It only appears that way. That end of main thing makes allegro turn it into winmain and compile correctly. Just gotta trust me, its a windows app.
I would write winmain with all its weird arguments and define something like ALLEGRO_NO_MAIN_MAGIC and it would work the same.
Just pretend it says winmain()