physics_restitution.js 1.2 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346
  1. // The Module object: Our interface to the outside world. We import
  2. // and export values on it, and do the work to get that through
  3. // closure compiler if necessary. There are various ways Module can be used:
  4. // 1. Not defined. We create it here
  5. // 2. A function parameter, function(Module) { ..generated code.. }
  6. // 3. pre-run appended it, var Module = {}; ..generated code..
  7. // 4. External script tag defines var Module.
  8. // We need to do an eval in order to handle the closure compiler
  9. // case, where this code here is minified but Module was defined
  10. // elsewhere (e.g. case 4 above). We also need to check if Module
  11. // already exists (e.g. case 3 above).
  12. // Note that if you want to run closure, and also to use Module
  13. // after the generated code, you will need to define var Module = {};
  14. // before the code. Then that object will be used in the code, and you
  15. // can continue to use Module afterwards as well.
  16. var Module;
  17. if (!Module) Module = (typeof Module !== 'undefined' ? Module : null) || {};
  18. // Sometimes an existing Module object exists with properties
  19. // meant to overwrite the default module functionality. Here
  20. // we collect those properties and reapply _after_ we configure
  21. // the current environment's defaults to avoid having to be so
  22. // defensive during initialization.
  23. var moduleOverrides = {};
  24. for (var key in Module) {
  25. if (Module.hasOwnProperty(key)) {
  26. moduleOverrides[key] = Module[key];
  27. }
  28. }
  29. // The environment setup code below is customized to use Module.
  30. // *** Environment setup code ***
  31. var ENVIRONMENT_IS_WEB = false;
  32. var ENVIRONMENT_IS_WORKER = false;
  33. var ENVIRONMENT_IS_NODE = false;
  34. var ENVIRONMENT_IS_SHELL = false;
  35. // Three configurations we can be running in:
  36. // 1) We could be the application main() thread running in the main JS UI thread. (ENVIRONMENT_IS_WORKER == false and ENVIRONMENT_IS_PTHREAD == false)
  37. // 2) We could be the application main() thread proxied to worker. (with Emscripten -s PROXY_TO_WORKER=1) (ENVIRONMENT_IS_WORKER == true, ENVIRONMENT_IS_PTHREAD == false)
  38. // 3) We could be an application pthread running in a worker. (ENVIRONMENT_IS_WORKER == true and ENVIRONMENT_IS_PTHREAD == true)
  39. if (Module['ENVIRONMENT']) {
  40. if (Module['ENVIRONMENT'] === 'WEB') {
  41. ENVIRONMENT_IS_WEB = true;
  42. } else if (Module['ENVIRONMENT'] === 'WORKER') {
  43. ENVIRONMENT_IS_WORKER = true;
  44. } else if (Module['ENVIRONMENT'] === 'NODE') {
  45. ENVIRONMENT_IS_NODE = true;
  46. } else if (Module['ENVIRONMENT'] === 'SHELL') {
  47. ENVIRONMENT_IS_SHELL = true;
  48. } else {
  49. throw new Error('The provided Module[\'ENVIRONMENT\'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.');
  50. }
  51. } else {
  52. ENVIRONMENT_IS_WEB = typeof window === 'object';
  53. ENVIRONMENT_IS_WORKER = typeof importScripts === 'function';
  54. ENVIRONMENT_IS_NODE = typeof process === 'object' && typeof require === 'function' && !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_WORKER;
  55. ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;
  56. }
  57. var ENVIRONMENT_IS_PTHREAD;
  58. if (!ENVIRONMENT_IS_PTHREAD) ENVIRONMENT_IS_PTHREAD = false; // ENVIRONMENT_IS_PTHREAD=true will have been preset in pthread-main.js. Make it false in the main runtime thread.
  59. var PthreadWorkerInit; // Collects together variables that are needed at initialization time for the web workers that host pthreads.
  60. if (!ENVIRONMENT_IS_PTHREAD) PthreadWorkerInit = {};
  61. var currentScriptUrl = ENVIRONMENT_IS_WORKER ? undefined : document.currentScript.src;
  62. if (ENVIRONMENT_IS_NODE) {
  63. // Expose functionality in the same simple way that the shells work
  64. // Note that we pollute the global namespace here, otherwise we break in node
  65. if (!Module['print']) Module['print'] = console.log;
  66. if (!Module['printErr']) Module['printErr'] = console.warn;
  67. var nodeFS;
  68. var nodePath;
  69. Module['read'] = function read(filename, binary) {
  70. if (!nodeFS) nodeFS = require('fs');
  71. if (!nodePath) nodePath = require('path');
  72. filename = nodePath['normalize'](filename);
  73. var ret = nodeFS['readFileSync'](filename);
  74. return binary ? ret : ret.toString();
  75. };
  76. Module['readBinary'] = function readBinary(filename) {
  77. var ret = Module['read'](filename, true);
  78. if (!ret.buffer) {
  79. ret = new Uint8Array(ret);
  80. }
  81. assert(ret.buffer);
  82. return ret;
  83. };
  84. Module['load'] = function load(f) {
  85. globalEval(read(f));
  86. };
  87. if (!Module['thisProgram']) {
  88. if (process['argv'].length > 1) {
  89. Module['thisProgram'] = process['argv'][1].replace(/\\/g, '/');
  90. } else {
  91. Module['thisProgram'] = 'unknown-program';
  92. }
  93. }
  94. Module['arguments'] = process['argv'].slice(2);
  95. if (typeof module !== 'undefined') {
  96. module['exports'] = Module;
  97. }
  98. process['on']('uncaughtException', function(ex) {
  99. // suppress ExitStatus exceptions from showing an error
  100. if (!(ex instanceof ExitStatus)) {
  101. throw ex;
  102. }
  103. });
  104. Module['inspect'] = function () { return '[Emscripten Module object]'; };
  105. }
  106. else if (ENVIRONMENT_IS_SHELL) {
  107. if (!Module['print']) Module['print'] = print;
  108. if (typeof printErr != 'undefined') Module['printErr'] = printErr; // not present in v8 or older sm
  109. if (typeof read != 'undefined') {
  110. Module['read'] = read;
  111. } else {
  112. Module['read'] = function read() { throw 'no read() available' };
  113. }
  114. Module['readBinary'] = function readBinary(f) {
  115. if (typeof readbuffer === 'function') {
  116. return new Uint8Array(readbuffer(f));
  117. }
  118. var data = read(f, 'binary');
  119. assert(typeof data === 'object');
  120. return data;
  121. };
  122. if (typeof scriptArgs != 'undefined') {
  123. Module['arguments'] = scriptArgs;
  124. } else if (typeof arguments != 'undefined') {
  125. Module['arguments'] = arguments;
  126. }
  127. if (typeof quit === 'function') {
  128. Module['quit'] = function(status, toThrow) {
  129. quit(status);
  130. }
  131. }
  132. }
  133. else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
  134. Module['read'] = function read(url) {
  135. var xhr = new XMLHttpRequest();
  136. xhr.open('GET', url, false);
  137. xhr.send(null);
  138. return xhr.responseText;
  139. };
  140. if (ENVIRONMENT_IS_WORKER) {
  141. Module['readBinary'] = function read(url) {
  142. var xhr = new XMLHttpRequest();
  143. xhr.open('GET', url, false);
  144. xhr.responseType = 'arraybuffer';
  145. xhr.send(null);
  146. return xhr.response;
  147. };
  148. }
  149. Module['readAsync'] = function readAsync(url, onload, onerror) {
  150. var xhr = new XMLHttpRequest();
  151. xhr.open('GET', url, true);
  152. xhr.responseType = 'arraybuffer';
  153. xhr.onload = function xhr_onload() {
  154. if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
  155. onload(xhr.response);
  156. } else {
  157. onerror();
  158. }
  159. };
  160. xhr.onerror = onerror;
  161. xhr.send(null);
  162. };
  163. if (typeof arguments != 'undefined') {
  164. Module['arguments'] = arguments;
  165. }
  166. if (typeof console !== 'undefined') {
  167. if (!Module['print']) Module['print'] = function print(x) {
  168. console.log(x);
  169. };
  170. if (!Module['printErr']) Module['printErr'] = function printErr(x) {
  171. console.warn(x);
  172. };
  173. } else {
  174. // Probably a worker, and without console.log. We can do very little here...
  175. var TRY_USE_DUMP = false;
  176. if (!Module['print']) Module['print'] = (TRY_USE_DUMP && (typeof(dump) !== "undefined") ? (function(x) {
  177. dump(x);
  178. }) : (function(x) {
  179. // self.postMessage(x); // enable this if you want stdout to be sent as messages
  180. }));
  181. }
  182. if (ENVIRONMENT_IS_WORKER) {
  183. Module['load'] = importScripts;
  184. }
  185. if (typeof Module['setWindowTitle'] === 'undefined') {
  186. Module['setWindowTitle'] = function(title) { document.title = title };
  187. }
  188. }
  189. else {
  190. // Unreachable because SHELL is dependant on the others
  191. throw 'Unknown runtime environment. Where are we?';
  192. }
  193. function globalEval(x) {
  194. eval.call(null, x);
  195. }
  196. if (!Module['load'] && Module['read']) {
  197. Module['load'] = function load(f) {
  198. globalEval(Module['read'](f));
  199. };
  200. }
  201. if (!Module['print']) {
  202. Module['print'] = function(){};
  203. }
  204. if (!Module['printErr']) {
  205. Module['printErr'] = Module['print'];
  206. }
  207. if (!Module['arguments']) {
  208. Module['arguments'] = [];
  209. }
  210. if (!Module['thisProgram']) {
  211. Module['thisProgram'] = './this.program';
  212. }
  213. if (!Module['quit']) {
  214. Module['quit'] = function(status, toThrow) {
  215. throw toThrow;
  216. }
  217. }
  218. // *** Environment setup code ***
  219. // Closure helpers
  220. Module.print = Module['print'];
  221. Module.printErr = Module['printErr'];
  222. // Callbacks
  223. Module['preRun'] = [];
  224. Module['postRun'] = [];
  225. // Merge back in the overrides
  226. for (var key in moduleOverrides) {
  227. if (moduleOverrides.hasOwnProperty(key)) {
  228. Module[key] = moduleOverrides[key];
  229. }
  230. }
  231. // Free the object hierarchy contained in the overrides, this lets the GC
  232. // reclaim data used e.g. in memoryInitializerRequest, which is a large typed array.
  233. moduleOverrides = undefined;
  234. // {{PREAMBLE_ADDITIONS}}
  235. // === Preamble library stuff ===
  236. // Documentation for the public APIs defined in this file must be updated in:
  237. // site/source/docs/api_reference/preamble.js.rst
  238. // A prebuilt local version of the documentation is available at:
  239. // site/build/text/docs/api_reference/preamble.js.txt
  240. // You can also build docs locally as HTML or other formats in site/
  241. // An online HTML version (which may be of a different version of Emscripten)
  242. // is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html
  243. //========================================
  244. // Runtime code shared with compiler
  245. //========================================
  246. var Runtime = {
  247. setTempRet0: function (value) {
  248. tempRet0 = value;
  249. return value;
  250. },
  251. getTempRet0: function () {
  252. return tempRet0;
  253. },
  254. stackSave: function () {
  255. return STACKTOP;
  256. },
  257. stackRestore: function (stackTop) {
  258. STACKTOP = stackTop;
  259. },
  260. getNativeTypeSize: function (type) {
  261. switch (type) {
  262. case 'i1': case 'i8': return 1;
  263. case 'i16': return 2;
  264. case 'i32': return 4;
  265. case 'i64': return 8;
  266. case 'float': return 4;
  267. case 'double': return 8;
  268. default: {
  269. if (type[type.length-1] === '*') {
  270. return Runtime.QUANTUM_SIZE; // A pointer
  271. } else if (type[0] === 'i') {
  272. var bits = parseInt(type.substr(1));
  273. assert(bits % 8 === 0);
  274. return bits/8;
  275. } else {
  276. return 0;
  277. }
  278. }
  279. }
  280. },
  281. getNativeFieldSize: function (type) {
  282. return Math.max(Runtime.getNativeTypeSize(type), Runtime.QUANTUM_SIZE);
  283. },
  284. STACK_ALIGN: 16,
  285. prepVararg: function (ptr, type) {
  286. if (type === 'double' || type === 'i64') {
  287. // move so the load is aligned
  288. if (ptr & 7) {
  289. assert((ptr & 7) === 4);
  290. ptr += 4;
  291. }
  292. } else {
  293. assert((ptr & 3) === 0);
  294. }
  295. return ptr;
  296. },
  297. getAlignSize: function (type, size, vararg) {
  298. // we align i64s and doubles on 64-bit boundaries, unlike x86
  299. if (!vararg && (type == 'i64' || type == 'double')) return 8;
  300. if (!type) return Math.min(size, 8); // align structures internally to 64 bits
  301. return Math.min(size || (type ? Runtime.getNativeFieldSize(type) : 0), Runtime.QUANTUM_SIZE);
  302. },
  303. dynCall: function (sig, ptr, args) {
  304. if (args && args.length) {
  305. assert(args.length == sig.length-1);
  306. assert(('dynCall_' + sig) in Module, 'bad function pointer type - no table for sig \'' + sig + '\'');
  307. return Module['dynCall_' + sig].apply(null, [ptr].concat(args));
  308. } else {
  309. assert(sig.length == 1);
  310. assert(('dynCall_' + sig) in Module, 'bad function pointer type - no table for sig \'' + sig + '\'');
  311. return Module['dynCall_' + sig].call(null, ptr);
  312. }
  313. },
  314. functionPointers: [],
  315. addFunction: function (func) {
  316. for (var i = 0; i < Runtime.functionPointers.length; i++) {
  317. if (!Runtime.functionPointers[i]) {
  318. Runtime.functionPointers[i] = func;
  319. return 2*(1 + i);
  320. }
  321. }
  322. throw 'Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.';
  323. },
  324. removeFunction: function (index) {
  325. Runtime.functionPointers[(index-2)/2] = null;
  326. },
  327. warnOnce: function (text) {
  328. if (!Runtime.warnOnce.shown) Runtime.warnOnce.shown = {};
  329. if (!Runtime.warnOnce.shown[text]) {
  330. Runtime.warnOnce.shown[text] = 1;
  331. Module.printErr(text);
  332. }
  333. },
  334. funcWrappers: {},
  335. getFuncWrapper: function (func, sig) {
  336. assert(sig);
  337. if (!Runtime.funcWrappers[sig]) {
  338. Runtime.funcWrappers[sig] = {};
  339. }
  340. var sigCache = Runtime.funcWrappers[sig];
  341. if (!sigCache[func]) {
  342. // optimize away arguments usage in common cases
  343. if (sig.length === 1) {
  344. sigCache[func] = function dynCall_wrapper() {
  345. return Runtime.dynCall(sig, func);
  346. };
  347. } else if (sig.length === 2) {
  348. sigCache[func] = function dynCall_wrapper(arg) {
  349. return Runtime.dynCall(sig, func, [arg]);
  350. };
  351. } else {
  352. // general case
  353. sigCache[func] = function dynCall_wrapper() {
  354. return Runtime.dynCall(sig, func, Array.prototype.slice.call(arguments));
  355. };
  356. }
  357. }
  358. return sigCache[func];
  359. },
  360. getCompilerSetting: function (name) {
  361. throw 'You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work';
  362. },
  363. stackAlloc: function (size) { var ret = STACKTOP;STACKTOP = (STACKTOP + size)|0;STACKTOP = (((STACKTOP)+15)&-16);(assert((((STACKTOP|0) < (STACK_MAX|0))|0))|0); return ret; },
  364. staticAlloc: function (size) { var ret = STATICTOP;STATICTOP = (STATICTOP + (assert(!staticSealed),size))|0;STATICTOP = (((STATICTOP)+15)&-16); return ret; },
  365. dynamicAlloc: function (size) { assert(DYNAMICTOP_PTR);var ret = HEAP32[DYNAMICTOP_PTR>>2];var end = (((ret + size + 15)|0) & -16);HEAP32[DYNAMICTOP_PTR>>2] = end;if (end >= TOTAL_MEMORY) {var success = enlargeMemory();if (!success) {HEAP32[DYNAMICTOP_PTR>>2] = ret;return 0;}}return ret;},
  366. alignMemory: function (size,quantum) { var ret = size = Math.ceil((size)/(quantum ? quantum : 16))*(quantum ? quantum : 16); return ret; },
  367. makeBigInt: function (low,high,unsigned) { var ret = (unsigned ? ((+((low>>>0)))+((+((high>>>0)))*4294967296.0)) : ((+((low>>>0)))+((+((high|0)))*4294967296.0))); return ret; },
  368. GLOBAL_BASE: 8,
  369. QUANTUM_SIZE: 4,
  370. __dummy__: 0
  371. }
  372. Module["Runtime"] = Runtime;
  373. //========================================
  374. // Runtime essentials
  375. //========================================
  376. var ABORT = 0; // whether we are quitting the application. no code should run after this. set in exit() and abort()
  377. var EXITSTATUS = 0;
  378. function assert(condition, text) {
  379. if (!condition) {
  380. abort('Assertion failed: ' + text);
  381. }
  382. }
  383. var globalScope = this;
  384. // Returns the C function with a specified identifier (for C++, you need to do manual name mangling)
  385. function getCFunc(ident) {
  386. var func = Module['_' + ident]; // closure exported function
  387. if (!func) {
  388. try { func = eval('_' + ident); } catch(e) {}
  389. }
  390. assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)');
  391. return func;
  392. }
  393. var cwrap, ccall;
  394. (function(){
  395. var JSfuncs = {
  396. // Helpers for cwrap -- it can't refer to Runtime directly because it might
  397. // be renamed by closure, instead it calls JSfuncs['stackSave'].body to find
  398. // out what the minified function name is.
  399. 'stackSave': function() {
  400. Runtime.stackSave()
  401. },
  402. 'stackRestore': function() {
  403. Runtime.stackRestore()
  404. },
  405. // type conversion from js to c
  406. 'arrayToC' : function(arr) {
  407. var ret = Runtime.stackAlloc(arr.length);
  408. writeArrayToMemory(arr, ret);
  409. return ret;
  410. },
  411. 'stringToC' : function(str) {
  412. var ret = 0;
  413. if (str !== null && str !== undefined && str !== 0) { // null string
  414. // at most 4 bytes per UTF-8 code point, +1 for the trailing '\0'
  415. var len = (str.length << 2) + 1;
  416. ret = Runtime.stackAlloc(len);
  417. stringToUTF8(str, ret, len);
  418. }
  419. return ret;
  420. }
  421. };
  422. // For fast lookup of conversion functions
  423. var toC = {'string' : JSfuncs['stringToC'], 'array' : JSfuncs['arrayToC']};
  424. // C calling interface.
  425. ccall = function ccallFunc(ident, returnType, argTypes, args, opts) {
  426. var func = getCFunc(ident);
  427. var cArgs = [];
  428. var stack = 0;
  429. assert(returnType !== 'array', 'Return type should not be "array".');
  430. if (args) {
  431. for (var i = 0; i < args.length; i++) {
  432. var converter = toC[argTypes[i]];
  433. if (converter) {
  434. if (stack === 0) stack = Runtime.stackSave();
  435. cArgs[i] = converter(args[i]);
  436. } else {
  437. cArgs[i] = args[i];
  438. }
  439. }
  440. }
  441. var ret = func.apply(null, cArgs);
  442. if ((!opts || !opts.async) && typeof EmterpreterAsync === 'object') {
  443. assert(!EmterpreterAsync.state, 'cannot start async op with normal JS calling ccall');
  444. }
  445. if (opts && opts.async) assert(!returnType, 'async ccalls cannot return values');
  446. if (returnType === 'string') ret = Pointer_stringify(ret);
  447. if (stack !== 0) {
  448. if (opts && opts.async) {
  449. EmterpreterAsync.asyncFinalizers.push(function() {
  450. Runtime.stackRestore(stack);
  451. });
  452. return;
  453. }
  454. Runtime.stackRestore(stack);
  455. }
  456. return ret;
  457. }
  458. var sourceRegex = /^function\s*[a-zA-Z$_0-9]*\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/;
  459. function parseJSFunc(jsfunc) {
  460. // Match the body and the return value of a javascript function source
  461. var parsed = jsfunc.toString().match(sourceRegex).slice(1);
  462. return {arguments : parsed[0], body : parsed[1], returnValue: parsed[2]}
  463. }
  464. // sources of useful functions. we create this lazily as it can trigger a source decompression on this entire file
  465. var JSsource = null;
  466. function ensureJSsource() {
  467. if (!JSsource) {
  468. JSsource = {};
  469. for (var fun in JSfuncs) {
  470. if (JSfuncs.hasOwnProperty(fun)) {
  471. // Elements of toCsource are arrays of three items:
  472. // the code, and the return value
  473. JSsource[fun] = parseJSFunc(JSfuncs[fun]);
  474. }
  475. }
  476. }
  477. }
  478. cwrap = function cwrap(ident, returnType, argTypes) {
  479. argTypes = argTypes || [];
  480. var cfunc = getCFunc(ident);
  481. // When the function takes numbers and returns a number, we can just return
  482. // the original function
  483. var numericArgs = argTypes.every(function(type){ return type === 'number'});
  484. var numericRet = (returnType !== 'string');
  485. if ( numericRet && numericArgs) {
  486. return cfunc;
  487. }
  488. // Creation of the arguments list (["$1","$2",...,"$nargs"])
  489. var argNames = argTypes.map(function(x,i){return '$'+i});
  490. var funcstr = "(function(" + argNames.join(',') + ") {";
  491. var nargs = argTypes.length;
  492. if (!numericArgs) {
  493. // Generate the code needed to convert the arguments from javascript
  494. // values to pointers
  495. ensureJSsource();
  496. funcstr += 'var stack = ' + JSsource['stackSave'].body + ';';
  497. for (var i = 0; i < nargs; i++) {
  498. var arg = argNames[i], type = argTypes[i];
  499. if (type === 'number') continue;
  500. var convertCode = JSsource[type + 'ToC']; // [code, return]
  501. funcstr += 'var ' + convertCode.arguments + ' = ' + arg + ';';
  502. funcstr += convertCode.body + ';';
  503. funcstr += arg + '=(' + convertCode.returnValue + ');';
  504. }
  505. }
  506. // When the code is compressed, the name of cfunc is not literally 'cfunc' anymore
  507. var cfuncname = parseJSFunc(function(){return cfunc}).returnValue;
  508. // Call the function
  509. funcstr += 'var ret = ' + cfuncname + '(' + argNames.join(',') + ');';
  510. if (!numericRet) { // Return type can only by 'string' or 'number'
  511. // Convert the result to a string
  512. var strgfy = parseJSFunc(function(){return Pointer_stringify}).returnValue;
  513. funcstr += 'ret = ' + strgfy + '(ret);';
  514. }
  515. funcstr += "if (typeof EmterpreterAsync === 'object') { assert(!EmterpreterAsync.state, 'cannot start async op with normal JS calling cwrap') }";
  516. if (!numericArgs) {
  517. // If we had a stack, restore it
  518. ensureJSsource();
  519. funcstr += JSsource['stackRestore'].body.replace('()', '(stack)') + ';';
  520. }
  521. funcstr += 'return ret})';
  522. return eval(funcstr);
  523. };
  524. })();
  525. Module["ccall"] = ccall;
  526. Module["cwrap"] = cwrap;
  527. function setValue(ptr, value, type, noSafe) {
  528. type = type || 'i8';
  529. if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit
  530. switch(type) {
  531. case 'i1': HEAP8[((ptr)>>0)]=value; break;
  532. case 'i8': HEAP8[((ptr)>>0)]=value; break;
  533. case 'i16': HEAP16[((ptr)>>1)]=value; break;
  534. case 'i32': HEAP32[((ptr)>>2)]=value; break;
  535. case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? ((Math_min((+(Math_floor((tempDouble)/4294967296.0))), 4294967295.0))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;
  536. case 'float': HEAPF32[((ptr)>>2)]=value; break;
  537. case 'double': HEAPF64[((ptr)>>3)]=value; break;
  538. default: abort('invalid type for setValue: ' + type);
  539. }
  540. }
  541. Module["setValue"] = setValue;
  542. function getValue(ptr, type, noSafe) {
  543. type = type || 'i8';
  544. if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit
  545. switch(type) {
  546. case 'i1': return HEAP8[((ptr)>>0)];
  547. case 'i8': return HEAP8[((ptr)>>0)];
  548. case 'i16': return HEAP16[((ptr)>>1)];
  549. case 'i32': return HEAP32[((ptr)>>2)];
  550. case 'i64': return HEAP32[((ptr)>>2)];
  551. case 'float': return HEAPF32[((ptr)>>2)];
  552. case 'double': return HEAPF64[((ptr)>>3)];
  553. default: abort('invalid type for setValue: ' + type);
  554. }
  555. return null;
  556. }
  557. Module["getValue"] = getValue;
  558. var ALLOC_NORMAL = 0; // Tries to use _malloc()
  559. var ALLOC_STACK = 1; // Lives for the duration of the current function call
  560. var ALLOC_STATIC = 2; // Cannot be freed
  561. var ALLOC_DYNAMIC = 3; // Cannot be freed except through sbrk
  562. var ALLOC_NONE = 4; // Do not allocate
  563. Module["ALLOC_NORMAL"] = ALLOC_NORMAL;
  564. Module["ALLOC_STACK"] = ALLOC_STACK;
  565. Module["ALLOC_STATIC"] = ALLOC_STATIC;
  566. Module["ALLOC_DYNAMIC"] = ALLOC_DYNAMIC;
  567. Module["ALLOC_NONE"] = ALLOC_NONE;
  568. // allocate(): This is for internal use. You can use it yourself as well, but the interface
  569. // is a little tricky (see docs right below). The reason is that it is optimized
  570. // for multiple syntaxes to save space in generated code. So you should
  571. // normally not use allocate(), and instead allocate memory using _malloc(),
  572. // initialize it with setValue(), and so forth.
  573. // @slab: An array of data, or a number. If a number, then the size of the block to allocate,
  574. // in *bytes* (note that this is sometimes confusing: the next parameter does not
  575. // affect this!)
  576. // @types: Either an array of types, one for each byte (or 0 if no type at that position),
  577. // or a single type which is used for the entire block. This only matters if there
  578. // is initial data - if @slab is a number, then this does not matter at all and is
  579. // ignored.
  580. // @allocator: How to allocate memory, see ALLOC_*
  581. function allocate(slab, types, allocator, ptr) {
  582. var zeroinit, size;
  583. if (typeof slab === 'number') {
  584. zeroinit = true;
  585. size = slab;
  586. } else {
  587. zeroinit = false;
  588. size = slab.length;
  589. }
  590. var singleType = typeof types === 'string' ? types : null;
  591. var ret;
  592. if (allocator == ALLOC_NONE) {
  593. ret = ptr;
  594. } else {
  595. ret = [typeof _malloc === 'function' ? _malloc : Runtime.staticAlloc, Runtime.stackAlloc, Runtime.staticAlloc, Runtime.dynamicAlloc][allocator === undefined ? ALLOC_STATIC : allocator](Math.max(size, singleType ? 1 : types.length));
  596. }
  597. if (zeroinit) {
  598. var ptr = ret, stop;
  599. assert((ret & 3) == 0);
  600. stop = ret + (size & ~3);
  601. for (; ptr < stop; ptr += 4) {
  602. HEAP32[((ptr)>>2)]=0;
  603. }
  604. stop = ret + size;
  605. while (ptr < stop) {
  606. HEAP8[((ptr++)>>0)]=0;
  607. }
  608. return ret;
  609. }
  610. if (singleType === 'i8') {
  611. if (slab.subarray || slab.slice) {
  612. HEAPU8.set(slab, ret);
  613. } else {
  614. HEAPU8.set(new Uint8Array(slab), ret);
  615. }
  616. return ret;
  617. }
  618. var i = 0, type, typeSize, previousType;
  619. while (i < size) {
  620. var curr = slab[i];
  621. if (typeof curr === 'function') {
  622. curr = Runtime.getFunctionIndex(curr);
  623. }
  624. type = singleType || types[i];
  625. if (type === 0) {
  626. i++;
  627. continue;
  628. }
  629. assert(type, 'Must know what type to store in allocate!');
  630. if (type == 'i64') type = 'i32'; // special case: we have one i32 here, and one i32 later
  631. setValue(ret+i, curr, type);
  632. // no need to look up size unless type changes, so cache it
  633. if (previousType !== type) {
  634. typeSize = Runtime.getNativeTypeSize(type);
  635. previousType = type;
  636. }
  637. i += typeSize;
  638. }
  639. return ret;
  640. }
  641. Module["allocate"] = allocate;
  642. // Allocate memory during any stage of startup - static memory early on, dynamic memory later, malloc when ready
  643. function getMemory(size) {
  644. if (!staticSealed) return Runtime.staticAlloc(size);
  645. if (!runtimeInitialized) return Runtime.dynamicAlloc(size);
  646. return _malloc(size);
  647. }
  648. Module["getMemory"] = getMemory;
  649. function Pointer_stringify(ptr, /* optional */ length) {
  650. if (length === 0 || !ptr) return '';
  651. // TODO: use TextDecoder
  652. // Find the length, and check for UTF while doing so
  653. var hasUtf = 0;
  654. var t;
  655. var i = 0;
  656. while (1) {
  657. assert(ptr + i < TOTAL_MEMORY);
  658. t = HEAPU8[(((ptr)+(i))>>0)];
  659. hasUtf |= t;
  660. if (t == 0 && !length) break;
  661. i++;
  662. if (length && i == length) break;
  663. }
  664. if (!length) length = i;
  665. var ret = '';
  666. if (hasUtf < 128) {
  667. var MAX_CHUNK = 1024; // split up into chunks, because .apply on a huge string can overflow the stack
  668. var curr;
  669. while (length > 0) {
  670. curr = String.fromCharCode.apply(String, HEAPU8.subarray(ptr, ptr + Math.min(length, MAX_CHUNK)));
  671. ret = ret ? ret + curr : curr;
  672. ptr += MAX_CHUNK;
  673. length -= MAX_CHUNK;
  674. }
  675. return ret;
  676. }
  677. return Module['UTF8ToString'](ptr);
  678. }
  679. Module["Pointer_stringify"] = Pointer_stringify;
  680. // Given a pointer 'ptr' to a null-terminated ASCII-encoded string in the emscripten HEAP, returns
  681. // a copy of that string as a Javascript String object.
  682. function AsciiToString(ptr) {
  683. var str = '';
  684. while (1) {
  685. var ch = HEAP8[((ptr++)>>0)];
  686. if (!ch) return str;
  687. str += String.fromCharCode(ch);
  688. }
  689. }
  690. Module["AsciiToString"] = AsciiToString;
  691. // Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
  692. // null-terminated and encoded in ASCII form. The copy will require at most str.length+1 bytes of space in the HEAP.
  693. function stringToAscii(str, outPtr) {
  694. return writeAsciiToMemory(str, outPtr, false);
  695. }
  696. Module["stringToAscii"] = stringToAscii;
  697. // Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the given array that contains uint8 values, returns
  698. // a copy of that string as a Javascript String object.
  699. var UTF8Decoder = typeof TextDecoder !== 'undefined' ? new TextDecoder('utf8') : undefined;
  700. function UTF8ArrayToString(u8Array, idx) {
  701. var endPtr = idx;
  702. // TextDecoder needs to know the byte length in advance, it doesn't stop on null terminator by itself.
  703. // Also, use the length info to avoid running tiny strings through TextDecoder, since .subarray() allocates garbage.
  704. while (u8Array[endPtr]) ++endPtr;
  705. if (endPtr - idx > 16 && u8Array.subarray && UTF8Decoder) {
  706. return UTF8Decoder.decode(u8Array.subarray(idx, endPtr));
  707. } else {
  708. var u0, u1, u2, u3, u4, u5;
  709. var str = '';
  710. while (1) {
  711. // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629
  712. u0 = u8Array[idx++];
  713. if (!u0) return str;
  714. if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; }
  715. u1 = u8Array[idx++] & 63;
  716. if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; }
  717. u2 = u8Array[idx++] & 63;
  718. if ((u0 & 0xF0) == 0xE0) {
  719. u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;
  720. } else {
  721. u3 = u8Array[idx++] & 63;
  722. if ((u0 & 0xF8) == 0xF0) {
  723. u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | u3;
  724. } else {
  725. u4 = u8Array[idx++] & 63;
  726. if ((u0 & 0xFC) == 0xF8) {
  727. u0 = ((u0 & 3) << 24) | (u1 << 18) | (u2 << 12) | (u3 << 6) | u4;
  728. } else {
  729. u5 = u8Array[idx++] & 63;
  730. u0 = ((u0 & 1) << 30) | (u1 << 24) | (u2 << 18) | (u3 << 12) | (u4 << 6) | u5;
  731. }
  732. }
  733. }
  734. if (u0 < 0x10000) {
  735. str += String.fromCharCode(u0);
  736. } else {
  737. var ch = u0 - 0x10000;
  738. str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));
  739. }
  740. }
  741. }
  742. }
  743. Module["UTF8ArrayToString"] = UTF8ArrayToString;
  744. // Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the emscripten HEAP, returns
  745. // a copy of that string as a Javascript String object.
  746. function UTF8ToString(ptr) {
  747. return UTF8ArrayToString(HEAPU8,ptr);
  748. }
  749. Module["UTF8ToString"] = UTF8ToString;
  750. // Copies the given Javascript String object 'str' to the given byte array at address 'outIdx',
  751. // encoded in UTF8 form and null-terminated. The copy will require at most str.length*4+1 bytes of space in the HEAP.
  752. // Use the function lengthBytesUTF8 to compute the exact number of bytes (excluding null terminator) that this function will write.
  753. // Parameters:
  754. // str: the Javascript string to copy.
  755. // outU8Array: the array to copy to. Each index in this array is assumed to be one 8-byte element.
  756. // outIdx: The starting offset in the array to begin the copying.
  757. // maxBytesToWrite: The maximum number of bytes this function can write to the array. This count should include the null
  758. // terminator, i.e. if maxBytesToWrite=1, only the null terminator will be written and nothing else.
  759. // maxBytesToWrite=0 does not write any bytes to the output, not even the null terminator.
  760. // Returns the number of bytes written, EXCLUDING the null terminator.
  761. function stringToUTF8Array(str, outU8Array, outIdx, maxBytesToWrite) {
  762. if (!(maxBytesToWrite > 0)) // Parameter maxBytesToWrite is not optional. Negative values, 0, null, undefined and false each don't write out any bytes.
  763. return 0;
  764. var startIdx = outIdx;
  765. var endIdx = outIdx + maxBytesToWrite - 1; // -1 for string null terminator.
  766. for (var i = 0; i < str.length; ++i) {
  767. // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! So decode UTF16->UTF32->UTF8.
  768. // See http://unicode.org/faq/utf_bom.html#utf16-3
  769. // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629
  770. var u = str.charCodeAt(i); // possibly a lead surrogate
  771. if (u >= 0xD800 && u <= 0xDFFF) u = 0x10000 + ((u & 0x3FF) << 10) | (str.charCodeAt(++i) & 0x3FF);
  772. if (u <= 0x7F) {
  773. if (outIdx >= endIdx) break;
  774. outU8Array[outIdx++] = u;
  775. } else if (u <= 0x7FF) {
  776. if (outIdx + 1 >= endIdx) break;
  777. outU8Array[outIdx++] = 0xC0 | (u >> 6);
  778. outU8Array[outIdx++] = 0x80 | (u & 63);
  779. } else if (u <= 0xFFFF) {
  780. if (outIdx + 2 >= endIdx) break;
  781. outU8Array[outIdx++] = 0xE0 | (u >> 12);
  782. outU8Array[outIdx++] = 0x80 | ((u >> 6) & 63);
  783. outU8Array[outIdx++] = 0x80 | (u & 63);
  784. } else if (u <= 0x1FFFFF) {
  785. if (outIdx + 3 >= endIdx) break;
  786. outU8Array[outIdx++] = 0xF0 | (u >> 18);
  787. outU8Array[outIdx++] = 0x80 | ((u >> 12) & 63);
  788. outU8Array[outIdx++] = 0x80 | ((u >> 6) & 63);
  789. outU8Array[outIdx++] = 0x80 | (u & 63);
  790. } else if (u <= 0x3FFFFFF) {
  791. if (outIdx + 4 >= endIdx) break;
  792. outU8Array[outIdx++] = 0xF8 | (u >> 24);
  793. outU8Array[outIdx++] = 0x80 | ((u >> 18) & 63);
  794. outU8Array[outIdx++] = 0x80 | ((u >> 12) & 63);
  795. outU8Array[outIdx++] = 0x80 | ((u >> 6) & 63);
  796. outU8Array[outIdx++] = 0x80 | (u & 63);
  797. } else {
  798. if (outIdx + 5 >= endIdx) break;
  799. outU8Array[outIdx++] = 0xFC | (u >> 30);
  800. outU8Array[outIdx++] = 0x80 | ((u >> 24) & 63);
  801. outU8Array[outIdx++] = 0x80 | ((u >> 18) & 63);
  802. outU8Array[outIdx++] = 0x80 | ((u >> 12) & 63);
  803. outU8Array[outIdx++] = 0x80 | ((u >> 6) & 63);
  804. outU8Array[outIdx++] = 0x80 | (u & 63);
  805. }
  806. }
  807. // Null-terminate the pointer to the buffer.
  808. outU8Array[outIdx] = 0;
  809. return outIdx - startIdx;
  810. }
  811. Module["stringToUTF8Array"] = stringToUTF8Array;
  812. // Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
  813. // null-terminated and encoded in UTF8 form. The copy will require at most str.length*4+1 bytes of space in the HEAP.
  814. // Use the function lengthBytesUTF8 to compute the exact number of bytes (excluding null terminator) that this function will write.
  815. // Returns the number of bytes written, EXCLUDING the null terminator.
  816. function stringToUTF8(str, outPtr, maxBytesToWrite) {
  817. assert(typeof maxBytesToWrite == 'number', 'stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');
  818. return stringToUTF8Array(str, HEAPU8,outPtr, maxBytesToWrite);
  819. }
  820. Module["stringToUTF8"] = stringToUTF8;
  821. // Returns the number of bytes the given Javascript string takes if encoded as a UTF8 byte array, EXCLUDING the null terminator byte.
  822. function lengthBytesUTF8(str) {
  823. var len = 0;
  824. for (var i = 0; i < str.length; ++i) {
  825. // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! So decode UTF16->UTF32->UTF8.
  826. // See http://unicode.org/faq/utf_bom.html#utf16-3
  827. var u = str.charCodeAt(i); // possibly a lead surrogate
  828. if (u >= 0xD800 && u <= 0xDFFF) u = 0x10000 + ((u & 0x3FF) << 10) | (str.charCodeAt(++i) & 0x3FF);
  829. if (u <= 0x7F) {
  830. ++len;
  831. } else if (u <= 0x7FF) {
  832. len += 2;
  833. } else if (u <= 0xFFFF) {
  834. len += 3;
  835. } else if (u <= 0x1FFFFF) {
  836. len += 4;
  837. } else if (u <= 0x3FFFFFF) {
  838. len += 5;
  839. } else {
  840. len += 6;
  841. }
  842. }
  843. return len;
  844. }
  845. Module["lengthBytesUTF8"] = lengthBytesUTF8;
  846. // Given a pointer 'ptr' to a null-terminated UTF16LE-encoded string in the emscripten HEAP, returns
  847. // a copy of that string as a Javascript String object.
  848. var UTF16Decoder = typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-16le') : undefined;
  849. function UTF16ToString(ptr) {
  850. assert(ptr % 2 == 0, 'Pointer passed to UTF16ToString must be aligned to two bytes!');
  851. var endPtr = ptr;
  852. // TextDecoder needs to know the byte length in advance, it doesn't stop on null terminator by itself.
  853. // Also, use the length info to avoid running tiny strings through TextDecoder, since .subarray() allocates garbage.
  854. var idx = endPtr >> 1;
  855. while (HEAP16[idx]) ++idx;
  856. endPtr = idx << 1;
  857. if (endPtr - ptr > 32 && UTF16Decoder) {
  858. return UTF16Decoder.decode(HEAPU8.subarray(ptr, endPtr));
  859. } else {
  860. var i = 0;
  861. var str = '';
  862. while (1) {
  863. var codeUnit = HEAP16[(((ptr)+(i*2))>>1)];
  864. if (codeUnit == 0) return str;
  865. ++i;
  866. // fromCharCode constructs a character from a UTF-16 code unit, so we can pass the UTF16 string right through.
  867. str += String.fromCharCode(codeUnit);
  868. }
  869. }
  870. }
  871. // Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
  872. // null-terminated and encoded in UTF16 form. The copy will require at most str.length*4+2 bytes of space in the HEAP.
  873. // Use the function lengthBytesUTF16() to compute the exact number of bytes (excluding null terminator) that this function will write.
  874. // Parameters:
  875. // str: the Javascript string to copy.
  876. // outPtr: Byte address in Emscripten HEAP where to write the string to.
  877. // maxBytesToWrite: The maximum number of bytes this function can write to the array. This count should include the null
  878. // terminator, i.e. if maxBytesToWrite=2, only the null terminator will be written and nothing else.
  879. // maxBytesToWrite<2 does not write any bytes to the output, not even the null terminator.
  880. // Returns the number of bytes written, EXCLUDING the null terminator.
  881. function stringToUTF16(str, outPtr, maxBytesToWrite) {
  882. assert(outPtr % 2 == 0, 'Pointer passed to stringToUTF16 must be aligned to two bytes!');
  883. assert(typeof maxBytesToWrite == 'number', 'stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');
  884. // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed.
  885. if (maxBytesToWrite === undefined) {
  886. maxBytesToWrite = 0x7FFFFFFF;
  887. }
  888. if (maxBytesToWrite < 2) return 0;
  889. maxBytesToWrite -= 2; // Null terminator.
  890. var startPtr = outPtr;
  891. var numCharsToWrite = (maxBytesToWrite < str.length*2) ? (maxBytesToWrite / 2) : str.length;
  892. for (var i = 0; i < numCharsToWrite; ++i) {
  893. // charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP.
  894. var codeUnit = str.charCodeAt(i); // possibly a lead surrogate
  895. HEAP16[((outPtr)>>1)]=codeUnit;
  896. outPtr += 2;
  897. }
  898. // Null-terminate the pointer to the HEAP.
  899. HEAP16[((outPtr)>>1)]=0;
  900. return outPtr - startPtr;
  901. }
  902. // Returns the number of bytes the given Javascript string takes if encoded as a UTF16 byte array, EXCLUDING the null terminator byte.
  903. function lengthBytesUTF16(str) {
  904. return str.length*2;
  905. }
  906. function UTF32ToString(ptr) {
  907. assert(ptr % 4 == 0, 'Pointer passed to UTF32ToString must be aligned to four bytes!');
  908. var i = 0;
  909. var str = '';
  910. while (1) {
  911. var utf32 = HEAP32[(((ptr)+(i*4))>>2)];
  912. if (utf32 == 0)
  913. return str;
  914. ++i;
  915. // Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not from a Unicode code point! So encode the code point to UTF-16 for constructing.
  916. // See http://unicode.org/faq/utf_bom.html#utf16-3
  917. if (utf32 >= 0x10000) {
  918. var ch = utf32 - 0x10000;
  919. str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));
  920. } else {
  921. str += String.fromCharCode(utf32);
  922. }
  923. }
  924. }
  925. // Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
  926. // null-terminated and encoded in UTF32 form. The copy will require at most str.length*4+4 bytes of space in the HEAP.
  927. // Use the function lengthBytesUTF32() to compute the exact number of bytes (excluding null terminator) that this function will write.
  928. // Parameters:
  929. // str: the Javascript string to copy.
  930. // outPtr: Byte address in Emscripten HEAP where to write the string to.
  931. // maxBytesToWrite: The maximum number of bytes this function can write to the array. This count should include the null
  932. // terminator, i.e. if maxBytesToWrite=4, only the null terminator will be written and nothing else.
  933. // maxBytesToWrite<4 does not write any bytes to the output, not even the null terminator.
  934. // Returns the number of bytes written, EXCLUDING the null terminator.
  935. function stringToUTF32(str, outPtr, maxBytesToWrite) {
  936. assert(outPtr % 4 == 0, 'Pointer passed to stringToUTF32 must be aligned to four bytes!');
  937. assert(typeof maxBytesToWrite == 'number', 'stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');
  938. // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed.
  939. if (maxBytesToWrite === undefined) {
  940. maxBytesToWrite = 0x7FFFFFFF;
  941. }
  942. if (maxBytesToWrite < 4) return 0;
  943. var startPtr = outPtr;
  944. var endPtr = startPtr + maxBytesToWrite - 4;
  945. for (var i = 0; i < str.length; ++i) {
  946. // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.
  947. // See http://unicode.org/faq/utf_bom.html#utf16-3
  948. var codeUnit = str.charCodeAt(i); // possibly a lead surrogate
  949. if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) {
  950. var trailSurrogate = str.charCodeAt(++i);
  951. codeUnit = 0x10000 + ((codeUnit & 0x3FF) << 10) | (trailSurrogate & 0x3FF);
  952. }
  953. HEAP32[((outPtr)>>2)]=codeUnit;
  954. outPtr += 4;
  955. if (outPtr + 4 > endPtr) break;
  956. }
  957. // Null-terminate the pointer to the HEAP.
  958. HEAP32[((outPtr)>>2)]=0;
  959. return outPtr - startPtr;
  960. }
  961. // Returns the number of bytes the given Javascript string takes if encoded as a UTF16 byte array, EXCLUDING the null terminator byte.
  962. function lengthBytesUTF32(str) {
  963. var len = 0;
  964. for (var i = 0; i < str.length; ++i) {
  965. // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.
  966. // See http://unicode.org/faq/utf_bom.html#utf16-3
  967. var codeUnit = str.charCodeAt(i);
  968. if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) ++i; // possibly a lead surrogate, so skip over the tail surrogate.
  969. len += 4;
  970. }
  971. return len;
  972. }
  973. function demangle(func) {
  974. var __cxa_demangle_func = Module['___cxa_demangle'] || Module['__cxa_demangle'];
  975. if (__cxa_demangle_func) {
  976. try {
  977. var s =
  978. func.substr(1);
  979. var len = lengthBytesUTF8(s)+1;
  980. var buf = _malloc(len);
  981. stringToUTF8(s, buf, len);
  982. var status = _malloc(4);
  983. var ret = __cxa_demangle_func(buf, 0, 0, status);
  984. if (getValue(status, 'i32') === 0 && ret) {
  985. return Pointer_stringify(ret);
  986. }
  987. // otherwise, libcxxabi failed
  988. } catch(e) {
  989. // ignore problems here
  990. } finally {
  991. if (buf) _free(buf);
  992. if (status) _free(status);
  993. if (ret) _free(ret);
  994. }
  995. // failure when using libcxxabi, don't demangle
  996. return func;
  997. }
  998. Runtime.warnOnce('warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling');
  999. return func;
  1000. }
  1001. function demangleAll(text) {
  1002. var regex =
  1003. /__Z[\w\d_]+/g;
  1004. return text.replace(regex,
  1005. function(x) {
  1006. var y = demangle(x);
  1007. return x === y ? x : (x + ' [' + y + ']');
  1008. });
  1009. }
  1010. function jsStackTrace() {
  1011. var err = new Error();
  1012. if (!err.stack) {
  1013. // IE10+ special cases: It does have callstack info, but it is only populated if an Error object is thrown,
  1014. // so try that as a special-case.
  1015. try {
  1016. throw new Error(0);
  1017. } catch(e) {
  1018. err = e;
  1019. }
  1020. if (!err.stack) {
  1021. return '(no stack trace available)';
  1022. }
  1023. }
  1024. return err.stack.toString();
  1025. }
  1026. function stackTrace() {
  1027. var js = jsStackTrace();
  1028. if (Module['extraStackTrace']) js += '\n' + Module['extraStackTrace']();
  1029. return demangleAll(js);
  1030. }
  1031. Module["stackTrace"] = stackTrace;
  1032. // Memory management
  1033. var PAGE_SIZE = 16384;
  1034. var WASM_PAGE_SIZE = 65536;
  1035. var ASMJS_PAGE_SIZE = 16777216;
  1036. var MIN_TOTAL_MEMORY = 16777216;
  1037. function alignUp(x, multiple) {
  1038. if (x % multiple > 0) {
  1039. x += multiple - (x % multiple);
  1040. }
  1041. return x;
  1042. }
  1043. var HEAP;
  1044. var buffer;
  1045. var HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;
  1046. function updateGlobalBuffer(buf) {
  1047. Module['buffer'] = buffer = buf;
  1048. }
  1049. function updateGlobalBufferViews() {
  1050. Module['HEAP8'] = HEAP8 = new Int8Array(buffer);
  1051. Module['HEAP16'] = HEAP16 = new Int16Array(buffer);
  1052. Module['HEAP32'] = HEAP32 = new Int32Array(buffer);
  1053. Module['HEAPU8'] = HEAPU8 = new Uint8Array(buffer);
  1054. Module['HEAPU16'] = HEAPU16 = new Uint16Array(buffer);
  1055. Module['HEAPU32'] = HEAPU32 = new Uint32Array(buffer);
  1056. Module['HEAPF32'] = HEAPF32 = new Float32Array(buffer);
  1057. Module['HEAPF64'] = HEAPF64 = new Float64Array(buffer);
  1058. }
  1059. var STATIC_BASE, STATICTOP, staticSealed; // static area
  1060. var STACK_BASE, STACKTOP, STACK_MAX; // stack area
  1061. var DYNAMIC_BASE, DYNAMICTOP_PTR; // dynamic area handled by sbrk
  1062. if (!ENVIRONMENT_IS_PTHREAD) { // Pthreads have already initialized these variables in src/pthread-main.js, where they were passed to the thread worker at startup time
  1063. STATIC_BASE = STATICTOP = STACK_BASE = STACKTOP = STACK_MAX = DYNAMIC_BASE = DYNAMICTOP_PTR = 0;
  1064. staticSealed = false;
  1065. }
  1066. if (ENVIRONMENT_IS_PTHREAD) {
  1067. staticSealed = true; // The static memory area has been initialized already in the main thread, pthreads skip this.
  1068. }
  1069. // Initializes the stack cookie. Called at the startup of main and at the startup of each thread in pthreads mode.
  1070. function writeStackCookie() {
  1071. assert((STACK_MAX & 3) == 0);
  1072. HEAPU32[(STACK_MAX >> 2)-1] = 0x02135467;
  1073. HEAPU32[(STACK_MAX >> 2)-2] = 0x89BACDFE;
  1074. }
  1075. function checkStackCookie() {
  1076. if (HEAPU32[(STACK_MAX >> 2)-1] != 0x02135467 || HEAPU32[(STACK_MAX >> 2)-2] != 0x89BACDFE) {
  1077. abort('Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x02135467, but received 0x' + HEAPU32[(STACK_MAX >> 2)-2].toString(16) + ' ' + HEAPU32[(STACK_MAX >> 2)-1].toString(16));
  1078. }
  1079. // Also test the global address 0 for integrity. This check is not compatible with SAFE_SPLIT_MEMORY though, since that mode already tests all address 0 accesses on its own.
  1080. if (HEAP32[0] !== 0x63736d65 /* 'emsc' */) throw 'Runtime error: The application has corrupted its heap memory area (address zero)!';
  1081. }
  1082. function abortStackOverflow(allocSize) {
  1083. abort('Stack overflow! Attempted to allocate ' + allocSize + ' bytes on the stack, but stack has only ' + (STACK_MAX - asm.stackSave() + allocSize) + ' bytes available!');
  1084. }
  1085. function abortOnCannotGrowMemory() {
  1086. abort('Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value ' + TOTAL_MEMORY + ', (2) compile with -s ALLOW_MEMORY_GROWTH=1 which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ');
  1087. }
  1088. function enlargeMemory() {
  1089. abort('Cannot enlarge memory arrays, since compiling with pthreads support enabled (-s USE_PTHREADS=1).');
  1090. }
  1091. var TOTAL_STACK = Module['TOTAL_STACK'] || 5242880;
  1092. var TOTAL_MEMORY = Module['TOTAL_MEMORY'] || 16777216;
  1093. if (TOTAL_MEMORY < TOTAL_STACK) Module.printErr('TOTAL_MEMORY should be larger than TOTAL_STACK, was ' + TOTAL_MEMORY + '! (TOTAL_STACK=' + TOTAL_STACK + ')');
  1094. // Initialize the runtime's memory
  1095. // check for full engine support (use string 'subarray' to avoid closure compiler confusion)
  1096. assert(typeof Int32Array !== 'undefined' && typeof Float64Array !== 'undefined' && !!(new Int32Array(1)['subarray']) && !!(new Int32Array(1)['set']),
  1097. 'JS engine does not provide full typed array support');
  1098. if (typeof SharedArrayBuffer !== 'undefined') {
  1099. if (!ENVIRONMENT_IS_PTHREAD) buffer = new SharedArrayBuffer(TOTAL_MEMORY);
  1100. // Currently SharedArrayBuffer does not have a slice() operation, so polyfill it in.
  1101. // Adapted from https://github.com/ttaubert/node-arraybuffer-slice, (c) 2014 Tim Taubert <[email protected]>
  1102. // arraybuffer-slice may be freely distributed under the MIT license.
  1103. (function (undefined) {
  1104. "use strict";
  1105. function clamp(val, length) {
  1106. val = (val|0) || 0;
  1107. if (val < 0) return Math.max(val + length, 0);
  1108. return Math.min(val, length);
  1109. }
  1110. if (typeof SharedArrayBuffer !== 'undefined' && !SharedArrayBuffer.prototype.slice) {
  1111. SharedArrayBuffer.prototype.slice = function (from, to) {
  1112. var length = this.byteLength;
  1113. var begin = clamp(from, length);
  1114. var end = length;
  1115. if (to !== undefined) end = clamp(to, length);
  1116. if (begin > end) return new ArrayBuffer(0);
  1117. var num = end - begin;
  1118. var target = new ArrayBuffer(num);
  1119. var targetArray = new Uint8Array(target);
  1120. var sourceArray = new Uint8Array(this, begin, num);
  1121. targetArray.set(sourceArray);
  1122. return target;
  1123. };
  1124. }
  1125. })();
  1126. } else {
  1127. if (!ENVIRONMENT_IS_PTHREAD) buffer = new ArrayBuffer(TOTAL_MEMORY);
  1128. }
  1129. updateGlobalBufferViews();
  1130. if (typeof Atomics === 'undefined') {
  1131. // Polyfill singlethreaded atomics ops from http://lars-t-hansen.github.io/ecmascript_sharedmem/shmem.html#Atomics.add
  1132. // No thread-safety needed since we don't have multithreading support.
  1133. Atomics = {};
  1134. Atomics['add'] = function(t, i, v) { var w = t[i]; t[i] += v; return w; }
  1135. Atomics['and'] = function(t, i, v) { var w = t[i]; t[i] &= v; return w; }
  1136. Atomics['compareExchange'] = function(t, i, e, r) { var w = t[i]; if (w == e) t[i] = r; return w; }
  1137. Atomics['exchange'] = function(t, i, v) { var w = t[i]; t[i] = v; return w; }
  1138. Atomics['wait'] = function(t, i, v, o) { if (t[i] != v) return 'not-equal'; else return 'timed-out'; }
  1139. Atomics['wake'] = function(t, i, c) { return 0; }
  1140. Atomics['wakeOrRequeue'] = function(t, i1, c, i2, v) { return 0; }
  1141. Atomics['isLockFree'] = function(s) { return true; }
  1142. Atomics['load'] = function(t, i) { return t[i]; }
  1143. Atomics['or'] = function(t, i, v) { var w = t[i]; t[i] |= v; return w; }
  1144. Atomics['store'] = function(t, i, v) { t[i] = v; return v; }
  1145. Atomics['sub'] = function(t, i, v) { var w = t[i]; t[i] -= v; return w; }
  1146. Atomics['xor'] = function(t, i, v) { var w = t[i]; t[i] ^= v; return w; }
  1147. }
  1148. function getTotalMemory() {
  1149. return TOTAL_MEMORY;
  1150. }
  1151. // Endianness check (note: assumes compiler arch was little-endian)
  1152. if (!ENVIRONMENT_IS_PTHREAD) {
  1153. HEAP32[0] = 0x63736d65; /* 'emsc' */
  1154. } else {
  1155. if (HEAP32[0] !== 0x63736d65) throw 'Runtime error: The application has corrupted its heap memory area (address zero)!';
  1156. }
  1157. HEAP16[1] = 0x6373;
  1158. if (HEAPU8[2] !== 0x73 || HEAPU8[3] !== 0x63) throw 'Runtime error: expected the system to be little-endian!';
  1159. Module['HEAP'] = HEAP;
  1160. Module['buffer'] = buffer;
  1161. Module['HEAP8'] = HEAP8;
  1162. Module['HEAP16'] = HEAP16;
  1163. Module['HEAP32'] = HEAP32;
  1164. Module['HEAPU8'] = HEAPU8;
  1165. Module['HEAPU16'] = HEAPU16;
  1166. Module['HEAPU32'] = HEAPU32;
  1167. Module['HEAPF32'] = HEAPF32;
  1168. Module['HEAPF64'] = HEAPF64;
  1169. function callRuntimeCallbacks(callbacks) {
  1170. while(callbacks.length > 0) {
  1171. var callback = callbacks.shift();
  1172. if (typeof callback == 'function') {
  1173. callback();
  1174. continue;
  1175. }
  1176. var func = callback.func;
  1177. if (typeof func === 'number') {
  1178. if (callback.arg === undefined) {
  1179. Module['dynCall_v'](func);
  1180. } else {
  1181. Module['dynCall_vi'](func, callback.arg);
  1182. }
  1183. } else {
  1184. func(callback.arg === undefined ? null : callback.arg);
  1185. }
  1186. }
  1187. }
  1188. var __ATPRERUN__ = []; // functions called before the runtime is initialized
  1189. var __ATINIT__ = []; // functions called during startup
  1190. var __ATMAIN__ = []; // functions called when main() is to be run
  1191. var __ATEXIT__ = []; // functions called during shutdown
  1192. var __ATPOSTRUN__ = []; // functions called after the runtime has exited
  1193. var runtimeInitialized = false;
  1194. var runtimeExited = false;
  1195. if (ENVIRONMENT_IS_PTHREAD) runtimeInitialized = true; // The runtime is hosted in the main thread, and bits shared to pthreads via SharedArrayBuffer. No need to init again in pthread.
  1196. function preRun() {
  1197. if (ENVIRONMENT_IS_PTHREAD) return; // PThreads reuse the runtime from the main thread.
  1198. // compatibility - merge in anything from Module['preRun'] at this time
  1199. if (Module['preRun']) {
  1200. if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']];
  1201. while (Module['preRun'].length) {
  1202. addOnPreRun(Module['preRun'].shift());
  1203. }
  1204. }
  1205. callRuntimeCallbacks(__ATPRERUN__);
  1206. }
  1207. function ensureInitRuntime() {
  1208. checkStackCookie();
  1209. if (ENVIRONMENT_IS_PTHREAD) return; // PThreads reuse the runtime from the main thread.
  1210. if (runtimeInitialized) return;
  1211. runtimeInitialized = true;
  1212. callRuntimeCallbacks(__ATINIT__);
  1213. }
  1214. function preMain() {
  1215. checkStackCookie();
  1216. if (ENVIRONMENT_IS_PTHREAD) return; // PThreads reuse the runtime from the main thread.
  1217. callRuntimeCallbacks(__ATMAIN__);
  1218. }
  1219. function exitRuntime() {
  1220. checkStackCookie();
  1221. if (ENVIRONMENT_IS_PTHREAD) return; // PThreads reuse the runtime from the main thread.
  1222. callRuntimeCallbacks(__ATEXIT__);
  1223. runtimeExited = true;
  1224. }
  1225. function postRun() {
  1226. checkStackCookie();
  1227. if (ENVIRONMENT_IS_PTHREAD) return; // PThreads reuse the runtime from the main thread.
  1228. // compatibility - merge in anything from Module['postRun'] at this time
  1229. if (Module['postRun']) {
  1230. if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']];
  1231. while (Module['postRun'].length) {
  1232. addOnPostRun(Module['postRun'].shift());
  1233. }
  1234. }
  1235. callRuntimeCallbacks(__ATPOSTRUN__);
  1236. }
  1237. function addOnPreRun(cb) {
  1238. __ATPRERUN__.unshift(cb);
  1239. }
  1240. Module["addOnPreRun"] = addOnPreRun;
  1241. function addOnInit(cb) {
  1242. __ATINIT__.unshift(cb);
  1243. }
  1244. Module["addOnInit"] = addOnInit;
  1245. function addOnPreMain(cb) {
  1246. __ATMAIN__.unshift(cb);
  1247. }
  1248. Module["addOnPreMain"] = addOnPreMain;
  1249. function addOnExit(cb) {
  1250. __ATEXIT__.unshift(cb);
  1251. }
  1252. Module["addOnExit"] = addOnExit;
  1253. function addOnPostRun(cb) {
  1254. __ATPOSTRUN__.unshift(cb);
  1255. }
  1256. Module["addOnPostRun"] = addOnPostRun;
  1257. // Tools
  1258. function intArrayFromString(stringy, dontAddNull, length /* optional */) {
  1259. var len = length > 0 ? length : lengthBytesUTF8(stringy)+1;
  1260. var u8array = new Array(len);
  1261. var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length);
  1262. if (dontAddNull) u8array.length = numBytesWritten;
  1263. return u8array;
  1264. }
  1265. Module["intArrayFromString"] = intArrayFromString;
  1266. function intArrayToString(array) {
  1267. var ret = [];
  1268. for (var i = 0; i < array.length; i++) {
  1269. var chr = array[i];
  1270. if (chr > 0xFF) {
  1271. assert(false, 'Character code ' + chr + ' (' + String.fromCharCode(chr) + ') at offset ' + i + ' not in 0x00-0xFF.');
  1272. chr &= 0xFF;
  1273. }
  1274. ret.push(String.fromCharCode(chr));
  1275. }
  1276. return ret.join('');
  1277. }
  1278. Module["intArrayToString"] = intArrayToString;
  1279. // Deprecated: This function should not be called because it is unsafe and does not provide
  1280. // a maximum length limit of how many bytes it is allowed to write. Prefer calling the
  1281. // function stringToUTF8Array() instead, which takes in a maximum length that can be used
  1282. // to be secure from out of bounds writes.
  1283. function writeStringToMemory(string, buffer, dontAddNull) {
  1284. Runtime.warnOnce('writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!');
  1285. var lastChar, end;
  1286. if (dontAddNull) {
  1287. // stringToUTF8Array always appends null. If we don't want to do that, remember the
  1288. // character that existed at the location where the null will be placed, and restore
  1289. // that after the write (below).
  1290. end = buffer + lengthBytesUTF8(string);
  1291. lastChar = HEAP8[end];
  1292. }
  1293. stringToUTF8(string, buffer, Infinity);
  1294. if (dontAddNull) HEAP8[end] = lastChar; // Restore the value under the null character.
  1295. }
  1296. Module["writeStringToMemory"] = writeStringToMemory;
  1297. function writeArrayToMemory(array, buffer) {
  1298. assert(array.length >= 0, 'writeArrayToMemory array must have a length (should be an array or typed array)')
  1299. HEAP8.set(array, buffer);
  1300. }
  1301. Module["writeArrayToMemory"] = writeArrayToMemory;
  1302. function writeAsciiToMemory(str, buffer, dontAddNull) {
  1303. for (var i = 0; i < str.length; ++i) {
  1304. assert(str.charCodeAt(i) === str.charCodeAt(i)&0xff);
  1305. HEAP8[((buffer++)>>0)]=str.charCodeAt(i);
  1306. }
  1307. // Null-terminate the pointer to the HEAP.
  1308. if (!dontAddNull) HEAP8[((buffer)>>0)]=0;
  1309. }
  1310. Module["writeAsciiToMemory"] = writeAsciiToMemory;
  1311. function unSign(value, bits, ignore) {
  1312. if (value >= 0) {
  1313. return value;
  1314. }
  1315. return bits <= 32 ? 2*Math.abs(1 << (bits-1)) + value // Need some trickery, since if bits == 32, we are right at the limit of the bits JS uses in bitshifts
  1316. : Math.pow(2, bits) + value;
  1317. }
  1318. function reSign(value, bits, ignore) {
  1319. if (value <= 0) {
  1320. return value;
  1321. }
  1322. var half = bits <= 32 ? Math.abs(1 << (bits-1)) // abs is needed if bits == 32
  1323. : Math.pow(2, bits-1);
  1324. if (value >= half && (bits <= 32 || value > half)) { // for huge values, we can hit the precision limit and always get true here. so don't do that
  1325. // but, in general there is no perfect solution here. With 64-bit ints, we get rounding and errors
  1326. // TODO: In i64 mode 1, resign the two parts separately and safely
  1327. value = -2*half + value; // Cannot bitshift half, as it may be at the limit of the bits JS uses in bitshifts
  1328. }
  1329. return value;
  1330. }
  1331. // Atomics.exchange is not yet implemented in the spec, so polyfill that in via compareExchange in the meanwhile.
  1332. // TODO: Keep an eye out for the opportunity to remove this once Atomics.exchange is available.
  1333. if (typeof Atomics !== 'undefined' && !Atomics['exchange']) {
  1334. Atomics['exchange'] = function(heap, index, val) {
  1335. var oldVal, oldVal2;
  1336. do {
  1337. oldVal = Atomics['load'](heap, index);
  1338. oldVal2 = Atomics['compareExchange'](heap, index, oldVal, val);
  1339. } while(oldVal != oldVal2);
  1340. return oldVal;
  1341. }
  1342. }
  1343. // check for imul support, and also for correctness ( https://bugs.webkit.org/show_bug.cgi?id=126345 )
  1344. if (!Math['imul'] || Math['imul'](0xffffffff, 5) !== -5) Math['imul'] = function imul(a, b) {
  1345. var ah = a >>> 16;
  1346. var al = a & 0xffff;
  1347. var bh = b >>> 16;
  1348. var bl = b & 0xffff;
  1349. return (al*bl + ((ah*bl + al*bh) << 16))|0;
  1350. };
  1351. Math.imul = Math['imul'];
  1352. if (!Math['clz32']) Math['clz32'] = function(x) {
  1353. x = x >>> 0;
  1354. for (var i = 0; i < 32; i++) {
  1355. if (x & (1 << (31 - i))) return i;
  1356. }
  1357. return 32;
  1358. };
  1359. Math.clz32 = Math['clz32']
  1360. if (!Math['trunc']) Math['trunc'] = function(x) {
  1361. return x < 0 ? Math.ceil(x) : Math.floor(x);
  1362. };
  1363. Math.trunc = Math['trunc'];
  1364. var Math_abs = Math.abs;
  1365. var Math_cos = Math.cos;
  1366. var Math_sin = Math.sin;
  1367. var Math_tan = Math.tan;
  1368. var Math_acos = Math.acos;
  1369. var Math_asin = Math.asin;
  1370. var Math_atan = Math.atan;
  1371. var Math_atan2 = Math.atan2;
  1372. var Math_exp = Math.exp;
  1373. var Math_log = Math.log;
  1374. var Math_sqrt = Math.sqrt;
  1375. var Math_ceil = Math.ceil;
  1376. var Math_floor = Math.floor;
  1377. var Math_pow = Math.pow;
  1378. var Math_imul = Math.imul;
  1379. var Math_fround = Math.fround;
  1380. var Math_round = Math.round;
  1381. var Math_min = Math.min;
  1382. var Math_clz32 = Math.clz32;
  1383. var Math_trunc = Math.trunc;
  1384. // A counter of dependencies for calling run(). If we need to
  1385. // do asynchronous work before running, increment this and
  1386. // decrement it. Incrementing must happen in a place like
  1387. // PRE_RUN_ADDITIONS (used by emcc to add file preloading).
  1388. // Note that you can add dependencies in preRun, even though
  1389. // it happens right before run - run will be postponed until
  1390. // the dependencies are met.
  1391. var runDependencies = 0;
  1392. var runDependencyWatcher = null;
  1393. var dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled
  1394. var runDependencyTracking = {};
  1395. function getUniqueRunDependency(id) {
  1396. var orig = id;
  1397. while (1) {
  1398. if (!runDependencyTracking[id]) return id;
  1399. id = orig + Math.random();
  1400. }
  1401. return id;
  1402. }
  1403. function addRunDependency(id) {
  1404. // We should never get here in pthreads (could no-op this out if called in pthreads, but that might indicate a bug in caller side,
  1405. // so good to be very explicit)
  1406. assert(!ENVIRONMENT_IS_PTHREAD);
  1407. runDependencies++;
  1408. if (Module['monitorRunDependencies']) {
  1409. Module['monitorRunDependencies'](runDependencies);
  1410. }
  1411. if (id) {
  1412. assert(!runDependencyTracking[id]);
  1413. runDependencyTracking[id] = 1;
  1414. if (runDependencyWatcher === null && typeof setInterval !== 'undefined') {
  1415. // Check for missing dependencies every few seconds
  1416. runDependencyWatcher = setInterval(function() {
  1417. if (ABORT) {
  1418. clearInterval(runDependencyWatcher);
  1419. runDependencyWatcher = null;
  1420. return;
  1421. }
  1422. var shown = false;
  1423. for (var dep in runDependencyTracking) {
  1424. if (!shown) {
  1425. shown = true;
  1426. Module.printErr('still waiting on run dependencies:');
  1427. }
  1428. Module.printErr('dependency: ' + dep);
  1429. }
  1430. if (shown) {
  1431. Module.printErr('(end of list)');
  1432. }
  1433. }, 10000);
  1434. }
  1435. } else {
  1436. Module.printErr('warning: run dependency added without ID');
  1437. }
  1438. }
  1439. Module["addRunDependency"] = addRunDependency;
  1440. function removeRunDependency(id) {
  1441. runDependencies--;
  1442. if (Module['monitorRunDependencies']) {
  1443. Module['monitorRunDependencies'](runDependencies);
  1444. }
  1445. if (id) {
  1446. assert(runDependencyTracking[id]);
  1447. delete runDependencyTracking[id];
  1448. } else {
  1449. Module.printErr('warning: run dependency removed without ID');
  1450. }
  1451. if (runDependencies == 0) {
  1452. if (runDependencyWatcher !== null) {
  1453. clearInterval(runDependencyWatcher);
  1454. runDependencyWatcher = null;
  1455. }
  1456. if (dependenciesFulfilled) {
  1457. var callback = dependenciesFulfilled;
  1458. dependenciesFulfilled = null;
  1459. callback(); // can add another dependenciesFulfilled
  1460. }
  1461. }
  1462. }
  1463. Module["removeRunDependency"] = removeRunDependency;
  1464. Module["preloadedImages"] = {}; // maps url to image data
  1465. Module["preloadedAudios"] = {}; // maps url to audio data
  1466. var memoryInitializer = null;
  1467. // === Body ===
  1468. var ASM_CONSTS = [function($0, $1) { { Module.printErr('bad name in getProcAddress: ' + [Pointer_stringify($0), Pointer_stringify($1)]); } },
  1469. function() { postMessage({ cmd: 'processQueuedMainThreadWork' }) }];
  1470. function _emscripten_asm_const_iii(code, a0, a1) {
  1471. return ASM_CONSTS[code](a0, a1);
  1472. }
  1473. function _emscripten_asm_const_v(code) {
  1474. return ASM_CONSTS[code]();
  1475. }
  1476. STATIC_BASE = 8;
  1477. STATICTOP = STATIC_BASE + 38352;
  1478. /* global initializers */ if (!ENVIRONMENT_IS_PTHREAD) __ATINIT__.push({ func: function() { ___emscripten_pthread_data_constructor() } });
  1479. if (!ENVIRONMENT_IS_PTHREAD) {
  1480. /* memory initializer */ allocate([32,3,0,0,194,1,0,0,15,0,0,0,32,186,32,60,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,32,0,0,176,1,0,0,0,0,0,0,0,0,0,32,37,249,142,0,10,2,0,0,128,190,125,95,244,125,31,160,242,43,74,30,9,82,8,0,64,34,65,80,20,4,16,32,32,41,46,18,8,34,8,0,32,34,65,80,20,4,16,32,32,249,16,76,8,250,62,60,16,34,125,222,247,125,16,32,32,161,232,50,8,34,8,0,8,34,5,16,4,69,16,0,240,163,164,50,8,82,8,0,4,34,5,16,4,69,16,32,32,249,226,94,8,2,0,129,2,62,125,31,244,125,16,0,0,32,0,0,176,1,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,190,15,0,192,15,224,247,251,125,126,191,95,232,190,80,0,162,8,8,68,232,47,20,10,133,2,129,80,72,160,80,0,162,40,228,73,40,40,20,10,132,2,129,64,72,160,72,0,190,15,2,16,175,235,247,9,132,62,159,216,79,160,71,0,34,136,228,9,161,42,20,10,132,2,129,80,72,160,72,0,34,40,8,4,160,47,20,10,133,2,129,80,72,162,80,0,190,143,0,0,33,32,244,251,125,126,129,95,232,156,208,7,0,128,0,0,224,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,1,12,0,130,66,191,223,239,247,251,11,5,5,133,66,191,4,72,0,198,66,161,80,40,20,64,8,5,37,133,66,160,8,168,0,170,70,161,80,40,20,64,8,5,37,133,66,144,16,8,0,146,74,161,95,232,247,67,8,5,37,121,126,136,32,8,0,130,82,161,64,40,1,66,8,137,36,133,64,132,64,8,0,130,98,161,64,42,2,66,8,81,36,133,64,130,128,8,0,130,66,191,192,47,244,67,248,33,252,133,126,191,0,9,62,0,0,0,0,4,0,0,0,0,0,0,0,128,1,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,4,0,4,0,32,72,65,0,0,0,0,0,8,0,0,4,4,0,4,60,32,0,65,0,0,0,0,0,8,0,0,240,125,223,247,133,239,75,81,190,239,251,190,239,59,81,4,0,69,65,20,133,40,74,73,170,40,138,162,32,8,81,4,240,69,65,244,157,40,74,71,170,40,138,162,224,11,81,4,16,69,65,20,132,40,74,73,170,40,138,162,0,10,145,2,240,125,223,247,133,47,74,209,170,232,251,190,224,123,31,1,0,0,0,0,4,8,64,0,0,0,8,32,0,0,0,0,0,0,0,0,132,15,96,0,0,0,8,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,1,15,0,0,0,0,0,0,0,0,0,0,0,0,0,36,1,9,0,0,0,0,0,0,0,0,0,6,0,0,0,36,1,9,0,0,0,0,0,0,0,128,16,9,162,40,250,36,1,9,0,0,0,0,0,0,0,0,62,1,42,37,66,34,82,9,0,0,0,0,0,0,0,128,138,3,42,34,34,36,41,9,0,0,0,0,0,0,0,128,10,1,42,37,18,36,1,9,0,0,0,0,0,0,0,128,10,1,190,232,251,36,1,9,0,0,0,0,0,0,0,128,190,14,0,0,2,172,1,15,0,0,0,0,0,0,0,128,4,0,0,224,3,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,0,0,0,14,184,67,132,3,58,32,0,128,160,190,2,32,0,0,240,138,32,82,196,2,43,32,4,34,145,2,248,59,0,240,7,142,56,75,228,2,58,32,2,28,138,30,8,42,233,17,4,224,11,66,244,2,130,36,1,20,4,20,232,186,4,209,5,128,184,195,231,10,58,137,0,28,14,60,40,2,9,80,4,128,0,64,196,2,128,68,0,34,132,32,232,2,0,80,4,0,0,64,128,2,0,32,5,0,142,62,8,2,0,16,4,224,3,64,128,66,0,0,7,0,132,0,248,3,0,240,7,0,0,64,128,34,0,0,4,0,0,0,0,0,0,0,0,0,0,64,128,2,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,7,128,0,194,160,72,24,0,0,1,132,33,9,146,2,66,38,4,1,33,81,0,0,127,63,2,66,2,16,41,0,34,20,192,239,247,251,253,126,9,161,223,239,247,187,187,3,18,15,68,40,20,10,133,66,9,129,64,32,16,16,17,1,8,4,68,40,20,10,133,66,127,129,64,32,16,16,17,1,4,130,199,239,247,251,253,126,9,129,207,231,243,17,17,1,50,169,80,40,20,10,133,66,9,161,64,32,16,16,17,1,64,184,80,40,20,10,133,66,121,191,223,239,247,187,187,3,32,160,31,0,0,0,0,0,0,16,0,0,0,0,0,0,112,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,2,8,131,34,1,0,2,8,67,2,1,0,1,1,124,20,4,132,68,1,0,32,4,132,4,128,8,63,130,0,132,66,191,223,239,247,3,126,161,80,40,20,10,33,0,0,132,70,161,80,40,20,138,82,161,80,40,20,122,161,239,3,158,74,161,80,40,20,82,82,161,80,40,20,74,31,8,2,132,82,161,80,40,20,34,74,161,80,40,244,75,161,239,3,132,98,161,80,40,20,82,74,161,80,40,4,122,161,40,2,124,66,191,223,239,247,139,126,191,223,239,247,11,189,239,3,0,0,0,0,0,0,0,4,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,5,32,0,0,4,132,0,34,129,69,17,16,66,1,0,148,66,81,0,0,8,66,81,148,42,162,32,8,165,80,0,0,0,32,0,0,0,0,0,0,0,5,0,0,0,0,8,190,239,251,254,251,190,239,251,20,145,235,251,190,239,251,0,32,8,130,32,10,162,40,138,20,145,40,138,162,40,138,62,190,239,251,254,11,190,239,251,20,145,40,138,162,40,138,0,162,40,138,34,8,130,32,8,20,145,40,138,162,40,138,8,190,239,251,254,251,190,239,251,20,145,47,250,190,239,251,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,33,0,4,0,0,0,0,0,0,0,0,0,0,0,0,130,80,20,2,20,0,0,0,0,0,0,0,0,0,0,16,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,190,40,138,162,40,34,0,0,0,0,0,0,0,0,0,0,170,40,138,162,232,34,0,0,0,0,0,0,0,0,0,0,170,40,138,162,168,34,0,0,0,0,0,0,0,0,0,0,170,40,138,162,232,34,0,0,0,0,0,0,0,0,0,0,190,239,251,190,47,62,0,0,0,0,0,0,0,0,0,0,4,0,0,0,40,32,0,0,0,0,0,0,0,0,0,0,0,0,0,128,15,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,1,0,0,0,4,0,0,0,6,0,0,0,5,0,0,0,7,0,0,0,6,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,5,0,0,0,5,0,0,0,2,0,0,0,4,0,0,0,1,0,0,0,7,0,0,0,5,0,0,0,2,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,1,0,0,0,1,0,0,0,3,0,0,0,4,0,0,0,3,0,0,0,6,0,0,0,7,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,3,0,0,0,5,0,0,0,6,0,0,0,5,0,0,0,7,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,7,0,0,0,6,0,0,0,7,0,0,0,7,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,2,0,0,0,7,0,0,0,2,0,0,0,3,0,0,0,5,0,0,0,2,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,4,0,0,0,5,0,0,0,5,0,0,0,1,0,0,0,2,0,0,0,5,0,0,0,2,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,4,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,3,0,0,0,1,0,0,0,3,0,0,0,4,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,7,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,7,0,0,0,3,0,0,0,5,0,0,0,4,0,0,0,1,0,0,0,7,0,0,0,4,0,0,0,3,0,0,0,5,0,0,0,3,0,0,0,3,0,0,0,2,0,0,0,5,0,0,0,6,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,5,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,7,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,7,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,5,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,4,0,0,0,6,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,9,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,3,0,0,0,5,0,0,0,255,255,255,255,0,1,0,0,255,255,255,255,0,0,128,191,20,0,0,0,180,11,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,199,145,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,180,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,104,121,115,97,99,32,91,114,97,121,108,105,98,93,32,45,32,80,104,121,115,105,99,115,32,114,101,115,116,105,116,117,116,105,111,110,0,80,104,121,115,97,99,0,82,101,115,116,105,116,117,116,105,111,110,32,97,109,111,117,110,116,0,48,0,48,46,53,0,49,0,80,114,101,115,115,32,39,82,39,32,116,111,32,114,101,115,101,116,32,101,120,97,109,112,108,101,0,80,111,119,101,114,101,100,32,98,121,0,73,110,105,116,105,97,108,105,122,105,110,103,32,114,97,121,108,105,98,32,40,118,49,46,55,46,48,41,0,35,99,97,110,118,97,115,0,84,97,114,103,101,116,32,116,105,109,101,32,112,101,114,32,102,114,97,109,101,58,32,37,48,50,46,48,51,102,32,109,105,108,108,105,115,101,99,111,110,100,115,0,69,115,99,97,112,101,0,67,97,110,118,97,115,32,115,99,97,108,101,100,32,116,111,32,102,117,108,108,115,99,114,101,101,110,46,32,69,108,101,109,101,110,116,83,105,122,101,58,32,40,37,105,120,37,105,41,44,32,83,99,114,101,101,110,83,105,122,101,40,37,105,120,37,105,41,0,67,97,110,118,97,115,32,115,99,97,108,101,100,32,116,111,32,119,105,110,100,111,119,101,100,46,32,69,108,101,109,101,110,116,83,105,122,101,58,32,40,37,105,120,37,105,41,44,32,83,99,114,101,101,110,83,105,122,101,40,37,105,120,37,105,41,0,91,84,69,88,32,73,68,32,37,105,93,32,68,101,102,97,117,108,116,32,102,111,110,116,32,108,111,97,100,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,0,68,88,84,32,99,111,109,112,114,101,115,115,101,100,32,116,101,120,116,117,114,101,32,102,111,114,109,97,116,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,69,84,67,49,32,99,111,109,112,114,101,115,115,101,100,32,116,101,120,116,117,114,101,32,102,111,114,109,97,116,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,69,84,67,50,32,99,111,109,112,114,101,115,115,101,100,32,116,101,120,116,117,114,101,32,102,111,114,109,97,116,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,80,86,82,84,32,99,111,109,112,114,101,115,115,101,100,32,116,101,120,116,117,114,101,32,102,111,114,109,97,116,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,83,84,67,32,99,111,109,112,114,101,115,115,101,100,32,116,101,120,116,117,114,101,32,102,111,114,109,97,116,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,84,101,120,116,117,114,101,32,102,111,114,109,97,116,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,91,84,69,88,32,73,68,32,37,105,93,32,84,101,120,116,117,114,101,32,99,114,101,97,116,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,32,40,37,105,120,37,105,41,0,84,101,120,116,117,114,101,32,99,111,117,108,100,32,110,111,116,32,98,101,32,99,114,101,97,116,101,100,0,73,109,97,103,101,32,100,97,116,97,32,102,111,114,109,97,116,32,105,115,32,99,111,109,112,114,101,115,115,101,100,44,32,99,97,110,32,110,111,116,32,98,101,32,99,111,110,118,101,114,116,101,100,0,70,111,114,109,97,116,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,102,111,114,32,112,105,120,101,108,32,100,97,116,97,32,114,101,116,114,105,101,118,97,108,0,70,97,105,108,101,100,32,116,111,32,105,110,105,116,105,97,108,105,122,101,32,71,76,70,87,0,84,114,121,105,110,103,32,116,111,32,101,110,97,98,108,101,32,77,83,65,65,32,120,52,0,67,108,111,115,101,115,116,32,102,117,108,108,115,99,114,101,101,110,32,118,105,100,101,111,109,111,100,101,58,32,37,105,32,120,32,37,105,0,71,76,70,87,32,70,97,105,108,101,100,32,116,111,32,105,110,105,116,105,97,108,105,122,101,32,87,105,110,100,111,119,0,68,105,115,112,108,97,121,32,100,101,118,105,99,101,32,105,110,105,116,105,97,108,105,122,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,0,82,101,110,100,101,114,32,115,105,122,101,58,32,37,105,32,120,32,37,105,0,83,99,114,101,101,110,32,115,105,122,101,58,32,37,105,32,120,32,37,105,0,86,105,101,119,112,111,114,116,32,111,102,102,115,101,116,115,58,32,37,105,44,32,37,105,0,84,114,121,105,110,103,32,116,111,32,101,110,97,98,108,101,32,86,83,89,78,67,0,71,80,85,58,32,86,101,110,100,111,114,58,32,32,32,37,115,0,71,80,85,58,32,82,101,110,100,101,114,101,114,58,32,37,115,0,71,80,85,58,32,86,101,114,115,105,111,110,58,32,32,37,115,0,71,80,85,58,32,71,76,83,76,58,32,32,32,32,32,37,115,0,32,0,78,117,109,98,101,114,32,111,102,32,115,117,112,112,111,114,116,101,100,32,101,120,116,101,110,115,105,111,110,115,58,32,37,105,0,71,76,95,79,69,83,95,118,101,114,116,101,120,95,97,114,114,97,121,95,111,98,106,101,99,116,0,103,108,71,101,110,86,101,114,116,101,120,65,114,114,97,121,115,79,69,83,0,103,108,66,105,110,100,86,101,114,116,101,120,65,114,114,97,121,79,69,83,0,103,108,68,101,108,101,116,101,86,101,114,116,101,120,65,114,114,97,121,115,79,69,83,0,71,76,95,79,69,83,95,116,101,120,116,117,114,101,95,110,112,111,116,0,71,76,95,69,88,84,95,116,101,120,116,117,114,101,95,99,111,109,112,114,101,115,115,105,111,110,95,115,51,116,99,0,71,76,95,87,69,66,71,76,95,99,111,109,112,114,101,115,115,101,100,95,116,101,120,116,117,114,101,95,115,51,116,99,0,71,76,95,87,69,66,75,73,84,95,87,69,66,71,76,95,99,111,109,112,114,101,115,115,101,100,95,116,101,120,116,117,114,101,95,115,51,116,99,0,71,76,95,79,69,83,95,99,111,109,112,114,101,115,115,101,100,95,69,84,67,49,95,82,71,66,56,95,116,101,120,116,117,114,101,0,71,76,95,87,69,66,71,76,95,99,111,109,112,114,101,115,115,101,100,95,116,101,120,116,117,114,101,95,101,116,99,49,0,71,76,95,65,82,66,95,69,83,51,95,99,111,109,112,97,116,105,98,105,108,105,116,121,0,71,76,95,73,77,71,95,116,101,120,116,117,114,101,95,99,111,109,112,114,101,115,115,105,111,110,95,112,118,114,116,99,0,71,76,95,75,72,82,95,116,101,120,116,117,114,101,95,99,111,109,112,114,101,115,115,105,111,110,95,97,115,116,99,95,104,100,114,0,71,76,95,69,88,84,95,116,101,120,116,117,114,101,95,102,105,108,116,101,114,95,97,110,105,115,111,116,114,111,112,105,99,0,71,76,95,69,88,84,95,116,101,120,116,117,114,101,95,109,105,114,114,111,114,95,99,108,97,109,112,0,91,69,88,84,69,78,83,73,79,78,93,32,86,65,79,32,101,120,116,101,110,115,105,111,110,32,100,101,116,101,99,116,101,100,44,32,86,65,79,32,102,117,110,99,116,105,111,110,115,32,105,110,105,116,105,97,108,105,122,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,0,91,69,88,84,69,78,83,73,79,78,93,32,86,65,79,32,101,120,116,101,110,115,105,111,110,32,110,111,116,32,102,111,117,110,100,44,32,86,65,79,32,117,115,97,103,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,91,69,88,84,69,78,83,73,79,78,93,32,78,80,79,84,32,116,101,120,116,117,114,101,115,32,101,120,116,101,110,115,105,111,110,32,100,101,116,101,99,116,101,100,44,32,102,117,108,108,32,78,80,79,84,32,116,101,120,116,117,114,101,115,32,115,117,112,112,111,114,116,101,100,0,91,69,88,84,69,78,83,73,79,78,93,32,78,80,79,84,32,116,101,120,116,117,114,101,115,32,101,120,116,101,110,115,105,111,110,32,110,111,116,32,102,111,117,110,100,44,32,108,105,109,105,116,101,100,32,78,80,79,84,32,115,117,112,112,111,114,116,32,40,110,111,45,109,105,112,109,97,112,115,44,32,110,111,45,114,101,112,101,97,116,41,0,91,69,88,84,69,78,83,73,79,78,93,32,68,88,84,32,99,111,109,112,114,101,115,115,101,100,32,116,101,120,116,117,114,101,115,32,115,117,112,112,111,114,116,101,100,0,91,69,88,84,69,78,83,73,79,78,93,32,69,84,67,49,32,99,111,109,112,114,101,115,115,101,100,32,116,101,120,116,117,114,101,115,32,115,117,112,112,111,114,116,101,100,0,91,69,88,84,69,78,83,73,79,78,93,32,69,84,67,50,47,69,65,67,32,99,111,109,112,114,101,115,115,101,100,32,116,101,120,116,117,114,101,115,32,115,117,112,112,111,114,116,101,100,0,91,69,88,84,69,78,83,73,79,78,93,32,80,86,82,84,32,99,111,109,112,114,101,115,115,101,100,32,116,101,120,116,117,114,101,115,32,115,117,112,112,111,114,116,101,100,0,91,69,88,84,69,78,83,73,79,78,93,32,65,83,84,67,32,99,111,109,112,114,101,115,115,101,100,32,116,101,120,116,117,114,101,115,32,115,117,112,112,111,114,116,101,100,0,91,69,88,84,69,78,83,73,79,78,93,32,65,110,105,115,111,116,114,111,112,105,99,32,116,101,120,116,117,114,101,115,32,102,105,108,116,101,114,105,110,103,32,115,117,112,112,111,114,116,101,100,32,40,109,97,120,58,32,37,46,48,102,88,41,0,91,69,88,84,69,78,83,73,79,78,93,32,67,108,97,109,112,32,109,105,114,114,111,114,32,119,114,97,112,32,116,101,120,116,117,114,101,32,109,111,100,101,32,115,117,112,112,111,114,116,101,100,0,91,84,69,88,32,73,68,32,37,105,93,32,66,97,115,101,32,119,104,105,116,101,32,116,101,120,116,117,114,101,32,108,111,97,100,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,0,66,97,115,101,32,119,104,105,116,101,32,116,101,120,116,117,114,101,32,99,111,117,108,100,32,110,111,116,32,98,101,32,108,111,97,100,101,100,0,79,112,101,110,71,76,32,100,101,102,97,117,108,116,32,115,116,97,116,101,115,32,105,110,105,116,105,97,108,105,122,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,0,91,67,80,85,93,32,68,101,102,97,117,108,116,32,98,117,102,102,101,114,115,32,105,110,105,116,105,97,108,105,122,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,32,40,108,105,110,101,115,44,32,116,114,105,97,110,103,108,101,115,44,32,113,117,97,100,115,41,0,91,86,65,79,32,73,68,32,37,105,93,32,68,101,102,97,117,108,116,32,98,117,102,102,101,114,115,32,86,65,79,32,105,110,105,116,105,97,108,105,122,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,32,40,108,105,110,101,115,41,0,91,86,66,79,32,73,68,32,37,105,93,91,86,66,79,32,73,68,32,37,105,93,32,68,101,102,97,117,108,116,32,98,117,102,102,101,114,115,32,86,66,79,115,32,105,110,105,116,105,97,108,105,122,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,32,40,108,105,110,101,115,41,0,91,86,65,79,32,73,68,32,37,105,93,32,68,101,102,97,117,108,116,32,98,117,102,102,101,114,115,32,86,65,79,32,105,110,105,116,105,97,108,105,122,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,32,40,116,114,105,97,110,103,108,101,115,41,0,91,86,66,79,32,73,68,32,37,105,93,91,86,66,79,32,73,68,32,37,105,93,32,68,101,102,97,117,108,116,32,98,117,102,102,101,114,115,32,86,66,79,115,32,105,110,105,116,105,97,108,105,122,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,32,40,116,114,105,97,110,103,108,101,115,41,0,91,86,65,79,32,73,68,32,37,105,93,32,68,101,102,97,117,108,116,32,98,117,102,102,101,114,115,32,86,65,79,32,105,110,105,116,105,97,108,105,122,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,32,40,113,117,97,100,115,41,0,91,86,66,79,32,73,68,32,37,105,93,91,86,66,79,32,73,68,32,37,105,93,91,86,66,79,32,73,68,32,37,105,93,91,86,66,79,32,73,68,32,37,105,93,32,68,101,102,97,117,108,116,32,98,117,102,102,101,114,115,32,86,66,79,115,32,105,110,105,116,105,97,108,105,122,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,32,40,113,117,97,100,115,41,0,35,118,101,114,115,105,111,110,32,49,48,48,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,97,116,116,114,105,98,117,116,101,32,118,101,99,51,32,118,101,114,116,101,120,80,111,115,105,116,105,111,110,59,32,32,32,32,32,10,97,116,116,114,105,98,117,116,101,32,118,101,99,50,32,118,101,114,116,101,120,84,101,120,67,111,111,114,100,59,32,32,32,32,32,10,97,116,116,114,105,98,117,116,101,32,118,101,99,52,32,118,101,114,116,101,120,67,111,108,111,114,59,32,32,32,32,32,32,32,32,10,118,97,114,121,105,110,103,32,118,101,99,50,32,102,114,97,103,84,101,120,67,111,111,114,100,59,32,32,32,32,32,32,32,32,32,10,118,97,114,121,105,110,103,32,118,101,99,52,32,102,114,97,103,67,111,108,111,114,59,32,32,32,32,32,32,32,32,32,32,32,32,10,117,110,105,102,111,114,109,32,109,97,116,52,32,109,118,112,77,97,116,114,105,120,59,32,32,32,32,32,32,32,32,32,32,32,32,10,118,111,105,100,32,109,97,105,110,40,41,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,123,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,102,114,97,103,84,101,120,67,111,111,114,100,32,61,32,118,101,114,116,101,120,84,101,120,67,111,111,114,100,59,32,10,32,32,32,32,102,114,97,103,67,111,108,111,114,32,61,32,118,101,114,116,101,120,67,111,108,111,114,59,32,32,32,32,32,32,32,10,32,32,32,32,103,108,95,80,111,115,105,116,105,111,110,32,61,32,109,118,112,77,97,116,114,105,120,42,118,101,99,52,40,118,101,114,116,101,120,80,111,115,105,116,105,111,110,44,32,49,46,48,41,59,32,10,125,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,0,35,118,101,114,115,105,111,110,32,49,48,48,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,112,114,101,99,105,115,105,111,110,32,109,101,100,105,117,109,112,32,102,108,111,97,116,59,32,32,32,32,32,32,32,32,32,32,32,10,118,97,114,121,105,110,103,32,118,101,99,50,32,102,114,97,103,84,101,120,67,111,111,114,100,59,32,32,32,32,32,32,32,32,32,10,118,97,114,121,105,110,103,32,118,101,99,52,32,102,114,97,103,67,111,108,111,114,59,32,32,32,32,32,32,32,32,32,32,32,32,10,117,110,105,102,111,114,109,32,115,97,109,112,108,101,114,50,68,32,116,101,120,116,117,114,101,48,59,32,32,32,32,32,32,32,32,10,117,110,105,102,111,114,109,32,118,101,99,52,32,99,111,108,68,105,102,102,117,115,101,59,32,32,32,32,32,32,32,32,32,32,32,10,118,111,105,100,32,109,97,105,110,40,41,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,123,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,32,32,32,32,118,101,99,52,32,116,101,120,101,108,67,111,108,111,114,32,61,32,116,101,120,116,117,114,101,50,68,40,116,101,120,116,117,114,101,48,44,32,102,114,97,103,84,101,120,67,111,111,114,100,41,59,32,10,32,32,32,32,103,108,95,70,114,97,103,67,111,108,111,114,32,61,32,116,101,120,101,108,67,111,108,111,114,42,99,111,108,68,105,102,102,117,115,101,42,102,114,97,103,67,111,108,111,114,59,32,32,32,32,32,32,10,125,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,10,0,91,83,72,68,82,32,73,68,32,37,105,93,32,68,101,102,97,117,108,116,32,115,104,97,100,101,114,32,108,111,97,100,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,0,91,83,72,68,82,32,73,68,32,37,105,93,32,68,101,102,97,117,108,116,32,115,104,97,100,101,114,32,99,111,117,108,100,32,110,111,116,32,98,101,32,108,111,97,100,101,100,0,118,101,114,116,101,120,80,111,115,105,116,105,111,110,0,118,101,114,116,101,120,84,101,120,67,111,111,114,100,0,118,101,114,116,101,120,84,101,120,67,111,111,114,100,50,0,118,101,114,116,101,120,78,111,114,109,97,108,0,118,101,114,116,101,120,84,97,110,103,101,110,116,0,118,101,114,116,101,120,67,111,108,111,114,0,109,118,112,77,97,116,114,105,120,0,99,111,108,68,105,102,102,117,115,101,0,99,111,108,65,109,98,105,101,110,116,0,99,111,108,83,112,101,99,117,108,97,114,0,116,101,120,116,117,114,101,48,0,116,101,120,116,117,114,101,49,0,116,101,120,116,117,114,101,50,0,91,86,83,72,68,82,32,73,68,32,37,105,93,32,70,97,105,108,101,100,32,116,111,32,99,111,109,112,105,108,101,32,118,101,114,116,101,120,32,115,104,97,100,101,114,46,46,46,0,37,115,0,91,86,83,72,68,82,32,73,68,32,37,105,93,32,86,101,114,116,101,120,32,115,104,97,100,101,114,32,99,111,109,112,105,108,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,0,91,70,83,72,68,82,32,73,68,32,37,105,93,32,70,97,105,108,101,100,32,116,111,32,99,111,109,112,105,108,101,32,102,114,97,103,109,101,110,116,32,115,104,97,100,101,114,46,46,46,0,91,70,83,72,68,82,32,73,68,32,37,105,93,32,70,114,97,103,109,101,110,116,32,115,104,97,100,101,114,32,99,111,109,112,105,108,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,0,91,83,72,68,82,32,73,68,32,37,105,93,32,70,97,105,108,101,100,32,116,111,32,108,105,110,107,32,115,104,97,100,101,114,32,112,114,111,103,114,97,109,46,46,46,0,91,83,72,68,82,32,73,68,32,37,105,93,32,83,104,97,100,101,114,32,112,114,111,103,114,97,109,32,108,111,97,100,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,0,68,79,87,78,83,67,65,76,73,78,71,58,32,82,101,113,117,105,114,101,100,32,115,99,114,101,101,110,32,115,105,122,101,32,40,37,105,120,37,105,41,32,105,115,32,98,105,103,103,101,114,32,116,104,97,110,32,100,105,115,112,108,97,121,32,115,105,122,101,32,40,37,105,120,37,105,41,0,68,111,119,110,115,99,97,108,101,32,109,97,116,114,105,120,32,103,101,110,101,114,97,116,101,100,44,32,99,111,110,116,101,110,116,32,119,105,108,108,32,98,101,32,114,101,110,100,101,114,101,100,32,97,116,58,32,37,105,32,120,32,37,105,0,85,80,83,67,65,76,73,78,71,58,32,82,101,113,117,105,114,101,100,32,115,99,114,101,101,110,32,115,105,122,101,58,32,37,105,32,120,32,37,105,32,45,62,32,68,105,115,112,108,97,121,32,115,105,122,101,58,32,37,105,32,120,32,37,105,0,91,71,76,70,87,51,32,69,114,114,111,114,93,32,67,111,100,101,58,32,37,105,32,68,101,99,114,105,112,116,105,111,110,58,32,37,115,0,73,78,70,79,58,32,0,87,65,82,78,73,78,71,58,32,0,87,105,110,100,111,119,32,99,108,111,115,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,0,91,84,69,88,32,73,68,32,37,105,93,32,85,110,108,111,97,100,101,100,32,116,101,120,116,117,114,101,32,100,97,116,97,32,40,98,97,115,101,32,119,104,105,116,101,32,116,101,120,116,117,114,101,41,32,102,114,111,109,32,86,82,65,77,0,91,84,69,88,32,73,68,32,37,105,93,32,85,110,108,111,97,100,101,100,32,116,101,120,116,117,114,101,32,100,97,116,97,32,102,114,111,109,32,86,82,65,77,32,40,71,80,85,41,0,83,116,97,99,107,32,66,117,102,102,101,114,32,79,118,101,114,102,108,111,119,32,40,77,65,88,32,37,105,32,77,97,116,114,105,120,41,0,77,65,88,95,76,73,78,69,83,95,66,65,84,67,72,32,111,118,101,114,102,108,111,119,0,77,65,88,95,84,82,73,65,78,71,76,69,83,95,66,65,84,67,72,32,111,118,101,114,102,108,111,119,0,77,65,88,95,81,85,65,68,83,95,66,65,84,67,72,32,111,118,101,114,102,108,111,119,0,37,50,105,32,70,80,83,0,69,88,84,0,65,82,66,0,79,69,83,0,65,78,71,76,69,0,103,108,67,114,101,97,116,101,80,114,111,103,114,97,109,79,98,106,101,99,116,0,103,108,67,114,101,97,116,101,80,114,111,103,114,97,109,0,103,108,85,115,101,80,114,111,103,114,97,109,79,98,106,101,99,116,0,103,108,85,115,101,80,114,111,103,114,97,109,0,103,108,67,114,101,97,116,101,83,104,97,100,101,114,79,98,106,101,99,116,0,103,108,67,114,101,97,116,101,83,104,97,100,101,114,0,103,108,65,116,116,97,99,104,79,98,106,101,99,116,0,103,108,65,116,116,97,99,104,83,104,97,100,101,114,0,103,108,68,101,116,97,99,104,79,98,106,101,99,116,0,103,108,68,101,116,97,99,104,83,104,97,100,101,114,0,103,108,80,105,120,101,108,83,116,111,114,101,105,0,103,108,71,101,116,83,116,114,105,110,103,0,103,108,71,101,116,73,110,116,101,103,101,114,118,0,103,108,71,101,116,70,108,111,97,116,118,0,103,108,71,101,116,66,111,111,108,101,97,110,118,0,103,108,71,101,110,84,101,120,116,117,114,101,115,0,103,108,68,101,108,101,116,101,84,101,120,116,117,114,101,115,0,103,108,67,111,109,112,114,101,115,115,101,100,84,101,120,73,109,97,103,101,50,68,0,103,108,67,111,109,112,114,101,115,115,101,100,84,101,120,83,117,98,73,109,97,103,101,50,68,0,103,108,84,101,120,73,109,97,103,101,50,68,0,103,108,84,101,120,83,117,98,73,109,97,103,101,50,68,0,103,108,82,101,97,100,80,105,120,101,108,115,0,103,108,66,105,110,100,84,101,120,116,117,114,101,0,103,108,71,101,116,84,101,120,80,97,114,97,109,101,116,101,114,102,118,0,103,108,71,101,116,84,101,120,80,97,114,97,109,101,116,101,114,105,118,0,103,108,84,101,120,80,97,114,97,109,101,116,101,114,102,118,0,103,108,84,101,120,80,97,114,97,109,101,116,101,114,105,118,0,103,108,73,115,84,101,120,116,117,114,101,0,103,108,71,101,110,66,117,102,102,101,114,115,0,103,108,68,101,108,101,116,101,66,117,102,102,101,114,115,0,103,108,71,101,116,66,117,102,102,101,114,80,97,114,97,109,101,116,101,114,105,118,0,103,108,66,117,102,102,101,114,68,97,116,97,0,103,108,66,117,102,102,101,114,83,117,98,68,97,116,97,0,103,108,73,115,66,117,102,102,101,114,0,103,108,71,101,110,82,101,110,100,101,114,98,117,102,102,101,114,115,0,103,108,68,101,108,101,116,101,82,101,110,100,101,114,98,117,102,102,101,114,115,0,103,108,66,105,110,100,82,101,110,100,101,114,98,117,102,102,101,114,0,103,108,71,101,116,82,101,110,100,101,114,98,117,102,102,101,114,80,97,114,97,109,101,116,101,114,105,118,0,103,108,73,115,82,101,110,100,101,114,98,117,102,102,101,114,0,103,108,71,101,116,85,110,105,102,111,114,109,102,118,0,103,108,71,101,116,85,110,105,102,111,114,109,105,118,0,103,108,71,101,116,85,110,105,102,111,114,109,76,111,99,97,116,105,111,110,0,103,108,71,101,116,86,101,114,116,101,120,65,116,116,114,105,98,102,118,0,103,108,71,101,116,86,101,114,116,101,120,65,116,116,114,105,98,105,118,0,103,108,71,101,116,86,101,114,116,101,120,65,116,116,114,105,98,80,111,105,110,116,101,114,118,0,103,108,71,101,116,65,99,116,105,118,101,85,110,105,102,111,114,109,0,103,108,85,110,105,102,111,114,109,49,102,0,103,108,85,110,105,102,111,114,109,50,102,0,103,108,85,110,105,102,111,114,109,51,102,0,103,108,85,110,105,102,111,114,109,52,102,0,103,108,85,110,105,102,111,114,109,49,105,0,103,108,85,110,105,102,111,114,109,50,105,0,103,108,85,110,105,102,111,114,109,51,105,0,103,108,85,110,105,102,111,114,109,52,105,0,103,108,85,110,105,102,111,114,109,49,105,118,0,103,108,85,110,105,102,111,114,109,50,105,118,0,103,108,85,110,105,102,111,114,109,51,105,118,0,103,108,85,110,105,102,111,114,109,52,105,118,0,103,108,85,110,105,102,111,114,109,49,102,118,0,103,108,85,110,105,102,111,114,109,50,102,118,0,103,108,85,110,105,102,111,114,109,51,102,118,0,103,108,85,110,105,102,111,114,109,52,102,118,0,103,108,85,110,105,102,111,114,109,77,97,116,114,105,120,50,102,118,0,103,108,85,110,105,102,111,114,109,77,97,116,114,105,120,51,102,118,0,103,108,85,110,105,102,111,114,109,77,97,116,114,105,120,52,102,118,0,103,108,66,105,110,100,66,117,102,102,101,114,0,103,108,86,101,114,116,101,120,65,116,116,114,105,98,49,102,118,0,103,108,86,101,114,116,101,120,65,116,116,114,105,98,50,102,118,0,103,108,86,101,114,116,101,120,65,116,116,114,105,98,51,102,118,0,103,108,86,101,114,116,101,120,65,116,116,114,105,98,52,102,118,0,103,108,71,101,116,65,116,116,114,105,98,76,111,99,97,116,105,111,110,0,103,108,71,101,116,65,99,116,105,118,101,65,116,116,114,105,98,0,103,108,68,101,108,101,116,101,83,104,97,100,101,114,0,103,108,71,101,116,65,116,116,97,99,104,101,100,83,104,97,100,101,114,115,0,103,108,83,104,97,100,101,114,83,111,117,114,99,101,0,103,108,71,101,116,83,104,97,100,101,114,83,111,117,114,99,101,0,103,108,67,111,109,112,105,108,101,83,104,97,100,101,114,0,103,108,71,101,116,83,104,97,100,101,114,73,110,102,111,76,111,103,0,103,108,71,101,116,83,104,97,100,101,114,105,118,0,103,108,71,101,116,80,114,111,103,114,97,109,105,118,0,103,108,73,115,83,104,97,100,101,114,0,103,108,68,101,108,101,116,101,80,114,111,103,114,97,109,0,103,108,71,101,116,83,104,97,100,101,114,80,114,101,99,105,115,105,111,110,70,111,114,109,97,116,0,103,108,76,105,110,107,80,114,111,103,114,97,109,0,103,108,71,101,116,80,114,111,103,114,97,109,73,110,102,111,76,111,103,0,103,108,86,97,108,105,100,97,116,101,80,114,111,103,114,97,109,0,103,108,73,115,80,114,111,103,114,97,109,0,103,108,66,105,110,100,65,116,116,114,105,98,76,111,99,97,116,105,111,110,0,103,108,66,105,110,100,70,114,97,109,101,98,117,102,102,101,114,0,103,108,71,101,110,70,114,97,109,101,98,117,102,102,101,114,115,0,103,108,68,101,108,101,116,101,70,114,97,109,101,98,117,102,102,101,114,115,0,103,108,70,114,97,109,101,98,117,102,102,101,114,82,101,110,100,101,114,98,117,102,102,101,114,0,103,108,70,114,97,109,101,98,117,102,102,101,114,84,101,120,116,117,114,101,50,68,0,103,108,71,101,116,70,114,97,109,101,98,117,102,102,101,114,65,116,116,97,99,104,109,101,110,116,80,97,114,97,109,101,116,101,114,105,118,0,103,108,73,115,70,114,97,109,101,98,117,102,102,101,114,0,103,108,68,101,108,101,116,101,79,98,106,101,99,116,0,103,108,71,101,116,79,98,106,101,99,116,80,97,114,97,109,101,116,101,114,105,118,0,103,108,71,101,116,73,110,102,111,76,111,103,0,103,108,66,105,110,100,80,114,111,103,114,97,109,0,103,108,71,101,116,80,111,105,110,116,101,114,118,0,103,108,68,114,97,119,82,97,110,103,101,69,108,101,109,101,110,116,115,0,103,108,69,110,97,98,108,101,67,108,105,101,110,116,83,116,97,116,101,0,103,108,86,101,114,116,101,120,80,111,105,110,116,101,114,0,103,108,84,101,120,67,111,111,114,100,80,111,105,110,116,101,114,0,103,108,78,111,114,109,97,108,80,111,105,110,116,101,114,0,103,108,67,111,108,111,114,80,111,105,110,116,101,114,0,103,108,67,108,105,101,110,116,65,99,116,105,118,101,84,101,120,116,117,114,101,0,103,108,71,101,110,86,101,114,116,101,120,65,114,114,97,121,115,0,103,108,68,101,108,101,116,101,86,101,114,116,101,120,65,114,114,97,121,115,0,103,108,66,105,110,100,86,101,114,116,101,120,65,114,114,97,121,0,103,108,77,97,116,114,105,120,77,111,100,101,0,103,108,76,111,97,100,73,100,101,110,116,105,116,121,0,103,108,76,111,97,100,77,97,116,114,105,120,102,0,103,108,70,114,117,115,116,117,109,0,103,108,82,111,116,97,116,101,102,0,103,108,86,101,114,116,101,120,65,116,116,114,105,98,80,111,105,110,116,101,114,0,103,108,69,110,97,98,108,101,86,101,114,116,101,120,65,116,116,114,105,98,65,114,114,97,121,0,103,108,68,105,115,97,98,108,101,86,101,114,116,101,120,65,116,116,114,105,98,65,114,114,97,121,0,103,108,68,114,97,119,65,114,114,97,121,115,0,103,108,68,114,97,119,69,108,101,109,101,110,116,115,0,103,108], "i8", ALLOC_NONE, Runtime.GLOBAL_BASE);
  1481. /* memory initializer */ allocate([83,104,97,100,101,114,66,105,110,97,114,121,0,103,108,82,101,108,101,97,115,101,83,104,97,100,101,114,67,111,109,112,105,108,101,114,0,103,108,71,101,116,69,114,114,111,114,0,103,108,86,101,114,116,101,120,65,116,116,114,105,98,68,105,118,105,115,111,114,0,103,108,68,114,97,119,65,114,114,97,121,115,73,110,115,116,97,110,99,101,100,0,103,108,68,114,97,119,69,108,101,109,101,110,116,115,73,110,115,116,97,110,99,101,100,0,103,108,70,105,110,105,115,104,0,103,108,70,108,117,115,104,0,103,108,67,108,101,97,114,68,101,112,116,104,0,103,108,67,108,101,97,114,68,101,112,116,104,102,0,103,108,68,101,112,116,104,70,117,110,99,0,103,108,69,110,97,98,108,101,0,103,108,68,105,115,97,98,108,101,0,103,108,70,114,111,110,116,70,97,99,101,0,103,108,67,117,108,108,70,97,99,101,0,103,108,67,108,101,97,114,0,103,108,76,105,110,101,87,105,100,116,104,0,103,108,67,108,101,97,114,83,116,101,110,99,105,108,0,103,108,68,101,112,116,104,77,97,115,107,0,103,108,83,116,101,110,99,105,108,77,97,115,107,0,103,108,67,104,101,99,107,70,114,97,109,101,98,117,102,102,101,114,83,116,97,116,117,115,0,103,108,71,101,110,101,114,97,116,101,77,105,112,109,97,112,0,103,108,65,99,116,105,118,101,84,101,120,116,117,114,101,0,103,108,66,108,101,110,100,69,113,117,97,116,105,111,110,0,103,108,73,115,69,110,97,98,108,101,100,0,103,108,66,108,101,110,100,70,117,110,99,0,103,108,66,108,101,110,100,69,113,117,97,116,105,111,110,83,101,112,97,114,97,116,101,0,103,108,68,101,112,116,104,82,97,110,103,101,0,103,108,68,101,112,116,104,82,97,110,103,101,102,0,103,108,83,116,101,110,99,105,108,77,97,115,107,83,101,112,97,114,97,116,101,0,103,108,72,105,110,116,0,103,108,80,111,108,121,103,111,110,79,102,102,115,101,116,0,103,108,86,101,114,116,101,120,65,116,116,114,105,98,49,102,0,103,108,83,97,109,112,108,101,67,111,118,101,114,97,103,101,0,103,108,84,101,120,80,97,114,97,109,101,116,101,114,105,0,103,108,84,101,120,80,97,114,97,109,101,116,101,114,102,0,103,108,86,101,114,116,101,120,65,116,116,114,105,98,50,102,0,103,108,83,116,101,110,99,105,108,70,117,110,99,0,103,108,83,116,101,110,99,105,108,79,112,0,103,108,86,105,101,119,112,111,114,116,0,103,108,67,108,101,97,114,67,111,108,111,114,0,103,108,83,99,105,115,115,111,114,0,103,108,86,101,114,116,101,120,65,116,116,114,105,98,51,102,0,103,108,67,111,108,111,114,77,97,115,107,0,103,108,82,101,110,100,101,114,98,117,102,102,101,114,83,116,111,114,97,103,101,0,103,108,66,108,101,110,100,70,117,110,99,83,101,112,97,114,97,116,101,0,103,108,66,108,101,110,100,67,111,108,111,114,0,103,108,83,116,101,110,99,105,108,70,117,110,99,83,101,112,97,114,97,116,101,0,103,108,83,116,101,110,99,105,108,79,112,83,101,112,97,114,97,116,101,0,103,108,86,101,114,116,101,120,65,116,116,114,105,98,52,102,0,103,108,67,111,112,121,84,101,120,73,109,97,103,101,50,68,0,103,108,67,111,112,121,84,101,120,83,117,98,73,109,97,103,101,50,68,0,103,108,68,114,97,119,66,117,102,102,101,114,115,0,123,32,77,111,100,117,108,101,46,112,114,105,110,116,69,114,114,40,39,98,97,100,32,110,97,109,101,32,105,110,32,103,101,116,80,114,111,99,65,100,100,114,101,115,115,58,32,39,32,43,32,91,80,111,105,110,116,101,114,95,115,116,114,105,110,103,105,102,121,40,36,48,41,44,32,80,111,105,110,116,101,114,95,115,116,114,105,110,103,105,102,121,40,36,49,41,93,41,59,32,125,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,46,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,101,109,115,99,114,105,112,116,101,110,95,105,115,95,109,97,105,110,95,114,117,110,116,105,109,101,95,116,104,114,101,97,100,40,41,32,38,38,32,34,101,109,115,99,114,105,112,116,101,110,95,109,97,105,110,95,116,104,114,101,97,100,95,112,114,111,99,101,115,115,95,113,117,101,117,101,100,95,99,97,108,108,115,32,109,117,115,116,32,98,101,32,99,97,108,108,101,100,32,102,114,111,109,32,116,104,101,32,109,97,105,110,32,116,104,114,101,97,100,33,34,0,67,58,92,101,109,115,100,107,92,101,109,115,99,114,105,112,116,101,110,92,49,46,51,55,46,57,92,115,121,115,116,101,109,92,108,105,98,92,112,116,104,114,101,97,100,92,108,105,98,114,97,114,121,95,112,116,104,114,101,97,100,46,99,0,101,109,115,99,114,105,112,116,101,110,95,109,97,105,110,95,116,104,114,101,97,100,95,112,114,111,99,101,115,115,95,113,117,101,117,101,100,95,99,97,108,108,115,0,48,32,38,38,32,34,73,110,118,97,108,105,100,32,69,109,115,99,114,105,112,116,101,110,32,112,116,104,114,101,97,100,32,95,100,111,95,99,97,108,108,32,111,112,99,111,100,101,33,34,0,95,100,111,95,99,97,108,108,0,99,97,108,108,0,101,109,115,99,114,105,112,116,101,110,95,97,115,121,110,99,95,114,117,110,95,105,110,95,109,97,105,110,95,116,104,114,101,97,100,0,112,111,115,116,77,101,115,115,97,103,101,40,123,32,99,109,100,58,32,39,112,114,111,99,101,115,115,81,117,101,117,101,100,77,97,105,110,84,104,114,101,97,100,87,111,114,107,39,32,125,41,0], "i8", ALLOC_NONE, Runtime.GLOBAL_BASE+10240);
  1482. }
  1483. /* no memory initializer */
  1484. var tempDoublePtr;
  1485. if (!ENVIRONMENT_IS_PTHREAD) tempDoublePtr = Runtime.alignMemory(allocate(12, "i8", ALLOC_STATIC), 8);
  1486. assert(tempDoublePtr % 8 == 0);
  1487. function copyTempFloat(ptr) { // functions, because inlining this code increases code size too much
  1488. HEAP8[tempDoublePtr] = HEAP8[ptr];
  1489. HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];
  1490. HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];
  1491. HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];
  1492. }
  1493. function copyTempDouble(ptr) {
  1494. HEAP8[tempDoublePtr] = HEAP8[ptr];
  1495. HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];
  1496. HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];
  1497. HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];
  1498. HEAP8[tempDoublePtr+4] = HEAP8[ptr+4];
  1499. HEAP8[tempDoublePtr+5] = HEAP8[ptr+5];
  1500. HEAP8[tempDoublePtr+6] = HEAP8[ptr+6];
  1501. HEAP8[tempDoublePtr+7] = HEAP8[ptr+7];
  1502. }
  1503. // {{PRE_LIBRARY}}
  1504. var GL={counter:1,lastError:0,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:[],currentContext:null,offscreenCanvases:{},timerQueriesEXT:[],byteSizeByTypeRoot:5120,byteSizeByType:[1,1,2,2,4,4,4,2,3,4,8],programInfos:{},stringCache:{},tempFixedLengthArray:[],packAlignment:4,unpackAlignment:4,init:function () {
  1505. GL.miniTempBuffer = new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);
  1506. for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) {
  1507. GL.miniTempBufferViews[i] = GL.miniTempBuffer.subarray(0, i+1);
  1508. }
  1509. // For functions such as glDrawBuffers, glInvalidateFramebuffer and glInvalidateSubFramebuffer that need to pass a short array to the WebGL API,
  1510. // create a set of short fixed-length arrays to avoid having to generate any garbage when calling those functions.
  1511. for (var i = 0; i < 32; i++) {
  1512. GL.tempFixedLengthArray.push(new Array(i));
  1513. }
  1514. },recordError:function recordError(errorCode) {
  1515. if (!GL.lastError) {
  1516. GL.lastError = errorCode;
  1517. }
  1518. },getNewId:function (table) {
  1519. var ret = GL.counter++;
  1520. for (var i = table.length; i < ret; i++) {
  1521. table[i] = null;
  1522. }
  1523. return ret;
  1524. },MINI_TEMP_BUFFER_SIZE:256,miniTempBuffer:null,miniTempBufferViews:[0],getSource:function (shader, count, string, length) {
  1525. var source = '';
  1526. for (var i = 0; i < count; ++i) {
  1527. var frag;
  1528. if (length) {
  1529. var len = HEAP32[(((length)+(i*4))>>2)];
  1530. if (len < 0) {
  1531. frag = Pointer_stringify(HEAP32[(((string)+(i*4))>>2)]);
  1532. } else {
  1533. frag = Pointer_stringify(HEAP32[(((string)+(i*4))>>2)], len);
  1534. }
  1535. } else {
  1536. frag = Pointer_stringify(HEAP32[(((string)+(i*4))>>2)]);
  1537. }
  1538. source += frag;
  1539. }
  1540. return source;
  1541. },createContext:function (canvas, webGLContextAttributes) {
  1542. if (typeof webGLContextAttributes['majorVersion'] === 'undefined' && typeof webGLContextAttributes['minorVersion'] === 'undefined') {
  1543. webGLContextAttributes['majorVersion'] = 1;
  1544. webGLContextAttributes['minorVersion'] = 0;
  1545. }
  1546. var ctx;
  1547. var errorInfo = '?';
  1548. function onContextCreationError(event) {
  1549. errorInfo = event.statusMessage || errorInfo;
  1550. }
  1551. try {
  1552. canvas.addEventListener('webglcontextcreationerror', onContextCreationError, false);
  1553. try {
  1554. if (webGLContextAttributes['majorVersion'] == 1 && webGLContextAttributes['minorVersion'] == 0) {
  1555. ctx = canvas.getContext("webgl", webGLContextAttributes) || canvas.getContext("experimental-webgl", webGLContextAttributes);
  1556. } else if (webGLContextAttributes['majorVersion'] == 2 && webGLContextAttributes['minorVersion'] == 0) {
  1557. ctx = canvas.getContext("webgl2", webGLContextAttributes) || canvas.getContext("experimental-webgl2", webGLContextAttributes);
  1558. } else {
  1559. throw 'Unsupported WebGL context version ' + majorVersion + '.' + minorVersion + '!'
  1560. }
  1561. } finally {
  1562. canvas.removeEventListener('webglcontextcreationerror', onContextCreationError, false);
  1563. }
  1564. if (!ctx) throw ':(';
  1565. } catch (e) {
  1566. Module.print('Could not create canvas: ' + [errorInfo, e, JSON.stringify(webGLContextAttributes)]);
  1567. return 0;
  1568. }
  1569. // possible GL_DEBUG entry point: ctx = wrapDebugGL(ctx);
  1570. if (!ctx) return 0;
  1571. return GL.registerContext(ctx, webGLContextAttributes);
  1572. },registerContext:function (ctx, webGLContextAttributes) {
  1573. var handle = GL.getNewId(GL.contexts);
  1574. var context = {
  1575. handle: handle,
  1576. attributes: webGLContextAttributes,
  1577. version: webGLContextAttributes['majorVersion'],
  1578. GLctx: ctx
  1579. };
  1580. // Store the created context object so that we can access the context given a canvas without having to pass the parameters again.
  1581. if (ctx.canvas) ctx.canvas.GLctxObject = context;
  1582. GL.contexts[handle] = context;
  1583. if (typeof webGLContextAttributes['enableExtensionsByDefault'] === 'undefined' || webGLContextAttributes['enableExtensionsByDefault']) {
  1584. GL.initExtensions(context);
  1585. }
  1586. return handle;
  1587. },makeContextCurrent:function (contextHandle) {
  1588. var context = GL.contexts[contextHandle];
  1589. if (!context) return false;
  1590. GLctx = Module.ctx = context.GLctx; // Active WebGL context object.
  1591. GL.currentContext = context; // Active Emscripten GL layer context object.
  1592. return true;
  1593. },getContext:function (contextHandle) {
  1594. return GL.contexts[contextHandle];
  1595. },deleteContext:function (contextHandle) {
  1596. if (GL.currentContext === GL.contexts[contextHandle]) GL.currentContext = null;
  1597. if (typeof JSEvents === 'object') JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas); // Release all JS event handlers on the DOM element that the GL context is associated with since the context is now deleted.
  1598. if (GL.contexts[contextHandle] && GL.contexts[contextHandle].GLctx.canvas) GL.contexts[contextHandle].GLctx.canvas.GLctxObject = undefined; // Make sure the canvas object no longer refers to the context object so there are no GC surprises.
  1599. GL.contexts[contextHandle] = null;
  1600. },initExtensions:function (context) {
  1601. // If this function is called without a specific context object, init the extensions of the currently active context.
  1602. if (!context) context = GL.currentContext;
  1603. if (context.initExtensionsDone) return;
  1604. context.initExtensionsDone = true;
  1605. var GLctx = context.GLctx;
  1606. context.maxVertexAttribs = GLctx.getParameter(GLctx.MAX_VERTEX_ATTRIBS);
  1607. // Detect the presence of a few extensions manually, this GL interop layer itself will need to know if they exist.
  1608. if (context.version < 2) {
  1609. // Extension available from Firefox 26 and Google Chrome 30
  1610. var instancedArraysExt = GLctx.getExtension('ANGLE_instanced_arrays');
  1611. if (instancedArraysExt) {
  1612. GLctx['vertexAttribDivisor'] = function(index, divisor) { instancedArraysExt['vertexAttribDivisorANGLE'](index, divisor); };
  1613. GLctx['drawArraysInstanced'] = function(mode, first, count, primcount) { instancedArraysExt['drawArraysInstancedANGLE'](mode, first, count, primcount); };
  1614. GLctx['drawElementsInstanced'] = function(mode, count, type, indices, primcount) { instancedArraysExt['drawElementsInstancedANGLE'](mode, count, type, indices, primcount); };
  1615. }
  1616. // Extension available from Firefox 25 and WebKit
  1617. var vaoExt = GLctx.getExtension('OES_vertex_array_object');
  1618. if (vaoExt) {
  1619. GLctx['createVertexArray'] = function() { return vaoExt['createVertexArrayOES'](); };
  1620. GLctx['deleteVertexArray'] = function(vao) { vaoExt['deleteVertexArrayOES'](vao); };
  1621. GLctx['bindVertexArray'] = function(vao) { vaoExt['bindVertexArrayOES'](vao); };
  1622. GLctx['isVertexArray'] = function(vao) { return vaoExt['isVertexArrayOES'](vao); };
  1623. }
  1624. var drawBuffersExt = GLctx.getExtension('WEBGL_draw_buffers');
  1625. if (drawBuffersExt) {
  1626. GLctx['drawBuffers'] = function(n, bufs) { drawBuffersExt['drawBuffersWEBGL'](n, bufs); };
  1627. }
  1628. }
  1629. GLctx.disjointTimerQueryExt = GLctx.getExtension("EXT_disjoint_timer_query");
  1630. // These are the 'safe' feature-enabling extensions that don't add any performance impact related to e.g. debugging, and
  1631. // should be enabled by default so that client GLES2/GL code will not need to go through extra hoops to get its stuff working.
  1632. // As new extensions are ratified at http://www.khronos.org/registry/webgl/extensions/ , feel free to add your new extensions
  1633. // here, as long as they don't produce a performance impact for users that might not be using those extensions.
  1634. // E.g. debugging-related extensions should probably be off by default.
  1635. var automaticallyEnabledExtensions = [ "OES_texture_float", "OES_texture_half_float", "OES_standard_derivatives",
  1636. "OES_vertex_array_object", "WEBGL_compressed_texture_s3tc", "WEBGL_depth_texture",
  1637. "OES_element_index_uint", "EXT_texture_filter_anisotropic", "ANGLE_instanced_arrays",
  1638. "OES_texture_float_linear", "OES_texture_half_float_linear", "WEBGL_compressed_texture_atc",
  1639. "WEBGL_compressed_texture_pvrtc", "EXT_color_buffer_half_float", "WEBGL_color_buffer_float",
  1640. "EXT_frag_depth", "EXT_sRGB", "WEBGL_draw_buffers", "WEBGL_shared_resources",
  1641. "EXT_shader_texture_lod", "EXT_color_buffer_float"];
  1642. function shouldEnableAutomatically(extension) {
  1643. var ret = false;
  1644. automaticallyEnabledExtensions.forEach(function(include) {
  1645. if (ext.indexOf(include) != -1) {
  1646. ret = true;
  1647. }
  1648. });
  1649. return ret;
  1650. }
  1651. var exts = GLctx.getSupportedExtensions();
  1652. if (exts && exts.length > 0) {
  1653. GLctx.getSupportedExtensions().forEach(function(ext) {
  1654. if (automaticallyEnabledExtensions.indexOf(ext) != -1) {
  1655. GLctx.getExtension(ext); // Calling .getExtension enables that extension permanently, no need to store the return value to be enabled.
  1656. }
  1657. });
  1658. }
  1659. },populateUniformTable:function (program) {
  1660. var p = GL.programs[program];
  1661. GL.programInfos[program] = {
  1662. uniforms: {},
  1663. maxUniformLength: 0, // This is eagerly computed below, since we already enumerate all uniforms anyway.
  1664. maxAttributeLength: -1, // This is lazily computed and cached, computed when/if first asked, "-1" meaning not computed yet.
  1665. maxUniformBlockNameLength: -1 // Lazily computed as well
  1666. };
  1667. var ptable = GL.programInfos[program];
  1668. var utable = ptable.uniforms;
  1669. // A program's uniform table maps the string name of an uniform to an integer location of that uniform.
  1670. // The global GL.uniforms map maps integer locations to WebGLUniformLocations.
  1671. var numUniforms = GLctx.getProgramParameter(p, GLctx.ACTIVE_UNIFORMS);
  1672. for (var i = 0; i < numUniforms; ++i) {
  1673. var u = GLctx.getActiveUniform(p, i);
  1674. var name = u.name;
  1675. ptable.maxUniformLength = Math.max(ptable.maxUniformLength, name.length+1);
  1676. // Strip off any trailing array specifier we might have got, e.g. "[0]".
  1677. if (name.indexOf(']', name.length-1) !== -1) {
  1678. var ls = name.lastIndexOf('[');
  1679. name = name.slice(0, ls);
  1680. }
  1681. // Optimize memory usage slightly: If we have an array of uniforms, e.g. 'vec3 colors[3];', then
  1682. // only store the string 'colors' in utable, and 'colors[0]', 'colors[1]' and 'colors[2]' will be parsed as 'colors'+i.
  1683. // Note that for the GL.uniforms table, we still need to fetch the all WebGLUniformLocations for all the indices.
  1684. var loc = GLctx.getUniformLocation(p, name);
  1685. if (loc != null)
  1686. {
  1687. var id = GL.getNewId(GL.uniforms);
  1688. utable[name] = [u.size, id];
  1689. GL.uniforms[id] = loc;
  1690. for (var j = 1; j < u.size; ++j) {
  1691. var n = name + '['+j+']';
  1692. loc = GLctx.getUniformLocation(p, n);
  1693. id = GL.getNewId(GL.uniforms);
  1694. GL.uniforms[id] = loc;
  1695. }
  1696. }
  1697. }
  1698. }};function _emscripten_glIsRenderbuffer(renderbuffer) {
  1699. var rb = GL.renderbuffers[renderbuffer];
  1700. if (!rb) return 0;
  1701. return GLctx.isRenderbuffer(rb);
  1702. }
  1703. function _emscripten_glStencilMaskSeparate(x0, x1) { GLctx['stencilMaskSeparate'](x0, x1) }
  1704. function ___pthread_setcancelstate() { return 0 }
  1705. function _emscripten_get_now() { abort() }
  1706. function _emscripten_set_main_loop_timing(mode, value) {
  1707. Browser.mainLoop.timingMode = mode;
  1708. Browser.mainLoop.timingValue = value;
  1709. if (!Browser.mainLoop.func) {
  1710. console.error('emscripten_set_main_loop_timing: Cannot set timing mode for main loop since a main loop does not exist! Call emscripten_set_main_loop first to set one up.');
  1711. return 1; // Return non-zero on failure, can't set timing mode when there is no main loop.
  1712. }
  1713. if (mode == 0 /*EM_TIMING_SETTIMEOUT*/) {
  1714. Browser.mainLoop.scheduler = function Browser_mainLoop_scheduler_setTimeout() {
  1715. var timeUntilNextTick = Math.max(0, Browser.mainLoop.tickStartTime + value - _emscripten_get_now())|0;
  1716. setTimeout(Browser.mainLoop.runner, timeUntilNextTick); // doing this each time means that on exception, we stop
  1717. };
  1718. Browser.mainLoop.method = 'timeout';
  1719. } else if (mode == 1 /*EM_TIMING_RAF*/) {
  1720. Browser.mainLoop.scheduler = function Browser_mainLoop_scheduler_rAF() {
  1721. Browser.requestAnimationFrame(Browser.mainLoop.runner);
  1722. };
  1723. Browser.mainLoop.method = 'rAF';
  1724. } else if (mode == 2 /*EM_TIMING_SETIMMEDIATE*/) {
  1725. if (!window['setImmediate']) {
  1726. // Emulate setImmediate. (note: not a complete polyfill, we don't emulate clearImmediate() to keep code size to minimum, since not needed)
  1727. var setImmediates = [];
  1728. var emscriptenMainLoopMessageId = 'setimmediate';
  1729. function Browser_setImmediate_messageHandler(event) {
  1730. if (event.source === window && event.data === emscriptenMainLoopMessageId) {
  1731. event.stopPropagation();
  1732. setImmediates.shift()();
  1733. }
  1734. }
  1735. window.addEventListener("message", Browser_setImmediate_messageHandler, true);
  1736. window['setImmediate'] = function Browser_emulated_setImmediate(func) {
  1737. setImmediates.push(func);
  1738. if (ENVIRONMENT_IS_WORKER) {
  1739. if (Module['setImmediates'] === undefined) Module['setImmediates'] = [];
  1740. Module['setImmediates'].push(func);
  1741. window.postMessage({target: emscriptenMainLoopMessageId}); // In --proxy-to-worker, route the message via proxyClient.js
  1742. } else window.postMessage(emscriptenMainLoopMessageId, "*"); // On the main thread, can just send the message to itself.
  1743. }
  1744. }
  1745. Browser.mainLoop.scheduler = function Browser_mainLoop_scheduler_setImmediate() {
  1746. window['setImmediate'](Browser.mainLoop.runner);
  1747. };
  1748. Browser.mainLoop.method = 'immediate';
  1749. }
  1750. return 0;
  1751. }function _emscripten_set_main_loop(func, fps, simulateInfiniteLoop, arg, noSetTiming) {
  1752. Module['noExitRuntime'] = true;
  1753. assert(!Browser.mainLoop.func, 'emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters.');
  1754. Browser.mainLoop.func = func;
  1755. Browser.mainLoop.arg = arg;
  1756. var browserIterationFunc;
  1757. if (typeof arg !== 'undefined') {
  1758. browserIterationFunc = function() {
  1759. Module['dynCall_vi'](func, arg);
  1760. };
  1761. } else {
  1762. browserIterationFunc = function() {
  1763. Module['dynCall_v'](func);
  1764. };
  1765. }
  1766. var thisMainLoopId = Browser.mainLoop.currentlyRunningMainloop;
  1767. Browser.mainLoop.runner = function Browser_mainLoop_runner() {
  1768. if (ABORT) return;
  1769. if (Browser.mainLoop.queue.length > 0) {
  1770. var start = Date.now();
  1771. var blocker = Browser.mainLoop.queue.shift();
  1772. blocker.func(blocker.arg);
  1773. if (Browser.mainLoop.remainingBlockers) {
  1774. var remaining = Browser.mainLoop.remainingBlockers;
  1775. var next = remaining%1 == 0 ? remaining-1 : Math.floor(remaining);
  1776. if (blocker.counted) {
  1777. Browser.mainLoop.remainingBlockers = next;
  1778. } else {
  1779. // not counted, but move the progress along a tiny bit
  1780. next = next + 0.5; // do not steal all the next one's progress
  1781. Browser.mainLoop.remainingBlockers = (8*remaining + next)/9;
  1782. }
  1783. }
  1784. console.log('main loop blocker "' + blocker.name + '" took ' + (Date.now() - start) + ' ms'); //, left: ' + Browser.mainLoop.remainingBlockers);
  1785. Browser.mainLoop.updateStatus();
  1786. // catches pause/resume main loop from blocker execution
  1787. if (thisMainLoopId < Browser.mainLoop.currentlyRunningMainloop) return;
  1788. setTimeout(Browser.mainLoop.runner, 0);
  1789. return;
  1790. }
  1791. // catch pauses from non-main loop sources
  1792. if (thisMainLoopId < Browser.mainLoop.currentlyRunningMainloop) return;
  1793. // Implement very basic swap interval control
  1794. Browser.mainLoop.currentFrameNumber = Browser.mainLoop.currentFrameNumber + 1 | 0;
  1795. if (Browser.mainLoop.timingMode == 1/*EM_TIMING_RAF*/ && Browser.mainLoop.timingValue > 1 && Browser.mainLoop.currentFrameNumber % Browser.mainLoop.timingValue != 0) {
  1796. // Not the scheduled time to render this frame - skip.
  1797. Browser.mainLoop.scheduler();
  1798. return;
  1799. } else if (Browser.mainLoop.timingMode == 0/*EM_TIMING_SETTIMEOUT*/) {
  1800. Browser.mainLoop.tickStartTime = _emscripten_get_now();
  1801. }
  1802. // Signal GL rendering layer that processing of a new frame is about to start. This helps it optimize
  1803. // VBO double-buffering and reduce GPU stalls.
  1804. if (Browser.mainLoop.method === 'timeout' && Module.ctx) {
  1805. Module.printErr('Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!');
  1806. Browser.mainLoop.method = ''; // just warn once per call to set main loop
  1807. }
  1808. Browser.mainLoop.runIter(browserIterationFunc);
  1809. checkStackCookie();
  1810. // catch pauses from the main loop itself
  1811. if (thisMainLoopId < Browser.mainLoop.currentlyRunningMainloop) return;
  1812. // Queue new audio data. This is important to be right after the main loop invocation, so that we will immediately be able
  1813. // to queue the newest produced audio samples.
  1814. // TODO: Consider adding pre- and post- rAF callbacks so that GL.newRenderingFrameStarted() and SDL.audio.queueNewAudioData()
  1815. // do not need to be hardcoded into this function, but can be more generic.
  1816. if (typeof SDL === 'object' && SDL.audio && SDL.audio.queueNewAudioData) SDL.audio.queueNewAudioData();
  1817. Browser.mainLoop.scheduler();
  1818. }
  1819. if (!noSetTiming) {
  1820. if (fps && fps > 0) _emscripten_set_main_loop_timing(0/*EM_TIMING_SETTIMEOUT*/, 1000.0 / fps);
  1821. else _emscripten_set_main_loop_timing(1/*EM_TIMING_RAF*/, 1); // Do rAF by rendering each frame (no decimating)
  1822. Browser.mainLoop.scheduler();
  1823. }
  1824. if (simulateInfiniteLoop) {
  1825. throw 'SimulateInfiniteLoop';
  1826. }
  1827. }var Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function () {
  1828. Browser.mainLoop.scheduler = null;
  1829. Browser.mainLoop.currentlyRunningMainloop++; // Incrementing this signals the previous main loop that it's now become old, and it must return.
  1830. },resume:function () {
  1831. Browser.mainLoop.currentlyRunningMainloop++;
  1832. var timingMode = Browser.mainLoop.timingMode;
  1833. var timingValue = Browser.mainLoop.timingValue;
  1834. var func = Browser.mainLoop.func;
  1835. Browser.mainLoop.func = null;
  1836. _emscripten_set_main_loop(func, 0, false, Browser.mainLoop.arg, true /* do not set timing and call scheduler, we will do it on the next lines */);
  1837. _emscripten_set_main_loop_timing(timingMode, timingValue);
  1838. Browser.mainLoop.scheduler();
  1839. },updateStatus:function () {
  1840. if (Module['setStatus']) {
  1841. var message = Module['statusMessage'] || 'Please wait...';
  1842. var remaining = Browser.mainLoop.remainingBlockers;
  1843. var expected = Browser.mainLoop.expectedBlockers;
  1844. if (remaining) {
  1845. if (remaining < expected) {
  1846. Module['setStatus'](message + ' (' + (expected - remaining) + '/' + expected + ')');
  1847. } else {
  1848. Module['setStatus'](message);
  1849. }
  1850. } else {
  1851. Module['setStatus']('');
  1852. }
  1853. }
  1854. },runIter:function (func) {
  1855. if (ABORT) return;
  1856. if (Module['preMainLoop']) {
  1857. var preRet = Module['preMainLoop']();
  1858. if (preRet === false) {
  1859. return; // |return false| skips a frame
  1860. }
  1861. }
  1862. try {
  1863. func();
  1864. } catch (e) {
  1865. if (e instanceof ExitStatus) {
  1866. return;
  1867. } else {
  1868. if (e && typeof e === 'object' && e.stack) Module.printErr('exception thrown: ' + [e, e.stack]);
  1869. throw e;
  1870. }
  1871. }
  1872. if (Module['postMainLoop']) Module['postMainLoop']();
  1873. }},isFullscreen:false,pointerLock:false,moduleContextCreatedCallbacks:[],workers:[],init:function () {
  1874. if (!Module["preloadPlugins"]) Module["preloadPlugins"] = []; // needs to exist even in workers
  1875. if (Browser.initted) return;
  1876. Browser.initted = true;
  1877. try {
  1878. new Blob();
  1879. Browser.hasBlobConstructor = true;
  1880. } catch(e) {
  1881. Browser.hasBlobConstructor = false;
  1882. console.log("warning: no blob constructor, cannot create blobs with mimetypes");
  1883. }
  1884. Browser.BlobBuilder = typeof MozBlobBuilder != "undefined" ? MozBlobBuilder : (typeof WebKitBlobBuilder != "undefined" ? WebKitBlobBuilder : (!Browser.hasBlobConstructor ? console.log("warning: no BlobBuilder") : null));
  1885. Browser.URLObject = typeof window != "undefined" ? (window.URL ? window.URL : window.webkitURL) : undefined;
  1886. if (!Module.noImageDecoding && typeof Browser.URLObject === 'undefined') {
  1887. console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.");
  1888. Module.noImageDecoding = true;
  1889. }
  1890. // Support for plugins that can process preloaded files. You can add more of these to
  1891. // your app by creating and appending to Module.preloadPlugins.
  1892. //
  1893. // Each plugin is asked if it can handle a file based on the file's name. If it can,
  1894. // it is given the file's raw data. When it is done, it calls a callback with the file's
  1895. // (possibly modified) data. For example, a plugin might decompress a file, or it
  1896. // might create some side data structure for use later (like an Image element, etc.).
  1897. var imagePlugin = {};
  1898. imagePlugin['canHandle'] = function imagePlugin_canHandle(name) {
  1899. return !Module.noImageDecoding && /\.(jpg|jpeg|png|bmp)$/i.test(name);
  1900. };
  1901. imagePlugin['handle'] = function imagePlugin_handle(byteArray, name, onload, onerror) {
  1902. var b = null;
  1903. if (Browser.hasBlobConstructor) {
  1904. try {
  1905. b = new Blob([byteArray], { type: Browser.getMimetype(name) });
  1906. if (b.size !== byteArray.length) { // Safari bug #118630
  1907. // Safari's Blob can only take an ArrayBuffer
  1908. b = new Blob([(new Uint8Array(byteArray)).buffer], { type: Browser.getMimetype(name) });
  1909. }
  1910. } catch(e) {
  1911. Runtime.warnOnce('Blob constructor present but fails: ' + e + '; falling back to blob builder');
  1912. }
  1913. }
  1914. if (!b) {
  1915. var bb = new Browser.BlobBuilder();
  1916. bb.append((new Uint8Array(byteArray)).buffer); // we need to pass a buffer, and must copy the array to get the right data range
  1917. b = bb.getBlob();
  1918. }
  1919. var url = Browser.URLObject.createObjectURL(b);
  1920. assert(typeof url == 'string', 'createObjectURL must return a url as a string');
  1921. var img = new Image();
  1922. img.onload = function img_onload() {
  1923. assert(img.complete, 'Image ' + name + ' could not be decoded');
  1924. var canvas = document.createElement('canvas');
  1925. canvas.width = img.width;
  1926. canvas.height = img.height;
  1927. var ctx = canvas.getContext('2d');
  1928. ctx.drawImage(img, 0, 0);
  1929. Module["preloadedImages"][name] = canvas;
  1930. Browser.URLObject.revokeObjectURL(url);
  1931. if (onload) onload(byteArray);
  1932. };
  1933. img.onerror = function img_onerror(event) {
  1934. console.log('Image ' + url + ' could not be decoded');
  1935. if (onerror) onerror();
  1936. };
  1937. img.src = url;
  1938. };
  1939. Module['preloadPlugins'].push(imagePlugin);
  1940. var audioPlugin = {};
  1941. audioPlugin['canHandle'] = function audioPlugin_canHandle(name) {
  1942. return !Module.noAudioDecoding && name.substr(-4) in { '.ogg': 1, '.wav': 1, '.mp3': 1 };
  1943. };
  1944. audioPlugin['handle'] = function audioPlugin_handle(byteArray, name, onload, onerror) {
  1945. var done = false;
  1946. function finish(audio) {
  1947. if (done) return;
  1948. done = true;
  1949. Module["preloadedAudios"][name] = audio;
  1950. if (onload) onload(byteArray);
  1951. }
  1952. function fail() {
  1953. if (done) return;
  1954. done = true;
  1955. Module["preloadedAudios"][name] = new Audio(); // empty shim
  1956. if (onerror) onerror();
  1957. }
  1958. if (Browser.hasBlobConstructor) {
  1959. try {
  1960. var b = new Blob([byteArray], { type: Browser.getMimetype(name) });
  1961. } catch(e) {
  1962. return fail();
  1963. }
  1964. var url = Browser.URLObject.createObjectURL(b); // XXX we never revoke this!
  1965. assert(typeof url == 'string', 'createObjectURL must return a url as a string');
  1966. var audio = new Audio();
  1967. audio.addEventListener('canplaythrough', function() { finish(audio) }, false); // use addEventListener due to chromium bug 124926
  1968. audio.onerror = function audio_onerror(event) {
  1969. if (done) return;
  1970. console.log('warning: browser could not fully decode audio ' + name + ', trying slower base64 approach');
  1971. function encode64(data) {
  1972. var BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  1973. var PAD = '=';
  1974. var ret = '';
  1975. var leftchar = 0;
  1976. var leftbits = 0;
  1977. for (var i = 0; i < data.length; i++) {
  1978. leftchar = (leftchar << 8) | data[i];
  1979. leftbits += 8;
  1980. while (leftbits >= 6) {
  1981. var curr = (leftchar >> (leftbits-6)) & 0x3f;
  1982. leftbits -= 6;
  1983. ret += BASE[curr];
  1984. }
  1985. }
  1986. if (leftbits == 2) {
  1987. ret += BASE[(leftchar&3) << 4];
  1988. ret += PAD + PAD;
  1989. } else if (leftbits == 4) {
  1990. ret += BASE[(leftchar&0xf) << 2];
  1991. ret += PAD;
  1992. }
  1993. return ret;
  1994. }
  1995. audio.src = 'data:audio/x-' + name.substr(-3) + ';base64,' + encode64(byteArray);
  1996. finish(audio); // we don't wait for confirmation this worked - but it's worth trying
  1997. };
  1998. audio.src = url;
  1999. // workaround for chrome bug 124926 - we do not always get oncanplaythrough or onerror
  2000. Browser.safeSetTimeout(function() {
  2001. finish(audio); // try to use it even though it is not necessarily ready to play
  2002. }, 10000);
  2003. } else {
  2004. return fail();
  2005. }
  2006. };
  2007. Module['preloadPlugins'].push(audioPlugin);
  2008. // Canvas event setup
  2009. function pointerLockChange() {
  2010. Browser.pointerLock = document['pointerLockElement'] === Module['canvas'] ||
  2011. document['mozPointerLockElement'] === Module['canvas'] ||
  2012. document['webkitPointerLockElement'] === Module['canvas'] ||
  2013. document['msPointerLockElement'] === Module['canvas'];
  2014. }
  2015. var canvas = Module['canvas'];
  2016. if (canvas) {
  2017. // forced aspect ratio can be enabled by defining 'forcedAspectRatio' on Module
  2018. // Module['forcedAspectRatio'] = 4 / 3;
  2019. canvas.requestPointerLock = canvas['requestPointerLock'] ||
  2020. canvas['mozRequestPointerLock'] ||
  2021. canvas['webkitRequestPointerLock'] ||
  2022. canvas['msRequestPointerLock'] ||
  2023. function(){};
  2024. canvas.exitPointerLock = document['exitPointerLock'] ||
  2025. document['mozExitPointerLock'] ||
  2026. document['webkitExitPointerLock'] ||
  2027. document['msExitPointerLock'] ||
  2028. function(){}; // no-op if function does not exist
  2029. canvas.exitPointerLock = canvas.exitPointerLock.bind(document);
  2030. document.addEventListener('pointerlockchange', pointerLockChange, false);
  2031. document.addEventListener('mozpointerlockchange', pointerLockChange, false);
  2032. document.addEventListener('webkitpointerlockchange', pointerLockChange, false);
  2033. document.addEventListener('mspointerlockchange', pointerLockChange, false);
  2034. if (Module['elementPointerLock']) {
  2035. canvas.addEventListener("click", function(ev) {
  2036. if (!Browser.pointerLock && Module['canvas'].requestPointerLock) {
  2037. Module['canvas'].requestPointerLock();
  2038. ev.preventDefault();
  2039. }
  2040. }, false);
  2041. }
  2042. }
  2043. },createContext:function (canvas, useWebGL, setInModule, webGLContextAttributes) {
  2044. if (useWebGL && Module.ctx && canvas == Module.canvas) return Module.ctx; // no need to recreate GL context if it's already been created for this canvas.
  2045. var ctx;
  2046. var contextHandle;
  2047. if (useWebGL) {
  2048. // For GLES2/desktop GL compatibility, adjust a few defaults to be different to WebGL defaults, so that they align better with the desktop defaults.
  2049. var contextAttributes = {
  2050. antialias: false,
  2051. alpha: false
  2052. };
  2053. if (webGLContextAttributes) {
  2054. for (var attribute in webGLContextAttributes) {
  2055. contextAttributes[attribute] = webGLContextAttributes[attribute];
  2056. }
  2057. }
  2058. contextHandle = GL.createContext(canvas, contextAttributes);
  2059. if (contextHandle) {
  2060. ctx = GL.getContext(contextHandle).GLctx;
  2061. }
  2062. } else {
  2063. ctx = canvas.getContext('2d');
  2064. }
  2065. if (!ctx) return null;
  2066. if (setInModule) {
  2067. if (!useWebGL) assert(typeof GLctx === 'undefined', 'cannot set in module if GLctx is used, but we are a non-GL context that would replace it');
  2068. Module.ctx = ctx;
  2069. if (useWebGL) GL.makeContextCurrent(contextHandle);
  2070. Module.useWebGL = useWebGL;
  2071. Browser.moduleContextCreatedCallbacks.forEach(function(callback) { callback() });
  2072. Browser.init();
  2073. }
  2074. return ctx;
  2075. },destroyContext:function (canvas, useWebGL, setInModule) {},fullscreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullscreen:function (lockPointer, resizeCanvas, vrDevice) {
  2076. Browser.lockPointer = lockPointer;
  2077. Browser.resizeCanvas = resizeCanvas;
  2078. Browser.vrDevice = vrDevice;
  2079. if (typeof Browser.lockPointer === 'undefined') Browser.lockPointer = true;
  2080. if (typeof Browser.resizeCanvas === 'undefined') Browser.resizeCanvas = false;
  2081. if (typeof Browser.vrDevice === 'undefined') Browser.vrDevice = null;
  2082. var canvas = Module['canvas'];
  2083. function fullscreenChange() {
  2084. Browser.isFullscreen = false;
  2085. var canvasContainer = canvas.parentNode;
  2086. if ((document['fullscreenElement'] || document['mozFullScreenElement'] ||
  2087. document['msFullscreenElement'] || document['webkitFullscreenElement'] ||
  2088. document['webkitCurrentFullScreenElement']) === canvasContainer) {
  2089. canvas.exitFullscreen = document['exitFullscreen'] ||
  2090. document['cancelFullScreen'] ||
  2091. document['mozCancelFullScreen'] ||
  2092. document['msExitFullscreen'] ||
  2093. document['webkitCancelFullScreen'] ||
  2094. function() {};
  2095. canvas.exitFullscreen = canvas.exitFullscreen.bind(document);
  2096. if (Browser.lockPointer) canvas.requestPointerLock();
  2097. Browser.isFullscreen = true;
  2098. if (Browser.resizeCanvas) Browser.setFullscreenCanvasSize();
  2099. } else {
  2100. // remove the full screen specific parent of the canvas again to restore the HTML structure from before going full screen
  2101. canvasContainer.parentNode.insertBefore(canvas, canvasContainer);
  2102. canvasContainer.parentNode.removeChild(canvasContainer);
  2103. if (Browser.resizeCanvas) Browser.setWindowedCanvasSize();
  2104. }
  2105. if (Module['onFullScreen']) Module['onFullScreen'](Browser.isFullscreen);
  2106. if (Module['onFullscreen']) Module['onFullscreen'](Browser.isFullscreen);
  2107. Browser.updateCanvasDimensions(canvas);
  2108. }
  2109. if (!Browser.fullscreenHandlersInstalled) {
  2110. Browser.fullscreenHandlersInstalled = true;
  2111. document.addEventListener('fullscreenchange', fullscreenChange, false);
  2112. document.addEventListener('mozfullscreenchange', fullscreenChange, false);
  2113. document.addEventListener('webkitfullscreenchange', fullscreenChange, false);
  2114. document.addEventListener('MSFullscreenChange', fullscreenChange, false);
  2115. }
  2116. // create a new parent to ensure the canvas has no siblings. this allows browsers to optimize full screen performance when its parent is the full screen root
  2117. var canvasContainer = document.createElement("div");
  2118. canvas.parentNode.insertBefore(canvasContainer, canvas);
  2119. canvasContainer.appendChild(canvas);
  2120. // use parent of canvas as full screen root to allow aspect ratio correction (Firefox stretches the root to screen size)
  2121. canvasContainer.requestFullscreen = canvasContainer['requestFullscreen'] ||
  2122. canvasContainer['mozRequestFullScreen'] ||
  2123. canvasContainer['msRequestFullscreen'] ||
  2124. (canvasContainer['webkitRequestFullscreen'] ? function() { canvasContainer['webkitRequestFullscreen'](Element['ALLOW_KEYBOARD_INPUT']) } : null) ||
  2125. (canvasContainer['webkitRequestFullScreen'] ? function() { canvasContainer['webkitRequestFullScreen'](Element['ALLOW_KEYBOARD_INPUT']) } : null);
  2126. if (vrDevice) {
  2127. canvasContainer.requestFullscreen({ vrDisplay: vrDevice });
  2128. } else {
  2129. canvasContainer.requestFullscreen();
  2130. }
  2131. },requestFullScreen:function (lockPointer, resizeCanvas, vrDevice) {
  2132. Module.printErr('Browser.requestFullScreen() is deprecated. Please call Browser.requestFullscreen instead.');
  2133. Browser.requestFullScreen = function(lockPointer, resizeCanvas, vrDevice) {
  2134. return Browser.requestFullscreen(lockPointer, resizeCanvas, vrDevice);
  2135. }
  2136. return Browser.requestFullscreen(lockPointer, resizeCanvas, vrDevice);
  2137. },nextRAF:0,fakeRequestAnimationFrame:function (func) {
  2138. // try to keep 60fps between calls to here
  2139. var now = Date.now();
  2140. if (Browser.nextRAF === 0) {
  2141. Browser.nextRAF = now + 1000/60;
  2142. } else {
  2143. while (now + 2 >= Browser.nextRAF) { // fudge a little, to avoid timer jitter causing us to do lots of delay:0
  2144. Browser.nextRAF += 1000/60;
  2145. }
  2146. }
  2147. var delay = Math.max(Browser.nextRAF - now, 0);
  2148. setTimeout(func, delay);
  2149. },requestAnimationFrame:function requestAnimationFrame(func) {
  2150. if (typeof window === 'undefined') { // Provide fallback to setTimeout if window is undefined (e.g. in Node.js)
  2151. Browser.fakeRequestAnimationFrame(func);
  2152. } else {
  2153. if (!window.requestAnimationFrame) {
  2154. window.requestAnimationFrame = window['requestAnimationFrame'] ||
  2155. window['mozRequestAnimationFrame'] ||
  2156. window['webkitRequestAnimationFrame'] ||
  2157. window['msRequestAnimationFrame'] ||
  2158. window['oRequestAnimationFrame'] ||
  2159. Browser.fakeRequestAnimationFrame;
  2160. }
  2161. window.requestAnimationFrame(func);
  2162. }
  2163. },safeCallback:function (func) {
  2164. return function() {
  2165. if (!ABORT) return func.apply(null, arguments);
  2166. };
  2167. },allowAsyncCallbacks:true,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function () {
  2168. Browser.allowAsyncCallbacks = false;
  2169. },resumeAsyncCallbacks:function () { // marks future callbacks as ok to execute, and synchronously runs any remaining ones right now
  2170. Browser.allowAsyncCallbacks = true;
  2171. if (Browser.queuedAsyncCallbacks.length > 0) {
  2172. var callbacks = Browser.queuedAsyncCallbacks;
  2173. Browser.queuedAsyncCallbacks = [];
  2174. callbacks.forEach(function(func) {
  2175. func();
  2176. });
  2177. }
  2178. },safeRequestAnimationFrame:function (func) {
  2179. return Browser.requestAnimationFrame(function() {
  2180. if (ABORT) return;
  2181. if (Browser.allowAsyncCallbacks) {
  2182. func();
  2183. } else {
  2184. Browser.queuedAsyncCallbacks.push(func);
  2185. }
  2186. });
  2187. },safeSetTimeout:function (func, timeout) {
  2188. Module['noExitRuntime'] = true;
  2189. return setTimeout(function() {
  2190. if (ABORT) return;
  2191. if (Browser.allowAsyncCallbacks) {
  2192. func();
  2193. } else {
  2194. Browser.queuedAsyncCallbacks.push(func);
  2195. }
  2196. }, timeout);
  2197. },safeSetInterval:function (func, timeout) {
  2198. Module['noExitRuntime'] = true;
  2199. return setInterval(function() {
  2200. if (ABORT) return;
  2201. if (Browser.allowAsyncCallbacks) {
  2202. func();
  2203. } // drop it on the floor otherwise, next interval will kick in
  2204. }, timeout);
  2205. },getMimetype:function (name) {
  2206. return {
  2207. 'jpg': 'image/jpeg',
  2208. 'jpeg': 'image/jpeg',
  2209. 'png': 'image/png',
  2210. 'bmp': 'image/bmp',
  2211. 'ogg': 'audio/ogg',
  2212. 'wav': 'audio/wav',
  2213. 'mp3': 'audio/mpeg'
  2214. }[name.substr(name.lastIndexOf('.')+1)];
  2215. },getUserMedia:function (func) {
  2216. if(!window.getUserMedia) {
  2217. window.getUserMedia = navigator['getUserMedia'] ||
  2218. navigator['mozGetUserMedia'];
  2219. }
  2220. window.getUserMedia(func);
  2221. },getMovementX:function (event) {
  2222. return event['movementX'] ||
  2223. event['mozMovementX'] ||
  2224. event['webkitMovementX'] ||
  2225. 0;
  2226. },getMovementY:function (event) {
  2227. return event['movementY'] ||
  2228. event['mozMovementY'] ||
  2229. event['webkitMovementY'] ||
  2230. 0;
  2231. },getMouseWheelDelta:function (event) {
  2232. var delta = 0;
  2233. switch (event.type) {
  2234. case 'DOMMouseScroll':
  2235. delta = event.detail;
  2236. break;
  2237. case 'mousewheel':
  2238. delta = event.wheelDelta;
  2239. break;
  2240. case 'wheel':
  2241. delta = event['deltaY'];
  2242. break;
  2243. default:
  2244. throw 'unrecognized mouse wheel event: ' + event.type;
  2245. }
  2246. return delta;
  2247. },mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function (event) { // event should be mousemove, mousedown or mouseup
  2248. if (Browser.pointerLock) {
  2249. // When the pointer is locked, calculate the coordinates
  2250. // based on the movement of the mouse.
  2251. // Workaround for Firefox bug 764498
  2252. if (event.type != 'mousemove' &&
  2253. ('mozMovementX' in event)) {
  2254. Browser.mouseMovementX = Browser.mouseMovementY = 0;
  2255. } else {
  2256. Browser.mouseMovementX = Browser.getMovementX(event);
  2257. Browser.mouseMovementY = Browser.getMovementY(event);
  2258. }
  2259. // check if SDL is available
  2260. if (typeof SDL != "undefined") {
  2261. Browser.mouseX = SDL.mouseX + Browser.mouseMovementX;
  2262. Browser.mouseY = SDL.mouseY + Browser.mouseMovementY;
  2263. } else {
  2264. // just add the mouse delta to the current absolut mouse position
  2265. // FIXME: ideally this should be clamped against the canvas size and zero
  2266. Browser.mouseX += Browser.mouseMovementX;
  2267. Browser.mouseY += Browser.mouseMovementY;
  2268. }
  2269. } else {
  2270. // Otherwise, calculate the movement based on the changes
  2271. // in the coordinates.
  2272. var rect = Module["canvas"].getBoundingClientRect();
  2273. var cw = Module["canvas"].width;
  2274. var ch = Module["canvas"].height;
  2275. // Neither .scrollX or .pageXOffset are defined in a spec, but
  2276. // we prefer .scrollX because it is currently in a spec draft.
  2277. // (see: http://www.w3.org/TR/2013/WD-cssom-view-20131217/)
  2278. var scrollX = ((typeof window.scrollX !== 'undefined') ? window.scrollX : window.pageXOffset);
  2279. var scrollY = ((typeof window.scrollY !== 'undefined') ? window.scrollY : window.pageYOffset);
  2280. // If this assert lands, it's likely because the browser doesn't support scrollX or pageXOffset
  2281. // and we have no viable fallback.
  2282. assert((typeof scrollX !== 'undefined') && (typeof scrollY !== 'undefined'), 'Unable to retrieve scroll position, mouse positions likely broken.');
  2283. if (event.type === 'touchstart' || event.type === 'touchend' || event.type === 'touchmove') {
  2284. var touch = event.touch;
  2285. if (touch === undefined) {
  2286. return; // the "touch" property is only defined in SDL
  2287. }
  2288. var adjustedX = touch.pageX - (scrollX + rect.left);
  2289. var adjustedY = touch.pageY - (scrollY + rect.top);
  2290. adjustedX = adjustedX * (cw / rect.width);
  2291. adjustedY = adjustedY * (ch / rect.height);
  2292. var coords = { x: adjustedX, y: adjustedY };
  2293. if (event.type === 'touchstart') {
  2294. Browser.lastTouches[touch.identifier] = coords;
  2295. Browser.touches[touch.identifier] = coords;
  2296. } else if (event.type === 'touchend' || event.type === 'touchmove') {
  2297. var last = Browser.touches[touch.identifier];
  2298. if (!last) last = coords;
  2299. Browser.lastTouches[touch.identifier] = last;
  2300. Browser.touches[touch.identifier] = coords;
  2301. }
  2302. return;
  2303. }
  2304. var x = event.pageX - (scrollX + rect.left);
  2305. var y = event.pageY - (scrollY + rect.top);
  2306. // the canvas might be CSS-scaled compared to its backbuffer;
  2307. // SDL-using content will want mouse coordinates in terms
  2308. // of backbuffer units.
  2309. x = x * (cw / rect.width);
  2310. y = y * (ch / rect.height);
  2311. Browser.mouseMovementX = x - Browser.mouseX;
  2312. Browser.mouseMovementY = y - Browser.mouseY;
  2313. Browser.mouseX = x;
  2314. Browser.mouseY = y;
  2315. }
  2316. },asyncLoad:function (url, onload, onerror, noRunDep) {
  2317. var dep = !noRunDep ? getUniqueRunDependency('al ' + url) : '';
  2318. Module['readAsync'](url, function(arrayBuffer) {
  2319. assert(arrayBuffer, 'Loading data file "' + url + '" failed (no arrayBuffer).');
  2320. onload(new Uint8Array(arrayBuffer));
  2321. if (dep) removeRunDependency(dep);
  2322. }, function(event) {
  2323. if (onerror) {
  2324. onerror();
  2325. } else {
  2326. throw 'Loading data file "' + url + '" failed.';
  2327. }
  2328. });
  2329. if (dep) addRunDependency(dep);
  2330. },resizeListeners:[],updateResizeListeners:function () {
  2331. var canvas = Module['canvas'];
  2332. Browser.resizeListeners.forEach(function(listener) {
  2333. listener(canvas.width, canvas.height);
  2334. });
  2335. },setCanvasSize:function (width, height, noUpdates) {
  2336. var canvas = Module['canvas'];
  2337. Browser.updateCanvasDimensions(canvas, width, height);
  2338. if (!noUpdates) Browser.updateResizeListeners();
  2339. },windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function () {
  2340. // check if SDL is available
  2341. if (typeof SDL != "undefined") {
  2342. var flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];
  2343. flags = flags | 0x00800000; // set SDL_FULLSCREEN flag
  2344. HEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags
  2345. }
  2346. Browser.updateResizeListeners();
  2347. },setWindowedCanvasSize:function () {
  2348. // check if SDL is available
  2349. if (typeof SDL != "undefined") {
  2350. var flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];
  2351. flags = flags & ~0x00800000; // clear SDL_FULLSCREEN flag
  2352. HEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags
  2353. }
  2354. Browser.updateResizeListeners();
  2355. },updateCanvasDimensions:function (canvas, wNative, hNative) {
  2356. if (wNative && hNative) {
  2357. canvas.widthNative = wNative;
  2358. canvas.heightNative = hNative;
  2359. } else {
  2360. wNative = canvas.widthNative;
  2361. hNative = canvas.heightNative;
  2362. }
  2363. var w = wNative;
  2364. var h = hNative;
  2365. if (Module['forcedAspectRatio'] && Module['forcedAspectRatio'] > 0) {
  2366. if (w/h < Module['forcedAspectRatio']) {
  2367. w = Math.round(h * Module['forcedAspectRatio']);
  2368. } else {
  2369. h = Math.round(w / Module['forcedAspectRatio']);
  2370. }
  2371. }
  2372. if (((document['fullscreenElement'] || document['mozFullScreenElement'] ||
  2373. document['msFullscreenElement'] || document['webkitFullscreenElement'] ||
  2374. document['webkitCurrentFullScreenElement']) === canvas.parentNode) && (typeof screen != 'undefined')) {
  2375. var factor = Math.min(screen.width / w, screen.height / h);
  2376. w = Math.round(w * factor);
  2377. h = Math.round(h * factor);
  2378. }
  2379. if (Browser.resizeCanvas) {
  2380. if (canvas.width != w) canvas.width = w;
  2381. if (canvas.height != h) canvas.height = h;
  2382. if (typeof canvas.style != 'undefined') {
  2383. canvas.style.removeProperty( "width");
  2384. canvas.style.removeProperty("height");
  2385. }
  2386. } else {
  2387. if (canvas.width != wNative) canvas.width = wNative;
  2388. if (canvas.height != hNative) canvas.height = hNative;
  2389. if (typeof canvas.style != 'undefined') {
  2390. if (w != wNative || h != hNative) {
  2391. canvas.style.setProperty( "width", w + "px", "important");
  2392. canvas.style.setProperty("height", h + "px", "important");
  2393. } else {
  2394. canvas.style.removeProperty( "width");
  2395. canvas.style.removeProperty("height");
  2396. }
  2397. }
  2398. }
  2399. },wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:function () {
  2400. var handle = Browser.nextWgetRequestHandle;
  2401. Browser.nextWgetRequestHandle++;
  2402. return handle;
  2403. }};var GLFW={Window:function (id, width, height, title, monitor, share) {
  2404. this.id = id;
  2405. this.x = 0;
  2406. this.y = 0;
  2407. this.fullscreen = false; // Used to determine if app in fullscreen mode
  2408. this.storedX = 0; // Used to store X before fullscreen
  2409. this.storedY = 0; // Used to store Y before fullscreen
  2410. this.width = width;
  2411. this.height = height;
  2412. this.storedWidth = width; // Used to store width before fullscreen
  2413. this.storedHeight = height; // Used to store height before fullscreen
  2414. this.title = title;
  2415. this.monitor = monitor;
  2416. this.share = share;
  2417. this.attributes = GLFW.hints;
  2418. this.inputModes = {
  2419. 0x00033001:0x00034001, // GLFW_CURSOR (GLFW_CURSOR_NORMAL)
  2420. 0x00033002:0, // GLFW_STICKY_KEYS
  2421. 0x00033003:0, // GLFW_STICKY_MOUSE_BUTTONS
  2422. };
  2423. this.buttons = 0;
  2424. this.keys = new Array();
  2425. this.shouldClose = 0;
  2426. this.title = null;
  2427. this.windowPosFunc = null; // GLFWwindowposfun
  2428. this.windowSizeFunc = null; // GLFWwindowsizefun
  2429. this.windowCloseFunc = null; // GLFWwindowclosefun
  2430. this.windowRefreshFunc = null; // GLFWwindowrefreshfun
  2431. this.windowFocusFunc = null; // GLFWwindowfocusfun
  2432. this.windowIconifyFunc = null; // GLFWwindowiconifyfun
  2433. this.framebufferSizeFunc = null; // GLFWframebuffersizefun
  2434. this.mouseButtonFunc = null; // GLFWmousebuttonfun
  2435. this.cursorPosFunc = null; // GLFWcursorposfun
  2436. this.cursorEnterFunc = null; // GLFWcursorenterfun
  2437. this.scrollFunc = null; // GLFWscrollfun
  2438. this.keyFunc = null; // GLFWkeyfun
  2439. this.charFunc = null; // GLFWcharfun
  2440. this.userptr = null;
  2441. },WindowFromId:function (id) {
  2442. if (id <= 0 || !GLFW.windows) return null;
  2443. return GLFW.windows[id - 1];
  2444. },errorFunc:null,monitorFunc:null,active:null,windows:null,monitors:null,monitorString:null,versionString:null,initialTime:null,extensions:null,hints:null,defaultHints:{131073:0,131074:0,131075:1,131076:1,131077:1,135169:8,135170:8,135171:8,135172:8,135173:24,135174:8,135175:0,135176:0,135177:0,135178:0,135179:0,135180:0,135181:0,135182:0,135183:0,139265:196609,139266:1,139267:0,139268:0,139269:0,139270:0,139271:0,139272:0},DOMToGLFWKeyCode:function (keycode) {
  2445. switch (keycode) {
  2446. // these keycodes are only defined for GLFW3, assume they are the same for GLFW2
  2447. case 0x20:return 32; // DOM_VK_SPACE -> GLFW_KEY_SPACE
  2448. case 0xDE:return 39; // DOM_VK_QUOTE -> GLFW_KEY_APOSTROPHE
  2449. case 0xBC:return 44; // DOM_VK_COMMA -> GLFW_KEY_COMMA
  2450. case 0xAD:return 45; // DOM_VK_HYPHEN_MINUS -> GLFW_KEY_MINUS
  2451. case 0xBD:return 45; // DOM_VK_MINUS -> GLFW_KEY_MINUS
  2452. case 0xBE:return 46; // DOM_VK_PERIOD -> GLFW_KEY_PERIOD
  2453. case 0xBF:return 47; // DOM_VK_SLASH -> GLFW_KEY_SLASH
  2454. case 0x30:return 48; // DOM_VK_0 -> GLFW_KEY_0
  2455. case 0x31:return 49; // DOM_VK_1 -> GLFW_KEY_1
  2456. case 0x32:return 50; // DOM_VK_2 -> GLFW_KEY_2
  2457. case 0x33:return 51; // DOM_VK_3 -> GLFW_KEY_3
  2458. case 0x34:return 52; // DOM_VK_4 -> GLFW_KEY_4
  2459. case 0x35:return 53; // DOM_VK_5 -> GLFW_KEY_5
  2460. case 0x36:return 54; // DOM_VK_6 -> GLFW_KEY_6
  2461. case 0x37:return 55; // DOM_VK_7 -> GLFW_KEY_7
  2462. case 0x38:return 56; // DOM_VK_8 -> GLFW_KEY_8
  2463. case 0x39:return 57; // DOM_VK_9 -> GLFW_KEY_9
  2464. case 0x3B:return 59; // DOM_VK_SEMICOLON -> GLFW_KEY_SEMICOLON
  2465. case 0x3D:return 61; // DOM_VK_EQUALS -> GLFW_KEY_EQUAL
  2466. case 0xBB:return 61; // DOM_VK_EQUALS -> GLFW_KEY_EQUAL
  2467. case 0x41:return 65; // DOM_VK_A -> GLFW_KEY_A
  2468. case 0x42:return 66; // DOM_VK_B -> GLFW_KEY_B
  2469. case 0x43:return 67; // DOM_VK_C -> GLFW_KEY_C
  2470. case 0x44:return 68; // DOM_VK_D -> GLFW_KEY_D
  2471. case 0x45:return 69; // DOM_VK_E -> GLFW_KEY_E
  2472. case 0x46:return 70; // DOM_VK_F -> GLFW_KEY_F
  2473. case 0x47:return 71; // DOM_VK_G -> GLFW_KEY_G
  2474. case 0x48:return 72; // DOM_VK_H -> GLFW_KEY_H
  2475. case 0x49:return 73; // DOM_VK_I -> GLFW_KEY_I
  2476. case 0x4A:return 74; // DOM_VK_J -> GLFW_KEY_J
  2477. case 0x4B:return 75; // DOM_VK_K -> GLFW_KEY_K
  2478. case 0x4C:return 76; // DOM_VK_L -> GLFW_KEY_L
  2479. case 0x4D:return 77; // DOM_VK_M -> GLFW_KEY_M
  2480. case 0x4E:return 78; // DOM_VK_N -> GLFW_KEY_N
  2481. case 0x4F:return 79; // DOM_VK_O -> GLFW_KEY_O
  2482. case 0x50:return 80; // DOM_VK_P -> GLFW_KEY_P
  2483. case 0x51:return 81; // DOM_VK_Q -> GLFW_KEY_Q
  2484. case 0x52:return 82; // DOM_VK_R -> GLFW_KEY_R
  2485. case 0x53:return 83; // DOM_VK_S -> GLFW_KEY_S
  2486. case 0x54:return 84; // DOM_VK_T -> GLFW_KEY_T
  2487. case 0x55:return 85; // DOM_VK_U -> GLFW_KEY_U
  2488. case 0x56:return 86; // DOM_VK_V -> GLFW_KEY_V
  2489. case 0x57:return 87; // DOM_VK_W -> GLFW_KEY_W
  2490. case 0x58:return 88; // DOM_VK_X -> GLFW_KEY_X
  2491. case 0x59:return 89; // DOM_VK_Y -> GLFW_KEY_Y
  2492. case 0x5a:return 90; // DOM_VK_Z -> GLFW_KEY_Z
  2493. case 0xDB:return 91; // DOM_VK_OPEN_BRACKET -> GLFW_KEY_LEFT_BRACKET
  2494. case 0xDC:return 92; // DOM_VK_BACKSLASH -> GLFW_KEY_BACKSLASH
  2495. case 0xDD:return 93; // DOM_VK_CLOSE_BRACKET -> GLFW_KEY_RIGHT_BRACKET
  2496. case 0xC0:return 94; // DOM_VK_BACK_QUOTE -> GLFW_KEY_GRAVE_ACCENT
  2497. case 0x1B:return 256; // DOM_VK_ESCAPE -> GLFW_KEY_ESCAPE
  2498. case 0x0D:return 257; // DOM_VK_RETURN -> GLFW_KEY_ENTER
  2499. case 0x09:return 258; // DOM_VK_TAB -> GLFW_KEY_TAB
  2500. case 0x08:return 259; // DOM_VK_BACK -> GLFW_KEY_BACKSPACE
  2501. case 0x2D:return 260; // DOM_VK_INSERT -> GLFW_KEY_INSERT
  2502. case 0x2E:return 261; // DOM_VK_DELETE -> GLFW_KEY_DELETE
  2503. case 0x27:return 262; // DOM_VK_RIGHT -> GLFW_KEY_RIGHT
  2504. case 0x25:return 263; // DOM_VK_LEFT -> GLFW_KEY_LEFT
  2505. case 0x28:return 264; // DOM_VK_DOWN -> GLFW_KEY_DOWN
  2506. case 0x26:return 265; // DOM_VK_UP -> GLFW_KEY_UP
  2507. case 0x21:return 266; // DOM_VK_PAGE_UP -> GLFW_KEY_PAGE_UP
  2508. case 0x22:return 267; // DOM_VK_PAGE_DOWN -> GLFW_KEY_PAGE_DOWN
  2509. case 0x24:return 268; // DOM_VK_HOME -> GLFW_KEY_HOME
  2510. case 0x23:return 269; // DOM_VK_END -> GLFW_KEY_END
  2511. case 0x14:return 280; // DOM_VK_CAPS_LOCK -> GLFW_KEY_CAPS_LOCK
  2512. case 0x91:return 281; // DOM_VK_SCROLL_LOCK -> GLFW_KEY_SCROLL_LOCK
  2513. case 0x90:return 282; // DOM_VK_NUM_LOCK -> GLFW_KEY_NUM_LOCK
  2514. case 0x2C:return 283; // DOM_VK_SNAPSHOT -> GLFW_KEY_PRINT_SCREEN
  2515. case 0x13:return 284; // DOM_VK_PAUSE -> GLFW_KEY_PAUSE
  2516. case 0x70:return 290; // DOM_VK_F1 -> GLFW_KEY_F1
  2517. case 0x71:return 291; // DOM_VK_F2 -> GLFW_KEY_F2
  2518. case 0x72:return 292; // DOM_VK_F3 -> GLFW_KEY_F3
  2519. case 0x73:return 293; // DOM_VK_F4 -> GLFW_KEY_F4
  2520. case 0x74:return 294; // DOM_VK_F5 -> GLFW_KEY_F5
  2521. case 0x75:return 295; // DOM_VK_F6 -> GLFW_KEY_F6
  2522. case 0x76:return 296; // DOM_VK_F7 -> GLFW_KEY_F7
  2523. case 0x77:return 297; // DOM_VK_F8 -> GLFW_KEY_F8
  2524. case 0x78:return 298; // DOM_VK_F9 -> GLFW_KEY_F9
  2525. case 0x79:return 299; // DOM_VK_F10 -> GLFW_KEY_F10
  2526. case 0x7A:return 300; // DOM_VK_F11 -> GLFW_KEY_F11
  2527. case 0x7B:return 301; // DOM_VK_F12 -> GLFW_KEY_F12
  2528. case 0x7C:return 302; // DOM_VK_F13 -> GLFW_KEY_F13
  2529. case 0x7D:return 303; // DOM_VK_F14 -> GLFW_KEY_F14
  2530. case 0x7E:return 304; // DOM_VK_F15 -> GLFW_KEY_F15
  2531. case 0x7F:return 305; // DOM_VK_F16 -> GLFW_KEY_F16
  2532. case 0x80:return 306; // DOM_VK_F17 -> GLFW_KEY_F17
  2533. case 0x81:return 307; // DOM_VK_F18 -> GLFW_KEY_F18
  2534. case 0x82:return 308; // DOM_VK_F19 -> GLFW_KEY_F19
  2535. case 0x83:return 309; // DOM_VK_F20 -> GLFW_KEY_F20
  2536. case 0x84:return 310; // DOM_VK_F21 -> GLFW_KEY_F21
  2537. case 0x85:return 311; // DOM_VK_F22 -> GLFW_KEY_F22
  2538. case 0x86:return 312; // DOM_VK_F23 -> GLFW_KEY_F23
  2539. case 0x87:return 313; // DOM_VK_F24 -> GLFW_KEY_F24
  2540. case 0x88:return 314; // 0x88 (not used?) -> GLFW_KEY_F25
  2541. case 0x60:return 320; // DOM_VK_NUMPAD0 -> GLFW_KEY_KP_0
  2542. case 0x61:return 321; // DOM_VK_NUMPAD1 -> GLFW_KEY_KP_1
  2543. case 0x62:return 322; // DOM_VK_NUMPAD2 -> GLFW_KEY_KP_2
  2544. case 0x63:return 323; // DOM_VK_NUMPAD3 -> GLFW_KEY_KP_3
  2545. case 0x64:return 324; // DOM_VK_NUMPAD4 -> GLFW_KEY_KP_4
  2546. case 0x65:return 325; // DOM_VK_NUMPAD5 -> GLFW_KEY_KP_5
  2547. case 0x66:return 326; // DOM_VK_NUMPAD6 -> GLFW_KEY_KP_6
  2548. case 0x67:return 327; // DOM_VK_NUMPAD7 -> GLFW_KEY_KP_7
  2549. case 0x68:return 328; // DOM_VK_NUMPAD8 -> GLFW_KEY_KP_8
  2550. case 0x69:return 329; // DOM_VK_NUMPAD9 -> GLFW_KEY_KP_9
  2551. case 0x6E:return 330; // DOM_VK_DECIMAL -> GLFW_KEY_KP_DECIMAL
  2552. case 0x6F:return 331; // DOM_VK_DIVIDE -> GLFW_KEY_KP_DIVIDE
  2553. case 0x6A:return 332; // DOM_VK_MULTIPLY -> GLFW_KEY_KP_MULTIPLY
  2554. case 0x6D:return 333; // DOM_VK_SUBTRACT -> GLFW_KEY_KP_SUBTRACT
  2555. case 0x6B:return 334; // DOM_VK_ADD -> GLFW_KEY_KP_ADD
  2556. // case 0x0D:return 335; // DOM_VK_RETURN -> GLFW_KEY_KP_ENTER (DOM_KEY_LOCATION_RIGHT)
  2557. // case 0x61:return 336; // DOM_VK_EQUALS -> GLFW_KEY_KP_EQUAL (DOM_KEY_LOCATION_RIGHT)
  2558. case 0x10:return 340; // DOM_VK_SHIFT -> GLFW_KEY_LEFT_SHIFT
  2559. case 0x11:return 341; // DOM_VK_CONTROL -> GLFW_KEY_LEFT_CONTROL
  2560. case 0x12:return 342; // DOM_VK_ALT -> GLFW_KEY_LEFT_ALT
  2561. case 0x5B:return 343; // DOM_VK_WIN -> GLFW_KEY_LEFT_SUPER
  2562. // case 0x10:return 344; // DOM_VK_SHIFT -> GLFW_KEY_RIGHT_SHIFT (DOM_KEY_LOCATION_RIGHT)
  2563. // case 0x11:return 345; // DOM_VK_CONTROL -> GLFW_KEY_RIGHT_CONTROL (DOM_KEY_LOCATION_RIGHT)
  2564. // case 0x12:return 346; // DOM_VK_ALT -> GLFW_KEY_RIGHT_ALT (DOM_KEY_LOCATION_RIGHT)
  2565. // case 0x5B:return 347; // DOM_VK_WIN -> GLFW_KEY_RIGHT_SUPER (DOM_KEY_LOCATION_RIGHT)
  2566. case 0x5D:return 348; // DOM_VK_CONTEXT_MENU -> GLFW_KEY_MENU
  2567. // XXX: GLFW_KEY_WORLD_1, GLFW_KEY_WORLD_2 what are these?
  2568. default:return -1; // GLFW_KEY_UNKNOWN
  2569. };
  2570. },getModBits:function (win) {
  2571. var mod = 0;
  2572. if (win.keys[340]) mod |= 0x0001; // GLFW_MOD_SHIFT
  2573. if (win.keys[341]) mod |= 0x0002; // GLFW_MOD_CONTROL
  2574. if (win.keys[342]) mod |= 0x0004; // GLFW_MOD_ALT
  2575. if (win.keys[343]) mod |= 0x0008; // GLFW_MOD_SUPER
  2576. return mod;
  2577. },onKeyPress:function (event) {
  2578. if (!GLFW.active || !GLFW.active.charFunc) return;
  2579. // correct unicode charCode is only available with onKeyPress event
  2580. var charCode = event.charCode;
  2581. if (charCode == 0 || (charCode >= 0x00 && charCode <= 0x1F)) return;
  2582. Module['dynCall_vii'](GLFW.active.charFunc, GLFW.active.id, charCode);
  2583. },onKeyChanged:function (event, status) {
  2584. if (!GLFW.active) return;
  2585. var key = GLFW.DOMToGLFWKeyCode(event.keyCode);
  2586. if (key == -1) return;
  2587. var repeat = status && GLFW.active.keys[key];
  2588. GLFW.active.keys[key] = status;
  2589. if (!GLFW.active.keyFunc) return;
  2590. if (repeat) status = 2; // GLFW_REPEAT
  2591. Module['dynCall_viiiii'](GLFW.active.keyFunc, GLFW.active.id, key, event.keyCode, status, GLFW.getModBits(GLFW.active));
  2592. },onKeydown:function (event) {
  2593. GLFW.onKeyChanged(event, 1); // GLFW_PRESS or GLFW_REPEAT
  2594. // This logic comes directly from the sdl implementation. We cannot
  2595. // call preventDefault on all keydown events otherwise onKeyPress will
  2596. // not get called
  2597. if (event.keyCode === 8 /* backspace */ || event.keyCode === 9 /* tab */) {
  2598. event.preventDefault();
  2599. }
  2600. },onKeyup:function (event) {
  2601. GLFW.onKeyChanged(event, 0); // GLFW_RELEASE
  2602. },onMousemove:function (event) {
  2603. if (!GLFW.active) return;
  2604. Browser.calculateMouseEvent(event);
  2605. if (event.target != Module["canvas"] || !GLFW.active.cursorPosFunc) return;
  2606. Module['dynCall_vidd'](GLFW.active.cursorPosFunc, GLFW.active.id, Browser.mouseX, Browser.mouseY);
  2607. },DOMToGLFWMouseButton:function (event) {
  2608. // DOM and glfw have different button codes.
  2609. // See http://www.w3schools.com/jsref/event_button.asp.
  2610. var eventButton = event['button'];
  2611. if (eventButton > 0) {
  2612. if (eventButton == 1) {
  2613. eventButton = 2;
  2614. } else {
  2615. eventButton = 1;
  2616. }
  2617. }
  2618. return eventButton;
  2619. },onMouseenter:function (event) {
  2620. if (!GLFW.active) return;
  2621. if (event.target != Module["canvas"] || !GLFW.active.cursorEnterFunc) return;
  2622. Module['dynCall_vii'](GLFW.active.cursorEnterFunc, GLFW.active.id, 1);
  2623. },onMouseleave:function (event) {
  2624. if (!GLFW.active) return;
  2625. if (event.target != Module["canvas"] || !GLFW.active.cursorEnterFunc) return;
  2626. Module['dynCall_vii'](GLFW.active.cursorEnterFunc, GLFW.active.id, 0);
  2627. },onMouseButtonChanged:function (event, status) {
  2628. if (!GLFW.active) return;
  2629. Browser.calculateMouseEvent(event);
  2630. if (event.target != Module["canvas"]) return;
  2631. eventButton = GLFW.DOMToGLFWMouseButton(event);
  2632. if (status == 1) { // GLFW_PRESS
  2633. GLFW.active.buttons |= (1 << eventButton);
  2634. try {
  2635. event.target.setCapture();
  2636. } catch (e) {}
  2637. } else { // GLFW_RELEASE
  2638. GLFW.active.buttons &= ~(1 << eventButton);
  2639. }
  2640. if (!GLFW.active.mouseButtonFunc) return;
  2641. Module['dynCall_viiii'](GLFW.active.mouseButtonFunc, GLFW.active.id, eventButton, status, GLFW.getModBits(GLFW.active));
  2642. },onMouseButtonDown:function (event) {
  2643. if (!GLFW.active) return;
  2644. GLFW.onMouseButtonChanged(event, 1); // GLFW_PRESS
  2645. },onMouseButtonUp:function (event) {
  2646. if (!GLFW.active) return;
  2647. GLFW.onMouseButtonChanged(event, 0); // GLFW_RELEASE
  2648. },onMouseWheel:function (event) {
  2649. // Note the minus sign that flips browser wheel direction (positive direction scrolls page down) to native wheel direction (positive direction is mouse wheel up)
  2650. var delta = -Browser.getMouseWheelDelta(event);
  2651. delta = (delta == 0) ? 0 : (delta > 0 ? Math.max(delta, 1) : Math.min(delta, -1)); // Quantize to integer so that minimum scroll is at least +/- 1.
  2652. GLFW.wheelPos += delta;
  2653. if (!GLFW.active || !GLFW.active.scrollFunc || event.target != Module['canvas']) return;
  2654. var sx = 0;
  2655. var sy = 0;
  2656. if (event.type == 'mousewheel') {
  2657. sx = event.wheelDeltaX;
  2658. sy = event.wheelDeltaY;
  2659. } else {
  2660. sx = event.deltaX;
  2661. sy = event.deltaY;
  2662. }
  2663. Module['dynCall_vidd'](GLFW.active.scrollFunc, GLFW.active.id, sx, sy);
  2664. event.preventDefault();
  2665. },onCanvasResize:function (width, height) {
  2666. if (!GLFW.active) return;
  2667. var resizeNeeded = true;
  2668. // If the client is requestiong fullscreen mode
  2669. if (document["fullscreen"] || document["fullScreen"] || document["mozFullScreen"] || document["webkitIsFullScreen"]) {
  2670. GLFW.active.storedX = GLFW.active.x;
  2671. GLFW.active.storedY = GLFW.active.y;
  2672. GLFW.active.storedWidth = GLFW.active.width;
  2673. GLFW.active.storedHeight = GLFW.active.height;
  2674. GLFW.active.x = GLFW.active.y = 0;
  2675. GLFW.active.width = screen.width;
  2676. GLFW.active.height = screen.height;
  2677. GLFW.active.fullscreen = true;
  2678. // If the client is reverting from fullscreen mode
  2679. } else if (GLFW.active.fullscreen == true) {
  2680. GLFW.active.x = GLFW.active.storedX;
  2681. GLFW.active.y = GLFW.active.storedY;
  2682. GLFW.active.width = GLFW.active.storedWidth;
  2683. GLFW.active.height = GLFW.active.storedHeight;
  2684. GLFW.active.fullscreen = false;
  2685. // If the width/height values do not match current active window sizes
  2686. } else if (GLFW.active.width != width || GLFW.active.height != height) {
  2687. GLFW.active.width = width;
  2688. GLFW.active.height = height;
  2689. } else {
  2690. resizeNeeded = false;
  2691. }
  2692. // If any of the above conditions were true, we need to resize the canvas
  2693. if (resizeNeeded) {
  2694. // resets the canvas size to counter the aspect preservation of Browser.updateCanvasDimensions
  2695. Browser.setCanvasSize(GLFW.active.width, GLFW.active.height, true);
  2696. // TODO: Client dimensions (clientWidth/clientHeight) vs pixel dimensions (width/height) of
  2697. // the canvas should drive window and framebuffer size respectfully.
  2698. GLFW.onWindowSizeChanged();
  2699. GLFW.onFramebufferSizeChanged();
  2700. }
  2701. },onWindowSizeChanged:function () {
  2702. if (!GLFW.active) return;
  2703. if (!GLFW.active.windowSizeFunc) return;
  2704. Module['dynCall_viii'](GLFW.active.windowSizeFunc, GLFW.active.id, GLFW.active.width, GLFW.active.height);
  2705. },onFramebufferSizeChanged:function () {
  2706. if (!GLFW.active) return;
  2707. if (!GLFW.active.framebufferSizeFunc) return;
  2708. Module['dynCall_viii'](GLFW.active.framebufferSizeFunc, GLFW.active.id, GLFW.active.width, GLFW.active.height);
  2709. },requestFullscreen:function () {
  2710. var RFS = Module["canvas"]['requestFullscreen'] ||
  2711. Module["canvas"]['mozRequestFullScreen'] ||
  2712. Module["canvas"]['webkitRequestFullScreen'] ||
  2713. (function() {});
  2714. RFS.apply(Module["canvas"], []);
  2715. },requestFullScreen:function () {
  2716. Module.printErr('GLFW.requestFullScreen() is deprecated. Please call GLFW.requestFullscreen instead.');
  2717. GLFW.requestFullScreen = function() {
  2718. return GLFW.requestFullscreen();
  2719. }
  2720. return GLFW.requestFullscreen();
  2721. },exitFullscreen:function () {
  2722. var CFS = document['exitFullscreen'] ||
  2723. document['cancelFullScreen'] ||
  2724. document['mozCancelFullScreen'] ||
  2725. document['webkitCancelFullScreen'] ||
  2726. (function() {});
  2727. CFS.apply(document, []);
  2728. },cancelFullScreen:function () {
  2729. Module.printErr('GLFW.cancelFullScreen() is deprecated. Please call GLFW.exitFullscreen instead.');
  2730. GLFW.cancelFullScreen = function() {
  2731. return GLFW.exitFullscreen();
  2732. }
  2733. return GLFW.exitFullscreen();
  2734. },getTime:function () {
  2735. return _emscripten_get_now() / 1000;
  2736. },setWindowTitle:function (winid, title) {
  2737. var win = GLFW.WindowFromId(winid);
  2738. if (!win) return;
  2739. win.title = Pointer_stringify(title);
  2740. if (GLFW.active.id == win.id) {
  2741. document.title = win.title;
  2742. }
  2743. },setKeyCallback:function (winid, cbfun) {
  2744. var win = GLFW.WindowFromId(winid);
  2745. if (!win) return;
  2746. win.keyFunc = cbfun;
  2747. },setCharCallback:function (winid, cbfun) {
  2748. var win = GLFW.WindowFromId(winid);
  2749. if (!win) return;
  2750. win.charFunc = cbfun;
  2751. },setMouseButtonCallback:function (winid, cbfun) {
  2752. var win = GLFW.WindowFromId(winid);
  2753. if (!win) return;
  2754. win.mouseButtonFunc = cbfun;
  2755. },setCursorPosCallback:function (winid, cbfun) {
  2756. var win = GLFW.WindowFromId(winid);
  2757. if (!win) return;
  2758. win.cursorPosFunc = cbfun;
  2759. },setScrollCallback:function (winid, cbfun) {
  2760. var win = GLFW.WindowFromId(winid);
  2761. if (!win) return;
  2762. win.scrollFunc = cbfun;
  2763. },setWindowSizeCallback:function (winid, cbfun) {
  2764. var win = GLFW.WindowFromId(winid);
  2765. if (!win) return;
  2766. win.windowSizeFunc = cbfun;
  2767. },setWindowCloseCallback:function (winid, cbfun) {
  2768. var win = GLFW.WindowFromId(winid);
  2769. if (!win) return;
  2770. win.windowCloseFunc = cbfun;
  2771. },setWindowRefreshCallback:function (winid, cbfun) {
  2772. var win = GLFW.WindowFromId(winid);
  2773. if (!win) return;
  2774. win.windowRefreshFunc = cbfun;
  2775. },onClickRequestPointerLock:function (e) {
  2776. if (!Browser.pointerLock && Module['canvas'].requestPointerLock) {
  2777. Module['canvas'].requestPointerLock();
  2778. e.preventDefault();
  2779. }
  2780. },setInputMode:function (winid, mode, value) {
  2781. var win = GLFW.WindowFromId(winid);
  2782. if (!win) return;
  2783. switch(mode) {
  2784. case 0x00033001: { // GLFW_CURSOR
  2785. switch(value) {
  2786. case 0x00034001: { // GLFW_CURSOR_NORMAL
  2787. win.inputModes[mode] = value;
  2788. Module['canvas'].removeEventListener('click', GLFW.onClickRequestPointerLock, true);
  2789. Module['canvas'].exitPointerLock();
  2790. break;
  2791. }
  2792. case 0x00034002: { // GLFW_CURSOR_HIDDEN
  2793. console.log("glfwSetInputMode called with GLFW_CURSOR_HIDDEN value not implemented.");
  2794. break;
  2795. }
  2796. case 0x00034003: { // GLFW_CURSOR_DISABLED
  2797. win.inputModes[mode] = value;
  2798. Module['canvas'].addEventListener('click', GLFW.onClickRequestPointerLock, true);
  2799. Module['canvas'].requestPointerLock();
  2800. break;
  2801. }
  2802. default: {
  2803. console.log("glfwSetInputMode called with unknown value parameter value: " + value + ".");
  2804. break;
  2805. }
  2806. }
  2807. break;
  2808. }
  2809. case 0x00033002: { // GLFW_STICKY_KEYS
  2810. console.log("glfwSetInputMode called with GLFW_STICKY_KEYS mode not implemented.");
  2811. break;
  2812. }
  2813. case 0x00033003: { // GLFW_STICKY_MOUSE_BUTTONS
  2814. console.log("glfwSetInputMode called with GLFW_STICKY_MOUSE_BUTTONS mode not implemented.");
  2815. break;
  2816. }
  2817. default: {
  2818. console.log("glfwSetInputMode called with unknown mode parameter value: " + mode + ".");
  2819. break;
  2820. }
  2821. }
  2822. },getKey:function (winid, key) {
  2823. var win = GLFW.WindowFromId(winid);
  2824. if (!win) return 0;
  2825. return win.keys[key];
  2826. },getMouseButton:function (winid, button) {
  2827. var win = GLFW.WindowFromId(winid);
  2828. if (!win) return 0;
  2829. return (win.buttons & (1 << button)) > 0;
  2830. },getCursorPos:function (winid, x, y) {
  2831. setValue(x, Browser.mouseX, 'double');
  2832. setValue(y, Browser.mouseY, 'double');
  2833. },getMousePos:function (winid, x, y) {
  2834. setValue(x, Browser.mouseX, 'i32');
  2835. setValue(y, Browser.mouseY, 'i32');
  2836. },setCursorPos:function (winid, x, y) {
  2837. },getWindowPos:function (winid, x, y) {
  2838. var wx = 0;
  2839. var wy = 0;
  2840. var win = GLFW.WindowFromId(winid);
  2841. if (win) {
  2842. wx = win.x;
  2843. wy = win.y;
  2844. }
  2845. setValue(x, wx, 'i32');
  2846. setValue(y, wy, 'i32');
  2847. },setWindowPos:function (winid, x, y) {
  2848. var win = GLFW.WindowFromId(winid);
  2849. if (!win) return;
  2850. win.x = x;
  2851. win.y = y;
  2852. },getWindowSize:function (winid, width, height) {
  2853. var ww = 0;
  2854. var wh = 0;
  2855. var win = GLFW.WindowFromId(winid);
  2856. if (win) {
  2857. ww = win.width;
  2858. wh = win.height;
  2859. }
  2860. setValue(width, ww, 'i32');
  2861. setValue(height, wh, 'i32');
  2862. },setWindowSize:function (winid, width, height) {
  2863. var win = GLFW.WindowFromId(winid);
  2864. if (!win) return;
  2865. if (GLFW.active.id == win.id) {
  2866. if (width == screen.width && height == screen.height) {
  2867. GLFW.requestFullscreen();
  2868. } else {
  2869. GLFW.exitFullscreen();
  2870. Browser.setCanvasSize(width, height);
  2871. win.width = width;
  2872. win.height = height;
  2873. }
  2874. }
  2875. if (!win.windowSizeFunc) return;
  2876. Module['dynCall_viii'](win.windowSizeFunc, win.id, width, height);
  2877. },createWindow:function (width, height, title, monitor, share) {
  2878. var i, id;
  2879. for (i = 0; i < GLFW.windows.length && GLFW.windows[i] !== null; i++);
  2880. if (i > 0) throw "glfwCreateWindow only supports one window at time currently";
  2881. // id for window
  2882. id = i + 1;
  2883. // not valid
  2884. if (width <= 0 || height <= 0) return 0;
  2885. if (monitor) {
  2886. GLFW.requestFullscreen();
  2887. } else {
  2888. Browser.setCanvasSize(width, height);
  2889. }
  2890. // Create context when there are no existing alive windows
  2891. for (i = 0; i < GLFW.windows.length && GLFW.windows[i] == null; i++);
  2892. if (i == GLFW.windows.length) {
  2893. var contextAttributes = {
  2894. antialias: (GLFW.hints[0x0002100D] > 1), // GLFW_SAMPLES
  2895. depth: (GLFW.hints[0x00021005] > 0), // GLFW_DEPTH_BITS
  2896. stencil: (GLFW.hints[0x00021006] > 0), // GLFW_STENCIL_BITS
  2897. alpha: (GLFW.hints[0x00021004] > 0) // GLFW_ALPHA_BITS
  2898. }
  2899. Module.ctx = Browser.createContext(Module['canvas'], true, true, contextAttributes);
  2900. }
  2901. // If context creation failed, do not return a valid window
  2902. if (!Module.ctx) return 0;
  2903. // Get non alive id
  2904. var win = new GLFW.Window(id, width, height, title, monitor, share);
  2905. // Set window to array
  2906. if (id - 1 == GLFW.windows.length) {
  2907. GLFW.windows.push(win);
  2908. } else {
  2909. GLFW.windows[id - 1] = win;
  2910. }
  2911. GLFW.active = win;
  2912. return win.id;
  2913. },destroyWindow:function (winid) {
  2914. var win = GLFW.WindowFromId(winid);
  2915. if (!win) return;
  2916. if (win.windowCloseFunc)
  2917. Module['dynCall_vi'](win.windowCloseFunc, win.id);
  2918. GLFW.windows[win.id - 1] = null;
  2919. if (GLFW.active.id == win.id)
  2920. GLFW.active = null;
  2921. // Destroy context when no alive windows
  2922. for (var i = 0; i < GLFW.windows.length; i++)
  2923. if (GLFW.windows[i] !== null) return;
  2924. Module.ctx = Browser.destroyContext(Module['canvas'], true, true);
  2925. },swapBuffers:function (winid) {
  2926. },GLFW2ParamToGLFW3Param:function (param) {
  2927. table = {
  2928. 0x00030001:0, // GLFW_MOUSE_CURSOR
  2929. 0x00030002:0, // GLFW_STICKY_KEYS
  2930. 0x00030003:0, // GLFW_STICKY_MOUSE_BUTTONS
  2931. 0x00030004:0, // GLFW_SYSTEM_KEYS
  2932. 0x00030005:0, // GLFW_KEY_REPEAT
  2933. 0x00030006:0, // GLFW_AUTO_POLL_EVENTS
  2934. 0x00020001:0, // GLFW_OPENED
  2935. 0x00020002:0, // GLFW_ACTIVE
  2936. 0x00020003:0, // GLFW_ICONIFIED
  2937. 0x00020004:0, // GLFW_ACCELERATED
  2938. 0x00020005:0x00021001, // GLFW_RED_BITS
  2939. 0x00020006:0x00021002, // GLFW_GREEN_BITS
  2940. 0x00020007:0x00021003, // GLFW_BLUE_BITS
  2941. 0x00020008:0x00021004, // GLFW_ALPHA_BITS
  2942. 0x00020009:0x00021005, // GLFW_DEPTH_BITS
  2943. 0x0002000A:0x00021006, // GLFW_STENCIL_BITS
  2944. 0x0002000B:0x0002100F, // GLFW_REFRESH_RATE
  2945. 0x0002000C:0x00021007, // GLFW_ACCUM_RED_BITS
  2946. 0x0002000D:0x00021008, // GLFW_ACCUM_GREEN_BITS
  2947. 0x0002000E:0x00021009, // GLFW_ACCUM_BLUE_BITS
  2948. 0x0002000F:0x0002100A, // GLFW_ACCUM_ALPHA_BITS
  2949. 0x00020010:0x0002100B, // GLFW_AUX_BUFFERS
  2950. 0x00020011:0x0002100C, // GLFW_STEREO
  2951. 0x00020012:0, // GLFW_WINDOW_NO_RESIZE
  2952. 0x00020013:0x0002100D, // GLFW_FSAA_SAMPLES
  2953. 0x00020014:0x00022002, // GLFW_OPENGL_VERSION_MAJOR
  2954. 0x00020015:0x00022003, // GLFW_OPENGL_VERSION_MINOR
  2955. 0x00020016:0x00022006, // GLFW_OPENGL_FORWARD_COMPAT
  2956. 0x00020017:0x00022007, // GLFW_OPENGL_DEBUG_CONTEXT
  2957. 0x00020018:0x00022008, // GLFW_OPENGL_PROFILE
  2958. };
  2959. return table[param];
  2960. }};function _glfwGetVideoModes(monitor, count) {
  2961. setValue(count, 0, 'i32');
  2962. return 0;
  2963. }
  2964. function _glLinkProgram(program) {
  2965. GLctx.linkProgram(GL.programs[program]);
  2966. GL.programInfos[program] = null; // uniforms no longer keep the same names after linking
  2967. GL.populateUniformTable(program);
  2968. }
  2969. function _glBindTexture(target, texture) {
  2970. GLctx.bindTexture(target, texture ? GL.textures[texture] : null);
  2971. }
  2972. function _emscripten_glStencilFunc(x0, x1, x2) { GLctx['stencilFunc'](x0, x1, x2) }
  2973. function _glGetString(name_) {
  2974. if (GL.stringCache[name_]) return GL.stringCache[name_];
  2975. var ret;
  2976. switch(name_) {
  2977. case 0x1F00 /* GL_VENDOR */:
  2978. case 0x1F01 /* GL_RENDERER */:
  2979. case 0x9245 /* UNMASKED_VENDOR_WEBGL */:
  2980. case 0x9246 /* UNMASKED_RENDERER_WEBGL */:
  2981. ret = allocate(intArrayFromString(GLctx.getParameter(name_)), 'i8', ALLOC_NORMAL);
  2982. break;
  2983. case 0x1F02 /* GL_VERSION */:
  2984. var glVersion = GLctx.getParameter(GLctx.VERSION);
  2985. // return GLES version string corresponding to the version of the WebGL context
  2986. {
  2987. glVersion = 'OpenGL ES 2.0 (' + glVersion + ')';
  2988. }
  2989. ret = allocate(intArrayFromString(glVersion), 'i8', ALLOC_NORMAL);
  2990. break;
  2991. case 0x1F03 /* GL_EXTENSIONS */:
  2992. var exts = GLctx.getSupportedExtensions();
  2993. var gl_exts = [];
  2994. for (var i = 0; i < exts.length; ++i) {
  2995. gl_exts.push(exts[i]);
  2996. gl_exts.push("GL_" + exts[i]);
  2997. }
  2998. ret = allocate(intArrayFromString(gl_exts.join(' ')), 'i8', ALLOC_NORMAL);
  2999. break;
  3000. case 0x8B8C /* GL_SHADING_LANGUAGE_VERSION */:
  3001. var glslVersion = GLctx.getParameter(GLctx.SHADING_LANGUAGE_VERSION);
  3002. // extract the version number 'N.M' from the string 'WebGL GLSL ES N.M ...'
  3003. var ver_re = /^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/;
  3004. var ver_num = glslVersion.match(ver_re);
  3005. if (ver_num !== null) {
  3006. if (ver_num[1].length == 3) ver_num[1] = ver_num[1] + '0'; // ensure minor version has 2 digits
  3007. glslVersion = 'OpenGL ES GLSL ES ' + ver_num[1] + ' (' + glslVersion + ')';
  3008. }
  3009. ret = allocate(intArrayFromString(glslVersion), 'i8', ALLOC_NORMAL);
  3010. break;
  3011. default:
  3012. GL.recordError(0x0500/*GL_INVALID_ENUM*/);
  3013. return 0;
  3014. }
  3015. GL.stringCache[name_] = ret;
  3016. return ret;
  3017. }
  3018. function _emscripten_glUniform3iv(location, count, value) {
  3019. GLctx.uniform3iv(GL.uniforms[location], HEAP32.subarray((value)>>2,(value+count*12)>>2));
  3020. }
  3021. function _emscripten_glShaderSource(shader, count, string, length) {
  3022. var source = GL.getSource(shader, count, string, length);
  3023. GLctx.shaderSource(GL.shaders[shader], source);
  3024. }
  3025. function _emscripten_glReleaseShaderCompiler() {
  3026. // NOP (as allowed by GLES 2.0 spec)
  3027. }
  3028. function _glDeleteProgram(id) {
  3029. if (!id) return;
  3030. var program = GL.programs[id];
  3031. if (!program) { // glDeleteProgram actually signals an error when deleting a nonexisting object, unlike some other GL delete functions.
  3032. GL.recordError(0x0501 /* GL_INVALID_VALUE */);
  3033. return;
  3034. }
  3035. GLctx.deleteProgram(program);
  3036. program.name = 0;
  3037. GL.programs[id] = null;
  3038. GL.programInfos[id] = null;
  3039. }
  3040. function _emscripten_glTexParameterf(x0, x1, x2) { GLctx['texParameterf'](x0, x1, x2) }
  3041. function _emscripten_glTexParameteri(x0, x1, x2) { GLctx['texParameteri'](x0, x1, x2) }
  3042. function _glCompileShader(shader) {
  3043. GLctx.compileShader(GL.shaders[shader]);
  3044. }
  3045. var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};
  3046. var ERRNO_MESSAGES={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};
  3047. function ___setErrNo(value) {
  3048. if (Module['___errno_location']) HEAP32[((Module['___errno_location']())>>2)]=value;
  3049. else Module.printErr('failed to set errno from JS');
  3050. return value;
  3051. }
  3052. var PATH={splitPath:function (filename) {
  3053. var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
  3054. return splitPathRe.exec(filename).slice(1);
  3055. },normalizeArray:function (parts, allowAboveRoot) {
  3056. // if the path tries to go above the root, `up` ends up > 0
  3057. var up = 0;
  3058. for (var i = parts.length - 1; i >= 0; i--) {
  3059. var last = parts[i];
  3060. if (last === '.') {
  3061. parts.splice(i, 1);
  3062. } else if (last === '..') {
  3063. parts.splice(i, 1);
  3064. up++;
  3065. } else if (up) {
  3066. parts.splice(i, 1);
  3067. up--;
  3068. }
  3069. }
  3070. // if the path is allowed to go above the root, restore leading ..s
  3071. if (allowAboveRoot) {
  3072. for (; up--; up) {
  3073. parts.unshift('..');
  3074. }
  3075. }
  3076. return parts;
  3077. },normalize:function (path) {
  3078. var isAbsolute = path.charAt(0) === '/',
  3079. trailingSlash = path.substr(-1) === '/';
  3080. // Normalize the path
  3081. path = PATH.normalizeArray(path.split('/').filter(function(p) {
  3082. return !!p;
  3083. }), !isAbsolute).join('/');
  3084. if (!path && !isAbsolute) {
  3085. path = '.';
  3086. }
  3087. if (path && trailingSlash) {
  3088. path += '/';
  3089. }
  3090. return (isAbsolute ? '/' : '') + path;
  3091. },dirname:function (path) {
  3092. var result = PATH.splitPath(path),
  3093. root = result[0],
  3094. dir = result[1];
  3095. if (!root && !dir) {
  3096. // No dirname whatsoever
  3097. return '.';
  3098. }
  3099. if (dir) {
  3100. // It has a dirname, strip trailing slash
  3101. dir = dir.substr(0, dir.length - 1);
  3102. }
  3103. return root + dir;
  3104. },basename:function (path) {
  3105. // EMSCRIPTEN return '/'' for '/', not an empty string
  3106. if (path === '/') return '/';
  3107. var lastSlash = path.lastIndexOf('/');
  3108. if (lastSlash === -1) return path;
  3109. return path.substr(lastSlash+1);
  3110. },extname:function (path) {
  3111. return PATH.splitPath(path)[3];
  3112. },join:function () {
  3113. var paths = Array.prototype.slice.call(arguments, 0);
  3114. return PATH.normalize(paths.join('/'));
  3115. },join2:function (l, r) {
  3116. return PATH.normalize(l + '/' + r);
  3117. },resolve:function () {
  3118. var resolvedPath = '',
  3119. resolvedAbsolute = false;
  3120. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  3121. var path = (i >= 0) ? arguments[i] : FS.cwd();
  3122. // Skip empty and invalid entries
  3123. if (typeof path !== 'string') {
  3124. throw new TypeError('Arguments to path.resolve must be strings');
  3125. } else if (!path) {
  3126. return ''; // an invalid portion invalidates the whole thing
  3127. }
  3128. resolvedPath = path + '/' + resolvedPath;
  3129. resolvedAbsolute = path.charAt(0) === '/';
  3130. }
  3131. // At this point the path should be resolved to a full absolute path, but
  3132. // handle relative paths to be safe (might happen when process.cwd() fails)
  3133. resolvedPath = PATH.normalizeArray(resolvedPath.split('/').filter(function(p) {
  3134. return !!p;
  3135. }), !resolvedAbsolute).join('/');
  3136. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  3137. },relative:function (from, to) {
  3138. from = PATH.resolve(from).substr(1);
  3139. to = PATH.resolve(to).substr(1);
  3140. function trim(arr) {
  3141. var start = 0;
  3142. for (; start < arr.length; start++) {
  3143. if (arr[start] !== '') break;
  3144. }
  3145. var end = arr.length - 1;
  3146. for (; end >= 0; end--) {
  3147. if (arr[end] !== '') break;
  3148. }
  3149. if (start > end) return [];
  3150. return arr.slice(start, end - start + 1);
  3151. }
  3152. var fromParts = trim(from.split('/'));
  3153. var toParts = trim(to.split('/'));
  3154. var length = Math.min(fromParts.length, toParts.length);
  3155. var samePartsLength = length;
  3156. for (var i = 0; i < length; i++) {
  3157. if (fromParts[i] !== toParts[i]) {
  3158. samePartsLength = i;
  3159. break;
  3160. }
  3161. }
  3162. var outputParts = [];
  3163. for (var i = samePartsLength; i < fromParts.length; i++) {
  3164. outputParts.push('..');
  3165. }
  3166. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  3167. return outputParts.join('/');
  3168. }};
  3169. var TTY={ttys:[],init:function () {
  3170. // https://github.com/kripken/emscripten/pull/1555
  3171. // if (ENVIRONMENT_IS_NODE) {
  3172. // // currently, FS.init does not distinguish if process.stdin is a file or TTY
  3173. // // device, it always assumes it's a TTY device. because of this, we're forcing
  3174. // // process.stdin to UTF8 encoding to at least make stdin reading compatible
  3175. // // with text files until FS.init can be refactored.
  3176. // process['stdin']['setEncoding']('utf8');
  3177. // }
  3178. },shutdown:function () {
  3179. // https://github.com/kripken/emscripten/pull/1555
  3180. // if (ENVIRONMENT_IS_NODE) {
  3181. // // inolen: any idea as to why node -e 'process.stdin.read()' wouldn't exit immediately (with process.stdin being a tty)?
  3182. // // isaacs: because now it's reading from the stream, you've expressed interest in it, so that read() kicks off a _read() which creates a ReadReq operation
  3183. // // inolen: I thought read() in that case was a synchronous operation that just grabbed some amount of buffered data if it exists?
  3184. // // isaacs: it is. but it also triggers a _read() call, which calls readStart() on the handle
  3185. // // isaacs: do process.stdin.pause() and i'd think it'd probably close the pending call
  3186. // process['stdin']['pause']();
  3187. // }
  3188. },register:function (dev, ops) {
  3189. TTY.ttys[dev] = { input: [], output: [], ops: ops };
  3190. FS.registerDevice(dev, TTY.stream_ops);
  3191. },stream_ops:{open:function (stream) {
  3192. var tty = TTY.ttys[stream.node.rdev];
  3193. if (!tty) {
  3194. throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
  3195. }
  3196. stream.tty = tty;
  3197. stream.seekable = false;
  3198. },close:function (stream) {
  3199. // flush any pending line data
  3200. stream.tty.ops.flush(stream.tty);
  3201. },flush:function (stream) {
  3202. stream.tty.ops.flush(stream.tty);
  3203. },read:function (stream, buffer, offset, length, pos /* ignored */) {
  3204. if (!stream.tty || !stream.tty.ops.get_char) {
  3205. throw new FS.ErrnoError(ERRNO_CODES.ENXIO);
  3206. }
  3207. var bytesRead = 0;
  3208. for (var i = 0; i < length; i++) {
  3209. var result;
  3210. try {
  3211. result = stream.tty.ops.get_char(stream.tty);
  3212. } catch (e) {
  3213. throw new FS.ErrnoError(ERRNO_CODES.EIO);
  3214. }
  3215. if (result === undefined && bytesRead === 0) {
  3216. throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
  3217. }
  3218. if (result === null || result === undefined) break;
  3219. bytesRead++;
  3220. buffer[offset+i] = result;
  3221. }
  3222. if (bytesRead) {
  3223. stream.node.timestamp = Date.now();
  3224. }
  3225. return bytesRead;
  3226. },write:function (stream, buffer, offset, length, pos) {
  3227. if (!stream.tty || !stream.tty.ops.put_char) {
  3228. throw new FS.ErrnoError(ERRNO_CODES.ENXIO);
  3229. }
  3230. for (var i = 0; i < length; i++) {
  3231. try {
  3232. stream.tty.ops.put_char(stream.tty, buffer[offset+i]);
  3233. } catch (e) {
  3234. throw new FS.ErrnoError(ERRNO_CODES.EIO);
  3235. }
  3236. }
  3237. if (length) {
  3238. stream.node.timestamp = Date.now();
  3239. }
  3240. return i;
  3241. }},default_tty_ops:{get_char:function (tty) {
  3242. if (!tty.input.length) {
  3243. var result = null;
  3244. if (ENVIRONMENT_IS_NODE) {
  3245. // we will read data by chunks of BUFSIZE
  3246. var BUFSIZE = 256;
  3247. var buf = new Buffer(BUFSIZE);
  3248. var bytesRead = 0;
  3249. var isPosixPlatform = (process.platform != 'win32'); // Node doesn't offer a direct check, so test by exclusion
  3250. var fd = process.stdin.fd;
  3251. if (isPosixPlatform) {
  3252. // Linux and Mac cannot use process.stdin.fd (which isn't set up as sync)
  3253. var usingDevice = false;
  3254. try {
  3255. fd = fs.openSync('/dev/stdin', 'r');
  3256. usingDevice = true;
  3257. } catch (e) {}
  3258. }
  3259. try {
  3260. bytesRead = fs.readSync(fd, buf, 0, BUFSIZE, null);
  3261. } catch(e) {
  3262. // Cross-platform differences: on Windows, reading EOF throws an exception, but on other OSes,
  3263. // reading EOF returns 0. Uniformize behavior by treating the EOF exception to return 0.
  3264. if (e.toString().indexOf('EOF') != -1) bytesRead = 0;
  3265. else throw e;
  3266. }
  3267. if (usingDevice) { fs.closeSync(fd); }
  3268. if (bytesRead > 0) {
  3269. result = buf.slice(0, bytesRead).toString('utf-8');
  3270. } else {
  3271. result = null;
  3272. }
  3273. } else if (typeof window != 'undefined' &&
  3274. typeof window.prompt == 'function') {
  3275. // Browser.
  3276. result = window.prompt('Input: '); // returns null on cancel
  3277. if (result !== null) {
  3278. result += '\n';
  3279. }
  3280. } else if (typeof readline == 'function') {
  3281. // Command line.
  3282. result = readline();
  3283. if (result !== null) {
  3284. result += '\n';
  3285. }
  3286. }
  3287. if (!result) {
  3288. return null;
  3289. }
  3290. tty.input = intArrayFromString(result, true);
  3291. }
  3292. return tty.input.shift();
  3293. },put_char:function (tty, val) {
  3294. if (val === null || val === 10) {
  3295. Module['print'](UTF8ArrayToString(tty.output, 0));
  3296. tty.output = [];
  3297. } else {
  3298. if (val != 0) tty.output.push(val); // val == 0 would cut text output off in the middle.
  3299. }
  3300. },flush:function (tty) {
  3301. if (tty.output && tty.output.length > 0) {
  3302. Module['print'](UTF8ArrayToString(tty.output, 0));
  3303. tty.output = [];
  3304. }
  3305. }},default_tty1_ops:{put_char:function (tty, val) {
  3306. if (val === null || val === 10) {
  3307. Module['printErr'](UTF8ArrayToString(tty.output, 0));
  3308. tty.output = [];
  3309. } else {
  3310. if (val != 0) tty.output.push(val);
  3311. }
  3312. },flush:function (tty) {
  3313. if (tty.output && tty.output.length > 0) {
  3314. Module['printErr'](UTF8ArrayToString(tty.output, 0));
  3315. tty.output = [];
  3316. }
  3317. }}};
  3318. var MEMFS={ops_table:null,mount:function (mount) {
  3319. return MEMFS.createNode(null, '/', 16384 | 511 /* 0777 */, 0);
  3320. },createNode:function (parent, name, mode, dev) {
  3321. if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {
  3322. // no supported
  3323. throw new FS.ErrnoError(ERRNO_CODES.EPERM);
  3324. }
  3325. if (!MEMFS.ops_table) {
  3326. MEMFS.ops_table = {
  3327. dir: {
  3328. node: {
  3329. getattr: MEMFS.node_ops.getattr,
  3330. setattr: MEMFS.node_ops.setattr,
  3331. lookup: MEMFS.node_ops.lookup,
  3332. mknod: MEMFS.node_ops.mknod,
  3333. rename: MEMFS.node_ops.rename,
  3334. unlink: MEMFS.node_ops.unlink,
  3335. rmdir: MEMFS.node_ops.rmdir,
  3336. readdir: MEMFS.node_ops.readdir,
  3337. symlink: MEMFS.node_ops.symlink
  3338. },
  3339. stream: {
  3340. llseek: MEMFS.stream_ops.llseek
  3341. }
  3342. },
  3343. file: {
  3344. node: {
  3345. getattr: MEMFS.node_ops.getattr,
  3346. setattr: MEMFS.node_ops.setattr
  3347. },
  3348. stream: {
  3349. llseek: MEMFS.stream_ops.llseek,
  3350. read: MEMFS.stream_ops.read,
  3351. write: MEMFS.stream_ops.write,
  3352. allocate: MEMFS.stream_ops.allocate,
  3353. mmap: MEMFS.stream_ops.mmap,
  3354. msync: MEMFS.stream_ops.msync
  3355. }
  3356. },
  3357. link: {
  3358. node: {
  3359. getattr: MEMFS.node_ops.getattr,
  3360. setattr: MEMFS.node_ops.setattr,
  3361. readlink: MEMFS.node_ops.readlink
  3362. },
  3363. stream: {}
  3364. },
  3365. chrdev: {
  3366. node: {
  3367. getattr: MEMFS.node_ops.getattr,
  3368. setattr: MEMFS.node_ops.setattr
  3369. },
  3370. stream: FS.chrdev_stream_ops
  3371. }
  3372. };
  3373. }
  3374. var node = FS.createNode(parent, name, mode, dev);
  3375. if (FS.isDir(node.mode)) {
  3376. node.node_ops = MEMFS.ops_table.dir.node;
  3377. node.stream_ops = MEMFS.ops_table.dir.stream;
  3378. node.contents = {};
  3379. } else if (FS.isFile(node.mode)) {
  3380. node.node_ops = MEMFS.ops_table.file.node;
  3381. node.stream_ops = MEMFS.ops_table.file.stream;
  3382. node.usedBytes = 0; // The actual number of bytes used in the typed array, as opposed to contents.length which gives the whole capacity.
  3383. // When the byte data of the file is populated, this will point to either a typed array, or a normal JS array. Typed arrays are preferred
  3384. // for performance, and used by default. However, typed arrays are not resizable like normal JS arrays are, so there is a small disk size
  3385. // penalty involved for appending file writes that continuously grow a file similar to std::vector capacity vs used -scheme.
  3386. node.contents = null;
  3387. } else if (FS.isLink(node.mode)) {
  3388. node.node_ops = MEMFS.ops_table.link.node;
  3389. node.stream_ops = MEMFS.ops_table.link.stream;
  3390. } else if (FS.isChrdev(node.mode)) {
  3391. node.node_ops = MEMFS.ops_table.chrdev.node;
  3392. node.stream_ops = MEMFS.ops_table.chrdev.stream;
  3393. }
  3394. node.timestamp = Date.now();
  3395. // add the new node to the parent
  3396. if (parent) {
  3397. parent.contents[name] = node;
  3398. }
  3399. return node;
  3400. },getFileDataAsRegularArray:function (node) {
  3401. if (node.contents && node.contents.subarray) {
  3402. var arr = [];
  3403. for (var i = 0; i < node.usedBytes; ++i) arr.push(node.contents[i]);
  3404. return arr; // Returns a copy of the original data.
  3405. }
  3406. return node.contents; // No-op, the file contents are already in a JS array. Return as-is.
  3407. },getFileDataAsTypedArray:function (node) {
  3408. if (!node.contents) return new Uint8Array;
  3409. if (node.contents.subarray) return node.contents.subarray(0, node.usedBytes); // Make sure to not return excess unused bytes.
  3410. return new Uint8Array(node.contents);
  3411. },expandFileStorage:function (node, newCapacity) {
  3412. // If we are asked to expand the size of a file that already exists, revert to using a standard JS array to store the file
  3413. // instead of a typed array. This makes resizing the array more flexible because we can just .push() elements at the back to
  3414. // increase the size.
  3415. if (node.contents && node.contents.subarray && newCapacity > node.contents.length) {
  3416. node.contents = MEMFS.getFileDataAsRegularArray(node);
  3417. node.usedBytes = node.contents.length; // We might be writing to a lazy-loaded file which had overridden this property, so force-reset it.
  3418. }
  3419. if (!node.contents || node.contents.subarray) { // Keep using a typed array if creating a new storage, or if old one was a typed array as well.
  3420. var prevCapacity = node.contents ? node.contents.length : 0;
  3421. if (prevCapacity >= newCapacity) return; // No need to expand, the storage was already large enough.
  3422. // Don't expand strictly to the given requested limit if it's only a very small increase, but instead geometrically grow capacity.
  3423. // For small filesizes (<1MB), perform size*2 geometric increase, but for large sizes, do a much more conservative size*1.125 increase to
  3424. // avoid overshooting the allocation cap by a very large margin.
  3425. var CAPACITY_DOUBLING_MAX = 1024 * 1024;
  3426. newCapacity = Math.max(newCapacity, (prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2.0 : 1.125)) | 0);
  3427. if (prevCapacity != 0) newCapacity = Math.max(newCapacity, 256); // At minimum allocate 256b for each file when expanding.
  3428. var oldContents = node.contents;
  3429. node.contents = new Uint8Array(newCapacity); // Allocate new storage.
  3430. if (node.usedBytes > 0) node.contents.set(oldContents.subarray(0, node.usedBytes), 0); // Copy old data over to the new storage.
  3431. return;
  3432. }
  3433. // Not using a typed array to back the file storage. Use a standard JS array instead.
  3434. if (!node.contents && newCapacity > 0) node.contents = [];
  3435. while (node.contents.length < newCapacity) node.contents.push(0);
  3436. },resizeFileStorage:function (node, newSize) {
  3437. if (node.usedBytes == newSize) return;
  3438. if (newSize == 0) {
  3439. node.contents = null; // Fully decommit when requesting a resize to zero.
  3440. node.usedBytes = 0;
  3441. return;
  3442. }
  3443. if (!node.contents || node.contents.subarray) { // Resize a typed array if that is being used as the backing store.
  3444. var oldContents = node.contents;
  3445. node.contents = new Uint8Array(new ArrayBuffer(newSize)); // Allocate new storage.
  3446. if (oldContents) {
  3447. node.contents.set(oldContents.subarray(0, Math.min(newSize, node.usedBytes))); // Copy old data over to the new storage.
  3448. }
  3449. node.usedBytes = newSize;
  3450. return;
  3451. }
  3452. // Backing with a JS array.
  3453. if (!node.contents) node.contents = [];
  3454. if (node.contents.length > newSize) node.contents.length = newSize;
  3455. else while (node.contents.length < newSize) node.contents.push(0);
  3456. node.usedBytes = newSize;
  3457. },node_ops:{getattr:function (node) {
  3458. var attr = {};
  3459. // device numbers reuse inode numbers.
  3460. attr.dev = FS.isChrdev(node.mode) ? node.id : 1;
  3461. attr.ino = node.id;
  3462. attr.mode = node.mode;
  3463. attr.nlink = 1;
  3464. attr.uid = 0;
  3465. attr.gid = 0;
  3466. attr.rdev = node.rdev;
  3467. if (FS.isDir(node.mode)) {
  3468. attr.size = 4096;
  3469. } else if (FS.isFile(node.mode)) {
  3470. attr.size = node.usedBytes;
  3471. } else if (FS.isLink(node.mode)) {
  3472. attr.size = node.link.length;
  3473. } else {
  3474. attr.size = 0;
  3475. }
  3476. attr.atime = new Date(node.timestamp);
  3477. attr.mtime = new Date(node.timestamp);
  3478. attr.ctime = new Date(node.timestamp);
  3479. // NOTE: In our implementation, st_blocks = Math.ceil(st_size/st_blksize),
  3480. // but this is not required by the standard.
  3481. attr.blksize = 4096;
  3482. attr.blocks = Math.ceil(attr.size / attr.blksize);
  3483. return attr;
  3484. },setattr:function (node, attr) {
  3485. if (attr.mode !== undefined) {
  3486. node.mode = attr.mode;
  3487. }
  3488. if (attr.timestamp !== undefined) {
  3489. node.timestamp = attr.timestamp;
  3490. }
  3491. if (attr.size !== undefined) {
  3492. MEMFS.resizeFileStorage(node, attr.size);
  3493. }
  3494. },lookup:function (parent, name) {
  3495. throw FS.genericErrors[ERRNO_CODES.ENOENT];
  3496. },mknod:function (parent, name, mode, dev) {
  3497. return MEMFS.createNode(parent, name, mode, dev);
  3498. },rename:function (old_node, new_dir, new_name) {
  3499. // if we're overwriting a directory at new_name, make sure it's empty.
  3500. if (FS.isDir(old_node.mode)) {
  3501. var new_node;
  3502. try {
  3503. new_node = FS.lookupNode(new_dir, new_name);
  3504. } catch (e) {
  3505. }
  3506. if (new_node) {
  3507. for (var i in new_node.contents) {
  3508. throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
  3509. }
  3510. }
  3511. }
  3512. // do the internal rewiring
  3513. delete old_node.parent.contents[old_node.name];
  3514. old_node.name = new_name;
  3515. new_dir.contents[new_name] = old_node;
  3516. old_node.parent = new_dir;
  3517. },unlink:function (parent, name) {
  3518. delete parent.contents[name];
  3519. },rmdir:function (parent, name) {
  3520. var node = FS.lookupNode(parent, name);
  3521. for (var i in node.contents) {
  3522. throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
  3523. }
  3524. delete parent.contents[name];
  3525. },readdir:function (node) {
  3526. var entries = ['.', '..']
  3527. for (var key in node.contents) {
  3528. if (!node.contents.hasOwnProperty(key)) {
  3529. continue;
  3530. }
  3531. entries.push(key);
  3532. }
  3533. return entries;
  3534. },symlink:function (parent, newname, oldpath) {
  3535. var node = MEMFS.createNode(parent, newname, 511 /* 0777 */ | 40960, 0);
  3536. node.link = oldpath;
  3537. return node;
  3538. },readlink:function (node) {
  3539. if (!FS.isLink(node.mode)) {
  3540. throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
  3541. }
  3542. return node.link;
  3543. }},stream_ops:{read:function (stream, buffer, offset, length, position) {
  3544. var contents = stream.node.contents;
  3545. if (position >= stream.node.usedBytes) return 0;
  3546. var size = Math.min(stream.node.usedBytes - position, length);
  3547. assert(size >= 0);
  3548. if (size > 8 && contents.subarray) { // non-trivial, and typed array
  3549. buffer.set(contents.subarray(position, position + size), offset);
  3550. } else {
  3551. for (var i = 0; i < size; i++) buffer[offset + i] = contents[position + i];
  3552. }
  3553. return size;
  3554. },write:function (stream, buffer, offset, length, position, canOwn) {
  3555. if (!length) return 0;
  3556. var node = stream.node;
  3557. node.timestamp = Date.now();
  3558. if (buffer.subarray && (!node.contents || node.contents.subarray)) { // This write is from a typed array to a typed array?
  3559. if (canOwn) {
  3560. assert(position === 0, 'canOwn must imply no weird position inside the file');
  3561. node.contents = buffer.subarray(offset, offset + length);
  3562. node.usedBytes = length;
  3563. return length;
  3564. } else if (node.usedBytes === 0 && position === 0) { // If this is a simple first write to an empty file, do a fast set since we don't need to care about old data.
  3565. node.contents = new Uint8Array(buffer.subarray(offset, offset + length));
  3566. node.usedBytes = length;
  3567. return length;
  3568. } else if (position + length <= node.usedBytes) { // Writing to an already allocated and used subrange of the file?
  3569. node.contents.set(buffer.subarray(offset, offset + length), position);
  3570. return length;
  3571. }
  3572. }
  3573. // Appending to an existing file and we need to reallocate, or source data did not come as a typed array.
  3574. MEMFS.expandFileStorage(node, position+length);
  3575. if (node.contents.subarray && buffer.subarray) node.contents.set(buffer.subarray(offset, offset + length), position); // Use typed array write if available.
  3576. else {
  3577. for (var i = 0; i < length; i++) {
  3578. node.contents[position + i] = buffer[offset + i]; // Or fall back to manual write if not.
  3579. }
  3580. }
  3581. node.usedBytes = Math.max(node.usedBytes, position+length);
  3582. return length;
  3583. },llseek:function (stream, offset, whence) {
  3584. var position = offset;
  3585. if (whence === 1) { // SEEK_CUR.
  3586. position += stream.position;
  3587. } else if (whence === 2) { // SEEK_END.
  3588. if (FS.isFile(stream.node.mode)) {
  3589. position += stream.node.usedBytes;
  3590. }
  3591. }
  3592. if (position < 0) {
  3593. throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
  3594. }
  3595. return position;
  3596. },allocate:function (stream, offset, length) {
  3597. MEMFS.expandFileStorage(stream.node, offset + length);
  3598. stream.node.usedBytes = Math.max(stream.node.usedBytes, offset + length);
  3599. },mmap:function (stream, buffer, offset, length, position, prot, flags) {
  3600. if (!FS.isFile(stream.node.mode)) {
  3601. throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
  3602. }
  3603. var ptr;
  3604. var allocated;
  3605. var contents = stream.node.contents;
  3606. // Only make a new copy when MAP_PRIVATE is specified.
  3607. if ( !(flags & 2) &&
  3608. (contents.buffer === buffer || contents.buffer === buffer.buffer) ) {
  3609. // We can't emulate MAP_SHARED when the file is not backed by the buffer
  3610. // we're mapping to (e.g. the HEAP buffer).
  3611. allocated = false;
  3612. ptr = contents.byteOffset;
  3613. } else {
  3614. // Try to avoid unnecessary slices.
  3615. if (position > 0 || position + length < stream.node.usedBytes) {
  3616. if (contents.subarray) {
  3617. contents = contents.subarray(position, position + length);
  3618. } else {
  3619. contents = Array.prototype.slice.call(contents, position, position + length);
  3620. }
  3621. }
  3622. allocated = true;
  3623. ptr = _malloc(length);
  3624. if (!ptr) {
  3625. throw new FS.ErrnoError(ERRNO_CODES.ENOMEM);
  3626. }
  3627. buffer.set(contents, ptr);
  3628. }
  3629. return { ptr: ptr, allocated: allocated };
  3630. },msync:function (stream, buffer, offset, length, mmapFlags) {
  3631. if (!FS.isFile(stream.node.mode)) {
  3632. throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
  3633. }
  3634. if (mmapFlags & 2) {
  3635. // MAP_PRIVATE calls need not to be synced back to underlying fs
  3636. return 0;
  3637. }
  3638. var bytesWritten = MEMFS.stream_ops.write(stream, buffer, 0, length, offset, false);
  3639. // should we check if bytesWritten and length are the same?
  3640. return 0;
  3641. }}};
  3642. var IDBFS={dbs:{},indexedDB:function () {
  3643. if (typeof indexedDB !== 'undefined') return indexedDB;
  3644. var ret = null;
  3645. if (typeof window === 'object') ret = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
  3646. assert(ret, 'IDBFS used, but indexedDB not supported');
  3647. return ret;
  3648. },DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",mount:function (mount) {
  3649. // reuse all of the core MEMFS functionality
  3650. return MEMFS.mount.apply(null, arguments);
  3651. },syncfs:function (mount, populate, callback) {
  3652. IDBFS.getLocalSet(mount, function(err, local) {
  3653. if (err) return callback(err);
  3654. IDBFS.getRemoteSet(mount, function(err, remote) {
  3655. if (err) return callback(err);
  3656. var src = populate ? remote : local;
  3657. var dst = populate ? local : remote;
  3658. IDBFS.reconcile(src, dst, callback);
  3659. });
  3660. });
  3661. },getDB:function (name, callback) {
  3662. // check the cache first
  3663. var db = IDBFS.dbs[name];
  3664. if (db) {
  3665. return callback(null, db);
  3666. }
  3667. var req;
  3668. try {
  3669. req = IDBFS.indexedDB().open(name, IDBFS.DB_VERSION);
  3670. } catch (e) {
  3671. return callback(e);
  3672. }
  3673. if (!req) {
  3674. return callback("Unable to connect to IndexedDB");
  3675. }
  3676. req.onupgradeneeded = function(e) {
  3677. var db = e.target.result;
  3678. var transaction = e.target.transaction;
  3679. var fileStore;
  3680. if (db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)) {
  3681. fileStore = transaction.objectStore(IDBFS.DB_STORE_NAME);
  3682. } else {
  3683. fileStore = db.createObjectStore(IDBFS.DB_STORE_NAME);
  3684. }
  3685. if (!fileStore.indexNames.contains('timestamp')) {
  3686. fileStore.createIndex('timestamp', 'timestamp', { unique: false });
  3687. }
  3688. };
  3689. req.onsuccess = function() {
  3690. db = req.result;
  3691. // add to the cache
  3692. IDBFS.dbs[name] = db;
  3693. callback(null, db);
  3694. };
  3695. req.onerror = function(e) {
  3696. callback(this.error);
  3697. e.preventDefault();
  3698. };
  3699. },getLocalSet:function (mount, callback) {
  3700. var entries = {};
  3701. function isRealDir(p) {
  3702. return p !== '.' && p !== '..';
  3703. };
  3704. function toAbsolute(root) {
  3705. return function(p) {
  3706. return PATH.join2(root, p);
  3707. }
  3708. };
  3709. var check = FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));
  3710. while (check.length) {
  3711. var path = check.pop();
  3712. var stat;
  3713. try {
  3714. stat = FS.stat(path);
  3715. } catch (e) {
  3716. return callback(e);
  3717. }
  3718. if (FS.isDir(stat.mode)) {
  3719. check.push.apply(check, FS.readdir(path).filter(isRealDir).map(toAbsolute(path)));
  3720. }
  3721. entries[path] = { timestamp: stat.mtime };
  3722. }
  3723. return callback(null, { type: 'local', entries: entries });
  3724. },getRemoteSet:function (mount, callback) {
  3725. var entries = {};
  3726. IDBFS.getDB(mount.mountpoint, function(err, db) {
  3727. if (err) return callback(err);
  3728. var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readonly');
  3729. transaction.onerror = function(e) {
  3730. callback(this.error);
  3731. e.preventDefault();
  3732. };
  3733. var store = transaction.objectStore(IDBFS.DB_STORE_NAME);
  3734. var index = store.index('timestamp');
  3735. index.openKeyCursor().onsuccess = function(event) {
  3736. var cursor = event.target.result;
  3737. if (!cursor) {
  3738. return callback(null, { type: 'remote', db: db, entries: entries });
  3739. }
  3740. entries[cursor.primaryKey] = { timestamp: cursor.key };
  3741. cursor.continue();
  3742. };
  3743. });
  3744. },loadLocalEntry:function (path, callback) {
  3745. var stat, node;
  3746. try {
  3747. var lookup = FS.lookupPath(path);
  3748. node = lookup.node;
  3749. stat = FS.stat(path);
  3750. } catch (e) {
  3751. return callback(e);
  3752. }
  3753. if (FS.isDir(stat.mode)) {
  3754. return callback(null, { timestamp: stat.mtime, mode: stat.mode });
  3755. } else if (FS.isFile(stat.mode)) {
  3756. // Performance consideration: storing a normal JavaScript array to a IndexedDB is much slower than storing a typed array.
  3757. // Therefore always convert the file contents to a typed array first before writing the data to IndexedDB.
  3758. node.contents = MEMFS.getFileDataAsTypedArray(node);
  3759. return callback(null, { timestamp: stat.mtime, mode: stat.mode, contents: node.contents });
  3760. } else {
  3761. return callback(new Error('node type not supported'));
  3762. }
  3763. },storeLocalEntry:function (path, entry, callback) {
  3764. try {
  3765. if (FS.isDir(entry.mode)) {
  3766. FS.mkdir(path, entry.mode);
  3767. } else if (FS.isFile(entry.mode)) {
  3768. FS.writeFile(path, entry.contents, { encoding: 'binary', canOwn: true });
  3769. } else {
  3770. return callback(new Error('node type not supported'));
  3771. }
  3772. FS.chmod(path, entry.mode);
  3773. FS.utime(path, entry.timestamp, entry.timestamp);
  3774. } catch (e) {
  3775. return callback(e);
  3776. }
  3777. callback(null);
  3778. },removeLocalEntry:function (path, callback) {
  3779. try {
  3780. var lookup = FS.lookupPath(path);
  3781. var stat = FS.stat(path);
  3782. if (FS.isDir(stat.mode)) {
  3783. FS.rmdir(path);
  3784. } else if (FS.isFile(stat.mode)) {
  3785. FS.unlink(path);
  3786. }
  3787. } catch (e) {
  3788. return callback(e);
  3789. }
  3790. callback(null);
  3791. },loadRemoteEntry:function (store, path, callback) {
  3792. var req = store.get(path);
  3793. req.onsuccess = function(event) { callback(null, event.target.result); };
  3794. req.onerror = function(e) {
  3795. callback(this.error);
  3796. e.preventDefault();
  3797. };
  3798. },storeRemoteEntry:function (store, path, entry, callback) {
  3799. var req = store.put(entry, path);
  3800. req.onsuccess = function() { callback(null); };
  3801. req.onerror = function(e) {
  3802. callback(this.error);
  3803. e.preventDefault();
  3804. };
  3805. },removeRemoteEntry:function (store, path, callback) {
  3806. var req = store.delete(path);
  3807. req.onsuccess = function() { callback(null); };
  3808. req.onerror = function(e) {
  3809. callback(this.error);
  3810. e.preventDefault();
  3811. };
  3812. },reconcile:function (src, dst, callback) {
  3813. var total = 0;
  3814. var create = [];
  3815. Object.keys(src.entries).forEach(function (key) {
  3816. var e = src.entries[key];
  3817. var e2 = dst.entries[key];
  3818. if (!e2 || e.timestamp > e2.timestamp) {
  3819. create.push(key);
  3820. total++;
  3821. }
  3822. });
  3823. var remove = [];
  3824. Object.keys(dst.entries).forEach(function (key) {
  3825. var e = dst.entries[key];
  3826. var e2 = src.entries[key];
  3827. if (!e2) {
  3828. remove.push(key);
  3829. total++;
  3830. }
  3831. });
  3832. if (!total) {
  3833. return callback(null);
  3834. }
  3835. var errored = false;
  3836. var completed = 0;
  3837. var db = src.type === 'remote' ? src.db : dst.db;
  3838. var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readwrite');
  3839. var store = transaction.objectStore(IDBFS.DB_STORE_NAME);
  3840. function done(err) {
  3841. if (err) {
  3842. if (!done.errored) {
  3843. done.errored = true;
  3844. return callback(err);
  3845. }
  3846. return;
  3847. }
  3848. if (++completed >= total) {
  3849. return callback(null);
  3850. }
  3851. };
  3852. transaction.onerror = function(e) {
  3853. done(this.error);
  3854. e.preventDefault();
  3855. };
  3856. // sort paths in ascending order so directory entries are created
  3857. // before the files inside them
  3858. create.sort().forEach(function (path) {
  3859. if (dst.type === 'local') {
  3860. IDBFS.loadRemoteEntry(store, path, function (err, entry) {
  3861. if (err) return done(err);
  3862. IDBFS.storeLocalEntry(path, entry, done);
  3863. });
  3864. } else {
  3865. IDBFS.loadLocalEntry(path, function (err, entry) {
  3866. if (err) return done(err);
  3867. IDBFS.storeRemoteEntry(store, path, entry, done);
  3868. });
  3869. }
  3870. });
  3871. // sort paths in descending order so files are deleted before their
  3872. // parent directories
  3873. remove.sort().reverse().forEach(function(path) {
  3874. if (dst.type === 'local') {
  3875. IDBFS.removeLocalEntry(path, done);
  3876. } else {
  3877. IDBFS.removeRemoteEntry(store, path, done);
  3878. }
  3879. });
  3880. }};
  3881. var NODEFS={isWindows:false,staticInit:function () {
  3882. NODEFS.isWindows = !!process.platform.match(/^win/);
  3883. },mount:function (mount) {
  3884. assert(ENVIRONMENT_IS_NODE);
  3885. return NODEFS.createNode(null, '/', NODEFS.getMode(mount.opts.root), 0);
  3886. },createNode:function (parent, name, mode, dev) {
  3887. if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) {
  3888. throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
  3889. }
  3890. var node = FS.createNode(parent, name, mode);
  3891. node.node_ops = NODEFS.node_ops;
  3892. node.stream_ops = NODEFS.stream_ops;
  3893. return node;
  3894. },getMode:function (path) {
  3895. var stat;
  3896. try {
  3897. stat = fs.lstatSync(path);
  3898. if (NODEFS.isWindows) {
  3899. // On Windows, directories return permission bits 'rw-rw-rw-', even though they have 'rwxrwxrwx', so
  3900. // propagate write bits to execute bits.
  3901. stat.mode = stat.mode | ((stat.mode & 146) >> 1);
  3902. }
  3903. } catch (e) {
  3904. if (!e.code) throw e;
  3905. throw new FS.ErrnoError(ERRNO_CODES[e.code]);
  3906. }
  3907. return stat.mode;
  3908. },realPath:function (node) {
  3909. var parts = [];
  3910. while (node.parent !== node) {
  3911. parts.push(node.name);
  3912. node = node.parent;
  3913. }
  3914. parts.push(node.mount.opts.root);
  3915. parts.reverse();
  3916. return PATH.join.apply(null, parts);
  3917. },flagsToPermissionStringMap:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},flagsToPermissionString:function (flags) {
  3918. flags &= ~0x200000 /*O_PATH*/; // Ignore this flag from musl, otherwise node.js fails to open the file.
  3919. flags &= ~0x800 /*O_NONBLOCK*/; // Ignore this flag from musl, otherwise node.js fails to open the file.
  3920. flags &= ~0x8000 /*O_LARGEFILE*/; // Ignore this flag from musl, otherwise node.js fails to open the file.
  3921. flags &= ~0x80000 /*O_CLOEXEC*/; // Some applications may pass it; it makes no sense for a single process.
  3922. if (flags in NODEFS.flagsToPermissionStringMap) {
  3923. return NODEFS.flagsToPermissionStringMap[flags];
  3924. } else {
  3925. throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
  3926. }
  3927. },node_ops:{getattr:function (node) {
  3928. var path = NODEFS.realPath(node);
  3929. var stat;
  3930. try {
  3931. stat = fs.lstatSync(path);
  3932. } catch (e) {
  3933. if (!e.code) throw e;
  3934. throw new FS.ErrnoError(ERRNO_CODES[e.code]);
  3935. }
  3936. // node.js v0.10.20 doesn't report blksize and blocks on Windows. Fake them with default blksize of 4096.
  3937. // See http://support.microsoft.com/kb/140365
  3938. if (NODEFS.isWindows && !stat.blksize) {
  3939. stat.blksize = 4096;
  3940. }
  3941. if (NODEFS.isWindows && !stat.blocks) {
  3942. stat.blocks = (stat.size+stat.blksize-1)/stat.blksize|0;
  3943. }
  3944. return {
  3945. dev: stat.dev,
  3946. ino: stat.ino,
  3947. mode: stat.mode,
  3948. nlink: stat.nlink,
  3949. uid: stat.uid,
  3950. gid: stat.gid,
  3951. rdev: stat.rdev,
  3952. size: stat.size,
  3953. atime: stat.atime,
  3954. mtime: stat.mtime,
  3955. ctime: stat.ctime,
  3956. blksize: stat.blksize,
  3957. blocks: stat.blocks
  3958. };
  3959. },setattr:function (node, attr) {
  3960. var path = NODEFS.realPath(node);
  3961. try {
  3962. if (attr.mode !== undefined) {
  3963. fs.chmodSync(path, attr.mode);
  3964. // update the common node structure mode as well
  3965. node.mode = attr.mode;
  3966. }
  3967. if (attr.timestamp !== undefined) {
  3968. var date = new Date(attr.timestamp);
  3969. fs.utimesSync(path, date, date);
  3970. }
  3971. if (attr.size !== undefined) {
  3972. fs.truncateSync(path, attr.size);
  3973. }
  3974. } catch (e) {
  3975. if (!e.code) throw e;
  3976. throw new FS.ErrnoError(ERRNO_CODES[e.code]);
  3977. }
  3978. },lookup:function (parent, name) {
  3979. var path = PATH.join2(NODEFS.realPath(parent), name);
  3980. var mode = NODEFS.getMode(path);
  3981. return NODEFS.createNode(parent, name, mode);
  3982. },mknod:function (parent, name, mode, dev) {
  3983. var node = NODEFS.createNode(parent, name, mode, dev);
  3984. // create the backing node for this in the fs root as well
  3985. var path = NODEFS.realPath(node);
  3986. try {
  3987. if (FS.isDir(node.mode)) {
  3988. fs.mkdirSync(path, node.mode);
  3989. } else {
  3990. fs.writeFileSync(path, '', { mode: node.mode });
  3991. }
  3992. } catch (e) {
  3993. if (!e.code) throw e;
  3994. throw new FS.ErrnoError(ERRNO_CODES[e.code]);
  3995. }
  3996. return node;
  3997. },rename:function (oldNode, newDir, newName) {
  3998. var oldPath = NODEFS.realPath(oldNode);
  3999. var newPath = PATH.join2(NODEFS.realPath(newDir), newName);
  4000. try {
  4001. fs.renameSync(oldPath, newPath);
  4002. } catch (e) {
  4003. if (!e.code) throw e;
  4004. throw new FS.ErrnoError(ERRNO_CODES[e.code]);
  4005. }
  4006. },unlink:function (parent, name) {
  4007. var path = PATH.join2(NODEFS.realPath(parent), name);
  4008. try {
  4009. fs.unlinkSync(path);
  4010. } catch (e) {
  4011. if (!e.code) throw e;
  4012. throw new FS.ErrnoError(ERRNO_CODES[e.code]);
  4013. }
  4014. },rmdir:function (parent, name) {
  4015. var path = PATH.join2(NODEFS.realPath(parent), name);
  4016. try {
  4017. fs.rmdirSync(path);
  4018. } catch (e) {
  4019. if (!e.code) throw e;
  4020. throw new FS.ErrnoError(ERRNO_CODES[e.code]);
  4021. }
  4022. },readdir:function (node) {
  4023. var path = NODEFS.realPath(node);
  4024. try {
  4025. return fs.readdirSync(path);
  4026. } catch (e) {
  4027. if (!e.code) throw e;
  4028. throw new FS.ErrnoError(ERRNO_CODES[e.code]);
  4029. }
  4030. },symlink:function (parent, newName, oldPath) {
  4031. var newPath = PATH.join2(NODEFS.realPath(parent), newName);
  4032. try {
  4033. fs.symlinkSync(oldPath, newPath);
  4034. } catch (e) {
  4035. if (!e.code) throw e;
  4036. throw new FS.ErrnoError(ERRNO_CODES[e.code]);
  4037. }
  4038. },readlink:function (node) {
  4039. var path = NODEFS.realPath(node);
  4040. try {
  4041. path = fs.readlinkSync(path);
  4042. path = NODEJS_PATH.relative(NODEJS_PATH.resolve(node.mount.opts.root), path);
  4043. return path;
  4044. } catch (e) {
  4045. if (!e.code) throw e;
  4046. throw new FS.ErrnoError(ERRNO_CODES[e.code]);
  4047. }
  4048. }},stream_ops:{open:function (stream) {
  4049. var path = NODEFS.realPath(stream.node);
  4050. try {
  4051. if (FS.isFile(stream.node.mode)) {
  4052. stream.nfd = fs.openSync(path, NODEFS.flagsToPermissionString(stream.flags));
  4053. }
  4054. } catch (e) {
  4055. if (!e.code) throw e;
  4056. throw new FS.ErrnoError(ERRNO_CODES[e.code]);
  4057. }
  4058. },close:function (stream) {
  4059. try {
  4060. if (FS.isFile(stream.node.mode) && stream.nfd) {
  4061. fs.closeSync(stream.nfd);
  4062. }
  4063. } catch (e) {
  4064. if (!e.code) throw e;
  4065. throw new FS.ErrnoError(ERRNO_CODES[e.code]);
  4066. }
  4067. },read:function (stream, buffer, offset, length, position) {
  4068. if (length === 0) return 0; // node errors on 0 length reads
  4069. // FIXME this is terrible.
  4070. var nbuffer = new Buffer(length);
  4071. var res;
  4072. try {
  4073. res = fs.readSync(stream.nfd, nbuffer, 0, length, position);
  4074. } catch (e) {
  4075. throw new FS.ErrnoError(ERRNO_CODES[e.code]);
  4076. }
  4077. if (res > 0) {
  4078. for (var i = 0; i < res; i++) {
  4079. buffer[offset + i] = nbuffer[i];
  4080. }
  4081. }
  4082. return res;
  4083. },write:function (stream, buffer, offset, length, position) {
  4084. // FIXME this is terrible.
  4085. var nbuffer = new Buffer(buffer.subarray(offset, offset + length));
  4086. var res;
  4087. try {
  4088. res = fs.writeSync(stream.nfd, nbuffer, 0, length, position);
  4089. } catch (e) {
  4090. throw new FS.ErrnoError(ERRNO_CODES[e.code]);
  4091. }
  4092. return res;
  4093. },llseek:function (stream, offset, whence) {
  4094. var position = offset;
  4095. if (whence === 1) { // SEEK_CUR.
  4096. position += stream.position;
  4097. } else if (whence === 2) { // SEEK_END.
  4098. if (FS.isFile(stream.node.mode)) {
  4099. try {
  4100. var stat = fs.fstatSync(stream.nfd);
  4101. position += stat.size;
  4102. } catch (e) {
  4103. throw new FS.ErrnoError(ERRNO_CODES[e.code]);
  4104. }
  4105. }
  4106. }
  4107. if (position < 0) {
  4108. throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
  4109. }
  4110. return position;
  4111. }}};
  4112. var WORKERFS={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount:function (mount) {
  4113. assert(ENVIRONMENT_IS_WORKER);
  4114. if (!WORKERFS.reader) WORKERFS.reader = new FileReaderSync();
  4115. var root = WORKERFS.createNode(null, '/', WORKERFS.DIR_MODE, 0);
  4116. var createdParents = {};
  4117. function ensureParent(path) {
  4118. // return the parent node, creating subdirs as necessary
  4119. var parts = path.split('/');
  4120. var parent = root;
  4121. for (var i = 0; i < parts.length-1; i++) {
  4122. var curr = parts.slice(0, i+1).join('/');
  4123. // Issue 4254: Using curr as a node name will prevent the node
  4124. // from being found in FS.nameTable when FS.open is called on
  4125. // a path which holds a child of this node,
  4126. // given that all FS functions assume node names
  4127. // are just their corresponding parts within their given path,
  4128. // rather than incremental aggregates which include their parent's
  4129. // directories.
  4130. if (!createdParents[curr]) {
  4131. createdParents[curr] = WORKERFS.createNode(parent, parts[i], WORKERFS.DIR_MODE, 0);
  4132. }
  4133. parent = createdParents[curr];
  4134. }
  4135. return parent;
  4136. }
  4137. function base(path) {
  4138. var parts = path.split('/');
  4139. return parts[parts.length-1];
  4140. }
  4141. // We also accept FileList here, by using Array.prototype
  4142. Array.prototype.forEach.call(mount.opts["files"] || [], function(file) {
  4143. WORKERFS.createNode(ensureParent(file.name), base(file.name), WORKERFS.FILE_MODE, 0, file, file.lastModifiedDate);
  4144. });
  4145. (mount.opts["blobs"] || []).forEach(function(obj) {
  4146. WORKERFS.createNode(ensureParent(obj["name"]), base(obj["name"]), WORKERFS.FILE_MODE, 0, obj["data"]);
  4147. });
  4148. (mount.opts["packages"] || []).forEach(function(pack) {
  4149. pack['metadata'].files.forEach(function(file) {
  4150. var name = file.filename.substr(1); // remove initial slash
  4151. WORKERFS.createNode(ensureParent(name), base(name), WORKERFS.FILE_MODE, 0, pack['blob'].slice(file.start, file.end));
  4152. });
  4153. });
  4154. return root;
  4155. },createNode:function (parent, name, mode, dev, contents, mtime) {
  4156. var node = FS.createNode(parent, name, mode);
  4157. node.mode = mode;
  4158. node.node_ops = WORKERFS.node_ops;
  4159. node.stream_ops = WORKERFS.stream_ops;
  4160. node.timestamp = (mtime || new Date).getTime();
  4161. assert(WORKERFS.FILE_MODE !== WORKERFS.DIR_MODE);
  4162. if (mode === WORKERFS.FILE_MODE) {
  4163. node.size = contents.size;
  4164. node.contents = contents;
  4165. } else {
  4166. node.size = 4096;
  4167. node.contents = {};
  4168. }
  4169. if (parent) {
  4170. parent.contents[name] = node;
  4171. }
  4172. return node;
  4173. },node_ops:{getattr:function (node) {
  4174. return {
  4175. dev: 1,
  4176. ino: undefined,
  4177. mode: node.mode,
  4178. nlink: 1,
  4179. uid: 0,
  4180. gid: 0,
  4181. rdev: undefined,
  4182. size: node.size,
  4183. atime: new Date(node.timestamp),
  4184. mtime: new Date(node.timestamp),
  4185. ctime: new Date(node.timestamp),
  4186. blksize: 4096,
  4187. blocks: Math.ceil(node.size / 4096),
  4188. };
  4189. },setattr:function (node, attr) {
  4190. if (attr.mode !== undefined) {
  4191. node.mode = attr.mode;
  4192. }
  4193. if (attr.timestamp !== undefined) {
  4194. node.timestamp = attr.timestamp;
  4195. }
  4196. },lookup:function (parent, name) {
  4197. throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
  4198. },mknod:function (parent, name, mode, dev) {
  4199. throw new FS.ErrnoError(ERRNO_CODES.EPERM);
  4200. },rename:function (oldNode, newDir, newName) {
  4201. throw new FS.ErrnoError(ERRNO_CODES.EPERM);
  4202. },unlink:function (parent, name) {
  4203. throw new FS.ErrnoError(ERRNO_CODES.EPERM);
  4204. },rmdir:function (parent, name) {
  4205. throw new FS.ErrnoError(ERRNO_CODES.EPERM);
  4206. },readdir:function (node) {
  4207. var entries = ['.', '..'];
  4208. for (var key in node.contents) {
  4209. if (!node.contents.hasOwnProperty(key)) {
  4210. continue;
  4211. }
  4212. entries.push(key);
  4213. }
  4214. return entries;
  4215. },symlink:function (parent, newName, oldPath) {
  4216. throw new FS.ErrnoError(ERRNO_CODES.EPERM);
  4217. },readlink:function (node) {
  4218. throw new FS.ErrnoError(ERRNO_CODES.EPERM);
  4219. }},stream_ops:{read:function (stream, buffer, offset, length, position) {
  4220. if (position >= stream.node.size) return 0;
  4221. var chunk = stream.node.contents.slice(position, position + length);
  4222. var ab = WORKERFS.reader.readAsArrayBuffer(chunk);
  4223. buffer.set(new Uint8Array(ab), offset);
  4224. return chunk.size;
  4225. },write:function (stream, buffer, offset, length, position) {
  4226. throw new FS.ErrnoError(ERRNO_CODES.EIO);
  4227. },llseek:function (stream, offset, whence) {
  4228. var position = offset;
  4229. if (whence === 1) { // SEEK_CUR.
  4230. position += stream.position;
  4231. } else if (whence === 2) { // SEEK_END.
  4232. if (FS.isFile(stream.node.mode)) {
  4233. position += stream.node.size;
  4234. }
  4235. }
  4236. if (position < 0) {
  4237. throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
  4238. }
  4239. return position;
  4240. }}};
  4241. var _stdin; if (ENVIRONMENT_IS_PTHREAD) _stdin = PthreadWorkerInit._stdin; else PthreadWorkerInit._stdin = _stdin = allocate(1, "i32*", ALLOC_STATIC);
  4242. var _stdout; if (ENVIRONMENT_IS_PTHREAD) _stdout = PthreadWorkerInit._stdout; else PthreadWorkerInit._stdout = _stdout = allocate(1, "i32*", ALLOC_STATIC);
  4243. var _stderr; if (ENVIRONMENT_IS_PTHREAD) _stderr = PthreadWorkerInit._stderr; else PthreadWorkerInit._stderr = _stderr = allocate(1, "i32*", ALLOC_STATIC);var FS={root:null,mounts:[],devices:[null],streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:function (e) {
  4244. if (!(e instanceof FS.ErrnoError)) throw e + ' : ' + stackTrace();
  4245. return ___setErrNo(e.errno);
  4246. },lookupPath:function (path, opts) {
  4247. path = PATH.resolve(FS.cwd(), path);
  4248. opts = opts || {};
  4249. if (!path) return { path: '', node: null };
  4250. var defaults = {
  4251. follow_mount: true,
  4252. recurse_count: 0
  4253. };
  4254. for (var key in defaults) {
  4255. if (opts[key] === undefined) {
  4256. opts[key] = defaults[key];
  4257. }
  4258. }
  4259. if (opts.recurse_count > 8) { // max recursive lookup of 8
  4260. throw new FS.ErrnoError(ERRNO_CODES.ELOOP);
  4261. }
  4262. // split the path
  4263. var parts = PATH.normalizeArray(path.split('/').filter(function(p) {
  4264. return !!p;
  4265. }), false);
  4266. // start at the root
  4267. var current = FS.root;
  4268. var current_path = '/';
  4269. for (var i = 0; i < parts.length; i++) {
  4270. var islast = (i === parts.length-1);
  4271. if (islast && opts.parent) {
  4272. // stop resolving
  4273. break;
  4274. }
  4275. current = FS.lookupNode(current, parts[i]);
  4276. current_path = PATH.join2(current_path, parts[i]);
  4277. // jump to the mount's root node if this is a mountpoint
  4278. if (FS.isMountpoint(current)) {
  4279. if (!islast || (islast && opts.follow_mount)) {
  4280. current = current.mounted.root;
  4281. }
  4282. }
  4283. // by default, lookupPath will not follow a symlink if it is the final path component.
  4284. // setting opts.follow = true will override this behavior.
  4285. if (!islast || opts.follow) {
  4286. var count = 0;
  4287. while (FS.isLink(current.mode)) {
  4288. var link = FS.readlink(current_path);
  4289. current_path = PATH.resolve(PATH.dirname(current_path), link);
  4290. var lookup = FS.lookupPath(current_path, { recurse_count: opts.recurse_count });
  4291. current = lookup.node;
  4292. if (count++ > 40) { // limit max consecutive symlinks to 40 (SYMLOOP_MAX).
  4293. throw new FS.ErrnoError(ERRNO_CODES.ELOOP);
  4294. }
  4295. }
  4296. }
  4297. }
  4298. return { path: current_path, node: current };
  4299. },getPath:function (node) {
  4300. var path;
  4301. while (true) {
  4302. if (FS.isRoot(node)) {
  4303. var mount = node.mount.mountpoint;
  4304. if (!path) return mount;
  4305. return mount[mount.length-1] !== '/' ? mount + '/' + path : mount + path;
  4306. }
  4307. path = path ? node.name + '/' + path : node.name;
  4308. node = node.parent;
  4309. }
  4310. },hashName:function (parentid, name) {
  4311. var hash = 0;
  4312. for (var i = 0; i < name.length; i++) {
  4313. hash = ((hash << 5) - hash + name.charCodeAt(i)) | 0;
  4314. }
  4315. return ((parentid + hash) >>> 0) % FS.nameTable.length;
  4316. },hashAddNode:function (node) {
  4317. var hash = FS.hashName(node.parent.id, node.name);
  4318. node.name_next = FS.nameTable[hash];
  4319. FS.nameTable[hash] = node;
  4320. },hashRemoveNode:function (node) {
  4321. var hash = FS.hashName(node.parent.id, node.name);
  4322. if (FS.nameTable[hash] === node) {
  4323. FS.nameTable[hash] = node.name_next;
  4324. } else {
  4325. var current = FS.nameTable[hash];
  4326. while (current) {
  4327. if (current.name_next === node) {
  4328. current.name_next = node.name_next;
  4329. break;
  4330. }
  4331. current = current.name_next;
  4332. }
  4333. }
  4334. },lookupNode:function (parent, name) {
  4335. var err = FS.mayLookup(parent);
  4336. if (err) {
  4337. throw new FS.ErrnoError(err, parent);
  4338. }
  4339. var hash = FS.hashName(parent.id, name);
  4340. for (var node = FS.nameTable[hash]; node; node = node.name_next) {
  4341. var nodeName = node.name;
  4342. if (node.parent.id === parent.id && nodeName === name) {
  4343. return node;
  4344. }
  4345. }
  4346. // if we failed to find it in the cache, call into the VFS
  4347. return FS.lookup(parent, name);
  4348. },createNode:function (parent, name, mode, rdev) {
  4349. if (!FS.FSNode) {
  4350. FS.FSNode = function(parent, name, mode, rdev) {
  4351. if (!parent) {
  4352. parent = this; // root node sets parent to itself
  4353. }
  4354. this.parent = parent;
  4355. this.mount = parent.mount;
  4356. this.mounted = null;
  4357. this.id = FS.nextInode++;
  4358. this.name = name;
  4359. this.mode = mode;
  4360. this.node_ops = {};
  4361. this.stream_ops = {};
  4362. this.rdev = rdev;
  4363. };
  4364. FS.FSNode.prototype = {};
  4365. // compatibility
  4366. var readMode = 292 | 73;
  4367. var writeMode = 146;
  4368. // NOTE we must use Object.defineProperties instead of individual calls to
  4369. // Object.defineProperty in order to make closure compiler happy
  4370. Object.defineProperties(FS.FSNode.prototype, {
  4371. read: {
  4372. get: function() { return (this.mode & readMode) === readMode; },
  4373. set: function(val) { val ? this.mode |= readMode : this.mode &= ~readMode; }
  4374. },
  4375. write: {
  4376. get: function() { return (this.mode & writeMode) === writeMode; },
  4377. set: function(val) { val ? this.mode |= writeMode : this.mode &= ~writeMode; }
  4378. },
  4379. isFolder: {
  4380. get: function() { return FS.isDir(this.mode); }
  4381. },
  4382. isDevice: {
  4383. get: function() { return FS.isChrdev(this.mode); }
  4384. }
  4385. });
  4386. }
  4387. var node = new FS.FSNode(parent, name, mode, rdev);
  4388. FS.hashAddNode(node);
  4389. return node;
  4390. },destroyNode:function (node) {
  4391. FS.hashRemoveNode(node);
  4392. },isRoot:function (node) {
  4393. return node === node.parent;
  4394. },isMountpoint:function (node) {
  4395. return !!node.mounted;
  4396. },isFile:function (mode) {
  4397. return (mode & 61440) === 32768;
  4398. },isDir:function (mode) {
  4399. return (mode & 61440) === 16384;
  4400. },isLink:function (mode) {
  4401. return (mode & 61440) === 40960;
  4402. },isChrdev:function (mode) {
  4403. return (mode & 61440) === 8192;
  4404. },isBlkdev:function (mode) {
  4405. return (mode & 61440) === 24576;
  4406. },isFIFO:function (mode) {
  4407. return (mode & 61440) === 4096;
  4408. },isSocket:function (mode) {
  4409. return (mode & 49152) === 49152;
  4410. },flagModes:{"r":0,"rs":1052672,"r+":2,"w":577,"wx":705,"xw":705,"w+":578,"wx+":706,"xw+":706,"a":1089,"ax":1217,"xa":1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function (str) {
  4411. var flags = FS.flagModes[str];
  4412. if (typeof flags === 'undefined') {
  4413. throw new Error('Unknown file open mode: ' + str);
  4414. }
  4415. return flags;
  4416. },flagsToPermissionString:function (flag) {
  4417. var perms = ['r', 'w', 'rw'][flag & 3];
  4418. if ((flag & 512)) {
  4419. perms += 'w';
  4420. }
  4421. return perms;
  4422. },nodePermissions:function (node, perms) {
  4423. if (FS.ignorePermissions) {
  4424. return 0;
  4425. }
  4426. // return 0 if any user, group or owner bits are set.
  4427. if (perms.indexOf('r') !== -1 && !(node.mode & 292)) {
  4428. return ERRNO_CODES.EACCES;
  4429. } else if (perms.indexOf('w') !== -1 && !(node.mode & 146)) {
  4430. return ERRNO_CODES.EACCES;
  4431. } else if (perms.indexOf('x') !== -1 && !(node.mode & 73)) {
  4432. return ERRNO_CODES.EACCES;
  4433. }
  4434. return 0;
  4435. },mayLookup:function (dir) {
  4436. var err = FS.nodePermissions(dir, 'x');
  4437. if (err) return err;
  4438. if (!dir.node_ops.lookup) return ERRNO_CODES.EACCES;
  4439. return 0;
  4440. },mayCreate:function (dir, name) {
  4441. try {
  4442. var node = FS.lookupNode(dir, name);
  4443. return ERRNO_CODES.EEXIST;
  4444. } catch (e) {
  4445. }
  4446. return FS.nodePermissions(dir, 'wx');
  4447. },mayDelete:function (dir, name, isdir) {
  4448. var node;
  4449. try {
  4450. node = FS.lookupNode(dir, name);
  4451. } catch (e) {
  4452. return e.errno;
  4453. }
  4454. var err = FS.nodePermissions(dir, 'wx');
  4455. if (err) {
  4456. return err;
  4457. }
  4458. if (isdir) {
  4459. if (!FS.isDir(node.mode)) {
  4460. return ERRNO_CODES.ENOTDIR;
  4461. }
  4462. if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) {
  4463. return ERRNO_CODES.EBUSY;
  4464. }
  4465. } else {
  4466. if (FS.isDir(node.mode)) {
  4467. return ERRNO_CODES.EISDIR;
  4468. }
  4469. }
  4470. return 0;
  4471. },mayOpen:function (node, flags) {
  4472. if (!node) {
  4473. return ERRNO_CODES.ENOENT;
  4474. }
  4475. if (FS.isLink(node.mode)) {
  4476. return ERRNO_CODES.ELOOP;
  4477. } else if (FS.isDir(node.mode)) {
  4478. if (FS.flagsToPermissionString(flags) !== 'r' || // opening for write
  4479. (flags & 512)) { // TODO: check for O_SEARCH? (== search for dir only)
  4480. return ERRNO_CODES.EISDIR;
  4481. }
  4482. }
  4483. return FS.nodePermissions(node, FS.flagsToPermissionString(flags));
  4484. },MAX_OPEN_FDS:4096,nextfd:function (fd_start, fd_end) {
  4485. fd_start = fd_start || 0;
  4486. fd_end = fd_end || FS.MAX_OPEN_FDS;
  4487. for (var fd = fd_start; fd <= fd_end; fd++) {
  4488. if (!FS.streams[fd]) {
  4489. return fd;
  4490. }
  4491. }
  4492. throw new FS.ErrnoError(ERRNO_CODES.EMFILE);
  4493. },getStream:function (fd) {
  4494. return FS.streams[fd];
  4495. },createStream:function (stream, fd_start, fd_end) {
  4496. if (!FS.FSStream) {
  4497. FS.FSStream = function(){};
  4498. FS.FSStream.prototype = {};
  4499. // compatibility
  4500. Object.defineProperties(FS.FSStream.prototype, {
  4501. object: {
  4502. get: function() { return this.node; },
  4503. set: function(val) { this.node = val; }
  4504. },
  4505. isRead: {
  4506. get: function() { return (this.flags & 2097155) !== 1; }
  4507. },
  4508. isWrite: {
  4509. get: function() { return (this.flags & 2097155) !== 0; }
  4510. },
  4511. isAppend: {
  4512. get: function() { return (this.flags & 1024); }
  4513. }
  4514. });
  4515. }
  4516. // clone it, so we can return an instance of FSStream
  4517. var newStream = new FS.FSStream();
  4518. for (var p in stream) {
  4519. newStream[p] = stream[p];
  4520. }
  4521. stream = newStream;
  4522. var fd = FS.nextfd(fd_start, fd_end);
  4523. stream.fd = fd;
  4524. FS.streams[fd] = stream;
  4525. return stream;
  4526. },closeStream:function (fd) {
  4527. FS.streams[fd] = null;
  4528. },chrdev_stream_ops:{open:function (stream) {
  4529. var device = FS.getDevice(stream.node.rdev);
  4530. // override node's stream ops with the device's
  4531. stream.stream_ops = device.stream_ops;
  4532. // forward the open call
  4533. if (stream.stream_ops.open) {
  4534. stream.stream_ops.open(stream);
  4535. }
  4536. },llseek:function () {
  4537. throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
  4538. }},major:function (dev) {
  4539. return ((dev) >> 8);
  4540. },minor:function (dev) {
  4541. return ((dev) & 0xff);
  4542. },makedev:function (ma, mi) {
  4543. return ((ma) << 8 | (mi));
  4544. },registerDevice:function (dev, ops) {
  4545. FS.devices[dev] = { stream_ops: ops };
  4546. },getDevice:function (dev) {
  4547. return FS.devices[dev];
  4548. },getMounts:function (mount) {
  4549. var mounts = [];
  4550. var check = [mount];
  4551. while (check.length) {
  4552. var m = check.pop();
  4553. mounts.push(m);
  4554. check.push.apply(check, m.mounts);
  4555. }
  4556. return mounts;
  4557. },syncfs:function (populate, callback) {
  4558. if (typeof(populate) === 'function') {
  4559. callback = populate;
  4560. populate = false;
  4561. }
  4562. FS.syncFSRequests++;
  4563. if (FS.syncFSRequests > 1) {
  4564. console.log('warning: ' + FS.syncFSRequests + ' FS.syncfs operations in flight at once, probably just doing extra work');
  4565. }
  4566. var mounts = FS.getMounts(FS.root.mount);
  4567. var completed = 0;
  4568. function doCallback(err) {
  4569. assert(FS.syncFSRequests > 0);
  4570. FS.syncFSRequests--;
  4571. return callback(err);
  4572. }
  4573. function done(err) {
  4574. if (err) {
  4575. if (!done.errored) {
  4576. done.errored = true;
  4577. return doCallback(err);
  4578. }
  4579. return;
  4580. }
  4581. if (++completed >= mounts.length) {
  4582. doCallback(null);
  4583. }
  4584. };
  4585. // sync all mounts
  4586. mounts.forEach(function (mount) {
  4587. if (!mount.type.syncfs) {
  4588. return done(null);
  4589. }
  4590. mount.type.syncfs(mount, populate, done);
  4591. });
  4592. },mount:function (type, opts, mountpoint) {
  4593. var root = mountpoint === '/';
  4594. var pseudo = !mountpoint;
  4595. var node;
  4596. if (root && FS.root) {
  4597. throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
  4598. } else if (!root && !pseudo) {
  4599. var lookup = FS.lookupPath(mountpoint, { follow_mount: false });
  4600. mountpoint = lookup.path; // use the absolute path
  4601. node = lookup.node;
  4602. if (FS.isMountpoint(node)) {
  4603. throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
  4604. }
  4605. if (!FS.isDir(node.mode)) {
  4606. throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
  4607. }
  4608. }
  4609. var mount = {
  4610. type: type,
  4611. opts: opts,
  4612. mountpoint: mountpoint,
  4613. mounts: []
  4614. };
  4615. // create a root node for the fs
  4616. var mountRoot = type.mount(mount);
  4617. mountRoot.mount = mount;
  4618. mount.root = mountRoot;
  4619. if (root) {
  4620. FS.root = mountRoot;
  4621. } else if (node) {
  4622. // set as a mountpoint
  4623. node.mounted = mount;
  4624. // add the new mount to the current mount's children
  4625. if (node.mount) {
  4626. node.mount.mounts.push(mount);
  4627. }
  4628. }
  4629. return mountRoot;
  4630. },unmount:function (mountpoint) {
  4631. var lookup = FS.lookupPath(mountpoint, { follow_mount: false });
  4632. if (!FS.isMountpoint(lookup.node)) {
  4633. throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
  4634. }
  4635. // destroy the nodes for this mount, and all its child mounts
  4636. var node = lookup.node;
  4637. var mount = node.mounted;
  4638. var mounts = FS.getMounts(mount);
  4639. Object.keys(FS.nameTable).forEach(function (hash) {
  4640. var current = FS.nameTable[hash];
  4641. while (current) {
  4642. var next = current.name_next;
  4643. if (mounts.indexOf(current.mount) !== -1) {
  4644. FS.destroyNode(current);
  4645. }
  4646. current = next;
  4647. }
  4648. });
  4649. // no longer a mountpoint
  4650. node.mounted = null;
  4651. // remove this mount from the child mounts
  4652. var idx = node.mount.mounts.indexOf(mount);
  4653. assert(idx !== -1);
  4654. node.mount.mounts.splice(idx, 1);
  4655. },lookup:function (parent, name) {
  4656. return parent.node_ops.lookup(parent, name);
  4657. },mknod:function (path, mode, dev) {
  4658. var lookup = FS.lookupPath(path, { parent: true });
  4659. var parent = lookup.node;
  4660. var name = PATH.basename(path);
  4661. if (!name || name === '.' || name === '..') {
  4662. throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
  4663. }
  4664. var err = FS.mayCreate(parent, name);
  4665. if (err) {
  4666. throw new FS.ErrnoError(err);
  4667. }
  4668. if (!parent.node_ops.mknod) {
  4669. throw new FS.ErrnoError(ERRNO_CODES.EPERM);
  4670. }
  4671. return parent.node_ops.mknod(parent, name, mode, dev);
  4672. },create:function (path, mode) {
  4673. mode = mode !== undefined ? mode : 438 /* 0666 */;
  4674. mode &= 4095;
  4675. mode |= 32768;
  4676. return FS.mknod(path, mode, 0);
  4677. },mkdir:function (path, mode) {
  4678. mode = mode !== undefined ? mode : 511 /* 0777 */;
  4679. mode &= 511 | 512;
  4680. mode |= 16384;
  4681. return FS.mknod(path, mode, 0);
  4682. },mkdirTree:function (path, mode) {
  4683. var dirs = path.split('/');
  4684. var d = '';
  4685. for (var i = 0; i < dirs.length; ++i) {
  4686. if (!dirs[i]) continue;
  4687. d += '/' + dirs[i];
  4688. try {
  4689. FS.mkdir(d, mode);
  4690. } catch(e) {
  4691. if (e.errno != ERRNO_CODES.EEXIST) throw e;
  4692. }
  4693. }
  4694. },mkdev:function (path, mode, dev) {
  4695. if (typeof(dev) === 'undefined') {
  4696. dev = mode;
  4697. mode = 438 /* 0666 */;
  4698. }
  4699. mode |= 8192;
  4700. return FS.mknod(path, mode, dev);
  4701. },symlink:function (oldpath, newpath) {
  4702. if (!PATH.resolve(oldpath)) {
  4703. throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
  4704. }
  4705. var lookup = FS.lookupPath(newpath, { parent: true });
  4706. var parent = lookup.node;
  4707. if (!parent) {
  4708. throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
  4709. }
  4710. var newname = PATH.basename(newpath);
  4711. var err = FS.mayCreate(parent, newname);
  4712. if (err) {
  4713. throw new FS.ErrnoError(err);
  4714. }
  4715. if (!parent.node_ops.symlink) {
  4716. throw new FS.ErrnoError(ERRNO_CODES.EPERM);
  4717. }
  4718. return parent.node_ops.symlink(parent, newname, oldpath);
  4719. },rename:function (old_path, new_path) {
  4720. var old_dirname = PATH.dirname(old_path);
  4721. var new_dirname = PATH.dirname(new_path);
  4722. var old_name = PATH.basename(old_path);
  4723. var new_name = PATH.basename(new_path);
  4724. // parents must exist
  4725. var lookup, old_dir, new_dir;
  4726. try {
  4727. lookup = FS.lookupPath(old_path, { parent: true });
  4728. old_dir = lookup.node;
  4729. lookup = FS.lookupPath(new_path, { parent: true });
  4730. new_dir = lookup.node;
  4731. } catch (e) {
  4732. throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
  4733. }
  4734. if (!old_dir || !new_dir) throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
  4735. // need to be part of the same mount
  4736. if (old_dir.mount !== new_dir.mount) {
  4737. throw new FS.ErrnoError(ERRNO_CODES.EXDEV);
  4738. }
  4739. // source must exist
  4740. var old_node = FS.lookupNode(old_dir, old_name);
  4741. // old path should not be an ancestor of the new path
  4742. var relative = PATH.relative(old_path, new_dirname);
  4743. if (relative.charAt(0) !== '.') {
  4744. throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
  4745. }
  4746. // new path should not be an ancestor of the old path
  4747. relative = PATH.relative(new_path, old_dirname);
  4748. if (relative.charAt(0) !== '.') {
  4749. throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
  4750. }
  4751. // see if the new path already exists
  4752. var new_node;
  4753. try {
  4754. new_node = FS.lookupNode(new_dir, new_name);
  4755. } catch (e) {
  4756. // not fatal
  4757. }
  4758. // early out if nothing needs to change
  4759. if (old_node === new_node) {
  4760. return;
  4761. }
  4762. // we'll need to delete the old entry
  4763. var isdir = FS.isDir(old_node.mode);
  4764. var err = FS.mayDelete(old_dir, old_name, isdir);
  4765. if (err) {
  4766. throw new FS.ErrnoError(err);
  4767. }
  4768. // need delete permissions if we'll be overwriting.
  4769. // need create permissions if new doesn't already exist.
  4770. err = new_node ?
  4771. FS.mayDelete(new_dir, new_name, isdir) :
  4772. FS.mayCreate(new_dir, new_name);
  4773. if (err) {
  4774. throw new FS.ErrnoError(err);
  4775. }
  4776. if (!old_dir.node_ops.rename) {
  4777. throw new FS.ErrnoError(ERRNO_CODES.EPERM);
  4778. }
  4779. if (FS.isMountpoint(old_node) || (new_node && FS.isMountpoint(new_node))) {
  4780. throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
  4781. }
  4782. // if we are going to change the parent, check write permissions
  4783. if (new_dir !== old_dir) {
  4784. err = FS.nodePermissions(old_dir, 'w');
  4785. if (err) {
  4786. throw new FS.ErrnoError(err);
  4787. }
  4788. }
  4789. try {
  4790. if (FS.trackingDelegate['willMovePath']) {
  4791. FS.trackingDelegate['willMovePath'](old_path, new_path);
  4792. }
  4793. } catch(e) {
  4794. console.log("FS.trackingDelegate['willMovePath']('"+old_path+"', '"+new_path+"') threw an exception: " + e.message);
  4795. }
  4796. // remove the node from the lookup hash
  4797. FS.hashRemoveNode(old_node);
  4798. // do the underlying fs rename
  4799. try {
  4800. old_dir.node_ops.rename(old_node, new_dir, new_name);
  4801. } catch (e) {
  4802. throw e;
  4803. } finally {
  4804. // add the node back to the hash (in case node_ops.rename
  4805. // changed its name)
  4806. FS.hashAddNode(old_node);
  4807. }
  4808. try {
  4809. if (FS.trackingDelegate['onMovePath']) FS.trackingDelegate['onMovePath'](old_path, new_path);
  4810. } catch(e) {
  4811. console.log("FS.trackingDelegate['onMovePath']('"+old_path+"', '"+new_path+"') threw an exception: " + e.message);
  4812. }
  4813. },rmdir:function (path) {
  4814. var lookup = FS.lookupPath(path, { parent: true });
  4815. var parent = lookup.node;
  4816. var name = PATH.basename(path);
  4817. var node = FS.lookupNode(parent, name);
  4818. var err = FS.mayDelete(parent, name, true);
  4819. if (err) {
  4820. throw new FS.ErrnoError(err);
  4821. }
  4822. if (!parent.node_ops.rmdir) {
  4823. throw new FS.ErrnoError(ERRNO_CODES.EPERM);
  4824. }
  4825. if (FS.isMountpoint(node)) {
  4826. throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
  4827. }
  4828. try {
  4829. if (FS.trackingDelegate['willDeletePath']) {
  4830. FS.trackingDelegate['willDeletePath'](path);
  4831. }
  4832. } catch(e) {
  4833. console.log("FS.trackingDelegate['willDeletePath']('"+path+"') threw an exception: " + e.message);
  4834. }
  4835. parent.node_ops.rmdir(parent, name);
  4836. FS.destroyNode(node);
  4837. try {
  4838. if (FS.trackingDelegate['onDeletePath']) FS.trackingDelegate['onDeletePath'](path);
  4839. } catch(e) {
  4840. console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: " + e.message);
  4841. }
  4842. },readdir:function (path) {
  4843. var lookup = FS.lookupPath(path, { follow: true });
  4844. var node = lookup.node;
  4845. if (!node.node_ops.readdir) {
  4846. throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
  4847. }
  4848. return node.node_ops.readdir(node);
  4849. },unlink:function (path) {
  4850. var lookup = FS.lookupPath(path, { parent: true });
  4851. var parent = lookup.node;
  4852. var name = PATH.basename(path);
  4853. var node = FS.lookupNode(parent, name);
  4854. var err = FS.mayDelete(parent, name, false);
  4855. if (err) {
  4856. // According to POSIX, we should map EISDIR to EPERM, but
  4857. // we instead do what Linux does (and we must, as we use
  4858. // the musl linux libc).
  4859. throw new FS.ErrnoError(err);
  4860. }
  4861. if (!parent.node_ops.unlink) {
  4862. throw new FS.ErrnoError(ERRNO_CODES.EPERM);
  4863. }
  4864. if (FS.isMountpoint(node)) {
  4865. throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
  4866. }
  4867. try {
  4868. if (FS.trackingDelegate['willDeletePath']) {
  4869. FS.trackingDelegate['willDeletePath'](path);
  4870. }
  4871. } catch(e) {
  4872. console.log("FS.trackingDelegate['willDeletePath']('"+path+"') threw an exception: " + e.message);
  4873. }
  4874. parent.node_ops.unlink(parent, name);
  4875. FS.destroyNode(node);
  4876. try {
  4877. if (FS.trackingDelegate['onDeletePath']) FS.trackingDelegate['onDeletePath'](path);
  4878. } catch(e) {
  4879. console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: " + e.message);
  4880. }
  4881. },readlink:function (path) {
  4882. var lookup = FS.lookupPath(path);
  4883. var link = lookup.node;
  4884. if (!link) {
  4885. throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
  4886. }
  4887. if (!link.node_ops.readlink) {
  4888. throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
  4889. }
  4890. return PATH.resolve(FS.getPath(link.parent), link.node_ops.readlink(link));
  4891. },stat:function (path, dontFollow) {
  4892. var lookup = FS.lookupPath(path, { follow: !dontFollow });
  4893. var node = lookup.node;
  4894. if (!node) {
  4895. throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
  4896. }
  4897. if (!node.node_ops.getattr) {
  4898. throw new FS.ErrnoError(ERRNO_CODES.EPERM);
  4899. }
  4900. return node.node_ops.getattr(node);
  4901. },lstat:function (path) {
  4902. return FS.stat(path, true);
  4903. },chmod:function (path, mode, dontFollow) {
  4904. var node;
  4905. if (typeof path === 'string') {
  4906. var lookup = FS.lookupPath(path, { follow: !dontFollow });
  4907. node = lookup.node;
  4908. } else {
  4909. node = path;
  4910. }
  4911. if (!node.node_ops.setattr) {
  4912. throw new FS.ErrnoError(ERRNO_CODES.EPERM);
  4913. }
  4914. node.node_ops.setattr(node, {
  4915. mode: (mode & 4095) | (node.mode & ~4095),
  4916. timestamp: Date.now()
  4917. });
  4918. },lchmod:function (path, mode) {
  4919. FS.chmod(path, mode, true);
  4920. },fchmod:function (fd, mode) {
  4921. var stream = FS.getStream(fd);
  4922. if (!stream) {
  4923. throw new FS.ErrnoError(ERRNO_CODES.EBADF);
  4924. }
  4925. FS.chmod(stream.node, mode);
  4926. },chown:function (path, uid, gid, dontFollow) {
  4927. var node;
  4928. if (typeof path === 'string') {
  4929. var lookup = FS.lookupPath(path, { follow: !dontFollow });
  4930. node = lookup.node;
  4931. } else {
  4932. node = path;
  4933. }
  4934. if (!node.node_ops.setattr) {
  4935. throw new FS.ErrnoError(ERRNO_CODES.EPERM);
  4936. }
  4937. node.node_ops.setattr(node, {
  4938. timestamp: Date.now()
  4939. // we ignore the uid / gid for now
  4940. });
  4941. },lchown:function (path, uid, gid) {
  4942. FS.chown(path, uid, gid, true);
  4943. },fchown:function (fd, uid, gid) {
  4944. var stream = FS.getStream(fd);
  4945. if (!stream) {
  4946. throw new FS.ErrnoError(ERRNO_CODES.EBADF);
  4947. }
  4948. FS.chown(stream.node, uid, gid);
  4949. },truncate:function (path, len) {
  4950. if (len < 0) {
  4951. throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
  4952. }
  4953. var node;
  4954. if (typeof path === 'string') {
  4955. var lookup = FS.lookupPath(path, { follow: true });
  4956. node = lookup.node;
  4957. } else {
  4958. node = path;
  4959. }
  4960. if (!node.node_ops.setattr) {
  4961. throw new FS.ErrnoError(ERRNO_CODES.EPERM);
  4962. }
  4963. if (FS.isDir(node.mode)) {
  4964. throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
  4965. }
  4966. if (!FS.isFile(node.mode)) {
  4967. throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
  4968. }
  4969. var err = FS.nodePermissions(node, 'w');
  4970. if (err) {
  4971. throw new FS.ErrnoError(err);
  4972. }
  4973. node.node_ops.setattr(node, {
  4974. size: len,
  4975. timestamp: Date.now()
  4976. });
  4977. },ftruncate:function (fd, len) {
  4978. var stream = FS.getStream(fd);
  4979. if (!stream) {
  4980. throw new FS.ErrnoError(ERRNO_CODES.EBADF);
  4981. }
  4982. if ((stream.flags & 2097155) === 0) {
  4983. throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
  4984. }
  4985. FS.truncate(stream.node, len);
  4986. },utime:function (path, atime, mtime) {
  4987. var lookup = FS.lookupPath(path, { follow: true });
  4988. var node = lookup.node;
  4989. node.node_ops.setattr(node, {
  4990. timestamp: Math.max(atime, mtime)
  4991. });
  4992. },open:function (path, flags, mode, fd_start, fd_end) {
  4993. if (path === "") {
  4994. throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
  4995. }
  4996. flags = typeof flags === 'string' ? FS.modeStringToFlags(flags) : flags;
  4997. mode = typeof mode === 'undefined' ? 438 /* 0666 */ : mode;
  4998. if ((flags & 64)) {
  4999. mode = (mode & 4095) | 32768;
  5000. } else {
  5001. mode = 0;
  5002. }
  5003. var node;
  5004. if (typeof path === 'object') {
  5005. node = path;
  5006. } else {
  5007. path = PATH.normalize(path);
  5008. try {
  5009. var lookup = FS.lookupPath(path, {
  5010. follow: !(flags & 131072)
  5011. });
  5012. node = lookup.node;
  5013. } catch (e) {
  5014. // ignore
  5015. }
  5016. }
  5017. // perhaps we need to create the node
  5018. var created = false;
  5019. if ((flags & 64)) {
  5020. if (node) {
  5021. // if O_CREAT and O_EXCL are set, error out if the node already exists
  5022. if ((flags & 128)) {
  5023. throw new FS.ErrnoError(ERRNO_CODES.EEXIST);
  5024. }
  5025. } else {
  5026. // node doesn't exist, try to create it
  5027. node = FS.mknod(path, mode, 0);
  5028. created = true;
  5029. }
  5030. }
  5031. if (!node) {
  5032. throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
  5033. }
  5034. // can't truncate a device
  5035. if (FS.isChrdev(node.mode)) {
  5036. flags &= ~512;
  5037. }
  5038. // if asked only for a directory, then this must be one
  5039. if ((flags & 65536) && !FS.isDir(node.mode)) {
  5040. throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
  5041. }
  5042. // check permissions, if this is not a file we just created now (it is ok to
  5043. // create and write to a file with read-only permissions; it is read-only
  5044. // for later use)
  5045. if (!created) {
  5046. var err = FS.mayOpen(node, flags);
  5047. if (err) {
  5048. throw new FS.ErrnoError(err);
  5049. }
  5050. }
  5051. // do truncation if necessary
  5052. if ((flags & 512)) {
  5053. FS.truncate(node, 0);
  5054. }
  5055. // we've already handled these, don't pass down to the underlying vfs
  5056. flags &= ~(128 | 512);
  5057. // register the stream with the filesystem
  5058. var stream = FS.createStream({
  5059. node: node,
  5060. path: FS.getPath(node), // we want the absolute path to the node
  5061. flags: flags,
  5062. seekable: true,
  5063. position: 0,
  5064. stream_ops: node.stream_ops,
  5065. // used by the file family libc calls (fopen, fwrite, ferror, etc.)
  5066. ungotten: [],
  5067. error: false
  5068. }, fd_start, fd_end);
  5069. // call the new stream's open function
  5070. if (stream.stream_ops.open) {
  5071. stream.stream_ops.open(stream);
  5072. }
  5073. if (Module['logReadFiles'] && !(flags & 1)) {
  5074. if (!FS.readFiles) FS.readFiles = {};
  5075. if (!(path in FS.readFiles)) {
  5076. FS.readFiles[path] = 1;
  5077. Module['printErr']('read file: ' + path);
  5078. }
  5079. }
  5080. try {
  5081. if (FS.trackingDelegate['onOpenFile']) {
  5082. var trackingFlags = 0;
  5083. if ((flags & 2097155) !== 1) {
  5084. trackingFlags |= FS.tracking.openFlags.READ;
  5085. }
  5086. if ((flags & 2097155) !== 0) {
  5087. trackingFlags |= FS.tracking.openFlags.WRITE;
  5088. }
  5089. FS.trackingDelegate['onOpenFile'](path, trackingFlags);
  5090. }
  5091. } catch(e) {
  5092. console.log("FS.trackingDelegate['onOpenFile']('"+path+"', flags) threw an exception: " + e.message);
  5093. }
  5094. return stream;
  5095. },close:function (stream) {
  5096. if (stream.getdents) stream.getdents = null; // free readdir state
  5097. try {
  5098. if (stream.stream_ops.close) {
  5099. stream.stream_ops.close(stream);
  5100. }
  5101. } catch (e) {
  5102. throw e;
  5103. } finally {
  5104. FS.closeStream(stream.fd);
  5105. }
  5106. },llseek:function (stream, offset, whence) {
  5107. if (!stream.seekable || !stream.stream_ops.llseek) {
  5108. throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
  5109. }
  5110. stream.position = stream.stream_ops.llseek(stream, offset, whence);
  5111. stream.ungotten = [];
  5112. return stream.position;
  5113. },read:function (stream, buffer, offset, length, position) {
  5114. if (length < 0 || position < 0) {
  5115. throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
  5116. }
  5117. if ((stream.flags & 2097155) === 1) {
  5118. throw new FS.ErrnoError(ERRNO_CODES.EBADF);
  5119. }
  5120. if (FS.isDir(stream.node.mode)) {
  5121. throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
  5122. }
  5123. if (!stream.stream_ops.read) {
  5124. throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
  5125. }
  5126. var seeking = true;
  5127. if (typeof position === 'undefined') {
  5128. position = stream.position;
  5129. seeking = false;
  5130. } else if (!stream.seekable) {
  5131. throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
  5132. }
  5133. var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position);
  5134. if (!seeking) stream.position += bytesRead;
  5135. return bytesRead;
  5136. },write:function (stream, buffer, offset, length, position, canOwn) {
  5137. if (length < 0 || position < 0) {
  5138. throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
  5139. }
  5140. if ((stream.flags & 2097155) === 0) {
  5141. throw new FS.ErrnoError(ERRNO_CODES.EBADF);
  5142. }
  5143. if (FS.isDir(stream.node.mode)) {
  5144. throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
  5145. }
  5146. if (!stream.stream_ops.write) {
  5147. throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
  5148. }
  5149. if (stream.flags & 1024) {
  5150. // seek to the end before writing in append mode
  5151. FS.llseek(stream, 0, 2);
  5152. }
  5153. var seeking = true;
  5154. if (typeof position === 'undefined') {
  5155. position = stream.position;
  5156. seeking = false;
  5157. } else if (!stream.seekable) {
  5158. throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
  5159. }
  5160. var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn);
  5161. if (!seeking) stream.position += bytesWritten;
  5162. try {
  5163. if (stream.path && FS.trackingDelegate['onWriteToFile']) FS.trackingDelegate['onWriteToFile'](stream.path);
  5164. } catch(e) {
  5165. console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: " + e.message);
  5166. }
  5167. return bytesWritten;
  5168. },allocate:function (stream, offset, length) {
  5169. if (offset < 0 || length <= 0) {
  5170. throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
  5171. }
  5172. if ((stream.flags & 2097155) === 0) {
  5173. throw new FS.ErrnoError(ERRNO_CODES.EBADF);
  5174. }
  5175. if (!FS.isFile(stream.node.mode) && !FS.isDir(node.mode)) {
  5176. throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
  5177. }
  5178. if (!stream.stream_ops.allocate) {
  5179. throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);
  5180. }
  5181. stream.stream_ops.allocate(stream, offset, length);
  5182. },mmap:function (stream, buffer, offset, length, position, prot, flags) {
  5183. // TODO if PROT is PROT_WRITE, make sure we have write access
  5184. if ((stream.flags & 2097155) === 1) {
  5185. throw new FS.ErrnoError(ERRNO_CODES.EACCES);
  5186. }
  5187. if (!stream.stream_ops.mmap) {
  5188. throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
  5189. }
  5190. return stream.stream_ops.mmap(stream, buffer, offset, length, position, prot, flags);
  5191. },msync:function (stream, buffer, offset, length, mmapFlags) {
  5192. if (!stream || !stream.stream_ops.msync) {
  5193. return 0;
  5194. }
  5195. return stream.stream_ops.msync(stream, buffer, offset, length, mmapFlags);
  5196. },munmap:function (stream) {
  5197. return 0;
  5198. },ioctl:function (stream, cmd, arg) {
  5199. if (!stream.stream_ops.ioctl) {
  5200. throw new FS.ErrnoError(ERRNO_CODES.ENOTTY);
  5201. }
  5202. return stream.stream_ops.ioctl(stream, cmd, arg);
  5203. },readFile:function (path, opts) {
  5204. opts = opts || {};
  5205. opts.flags = opts.flags || 'r';
  5206. opts.encoding = opts.encoding || 'binary';
  5207. if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {
  5208. throw new Error('Invalid encoding type "' + opts.encoding + '"');
  5209. }
  5210. var ret;
  5211. var stream = FS.open(path, opts.flags);
  5212. var stat = FS.stat(path);
  5213. var length = stat.size;
  5214. var buf = new Uint8Array(length);
  5215. FS.read(stream, buf, 0, length, 0);
  5216. if (opts.encoding === 'utf8') {
  5217. ret = UTF8ArrayToString(buf, 0);
  5218. } else if (opts.encoding === 'binary') {
  5219. ret = buf;
  5220. }
  5221. FS.close(stream);
  5222. return ret;
  5223. },writeFile:function (path, data, opts) {
  5224. opts = opts || {};
  5225. opts.flags = opts.flags || 'w';
  5226. opts.encoding = opts.encoding || 'utf8';
  5227. if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {
  5228. throw new Error('Invalid encoding type "' + opts.encoding + '"');
  5229. }
  5230. var stream = FS.open(path, opts.flags, opts.mode);
  5231. if (opts.encoding === 'utf8') {
  5232. var buf = new Uint8Array(lengthBytesUTF8(data)+1);
  5233. var actualNumBytes = stringToUTF8Array(data, buf, 0, buf.length);
  5234. FS.write(stream, buf, 0, actualNumBytes, 0, opts.canOwn);
  5235. } else if (opts.encoding === 'binary') {
  5236. FS.write(stream, data, 0, data.length, 0, opts.canOwn);
  5237. }
  5238. FS.close(stream);
  5239. },cwd:function () {
  5240. return FS.currentPath;
  5241. },chdir:function (path) {
  5242. var lookup = FS.lookupPath(path, { follow: true });
  5243. if (lookup.node === null) {
  5244. throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
  5245. }
  5246. if (!FS.isDir(lookup.node.mode)) {
  5247. throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
  5248. }
  5249. var err = FS.nodePermissions(lookup.node, 'x');
  5250. if (err) {
  5251. throw new FS.ErrnoError(err);
  5252. }
  5253. FS.currentPath = lookup.path;
  5254. },createDefaultDirectories:function () {
  5255. FS.mkdir('/tmp');
  5256. FS.mkdir('/home');
  5257. FS.mkdir('/home/web_user');
  5258. },createDefaultDevices:function () {
  5259. // create /dev
  5260. FS.mkdir('/dev');
  5261. // setup /dev/null
  5262. FS.registerDevice(FS.makedev(1, 3), {
  5263. read: function() { return 0; },
  5264. write: function(stream, buffer, offset, length, pos) { return length; }
  5265. });
  5266. FS.mkdev('/dev/null', FS.makedev(1, 3));
  5267. // setup /dev/tty and /dev/tty1
  5268. // stderr needs to print output using Module['printErr']
  5269. // so we register a second tty just for it.
  5270. TTY.register(FS.makedev(5, 0), TTY.default_tty_ops);
  5271. TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops);
  5272. FS.mkdev('/dev/tty', FS.makedev(5, 0));
  5273. FS.mkdev('/dev/tty1', FS.makedev(6, 0));
  5274. // setup /dev/[u]random
  5275. var random_device;
  5276. if (typeof crypto !== 'undefined') {
  5277. // for modern web browsers
  5278. var randomBuffer = new Uint8Array(1);
  5279. random_device = function() { crypto.getRandomValues(randomBuffer); return randomBuffer[0]; };
  5280. } else if (ENVIRONMENT_IS_NODE) {
  5281. // for nodejs
  5282. random_device = function() { return require('crypto').randomBytes(1)[0]; };
  5283. } else {
  5284. // default for ES5 platforms
  5285. random_device = function() { return (Math.random()*256)|0; };
  5286. }
  5287. FS.createDevice('/dev', 'random', random_device);
  5288. FS.createDevice('/dev', 'urandom', random_device);
  5289. // we're not going to emulate the actual shm device,
  5290. // just create the tmp dirs that reside in it commonly
  5291. FS.mkdir('/dev/shm');
  5292. FS.mkdir('/dev/shm/tmp');
  5293. },createSpecialDirectories:function () {
  5294. // create /proc/self/fd which allows /proc/self/fd/6 => readlink gives the name of the stream for fd 6 (see test_unistd_ttyname)
  5295. FS.mkdir('/proc');
  5296. FS.mkdir('/proc/self');
  5297. FS.mkdir('/proc/self/fd');
  5298. FS.mount({
  5299. mount: function() {
  5300. var node = FS.createNode('/proc/self', 'fd', 16384 | 511 /* 0777 */, 73);
  5301. node.node_ops = {
  5302. lookup: function(parent, name) {
  5303. var fd = +name;
  5304. var stream = FS.getStream(fd);
  5305. if (!stream) throw new FS.ErrnoError(ERRNO_CODES.EBADF);
  5306. var ret = {
  5307. parent: null,
  5308. mount: { mountpoint: 'fake' },
  5309. node_ops: { readlink: function() { return stream.path } }
  5310. };
  5311. ret.parent = ret; // make it look like a simple root node
  5312. return ret;
  5313. }
  5314. };
  5315. return node;
  5316. }
  5317. }, {}, '/proc/self/fd');
  5318. },createStandardStreams:function () {
  5319. // TODO deprecate the old functionality of a single
  5320. // input / output callback and that utilizes FS.createDevice
  5321. // and instead require a unique set of stream ops
  5322. // by default, we symlink the standard streams to the
  5323. // default tty devices. however, if the standard streams
  5324. // have been overwritten we create a unique device for
  5325. // them instead.
  5326. if (Module['stdin']) {
  5327. FS.createDevice('/dev', 'stdin', Module['stdin']);
  5328. } else {
  5329. FS.symlink('/dev/tty', '/dev/stdin');
  5330. }
  5331. if (Module['stdout']) {
  5332. FS.createDevice('/dev', 'stdout', null, Module['stdout']);
  5333. } else {
  5334. FS.symlink('/dev/tty', '/dev/stdout');
  5335. }
  5336. if (Module['stderr']) {
  5337. FS.createDevice('/dev', 'stderr', null, Module['stderr']);
  5338. } else {
  5339. FS.symlink('/dev/tty1', '/dev/stderr');
  5340. }
  5341. // open default streams for the stdin, stdout and stderr devices
  5342. var stdin = FS.open('/dev/stdin', 'r');
  5343. assert(stdin.fd === 0, 'invalid handle for stdin (' + stdin.fd + ')');
  5344. var stdout = FS.open('/dev/stdout', 'w');
  5345. assert(stdout.fd === 1, 'invalid handle for stdout (' + stdout.fd + ')');
  5346. var stderr = FS.open('/dev/stderr', 'w');
  5347. assert(stderr.fd === 2, 'invalid handle for stderr (' + stderr.fd + ')');
  5348. },ensureErrnoError:function () {
  5349. if (FS.ErrnoError) return;
  5350. FS.ErrnoError = function ErrnoError(errno, node) {
  5351. //Module.printErr(stackTrace()); // useful for debugging
  5352. this.node = node;
  5353. this.setErrno = function(errno) {
  5354. this.errno = errno;
  5355. for (var key in ERRNO_CODES) {
  5356. if (ERRNO_CODES[key] === errno) {
  5357. this.code = key;
  5358. break;
  5359. }
  5360. }
  5361. };
  5362. this.setErrno(errno);
  5363. this.message = ERRNO_MESSAGES[errno];
  5364. if (this.stack) this.stack = demangleAll(this.stack);
  5365. };
  5366. FS.ErrnoError.prototype = new Error();
  5367. FS.ErrnoError.prototype.constructor = FS.ErrnoError;
  5368. // Some errors may happen quite a bit, to avoid overhead we reuse them (and suffer a lack of stack info)
  5369. [ERRNO_CODES.ENOENT].forEach(function(code) {
  5370. FS.genericErrors[code] = new FS.ErrnoError(code);
  5371. FS.genericErrors[code].stack = '<generic error, no stack>';
  5372. });
  5373. },staticInit:function () {
  5374. FS.ensureErrnoError();
  5375. FS.nameTable = new Array(4096);
  5376. FS.mount(MEMFS, {}, '/');
  5377. FS.createDefaultDirectories();
  5378. FS.createDefaultDevices();
  5379. FS.createSpecialDirectories();
  5380. FS.filesystems = {
  5381. 'MEMFS': MEMFS,
  5382. 'IDBFS': IDBFS,
  5383. 'NODEFS': NODEFS,
  5384. 'WORKERFS': WORKERFS,
  5385. };
  5386. },init:function (input, output, error) {
  5387. assert(!FS.init.initialized, 'FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)');
  5388. FS.init.initialized = true;
  5389. FS.ensureErrnoError();
  5390. // Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here
  5391. Module['stdin'] = input || Module['stdin'];
  5392. Module['stdout'] = output || Module['stdout'];
  5393. Module['stderr'] = error || Module['stderr'];
  5394. FS.createStandardStreams();
  5395. },quit:function () {
  5396. FS.init.initialized = false;
  5397. // force-flush all streams, so we get musl std streams printed out
  5398. var fflush = Module['_fflush'];
  5399. if (fflush) fflush(0);
  5400. // close all of our streams
  5401. for (var i = 0; i < FS.streams.length; i++) {
  5402. var stream = FS.streams[i];
  5403. if (!stream) {
  5404. continue;
  5405. }
  5406. FS.close(stream);
  5407. }
  5408. },getMode:function (canRead, canWrite) {
  5409. var mode = 0;
  5410. if (canRead) mode |= 292 | 73;
  5411. if (canWrite) mode |= 146;
  5412. return mode;
  5413. },joinPath:function (parts, forceRelative) {
  5414. var path = PATH.join.apply(null, parts);
  5415. if (forceRelative && path[0] == '/') path = path.substr(1);
  5416. return path;
  5417. },absolutePath:function (relative, base) {
  5418. return PATH.resolve(base, relative);
  5419. },standardizePath:function (path) {
  5420. return PATH.normalize(path);
  5421. },findObject:function (path, dontResolveLastLink) {
  5422. var ret = FS.analyzePath(path, dontResolveLastLink);
  5423. if (ret.exists) {
  5424. return ret.object;
  5425. } else {
  5426. ___setErrNo(ret.error);
  5427. return null;
  5428. }
  5429. },analyzePath:function (path, dontResolveLastLink) {
  5430. // operate from within the context of the symlink's target
  5431. try {
  5432. var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });
  5433. path = lookup.path;
  5434. } catch (e) {
  5435. }
  5436. var ret = {
  5437. isRoot: false, exists: false, error: 0, name: null, path: null, object: null,
  5438. parentExists: false, parentPath: null, parentObject: null
  5439. };
  5440. try {
  5441. var lookup = FS.lookupPath(path, { parent: true });
  5442. ret.parentExists = true;
  5443. ret.parentPath = lookup.path;
  5444. ret.parentObject = lookup.node;
  5445. ret.name = PATH.basename(path);
  5446. lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });
  5447. ret.exists = true;
  5448. ret.path = lookup.path;
  5449. ret.object = lookup.node;
  5450. ret.name = lookup.node.name;
  5451. ret.isRoot = lookup.path === '/';
  5452. } catch (e) {
  5453. ret.error = e.errno;
  5454. };
  5455. return ret;
  5456. },createFolder:function (parent, name, canRead, canWrite) {
  5457. var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
  5458. var mode = FS.getMode(canRead, canWrite);
  5459. return FS.mkdir(path, mode);
  5460. },createPath:function (parent, path, canRead, canWrite) {
  5461. parent = typeof parent === 'string' ? parent : FS.getPath(parent);
  5462. var parts = path.split('/').reverse();
  5463. while (parts.length) {
  5464. var part = parts.pop();
  5465. if (!part) continue;
  5466. var current = PATH.join2(parent, part);
  5467. try {
  5468. FS.mkdir(current);
  5469. } catch (e) {
  5470. // ignore EEXIST
  5471. }
  5472. parent = current;
  5473. }
  5474. return current;
  5475. },createFile:function (parent, name, properties, canRead, canWrite) {
  5476. var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
  5477. var mode = FS.getMode(canRead, canWrite);
  5478. return FS.create(path, mode);
  5479. },createDataFile:function (parent, name, data, canRead, canWrite, canOwn) {
  5480. var path = name ? PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name) : parent;
  5481. var mode = FS.getMode(canRead, canWrite);
  5482. var node = FS.create(path, mode);
  5483. if (data) {
  5484. if (typeof data === 'string') {
  5485. var arr = new Array(data.length);
  5486. for (var i = 0, len = data.length; i < len; ++i) arr[i] = data.charCodeAt(i);
  5487. data = arr;
  5488. }
  5489. // make sure we can write to the file
  5490. FS.chmod(node, mode | 146);
  5491. var stream = FS.open(node, 'w');
  5492. FS.write(stream, data, 0, data.length, 0, canOwn);
  5493. FS.close(stream);
  5494. FS.chmod(node, mode);
  5495. }
  5496. return node;
  5497. },createDevice:function (parent, name, input, output) {
  5498. var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
  5499. var mode = FS.getMode(!!input, !!output);
  5500. if (!FS.createDevice.major) FS.createDevice.major = 64;
  5501. var dev = FS.makedev(FS.createDevice.major++, 0);
  5502. // Create a fake device that a set of stream ops to emulate
  5503. // the old behavior.
  5504. FS.registerDevice(dev, {
  5505. open: function(stream) {
  5506. stream.seekable = false;
  5507. },
  5508. close: function(stream) {
  5509. // flush any pending line data
  5510. if (output && output.buffer && output.buffer.length) {
  5511. output(10);
  5512. }
  5513. },
  5514. read: function(stream, buffer, offset, length, pos /* ignored */) {
  5515. var bytesRead = 0;
  5516. for (var i = 0; i < length; i++) {
  5517. var result;
  5518. try {
  5519. result = input();
  5520. } catch (e) {
  5521. throw new FS.ErrnoError(ERRNO_CODES.EIO);
  5522. }
  5523. if (result === undefined && bytesRead === 0) {
  5524. throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
  5525. }
  5526. if (result === null || result === undefined) break;
  5527. bytesRead++;
  5528. buffer[offset+i] = result;
  5529. }
  5530. if (bytesRead) {
  5531. stream.node.timestamp = Date.now();
  5532. }
  5533. return bytesRead;
  5534. },
  5535. write: function(stream, buffer, offset, length, pos) {
  5536. for (var i = 0; i < length; i++) {
  5537. try {
  5538. output(buffer[offset+i]);
  5539. } catch (e) {
  5540. throw new FS.ErrnoError(ERRNO_CODES.EIO);
  5541. }
  5542. }
  5543. if (length) {
  5544. stream.node.timestamp = Date.now();
  5545. }
  5546. return i;
  5547. }
  5548. });
  5549. return FS.mkdev(path, mode, dev);
  5550. },createLink:function (parent, name, target, canRead, canWrite) {
  5551. var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
  5552. return FS.symlink(target, path);
  5553. },forceLoadFile:function (obj) {
  5554. if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;
  5555. var success = true;
  5556. if (typeof XMLHttpRequest !== 'undefined') {
  5557. throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");
  5558. } else if (Module['read']) {
  5559. // Command-line.
  5560. try {
  5561. // WARNING: Can't read binary files in V8's d8 or tracemonkey's js, as
  5562. // read() will try to parse UTF8.
  5563. obj.contents = intArrayFromString(Module['read'](obj.url), true);
  5564. obj.usedBytes = obj.contents.length;
  5565. } catch (e) {
  5566. success = false;
  5567. }
  5568. } else {
  5569. throw new Error('Cannot load without read() or XMLHttpRequest.');
  5570. }
  5571. if (!success) ___setErrNo(ERRNO_CODES.EIO);
  5572. return success;
  5573. },createLazyFile:function (parent, name, url, canRead, canWrite) {
  5574. // Lazy chunked Uint8Array (implements get and length from Uint8Array). Actual getting is abstracted away for eventual reuse.
  5575. function LazyUint8Array() {
  5576. this.lengthKnown = false;
  5577. this.chunks = []; // Loaded chunks. Index is the chunk number
  5578. }
  5579. LazyUint8Array.prototype.get = function LazyUint8Array_get(idx) {
  5580. if (idx > this.length-1 || idx < 0) {
  5581. return undefined;
  5582. }
  5583. var chunkOffset = idx % this.chunkSize;
  5584. var chunkNum = (idx / this.chunkSize)|0;
  5585. return this.getter(chunkNum)[chunkOffset];
  5586. }
  5587. LazyUint8Array.prototype.setDataGetter = function LazyUint8Array_setDataGetter(getter) {
  5588. this.getter = getter;
  5589. }
  5590. LazyUint8Array.prototype.cacheLength = function LazyUint8Array_cacheLength() {
  5591. // Find length
  5592. var xhr = new XMLHttpRequest();
  5593. xhr.open('HEAD', url, false);
  5594. xhr.send(null);
  5595. if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
  5596. var datalength = Number(xhr.getResponseHeader("Content-length"));
  5597. var header;
  5598. var hasByteServing = (header = xhr.getResponseHeader("Accept-Ranges")) && header === "bytes";
  5599. var usesGzip = (header = xhr.getResponseHeader("Content-Encoding")) && header === "gzip";
  5600. var chunkSize = 1024*1024; // Chunk size in bytes
  5601. if (!hasByteServing) chunkSize = datalength;
  5602. // Function to get a range from the remote URL.
  5603. var doXHR = (function(from, to) {
  5604. if (from > to) throw new Error("invalid range (" + from + ", " + to + ") or no bytes requested!");
  5605. if (to > datalength-1) throw new Error("only " + datalength + " bytes available! programmer error!");
  5606. // TODO: Use mozResponseArrayBuffer, responseStream, etc. if available.
  5607. var xhr = new XMLHttpRequest();
  5608. xhr.open('GET', url, false);
  5609. if (datalength !== chunkSize) xhr.setRequestHeader("Range", "bytes=" + from + "-" + to);
  5610. // Some hints to the browser that we want binary data.
  5611. if (typeof Uint8Array != 'undefined') xhr.responseType = 'arraybuffer';
  5612. if (xhr.overrideMimeType) {
  5613. xhr.overrideMimeType('text/plain; charset=x-user-defined');
  5614. }
  5615. xhr.send(null);
  5616. if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
  5617. if (xhr.response !== undefined) {
  5618. return new Uint8Array(xhr.response || []);
  5619. } else {
  5620. return intArrayFromString(xhr.responseText || '', true);
  5621. }
  5622. });
  5623. var lazyArray = this;
  5624. lazyArray.setDataGetter(function(chunkNum) {
  5625. var start = chunkNum * chunkSize;
  5626. var end = (chunkNum+1) * chunkSize - 1; // including this byte
  5627. end = Math.min(end, datalength-1); // if datalength-1 is selected, this is the last block
  5628. if (typeof(lazyArray.chunks[chunkNum]) === "undefined") {
  5629. lazyArray.chunks[chunkNum] = doXHR(start, end);
  5630. }
  5631. if (typeof(lazyArray.chunks[chunkNum]) === "undefined") throw new Error("doXHR failed!");
  5632. return lazyArray.chunks[chunkNum];
  5633. });
  5634. if (usesGzip || !datalength) {
  5635. // if the server uses gzip or doesn't supply the length, we have to download the whole file to get the (uncompressed) length
  5636. chunkSize = datalength = 1; // this will force getter(0)/doXHR do download the whole file
  5637. datalength = this.getter(0).length;
  5638. chunkSize = datalength;
  5639. console.log("LazyFiles on gzip forces download of the whole file when length is accessed");
  5640. }
  5641. this._length = datalength;
  5642. this._chunkSize = chunkSize;
  5643. this.lengthKnown = true;
  5644. }
  5645. if (typeof XMLHttpRequest !== 'undefined') {
  5646. if (!ENVIRONMENT_IS_WORKER) throw 'Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc';
  5647. var lazyArray = new LazyUint8Array();
  5648. Object.defineProperties(lazyArray, {
  5649. length: {
  5650. get: function() {
  5651. if(!this.lengthKnown) {
  5652. this.cacheLength();
  5653. }
  5654. return this._length;
  5655. }
  5656. },
  5657. chunkSize: {
  5658. get: function() {
  5659. if(!this.lengthKnown) {
  5660. this.cacheLength();
  5661. }
  5662. return this._chunkSize;
  5663. }
  5664. }
  5665. });
  5666. var properties = { isDevice: false, contents: lazyArray };
  5667. } else {
  5668. var properties = { isDevice: false, url: url };
  5669. }
  5670. var node = FS.createFile(parent, name, properties, canRead, canWrite);
  5671. // This is a total hack, but I want to get this lazy file code out of the
  5672. // core of MEMFS. If we want to keep this lazy file concept I feel it should
  5673. // be its own thin LAZYFS proxying calls to MEMFS.
  5674. if (properties.contents) {
  5675. node.contents = properties.contents;
  5676. } else if (properties.url) {
  5677. node.contents = null;
  5678. node.url = properties.url;
  5679. }
  5680. // Add a function that defers querying the file size until it is asked the first time.
  5681. Object.defineProperties(node, {
  5682. usedBytes: {
  5683. get: function() { return this.contents.length; }
  5684. }
  5685. });
  5686. // override each stream op with one that tries to force load the lazy file first
  5687. var stream_ops = {};
  5688. var keys = Object.keys(node.stream_ops);
  5689. keys.forEach(function(key) {
  5690. var fn = node.stream_ops[key];
  5691. stream_ops[key] = function forceLoadLazyFile() {
  5692. if (!FS.forceLoadFile(node)) {
  5693. throw new FS.ErrnoError(ERRNO_CODES.EIO);
  5694. }
  5695. return fn.apply(null, arguments);
  5696. };
  5697. });
  5698. // use a custom read function
  5699. stream_ops.read = function stream_ops_read(stream, buffer, offset, length, position) {
  5700. if (!FS.forceLoadFile(node)) {
  5701. throw new FS.ErrnoError(ERRNO_CODES.EIO);
  5702. }
  5703. var contents = stream.node.contents;
  5704. if (position >= contents.length)
  5705. return 0;
  5706. var size = Math.min(contents.length - position, length);
  5707. assert(size >= 0);
  5708. if (contents.slice) { // normal array
  5709. for (var i = 0; i < size; i++) {
  5710. buffer[offset + i] = contents[position + i];
  5711. }
  5712. } else {
  5713. for (var i = 0; i < size; i++) { // LazyUint8Array from sync binary XHR
  5714. buffer[offset + i] = contents.get(position + i);
  5715. }
  5716. }
  5717. return size;
  5718. };
  5719. node.stream_ops = stream_ops;
  5720. return node;
  5721. },createPreloadedFile:function (parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn, preFinish) {
  5722. Browser.init(); // XXX perhaps this method should move onto Browser?
  5723. // TODO we should allow people to just pass in a complete filename instead
  5724. // of parent and name being that we just join them anyways
  5725. var fullname = name ? PATH.resolve(PATH.join2(parent, name)) : parent;
  5726. var dep = getUniqueRunDependency('cp ' + fullname); // might have several active requests for the same fullname
  5727. function processData(byteArray) {
  5728. function finish(byteArray) {
  5729. if (preFinish) preFinish();
  5730. if (!dontCreateFile) {
  5731. FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);
  5732. }
  5733. if (onload) onload();
  5734. removeRunDependency(dep);
  5735. }
  5736. var handled = false;
  5737. Module['preloadPlugins'].forEach(function(plugin) {
  5738. if (handled) return;
  5739. if (plugin['canHandle'](fullname)) {
  5740. plugin['handle'](byteArray, fullname, finish, function() {
  5741. if (onerror) onerror();
  5742. removeRunDependency(dep);
  5743. });
  5744. handled = true;
  5745. }
  5746. });
  5747. if (!handled) finish(byteArray);
  5748. }
  5749. addRunDependency(dep);
  5750. if (typeof url == 'string') {
  5751. Browser.asyncLoad(url, function(byteArray) {
  5752. processData(byteArray);
  5753. }, onerror);
  5754. } else {
  5755. processData(url);
  5756. }
  5757. },indexedDB:function () {
  5758. return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
  5759. },DB_NAME:function () {
  5760. return 'EM_FS_' + window.location.pathname;
  5761. },DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function (paths, onload, onerror) {
  5762. onload = onload || function(){};
  5763. onerror = onerror || function(){};
  5764. var indexedDB = FS.indexedDB();
  5765. try {
  5766. var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);
  5767. } catch (e) {
  5768. return onerror(e);
  5769. }
  5770. openRequest.onupgradeneeded = function openRequest_onupgradeneeded() {
  5771. console.log('creating db');
  5772. var db = openRequest.result;
  5773. db.createObjectStore(FS.DB_STORE_NAME);
  5774. };
  5775. openRequest.onsuccess = function openRequest_onsuccess() {
  5776. var db = openRequest.result;
  5777. var transaction = db.transaction([FS.DB_STORE_NAME], 'readwrite');
  5778. var files = transaction.objectStore(FS.DB_STORE_NAME);
  5779. var ok = 0, fail = 0, total = paths.length;
  5780. function finish() {
  5781. if (fail == 0) onload(); else onerror();
  5782. }
  5783. paths.forEach(function(path) {
  5784. var putRequest = files.put(FS.analyzePath(path).object.contents, path);
  5785. putRequest.onsuccess = function putRequest_onsuccess() { ok++; if (ok + fail == total) finish() };
  5786. putRequest.onerror = function putRequest_onerror() { fail++; if (ok + fail == total) finish() };
  5787. });
  5788. transaction.onerror = onerror;
  5789. };
  5790. openRequest.onerror = onerror;
  5791. },loadFilesFromDB:function (paths, onload, onerror) {
  5792. onload = onload || function(){};
  5793. onerror = onerror || function(){};
  5794. var indexedDB = FS.indexedDB();
  5795. try {
  5796. var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);
  5797. } catch (e) {
  5798. return onerror(e);
  5799. }
  5800. openRequest.onupgradeneeded = onerror; // no database to load from
  5801. openRequest.onsuccess = function openRequest_onsuccess() {
  5802. var db = openRequest.result;
  5803. try {
  5804. var transaction = db.transaction([FS.DB_STORE_NAME], 'readonly');
  5805. } catch(e) {
  5806. onerror(e);
  5807. return;
  5808. }
  5809. var files = transaction.objectStore(FS.DB_STORE_NAME);
  5810. var ok = 0, fail = 0, total = paths.length;
  5811. function finish() {
  5812. if (fail == 0) onload(); else onerror();
  5813. }
  5814. paths.forEach(function(path) {
  5815. var getRequest = files.get(path);
  5816. getRequest.onsuccess = function getRequest_onsuccess() {
  5817. if (FS.analyzePath(path).exists) {
  5818. FS.unlink(path);
  5819. }
  5820. FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true);
  5821. ok++;
  5822. if (ok + fail == total) finish();
  5823. };
  5824. getRequest.onerror = function getRequest_onerror() { fail++; if (ok + fail == total) finish() };
  5825. });
  5826. transaction.onerror = onerror;
  5827. };
  5828. openRequest.onerror = onerror;
  5829. }};var SYSCALLS={DEFAULT_POLLMASK:5,mappings:{},umask:511,calculateAt:function (dirfd, path) {
  5830. if (path[0] !== '/') {
  5831. // relative path
  5832. var dir;
  5833. if (dirfd === -100) {
  5834. dir = FS.cwd();
  5835. } else {
  5836. var dirstream = FS.getStream(dirfd);
  5837. if (!dirstream) throw new FS.ErrnoError(ERRNO_CODES.EBADF);
  5838. dir = dirstream.path;
  5839. }
  5840. path = PATH.join2(dir, path);
  5841. }
  5842. return path;
  5843. },doStat:function (func, path, buf) {
  5844. try {
  5845. var stat = func(path);
  5846. } catch (e) {
  5847. if (e && e.node && PATH.normalize(path) !== PATH.normalize(FS.getPath(e.node))) {
  5848. // an error occurred while trying to look up the path; we should just report ENOTDIR
  5849. return -ERRNO_CODES.ENOTDIR;
  5850. }
  5851. throw e;
  5852. }
  5853. HEAP32[((buf)>>2)]=stat.dev;
  5854. HEAP32[(((buf)+(4))>>2)]=0;
  5855. HEAP32[(((buf)+(8))>>2)]=stat.ino;
  5856. HEAP32[(((buf)+(12))>>2)]=stat.mode;
  5857. HEAP32[(((buf)+(16))>>2)]=stat.nlink;
  5858. HEAP32[(((buf)+(20))>>2)]=stat.uid;
  5859. HEAP32[(((buf)+(24))>>2)]=stat.gid;
  5860. HEAP32[(((buf)+(28))>>2)]=stat.rdev;
  5861. HEAP32[(((buf)+(32))>>2)]=0;
  5862. HEAP32[(((buf)+(36))>>2)]=stat.size;
  5863. HEAP32[(((buf)+(40))>>2)]=4096;
  5864. HEAP32[(((buf)+(44))>>2)]=stat.blocks;
  5865. HEAP32[(((buf)+(48))>>2)]=(stat.atime.getTime() / 1000)|0;
  5866. HEAP32[(((buf)+(52))>>2)]=0;
  5867. HEAP32[(((buf)+(56))>>2)]=(stat.mtime.getTime() / 1000)|0;
  5868. HEAP32[(((buf)+(60))>>2)]=0;
  5869. HEAP32[(((buf)+(64))>>2)]=(stat.ctime.getTime() / 1000)|0;
  5870. HEAP32[(((buf)+(68))>>2)]=0;
  5871. HEAP32[(((buf)+(72))>>2)]=stat.ino;
  5872. return 0;
  5873. },doMsync:function (addr, stream, len, flags) {
  5874. var buffer = new Uint8Array(HEAPU8.subarray(addr, addr + len));
  5875. FS.msync(stream, buffer, 0, len, flags);
  5876. },doMkdir:function (path, mode) {
  5877. // remove a trailing slash, if one - /a/b/ has basename of '', but
  5878. // we want to create b in the context of this function
  5879. path = PATH.normalize(path);
  5880. if (path[path.length-1] === '/') path = path.substr(0, path.length-1);
  5881. FS.mkdir(path, mode, 0);
  5882. return 0;
  5883. },doMknod:function (path, mode, dev) {
  5884. // we don't want this in the JS API as it uses mknod to create all nodes.
  5885. switch (mode & 61440) {
  5886. case 32768:
  5887. case 8192:
  5888. case 24576:
  5889. case 4096:
  5890. case 49152:
  5891. break;
  5892. default: return -ERRNO_CODES.EINVAL;
  5893. }
  5894. FS.mknod(path, mode, dev);
  5895. return 0;
  5896. },doReadlink:function (path, buf, bufsize) {
  5897. if (bufsize <= 0) return -ERRNO_CODES.EINVAL;
  5898. var ret = FS.readlink(path);
  5899. var len = Math.min(bufsize, lengthBytesUTF8(ret));
  5900. var endChar = HEAP8[buf+len];
  5901. stringToUTF8(ret, buf, bufsize+1);
  5902. // readlink is one of the rare functions that write out a C string, but does never append a null to the output buffer(!)
  5903. // stringToUTF8() always appends a null byte, so restore the character under the null byte after the write.
  5904. HEAP8[buf+len] = endChar;
  5905. return len;
  5906. },doAccess:function (path, amode) {
  5907. if (amode & ~7) {
  5908. // need a valid mode
  5909. return -ERRNO_CODES.EINVAL;
  5910. }
  5911. var node;
  5912. var lookup = FS.lookupPath(path, { follow: true });
  5913. node = lookup.node;
  5914. var perms = '';
  5915. if (amode & 4) perms += 'r';
  5916. if (amode & 2) perms += 'w';
  5917. if (amode & 1) perms += 'x';
  5918. if (perms /* otherwise, they've just passed F_OK */ && FS.nodePermissions(node, perms)) {
  5919. return -ERRNO_CODES.EACCES;
  5920. }
  5921. return 0;
  5922. },doDup:function (path, flags, suggestFD) {
  5923. var suggest = FS.getStream(suggestFD);
  5924. if (suggest) FS.close(suggest);
  5925. return FS.open(path, flags, 0, suggestFD, suggestFD).fd;
  5926. },doReadv:function (stream, iov, iovcnt, offset) {
  5927. var ret = 0;
  5928. for (var i = 0; i < iovcnt; i++) {
  5929. var ptr = HEAP32[(((iov)+(i*8))>>2)];
  5930. var len = HEAP32[(((iov)+(i*8 + 4))>>2)];
  5931. var curr = FS.read(stream, HEAP8,ptr, len, offset);
  5932. if (curr < 0) return -1;
  5933. ret += curr;
  5934. if (curr < len) break; // nothing more to read
  5935. }
  5936. return ret;
  5937. },doWritev:function (stream, iov, iovcnt, offset) {
  5938. var ret = 0;
  5939. for (var i = 0; i < iovcnt; i++) {
  5940. var ptr = HEAP32[(((iov)+(i*8))>>2)];
  5941. var len = HEAP32[(((iov)+(i*8 + 4))>>2)];
  5942. var curr = FS.write(stream, HEAP8,ptr, len, offset);
  5943. if (curr < 0) return -1;
  5944. ret += curr;
  5945. }
  5946. return ret;
  5947. },varargs:0,get:function (varargs) {
  5948. SYSCALLS.varargs += 4;
  5949. var ret = HEAP32[(((SYSCALLS.varargs)-(4))>>2)];
  5950. return ret;
  5951. },getStr:function () {
  5952. var ret = Pointer_stringify(SYSCALLS.get());
  5953. return ret;
  5954. },getStreamFromFD:function () {
  5955. var stream = FS.getStream(SYSCALLS.get());
  5956. if (!stream) throw new FS.ErrnoError(ERRNO_CODES.EBADF);
  5957. return stream;
  5958. },getSocketFromFD:function () {
  5959. var socket = SOCKFS.getSocket(SYSCALLS.get());
  5960. if (!socket) throw new FS.ErrnoError(ERRNO_CODES.EBADF);
  5961. return socket;
  5962. },getSocketAddress:function (allowNull) {
  5963. var addrp = SYSCALLS.get(), addrlen = SYSCALLS.get();
  5964. if (allowNull && addrp === 0) return null;
  5965. var info = __read_sockaddr(addrp, addrlen);
  5966. if (info.errno) throw new FS.ErrnoError(info.errno);
  5967. info.addr = DNS.lookup_addr(info.addr) || info.addr;
  5968. return info;
  5969. },get64:function () {
  5970. var low = SYSCALLS.get(), high = SYSCALLS.get();
  5971. if (low >= 0) assert(high === 0);
  5972. else assert(high === -1);
  5973. return low;
  5974. },getZero:function () {
  5975. assert(SYSCALLS.get() === 0);
  5976. }};function ___syscall54(which, varargs) {if (ENVIRONMENT_IS_PTHREAD) { return _emscripten_sync_run_in_main_thread_2(138, 54, varargs) }
  5977. SYSCALLS.varargs = varargs;
  5978. try {
  5979. // ioctl
  5980. var stream = SYSCALLS.getStreamFromFD(), op = SYSCALLS.get();
  5981. switch (op) {
  5982. case 21505: {
  5983. if (!stream.tty) return -ERRNO_CODES.ENOTTY;
  5984. return 0;
  5985. }
  5986. case 21506: {
  5987. if (!stream.tty) return -ERRNO_CODES.ENOTTY;
  5988. return 0; // no-op, not actually adjusting terminal settings
  5989. }
  5990. case 21519: {
  5991. if (!stream.tty) return -ERRNO_CODES.ENOTTY;
  5992. var argp = SYSCALLS.get();
  5993. HEAP32[((argp)>>2)]=0;
  5994. return 0;
  5995. }
  5996. case 21520: {
  5997. if (!stream.tty) return -ERRNO_CODES.ENOTTY;
  5998. return -ERRNO_CODES.EINVAL; // not supported
  5999. }
  6000. case 21531: {
  6001. var argp = SYSCALLS.get();
  6002. return FS.ioctl(stream, op, argp);
  6003. }
  6004. case 21523: {
  6005. // TODO: in theory we should write to the winsize struct that gets
  6006. // passed in, but for now musl doesn't read anything on it
  6007. if (!stream.tty) return -ERRNO_CODES.ENOTTY;
  6008. return 0;
  6009. }
  6010. default: abort('bad ioctl syscall ' + op);
  6011. }
  6012. } catch (e) {
  6013. if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) abort(e);
  6014. return -e.errno;
  6015. }
  6016. }
  6017. function _emscripten_glSampleCoverage(value, invert) {
  6018. GLctx.sampleCoverage(value, !!invert);
  6019. }
  6020. function _glDeleteTextures(n, textures) {
  6021. for (var i = 0; i < n; i++) {
  6022. var id = HEAP32[(((textures)+(i*4))>>2)];
  6023. var texture = GL.textures[id];
  6024. if (!texture) continue; // GL spec: "glDeleteTextures silently ignores 0s and names that do not correspond to existing textures".
  6025. GLctx.deleteTexture(texture);
  6026. texture.name = 0;
  6027. GL.textures[id] = null;
  6028. }
  6029. }
  6030. function _emscripten_glFrustum() {
  6031. Module['printErr']('missing function: emscripten_glFrustum'); abort(-1);
  6032. }
  6033. function _glfwSetWindowSizeCallback(winid, cbfun) {
  6034. GLFW.setWindowSizeCallback(winid, cbfun);
  6035. }
  6036. function _emscripten_glGetTexParameterfv(target, pname, params) {
  6037. if (!params) {
  6038. // GLES2 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense
  6039. // if p == null, issue a GL error to notify user about it.
  6040. GL.recordError(0x0501 /* GL_INVALID_VALUE */);
  6041. return;
  6042. }
  6043. HEAPF32[((params)>>2)]=GLctx.getTexParameter(target, pname);
  6044. }
  6045. function _emscripten_glUniform4i(location, v0, v1, v2, v3) {
  6046. GLctx.uniform4i(GL.uniforms[location], v0, v1, v2, v3);
  6047. }
  6048. function _emscripten_glBindRenderbuffer(target, renderbuffer) {
  6049. GLctx.bindRenderbuffer(target, renderbuffer ? GL.renderbuffers[renderbuffer] : null);
  6050. }
  6051. function _emscripten_glViewport(x0, x1, x2, x3) { GLctx['viewport'](x0, x1, x2, x3) }
  6052. var JSEvents={keyEvent:0,mouseEvent:0,wheelEvent:0,uiEvent:0,focusEvent:0,deviceOrientationEvent:0,deviceMotionEvent:0,fullscreenChangeEvent:0,pointerlockChangeEvent:0,visibilityChangeEvent:0,touchEvent:0,lastGamepadState:null,lastGamepadStateFrame:null,numGamepadsConnected:0,previousFullscreenElement:null,previousScreenX:null,previousScreenY:null,removeEventListenersRegistered:false,staticInit:function () {
  6053. if (typeof window !== 'undefined') {
  6054. window.addEventListener("gamepadconnected", function() { ++JSEvents.numGamepadsConnected; });
  6055. window.addEventListener("gamepaddisconnected", function() { --JSEvents.numGamepadsConnected; });
  6056. }
  6057. },registerRemoveEventListeners:function () {
  6058. if (!JSEvents.removeEventListenersRegistered) {
  6059. __ATEXIT__.push(function() {
  6060. for(var i = JSEvents.eventHandlers.length-1; i >= 0; --i) {
  6061. JSEvents._removeHandler(i);
  6062. }
  6063. });
  6064. JSEvents.removeEventListenersRegistered = true;
  6065. }
  6066. },findEventTarget:function (target) {
  6067. if (target) {
  6068. if (typeof target == "number") {
  6069. target = Pointer_stringify(target);
  6070. }
  6071. if (target == '#window') return window;
  6072. else if (target == '#document') return document;
  6073. else if (target == '#screen') return window.screen;
  6074. else if (target == '#canvas') return Module['canvas'];
  6075. if (typeof target == 'string') return document.getElementById(target);
  6076. else return target;
  6077. } else {
  6078. // The sensible target varies between events, but use window as the default
  6079. // since DOM events mostly can default to that. Specific callback registrations
  6080. // override their own defaults.
  6081. return window;
  6082. }
  6083. },deferredCalls:[],deferCall:function (targetFunction, precedence, argsList) {
  6084. function arraysHaveEqualContent(arrA, arrB) {
  6085. if (arrA.length != arrB.length) return false;
  6086. for(var i in arrA) {
  6087. if (arrA[i] != arrB[i]) return false;
  6088. }
  6089. return true;
  6090. }
  6091. // Test if the given call was already queued, and if so, don't add it again.
  6092. for(var i in JSEvents.deferredCalls) {
  6093. var call = JSEvents.deferredCalls[i];
  6094. if (call.targetFunction == targetFunction && arraysHaveEqualContent(call.argsList, argsList)) {
  6095. return;
  6096. }
  6097. }
  6098. JSEvents.deferredCalls.push({
  6099. targetFunction: targetFunction,
  6100. precedence: precedence,
  6101. argsList: argsList
  6102. });
  6103. JSEvents.deferredCalls.sort(function(x,y) { return x.precedence < y.precedence; });
  6104. },removeDeferredCalls:function (targetFunction) {
  6105. for(var i = 0; i < JSEvents.deferredCalls.length; ++i) {
  6106. if (JSEvents.deferredCalls[i].targetFunction == targetFunction) {
  6107. JSEvents.deferredCalls.splice(i, 1);
  6108. --i;
  6109. }
  6110. }
  6111. },canPerformEventHandlerRequests:function () {
  6112. return JSEvents.inEventHandler && JSEvents.currentEventHandler.allowsDeferredCalls;
  6113. },runDeferredCalls:function () {
  6114. if (!JSEvents.canPerformEventHandlerRequests()) {
  6115. return;
  6116. }
  6117. for(var i = 0; i < JSEvents.deferredCalls.length; ++i) {
  6118. var call = JSEvents.deferredCalls[i];
  6119. JSEvents.deferredCalls.splice(i, 1);
  6120. --i;
  6121. call.targetFunction.apply(this, call.argsList);
  6122. }
  6123. },inEventHandler:0,currentEventHandler:null,eventHandlers:[],isInternetExplorer:function () { return navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0; },removeAllHandlersOnTarget:function (target, eventTypeString) {
  6124. for(var i = 0; i < JSEvents.eventHandlers.length; ++i) {
  6125. if (JSEvents.eventHandlers[i].target == target &&
  6126. (!eventTypeString || eventTypeString == JSEvents.eventHandlers[i].eventTypeString)) {
  6127. JSEvents._removeHandler(i--);
  6128. }
  6129. }
  6130. },_removeHandler:function (i) {
  6131. var h = JSEvents.eventHandlers[i];
  6132. h.target.removeEventListener(h.eventTypeString, h.eventListenerFunc, h.useCapture);
  6133. JSEvents.eventHandlers.splice(i, 1);
  6134. },registerOrRemoveHandler:function (eventHandler) {
  6135. var jsEventHandler = function jsEventHandler(event) {
  6136. // Increment nesting count for the event handler.
  6137. ++JSEvents.inEventHandler;
  6138. JSEvents.currentEventHandler = eventHandler;
  6139. // Process any old deferred calls the user has placed.
  6140. JSEvents.runDeferredCalls();
  6141. // Process the actual event, calls back to user C code handler.
  6142. eventHandler.handlerFunc(event);
  6143. // Process any new deferred calls that were placed right now from this event handler.
  6144. JSEvents.runDeferredCalls();
  6145. // Out of event handler - restore nesting count.
  6146. --JSEvents.inEventHandler;
  6147. }
  6148. if (eventHandler.callbackfunc) {
  6149. eventHandler.eventListenerFunc = jsEventHandler;
  6150. eventHandler.target.addEventListener(eventHandler.eventTypeString, jsEventHandler, eventHandler.useCapture);
  6151. JSEvents.eventHandlers.push(eventHandler);
  6152. JSEvents.registerRemoveEventListeners();
  6153. } else {
  6154. for(var i = 0; i < JSEvents.eventHandlers.length; ++i) {
  6155. if (JSEvents.eventHandlers[i].target == eventHandler.target
  6156. && JSEvents.eventHandlers[i].eventTypeString == eventHandler.eventTypeString) {
  6157. JSEvents._removeHandler(i--);
  6158. }
  6159. }
  6160. }
  6161. },registerKeyEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
  6162. if (!JSEvents.keyEvent) {
  6163. JSEvents.keyEvent = _malloc( 164 );
  6164. }
  6165. var handlerFunc = function(event) {
  6166. var e = event || window.event;
  6167. stringToUTF8(e.key ? e.key : "", JSEvents.keyEvent + 0, 32);
  6168. stringToUTF8(e.code ? e.code : "", JSEvents.keyEvent + 32, 32);
  6169. HEAP32[(((JSEvents.keyEvent)+(64))>>2)]=e.location;
  6170. HEAP32[(((JSEvents.keyEvent)+(68))>>2)]=e.ctrlKey;
  6171. HEAP32[(((JSEvents.keyEvent)+(72))>>2)]=e.shiftKey;
  6172. HEAP32[(((JSEvents.keyEvent)+(76))>>2)]=e.altKey;
  6173. HEAP32[(((JSEvents.keyEvent)+(80))>>2)]=e.metaKey;
  6174. HEAP32[(((JSEvents.keyEvent)+(84))>>2)]=e.repeat;
  6175. stringToUTF8(e.locale ? e.locale : "", JSEvents.keyEvent + 88, 32);
  6176. stringToUTF8(e.char ? e.char : "", JSEvents.keyEvent + 120, 32);
  6177. HEAP32[(((JSEvents.keyEvent)+(152))>>2)]=e.charCode;
  6178. HEAP32[(((JSEvents.keyEvent)+(156))>>2)]=e.keyCode;
  6179. HEAP32[(((JSEvents.keyEvent)+(160))>>2)]=e.which;
  6180. var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.keyEvent, userData);
  6181. if (shouldCancel) {
  6182. e.preventDefault();
  6183. }
  6184. };
  6185. var eventHandler = {
  6186. target: JSEvents.findEventTarget(target),
  6187. allowsDeferredCalls: JSEvents.isInternetExplorer() ? false : true, // MSIE doesn't allow fullscreen and pointerlock requests from key handlers, others do.
  6188. eventTypeString: eventTypeString,
  6189. callbackfunc: callbackfunc,
  6190. handlerFunc: handlerFunc,
  6191. useCapture: useCapture
  6192. };
  6193. JSEvents.registerOrRemoveHandler(eventHandler);
  6194. },getBoundingClientRectOrZeros:function (target) {
  6195. return target.getBoundingClientRect ? target.getBoundingClientRect() : { left: 0, top: 0 };
  6196. },fillMouseEventData:function (eventStruct, e, target) {
  6197. HEAPF64[((eventStruct)>>3)]=JSEvents.tick();
  6198. HEAP32[(((eventStruct)+(8))>>2)]=e.screenX;
  6199. HEAP32[(((eventStruct)+(12))>>2)]=e.screenY;
  6200. HEAP32[(((eventStruct)+(16))>>2)]=e.clientX;
  6201. HEAP32[(((eventStruct)+(20))>>2)]=e.clientY;
  6202. HEAP32[(((eventStruct)+(24))>>2)]=e.ctrlKey;
  6203. HEAP32[(((eventStruct)+(28))>>2)]=e.shiftKey;
  6204. HEAP32[(((eventStruct)+(32))>>2)]=e.altKey;
  6205. HEAP32[(((eventStruct)+(36))>>2)]=e.metaKey;
  6206. HEAP16[(((eventStruct)+(40))>>1)]=e.button;
  6207. HEAP16[(((eventStruct)+(42))>>1)]=e.buttons;
  6208. HEAP32[(((eventStruct)+(44))>>2)]=e["movementX"] || e["mozMovementX"] || e["webkitMovementX"] || (e.screenX-JSEvents.previousScreenX);
  6209. HEAP32[(((eventStruct)+(48))>>2)]=e["movementY"] || e["mozMovementY"] || e["webkitMovementY"] || (e.screenY-JSEvents.previousScreenY);
  6210. if (Module['canvas']) {
  6211. var rect = Module['canvas'].getBoundingClientRect();
  6212. HEAP32[(((eventStruct)+(60))>>2)]=e.clientX - rect.left;
  6213. HEAP32[(((eventStruct)+(64))>>2)]=e.clientY - rect.top;
  6214. } else { // Canvas is not initialized, return 0.
  6215. HEAP32[(((eventStruct)+(60))>>2)]=0;
  6216. HEAP32[(((eventStruct)+(64))>>2)]=0;
  6217. }
  6218. if (target) {
  6219. var rect = JSEvents.getBoundingClientRectOrZeros(target);
  6220. HEAP32[(((eventStruct)+(52))>>2)]=e.clientX - rect.left;
  6221. HEAP32[(((eventStruct)+(56))>>2)]=e.clientY - rect.top;
  6222. } else { // No specific target passed, return 0.
  6223. HEAP32[(((eventStruct)+(52))>>2)]=0;
  6224. HEAP32[(((eventStruct)+(56))>>2)]=0;
  6225. }
  6226. // wheel and mousewheel events contain wrong screenX/screenY on chrome/opera
  6227. // https://github.com/kripken/emscripten/pull/4997
  6228. // https://bugs.chromium.org/p/chromium/issues/detail?id=699956
  6229. if (e.type !== 'wheel' && e.type !== 'mousewheel') {
  6230. JSEvents.previousScreenX = e.screenX;
  6231. JSEvents.previousScreenY = e.screenY;
  6232. }
  6233. },registerMouseEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
  6234. if (!JSEvents.mouseEvent) {
  6235. JSEvents.mouseEvent = _malloc( 72 );
  6236. }
  6237. target = JSEvents.findEventTarget(target);
  6238. var handlerFunc = function(event) {
  6239. var e = event || window.event;
  6240. JSEvents.fillMouseEventData(JSEvents.mouseEvent, e, target);
  6241. var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.mouseEvent, userData);
  6242. if (shouldCancel) {
  6243. e.preventDefault();
  6244. }
  6245. };
  6246. var eventHandler = {
  6247. target: target,
  6248. allowsDeferredCalls: eventTypeString != 'mousemove' && eventTypeString != 'mouseenter' && eventTypeString != 'mouseleave', // Mouse move events do not allow fullscreen/pointer lock requests to be handled in them!
  6249. eventTypeString: eventTypeString,
  6250. callbackfunc: callbackfunc,
  6251. handlerFunc: handlerFunc,
  6252. useCapture: useCapture
  6253. };
  6254. // In IE, mousedown events don't either allow deferred calls to be run!
  6255. if (JSEvents.isInternetExplorer() && eventTypeString == 'mousedown') eventHandler.allowsDeferredCalls = false;
  6256. JSEvents.registerOrRemoveHandler(eventHandler);
  6257. },registerWheelEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
  6258. if (!JSEvents.wheelEvent) {
  6259. JSEvents.wheelEvent = _malloc( 104 );
  6260. }
  6261. target = JSEvents.findEventTarget(target);
  6262. // The DOM Level 3 events spec event 'wheel'
  6263. var wheelHandlerFunc = function(event) {
  6264. var e = event || window.event;
  6265. JSEvents.fillMouseEventData(JSEvents.wheelEvent, e, target);
  6266. HEAPF64[(((JSEvents.wheelEvent)+(72))>>3)]=e["deltaX"];
  6267. HEAPF64[(((JSEvents.wheelEvent)+(80))>>3)]=e["deltaY"];
  6268. HEAPF64[(((JSEvents.wheelEvent)+(88))>>3)]=e["deltaZ"];
  6269. HEAP32[(((JSEvents.wheelEvent)+(96))>>2)]=e["deltaMode"];
  6270. var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.wheelEvent, userData);
  6271. if (shouldCancel) {
  6272. e.preventDefault();
  6273. }
  6274. };
  6275. // The 'mousewheel' event as implemented in Safari 6.0.5
  6276. var mouseWheelHandlerFunc = function(event) {
  6277. var e = event || window.event;
  6278. JSEvents.fillMouseEventData(JSEvents.wheelEvent, e, target);
  6279. HEAPF64[(((JSEvents.wheelEvent)+(72))>>3)]=e["wheelDeltaX"] || 0;
  6280. HEAPF64[(((JSEvents.wheelEvent)+(80))>>3)]=-(e["wheelDeltaY"] ? e["wheelDeltaY"] : e["wheelDelta"]) /* 1. Invert to unify direction with the DOM Level 3 wheel event. 2. MSIE does not provide wheelDeltaY, so wheelDelta is used as a fallback. */;
  6281. HEAPF64[(((JSEvents.wheelEvent)+(88))>>3)]=0 /* Not available */;
  6282. HEAP32[(((JSEvents.wheelEvent)+(96))>>2)]=0 /* DOM_DELTA_PIXEL */;
  6283. var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.wheelEvent, userData);
  6284. if (shouldCancel) {
  6285. e.preventDefault();
  6286. }
  6287. };
  6288. var eventHandler = {
  6289. target: target,
  6290. allowsDeferredCalls: true,
  6291. eventTypeString: eventTypeString,
  6292. callbackfunc: callbackfunc,
  6293. handlerFunc: (eventTypeString == 'wheel') ? wheelHandlerFunc : mouseWheelHandlerFunc,
  6294. useCapture: useCapture
  6295. };
  6296. JSEvents.registerOrRemoveHandler(eventHandler);
  6297. },pageScrollPos:function () {
  6298. if (window.pageXOffset > 0 || window.pageYOffset > 0) {
  6299. return [window.pageXOffset, window.pageYOffset];
  6300. }
  6301. if (typeof document.documentElement.scrollLeft !== 'undefined' || typeof document.documentElement.scrollTop !== 'undefined') {
  6302. return [document.documentElement.scrollLeft, document.documentElement.scrollTop];
  6303. }
  6304. return [document.body.scrollLeft|0, document.body.scrollTop|0];
  6305. },registerUiEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
  6306. if (!JSEvents.uiEvent) {
  6307. JSEvents.uiEvent = _malloc( 36 );
  6308. }
  6309. if (eventTypeString == "scroll" && !target) {
  6310. target = document; // By default read scroll events on document rather than window.
  6311. } else {
  6312. target = JSEvents.findEventTarget(target);
  6313. }
  6314. var handlerFunc = function(event) {
  6315. var e = event || window.event;
  6316. if (e.target != target) {
  6317. // Never take ui events such as scroll via a 'bubbled' route, but always from the direct element that
  6318. // was targeted. Otherwise e.g. if app logs a message in response to a page scroll, the Emscripten log
  6319. // message box could cause to scroll, generating a new (bubbled) scroll message, causing a new log print,
  6320. // causing a new scroll, etc..
  6321. return;
  6322. }
  6323. var scrollPos = JSEvents.pageScrollPos();
  6324. HEAP32[((JSEvents.uiEvent)>>2)]=e.detail;
  6325. HEAP32[(((JSEvents.uiEvent)+(4))>>2)]=document.body.clientWidth;
  6326. HEAP32[(((JSEvents.uiEvent)+(8))>>2)]=document.body.clientHeight;
  6327. HEAP32[(((JSEvents.uiEvent)+(12))>>2)]=window.innerWidth;
  6328. HEAP32[(((JSEvents.uiEvent)+(16))>>2)]=window.innerHeight;
  6329. HEAP32[(((JSEvents.uiEvent)+(20))>>2)]=window.outerWidth;
  6330. HEAP32[(((JSEvents.uiEvent)+(24))>>2)]=window.outerHeight;
  6331. HEAP32[(((JSEvents.uiEvent)+(28))>>2)]=scrollPos[0];
  6332. HEAP32[(((JSEvents.uiEvent)+(32))>>2)]=scrollPos[1];
  6333. var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.uiEvent, userData);
  6334. if (shouldCancel) {
  6335. e.preventDefault();
  6336. }
  6337. };
  6338. var eventHandler = {
  6339. target: target,
  6340. allowsDeferredCalls: false, // Neither scroll or resize events allow running requests inside them.
  6341. eventTypeString: eventTypeString,
  6342. callbackfunc: callbackfunc,
  6343. handlerFunc: handlerFunc,
  6344. useCapture: useCapture
  6345. };
  6346. JSEvents.registerOrRemoveHandler(eventHandler);
  6347. },getNodeNameForTarget:function (target) {
  6348. if (!target) return '';
  6349. if (target == window) return '#window';
  6350. if (target == window.screen) return '#screen';
  6351. return (target && target.nodeName) ? target.nodeName : '';
  6352. },registerFocusEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
  6353. if (!JSEvents.focusEvent) {
  6354. JSEvents.focusEvent = _malloc( 256 );
  6355. }
  6356. var handlerFunc = function(event) {
  6357. var e = event || window.event;
  6358. var nodeName = JSEvents.getNodeNameForTarget(e.target);
  6359. var id = e.target.id ? e.target.id : '';
  6360. stringToUTF8(nodeName, JSEvents.focusEvent + 0, 128);
  6361. stringToUTF8(id, JSEvents.focusEvent + 128, 128);
  6362. var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.focusEvent, userData);
  6363. if (shouldCancel) {
  6364. e.preventDefault();
  6365. }
  6366. };
  6367. var eventHandler = {
  6368. target: JSEvents.findEventTarget(target),
  6369. allowsDeferredCalls: false,
  6370. eventTypeString: eventTypeString,
  6371. callbackfunc: callbackfunc,
  6372. handlerFunc: handlerFunc,
  6373. useCapture: useCapture
  6374. };
  6375. JSEvents.registerOrRemoveHandler(eventHandler);
  6376. },tick:function () {
  6377. if (window['performance'] && window['performance']['now']) return window['performance']['now']();
  6378. else return Date.now();
  6379. },registerDeviceOrientationEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
  6380. if (!JSEvents.deviceOrientationEvent) {
  6381. JSEvents.deviceOrientationEvent = _malloc( 40 );
  6382. }
  6383. var handlerFunc = function(event) {
  6384. var e = event || window.event;
  6385. HEAPF64[((JSEvents.deviceOrientationEvent)>>3)]=JSEvents.tick();
  6386. HEAPF64[(((JSEvents.deviceOrientationEvent)+(8))>>3)]=e.alpha;
  6387. HEAPF64[(((JSEvents.deviceOrientationEvent)+(16))>>3)]=e.beta;
  6388. HEAPF64[(((JSEvents.deviceOrientationEvent)+(24))>>3)]=e.gamma;
  6389. HEAP32[(((JSEvents.deviceOrientationEvent)+(32))>>2)]=e.absolute;
  6390. var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.deviceOrientationEvent, userData);
  6391. if (shouldCancel) {
  6392. e.preventDefault();
  6393. }
  6394. };
  6395. var eventHandler = {
  6396. target: JSEvents.findEventTarget(target),
  6397. allowsDeferredCalls: false,
  6398. eventTypeString: eventTypeString,
  6399. callbackfunc: callbackfunc,
  6400. handlerFunc: handlerFunc,
  6401. useCapture: useCapture
  6402. };
  6403. JSEvents.registerOrRemoveHandler(eventHandler);
  6404. },registerDeviceMotionEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
  6405. if (!JSEvents.deviceMotionEvent) {
  6406. JSEvents.deviceMotionEvent = _malloc( 80 );
  6407. }
  6408. var handlerFunc = function(event) {
  6409. var e = event || window.event;
  6410. HEAPF64[((JSEvents.deviceOrientationEvent)>>3)]=JSEvents.tick();
  6411. HEAPF64[(((JSEvents.deviceMotionEvent)+(8))>>3)]=e.acceleration.x;
  6412. HEAPF64[(((JSEvents.deviceMotionEvent)+(16))>>3)]=e.acceleration.y;
  6413. HEAPF64[(((JSEvents.deviceMotionEvent)+(24))>>3)]=e.acceleration.z;
  6414. HEAPF64[(((JSEvents.deviceMotionEvent)+(32))>>3)]=e.accelerationIncludingGravity.x;
  6415. HEAPF64[(((JSEvents.deviceMotionEvent)+(40))>>3)]=e.accelerationIncludingGravity.y;
  6416. HEAPF64[(((JSEvents.deviceMotionEvent)+(48))>>3)]=e.accelerationIncludingGravity.z;
  6417. HEAPF64[(((JSEvents.deviceMotionEvent)+(56))>>3)]=e.rotationRate.alpha;
  6418. HEAPF64[(((JSEvents.deviceMotionEvent)+(64))>>3)]=e.rotationRate.beta;
  6419. HEAPF64[(((JSEvents.deviceMotionEvent)+(72))>>3)]=e.rotationRate.gamma;
  6420. var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.deviceMotionEvent, userData);
  6421. if (shouldCancel) {
  6422. e.preventDefault();
  6423. }
  6424. };
  6425. var eventHandler = {
  6426. target: JSEvents.findEventTarget(target),
  6427. allowsDeferredCalls: false,
  6428. eventTypeString: eventTypeString,
  6429. callbackfunc: callbackfunc,
  6430. handlerFunc: handlerFunc,
  6431. useCapture: useCapture
  6432. };
  6433. JSEvents.registerOrRemoveHandler(eventHandler);
  6434. },screenOrientation:function () {
  6435. if (!window.screen) return undefined;
  6436. return window.screen.orientation || window.screen.mozOrientation || window.screen.webkitOrientation || window.screen.msOrientation;
  6437. },fillOrientationChangeEventData:function (eventStruct, e) {
  6438. var orientations = ["portrait-primary", "portrait-secondary", "landscape-primary", "landscape-secondary"];
  6439. var orientations2 = ["portrait", "portrait", "landscape", "landscape"];
  6440. var orientationString = JSEvents.screenOrientation();
  6441. var orientation = orientations.indexOf(orientationString);
  6442. if (orientation == -1) {
  6443. orientation = orientations2.indexOf(orientationString);
  6444. }
  6445. HEAP32[((eventStruct)>>2)]=1 << orientation;
  6446. HEAP32[(((eventStruct)+(4))>>2)]=window.orientation;
  6447. },registerOrientationChangeEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
  6448. if (!JSEvents.orientationChangeEvent) {
  6449. JSEvents.orientationChangeEvent = _malloc( 8 );
  6450. }
  6451. if (!target) {
  6452. target = window.screen; // Orientation events need to be captured from 'window.screen' instead of 'window'
  6453. } else {
  6454. target = JSEvents.findEventTarget(target);
  6455. }
  6456. var handlerFunc = function(event) {
  6457. var e = event || window.event;
  6458. JSEvents.fillOrientationChangeEventData(JSEvents.orientationChangeEvent, e);
  6459. var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.orientationChangeEvent, userData);
  6460. if (shouldCancel) {
  6461. e.preventDefault();
  6462. }
  6463. };
  6464. if (eventTypeString == "orientationchange" && window.screen.mozOrientation !== undefined) {
  6465. eventTypeString = "mozorientationchange";
  6466. }
  6467. var eventHandler = {
  6468. target: target,
  6469. allowsDeferredCalls: false,
  6470. eventTypeString: eventTypeString,
  6471. callbackfunc: callbackfunc,
  6472. handlerFunc: handlerFunc,
  6473. useCapture: useCapture
  6474. };
  6475. JSEvents.registerOrRemoveHandler(eventHandler);
  6476. },fullscreenEnabled:function () {
  6477. return document.fullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled;
  6478. },fillFullscreenChangeEventData:function (eventStruct, e) {
  6479. var fullscreenElement = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement;
  6480. var isFullscreen = !!fullscreenElement;
  6481. HEAP32[((eventStruct)>>2)]=isFullscreen;
  6482. HEAP32[(((eventStruct)+(4))>>2)]=JSEvents.fullscreenEnabled();
  6483. // If transitioning to fullscreen, report info about the element that is now fullscreen.
  6484. // If transitioning to windowed mode, report info about the element that just was fullscreen.
  6485. var reportedElement = isFullscreen ? fullscreenElement : JSEvents.previousFullscreenElement;
  6486. var nodeName = JSEvents.getNodeNameForTarget(reportedElement);
  6487. var id = (reportedElement && reportedElement.id) ? reportedElement.id : '';
  6488. stringToUTF8(nodeName, eventStruct + 8, 128);
  6489. stringToUTF8(id, eventStruct + 136, 128);
  6490. HEAP32[(((eventStruct)+(264))>>2)]=reportedElement ? reportedElement.clientWidth : 0;
  6491. HEAP32[(((eventStruct)+(268))>>2)]=reportedElement ? reportedElement.clientHeight : 0;
  6492. HEAP32[(((eventStruct)+(272))>>2)]=screen.width;
  6493. HEAP32[(((eventStruct)+(276))>>2)]=screen.height;
  6494. if (isFullscreen) {
  6495. JSEvents.previousFullscreenElement = fullscreenElement;
  6496. }
  6497. },registerFullscreenChangeEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
  6498. if (!JSEvents.fullscreenChangeEvent) {
  6499. JSEvents.fullscreenChangeEvent = _malloc( 280 );
  6500. }
  6501. if (!target) {
  6502. target = document; // Fullscreen change events need to be captured from 'document' by default instead of 'window'
  6503. } else {
  6504. target = JSEvents.findEventTarget(target);
  6505. }
  6506. var handlerFunc = function(event) {
  6507. var e = event || window.event;
  6508. JSEvents.fillFullscreenChangeEventData(JSEvents.fullscreenChangeEvent, e);
  6509. var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.fullscreenChangeEvent, userData);
  6510. if (shouldCancel) {
  6511. e.preventDefault();
  6512. }
  6513. };
  6514. var eventHandler = {
  6515. target: target,
  6516. allowsDeferredCalls: false,
  6517. eventTypeString: eventTypeString,
  6518. callbackfunc: callbackfunc,
  6519. handlerFunc: handlerFunc,
  6520. useCapture: useCapture
  6521. };
  6522. JSEvents.registerOrRemoveHandler(eventHandler);
  6523. },resizeCanvasForFullscreen:function (target, strategy) {
  6524. var restoreOldStyle = __registerRestoreOldStyle(target);
  6525. var cssWidth = strategy.softFullscreen ? window.innerWidth : screen.width;
  6526. var cssHeight = strategy.softFullscreen ? window.innerHeight : screen.height;
  6527. var rect = target.getBoundingClientRect();
  6528. var windowedCssWidth = rect.right - rect.left;
  6529. var windowedCssHeight = rect.bottom - rect.top;
  6530. var windowedRttWidth = target.width;
  6531. var windowedRttHeight = target.height;
  6532. if (strategy.scaleMode == 3) {
  6533. __setLetterbox(target, (cssHeight - windowedCssHeight) / 2, (cssWidth - windowedCssWidth) / 2);
  6534. cssWidth = windowedCssWidth;
  6535. cssHeight = windowedCssHeight;
  6536. } else if (strategy.scaleMode == 2) {
  6537. if (cssWidth*windowedRttHeight < windowedRttWidth*cssHeight) {
  6538. var desiredCssHeight = windowedRttHeight * cssWidth / windowedRttWidth;
  6539. __setLetterbox(target, (cssHeight - desiredCssHeight) / 2, 0);
  6540. cssHeight = desiredCssHeight;
  6541. } else {
  6542. var desiredCssWidth = windowedRttWidth * cssHeight / windowedRttHeight;
  6543. __setLetterbox(target, 0, (cssWidth - desiredCssWidth) / 2);
  6544. cssWidth = desiredCssWidth;
  6545. }
  6546. }
  6547. // If we are adding padding, must choose a background color or otherwise Chrome will give the
  6548. // padding a default white color. Do it only if user has not customized their own background color.
  6549. if (!target.style.backgroundColor) target.style.backgroundColor = 'black';
  6550. // IE11 does the same, but requires the color to be set in the document body.
  6551. if (!document.body.style.backgroundColor) document.body.style.backgroundColor = 'black'; // IE11
  6552. // Firefox always shows black letterboxes independent of style color.
  6553. target.style.width = cssWidth + 'px';
  6554. target.style.height = cssHeight + 'px';
  6555. if (strategy.filteringMode == 1) {
  6556. target.style.imageRendering = 'optimizeSpeed';
  6557. target.style.imageRendering = '-moz-crisp-edges';
  6558. target.style.imageRendering = '-o-crisp-edges';
  6559. target.style.imageRendering = '-webkit-optimize-contrast';
  6560. target.style.imageRendering = 'optimize-contrast';
  6561. target.style.imageRendering = 'crisp-edges';
  6562. target.style.imageRendering = 'pixelated';
  6563. }
  6564. var dpiScale = (strategy.canvasResolutionScaleMode == 2) ? window.devicePixelRatio : 1;
  6565. if (strategy.canvasResolutionScaleMode != 0) {
  6566. target.width = cssWidth * dpiScale;
  6567. target.height = cssHeight * dpiScale;
  6568. if (target.GLctxObject) target.GLctxObject.GLctx.viewport(0, 0, target.width, target.height);
  6569. }
  6570. return restoreOldStyle;
  6571. },requestFullscreen:function (target, strategy) {
  6572. // EMSCRIPTEN_FULLSCREEN_SCALE_DEFAULT + EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_NONE is a mode where no extra logic is performed to the DOM elements.
  6573. if (strategy.scaleMode != 0 || strategy.canvasResolutionScaleMode != 0) {
  6574. JSEvents.resizeCanvasForFullscreen(target, strategy);
  6575. }
  6576. if (target.requestFullscreen) {
  6577. target.requestFullscreen();
  6578. } else if (target.msRequestFullscreen) {
  6579. target.msRequestFullscreen();
  6580. } else if (target.mozRequestFullScreen) {
  6581. target.mozRequestFullScreen();
  6582. } else if (target.mozRequestFullscreen) {
  6583. target.mozRequestFullscreen();
  6584. } else if (target.webkitRequestFullscreen) {
  6585. target.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
  6586. } else {
  6587. if (typeof JSEvents.fullscreenEnabled() === 'undefined') {
  6588. return -1;
  6589. } else {
  6590. return -3;
  6591. }
  6592. }
  6593. if (strategy.canvasResizedCallback) {
  6594. Module['dynCall_iiii'](strategy.canvasResizedCallback, 37, 0, strategy.canvasResizedCallbackUserData);
  6595. }
  6596. return 0;
  6597. },fillPointerlockChangeEventData:function (eventStruct, e) {
  6598. var pointerLockElement = document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement || document.msPointerLockElement;
  6599. var isPointerlocked = !!pointerLockElement;
  6600. HEAP32[((eventStruct)>>2)]=isPointerlocked;
  6601. var nodeName = JSEvents.getNodeNameForTarget(pointerLockElement);
  6602. var id = (pointerLockElement && pointerLockElement.id) ? pointerLockElement.id : '';
  6603. stringToUTF8(nodeName, eventStruct + 4, 128);
  6604. stringToUTF8(id, eventStruct + 132, 128);
  6605. },registerPointerlockChangeEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
  6606. if (!JSEvents.pointerlockChangeEvent) {
  6607. JSEvents.pointerlockChangeEvent = _malloc( 260 );
  6608. }
  6609. if (!target) {
  6610. target = document; // Pointer lock change events need to be captured from 'document' by default instead of 'window'
  6611. } else {
  6612. target = JSEvents.findEventTarget(target);
  6613. }
  6614. var handlerFunc = function(event) {
  6615. var e = event || window.event;
  6616. JSEvents.fillPointerlockChangeEventData(JSEvents.pointerlockChangeEvent, e);
  6617. var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.pointerlockChangeEvent, userData);
  6618. if (shouldCancel) {
  6619. e.preventDefault();
  6620. }
  6621. };
  6622. var eventHandler = {
  6623. target: target,
  6624. allowsDeferredCalls: false,
  6625. eventTypeString: eventTypeString,
  6626. callbackfunc: callbackfunc,
  6627. handlerFunc: handlerFunc,
  6628. useCapture: useCapture
  6629. };
  6630. JSEvents.registerOrRemoveHandler(eventHandler);
  6631. },registerPointerlockErrorEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
  6632. if (!target) {
  6633. target = document; // Pointer lock events need to be captured from 'document' by default instead of 'window'
  6634. } else {
  6635. target = JSEvents.findEventTarget(target);
  6636. }
  6637. var handlerFunc = function(event) {
  6638. var e = event || window.event;
  6639. var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, 0, userData);
  6640. if (shouldCancel) {
  6641. e.preventDefault();
  6642. }
  6643. };
  6644. var eventHandler = {
  6645. target: target,
  6646. allowsDeferredCalls: false,
  6647. eventTypeString: eventTypeString,
  6648. callbackfunc: callbackfunc,
  6649. handlerFunc: handlerFunc,
  6650. useCapture: useCapture
  6651. };
  6652. JSEvents.registerOrRemoveHandler(eventHandler);
  6653. },requestPointerLock:function (target) {
  6654. if (target.requestPointerLock) {
  6655. target.requestPointerLock();
  6656. } else if (target.mozRequestPointerLock) {
  6657. target.mozRequestPointerLock();
  6658. } else if (target.webkitRequestPointerLock) {
  6659. target.webkitRequestPointerLock();
  6660. } else if (target.msRequestPointerLock) {
  6661. target.msRequestPointerLock();
  6662. } else {
  6663. // document.body is known to accept pointer lock, so use that to differentiate if the user passed a bad element,
  6664. // or if the whole browser just doesn't support the feature.
  6665. if (document.body.requestPointerLock || document.body.mozRequestPointerLock || document.body.webkitRequestPointerLock || document.body.msRequestPointerLock) {
  6666. return -3;
  6667. } else {
  6668. return -1;
  6669. }
  6670. }
  6671. return 0;
  6672. },fillVisibilityChangeEventData:function (eventStruct, e) {
  6673. var visibilityStates = [ "hidden", "visible", "prerender", "unloaded" ];
  6674. var visibilityState = visibilityStates.indexOf(document.visibilityState);
  6675. HEAP32[((eventStruct)>>2)]=document.hidden;
  6676. HEAP32[(((eventStruct)+(4))>>2)]=visibilityState;
  6677. },registerVisibilityChangeEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
  6678. if (!JSEvents.visibilityChangeEvent) {
  6679. JSEvents.visibilityChangeEvent = _malloc( 8 );
  6680. }
  6681. if (!target) {
  6682. target = document; // Visibility change events need to be captured from 'document' by default instead of 'window'
  6683. } else {
  6684. target = JSEvents.findEventTarget(target);
  6685. }
  6686. var handlerFunc = function(event) {
  6687. var e = event || window.event;
  6688. JSEvents.fillVisibilityChangeEventData(JSEvents.visibilityChangeEvent, e);
  6689. var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.visibilityChangeEvent, userData);
  6690. if (shouldCancel) {
  6691. e.preventDefault();
  6692. }
  6693. };
  6694. var eventHandler = {
  6695. target: target,
  6696. allowsDeferredCalls: false,
  6697. eventTypeString: eventTypeString,
  6698. callbackfunc: callbackfunc,
  6699. handlerFunc: handlerFunc,
  6700. useCapture: useCapture
  6701. };
  6702. JSEvents.registerOrRemoveHandler(eventHandler);
  6703. },registerTouchEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
  6704. if (!JSEvents.touchEvent) {
  6705. JSEvents.touchEvent = _malloc( 1684 );
  6706. }
  6707. target = JSEvents.findEventTarget(target);
  6708. var handlerFunc = function(event) {
  6709. var e = event || window.event;
  6710. var touches = {};
  6711. for(var i = 0; i < e.touches.length; ++i) {
  6712. var touch = e.touches[i];
  6713. touches[touch.identifier] = touch;
  6714. }
  6715. for(var i = 0; i < e.changedTouches.length; ++i) {
  6716. var touch = e.changedTouches[i];
  6717. touches[touch.identifier] = touch;
  6718. touch.changed = true;
  6719. }
  6720. for(var i = 0; i < e.targetTouches.length; ++i) {
  6721. var touch = e.targetTouches[i];
  6722. touches[touch.identifier].onTarget = true;
  6723. }
  6724. var ptr = JSEvents.touchEvent;
  6725. HEAP32[(((ptr)+(4))>>2)]=e.ctrlKey;
  6726. HEAP32[(((ptr)+(8))>>2)]=e.shiftKey;
  6727. HEAP32[(((ptr)+(12))>>2)]=e.altKey;
  6728. HEAP32[(((ptr)+(16))>>2)]=e.metaKey;
  6729. ptr += 20; // Advance to the start of the touch array.
  6730. var canvasRect = Module['canvas'] ? Module['canvas'].getBoundingClientRect() : undefined;
  6731. var targetRect = JSEvents.getBoundingClientRectOrZeros(target);
  6732. var numTouches = 0;
  6733. for(var i in touches) {
  6734. var t = touches[i];
  6735. HEAP32[((ptr)>>2)]=t.identifier;
  6736. HEAP32[(((ptr)+(4))>>2)]=t.screenX;
  6737. HEAP32[(((ptr)+(8))>>2)]=t.screenY;
  6738. HEAP32[(((ptr)+(12))>>2)]=t.clientX;
  6739. HEAP32[(((ptr)+(16))>>2)]=t.clientY;
  6740. HEAP32[(((ptr)+(20))>>2)]=t.pageX;
  6741. HEAP32[(((ptr)+(24))>>2)]=t.pageY;
  6742. HEAP32[(((ptr)+(28))>>2)]=t.changed;
  6743. HEAP32[(((ptr)+(32))>>2)]=t.onTarget;
  6744. if (canvasRect) {
  6745. HEAP32[(((ptr)+(44))>>2)]=t.clientX - canvasRect.left;
  6746. HEAP32[(((ptr)+(48))>>2)]=t.clientY - canvasRect.top;
  6747. } else {
  6748. HEAP32[(((ptr)+(44))>>2)]=0;
  6749. HEAP32[(((ptr)+(48))>>2)]=0;
  6750. }
  6751. HEAP32[(((ptr)+(36))>>2)]=t.clientX - targetRect.left;
  6752. HEAP32[(((ptr)+(40))>>2)]=t.clientY - targetRect.top;
  6753. ptr += 52;
  6754. if (++numTouches >= 32) {
  6755. break;
  6756. }
  6757. }
  6758. HEAP32[((JSEvents.touchEvent)>>2)]=numTouches;
  6759. var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.touchEvent, userData);
  6760. if (shouldCancel) {
  6761. e.preventDefault();
  6762. }
  6763. };
  6764. var eventHandler = {
  6765. target: target,
  6766. allowsDeferredCalls: false, // XXX Currently disabled, see bug https://bugzilla.mozilla.org/show_bug.cgi?id=966493
  6767. // Once the above bug is resolved, enable the following condition if possible:
  6768. // allowsDeferredCalls: eventTypeString == 'touchstart',
  6769. eventTypeString: eventTypeString,
  6770. callbackfunc: callbackfunc,
  6771. handlerFunc: handlerFunc,
  6772. useCapture: useCapture
  6773. };
  6774. JSEvents.registerOrRemoveHandler(eventHandler);
  6775. },fillGamepadEventData:function (eventStruct, e) {
  6776. HEAPF64[((eventStruct)>>3)]=e.timestamp;
  6777. for(var i = 0; i < e.axes.length; ++i) {
  6778. HEAPF64[(((eventStruct+i*8)+(16))>>3)]=e.axes[i];
  6779. }
  6780. for(var i = 0; i < e.buttons.length; ++i) {
  6781. if (typeof(e.buttons[i]) === 'object') {
  6782. HEAPF64[(((eventStruct+i*8)+(528))>>3)]=e.buttons[i].value;
  6783. } else {
  6784. HEAPF64[(((eventStruct+i*8)+(528))>>3)]=e.buttons[i];
  6785. }
  6786. }
  6787. for(var i = 0; i < e.buttons.length; ++i) {
  6788. if (typeof(e.buttons[i]) === 'object') {
  6789. HEAP32[(((eventStruct+i*4)+(1040))>>2)]=e.buttons[i].pressed;
  6790. } else {
  6791. HEAP32[(((eventStruct+i*4)+(1040))>>2)]=e.buttons[i] == 1.0;
  6792. }
  6793. }
  6794. HEAP32[(((eventStruct)+(1296))>>2)]=e.connected;
  6795. HEAP32[(((eventStruct)+(1300))>>2)]=e.index;
  6796. HEAP32[(((eventStruct)+(8))>>2)]=e.axes.length;
  6797. HEAP32[(((eventStruct)+(12))>>2)]=e.buttons.length;
  6798. stringToUTF8(e.id, eventStruct + 1304, 64);
  6799. stringToUTF8(e.mapping, eventStruct + 1368, 64);
  6800. },registerGamepadEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
  6801. if (!JSEvents.gamepadEvent) {
  6802. JSEvents.gamepadEvent = _malloc( 1432 );
  6803. }
  6804. var handlerFunc = function(event) {
  6805. var e = event || window.event;
  6806. JSEvents.fillGamepadEventData(JSEvents.gamepadEvent, e.gamepad);
  6807. var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.gamepadEvent, userData);
  6808. if (shouldCancel) {
  6809. e.preventDefault();
  6810. }
  6811. };
  6812. var eventHandler = {
  6813. target: JSEvents.findEventTarget(target),
  6814. allowsDeferredCalls: true,
  6815. eventTypeString: eventTypeString,
  6816. callbackfunc: callbackfunc,
  6817. handlerFunc: handlerFunc,
  6818. useCapture: useCapture
  6819. };
  6820. JSEvents.registerOrRemoveHandler(eventHandler);
  6821. },registerBeforeUnloadEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
  6822. var handlerFunc = function(event) {
  6823. var e = event || window.event;
  6824. var confirmationMessage = Module['dynCall_iiii'](callbackfunc, eventTypeId, 0, userData);
  6825. if (confirmationMessage) {
  6826. confirmationMessage = Pointer_stringify(confirmationMessage);
  6827. }
  6828. if (confirmationMessage) {
  6829. e.preventDefault();
  6830. e.returnValue = confirmationMessage;
  6831. return confirmationMessage;
  6832. }
  6833. };
  6834. var eventHandler = {
  6835. target: JSEvents.findEventTarget(target),
  6836. allowsDeferredCalls: false,
  6837. eventTypeString: eventTypeString,
  6838. callbackfunc: callbackfunc,
  6839. handlerFunc: handlerFunc,
  6840. useCapture: useCapture
  6841. };
  6842. JSEvents.registerOrRemoveHandler(eventHandler);
  6843. },battery:function () { return navigator.battery || navigator.mozBattery || navigator.webkitBattery; },fillBatteryEventData:function (eventStruct, e) {
  6844. HEAPF64[((eventStruct)>>3)]=e.chargingTime;
  6845. HEAPF64[(((eventStruct)+(8))>>3)]=e.dischargingTime;
  6846. HEAPF64[(((eventStruct)+(16))>>3)]=e.level;
  6847. HEAP32[(((eventStruct)+(24))>>2)]=e.charging;
  6848. },registerBatteryEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
  6849. if (!JSEvents.batteryEvent) {
  6850. JSEvents.batteryEvent = _malloc( 32 );
  6851. }
  6852. var handlerFunc = function(event) {
  6853. var e = event || window.event;
  6854. JSEvents.fillBatteryEventData(JSEvents.batteryEvent, JSEvents.battery());
  6855. var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.batteryEvent, userData);
  6856. if (shouldCancel) {
  6857. e.preventDefault();
  6858. }
  6859. };
  6860. var eventHandler = {
  6861. target: JSEvents.findEventTarget(target),
  6862. allowsDeferredCalls: false,
  6863. eventTypeString: eventTypeString,
  6864. callbackfunc: callbackfunc,
  6865. handlerFunc: handlerFunc,
  6866. useCapture: useCapture
  6867. };
  6868. JSEvents.registerOrRemoveHandler(eventHandler);
  6869. },registerWebGlEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
  6870. if (!target) {
  6871. target = Module['canvas'];
  6872. }
  6873. var handlerFunc = function(event) {
  6874. var e = event || window.event;
  6875. var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, 0, userData);
  6876. if (shouldCancel) {
  6877. e.preventDefault();
  6878. }
  6879. };
  6880. var eventHandler = {
  6881. target: JSEvents.findEventTarget(target),
  6882. allowsDeferredCalls: false,
  6883. eventTypeString: eventTypeString,
  6884. callbackfunc: callbackfunc,
  6885. handlerFunc: handlerFunc,
  6886. useCapture: useCapture
  6887. };
  6888. JSEvents.registerOrRemoveHandler(eventHandler);
  6889. }};function __emscripten_sample_gamepad_data() {
  6890. // Polling gamepads generates garbage, so don't do it when we know there are no gamepads connected.
  6891. if (!JSEvents.numGamepadsConnected) return;
  6892. // Produce a new Gamepad API sample if we are ticking a new game frame, or if not using emscripten_set_main_loop() at all to drive animation.
  6893. if (Browser.mainLoop.currentFrameNumber !== JSEvents.lastGamepadStateFrame || !Browser.mainLoop.currentFrameNumber) {
  6894. JSEvents.lastGamepadState = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads : null);
  6895. JSEvents.lastGamepadStateFrame = Browser.mainLoop.currentFrameNumber;
  6896. }
  6897. }function _emscripten_get_gamepad_status(index, gamepadState) {
  6898. __emscripten_sample_gamepad_data();
  6899. if (!JSEvents.lastGamepadState) return -1;
  6900. // INVALID_PARAM is returned on a Gamepad index that never was there.
  6901. if (index < 0 || index >= JSEvents.lastGamepadState.length) return -5;
  6902. // NO_DATA is returned on a Gamepad index that was removed.
  6903. // For previously disconnected gamepads there should be an empty slot (null/undefined/false) at the index.
  6904. // This is because gamepads must keep their original position in the array.
  6905. // For example, removing the first of two gamepads produces [null/undefined/false, gamepad].
  6906. if (!JSEvents.lastGamepadState[index]) return -7;
  6907. JSEvents.fillGamepadEventData(gamepadState, JSEvents.lastGamepadState[index]);
  6908. return 0;
  6909. }
  6910. function _utime(path, times) {
  6911. if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_2(12, path, times);
  6912. // int utime(const char *path, const struct utimbuf *times);
  6913. // http://pubs.opengroup.org/onlinepubs/009695399/basedefs/utime.h.html
  6914. var time;
  6915. if (times) {
  6916. // NOTE: We don't keep track of access timestamps.
  6917. var offset = 4;
  6918. time = HEAP32[(((times)+(offset))>>2)];
  6919. time *= 1000;
  6920. } else {
  6921. time = Date.now();
  6922. }
  6923. path = Pointer_stringify(path);
  6924. try {
  6925. FS.utime(path, time, time);
  6926. return 0;
  6927. } catch (e) {
  6928. FS.handleFSError(e);
  6929. return -1;
  6930. }
  6931. }
  6932. function _emscripten_glCopyTexImage2D(x0, x1, x2, x3, x4, x5, x6, x7) { GLctx['copyTexImage2D'](x0, x1, x2, x3, x4, x5, x6, x7) }
  6933. function _emscripten_glTexParameterfv(target, pname, params) {
  6934. var param = HEAPF32[((params)>>2)];
  6935. GLctx.texParameterf(target, pname, param);
  6936. }
  6937. var PROCINFO={ppid:1,pid:42,sid:42,pgid:42};
  6938. var __pthread_ptr=0;
  6939. var __pthread_is_main_browser_thread=0;function __register_pthread_ptr(pthreadPtr, isMainBrowserThread, isMainRuntimeThread) {
  6940. pthreadPtr = pthreadPtr|0;
  6941. isMainBrowserThread = isMainBrowserThread|0;
  6942. isMainRuntimeThread = isMainRuntimeThread|0;
  6943. __pthread_ptr = pthreadPtr;
  6944. __pthread_is_main_browser_thread = isMainBrowserThread;
  6945. __pthread_is_main_runtime_thread = isMainRuntimeThread;
  6946. }
  6947. var _emscripten_main_thread_process_queued_calls=undefined;var PThread={MAIN_THREAD_ID:1,mainThreadInfo:{schedPolicy:0,schedPrio:0},unusedWorkerPool:[],runningWorkers:[],initMainThreadBlock:function () {
  6948. if (ENVIRONMENT_IS_PTHREAD) return undefined;
  6949. PThread.mainThreadBlock = allocate(244, "i32*", ALLOC_STATIC);
  6950. __register_pthread_ptr(PThread.mainThreadBlock, /*isMainBrowserThread=*/!ENVIRONMENT_IS_WORKER, /*isMainRuntimeThread=*/1); // Pass the thread address inside the asm.js scope to store it for fast access that avoids the need for a FFI out.
  6951. for (var i = 0; i < 244/4; ++i) HEAPU32[PThread.mainThreadBlock/4+i] = 0;
  6952. // The pthread struct has a field that points to itself - this is used as a magic ID to detect whether the pthread_t
  6953. // structure is 'alive'.
  6954. HEAP32[(((PThread.mainThreadBlock)+(24))>>2)]=PThread.mainThreadBlock;
  6955. // Allocate memory for thread-local storage.
  6956. var tlsMemory = allocate(128 * 4, "i32*", ALLOC_STATIC);
  6957. for (var i = 0; i < 128; ++i) HEAPU32[tlsMemory/4+i] = 0;
  6958. Atomics.store(HEAPU32, (PThread.mainThreadBlock + 116 ) >> 2, tlsMemory); // Init thread-local-storage memory array.
  6959. Atomics.store(HEAPU32, (PThread.mainThreadBlock + 52 ) >> 2, PThread.mainThreadBlock); // Main thread ID.
  6960. Atomics.store(HEAPU32, (PThread.mainThreadBlock + 56 ) >> 2, PROCINFO.pid); // Process ID.
  6961. },pthreads:{},pthreadIdCounter:2,exitHandlers:null,setThreadStatus:function () {},runExitHandlers:function () {
  6962. if (PThread.exitHandlers !== null) {
  6963. while (PThread.exitHandlers.length > 0) {
  6964. PThread.exitHandlers.pop()();
  6965. }
  6966. PThread.exitHandlers = null;
  6967. }
  6968. // Call into the musl function that runs destructors of all thread-specific data.
  6969. if (ENVIRONMENT_IS_PTHREAD && threadInfoStruct) ___pthread_tsd_run_dtors();
  6970. },threadExit:function (exitCode) {
  6971. var tb = _pthread_self();
  6972. if (tb) { // If we haven't yet exited?
  6973. Atomics.store(HEAPU32, (tb + 4 ) >> 2, exitCode);
  6974. // When we publish this, the main thread is free to deallocate the thread object and we are done.
  6975. // Therefore set threadInfoStruct = 0; above to 'release' the object in this worker thread.
  6976. Atomics.store(HEAPU32, (tb + 0 ) >> 2, 1);
  6977. // Disable all cancellation so that executing the cleanup handlers won't trigger another JS
  6978. // canceled exception to be thrown.
  6979. Atomics.store(HEAPU32, (tb + 72 ) >> 2, 1/*PTHREAD_CANCEL_DISABLE*/);
  6980. Atomics.store(HEAPU32, (tb + 76 ) >> 2, 0/*PTHREAD_CANCEL_DEFERRED*/);
  6981. PThread.runExitHandlers();
  6982. _emscripten_futex_wake(tb + 0, 2147483647);
  6983. __register_pthread_ptr(0, 0, 0); // Unregister the thread block also inside the asm.js scope.
  6984. threadInfoStruct = 0;
  6985. if (ENVIRONMENT_IS_PTHREAD) {
  6986. // This worker no longer owns any WebGL OffscreenCanvases, so transfer them back to parent thread.
  6987. var transferList = [];
  6988. postMessage({ cmd: 'exit' });
  6989. }
  6990. }
  6991. },threadCancel:function () {
  6992. PThread.runExitHandlers();
  6993. Atomics.store(HEAPU32, (threadInfoStruct + 4 ) >> 2, -1/*PTHREAD_CANCELED*/);
  6994. Atomics.store(HEAPU32, (threadInfoStruct + 0 ) >> 2, 1); // Mark the thread as no longer running.
  6995. _emscripten_futex_wake(threadInfoStruct + 0, 2147483647); // wake all threads
  6996. threadInfoStruct = selfThreadId = 0; // Not hosting a pthread anymore in this worker, reset the info structures to null.
  6997. __register_pthread_ptr(0, 0, 0); // Unregister the thread block also inside the asm.js scope.
  6998. postMessage({ cmd: 'cancelDone' });
  6999. },terminateAllThreads:function () {
  7000. for (var t in PThread.pthreads) {
  7001. var pthread = PThread.pthreads[t];
  7002. if (pthread) {
  7003. PThread.freeThreadData(pthread);
  7004. if (pthread.worker) pthread.worker.terminate();
  7005. }
  7006. }
  7007. PThread.pthreads = {};
  7008. for (var t in PThread.unusedWorkerPool) {
  7009. var pthread = PThread.unusedWorkerPool[t];
  7010. if (pthread) {
  7011. PThread.freeThreadData(pthread);
  7012. if (pthread.worker) pthread.worker.terminate();
  7013. }
  7014. }
  7015. PThread.unusedWorkerPool = [];
  7016. for (var t in PThread.runningWorkers) {
  7017. var pthread = PThread.runningWorkers[t];
  7018. if (pthread) {
  7019. PThread.freeThreadData(pthread);
  7020. if (pthread.worker) pthread.worker.terminate();
  7021. }
  7022. }
  7023. PThread.runningWorkers = [];
  7024. },freeThreadData:function (pthread) {
  7025. if (!pthread) return;
  7026. if (pthread.threadInfoStruct) {
  7027. var tlsMemory = HEAP32[(((pthread.threadInfoStruct)+(116))>>2)];
  7028. HEAP32[(((pthread.threadInfoStruct)+(116))>>2)]=0;
  7029. _free(pthread.tlsMemory);
  7030. _free(pthread.threadInfoStruct);
  7031. }
  7032. pthread.threadInfoStruct = 0;
  7033. if (pthread.allocatedOwnStack && pthread.stackBase) _free(pthread.stackBase);
  7034. pthread.stackBase = 0;
  7035. if (pthread.worker) pthread.worker.pthread = null;
  7036. },receiveObjectTransfer:function (data) {
  7037. },allocateUnusedWorkers:function (numWorkers, onFinishedLoading) {
  7038. if (typeof SharedArrayBuffer === 'undefined') return; // No multithreading support, no-op.
  7039. Module['print']('Preallocating ' + numWorkers + ' workers for a pthread spawn pool.');
  7040. var numWorkersLoaded = 0;
  7041. for (var i = 0; i < numWorkers; ++i) {
  7042. var pthreadMainJs = 'pthread-main.js';
  7043. // Allow HTML module to configure the location where the 'pthread-main.js' file will be loaded from,
  7044. // either via Module.locateFile() function, or via Module.pthreadMainPrefixURL string. If neither
  7045. // of these are passed, then the default URL 'pthread-main.js' relative to the main html file is loaded.
  7046. if (typeof Module['locateFile'] === 'function') pthreadMainJs = Module['locateFile'](pthreadMainJs);
  7047. else if (Module['pthreadMainPrefixURL']) pthreadMainJs = Module['pthreadMainPrefixURL'] + pthreadMainJs;
  7048. var worker = new Worker(pthreadMainJs);
  7049. worker.onmessage = function(e) {
  7050. // If this message is intended to a recipient that is not the main thread, forward it to the target thread.
  7051. if (e.data.targetThread && e.data.targetThread != _pthread_self()) {
  7052. var thread = PThread.pthreads[e.data.targetThread];
  7053. if (thread) {
  7054. thread.worker.postMessage(e.data, e.data.transferList);
  7055. } else {
  7056. console.error('Internal error! Worker sent a message "' + e.data.cmd + '" to target pthread ' + e.data.targetThread + ', but that thread no longer exists!');
  7057. }
  7058. return;
  7059. }
  7060. if (e.data.cmd === 'processQueuedMainThreadWork') {
  7061. // TODO: Must post message to main Emscripten thread in PROXY_TO_WORKER mode.
  7062. _emscripten_main_thread_process_queued_calls();
  7063. } else if (e.data.cmd === 'spawnThread') {
  7064. __spawn_thread(e.data);
  7065. } else if (e.data.cmd === 'cleanupThread') {
  7066. __cleanup_thread(e.data.thread);
  7067. } else if (e.data.cmd === 'killThread') {
  7068. __kill_thread(e.data.thread);
  7069. } else if (e.data.cmd === 'cancelThread') {
  7070. __cancel_thread(e.data.thread);
  7071. } else if (e.data.cmd === 'loaded') {
  7072. ++numWorkersLoaded;
  7073. if (numWorkersLoaded === numWorkers && onFinishedLoading) {
  7074. onFinishedLoading();
  7075. }
  7076. } else if (e.data.cmd === 'print') {
  7077. Module['print']('Thread ' + e.data.threadId + ': ' + e.data.text);
  7078. } else if (e.data.cmd === 'printErr') {
  7079. Module['printErr']('Thread ' + e.data.threadId + ': ' + e.data.text);
  7080. } else if (e.data.cmd === 'alert') {
  7081. alert('Thread ' + e.data.threadId + ': ' + e.data.text);
  7082. } else if (e.data.cmd === 'exit') {
  7083. // currently no-op
  7084. } else if (e.data.cmd === 'cancelDone') {
  7085. PThread.freeThreadData(worker.pthread);
  7086. worker.pthread = undefined; // Detach the worker from the pthread object, and return it to the worker pool as an unused worker.
  7087. PThread.unusedWorkerPool.push(worker);
  7088. // TODO: Free if detached.
  7089. PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker.pthread), 1); // Not a running Worker anymore.
  7090. } else if (e.data.cmd === 'objectTransfer') {
  7091. PThread.receiveObjectTransfer(e.data);
  7092. } else {
  7093. Module['printErr']("worker sent an unknown command " + e.data.cmd);
  7094. }
  7095. };
  7096. worker.onerror = function(e) {
  7097. Module['printErr']('pthread sent an error! ' + e.filename + ':' + e.lineno + ': ' + e.message);
  7098. };
  7099. // Allocate tempDoublePtr for the worker. This is done here on the worker's behalf, since we may need to do this statically
  7100. // if the runtime has not been loaded yet, etc. - so we just use getMemory, which is main-thread only.
  7101. var tempDoublePtr = getMemory(8); // TODO: leaks. Cleanup after worker terminates.
  7102. // Ask the new worker to load up the Emscripten-compiled page. This is a heavy operation.
  7103. worker.postMessage({
  7104. cmd: 'load',
  7105. url: currentScriptUrl,
  7106. buffer: HEAPU8.buffer,
  7107. tempDoublePtr: tempDoublePtr,
  7108. TOTAL_MEMORY: TOTAL_MEMORY,
  7109. STATICTOP: STATICTOP,
  7110. DYNAMIC_BASE: DYNAMIC_BASE,
  7111. DYNAMICTOP_PTR: DYNAMICTOP_PTR,
  7112. PthreadWorkerInit: PthreadWorkerInit
  7113. });
  7114. PThread.unusedWorkerPool.push(worker);
  7115. }
  7116. },getNewWorker:function () {
  7117. if (PThread.unusedWorkerPool.length == 0) PThread.allocateUnusedWorkers(1);
  7118. if (PThread.unusedWorkerPool.length > 0) return PThread.unusedWorkerPool.pop();
  7119. else return null;
  7120. },busySpinWait:function (msecs) {
  7121. var t = performance.now() + msecs;
  7122. while(performance.now() < t) {
  7123. ;
  7124. }
  7125. }};var __pthread_is_main_runtime_thread=0;function _emscripten_is_main_runtime_thread() {
  7126. return __pthread_is_main_runtime_thread|0; // Semantically the same as testing "!ENVIRONMENT_IS_PTHREAD" outside the asm.js scope
  7127. }
  7128. function _emscripten_glLinkProgram(program) {
  7129. GLctx.linkProgram(GL.programs[program]);
  7130. GL.programInfos[program] = null; // uniforms no longer keep the same names after linking
  7131. GL.populateUniformTable(program);
  7132. }
  7133. function _emscripten_glUniform3f(location, v0, v1, v2) {
  7134. GLctx.uniform3f(GL.uniforms[location], v0, v1, v2);
  7135. }
  7136. function _emscripten_glGetObjectParameterivARB() {
  7137. Module['printErr']('missing function: emscripten_glGetObjectParameterivARB'); abort(-1);
  7138. }
  7139. function _emscripten_glBlendFunc(x0, x1) { GLctx['blendFunc'](x0, x1) }
  7140. function _emscripten_glUniform3i(location, v0, v1, v2) {
  7141. GLctx.uniform3i(GL.uniforms[location], v0, v1, v2);
  7142. }
  7143. function _emscripten_glStencilOp(x0, x1, x2) { GLctx['stencilOp'](x0, x1, x2) }
  7144. function _glCreateShader(shaderType) {
  7145. var id = GL.getNewId(GL.shaders);
  7146. GL.shaders[id] = GLctx.createShader(shaderType);
  7147. return id;
  7148. }
  7149. function _glUniform1i(location, v0) {
  7150. GLctx.uniform1i(GL.uniforms[location], v0);
  7151. }
  7152. function _emscripten_glBindAttribLocation(program, index, name) {
  7153. name = Pointer_stringify(name);
  7154. GLctx.bindAttribLocation(GL.programs[program], index, name);
  7155. }
  7156. function _glCompressedTexImage2D(target, level, internalFormat, width, height, border, imageSize, data) {
  7157. GLctx['compressedTexImage2D'](target, level, internalFormat, width, height, border, data ? HEAPU8.subarray((data),(data+imageSize)) : null);
  7158. }
  7159. function _glDisable(x0) { GLctx['disable'](x0) }
  7160. function _emscripten_glEnableVertexAttribArray(index) {
  7161. GLctx.enableVertexAttribArray(index);
  7162. }
  7163. Module["_memset"] = _memset;
  7164. function _atexit(func, arg) {
  7165. if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_2(110, func, arg);
  7166. __ATEXIT__.unshift({ func: func, arg: arg });
  7167. }
  7168. function _glfwMakeContextCurrent(winid) {}
  7169. function _emscripten_set_touchcancel_callback(target, userData, useCapture, callbackfunc) {
  7170. JSEvents.registerTouchEventCallback(target, userData, useCapture, callbackfunc, 25, "touchcancel");
  7171. return 0;
  7172. }
  7173. function ___lock() {}
  7174. function _emscripten_glBlendFuncSeparate(x0, x1, x2, x3) { GLctx['blendFuncSeparate'](x0, x1, x2, x3) }
  7175. function _glCullFace(x0) { GLctx['cullFace'](x0) }
  7176. function _emscripten_glGetVertexAttribPointerv(index, pname, pointer) {
  7177. if (!pointer) {
  7178. // GLES2 specification does not specify how to behave if pointer is a null pointer. Since calling this function does not make sense
  7179. // if pointer == null, issue a GL error to notify user about it.
  7180. GL.recordError(0x0501 /* GL_INVALID_VALUE */);
  7181. return;
  7182. }
  7183. HEAP32[((pointer)>>2)]=GLctx.getVertexAttribOffset(index, pname);
  7184. }
  7185. function _emscripten_glVertexAttrib3f(x0, x1, x2, x3) { GLctx['vertexAttrib3f'](x0, x1, x2, x3) }
  7186. function _emscripten_glEnable(x0) { GLctx['enable'](x0) }
  7187. function _emscripten_glNormalPointer() {
  7188. Module['printErr']('missing function: emscripten_glNormalPointer'); abort(-1);
  7189. }
  7190. var _emscripten_GetProcAddress=undefined;
  7191. Module["_emscripten_GetProcAddress"] = _emscripten_GetProcAddress;
  7192. var EGL={errorCode:12288,defaultDisplayInitialized:false,currentContext:0,currentReadSurface:0,currentDrawSurface:0,stringCache:{},setErrorCode:function (code) {
  7193. EGL.errorCode = code;
  7194. },chooseConfig:function (display, attribList, config, config_size, numConfigs) {
  7195. if (display != 62000 /* Magic ID for Emscripten 'default display' */) {
  7196. EGL.setErrorCode(0x3008 /* EGL_BAD_DISPLAY */);
  7197. return 0;
  7198. }
  7199. // TODO: read attribList.
  7200. if ((!config || !config_size) && !numConfigs) {
  7201. EGL.setErrorCode(0x300C /* EGL_BAD_PARAMETER */);
  7202. return 0;
  7203. }
  7204. if (numConfigs) {
  7205. HEAP32[((numConfigs)>>2)]=1; // Total number of supported configs: 1.
  7206. }
  7207. if (config && config_size > 0) {
  7208. HEAP32[((config)>>2)]=62002;
  7209. }
  7210. EGL.setErrorCode(0x3000 /* EGL_SUCCESS */);
  7211. return 1;
  7212. }};function _eglGetProcAddress(name_) {
  7213. return _emscripten_GetProcAddress(name_);
  7214. }
  7215. function _glfwSetScrollCallback(winid, cbfun) {
  7216. GLFW.setScrollCallback(winid, cbfun);
  7217. }
  7218. function _emscripten_get_pointerlock_status(pointerlockStatus) {
  7219. if (pointerlockStatus) JSEvents.fillPointerlockChangeEventData(pointerlockStatus);
  7220. if (!document.body || (!document.body.requestPointerLock && !document.body.mozRequestPointerLock && !document.body.webkitRequestPointerLock && !document.body.msRequestPointerLock)) {
  7221. return -1;
  7222. }
  7223. return 0;
  7224. }
  7225. function _glAttachShader(program, shader) {
  7226. GLctx.attachShader(GL.programs[program],
  7227. GL.shaders[shader]);
  7228. }
  7229. function _glfwGetPrimaryMonitor() {
  7230. return 1;
  7231. }
  7232. function emscriptenWebGLGetVertexAttrib(index, pname, params, type) {
  7233. if (!params) {
  7234. // GLES2 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense
  7235. // if params == null, issue a GL error to notify user about it.
  7236. GL.recordError(0x0501 /* GL_INVALID_VALUE */);
  7237. return;
  7238. }
  7239. var data = GLctx.getVertexAttrib(index, pname);
  7240. if (pname == 0x889F/*VERTEX_ATTRIB_ARRAY_BUFFER_BINDING*/) {
  7241. HEAP32[((params)>>2)]=data["name"];
  7242. } else if (typeof data == 'number' || typeof data == 'boolean') {
  7243. switch (type) {
  7244. case 'Integer': HEAP32[((params)>>2)]=data; break;
  7245. case 'Float': HEAPF32[((params)>>2)]=data; break;
  7246. case 'FloatToInteger': HEAP32[((params)>>2)]=Math.fround(data); break;
  7247. default: throw 'internal emscriptenWebGLGetVertexAttrib() error, bad type: ' + type;
  7248. }
  7249. } else {
  7250. for (var i = 0; i < data.length; i++) {
  7251. switch (type) {
  7252. case 'Integer': HEAP32[(((params)+(i))>>2)]=data[i]; break;
  7253. case 'Float': HEAPF32[(((params)+(i))>>2)]=data[i]; break;
  7254. case 'FloatToInteger': HEAP32[(((params)+(i))>>2)]=Math.fround(data[i]); break;
  7255. default: throw 'internal emscriptenWebGLGetVertexAttrib() error, bad type: ' + type;
  7256. }
  7257. }
  7258. }
  7259. }function _emscripten_glGetVertexAttribfv(index, pname, params) {
  7260. // N.B. This function may only be called if the vertex attribute was specified using the function glVertexAttrib*f(),
  7261. // otherwise the results are undefined. (GLES3 spec 6.1.12)
  7262. emscriptenWebGLGetVertexAttrib(index, pname, params, 'Float');
  7263. }
  7264. function _emscripten_set_touchstart_callback(target, userData, useCapture, callbackfunc) {
  7265. JSEvents.registerTouchEventCallback(target, userData, useCapture, callbackfunc, 22, "touchstart");
  7266. return 0;
  7267. }
  7268. function _emscripten_glDeleteShader(id) {
  7269. if (!id) return;
  7270. var shader = GL.shaders[id];
  7271. if (!shader) { // glDeleteShader actually signals an error when deleting a nonexisting object, unlike some other GL delete functions.
  7272. GL.recordError(0x0501 /* GL_INVALID_VALUE */);
  7273. return;
  7274. }
  7275. GLctx.deleteShader(shader);
  7276. GL.shaders[id] = null;
  7277. }
  7278. function _emscripten_glVertexPointer(){ throw 'Legacy GL function (glVertexPointer) called. If you want legacy GL emulation, you need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; }
  7279. function _emscripten_glDeleteBuffers(n, buffers) {
  7280. for (var i = 0; i < n; i++) {
  7281. var id = HEAP32[(((buffers)+(i*4))>>2)];
  7282. var buffer = GL.buffers[id];
  7283. // From spec: "glDeleteBuffers silently ignores 0's and names that do not
  7284. // correspond to existing buffer objects."
  7285. if (!buffer) continue;
  7286. GLctx.deleteBuffer(buffer);
  7287. buffer.name = 0;
  7288. GL.buffers[id] = null;
  7289. if (id == GL.currArrayBuffer) GL.currArrayBuffer = 0;
  7290. if (id == GL.currElementArrayBuffer) GL.currElementArrayBuffer = 0;
  7291. }
  7292. }
  7293. function _emscripten_glTexParameteriv(target, pname, params) {
  7294. var param = HEAP32[((params)>>2)];
  7295. GLctx.texParameteri(target, pname, param);
  7296. }
  7297. function _glDrawElements(mode, count, type, indices) {
  7298. GLctx.drawElements(mode, count, type, indices);
  7299. }
  7300. function _glfwTerminate() {
  7301. window.removeEventListener("keydown", GLFW.onKeydown, true);
  7302. window.removeEventListener("keypress", GLFW.onKeyPress, true);
  7303. window.removeEventListener("keyup", GLFW.onKeyup, true);
  7304. Module["canvas"].removeEventListener("mousemove", GLFW.onMousemove, true);
  7305. Module["canvas"].removeEventListener("mousedown", GLFW.onMouseButtonDown, true);
  7306. Module["canvas"].removeEventListener("mouseup", GLFW.onMouseButtonUp, true);
  7307. Module["canvas"].removeEventListener('wheel', GLFW.onMouseWheel, true);
  7308. Module["canvas"].removeEventListener('mousewheel', GLFW.onMouseWheel, true);
  7309. Module["canvas"].removeEventListener('mouseenter', GLFW.onMouseenter, true);
  7310. Module["canvas"].removeEventListener('mouseleave', GLFW.onMouseleave, true);
  7311. Module["canvas"].width = Module["canvas"].height = 1;
  7312. GLFW.windows = null;
  7313. GLFW.active = null;
  7314. }
  7315. function _emscripten_glUniformMatrix2fv(location, count, transpose, value) {
  7316. var view;
  7317. if (4*count <= GL.MINI_TEMP_BUFFER_SIZE) {
  7318. // avoid allocation when uploading few enough uniforms
  7319. view = GL.miniTempBufferViews[4*count-1];
  7320. for (var i = 0; i < 4*count; i += 4) {
  7321. view[i] = HEAPF32[(((value)+(4*i))>>2)];
  7322. view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)];
  7323. view[i+2] = HEAPF32[(((value)+(4*i+8))>>2)];
  7324. view[i+3] = HEAPF32[(((value)+(4*i+12))>>2)];
  7325. }
  7326. } else {
  7327. view = HEAPF32.subarray((value)>>2,(value+count*16)>>2);
  7328. }
  7329. GLctx.uniformMatrix2fv(GL.uniforms[location], !!transpose, view);
  7330. }
  7331. function ___syscall6(which, varargs) {if (ENVIRONMENT_IS_PTHREAD) { return _emscripten_sync_run_in_main_thread_2(138, 6, varargs) }
  7332. SYSCALLS.varargs = varargs;
  7333. try {
  7334. // close
  7335. var stream = SYSCALLS.getStreamFromFD();
  7336. FS.close(stream);
  7337. return 0;
  7338. } catch (e) {
  7339. if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) abort(e);
  7340. return -e.errno;
  7341. }
  7342. }
  7343. function _llvm_stacksave() {
  7344. var self = _llvm_stacksave;
  7345. if (!self.LLVM_SAVEDSTACKS) {
  7346. self.LLVM_SAVEDSTACKS = [];
  7347. }
  7348. self.LLVM_SAVEDSTACKS.push(Runtime.stackSave());
  7349. return self.LLVM_SAVEDSTACKS.length-1;
  7350. }
  7351. function _emscripten_glGetVertexAttribiv(index, pname, params) {
  7352. // N.B. This function may only be called if the vertex attribute was specified using the function glVertexAttrib*f(),
  7353. // otherwise the results are undefined. (GLES3 spec 6.1.12)
  7354. emscriptenWebGLGetVertexAttrib(index, pname, params, 'FloatToInteger');
  7355. }
  7356. function _emscripten_glUniformMatrix4fv(location, count, transpose, value) {
  7357. var view;
  7358. if (16*count <= GL.MINI_TEMP_BUFFER_SIZE) {
  7359. // avoid allocation when uploading few enough uniforms
  7360. view = GL.miniTempBufferViews[16*count-1];
  7361. for (var i = 0; i < 16*count; i += 16) {
  7362. view[i] = HEAPF32[(((value)+(4*i))>>2)];
  7363. view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)];
  7364. view[i+2] = HEAPF32[(((value)+(4*i+8))>>2)];
  7365. view[i+3] = HEAPF32[(((value)+(4*i+12))>>2)];
  7366. view[i+4] = HEAPF32[(((value)+(4*i+16))>>2)];
  7367. view[i+5] = HEAPF32[(((value)+(4*i+20))>>2)];
  7368. view[i+6] = HEAPF32[(((value)+(4*i+24))>>2)];
  7369. view[i+7] = HEAPF32[(((value)+(4*i+28))>>2)];
  7370. view[i+8] = HEAPF32[(((value)+(4*i+32))>>2)];
  7371. view[i+9] = HEAPF32[(((value)+(4*i+36))>>2)];
  7372. view[i+10] = HEAPF32[(((value)+(4*i+40))>>2)];
  7373. view[i+11] = HEAPF32[(((value)+(4*i+44))>>2)];
  7374. view[i+12] = HEAPF32[(((value)+(4*i+48))>>2)];
  7375. view[i+13] = HEAPF32[(((value)+(4*i+52))>>2)];
  7376. view[i+14] = HEAPF32[(((value)+(4*i+56))>>2)];
  7377. view[i+15] = HEAPF32[(((value)+(4*i+60))>>2)];
  7378. }
  7379. } else {
  7380. view = HEAPF32.subarray((value)>>2,(value+count*64)>>2);
  7381. }
  7382. GLctx.uniformMatrix4fv(GL.uniforms[location], !!transpose, view);
  7383. }
  7384. function _emscripten_glDrawArraysInstanced(mode, first, count, primcount) {
  7385. GLctx['drawArraysInstanced'](mode, first, count, primcount);
  7386. }
  7387. function _emscripten_glEnableClientState() {
  7388. Module['printErr']('missing function: emscripten_glEnableClientState'); abort(-1);
  7389. }
  7390. function _emscripten_glGetPointerv() {
  7391. Module['printErr']('missing function: emscripten_glGetPointerv'); abort(-1);
  7392. }
  7393. function ___syscall140(which, varargs) {if (ENVIRONMENT_IS_PTHREAD) { return _emscripten_sync_run_in_main_thread_2(138, 140, varargs) }
  7394. SYSCALLS.varargs = varargs;
  7395. try {
  7396. // llseek
  7397. var stream = SYSCALLS.getStreamFromFD(), offset_high = SYSCALLS.get(), offset_low = SYSCALLS.get(), result = SYSCALLS.get(), whence = SYSCALLS.get();
  7398. var offset = offset_low;
  7399. assert(offset_high === 0);
  7400. FS.llseek(stream, offset, whence);
  7401. HEAP32[((result)>>2)]=stream.position;
  7402. if (stream.getdents && offset === 0 && whence === 0) stream.getdents = null; // reset readdir state
  7403. return 0;
  7404. } catch (e) {
  7405. if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) abort(e);
  7406. return -e.errno;
  7407. }
  7408. }
  7409. function ___syscall146(which, varargs) {if (ENVIRONMENT_IS_PTHREAD) { return _emscripten_sync_run_in_main_thread_2(138, 146, varargs) }
  7410. SYSCALLS.varargs = varargs;
  7411. try {
  7412. // writev
  7413. var stream = SYSCALLS.getStreamFromFD(), iov = SYSCALLS.get(), iovcnt = SYSCALLS.get();
  7414. return SYSCALLS.doWritev(stream, iov, iovcnt);
  7415. } catch (e) {
  7416. if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) abort(e);
  7417. return -e.errno;
  7418. }
  7419. }
  7420. function _emscripten_glUniform1i(location, v0) {
  7421. GLctx.uniform1i(GL.uniforms[location], v0);
  7422. }
  7423. function _emscripten_glStencilMask(x0) { GLctx['stencilMask'](x0) }
  7424. function _emscripten_glStencilFuncSeparate(x0, x1, x2, x3) { GLctx['stencilFuncSeparate'](x0, x1, x2, x3) }
  7425. var _tzname; if (ENVIRONMENT_IS_PTHREAD) _tzname = PthreadWorkerInit._tzname; else PthreadWorkerInit._tzname = _tzname = allocate(8, "i32*", ALLOC_STATIC);
  7426. var _daylight; if (ENVIRONMENT_IS_PTHREAD) _daylight = PthreadWorkerInit._daylight; else PthreadWorkerInit._daylight = _daylight = allocate(1, "i32*", ALLOC_STATIC);
  7427. var _timezone; if (ENVIRONMENT_IS_PTHREAD) _timezone = PthreadWorkerInit._timezone; else PthreadWorkerInit._timezone = _timezone = allocate(1, "i32*", ALLOC_STATIC);function _tzset() {
  7428. if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_0(119);
  7429. // TODO: Use (malleable) environment variables instead of system settings.
  7430. if (_tzset.called) return;
  7431. _tzset.called = true;
  7432. HEAP32[((_timezone)>>2)]=-(new Date()).getTimezoneOffset() * 60;
  7433. var winter = new Date(2000, 0, 1);
  7434. var summer = new Date(2000, 6, 1);
  7435. HEAP32[((_daylight)>>2)]=Number(winter.getTimezoneOffset() != summer.getTimezoneOffset());
  7436. function extractZone(date) {
  7437. var match = date.toTimeString().match(/\(([A-Za-z ]+)\)$/);
  7438. return match ? match[1] : "GMT";
  7439. };
  7440. var winterName = extractZone(winter);
  7441. var summerName = extractZone(summer);
  7442. var winterNamePtr = allocate(intArrayFromString(winterName), 'i8', ALLOC_NORMAL);
  7443. var summerNamePtr = allocate(intArrayFromString(summerName), 'i8', ALLOC_NORMAL);
  7444. if (summer.getTimezoneOffset() < winter.getTimezoneOffset()) {
  7445. // Northern hemisphere
  7446. HEAP32[((_tzname)>>2)]=winterNamePtr;
  7447. HEAP32[(((_tzname)+(4))>>2)]=summerNamePtr;
  7448. } else {
  7449. HEAP32[((_tzname)>>2)]=summerNamePtr;
  7450. HEAP32[(((_tzname)+(4))>>2)]=winterNamePtr;
  7451. }
  7452. }
  7453. Module["_i64Subtract"] = _i64Subtract;
  7454. Module["_i64Add"] = _i64Add;
  7455. function _emscripten_set_touchend_callback(target, userData, useCapture, callbackfunc) {
  7456. JSEvents.registerTouchEventCallback(target, userData, useCapture, callbackfunc, 23, "touchend");
  7457. return 0;
  7458. }
  7459. function _glUseProgram(program) {
  7460. GLctx.useProgram(program ? GL.programs[program] : null);
  7461. }
  7462. function _emscripten_glDisableVertexAttribArray(index) {
  7463. GLctx.disableVertexAttribArray(index);
  7464. }
  7465. function _emscripten_glVertexAttrib1f(x0, x1) { GLctx['vertexAttrib1f'](x0, x1) }
  7466. function _emscripten_glFinish() { GLctx['finish']() }
  7467. function _glDrawArrays(mode, first, count) {
  7468. GLctx.drawArrays(mode, first, count);
  7469. }
  7470. function _emscripten_glDepthFunc(x0) { GLctx['depthFunc'](x0) }
  7471. function _emscripten_get_num_gamepads() {
  7472. // Polling gamepads generates garbage, so don't do it when we know there are no gamepads connected.
  7473. if (!JSEvents.numGamepadsConnected) return 0;
  7474. __emscripten_sample_gamepad_data();
  7475. if (!JSEvents.lastGamepadState) return -1;
  7476. return JSEvents.lastGamepadState.length;
  7477. }
  7478. function _sysconf(name) {
  7479. if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_1(72, name);
  7480. // long sysconf(int name);
  7481. // http://pubs.opengroup.org/onlinepubs/009695399/functions/sysconf.html
  7482. switch(name) {
  7483. case 30: return PAGE_SIZE;
  7484. case 85:
  7485. var maxHeapSize = 2*1024*1024*1024 - 16777216;
  7486. maxHeapSize = HEAPU8.length;
  7487. return maxHeapSize / PAGE_SIZE;
  7488. case 132:
  7489. case 133:
  7490. case 12:
  7491. case 137:
  7492. case 138:
  7493. case 15:
  7494. case 235:
  7495. case 16:
  7496. case 17:
  7497. case 18:
  7498. case 19:
  7499. case 20:
  7500. case 149:
  7501. case 13:
  7502. case 10:
  7503. case 236:
  7504. case 153:
  7505. case 9:
  7506. case 21:
  7507. case 22:
  7508. case 159:
  7509. case 154:
  7510. case 14:
  7511. case 77:
  7512. case 78:
  7513. case 139:
  7514. case 80:
  7515. case 81:
  7516. case 82:
  7517. case 68:
  7518. case 67:
  7519. case 164:
  7520. case 11:
  7521. case 29:
  7522. case 47:
  7523. case 48:
  7524. case 95:
  7525. case 52:
  7526. case 51:
  7527. case 46:
  7528. return 200809;
  7529. case 79:
  7530. return 0;
  7531. case 27:
  7532. case 246:
  7533. case 127:
  7534. case 128:
  7535. case 23:
  7536. case 24:
  7537. case 160:
  7538. case 161:
  7539. case 181:
  7540. case 182:
  7541. case 242:
  7542. case 183:
  7543. case 184:
  7544. case 243:
  7545. case 244:
  7546. case 245:
  7547. case 165:
  7548. case 178:
  7549. case 179:
  7550. case 49:
  7551. case 50:
  7552. case 168:
  7553. case 169:
  7554. case 175:
  7555. case 170:
  7556. case 171:
  7557. case 172:
  7558. case 97:
  7559. case 76:
  7560. case 32:
  7561. case 173:
  7562. case 35:
  7563. return -1;
  7564. case 176:
  7565. case 177:
  7566. case 7:
  7567. case 155:
  7568. case 8:
  7569. case 157:
  7570. case 125:
  7571. case 126:
  7572. case 92:
  7573. case 93:
  7574. case 129:
  7575. case 130:
  7576. case 131:
  7577. case 94:
  7578. case 91:
  7579. return 1;
  7580. case 74:
  7581. case 60:
  7582. case 69:
  7583. case 70:
  7584. case 4:
  7585. return 1024;
  7586. case 31:
  7587. case 42:
  7588. case 72:
  7589. return 32;
  7590. case 87:
  7591. case 26:
  7592. case 33:
  7593. return 2147483647;
  7594. case 34:
  7595. case 1:
  7596. return 47839;
  7597. case 38:
  7598. case 36:
  7599. return 99;
  7600. case 43:
  7601. case 37:
  7602. return 2048;
  7603. case 0: return 2097152;
  7604. case 3: return 65536;
  7605. case 28: return 32768;
  7606. case 44: return 32767;
  7607. case 75: return 16384;
  7608. case 39: return 1000;
  7609. case 89: return 700;
  7610. case 71: return 256;
  7611. case 40: return 255;
  7612. case 2: return 100;
  7613. case 180: return 64;
  7614. case 25: return 20;
  7615. case 5: return 16;
  7616. case 6: return 6;
  7617. case 73: return 4;
  7618. case 84: {
  7619. if (typeof navigator === 'object') return navigator['hardwareConcurrency'] || 1;
  7620. return 1;
  7621. }
  7622. }
  7623. ___setErrNo(ERRNO_CODES.EINVAL);
  7624. return -1;
  7625. }
  7626. function _emscripten_glUniform4iv(location, count, value) {
  7627. GLctx.uniform4iv(GL.uniforms[location], HEAP32.subarray((value)>>2,(value+count*16)>>2));
  7628. }
  7629. function _glClear(x0) { GLctx['clear'](x0) }
  7630. function _emscripten_glLoadIdentity(){ throw 'Legacy GL function (glLoadIdentity) called. If you want legacy GL emulation, you need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; }
  7631. function _emscripten_glUniform3fv(location, count, value) {
  7632. var view;
  7633. if (3*count <= GL.MINI_TEMP_BUFFER_SIZE) {
  7634. // avoid allocation when uploading few enough uniforms
  7635. view = GL.miniTempBufferViews[3*count-1];
  7636. for (var i = 0; i < 3*count; i += 3) {
  7637. view[i] = HEAPF32[(((value)+(4*i))>>2)];
  7638. view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)];
  7639. view[i+2] = HEAPF32[(((value)+(4*i+8))>>2)];
  7640. }
  7641. } else {
  7642. view = HEAPF32.subarray((value)>>2,(value+count*12)>>2);
  7643. }
  7644. GLctx.uniform3fv(GL.uniforms[location], view);
  7645. }
  7646. function _emscripten_glIsTexture(texture) {
  7647. var texture = GL.textures[texture];
  7648. if (!texture) return 0;
  7649. return GLctx.isTexture(texture);
  7650. }
  7651. function _glEnableVertexAttribArray(index) {
  7652. GLctx.enableVertexAttribArray(index);
  7653. }
  7654. function _emscripten_glAttachShader(program, shader) {
  7655. GLctx.attachShader(GL.programs[program],
  7656. GL.shaders[shader]);
  7657. }
  7658. function _glUniform4f(location, v0, v1, v2, v3) {
  7659. GLctx.uniform4f(GL.uniforms[location], v0, v1, v2, v3);
  7660. }
  7661. function _emscripten_request_pointerlock(target, deferUntilInEventHandler) {
  7662. if (!target) target = '#canvas';
  7663. target = JSEvents.findEventTarget(target);
  7664. if (!target) return -4;
  7665. if (!target.requestPointerLock && !target.mozRequestPointerLock && !target.webkitRequestPointerLock && !target.msRequestPointerLock) {
  7666. return -1;
  7667. }
  7668. var canPerformRequests = JSEvents.canPerformEventHandlerRequests();
  7669. // Queue this function call if we're not currently in an event handler and the user saw it appropriate to do so.
  7670. if (!canPerformRequests) {
  7671. if (deferUntilInEventHandler) {
  7672. JSEvents.deferCall(JSEvents.requestPointerLock, 2 /* priority below fullscreen */, [target]);
  7673. return 1;
  7674. } else {
  7675. return -2;
  7676. }
  7677. }
  7678. return JSEvents.requestPointerLock(target);
  7679. }
  7680. function _emscripten_glVertexAttrib2f(x0, x1, x2) { GLctx['vertexAttrib2f'](x0, x1, x2) }
  7681. function _glfwCreateWindow(width, height, title, monitor, share) {
  7682. return GLFW.createWindow(width, height, title, monitor, share);
  7683. }
  7684. function _glfwDefaultWindowHints() {
  7685. GLFW.hints = GLFW.defaultHints;
  7686. }
  7687. function _gettimeofday(ptr) {
  7688. var now = Date.now();
  7689. HEAP32[((ptr)>>2)]=(now/1000)|0; // seconds
  7690. HEAP32[(((ptr)+(4))>>2)]=((now % 1000)*1000)|0; // microseconds
  7691. return 0;
  7692. }
  7693. function _emscripten_glClearStencil(x0) { GLctx['clearStencil'](x0) }
  7694. function _emscripten_glDetachShader(program, shader) {
  7695. GLctx.detachShader(GL.programs[program],
  7696. GL.shaders[shader]);
  7697. }
  7698. function _emscripten_glDeleteVertexArrays(n, vaos) {
  7699. for (var i = 0; i < n; i++) {
  7700. var id = HEAP32[(((vaos)+(i*4))>>2)];
  7701. GLctx['deleteVertexArray'](GL.vaos[id]);
  7702. GL.vaos[id] = null;
  7703. }
  7704. }
  7705. function _glfwInit() {
  7706. if (GLFW.windows) return 1; // GL_TRUE
  7707. GLFW.initialTime = GLFW.getTime();
  7708. GLFW.hints = GLFW.defaultHints;
  7709. GLFW.windows = new Array()
  7710. GLFW.active = null;
  7711. window.addEventListener("keydown", GLFW.onKeydown, true);
  7712. window.addEventListener("keypress", GLFW.onKeyPress, true);
  7713. window.addEventListener("keyup", GLFW.onKeyup, true);
  7714. Module["canvas"].addEventListener("mousemove", GLFW.onMousemove, true);
  7715. Module["canvas"].addEventListener("mousedown", GLFW.onMouseButtonDown, true);
  7716. Module["canvas"].addEventListener("mouseup", GLFW.onMouseButtonUp, true);
  7717. Module["canvas"].addEventListener('wheel', GLFW.onMouseWheel, true);
  7718. Module["canvas"].addEventListener('mousewheel', GLFW.onMouseWheel, true);
  7719. Module["canvas"].addEventListener('mouseenter', GLFW.onMouseenter, true);
  7720. Module["canvas"].addEventListener('mouseleave', GLFW.onMouseleave, true);
  7721. Browser.resizeListeners.push(function(width, height) {
  7722. GLFW.onCanvasResize(width, height);
  7723. });
  7724. return 1; // GL_TRUE
  7725. }
  7726. function _emscripten_glGetTexParameteriv(target, pname, params) {
  7727. if (!params) {
  7728. // GLES2 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense
  7729. // if p == null, issue a GL error to notify user about it.
  7730. GL.recordError(0x0501 /* GL_INVALID_VALUE */);
  7731. return;
  7732. }
  7733. HEAP32[((params)>>2)]=GLctx.getTexParameter(target, pname);
  7734. }
  7735. function _glfwSwapBuffers(winid) {
  7736. GLFW.swapBuffers(winid);
  7737. }
  7738. function _emscripten_glGenerateMipmap(x0) { GLctx['generateMipmap'](x0) }
  7739. var _environ; if (ENVIRONMENT_IS_PTHREAD) _environ = PthreadWorkerInit._environ; else PthreadWorkerInit._environ = _environ = allocate(1, "i32*", ALLOC_STATIC);var ___environ=_environ;function ___buildEnvironment(env) {
  7740. // WARNING: Arbitrary limit!
  7741. var MAX_ENV_VALUES = 64;
  7742. var TOTAL_ENV_SIZE = 1024;
  7743. // Statically allocate memory for the environment.
  7744. var poolPtr;
  7745. var envPtr;
  7746. if (!___buildEnvironment.called) {
  7747. ___buildEnvironment.called = true;
  7748. // Set default values. Use string keys for Closure Compiler compatibility.
  7749. ENV['USER'] = ENV['LOGNAME'] = 'web_user';
  7750. ENV['PATH'] = '/';
  7751. ENV['PWD'] = '/';
  7752. ENV['HOME'] = '/home/web_user';
  7753. ENV['LANG'] = 'C';
  7754. ENV['_'] = Module['thisProgram'];
  7755. // Allocate memory.
  7756. poolPtr = allocate(TOTAL_ENV_SIZE, 'i8', ALLOC_STATIC);
  7757. envPtr = allocate(MAX_ENV_VALUES * 4,
  7758. 'i8*', ALLOC_STATIC);
  7759. HEAP32[((envPtr)>>2)]=poolPtr;
  7760. HEAP32[((_environ)>>2)]=envPtr;
  7761. } else {
  7762. envPtr = HEAP32[((_environ)>>2)];
  7763. poolPtr = HEAP32[((envPtr)>>2)];
  7764. }
  7765. // Collect key=value lines.
  7766. var strings = [];
  7767. var totalSize = 0;
  7768. for (var key in env) {
  7769. if (typeof env[key] === 'string') {
  7770. var line = key + '=' + env[key];
  7771. strings.push(line);
  7772. totalSize += line.length;
  7773. }
  7774. }
  7775. if (totalSize > TOTAL_ENV_SIZE) {
  7776. throw new Error('Environment size exceeded TOTAL_ENV_SIZE!');
  7777. }
  7778. // Make new.
  7779. var ptrSize = 4;
  7780. for (var i = 0; i < strings.length; i++) {
  7781. var line = strings[i];
  7782. writeAsciiToMemory(line, poolPtr);
  7783. HEAP32[(((envPtr)+(i * ptrSize))>>2)]=poolPtr;
  7784. poolPtr += line.length + 1;
  7785. }
  7786. HEAP32[(((envPtr)+(strings.length * ptrSize))>>2)]=0;
  7787. }var ENV={};function _clearenv(name) {
  7788. if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_1(112, name);
  7789. // int clearenv (void);
  7790. // http://www.gnu.org/s/hello/manual/libc/Environment-Access.html#index-clearenv-3107
  7791. ENV = {};
  7792. ___buildEnvironment(ENV);
  7793. return 0;
  7794. }
  7795. function _emscripten_glCullFace(x0) { GLctx['cullFace'](x0) }
  7796. function _emscripten_glUniform4f(location, v0, v1, v2, v3) {
  7797. GLctx.uniform4f(GL.uniforms[location], v0, v1, v2, v3);
  7798. }
  7799. function _glDisableVertexAttribArray(index) {
  7800. GLctx.disableVertexAttribArray(index);
  7801. }
  7802. function _emscripten_glUseProgram(program) {
  7803. GLctx.useProgram(program ? GL.programs[program] : null);
  7804. }
  7805. function _emscripten_glHint(x0, x1) { GLctx['hint'](x0, x1) }
  7806. function _emscripten_glUniform2fv(location, count, value) {
  7807. var view;
  7808. if (2*count <= GL.MINI_TEMP_BUFFER_SIZE) {
  7809. // avoid allocation when uploading few enough uniforms
  7810. view = GL.miniTempBufferViews[2*count-1];
  7811. for (var i = 0; i < 2*count; i += 2) {
  7812. view[i] = HEAPF32[(((value)+(4*i))>>2)];
  7813. view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)];
  7814. }
  7815. } else {
  7816. view = HEAPF32.subarray((value)>>2,(value+count*8)>>2);
  7817. }
  7818. GLctx.uniform2fv(GL.uniforms[location], view);
  7819. }
  7820. function _glfwSwapInterval(interval) {
  7821. interval = Math.abs(interval); // GLFW uses negative values to enable GLX_EXT_swap_control_tear, which we don't have, so just treat negative and positive the same.
  7822. if (interval == 0) _emscripten_set_main_loop_timing(0/*EM_TIMING_SETTIMEOUT*/, 0);
  7823. else _emscripten_set_main_loop_timing(1/*EM_TIMING_RAF*/, interval);
  7824. }
  7825. function _glGetShaderInfoLog(shader, maxLength, length, infoLog) {
  7826. var log = GLctx.getShaderInfoLog(GL.shaders[shader]);
  7827. if (log === null) log = '(unknown error)';
  7828. if (maxLength > 0 && infoLog) {
  7829. var numBytesWrittenExclNull = stringToUTF8(log, infoLog, maxLength);
  7830. if (length) HEAP32[((length)>>2)]=numBytesWrittenExclNull;
  7831. } else {
  7832. if (length) HEAP32[((length)>>2)]=0;
  7833. }
  7834. }
  7835. function _emscripten_glMatrixMode(){ throw 'Legacy GL function (glMatrixMode) called. If you want legacy GL emulation, you need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; }
  7836. function _abort() {
  7837. Module['abort']();
  7838. }
  7839. function _emscripten_glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer) {
  7840. GLctx.framebufferRenderbuffer(target, attachment, renderbuffertarget,
  7841. GL.renderbuffers[renderbuffer]);
  7842. }
  7843. function _emscripten_glDeleteFramebuffers(n, framebuffers) {
  7844. for (var i = 0; i < n; ++i) {
  7845. var id = HEAP32[(((framebuffers)+(i*4))>>2)];
  7846. var framebuffer = GL.framebuffers[id];
  7847. if (!framebuffer) continue; // GL spec: "glDeleteFramebuffers silently ignores 0s and names that do not correspond to existing framebuffer objects".
  7848. GLctx.deleteFramebuffer(framebuffer);
  7849. framebuffer.name = 0;
  7850. GL.framebuffers[id] = null;
  7851. }
  7852. }
  7853. function _emscripten_glIsBuffer(buffer) {
  7854. var b = GL.buffers[buffer];
  7855. if (!b) return 0;
  7856. return GLctx.isBuffer(b);
  7857. }
  7858. function _emscripten_glUniform2iv(location, count, value) {
  7859. GLctx.uniform2iv(GL.uniforms[location], HEAP32.subarray((value)>>2,(value+count*8)>>2));
  7860. }
  7861. var _emscripten_asm_const=true;
  7862. function _chroot(path) {
  7863. if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_1(37, path);
  7864. // int chroot(const char *path);
  7865. // http://pubs.opengroup.org/onlinepubs/7908799/xsh/chroot.html
  7866. ___setErrNo(ERRNO_CODES.EACCES);
  7867. return -1;
  7868. }
  7869. function _glEnable(x0) { GLctx['enable'](x0) }
  7870. function emscriptenWebGLComputeImageSize(width, height, sizePerPixel, alignment) {
  7871. function roundedToNextMultipleOf(x, y) {
  7872. return Math.floor((x + y - 1) / y) * y
  7873. }
  7874. var plainRowSize = width * sizePerPixel;
  7875. var alignedRowSize = roundedToNextMultipleOf(plainRowSize, alignment);
  7876. return (height <= 0) ? 0 :
  7877. ((height - 1) * alignedRowSize + plainRowSize);
  7878. }function emscriptenWebGLGetTexPixelData(type, format, width, height, pixels, internalFormat) {
  7879. var sizePerPixel;
  7880. var numChannels;
  7881. switch(format) {
  7882. case 0x1906 /* GL_ALPHA */:
  7883. case 0x1909 /* GL_LUMINANCE */:
  7884. case 0x1902 /* GL_DEPTH_COMPONENT */:
  7885. numChannels = 1;
  7886. break;
  7887. case 0x190A /* GL_LUMINANCE_ALPHA */:
  7888. numChannels = 2;
  7889. break;
  7890. case 0x1907 /* GL_RGB */:
  7891. case 0x8C40 /* GL_SRGB_EXT */:
  7892. numChannels = 3;
  7893. break;
  7894. case 0x1908 /* GL_RGBA */:
  7895. case 0x8C42 /* GL_SRGB_ALPHA_EXT */:
  7896. numChannels = 4;
  7897. break;
  7898. default:
  7899. GL.recordError(0x0500); // GL_INVALID_ENUM
  7900. return null;
  7901. }
  7902. switch (type) {
  7903. case 0x1401 /* GL_UNSIGNED_BYTE */:
  7904. sizePerPixel = numChannels*1;
  7905. break;
  7906. case 0x1403 /* GL_UNSIGNED_SHORT */:
  7907. case 0x8D61 /* GL_HALF_FLOAT_OES */:
  7908. sizePerPixel = numChannels*2;
  7909. break;
  7910. case 0x1405 /* GL_UNSIGNED_INT */:
  7911. case 0x1406 /* GL_FLOAT */:
  7912. sizePerPixel = numChannels*4;
  7913. break;
  7914. case 0x84FA /* GL_UNSIGNED_INT_24_8_WEBGL/GL_UNSIGNED_INT_24_8 */:
  7915. sizePerPixel = 4;
  7916. break;
  7917. case 0x8363 /* GL_UNSIGNED_SHORT_5_6_5 */:
  7918. case 0x8033 /* GL_UNSIGNED_SHORT_4_4_4_4 */:
  7919. case 0x8034 /* GL_UNSIGNED_SHORT_5_5_5_1 */:
  7920. sizePerPixel = 2;
  7921. break;
  7922. default:
  7923. GL.recordError(0x0500); // GL_INVALID_ENUM
  7924. return null;
  7925. }
  7926. var bytes = emscriptenWebGLComputeImageSize(width, height, sizePerPixel, GL.unpackAlignment);
  7927. switch(type) {
  7928. case 0x1401 /* GL_UNSIGNED_BYTE */:
  7929. return HEAPU8.subarray((pixels),(pixels+bytes));
  7930. case 0x1406 /* GL_FLOAT */:
  7931. return HEAPF32.subarray((pixels)>>2,(pixels+bytes)>>2);
  7932. case 0x1405 /* GL_UNSIGNED_INT */:
  7933. case 0x84FA /* GL_UNSIGNED_INT_24_8_WEBGL/GL_UNSIGNED_INT_24_8 */:
  7934. return HEAPU32.subarray((pixels)>>2,(pixels+bytes)>>2);
  7935. case 0x1403 /* GL_UNSIGNED_SHORT */:
  7936. case 0x8363 /* GL_UNSIGNED_SHORT_5_6_5 */:
  7937. case 0x8033 /* GL_UNSIGNED_SHORT_4_4_4_4 */:
  7938. case 0x8034 /* GL_UNSIGNED_SHORT_5_5_5_1 */:
  7939. case 0x8D61 /* GL_HALF_FLOAT_OES */:
  7940. return HEAPU16.subarray((pixels)>>1,(pixels+bytes)>>1);
  7941. default:
  7942. GL.recordError(0x0500); // GL_INVALID_ENUM
  7943. return null;
  7944. }
  7945. }function _emscripten_glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels) {
  7946. var pixelData = null;
  7947. if (pixels) pixelData = emscriptenWebGLGetTexPixelData(type, format, width, height, pixels, 0);
  7948. GLctx.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixelData);
  7949. }
  7950. function _emscripten_glPolygonOffset(x0, x1) { GLctx['polygonOffset'](x0, x1) }
  7951. var _emscripten_asm_const_int=true;
  7952. function _emscripten_glUniform2f(location, v0, v1) {
  7953. GLctx.uniform2f(GL.uniforms[location], v0, v1);
  7954. }
  7955. function _glGetAttribLocation(program, name) {
  7956. program = GL.programs[program];
  7957. name = Pointer_stringify(name);
  7958. return GLctx.getAttribLocation(program, name);
  7959. }
  7960. function _glfwWindowHint(target, hint) {
  7961. GLFW.hints[target] = hint;
  7962. }
  7963. function _emscripten_glUniform2i(location, v0, v1) {
  7964. GLctx.uniform2i(GL.uniforms[location], v0, v1);
  7965. }
  7966. function _glBlendFunc(x0, x1) { GLctx['blendFunc'](x0, x1) }
  7967. function _glCreateProgram() {
  7968. var id = GL.getNewId(GL.programs);
  7969. var program = GLctx.createProgram();
  7970. program.name = id;
  7971. GL.programs[id] = program;
  7972. return id;
  7973. }
  7974. function _emscripten_glDeleteRenderbuffers(n, renderbuffers) {
  7975. for (var i = 0; i < n; i++) {
  7976. var id = HEAP32[(((renderbuffers)+(i*4))>>2)];
  7977. var renderbuffer = GL.renderbuffers[id];
  7978. if (!renderbuffer) continue; // GL spec: "glDeleteRenderbuffers silently ignores 0s and names that do not correspond to existing renderbuffer objects".
  7979. GLctx.deleteRenderbuffer(renderbuffer);
  7980. renderbuffer.name = 0;
  7981. GL.renderbuffers[id] = null;
  7982. }
  7983. }
  7984. function _emscripten_glGetBufferParameteriv(target, value, data) {
  7985. if (!data) {
  7986. // GLES2 specification does not specify how to behave if data is a null pointer. Since calling this function does not make sense
  7987. // if data == null, issue a GL error to notify user about it.
  7988. GL.recordError(0x0501 /* GL_INVALID_VALUE */);
  7989. return;
  7990. }
  7991. HEAP32[((data)>>2)]=GLctx.getBufferParameter(target, value);
  7992. }
  7993. function emscriptenWebGLGetUniform(program, location, params, type) {
  7994. if (!params) {
  7995. // GLES2 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense
  7996. // if params == null, issue a GL error to notify user about it.
  7997. GL.recordError(0x0501 /* GL_INVALID_VALUE */);
  7998. return;
  7999. }
  8000. var data = GLctx.getUniform(GL.programs[program], GL.uniforms[location]);
  8001. if (typeof data == 'number' || typeof data == 'boolean') {
  8002. switch (type) {
  8003. case 'Integer': HEAP32[((params)>>2)]=data; break;
  8004. case 'Float': HEAPF32[((params)>>2)]=data; break;
  8005. default: throw 'internal emscriptenWebGLGetUniform() error, bad type: ' + type;
  8006. }
  8007. } else {
  8008. for (var i = 0; i < data.length; i++) {
  8009. switch (type) {
  8010. case 'Integer': HEAP32[(((params)+(i))>>2)]=data[i]; break;
  8011. case 'Float': HEAPF32[(((params)+(i))>>2)]=data[i]; break;
  8012. default: throw 'internal emscriptenWebGLGetUniform() error, bad type: ' + type;
  8013. }
  8014. }
  8015. }
  8016. }function _emscripten_glGetUniformiv(program, location, params) {
  8017. emscriptenWebGLGetUniform(program, location, params, 'Integer');
  8018. }
  8019. function _unsetenv(name) {
  8020. if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_1(114, name);
  8021. // int unsetenv(const char *name);
  8022. // http://pubs.opengroup.org/onlinepubs/009695399/functions/unsetenv.html
  8023. if (name === 0) {
  8024. ___setErrNo(ERRNO_CODES.EINVAL);
  8025. return -1;
  8026. }
  8027. name = Pointer_stringify(name);
  8028. if (name === '' || name.indexOf('=') !== -1) {
  8029. ___setErrNo(ERRNO_CODES.EINVAL);
  8030. return -1;
  8031. }
  8032. if (ENV.hasOwnProperty(name)) {
  8033. delete ENV[name];
  8034. ___buildEnvironment(ENV);
  8035. }
  8036. return 0;
  8037. }
  8038. function _emscripten_glDepthMask(flag) {
  8039. GLctx.depthMask(!!flag);
  8040. }
  8041. function _emscripten_glDepthRangef(x0, x1) { GLctx['depthRange'](x0, x1) }
  8042. function _emscripten_get_now_is_monotonic() {
  8043. // return whether emscripten_get_now is guaranteed monotonic; the Date.now
  8044. // implementation is not :(
  8045. return ENVIRONMENT_IS_NODE || (typeof dateNow !== 'undefined') ||
  8046. ((ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && self['performance'] && self['performance']['now']);
  8047. }function _clock_gettime(clk_id, tp) {
  8048. // int clock_gettime(clockid_t clk_id, struct timespec *tp);
  8049. var now;
  8050. if (clk_id === 0) {
  8051. now = Date.now();
  8052. } else if (clk_id === 1 && _emscripten_get_now_is_monotonic()) {
  8053. now = _emscripten_get_now();
  8054. } else {
  8055. ___setErrNo(ERRNO_CODES.EINVAL);
  8056. return -1;
  8057. }
  8058. HEAP32[((tp)>>2)]=(now/1000)|0; // seconds
  8059. HEAP32[(((tp)+(4))>>2)]=((now % 1000)*1000*1000)|0; // nanoseconds
  8060. return 0;
  8061. }function ___clock_gettime() {
  8062. return _clock_gettime.apply(null, arguments)
  8063. }
  8064. function _emscripten_set_fullscreenchange_callback(target, userData, useCapture, callbackfunc) {
  8065. if (typeof JSEvents.fullscreenEnabled() === 'undefined') return -1;
  8066. if (!target) target = document;
  8067. else {
  8068. target = JSEvents.findEventTarget(target);
  8069. if (!target) return -4;
  8070. }
  8071. JSEvents.registerFullscreenChangeEventCallback(target, userData, useCapture, callbackfunc, 19, "fullscreenchange");
  8072. JSEvents.registerFullscreenChangeEventCallback(target, userData, useCapture, callbackfunc, 19, "mozfullscreenchange");
  8073. JSEvents.registerFullscreenChangeEventCallback(target, userData, useCapture, callbackfunc, 19, "webkitfullscreenchange");
  8074. JSEvents.registerFullscreenChangeEventCallback(target, userData, useCapture, callbackfunc, 19, "msfullscreenchange");
  8075. return 0;
  8076. }
  8077. function _emscripten_glVertexAttrib1fv(index, v) {
  8078. GLctx.vertexAttrib1f(index, HEAPF32[v>>2]);
  8079. }
  8080. function __cleanup_thread(pthread_ptr) {
  8081. if (ENVIRONMENT_IS_PTHREAD) throw 'Internal Error! _cleanup_thread() can only ever be called from main application thread!';
  8082. if (!pthread_ptr) throw 'Internal Error! Null pthread_ptr in _cleanup_thread!';
  8083. HEAP32[(((pthread_ptr)+(24))>>2)]=0;
  8084. var pthread = PThread.pthreads[pthread_ptr];
  8085. var worker = pthread.worker;
  8086. PThread.freeThreadData(pthread);
  8087. worker.pthread = undefined; // Detach the worker from the pthread object, and return it to the worker pool as an unused worker.
  8088. PThread.unusedWorkerPool.push(worker);
  8089. PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker.pthread), 1); // Not a running Worker anymore.
  8090. }
  8091. function __pthread_testcancel_js() {
  8092. if (!ENVIRONMENT_IS_PTHREAD) return;
  8093. if (!threadInfoStruct) return;
  8094. var cancelDisabled = Atomics.load(HEAPU32, (threadInfoStruct + 72 ) >> 2);
  8095. if (cancelDisabled) return;
  8096. var canceled = Atomics.load(HEAPU32, (threadInfoStruct + 0 ) >> 2);
  8097. if (canceled == 2) throw 'Canceled!';
  8098. }function _pthread_join(thread, status) {
  8099. if (!thread) {
  8100. Module['printErr']('pthread_join attempted on a null thread pointer!');
  8101. return ERRNO_CODES.ESRCH;
  8102. }
  8103. if (ENVIRONMENT_IS_PTHREAD && selfThreadId == thread) {
  8104. Module['printErr']('PThread ' + thread + ' is attempting to join to itself!');
  8105. return ERRNO_CODES.EDEADLK;
  8106. }
  8107. else if (!ENVIRONMENT_IS_PTHREAD && PThread.mainThreadBlock == thread) {
  8108. Module['printErr']('Main thread ' + thread + ' is attempting to join to itself!');
  8109. return ERRNO_CODES.EDEADLK;
  8110. }
  8111. var self = HEAP32[(((thread)+(24))>>2)];
  8112. if (self != thread) {
  8113. Module['printErr']('pthread_join attempted on thread ' + thread + ', which does not point to a valid thread, or does not exist anymore!');
  8114. return ERRNO_CODES.ESRCH;
  8115. }
  8116. var detached = Atomics.load(HEAPU32, (thread + 80 ) >> 2);
  8117. if (detached) {
  8118. Module['printErr']('Attempted to join thread ' + thread + ', which was already detached!');
  8119. return ERRNO_CODES.EINVAL; // The thread is already detached, can no longer join it!
  8120. }
  8121. for (;;) {
  8122. var threadStatus = Atomics.load(HEAPU32, (thread + 0 ) >> 2);
  8123. if (threadStatus == 1) { // Exited?
  8124. var threadExitCode = Atomics.load(HEAPU32, (thread + 4 ) >> 2);
  8125. if (status) HEAP32[((status)>>2)]=threadExitCode;
  8126. Atomics.store(HEAPU32, (thread + 80 ) >> 2, 1); // Mark the thread as detached.
  8127. if (!ENVIRONMENT_IS_PTHREAD) __cleanup_thread(thread);
  8128. else postMessage({ cmd: 'cleanupThread', thread: thread});
  8129. return 0;
  8130. }
  8131. // TODO HACK! Replace the _js variant with just _pthread_testcancel:
  8132. //_pthread_testcancel();
  8133. __pthread_testcancel_js();
  8134. // In main runtime thread (the thread that initialized the Emscripten C runtime and launched main()), assist pthreads in performing operations
  8135. // that they need to access the Emscripten main runtime for.
  8136. if (!ENVIRONMENT_IS_PTHREAD) _emscripten_main_thread_process_queued_calls();
  8137. _emscripten_futex_wait(thread + 0, threadStatus, ENVIRONMENT_IS_PTHREAD ? 100 : 1);
  8138. }
  8139. }
  8140. Module["___muldsi3"] = ___muldsi3;
  8141. Module["___muldi3"] = ___muldi3;
  8142. function _emscripten_glGetShaderPrecisionFormat(shaderType, precisionType, range, precision) {
  8143. var result = GLctx.getShaderPrecisionFormat(shaderType, precisionType);
  8144. HEAP32[((range)>>2)]=result.rangeMin;
  8145. HEAP32[(((range)+(4))>>2)]=result.rangeMax;
  8146. HEAP32[((precision)>>2)]=result.precision;
  8147. }
  8148. function _emscripten_glUniform1fv(location, count, value) {
  8149. var view;
  8150. if (count <= GL.MINI_TEMP_BUFFER_SIZE) {
  8151. // avoid allocation when uploading few enough uniforms
  8152. view = GL.miniTempBufferViews[count-1];
  8153. for (var i = 0; i < count; ++i) {
  8154. view[i] = HEAPF32[(((value)+(4*i))>>2)];
  8155. }
  8156. } else {
  8157. view = HEAPF32.subarray((value)>>2,(value+count*4)>>2);
  8158. }
  8159. GLctx.uniform1fv(GL.uniforms[location], view);
  8160. }
  8161. function _glDeleteBuffers(n, buffers) {
  8162. for (var i = 0; i < n; i++) {
  8163. var id = HEAP32[(((buffers)+(i*4))>>2)];
  8164. var buffer = GL.buffers[id];
  8165. // From spec: "glDeleteBuffers silently ignores 0's and names that do not
  8166. // correspond to existing buffer objects."
  8167. if (!buffer) continue;
  8168. GLctx.deleteBuffer(buffer);
  8169. buffer.name = 0;
  8170. GL.buffers[id] = null;
  8171. if (id == GL.currArrayBuffer) GL.currArrayBuffer = 0;
  8172. if (id == GL.currElementArrayBuffer) GL.currElementArrayBuffer = 0;
  8173. }
  8174. }
  8175. function _emscripten_set_gamepaddisconnected_callback(userData, useCapture, callbackfunc) {
  8176. if (!navigator.getGamepads && !navigator.webkitGetGamepads) return -1;
  8177. JSEvents.registerGamepadEventCallback(window, userData, useCapture, callbackfunc, 27, "gamepaddisconnected");
  8178. return 0;
  8179. }
  8180. function _emscripten_glBindProgramARB() {
  8181. Module['printErr']('missing function: emscripten_glBindProgramARB'); abort(-1);
  8182. }
  8183. function _emscripten_glBindTexture(target, texture) {
  8184. GLctx.bindTexture(target, texture ? GL.textures[texture] : null);
  8185. }
  8186. function _emscripten_glCheckFramebufferStatus(x0) { return GLctx['checkFramebufferStatus'](x0) }
  8187. function _emscripten_glDeleteProgram(id) {
  8188. if (!id) return;
  8189. var program = GL.programs[id];
  8190. if (!program) { // glDeleteProgram actually signals an error when deleting a nonexisting object, unlike some other GL delete functions.
  8191. GL.recordError(0x0501 /* GL_INVALID_VALUE */);
  8192. return;
  8193. }
  8194. GLctx.deleteProgram(program);
  8195. program.name = 0;
  8196. GL.programs[id] = null;
  8197. GL.programInfos[id] = null;
  8198. }
  8199. function _emscripten_glDisable(x0) { GLctx['disable'](x0) }
  8200. function _emscripten_glVertexAttrib3fv(index, v) {
  8201. GLctx.vertexAttrib3f(index, HEAPF32[v>>2], HEAPF32[v+4>>2], HEAPF32[v+8>>2]);
  8202. }
  8203. function _glClearColor(x0, x1, x2, x3) { GLctx['clearColor'](x0, x1, x2, x3) }
  8204. function _emscripten_glGetActiveAttrib(program, index, bufSize, length, size, type, name) {
  8205. program = GL.programs[program];
  8206. var info = GLctx.getActiveAttrib(program, index);
  8207. if (!info) return; // If an error occurs, nothing will be written to length, size and type and name.
  8208. if (bufSize > 0 && name) {
  8209. var numBytesWrittenExclNull = stringToUTF8(info.name, name, bufSize);
  8210. if (length) HEAP32[((length)>>2)]=numBytesWrittenExclNull;
  8211. } else {
  8212. if (length) HEAP32[((length)>>2)]=0;
  8213. }
  8214. if (size) HEAP32[((size)>>2)]=info.size;
  8215. if (type) HEAP32[((type)>>2)]=info.type;
  8216. }
  8217. function _emscripten_glIsFramebuffer(framebuffer) {
  8218. var fb = GL.framebuffers[framebuffer];
  8219. if (!fb) return 0;
  8220. return GLctx.isFramebuffer(fb);
  8221. }
  8222. function _emscripten_glLineWidth(x0) { GLctx['lineWidth'](x0) }
  8223. function _glfwGetCursorPos(winid, x, y) {
  8224. GLFW.getCursorPos(winid, x, y);
  8225. }
  8226. function _emscripten_glGetString(name_) {
  8227. if (GL.stringCache[name_]) return GL.stringCache[name_];
  8228. var ret;
  8229. switch(name_) {
  8230. case 0x1F00 /* GL_VENDOR */:
  8231. case 0x1F01 /* GL_RENDERER */:
  8232. case 0x9245 /* UNMASKED_VENDOR_WEBGL */:
  8233. case 0x9246 /* UNMASKED_RENDERER_WEBGL */:
  8234. ret = allocate(intArrayFromString(GLctx.getParameter(name_)), 'i8', ALLOC_NORMAL);
  8235. break;
  8236. case 0x1F02 /* GL_VERSION */:
  8237. var glVersion = GLctx.getParameter(GLctx.VERSION);
  8238. // return GLES version string corresponding to the version of the WebGL context
  8239. {
  8240. glVersion = 'OpenGL ES 2.0 (' + glVersion + ')';
  8241. }
  8242. ret = allocate(intArrayFromString(glVersion), 'i8', ALLOC_NORMAL);
  8243. break;
  8244. case 0x1F03 /* GL_EXTENSIONS */:
  8245. var exts = GLctx.getSupportedExtensions();
  8246. var gl_exts = [];
  8247. for (var i = 0; i < exts.length; ++i) {
  8248. gl_exts.push(exts[i]);
  8249. gl_exts.push("GL_" + exts[i]);
  8250. }
  8251. ret = allocate(intArrayFromString(gl_exts.join(' ')), 'i8', ALLOC_NORMAL);
  8252. break;
  8253. case 0x8B8C /* GL_SHADING_LANGUAGE_VERSION */:
  8254. var glslVersion = GLctx.getParameter(GLctx.SHADING_LANGUAGE_VERSION);
  8255. // extract the version number 'N.M' from the string 'WebGL GLSL ES N.M ...'
  8256. var ver_re = /^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/;
  8257. var ver_num = glslVersion.match(ver_re);
  8258. if (ver_num !== null) {
  8259. if (ver_num[1].length == 3) ver_num[1] = ver_num[1] + '0'; // ensure minor version has 2 digits
  8260. glslVersion = 'OpenGL ES GLSL ES ' + ver_num[1] + ' (' + glslVersion + ')';
  8261. }
  8262. ret = allocate(intArrayFromString(glslVersion), 'i8', ALLOC_NORMAL);
  8263. break;
  8264. default:
  8265. GL.recordError(0x0500/*GL_INVALID_ENUM*/);
  8266. return 0;
  8267. }
  8268. GL.stringCache[name_] = ret;
  8269. return ret;
  8270. }
  8271. function _emscripten_glGetAttribLocation(program, name) {
  8272. program = GL.programs[program];
  8273. name = Pointer_stringify(name);
  8274. return GLctx.getAttribLocation(program, name);
  8275. }
  8276. function _emscripten_glRotatef() {
  8277. Module['printErr']('missing function: emscripten_glRotatef'); abort(-1);
  8278. }
  8279. function emscriptenWebGLGet(name_, p, type) {
  8280. // Guard against user passing a null pointer.
  8281. // Note that GLES2 spec does not say anything about how passing a null pointer should be treated.
  8282. // Testing on desktop core GL 3, the application crashes on glGetIntegerv to a null pointer, but
  8283. // better to report an error instead of doing anything random.
  8284. if (!p) {
  8285. GL.recordError(0x0501 /* GL_INVALID_VALUE */);
  8286. return;
  8287. }
  8288. var ret = undefined;
  8289. switch(name_) { // Handle a few trivial GLES values
  8290. case 0x8DFA: // GL_SHADER_COMPILER
  8291. ret = 1;
  8292. break;
  8293. case 0x8DF8: // GL_SHADER_BINARY_FORMATS
  8294. if (type !== 'Integer' && type !== 'Integer64') {
  8295. GL.recordError(0x0500); // GL_INVALID_ENUM
  8296. }
  8297. return; // Do not write anything to the out pointer, since no binary formats are supported.
  8298. case 0x8DF9: // GL_NUM_SHADER_BINARY_FORMATS
  8299. ret = 0;
  8300. break;
  8301. case 0x86A2: // GL_NUM_COMPRESSED_TEXTURE_FORMATS
  8302. // WebGL doesn't have GL_NUM_COMPRESSED_TEXTURE_FORMATS (it's obsolete since GL_COMPRESSED_TEXTURE_FORMATS returns a JS array that can be queried for length),
  8303. // so implement it ourselves to allow C++ GLES2 code get the length.
  8304. var formats = GLctx.getParameter(0x86A3 /*GL_COMPRESSED_TEXTURE_FORMATS*/);
  8305. ret = formats.length;
  8306. break;
  8307. }
  8308. if (ret === undefined) {
  8309. var result = GLctx.getParameter(name_);
  8310. switch (typeof(result)) {
  8311. case "number":
  8312. ret = result;
  8313. break;
  8314. case "boolean":
  8315. ret = result ? 1 : 0;
  8316. break;
  8317. case "string":
  8318. GL.recordError(0x0500); // GL_INVALID_ENUM
  8319. return;
  8320. case "object":
  8321. if (result === null) {
  8322. // null is a valid result for some (e.g., which buffer is bound - perhaps nothing is bound), but otherwise
  8323. // can mean an invalid name_, which we need to report as an error
  8324. switch(name_) {
  8325. case 0x8894: // ARRAY_BUFFER_BINDING
  8326. case 0x8B8D: // CURRENT_PROGRAM
  8327. case 0x8895: // ELEMENT_ARRAY_BUFFER_BINDING
  8328. case 0x8CA6: // FRAMEBUFFER_BINDING
  8329. case 0x8CA7: // RENDERBUFFER_BINDING
  8330. case 0x8069: // TEXTURE_BINDING_2D
  8331. case 0x8514: { // TEXTURE_BINDING_CUBE_MAP
  8332. ret = 0;
  8333. break;
  8334. }
  8335. default: {
  8336. GL.recordError(0x0500); // GL_INVALID_ENUM
  8337. return;
  8338. }
  8339. }
  8340. } else if (result instanceof Float32Array ||
  8341. result instanceof Uint32Array ||
  8342. result instanceof Int32Array ||
  8343. result instanceof Array) {
  8344. for (var i = 0; i < result.length; ++i) {
  8345. switch (type) {
  8346. case 'Integer': HEAP32[(((p)+(i*4))>>2)]=result[i]; break;
  8347. case 'Float': HEAPF32[(((p)+(i*4))>>2)]=result[i]; break;
  8348. case 'Boolean': HEAP8[(((p)+(i))>>0)]=result[i] ? 1 : 0; break;
  8349. default: throw 'internal glGet error, bad type: ' + type;
  8350. }
  8351. }
  8352. return;
  8353. } else if (result instanceof WebGLBuffer ||
  8354. result instanceof WebGLProgram ||
  8355. result instanceof WebGLFramebuffer ||
  8356. result instanceof WebGLRenderbuffer ||
  8357. result instanceof WebGLTexture) {
  8358. ret = result.name | 0;
  8359. } else {
  8360. GL.recordError(0x0500); // GL_INVALID_ENUM
  8361. return;
  8362. }
  8363. break;
  8364. default:
  8365. GL.recordError(0x0500); // GL_INVALID_ENUM
  8366. return;
  8367. }
  8368. }
  8369. switch (type) {
  8370. case 'Integer64': (tempI64 = [ret>>>0,(tempDouble=ret,(+(Math_abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? ((Math_min((+(Math_floor((tempDouble)/4294967296.0))), 4294967295.0))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)],HEAP32[((p)>>2)]=tempI64[0],HEAP32[(((p)+(4))>>2)]=tempI64[1]); break;
  8371. case 'Integer': HEAP32[((p)>>2)]=ret; break;
  8372. case 'Float': HEAPF32[((p)>>2)]=ret; break;
  8373. case 'Boolean': HEAP8[((p)>>0)]=ret ? 1 : 0; break;
  8374. default: throw 'internal glGet error, bad type: ' + type;
  8375. }
  8376. }function _emscripten_glGetIntegerv(name_, p) {
  8377. emscriptenWebGLGet(name_, p, 'Integer');
  8378. }
  8379. function _emscripten_glGetFramebufferAttachmentParameteriv(target, attachment, pname, params) {
  8380. var result = GLctx.getFramebufferAttachmentParameter(target, attachment, pname);
  8381. HEAP32[((params)>>2)]=result;
  8382. }
  8383. function _llvm_stackrestore(p) {
  8384. var self = _llvm_stacksave;
  8385. var ret = self.LLVM_SAVEDSTACKS[p];
  8386. self.LLVM_SAVEDSTACKS.splice(p, 1);
  8387. Runtime.stackRestore(ret);
  8388. }
  8389. function _glfwSetWindowShouldClose(winid, value) {
  8390. var win = GLFW.WindowFromId(winid);
  8391. if (!win) return;
  8392. win.shouldClose = value;
  8393. }
  8394. function _emscripten_glClientActiveTexture() {
  8395. Module['printErr']('missing function: emscripten_glClientActiveTexture'); abort(-1);
  8396. }
  8397. function _glGenBuffers(n, buffers) {
  8398. for (var i = 0; i < n; i++) {
  8399. var buffer = GLctx.createBuffer();
  8400. if (!buffer) {
  8401. GL.recordError(0x0502 /* GL_INVALID_OPERATION */);
  8402. while(i < n) HEAP32[(((buffers)+(i++*4))>>2)]=0;
  8403. return;
  8404. }
  8405. var id = GL.getNewId(GL.buffers);
  8406. buffer.name = id;
  8407. GL.buffers[id] = buffer;
  8408. HEAP32[(((buffers)+(i*4))>>2)]=id;
  8409. }
  8410. }
  8411. function _emscripten_memcpy_big(dest, src, num) {
  8412. HEAPU8.set(HEAPU8.subarray(src, src+num), dest);
  8413. return dest;
  8414. }
  8415. Module["_memcpy"] = _memcpy;
  8416. function _emscripten_glGetShaderInfoLog(shader, maxLength, length, infoLog) {
  8417. var log = GLctx.getShaderInfoLog(GL.shaders[shader]);
  8418. if (log === null) log = '(unknown error)';
  8419. if (maxLength > 0 && infoLog) {
  8420. var numBytesWrittenExclNull = stringToUTF8(log, infoLog, maxLength);
  8421. if (length) HEAP32[((length)>>2)]=numBytesWrittenExclNull;
  8422. } else {
  8423. if (length) HEAP32[((length)>>2)]=0;
  8424. }
  8425. }
  8426. function _glfwGetTime() {
  8427. return GLFW.getTime() - GLFW.initialTime;
  8428. }
  8429. function _emscripten_glGetRenderbufferParameteriv(target, pname, params) {
  8430. if (!params) {
  8431. // GLES2 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense
  8432. // if params == null, issue a GL error to notify user about it.
  8433. GL.recordError(0x0501 /* GL_INVALID_VALUE */);
  8434. return;
  8435. }
  8436. HEAP32[((params)>>2)]=GLctx.getRenderbufferParameter(target, pname);
  8437. }
  8438. function _emscripten_glStencilOpSeparate(x0, x1, x2, x3) { GLctx['stencilOpSeparate'](x0, x1, x2, x3) }
  8439. function _emscripten_glReadPixels(x, y, width, height, format, type, pixels) {
  8440. var pixelData = emscriptenWebGLGetTexPixelData(type, format, width, height, pixels, format);
  8441. if (!pixelData) {
  8442. GL.recordError(0x0500/*GL_INVALID_ENUM*/);
  8443. return;
  8444. }
  8445. GLctx.readPixels(x, y, width, height, format, type, pixelData);
  8446. }
  8447. function _emscripten_glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data) {
  8448. GLctx['compressedTexSubImage2D'](target, level, xoffset, yoffset, width, height, format, data ? HEAPU8.subarray((data),(data+imageSize)) : null);
  8449. }
  8450. function _emscripten_glGetError() {
  8451. // First return any GL error generated by the emscripten library_gl.js interop layer.
  8452. if (GL.lastError) {
  8453. var error = GL.lastError;
  8454. GL.lastError = 0/*GL_NO_ERROR*/;
  8455. return error;
  8456. } else { // If there were none, return the GL error from the browser GL context.
  8457. return GLctx.getError();
  8458. }
  8459. }
  8460. function _emscripten_glFramebufferTexture2D(target, attachment, textarget, texture, level) {
  8461. GLctx.framebufferTexture2D(target, attachment, textarget,
  8462. GL.textures[texture], level);
  8463. }
  8464. function _emscripten_glIsEnabled(x0) { return GLctx['isEnabled'](x0) }
  8465. function _glClearDepthf(x0) { GLctx['clearDepth'](x0) }
  8466. Module["_memmove"] = _memmove;
  8467. function _glGenTextures(n, textures) {
  8468. for (var i = 0; i < n; i++) {
  8469. var texture = GLctx.createTexture();
  8470. if (!texture) {
  8471. GL.recordError(0x0502 /* GL_INVALID_OPERATION */); // GLES + EGL specs don't specify what should happen here, so best to issue an error and create IDs with 0.
  8472. while(i < n) HEAP32[(((textures)+(i++*4))>>2)]=0;
  8473. return;
  8474. }
  8475. var id = GL.getNewId(GL.textures);
  8476. texture.name = id;
  8477. GL.textures[id] = texture;
  8478. HEAP32[(((textures)+(i*4))>>2)]=id;
  8479. }
  8480. }
  8481. function _emscripten_glVertexAttrib4f(x0, x1, x2, x3, x4) { GLctx['vertexAttrib4f'](x0, x1, x2, x3, x4) }
  8482. function _glDepthFunc(x0) { GLctx['depthFunc'](x0) }
  8483. var __main_thread_futex_wait_address; if (ENVIRONMENT_IS_PTHREAD) __main_thread_futex_wait_address = PthreadWorkerInit.__main_thread_futex_wait_address; else PthreadWorkerInit.__main_thread_futex_wait_address = __main_thread_futex_wait_address = allocate(1, "i32*", ALLOC_STATIC);function _emscripten_futex_wait(addr, val, timeout) {
  8484. if (addr <= 0 || addr > HEAP8.length || addr&3 != 0) return -22;
  8485. // dump('futex_wait addr:' + addr + ' by thread: ' + _pthread_self() + (ENVIRONMENT_IS_PTHREAD?'(pthread)':'') + '\n');
  8486. if (ENVIRONMENT_IS_WORKER) {
  8487. var ret = Atomics.wait(HEAP32, addr >> 2, val, timeout);
  8488. // dump('futex_wait done by thread: ' + _pthread_self() + (ENVIRONMENT_IS_PTHREAD?'(pthread)':'') + '\n');
  8489. if (ret === 'timed-out') return -110;
  8490. if (ret === 'not-equal') return -11;
  8491. if (ret === 'ok') return 0;
  8492. throw 'Atomics.wait returned an unexpected value ' + ret;
  8493. } else {
  8494. // Atomics.wait is not available in the main browser thread, so simulate it via busy spinning.
  8495. var loadedVal = Atomics.load(HEAP32, addr >> 2);
  8496. if (val != loadedVal) return -11;
  8497. var tNow = performance.now();
  8498. var tEnd = tNow + timeout;
  8499. // Register globally which address the main thread is simulating to be waiting on. When zero, main thread is not waiting on anything,
  8500. // and on nonzero, the contents of address pointed by __main_thread_futex_wait_address tell which address the main thread is simulating its wait on.
  8501. Atomics.store(HEAP32, __main_thread_futex_wait_address >> 2, addr);
  8502. var ourWaitAddress = addr; // We may recursively re-enter this function while processing queued calls, in which case we'll do a spurious wakeup of the older wait operation.
  8503. while (addr == ourWaitAddress) {
  8504. tNow = performance.now();
  8505. if (tNow > tEnd) {
  8506. return -110;
  8507. }
  8508. _emscripten_main_thread_process_queued_calls(); // We are performing a blocking loop here, so must pump any pthreads if they want to perform operations that are proxied.
  8509. addr = Atomics.load(HEAP32, __main_thread_futex_wait_address >> 2); // Look for a worker thread waking us up.
  8510. }
  8511. return 0;
  8512. }
  8513. }
  8514. function _emscripten_glClearDepthf(x0) { GLctx['clearDepth'](x0) }
  8515. function _emscripten_glClear(x0) { GLctx['clear'](x0) }
  8516. function _emscripten_glBindBuffer(target, buffer) {
  8517. var bufferObj = buffer ? GL.buffers[buffer] : null;
  8518. GLctx.bindBuffer(target, bufferObj);
  8519. }
  8520. function _emscripten_glGetUniformfv(program, location, params) {
  8521. emscriptenWebGLGetUniform(program, location, params, 'Float');
  8522. }
  8523. function _glGetProgramiv(program, pname, p) {
  8524. if (!p) {
  8525. // GLES2 specification does not specify how to behave if p is a null pointer. Since calling this function does not make sense
  8526. // if p == null, issue a GL error to notify user about it.
  8527. GL.recordError(0x0501 /* GL_INVALID_VALUE */);
  8528. return;
  8529. }
  8530. if (program >= GL.counter) {
  8531. GL.recordError(0x0501 /* GL_INVALID_VALUE */);
  8532. return;
  8533. }
  8534. var ptable = GL.programInfos[program];
  8535. if (!ptable) {
  8536. GL.recordError(0x0502 /* GL_INVALID_OPERATION */);
  8537. return;
  8538. }
  8539. if (pname == 0x8B84) { // GL_INFO_LOG_LENGTH
  8540. var log = GLctx.getProgramInfoLog(GL.programs[program]);
  8541. if (log === null) log = '(unknown error)';
  8542. HEAP32[((p)>>2)]=log.length + 1;
  8543. } else if (pname == 0x8B87 /* GL_ACTIVE_UNIFORM_MAX_LENGTH */) {
  8544. HEAP32[((p)>>2)]=ptable.maxUniformLength;
  8545. } else if (pname == 0x8B8A /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */) {
  8546. if (ptable.maxAttributeLength == -1) {
  8547. var program = GL.programs[program];
  8548. var numAttribs = GLctx.getProgramParameter(program, GLctx.ACTIVE_ATTRIBUTES);
  8549. ptable.maxAttributeLength = 0; // Spec says if there are no active attribs, 0 must be returned.
  8550. for (var i = 0; i < numAttribs; ++i) {
  8551. var activeAttrib = GLctx.getActiveAttrib(program, i);
  8552. ptable.maxAttributeLength = Math.max(ptable.maxAttributeLength, activeAttrib.name.length+1);
  8553. }
  8554. }
  8555. HEAP32[((p)>>2)]=ptable.maxAttributeLength;
  8556. } else if (pname == 0x8A35 /* GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */) {
  8557. if (ptable.maxUniformBlockNameLength == -1) {
  8558. var program = GL.programs[program];
  8559. var numBlocks = GLctx.getProgramParameter(program, GLctx.ACTIVE_UNIFORM_BLOCKS);
  8560. ptable.maxUniformBlockNameLength = 0;
  8561. for (var i = 0; i < numBlocks; ++i) {
  8562. var activeBlockName = GLctx.getActiveUniformBlockName(program, i);
  8563. ptable.maxUniformBlockNameLength = Math.max(ptable.maxUniformBlockNameLength, activeBlockName.length+1);
  8564. }
  8565. }
  8566. HEAP32[((p)>>2)]=ptable.maxUniformBlockNameLength;
  8567. } else {
  8568. HEAP32[((p)>>2)]=GLctx.getProgramParameter(GL.programs[program], pname);
  8569. }
  8570. }
  8571. function _glVertexAttribPointer(index, size, type, normalized, stride, ptr) {
  8572. GLctx.vertexAttribPointer(index, size, type, !!normalized, stride, ptr);
  8573. }
  8574. function _emscripten_exit_pointerlock() {
  8575. // Make sure no queued up calls will fire after this.
  8576. JSEvents.removeDeferredCalls(JSEvents.requestPointerLock);
  8577. if (document.exitPointerLock) {
  8578. document.exitPointerLock();
  8579. } else if (document.msExitPointerLock) {
  8580. document.msExitPointerLock();
  8581. } else if (document.mozExitPointerLock) {
  8582. document.mozExitPointerLock();
  8583. } else if (document.webkitExitPointerLock) {
  8584. document.webkitExitPointerLock();
  8585. } else {
  8586. return -1;
  8587. }
  8588. return 0;
  8589. }
  8590. var cttz_i8; if (ENVIRONMENT_IS_PTHREAD) cttz_i8 = PthreadWorkerInit.cttz_i8; else PthreadWorkerInit.cttz_i8 = cttz_i8 = allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0], "i8", ALLOC_STATIC);
  8591. Module["_llvm_cttz_i32"] = _llvm_cttz_i32;
  8592. Module["___udivmoddi4"] = ___udivmoddi4;
  8593. Module["___uremdi3"] = ___uremdi3;
  8594. function _glGetUniformLocation(program, name) {
  8595. name = Pointer_stringify(name);
  8596. var arrayOffset = 0;
  8597. // If user passed an array accessor "[index]", parse the array index off the accessor.
  8598. if (name.indexOf(']', name.length-1) !== -1) {
  8599. var ls = name.lastIndexOf('[');
  8600. var arrayIndex = name.slice(ls+1, -1);
  8601. if (arrayIndex.length > 0) {
  8602. arrayOffset = parseInt(arrayIndex);
  8603. if (arrayOffset < 0) {
  8604. return -1;
  8605. }
  8606. }
  8607. name = name.slice(0, ls);
  8608. }
  8609. var ptable = GL.programInfos[program];
  8610. if (!ptable) {
  8611. return -1;
  8612. }
  8613. var utable = ptable.uniforms;
  8614. var uniformInfo = utable[name]; // returns pair [ dimension_of_uniform_array, uniform_location ]
  8615. if (uniformInfo && arrayOffset < uniformInfo[0]) { // Check if user asked for an out-of-bounds element, i.e. for 'vec4 colors[3];' user could ask for 'colors[10]' which should return -1.
  8616. return uniformInfo[1]+arrayOffset;
  8617. } else {
  8618. return -1;
  8619. }
  8620. }
  8621. function _emscripten_glGetAttachedShaders(program, maxCount, count, shaders) {
  8622. var result = GLctx.getAttachedShaders(GL.programs[program]);
  8623. var len = result.length;
  8624. if (len > maxCount) {
  8625. len = maxCount;
  8626. }
  8627. HEAP32[((count)>>2)]=len;
  8628. for (var i = 0; i < len; ++i) {
  8629. var id = GL.shaders.indexOf(result[i]);
  8630. assert(id !== -1, 'shader not bound to local id');
  8631. HEAP32[(((shaders)+(i*4))>>2)]=id;
  8632. }
  8633. }
  8634. function _emscripten_glGenRenderbuffers(n, renderbuffers) {
  8635. for (var i = 0; i < n; i++) {
  8636. var renderbuffer = GLctx.createRenderbuffer();
  8637. if (!renderbuffer) {
  8638. GL.recordError(0x0502 /* GL_INVALID_OPERATION */);
  8639. while(i < n) HEAP32[(((renderbuffers)+(i++*4))>>2)]=0;
  8640. return;
  8641. }
  8642. var id = GL.getNewId(GL.renderbuffers);
  8643. renderbuffer.name = id;
  8644. GL.renderbuffers[id] = renderbuffer;
  8645. HEAP32[(((renderbuffers)+(i*4))>>2)]=id;
  8646. }
  8647. }
  8648. function _emscripten_glFrontFace(x0) { GLctx['frontFace'](x0) }
  8649. function _emscripten_glActiveTexture(x0) { GLctx['activeTexture'](x0) }
  8650. function _emscripten_glUniform1iv(location, count, value) {
  8651. GLctx.uniform1iv(GL.uniforms[location], HEAP32.subarray((value)>>2,(value+count*4)>>2));
  8652. }
  8653. function _emscripten_glTexCoordPointer() {
  8654. Module['printErr']('missing function: emscripten_glTexCoordPointer'); abort(-1);
  8655. }
  8656. function _emscripten_glGetInfoLogARB() {
  8657. Module['printErr']('missing function: emscripten_glGetInfoLogARB'); abort(-1);
  8658. }
  8659. function __exit(status) {
  8660. // void _exit(int status);
  8661. // http://pubs.opengroup.org/onlinepubs/000095399/functions/exit.html
  8662. Module['exit'](status);
  8663. }function _exit(status) {
  8664. __exit(status);
  8665. }
  8666. function _emscripten_glRenderbufferStorage(x0, x1, x2, x3) { GLctx['renderbufferStorage'](x0, x1, x2, x3) }
  8667. function _emscripten_glCopyTexSubImage2D(x0, x1, x2, x3, x4, x5, x6, x7) { GLctx['copyTexSubImage2D'](x0, x1, x2, x3, x4, x5, x6, x7) }
  8668. function _glfwSetCursorPosCallback(winid, cbfun) {
  8669. GLFW.setCursorPosCallback(winid, cbfun);
  8670. }
  8671. function _emscripten_glDepthRange(x0, x1) { GLctx['depthRange'](x0, x1) }
  8672. function _glBindAttribLocation(program, index, name) {
  8673. name = Pointer_stringify(name);
  8674. GLctx.bindAttribLocation(GL.programs[program], index, name);
  8675. }
  8676. function _emscripten_glShaderBinary() {
  8677. GL.recordError(0x0500/*GL_INVALID_ENUM*/);
  8678. }
  8679. function _emscripten_glIsProgram(program) {
  8680. var program = GL.programs[program];
  8681. if (!program) return 0;
  8682. return GLctx.isProgram(program);
  8683. }
  8684. function _emscripten_glBlendColor(x0, x1, x2, x3) { GLctx['blendColor'](x0, x1, x2, x3) }
  8685. function _emscripten_glGetShaderiv(shader, pname, p) {
  8686. if (!p) {
  8687. // GLES2 specification does not specify how to behave if p is a null pointer. Since calling this function does not make sense
  8688. // if p == null, issue a GL error to notify user about it.
  8689. GL.recordError(0x0501 /* GL_INVALID_VALUE */);
  8690. return;
  8691. }
  8692. if (pname == 0x8B84) { // GL_INFO_LOG_LENGTH
  8693. var log = GLctx.getShaderInfoLog(GL.shaders[shader]);
  8694. if (log === null) log = '(unknown error)';
  8695. HEAP32[((p)>>2)]=log.length + 1;
  8696. } else {
  8697. HEAP32[((p)>>2)]=GLctx.getShaderParameter(GL.shaders[shader], pname);
  8698. }
  8699. }
  8700. function _emscripten_glUniformMatrix3fv(location, count, transpose, value) {
  8701. var view;
  8702. if (9*count <= GL.MINI_TEMP_BUFFER_SIZE) {
  8703. // avoid allocation when uploading few enough uniforms
  8704. view = GL.miniTempBufferViews[9*count-1];
  8705. for (var i = 0; i < 9*count; i += 9) {
  8706. view[i] = HEAPF32[(((value)+(4*i))>>2)];
  8707. view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)];
  8708. view[i+2] = HEAPF32[(((value)+(4*i+8))>>2)];
  8709. view[i+3] = HEAPF32[(((value)+(4*i+12))>>2)];
  8710. view[i+4] = HEAPF32[(((value)+(4*i+16))>>2)];
  8711. view[i+5] = HEAPF32[(((value)+(4*i+20))>>2)];
  8712. view[i+6] = HEAPF32[(((value)+(4*i+24))>>2)];
  8713. view[i+7] = HEAPF32[(((value)+(4*i+28))>>2)];
  8714. view[i+8] = HEAPF32[(((value)+(4*i+32))>>2)];
  8715. }
  8716. } else {
  8717. view = HEAPF32.subarray((value)>>2,(value+count*36)>>2);
  8718. }
  8719. GLctx.uniformMatrix3fv(GL.uniforms[location], !!transpose, view);
  8720. }
  8721. Module["___udivdi3"] = ___udivdi3;
  8722. function _emscripten_glUniform4fv(location, count, value) {
  8723. var view;
  8724. if (4*count <= GL.MINI_TEMP_BUFFER_SIZE) {
  8725. // avoid allocation when uploading few enough uniforms
  8726. view = GL.miniTempBufferViews[4*count-1];
  8727. for (var i = 0; i < 4*count; i += 4) {
  8728. view[i] = HEAPF32[(((value)+(4*i))>>2)];
  8729. view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)];
  8730. view[i+2] = HEAPF32[(((value)+(4*i+8))>>2)];
  8731. view[i+3] = HEAPF32[(((value)+(4*i+12))>>2)];
  8732. }
  8733. } else {
  8734. view = HEAPF32.subarray((value)>>2,(value+count*16)>>2);
  8735. }
  8736. GLctx.uniform4fv(GL.uniforms[location], view);
  8737. }
  8738. function _glBufferSubData(target, offset, size, data) {
  8739. GLctx.bufferSubData(target, offset, HEAPU8.subarray(data, data+size));
  8740. }
  8741. function _emscripten_futex_wake(addr, count) {
  8742. if (addr <= 0 || addr > HEAP8.length || addr&3 != 0 || count < 0) return -22;
  8743. if (count == 0) return 0;
  8744. // dump('futex_wake addr:' + addr + ' by thread: ' + _pthread_self() + (ENVIRONMENT_IS_PTHREAD?'(pthread)':'') + '\n');
  8745. // See if main thread is waiting on this address? If so, wake it up by resetting its wake location to zero.
  8746. // Note that this is not a fair procedure, since we always wake main thread first before any workers, so
  8747. // this scheme does not adhere to real queue-based waiting.
  8748. var mainThreadWaitAddress = Atomics.load(HEAP32, __main_thread_futex_wait_address >> 2);
  8749. var mainThreadWoken = 0;
  8750. if (mainThreadWaitAddress == addr) {
  8751. var loadedAddr = Atomics.compareExchange(HEAP32, __main_thread_futex_wait_address >> 2, mainThreadWaitAddress, 0);
  8752. if (loadedAddr == mainThreadWaitAddress) {
  8753. --count;
  8754. mainThreadWoken = 1;
  8755. if (count <= 0) return 1;
  8756. }
  8757. }
  8758. // Wake any workers waiting on this address.
  8759. var ret = Atomics.wake(HEAP32, addr >> 2, count);
  8760. if (ret >= 0) return ret + mainThreadWoken;
  8761. throw 'Atomics.wake returned an unexpected value ' + ret;
  8762. }
  8763. function _glGetProgramInfoLog(program, maxLength, length, infoLog) {
  8764. var log = GLctx.getProgramInfoLog(GL.programs[program]);
  8765. if (log === null) log = '(unknown error)';
  8766. if (maxLength > 0 && infoLog) {
  8767. var numBytesWrittenExclNull = stringToUTF8(log, infoLog, maxLength);
  8768. if (length) HEAP32[((length)>>2)]=numBytesWrittenExclNull;
  8769. } else {
  8770. if (length) HEAP32[((length)>>2)]=0;
  8771. }
  8772. }
  8773. function _emscripten_glGenFramebuffers(n, ids) {
  8774. for (var i = 0; i < n; ++i) {
  8775. var framebuffer = GLctx.createFramebuffer();
  8776. if (!framebuffer) {
  8777. GL.recordError(0x0502 /* GL_INVALID_OPERATION */);
  8778. while(i < n) HEAP32[(((ids)+(i++*4))>>2)]=0;
  8779. return;
  8780. }
  8781. var id = GL.getNewId(GL.framebuffers);
  8782. framebuffer.name = id;
  8783. GL.framebuffers[id] = framebuffer;
  8784. HEAP32[(((ids)+(i*4))>>2)]=id;
  8785. }
  8786. }
  8787. function _glGetShaderiv(shader, pname, p) {
  8788. if (!p) {
  8789. // GLES2 specification does not specify how to behave if p is a null pointer. Since calling this function does not make sense
  8790. // if p == null, issue a GL error to notify user about it.
  8791. GL.recordError(0x0501 /* GL_INVALID_VALUE */);
  8792. return;
  8793. }
  8794. if (pname == 0x8B84) { // GL_INFO_LOG_LENGTH
  8795. var log = GLctx.getShaderInfoLog(GL.shaders[shader]);
  8796. if (log === null) log = '(unknown error)';
  8797. HEAP32[((p)>>2)]=log.length + 1;
  8798. } else {
  8799. HEAP32[((p)>>2)]=GLctx.getShaderParameter(GL.shaders[shader], pname);
  8800. }
  8801. }
  8802. function _emscripten_glBlendEquationSeparate(x0, x1) { GLctx['blendEquationSeparate'](x0, x1) }
  8803. function _glfwSetWindowIconifyCallback(winid, cbfun) {
  8804. var win = GLFW.WindowFromId(winid);
  8805. if (!win) return;
  8806. win.windowIconifyFunc = cbfun;
  8807. }
  8808. function _emscripten_glDrawRangeElements() {
  8809. Module['printErr']('missing function: emscripten_glDrawRangeElements'); abort(-1);
  8810. }
  8811. function _emscripten_glGenTextures(n, textures) {
  8812. for (var i = 0; i < n; i++) {
  8813. var texture = GLctx.createTexture();
  8814. if (!texture) {
  8815. GL.recordError(0x0502 /* GL_INVALID_OPERATION */); // GLES + EGL specs don't specify what should happen here, so best to issue an error and create IDs with 0.
  8816. while(i < n) HEAP32[(((textures)+(i++*4))>>2)]=0;
  8817. return;
  8818. }
  8819. var id = GL.getNewId(GL.textures);
  8820. texture.name = id;
  8821. GL.textures[id] = texture;
  8822. HEAP32[(((textures)+(i*4))>>2)]=id;
  8823. }
  8824. }
  8825. function _emscripten_glVertexAttrib2fv(index, v) {
  8826. GLctx.vertexAttrib2f(index, HEAPF32[v>>2], HEAPF32[v+4>>2]);
  8827. }
  8828. function _emscripten_glGetActiveUniform(program, index, bufSize, length, size, type, name) {
  8829. program = GL.programs[program];
  8830. var info = GLctx.getActiveUniform(program, index);
  8831. if (!info) return; // If an error occurs, nothing will be written to length, size, type and name.
  8832. if (bufSize > 0 && name) {
  8833. var numBytesWrittenExclNull = stringToUTF8(info.name, name, bufSize);
  8834. if (length) HEAP32[((length)>>2)]=numBytesWrittenExclNull;
  8835. } else {
  8836. if (length) HEAP32[((length)>>2)]=0;
  8837. }
  8838. if (size) HEAP32[((size)>>2)]=info.size;
  8839. if (type) HEAP32[((type)>>2)]=info.type;
  8840. }
  8841. Module["_roundf"] = _roundf;
  8842. function _emscripten_glDeleteObjectARB() {
  8843. Module['printErr']('missing function: emscripten_glDeleteObjectARB'); abort(-1);
  8844. }
  8845. function _emscripten_set_touchmove_callback(target, userData, useCapture, callbackfunc) {
  8846. JSEvents.registerTouchEventCallback(target, userData, useCapture, callbackfunc, 24, "touchmove");
  8847. return 0;
  8848. }
  8849. function _emscripten_glUniform1f(location, v0) {
  8850. GLctx.uniform1f(GL.uniforms[location], v0);
  8851. }
  8852. function _emscripten_glVertexAttribPointer(index, size, type, normalized, stride, ptr) {
  8853. GLctx.vertexAttribPointer(index, size, type, !!normalized, stride, ptr);
  8854. }
  8855. function _glShaderSource(shader, count, string, length) {
  8856. var source = GL.getSource(shader, count, string, length);
  8857. GLctx.shaderSource(GL.shaders[shader], source);
  8858. }
  8859. function __spawn_thread(threadParams) {
  8860. if (ENVIRONMENT_IS_PTHREAD) throw 'Internal Error! _spawn_thread() can only ever be called from main application thread!';
  8861. var worker = PThread.getNewWorker();
  8862. if (worker.pthread !== undefined) throw 'Internal error!';
  8863. if (!threadParams.pthread_ptr) throw 'Internal error, no pthread ptr!';
  8864. PThread.runningWorkers.push(worker);
  8865. // Allocate memory for thread-local storage and initialize it to zero.
  8866. var tlsMemory = _malloc(128 * 4);
  8867. for (var i = 0; i < 128; ++i) {
  8868. HEAP32[(((tlsMemory)+(i*4))>>2)]=0;
  8869. }
  8870. var pthread = PThread.pthreads[threadParams.pthread_ptr] = { // Create a pthread info object to represent this thread.
  8871. worker: worker,
  8872. stackBase: threadParams.stackBase,
  8873. stackSize: threadParams.stackSize,
  8874. allocatedOwnStack: threadParams.allocatedOwnStack,
  8875. thread: threadParams.pthread_ptr,
  8876. threadInfoStruct: threadParams.pthread_ptr // Info area for this thread in Emscripten HEAP (shared)
  8877. };
  8878. Atomics.store(HEAPU32, (pthread.threadInfoStruct + 0 ) >> 2, 0); // threadStatus <- 0, meaning not yet exited.
  8879. Atomics.store(HEAPU32, (pthread.threadInfoStruct + 4 ) >> 2, 0); // threadExitCode <- 0.
  8880. Atomics.store(HEAPU32, (pthread.threadInfoStruct + 20 ) >> 2, 0); // profilerBlock <- 0.
  8881. Atomics.store(HEAPU32, (pthread.threadInfoStruct + 80 ) >> 2, threadParams.detached);
  8882. Atomics.store(HEAPU32, (pthread.threadInfoStruct + 116 ) >> 2, tlsMemory); // Init thread-local-storage memory array.
  8883. Atomics.store(HEAPU32, (pthread.threadInfoStruct + 60 ) >> 2, 0); // Mark initial status to unused.
  8884. Atomics.store(HEAPU32, (pthread.threadInfoStruct + 52 ) >> 2, pthread.threadInfoStruct); // Main thread ID.
  8885. Atomics.store(HEAPU32, (pthread.threadInfoStruct + 56 ) >> 2, PROCINFO.pid); // Process ID.
  8886. Atomics.store(HEAPU32, (pthread.threadInfoStruct + 120) >> 2, threadParams.stackSize);
  8887. Atomics.store(HEAPU32, (pthread.threadInfoStruct + 96) >> 2, threadParams.stackSize);
  8888. Atomics.store(HEAPU32, (pthread.threadInfoStruct + 92) >> 2, threadParams.stackBase);
  8889. Atomics.store(HEAPU32, (pthread.threadInfoStruct + 120 + 8) >> 2, threadParams.stackBase);
  8890. Atomics.store(HEAPU32, (pthread.threadInfoStruct + 120 + 12) >> 2, threadParams.detached);
  8891. Atomics.store(HEAPU32, (pthread.threadInfoStruct + 120 + 20) >> 2, threadParams.schedPolicy);
  8892. Atomics.store(HEAPU32, (pthread.threadInfoStruct + 120 + 24) >> 2, threadParams.schedPrio);
  8893. var global_libc = _emscripten_get_global_libc();
  8894. var global_locale = global_libc + 40;
  8895. Atomics.store(HEAPU32, (pthread.threadInfoStruct + 188) >> 2, global_locale);
  8896. worker.pthread = pthread;
  8897. // Ask the worker to start executing its pthread entry point function.
  8898. worker.postMessage({
  8899. cmd: 'run',
  8900. start_routine: threadParams.startRoutine,
  8901. arg: threadParams.arg,
  8902. threadInfoStruct: threadParams.pthread_ptr,
  8903. selfThreadId: threadParams.pthread_ptr, // TODO: Remove this since thread ID is now the same as the thread address.
  8904. parentThreadId: threadParams.parent_pthread_ptr,
  8905. stackBase: threadParams.stackBase,
  8906. stackSize: threadParams.stackSize,
  8907. }, threadParams.transferList);
  8908. }
  8909. function _pthread_getschedparam(thread, policy, schedparam) {
  8910. if (!policy && !schedparam) return ERRNO_CODES.EINVAL;
  8911. if (!thread) {
  8912. Module['printErr']('pthread_getschedparam called with a null thread pointer!');
  8913. return ERRNO_CODES.ESRCH;
  8914. }
  8915. var self = HEAP32[(((thread)+(24))>>2)];
  8916. if (self != thread) {
  8917. Module['printErr']('pthread_getschedparam attempted on thread ' + thread + ', which does not point to a valid thread, or does not exist anymore!');
  8918. return ERRNO_CODES.ESRCH;
  8919. }
  8920. var schedPolicy = Atomics.load(HEAPU32, (thread + 120 + 20 ) >> 2);
  8921. var schedPrio = Atomics.load(HEAPU32, (thread + 120 + 24 ) >> 2);
  8922. if (policy) HEAP32[((policy)>>2)]=schedPolicy;
  8923. if (schedparam) HEAP32[((schedparam)>>2)]=schedPrio;
  8924. return 0;
  8925. }
  8926. function _pthread_self() {
  8927. return __pthread_ptr|0;
  8928. }function _pthread_create(pthread_ptr, attr, start_routine, arg) {
  8929. if (typeof SharedArrayBuffer === 'undefined') {
  8930. Module['printErr']('Current environment does not support SharedArrayBuffer, pthreads are not available!');
  8931. return 11;
  8932. }
  8933. if (!pthread_ptr) {
  8934. Module['printErr']('pthread_create called with a null thread pointer!');
  8935. return 22;
  8936. }
  8937. var transferList = []; // List of JS objects that will transfer ownership to the Worker hosting the thread
  8938. // Synchronously proxy the thread creation to main thread if possible. If we need to transfer ownership of objects, then
  8939. // proxy asynchronously via postMessage.
  8940. if (ENVIRONMENT_IS_PTHREAD && transferList.length == 0) {
  8941. return _emscripten_sync_run_in_main_thread_4(137, pthread_ptr, attr, start_routine, arg);
  8942. }
  8943. var stackSize = 0;
  8944. var stackBase = 0;
  8945. var detached = 0; // Default thread attr is PTHREAD_CREATE_JOINABLE, i.e. start as not detached.
  8946. var schedPolicy = 0; /*SCHED_OTHER*/
  8947. var schedPrio = 0;
  8948. if (attr) {
  8949. stackSize = HEAP32[((attr)>>2)];
  8950. stackBase = HEAP32[(((attr)+(8))>>2)];
  8951. detached = HEAP32[(((attr)+(12))>>2)] != 0/*PTHREAD_CREATE_JOINABLE*/;
  8952. var inheritSched = HEAP32[(((attr)+(16))>>2)] == 0/*PTHREAD_INHERIT_SCHED*/;
  8953. if (inheritSched) {
  8954. var prevSchedPolicy = HEAP32[(((attr)+(20))>>2)];
  8955. var prevSchedPrio = HEAP32[(((attr)+(24))>>2)];
  8956. _pthread_getschedparam(_pthread_self(), attr + 20, attr + 24);
  8957. schedPolicy = HEAP32[(((attr)+(20))>>2)];
  8958. schedPrio = HEAP32[(((attr)+(24))>>2)];
  8959. HEAP32[(((attr)+(20))>>2)]=prevSchedPolicy;
  8960. HEAP32[(((attr)+(24))>>2)]=prevSchedPrio;
  8961. } else {
  8962. schedPolicy = HEAP32[(((attr)+(20))>>2)];
  8963. schedPrio = HEAP32[(((attr)+(24))>>2)];
  8964. }
  8965. }
  8966. stackSize += 81920 /*DEFAULT_STACK_SIZE*/;
  8967. var allocatedOwnStack = stackBase == 0; // If allocatedOwnStack == true, then the pthread impl maintains the stack allocation.
  8968. if (allocatedOwnStack) {
  8969. stackBase = _malloc(stackSize); // Allocate a stack if the user doesn't want to place the stack in a custom memory area.
  8970. } else {
  8971. // Musl stores the stack base address assuming stack grows downwards, so adjust it to Emscripten convention that the
  8972. // stack grows upwards instead.
  8973. stackBase -= stackSize;
  8974. assert(stackBase > 0);
  8975. }
  8976. // Allocate thread block (pthread_t structure).
  8977. var threadInfoStruct = _malloc(244);
  8978. for (var i = 0; i < 244 >> 2; ++i) HEAPU32[(threadInfoStruct>>2) + i] = 0; // zero-initialize thread structure.
  8979. HEAP32[((pthread_ptr)>>2)]=threadInfoStruct;
  8980. // The pthread struct has a field that points to itself - this is used as a magic ID to detect whether the pthread_t
  8981. // structure is 'alive'.
  8982. HEAP32[(((threadInfoStruct)+(24))>>2)]=threadInfoStruct;
  8983. // pthread struct robust_list head should point to itself.
  8984. var headPtr = threadInfoStruct + 168;
  8985. HEAP32[((headPtr)>>2)]=headPtr;
  8986. var threadParams = {
  8987. stackBase: stackBase,
  8988. stackSize: stackSize,
  8989. allocatedOwnStack: allocatedOwnStack,
  8990. schedPolicy: schedPolicy,
  8991. schedPrio: schedPrio,
  8992. detached: detached,
  8993. startRoutine: start_routine,
  8994. pthread_ptr: threadInfoStruct,
  8995. parent_pthread_ptr: _pthread_self(),
  8996. arg: arg,
  8997. transferList: transferList
  8998. };
  8999. if (ENVIRONMENT_IS_PTHREAD) {
  9000. // The prepopulated pool of web workers that can host pthreads is stored in the main JS thread. Therefore if a
  9001. // pthread is attempting to spawn a new thread, the thread creation must be deferred to the main JS thread.
  9002. threadParams.cmd = 'spawnThread';
  9003. postMessage(threadParams, transferList);
  9004. } else {
  9005. // We are the main thread, so we have the pthread warmup pool in this thread and can fire off JS thread creation
  9006. // directly ourselves.
  9007. __spawn_thread(threadParams);
  9008. }
  9009. return 0;
  9010. }
  9011. function _emscripten_glDrawArrays(mode, first, count) {
  9012. GLctx.drawArrays(mode, first, count);
  9013. }
  9014. function _emscripten_glGenBuffers(n, buffers) {
  9015. for (var i = 0; i < n; i++) {
  9016. var buffer = GLctx.createBuffer();
  9017. if (!buffer) {
  9018. GL.recordError(0x0502 /* GL_INVALID_OPERATION */);
  9019. while(i < n) HEAP32[(((buffers)+(i++*4))>>2)]=0;
  9020. return;
  9021. }
  9022. var id = GL.getNewId(GL.buffers);
  9023. buffer.name = id;
  9024. GL.buffers[id] = buffer;
  9025. HEAP32[(((buffers)+(i*4))>>2)]=id;
  9026. }
  9027. }
  9028. function _emscripten_glClearDepth(x0) { GLctx['clearDepth'](x0) }
  9029. function _emscripten_set_keypress_callback(target, userData, useCapture, callbackfunc) {
  9030. JSEvents.registerKeyEventCallback(target, userData, useCapture, callbackfunc, 1, "keypress");
  9031. return 0;
  9032. }
  9033. function _glfwSetCharCallback(winid, cbfun) {
  9034. GLFW.setCharCallback(winid, cbfun);
  9035. }
  9036. function _emscripten_glGetUniformLocation(program, name) {
  9037. name = Pointer_stringify(name);
  9038. var arrayOffset = 0;
  9039. // If user passed an array accessor "[index]", parse the array index off the accessor.
  9040. if (name.indexOf(']', name.length-1) !== -1) {
  9041. var ls = name.lastIndexOf('[');
  9042. var arrayIndex = name.slice(ls+1, -1);
  9043. if (arrayIndex.length > 0) {
  9044. arrayOffset = parseInt(arrayIndex);
  9045. if (arrayOffset < 0) {
  9046. return -1;
  9047. }
  9048. }
  9049. name = name.slice(0, ls);
  9050. }
  9051. var ptable = GL.programInfos[program];
  9052. if (!ptable) {
  9053. return -1;
  9054. }
  9055. var utable = ptable.uniforms;
  9056. var uniformInfo = utable[name]; // returns pair [ dimension_of_uniform_array, uniform_location ]
  9057. if (uniformInfo && arrayOffset < uniformInfo[0]) { // Check if user asked for an out-of-bounds element, i.e. for 'vec4 colors[3];' user could ask for 'colors[10]' which should return -1.
  9058. return uniformInfo[1]+arrayOffset;
  9059. } else {
  9060. return -1;
  9061. }
  9062. }
  9063. function _glBindBuffer(target, buffer) {
  9064. var bufferObj = buffer ? GL.buffers[buffer] : null;
  9065. GLctx.bindBuffer(target, bufferObj);
  9066. }
  9067. function _emscripten_set_current_thread_status_js(newStatus) {
  9068. }
  9069. Module["_emscripten_set_current_thread_status"] = _emscripten_set_current_thread_status;
  9070. function _emscripten_glVertexAttrib4fv(index, v) {
  9071. GLctx.vertexAttrib4f(index, HEAPF32[v>>2], HEAPF32[v+4>>2], HEAPF32[v+8>>2], HEAPF32[v+12>>2]);
  9072. }
  9073. function _emscripten_glScissor(x0, x1, x2, x3) { GLctx['scissor'](x0, x1, x2, x3) }
  9074. function _glfwSetCursorEnterCallback(winid, cbfun) {
  9075. var win = GLFW.WindowFromId(winid);
  9076. if (!win) return;
  9077. win.cursorEnterFunc = cbfun;
  9078. }
  9079. Module["_bitshift64Lshr"] = _bitshift64Lshr;
  9080. function _confstr(name, buf, len) {
  9081. if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_3(68, name, buf, len);
  9082. // size_t confstr(int name, char *buf, size_t len);
  9083. // http://pubs.opengroup.org/onlinepubs/000095399/functions/confstr.html
  9084. var value;
  9085. switch (name) {
  9086. case 0:
  9087. value = ENV['PATH'] || '/';
  9088. break;
  9089. case 1:
  9090. // Mimicking glibc.
  9091. value = 'POSIX_V6_ILP32_OFF32\nPOSIX_V6_ILP32_OFFBIG';
  9092. break;
  9093. case 2:
  9094. // This JS implementation was tested against this glibc version.
  9095. value = 'glibc 2.14';
  9096. break;
  9097. case 3:
  9098. // We don't support pthreads.
  9099. value = '';
  9100. break;
  9101. case 1118:
  9102. case 1122:
  9103. case 1124:
  9104. case 1125:
  9105. case 1126:
  9106. case 1128:
  9107. case 1129:
  9108. case 1130:
  9109. value = '';
  9110. break;
  9111. case 1116:
  9112. case 1117:
  9113. case 1121:
  9114. value = '-m32';
  9115. break;
  9116. case 1120:
  9117. value = '-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64';
  9118. break;
  9119. default:
  9120. ___setErrNo(ERRNO_CODES.EINVAL);
  9121. return 0;
  9122. }
  9123. if (len == 0 || buf == 0) {
  9124. return value.length + 1;
  9125. } else {
  9126. var length = Math.min(len, value.length);
  9127. for (var i = 0; i < length; i++) {
  9128. HEAP8[(((buf)+(i))>>0)]=value.charCodeAt(i);
  9129. }
  9130. if (len > length) HEAP8[(((buf)+(i++))>>0)]=0;
  9131. return i;
  9132. }
  9133. }
  9134. function _glBufferData(target, size, data, usage) {
  9135. if (!data) {
  9136. GLctx.bufferData(target, size, usage);
  9137. } else {
  9138. GLctx.bufferData(target, HEAPU8.subarray(data, data+size), usage);
  9139. }
  9140. }
  9141. function _emscripten_glIsShader(shader) {
  9142. var s = GL.shaders[shader];
  9143. if (!s) return 0;
  9144. return GLctx.isShader(s);
  9145. }
  9146. function _getenv(name) {
  9147. if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_1(111, name);
  9148. // char *getenv(const char *name);
  9149. // http://pubs.opengroup.org/onlinepubs/009695399/functions/getenv.html
  9150. if (name === 0) return 0;
  9151. name = Pointer_stringify(name);
  9152. if (!ENV.hasOwnProperty(name)) return 0;
  9153. if (_getenv.ret) _free(_getenv.ret);
  9154. _getenv.ret = allocate(intArrayFromString(ENV[name]), 'i8', ALLOC_NORMAL);
  9155. return _getenv.ret;
  9156. }
  9157. function _emscripten_conditional_set_current_thread_status_js(expectedStatus, newStatus) {
  9158. }
  9159. Module["_emscripten_conditional_set_current_thread_status"] = _emscripten_conditional_set_current_thread_status;
  9160. function _emscripten_glDrawBuffers(n, bufs) {
  9161. var bufArray = GL.tempFixedLengthArray[n];
  9162. for (var i = 0; i < n; i++) {
  9163. bufArray[i] = HEAP32[(((bufs)+(i*4))>>2)];
  9164. }
  9165. GLctx['drawBuffers'](bufArray);
  9166. }
  9167. function _glGetFloatv(name_, p) {
  9168. emscriptenWebGLGet(name_, p, 'Float');
  9169. }
  9170. function _emscripten_glBindFramebuffer(target, framebuffer) {
  9171. GLctx.bindFramebuffer(target, framebuffer ? GL.framebuffers[framebuffer] : null);
  9172. }
  9173. function _emscripten_glBlendEquation(x0) { GLctx['blendEquation'](x0) }
  9174. function _emscripten_glBufferSubData(target, offset, size, data) {
  9175. GLctx.bufferSubData(target, offset, HEAPU8.subarray(data, data+size));
  9176. }
  9177. function _emscripten_glBufferData(target, size, data, usage) {
  9178. if (!data) {
  9179. GLctx.bufferData(target, size, usage);
  9180. } else {
  9181. GLctx.bufferData(target, HEAPU8.subarray(data, data+size), usage);
  9182. }
  9183. }
  9184. Module["_sbrk"] = _sbrk;
  9185. Module["_bitshift64Shl"] = _bitshift64Shl;
  9186. function _emscripten_glGetShaderSource(shader, bufSize, length, source) {
  9187. var result = GLctx.getShaderSource(GL.shaders[shader]);
  9188. if (!result) return; // If an error occurs, nothing will be written to length or source.
  9189. if (bufSize > 0 && source) {
  9190. var numBytesWrittenExclNull = stringToUTF8(result, source, bufSize);
  9191. if (length) HEAP32[((length)>>2)]=numBytesWrittenExclNull;
  9192. } else {
  9193. if (length) HEAP32[((length)>>2)]=0;
  9194. }
  9195. }
  9196. Module["_llvm_bswap_i32"] = _llvm_bswap_i32;
  9197. function _emscripten_set_click_callback(target, userData, useCapture, callbackfunc) {
  9198. JSEvents.registerMouseEventCallback(target, userData, useCapture, callbackfunc, 4, "click");
  9199. return 0;
  9200. }
  9201. function _glfwSetKeyCallback(winid, cbfun) {
  9202. GLFW.setKeyCallback(winid, cbfun);
  9203. }
  9204. function _emscripten_set_gamepadconnected_callback(userData, useCapture, callbackfunc) {
  9205. if (!navigator.getGamepads && !navigator.webkitGetGamepads) return -1;
  9206. JSEvents.registerGamepadEventCallback(window, userData, useCapture, callbackfunc, 26, "gamepadconnected");
  9207. return 0;
  9208. }
  9209. function _emscripten_glGetFloatv(name_, p) {
  9210. emscriptenWebGLGet(name_, p, 'Float');
  9211. }
  9212. function _glTexImage2D(target, level, internalFormat, width, height, border, format, type, pixels) {
  9213. var pixelData = null;
  9214. if (pixels) pixelData = emscriptenWebGLGetTexPixelData(type, format, width, height, pixels, internalFormat);
  9215. GLctx.texImage2D(target, level, internalFormat, width, height, border, format, type, pixelData);
  9216. }
  9217. function ___assert_fail(condition, filename, line, func) {
  9218. ABORT = true;
  9219. throw 'Assertion failed: ' + Pointer_stringify(condition) + ', at: ' + [filename ? Pointer_stringify(filename) : 'unknown filename', line, func ? Pointer_stringify(func) : 'unknown function'] + ' at ' + stackTrace();
  9220. }
  9221. function _emscripten_glVertexAttribDivisor(index, divisor) {
  9222. GLctx['vertexAttribDivisor'](index, divisor);
  9223. }
  9224. function _emscripten_glDrawElementsInstanced(mode, count, type, indices, primcount) {
  9225. GLctx['drawElementsInstanced'](mode, count, type, indices, primcount);
  9226. }
  9227. function _emscripten_glDrawElements(mode, count, type, indices) {
  9228. GLctx.drawElements(mode, count, type, indices);
  9229. }
  9230. function _glfwSetMouseButtonCallback(winid, cbfun) {
  9231. GLFW.setMouseButtonCallback(winid, cbfun);
  9232. }
  9233. function _emscripten_glCreateProgram() {
  9234. var id = GL.getNewId(GL.programs);
  9235. var program = GLctx.createProgram();
  9236. program.name = id;
  9237. GL.programs[id] = program;
  9238. return id;
  9239. }
  9240. function _emscripten_glCompressedTexImage2D(target, level, internalFormat, width, height, border, imageSize, data) {
  9241. GLctx['compressedTexImage2D'](target, level, internalFormat, width, height, border, data ? HEAPU8.subarray((data),(data+imageSize)) : null);
  9242. }
  9243. function _emscripten_glClearColor(x0, x1, x2, x3) { GLctx['clearColor'](x0, x1, x2, x3) }
  9244. function _emscripten_glBindVertexArray(vao) {
  9245. GLctx['bindVertexArray'](GL.vaos[vao]);
  9246. }
  9247. function _setenv(envname, envval, overwrite) {
  9248. if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_3(113, envname, envval, overwrite);
  9249. // int setenv(const char *envname, const char *envval, int overwrite);
  9250. // http://pubs.opengroup.org/onlinepubs/009695399/functions/setenv.html
  9251. if (envname === 0) {
  9252. ___setErrNo(ERRNO_CODES.EINVAL);
  9253. return -1;
  9254. }
  9255. var name = Pointer_stringify(envname);
  9256. var val = Pointer_stringify(envval);
  9257. if (name === '' || name.indexOf('=') !== -1) {
  9258. ___setErrNo(ERRNO_CODES.EINVAL);
  9259. return -1;
  9260. }
  9261. if (ENV.hasOwnProperty(name) && !overwrite) return 0;
  9262. ENV[name] = val;
  9263. ___buildEnvironment(ENV);
  9264. return 0;
  9265. }
  9266. function _emscripten_glLoadMatrixf() {
  9267. Module['printErr']('missing function: emscripten_glLoadMatrixf'); abort(-1);
  9268. }
  9269. function _glDeleteShader(id) {
  9270. if (!id) return;
  9271. var shader = GL.shaders[id];
  9272. if (!shader) { // glDeleteShader actually signals an error when deleting a nonexisting object, unlike some other GL delete functions.
  9273. GL.recordError(0x0501 /* GL_INVALID_VALUE */);
  9274. return;
  9275. }
  9276. GLctx.deleteShader(shader);
  9277. GL.shaders[id] = null;
  9278. }
  9279. function _emscripten_glGetProgramiv(program, pname, p) {
  9280. if (!p) {
  9281. // GLES2 specification does not specify how to behave if p is a null pointer. Since calling this function does not make sense
  9282. // if p == null, issue a GL error to notify user about it.
  9283. GL.recordError(0x0501 /* GL_INVALID_VALUE */);
  9284. return;
  9285. }
  9286. if (program >= GL.counter) {
  9287. GL.recordError(0x0501 /* GL_INVALID_VALUE */);
  9288. return;
  9289. }
  9290. var ptable = GL.programInfos[program];
  9291. if (!ptable) {
  9292. GL.recordError(0x0502 /* GL_INVALID_OPERATION */);
  9293. return;
  9294. }
  9295. if (pname == 0x8B84) { // GL_INFO_LOG_LENGTH
  9296. var log = GLctx.getProgramInfoLog(GL.programs[program]);
  9297. if (log === null) log = '(unknown error)';
  9298. HEAP32[((p)>>2)]=log.length + 1;
  9299. } else if (pname == 0x8B87 /* GL_ACTIVE_UNIFORM_MAX_LENGTH */) {
  9300. HEAP32[((p)>>2)]=ptable.maxUniformLength;
  9301. } else if (pname == 0x8B8A /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */) {
  9302. if (ptable.maxAttributeLength == -1) {
  9303. var program = GL.programs[program];
  9304. var numAttribs = GLctx.getProgramParameter(program, GLctx.ACTIVE_ATTRIBUTES);
  9305. ptable.maxAttributeLength = 0; // Spec says if there are no active attribs, 0 must be returned.
  9306. for (var i = 0; i < numAttribs; ++i) {
  9307. var activeAttrib = GLctx.getActiveAttrib(program, i);
  9308. ptable.maxAttributeLength = Math.max(ptable.maxAttributeLength, activeAttrib.name.length+1);
  9309. }
  9310. }
  9311. HEAP32[((p)>>2)]=ptable.maxAttributeLength;
  9312. } else if (pname == 0x8A35 /* GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */) {
  9313. if (ptable.maxUniformBlockNameLength == -1) {
  9314. var program = GL.programs[program];
  9315. var numBlocks = GLctx.getProgramParameter(program, GLctx.ACTIVE_UNIFORM_BLOCKS);
  9316. ptable.maxUniformBlockNameLength = 0;
  9317. for (var i = 0; i < numBlocks; ++i) {
  9318. var activeBlockName = GLctx.getActiveUniformBlockName(program, i);
  9319. ptable.maxUniformBlockNameLength = Math.max(ptable.maxUniformBlockNameLength, activeBlockName.length+1);
  9320. }
  9321. }
  9322. HEAP32[((p)>>2)]=ptable.maxUniformBlockNameLength;
  9323. } else {
  9324. HEAP32[((p)>>2)]=GLctx.getProgramParameter(GL.programs[program], pname);
  9325. }
  9326. }
  9327. function _emscripten_glGetProgramInfoLog(program, maxLength, length, infoLog) {
  9328. var log = GLctx.getProgramInfoLog(GL.programs[program]);
  9329. if (log === null) log = '(unknown error)';
  9330. if (maxLength > 0 && infoLog) {
  9331. var numBytesWrittenExclNull = stringToUTF8(log, infoLog, maxLength);
  9332. if (length) HEAP32[((length)>>2)]=numBytesWrittenExclNull;
  9333. } else {
  9334. if (length) HEAP32[((length)>>2)]=0;
  9335. }
  9336. }
  9337. function _emscripten_glTexImage2D(target, level, internalFormat, width, height, border, format, type, pixels) {
  9338. var pixelData = null;
  9339. if (pixels) pixelData = emscriptenWebGLGetTexPixelData(type, format, width, height, pixels, internalFormat);
  9340. GLctx.texImage2D(target, level, internalFormat, width, height, border, format, type, pixelData);
  9341. }
  9342. function _glPixelStorei(pname, param) {
  9343. if (pname == 0x0D05 /* GL_PACK_ALIGNMENT */) {
  9344. GL.packAlignment = param;
  9345. } else if (pname == 0x0cf5 /* GL_UNPACK_ALIGNMENT */) {
  9346. GL.unpackAlignment = param;
  9347. }
  9348. GLctx.pixelStorei(pname, param);
  9349. }
  9350. function ___unlock() {}
  9351. function _emscripten_glColorPointer() {
  9352. Module['printErr']('missing function: emscripten_glColorPointer'); abort(-1);
  9353. }
  9354. function _glViewport(x0, x1, x2, x3) { GLctx['viewport'](x0, x1, x2, x3) }
  9355. function _glfwDestroyWindow(winid) {
  9356. return GLFW.destroyWindow(winid);
  9357. }
  9358. function _emscripten_glFlush() { GLctx['flush']() }
  9359. function _glfwSetErrorCallback(cbfun) {
  9360. GLFW.errorFunc = cbfun;
  9361. }
  9362. function _emscripten_glCreateShader(shaderType) {
  9363. var id = GL.getNewId(GL.shaders);
  9364. GL.shaders[id] = GLctx.createShader(shaderType);
  9365. return id;
  9366. }
  9367. function _glUniformMatrix4fv(location, count, transpose, value) {
  9368. var view;
  9369. if (16*count <= GL.MINI_TEMP_BUFFER_SIZE) {
  9370. // avoid allocation when uploading few enough uniforms
  9371. view = GL.miniTempBufferViews[16*count-1];
  9372. for (var i = 0; i < 16*count; i += 16) {
  9373. view[i] = HEAPF32[(((value)+(4*i))>>2)];
  9374. view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)];
  9375. view[i+2] = HEAPF32[(((value)+(4*i+8))>>2)];
  9376. view[i+3] = HEAPF32[(((value)+(4*i+12))>>2)];
  9377. view[i+4] = HEAPF32[(((value)+(4*i+16))>>2)];
  9378. view[i+5] = HEAPF32[(((value)+(4*i+20))>>2)];
  9379. view[i+6] = HEAPF32[(((value)+(4*i+24))>>2)];
  9380. view[i+7] = HEAPF32[(((value)+(4*i+28))>>2)];
  9381. view[i+8] = HEAPF32[(((value)+(4*i+32))>>2)];
  9382. view[i+9] = HEAPF32[(((value)+(4*i+36))>>2)];
  9383. view[i+10] = HEAPF32[(((value)+(4*i+40))>>2)];
  9384. view[i+11] = HEAPF32[(((value)+(4*i+44))>>2)];
  9385. view[i+12] = HEAPF32[(((value)+(4*i+48))>>2)];
  9386. view[i+13] = HEAPF32[(((value)+(4*i+52))>>2)];
  9387. view[i+14] = HEAPF32[(((value)+(4*i+56))>>2)];
  9388. view[i+15] = HEAPF32[(((value)+(4*i+60))>>2)];
  9389. }
  9390. } else {
  9391. view = HEAPF32.subarray((value)>>2,(value+count*64)>>2);
  9392. }
  9393. GLctx.uniformMatrix4fv(GL.uniforms[location], !!transpose, view);
  9394. }
  9395. function _emscripten_glValidateProgram(program) {
  9396. GLctx.validateProgram(GL.programs[program]);
  9397. }
  9398. function _emscripten_syscall(which, varargs) {
  9399. switch (which) {
  9400. case 54: return ___syscall54(which, varargs);
  9401. case 6: return ___syscall6(which, varargs);
  9402. case 140: return ___syscall140(which, varargs);
  9403. case 146: return ___syscall146(which, varargs);
  9404. default: throw "surprising proxied syscall: " + which;
  9405. }
  9406. }
  9407. function _glTexParameteri(x0, x1, x2) { GLctx['texParameteri'](x0, x1, x2) }
  9408. function _glFrontFace(x0) { GLctx['frontFace'](x0) }
  9409. function _emscripten_glColorMask(red, green, blue, alpha) {
  9410. GLctx.colorMask(!!red, !!green, !!blue, !!alpha);
  9411. }
  9412. function _emscripten_glPixelStorei(pname, param) {
  9413. if (pname == 0x0D05 /* GL_PACK_ALIGNMENT */) {
  9414. GL.packAlignment = param;
  9415. } else if (pname == 0x0cf5 /* GL_UNPACK_ALIGNMENT */) {
  9416. GL.unpackAlignment = param;
  9417. }
  9418. GLctx.pixelStorei(pname, param);
  9419. }
  9420. function _emscripten_glDeleteTextures(n, textures) {
  9421. for (var i = 0; i < n; i++) {
  9422. var id = HEAP32[(((textures)+(i*4))>>2)];
  9423. var texture = GL.textures[id];
  9424. if (!texture) continue; // GL spec: "glDeleteTextures silently ignores 0s and names that do not correspond to existing textures".
  9425. GLctx.deleteTexture(texture);
  9426. texture.name = 0;
  9427. GL.textures[id] = null;
  9428. }
  9429. }
  9430. function _fpathconf(fildes, name) {
  9431. if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_2(46, fildes, name);
  9432. // long fpathconf(int fildes, int name);
  9433. // http://pubs.opengroup.org/onlinepubs/000095399/functions/encrypt.html
  9434. // NOTE: The first parameter is ignored, so pathconf == fpathconf.
  9435. // The constants here aren't real values. Just mimicking glibc.
  9436. switch (name) {
  9437. case 0:
  9438. return 32000;
  9439. case 1:
  9440. case 2:
  9441. case 3:
  9442. return 255;
  9443. case 4:
  9444. case 5:
  9445. case 16:
  9446. case 17:
  9447. case 18:
  9448. return 4096;
  9449. case 6:
  9450. case 7:
  9451. case 20:
  9452. return 1;
  9453. case 8:
  9454. return 0;
  9455. case 9:
  9456. case 10:
  9457. case 11:
  9458. case 12:
  9459. case 14:
  9460. case 15:
  9461. case 19:
  9462. return -1;
  9463. case 13:
  9464. return 64;
  9465. }
  9466. ___setErrNo(ERRNO_CODES.EINVAL);
  9467. return -1;
  9468. }
  9469. function _putenv(string) {
  9470. if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_1(115, string);
  9471. // int putenv(char *string);
  9472. // http://pubs.opengroup.org/onlinepubs/009695399/functions/putenv.html
  9473. // WARNING: According to the standard (and the glibc implementation), the
  9474. // string is taken by reference so future changes are reflected.
  9475. // We copy it instead, possibly breaking some uses.
  9476. if (string === 0) {
  9477. ___setErrNo(ERRNO_CODES.EINVAL);
  9478. return -1;
  9479. }
  9480. string = Pointer_stringify(string);
  9481. var splitPoint = string.indexOf('=')
  9482. if (string === '' || string.indexOf('=') === -1) {
  9483. ___setErrNo(ERRNO_CODES.EINVAL);
  9484. return -1;
  9485. }
  9486. var name = string.slice(0, splitPoint);
  9487. var value = string.slice(splitPoint + 1);
  9488. if (!(name in ENV) || ENV[name] !== value) {
  9489. ENV[name] = value;
  9490. ___buildEnvironment(ENV);
  9491. }
  9492. return 0;
  9493. }
  9494. function _emscripten_glGenVertexArrays(n, arrays) {
  9495. for (var i = 0; i < n; i++) {
  9496. var vao = GLctx['createVertexArray']();
  9497. if (!vao) {
  9498. GL.recordError(0x0502 /* GL_INVALID_OPERATION */);
  9499. while(i < n) HEAP32[(((arrays)+(i++*4))>>2)]=0;
  9500. return;
  9501. }
  9502. var id = GL.getNewId(GL.vaos);
  9503. vao.name = id;
  9504. GL.vaos[id] = vao;
  9505. HEAP32[(((arrays)+(i*4))>>2)]=id;
  9506. }
  9507. }
  9508. function _time(ptr) {
  9509. var ret = (Date.now()/1000)|0;
  9510. if (ptr) {
  9511. HEAP32[((ptr)>>2)]=ret;
  9512. }
  9513. return ret;
  9514. }
  9515. function _emscripten_glGetBooleanv(name_, p) {
  9516. emscriptenWebGLGet(name_, p, 'Boolean');
  9517. }
  9518. function _utimes(path, times) {
  9519. if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_2(13, path, times);
  9520. var time;
  9521. if (times) {
  9522. var offset = 8 + 0;
  9523. time = HEAP32[(((times)+(offset))>>2)] * 1000;
  9524. offset = 8 + 4;
  9525. time += HEAP32[(((times)+(offset))>>2)] / 1000;
  9526. } else {
  9527. time = Date.now();
  9528. }
  9529. path = Pointer_stringify(path);
  9530. try {
  9531. FS.utime(path, time, time);
  9532. return 0;
  9533. } catch (e) {
  9534. FS.handleFSError(e);
  9535. return -1;
  9536. }
  9537. }
  9538. function _emscripten_glCompileShader(shader) {
  9539. GLctx.compileShader(GL.shaders[shader]);
  9540. }
  9541. var GLctx; GL.init();
  9542. if (ENVIRONMENT_IS_NODE) {
  9543. _emscripten_get_now = function _emscripten_get_now_actual() {
  9544. var t = process['hrtime']();
  9545. return t[0] * 1e3 + t[1] / 1e6;
  9546. };
  9547. } else if (typeof dateNow !== 'undefined') {
  9548. _emscripten_get_now = dateNow;
  9549. } else if (typeof self === 'object' && self['performance'] && typeof self['performance']['now'] === 'function') {
  9550. _emscripten_get_now = function() { return self['performance']['now'](); };
  9551. } else if (typeof performance === 'object' && typeof performance['now'] === 'function') {
  9552. _emscripten_get_now = function() { return performance['now'](); };
  9553. } else {
  9554. _emscripten_get_now = Date.now;
  9555. };
  9556. Module["requestFullScreen"] = function Module_requestFullScreen(lockPointer, resizeCanvas, vrDevice) { Module.printErr("Module.requestFullScreen is deprecated. Please call Module.requestFullscreen instead."); Module["requestFullScreen"] = Module["requestFullscreen"]; Browser.requestFullScreen(lockPointer, resizeCanvas, vrDevice) };
  9557. Module["requestFullscreen"] = function Module_requestFullscreen(lockPointer, resizeCanvas, vrDevice) { Browser.requestFullscreen(lockPointer, resizeCanvas, vrDevice) };
  9558. Module["requestAnimationFrame"] = function Module_requestAnimationFrame(func) { Browser.requestAnimationFrame(func) };
  9559. Module["setCanvasSize"] = function Module_setCanvasSize(width, height, noUpdates) { Browser.setCanvasSize(width, height, noUpdates) };
  9560. Module["pauseMainLoop"] = function Module_pauseMainLoop() { Browser.mainLoop.pause() };
  9561. Module["resumeMainLoop"] = function Module_resumeMainLoop() { Browser.mainLoop.resume() };
  9562. Module["getUserMedia"] = function Module_getUserMedia() { Browser.getUserMedia() }
  9563. Module["createContext"] = function Module_createContext(canvas, useWebGL, setInModule, webGLContextAttributes) { return Browser.createContext(canvas, useWebGL, setInModule, webGLContextAttributes) };
  9564. FS.staticInit();__ATINIT__.unshift(function() { if (!Module["noFSInit"] && !FS.init.initialized) FS.init() });__ATMAIN__.push(function() { FS.ignorePermissions = false });__ATEXIT__.push(function() { FS.quit() });Module["FS_createFolder"] = FS.createFolder;Module["FS_createPath"] = FS.createPath;Module["FS_createDataFile"] = FS.createDataFile;Module["FS_createPreloadedFile"] = FS.createPreloadedFile;Module["FS_createLazyFile"] = FS.createLazyFile;Module["FS_createLink"] = FS.createLink;Module["FS_createDevice"] = FS.createDevice;Module["FS_unlink"] = FS.unlink;;
  9565. __ATINIT__.unshift(function() { TTY.init() });__ATEXIT__.push(function() { TTY.shutdown() });;
  9566. if (ENVIRONMENT_IS_NODE) { var fs = require("fs"); var NODEJS_PATH = require("path"); NODEFS.staticInit(); };
  9567. JSEvents.staticInit();;
  9568. if (!ENVIRONMENT_IS_PTHREAD) PThread.initMainThreadBlock();;
  9569. if (!ENVIRONMENT_IS_PTHREAD) ___buildEnvironment(ENV);;
  9570. if (!ENVIRONMENT_IS_PTHREAD) {
  9571. // Only main thread initializes these, pthreads copy them over at thread worker init time (in pthread-main.js)
  9572. DYNAMICTOP_PTR = allocate(1, "i32", ALLOC_STATIC);
  9573. STACK_BASE = STACKTOP = Runtime.alignMemory(STATICTOP);
  9574. STACK_MAX = STACK_BASE + TOTAL_STACK;
  9575. DYNAMIC_BASE = Runtime.alignMemory(STACK_MAX);
  9576. HEAP32[DYNAMICTOP_PTR>>2] = DYNAMIC_BASE;
  9577. staticSealed = true; // seal the static portion of memory
  9578. assert(DYNAMIC_BASE < TOTAL_MEMORY, "TOTAL_MEMORY not big enough for stack");
  9579. }
  9580. function nullFunc_viiiii(x) { Module["printErr"]("Invalid function pointer called with signature 'viiiii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9581. function nullFunc_vd(x) { Module["printErr"]("Invalid function pointer called with signature 'vd'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9582. function nullFunc_vid(x) { Module["printErr"]("Invalid function pointer called with signature 'vid'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9583. function nullFunc_vi(x) { Module["printErr"]("Invalid function pointer called with signature 'vi'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9584. function nullFunc_vii(x) { Module["printErr"]("Invalid function pointer called with signature 'vii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9585. function nullFunc_ii(x) { Module["printErr"]("Invalid function pointer called with signature 'ii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9586. function nullFunc_viddd(x) { Module["printErr"]("Invalid function pointer called with signature 'viddd'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9587. function nullFunc_vidd(x) { Module["printErr"]("Invalid function pointer called with signature 'vidd'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9588. function nullFunc_iiii(x) { Module["printErr"]("Invalid function pointer called with signature 'iiii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9589. function nullFunc_viiiiiiii(x) { Module["printErr"]("Invalid function pointer called with signature 'viiiiiiii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9590. function nullFunc_viiiiii(x) { Module["printErr"]("Invalid function pointer called with signature 'viiiiii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9591. function nullFunc_viii(x) { Module["printErr"]("Invalid function pointer called with signature 'viii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9592. function nullFunc_vidddd(x) { Module["printErr"]("Invalid function pointer called with signature 'vidddd'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9593. function nullFunc_vdi(x) { Module["printErr"]("Invalid function pointer called with signature 'vdi'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9594. function nullFunc_viiiiiii(x) { Module["printErr"]("Invalid function pointer called with signature 'viiiiiii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9595. function nullFunc_viiiiiiiii(x) { Module["printErr"]("Invalid function pointer called with signature 'viiiiiiiii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9596. function nullFunc_iii(x) { Module["printErr"]("Invalid function pointer called with signature 'iii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9597. function nullFunc_i(x) { Module["printErr"]("Invalid function pointer called with signature 'i'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9598. function nullFunc_vdddddd(x) { Module["printErr"]("Invalid function pointer called with signature 'vdddddd'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9599. function nullFunc_vdddd(x) { Module["printErr"]("Invalid function pointer called with signature 'vdddd'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9600. function nullFunc_vdd(x) { Module["printErr"]("Invalid function pointer called with signature 'vdd'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9601. function nullFunc_v(x) { Module["printErr"]("Invalid function pointer called with signature 'v'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9602. function nullFunc_viid(x) { Module["printErr"]("Invalid function pointer called with signature 'viid'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9603. function nullFunc_viiii(x) { Module["printErr"]("Invalid function pointer called with signature 'viiii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x) }
  9604. function invoke_viiiii(index,a1,a2,a3,a4,a5) {
  9605. try {
  9606. Module["dynCall_viiiii"](index,a1,a2,a3,a4,a5);
  9607. } catch(e) {
  9608. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9609. Module["setThrew"](1, 0);
  9610. }
  9611. }
  9612. function invoke_vd(index,a1) {
  9613. try {
  9614. Module["dynCall_vd"](index,a1);
  9615. } catch(e) {
  9616. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9617. Module["setThrew"](1, 0);
  9618. }
  9619. }
  9620. function invoke_vid(index,a1,a2) {
  9621. try {
  9622. Module["dynCall_vid"](index,a1,a2);
  9623. } catch(e) {
  9624. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9625. Module["setThrew"](1, 0);
  9626. }
  9627. }
  9628. function invoke_vi(index,a1) {
  9629. try {
  9630. Module["dynCall_vi"](index,a1);
  9631. } catch(e) {
  9632. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9633. Module["setThrew"](1, 0);
  9634. }
  9635. }
  9636. function invoke_vii(index,a1,a2) {
  9637. try {
  9638. Module["dynCall_vii"](index,a1,a2);
  9639. } catch(e) {
  9640. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9641. Module["setThrew"](1, 0);
  9642. }
  9643. }
  9644. function invoke_ii(index,a1) {
  9645. try {
  9646. return Module["dynCall_ii"](index,a1);
  9647. } catch(e) {
  9648. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9649. Module["setThrew"](1, 0);
  9650. }
  9651. }
  9652. function invoke_viddd(index,a1,a2,a3,a4) {
  9653. try {
  9654. Module["dynCall_viddd"](index,a1,a2,a3,a4);
  9655. } catch(e) {
  9656. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9657. Module["setThrew"](1, 0);
  9658. }
  9659. }
  9660. function invoke_vidd(index,a1,a2,a3) {
  9661. try {
  9662. Module["dynCall_vidd"](index,a1,a2,a3);
  9663. } catch(e) {
  9664. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9665. Module["setThrew"](1, 0);
  9666. }
  9667. }
  9668. function invoke_iiii(index,a1,a2,a3) {
  9669. try {
  9670. return Module["dynCall_iiii"](index,a1,a2,a3);
  9671. } catch(e) {
  9672. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9673. Module["setThrew"](1, 0);
  9674. }
  9675. }
  9676. function invoke_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8) {
  9677. try {
  9678. Module["dynCall_viiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8);
  9679. } catch(e) {
  9680. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9681. Module["setThrew"](1, 0);
  9682. }
  9683. }
  9684. function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6) {
  9685. try {
  9686. Module["dynCall_viiiiii"](index,a1,a2,a3,a4,a5,a6);
  9687. } catch(e) {
  9688. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9689. Module["setThrew"](1, 0);
  9690. }
  9691. }
  9692. function invoke_viii(index,a1,a2,a3) {
  9693. try {
  9694. Module["dynCall_viii"](index,a1,a2,a3);
  9695. } catch(e) {
  9696. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9697. Module["setThrew"](1, 0);
  9698. }
  9699. }
  9700. function invoke_vidddd(index,a1,a2,a3,a4,a5) {
  9701. try {
  9702. Module["dynCall_vidddd"](index,a1,a2,a3,a4,a5);
  9703. } catch(e) {
  9704. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9705. Module["setThrew"](1, 0);
  9706. }
  9707. }
  9708. function invoke_vdi(index,a1,a2) {
  9709. try {
  9710. Module["dynCall_vdi"](index,a1,a2);
  9711. } catch(e) {
  9712. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9713. Module["setThrew"](1, 0);
  9714. }
  9715. }
  9716. function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7) {
  9717. try {
  9718. Module["dynCall_viiiiiii"](index,a1,a2,a3,a4,a5,a6,a7);
  9719. } catch(e) {
  9720. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9721. Module["setThrew"](1, 0);
  9722. }
  9723. }
  9724. function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9) {
  9725. try {
  9726. Module["dynCall_viiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9);
  9727. } catch(e) {
  9728. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9729. Module["setThrew"](1, 0);
  9730. }
  9731. }
  9732. function invoke_iii(index,a1,a2) {
  9733. try {
  9734. return Module["dynCall_iii"](index,a1,a2);
  9735. } catch(e) {
  9736. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9737. Module["setThrew"](1, 0);
  9738. }
  9739. }
  9740. function invoke_i(index) {
  9741. try {
  9742. return Module["dynCall_i"](index);
  9743. } catch(e) {
  9744. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9745. Module["setThrew"](1, 0);
  9746. }
  9747. }
  9748. function invoke_vdddddd(index,a1,a2,a3,a4,a5,a6) {
  9749. try {
  9750. Module["dynCall_vdddddd"](index,a1,a2,a3,a4,a5,a6);
  9751. } catch(e) {
  9752. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9753. Module["setThrew"](1, 0);
  9754. }
  9755. }
  9756. function invoke_vdddd(index,a1,a2,a3,a4) {
  9757. try {
  9758. Module["dynCall_vdddd"](index,a1,a2,a3,a4);
  9759. } catch(e) {
  9760. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9761. Module["setThrew"](1, 0);
  9762. }
  9763. }
  9764. function invoke_vdd(index,a1,a2) {
  9765. try {
  9766. Module["dynCall_vdd"](index,a1,a2);
  9767. } catch(e) {
  9768. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9769. Module["setThrew"](1, 0);
  9770. }
  9771. }
  9772. function invoke_v(index) {
  9773. try {
  9774. Module["dynCall_v"](index);
  9775. } catch(e) {
  9776. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9777. Module["setThrew"](1, 0);
  9778. }
  9779. }
  9780. function invoke_viid(index,a1,a2,a3) {
  9781. try {
  9782. Module["dynCall_viid"](index,a1,a2,a3);
  9783. } catch(e) {
  9784. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9785. Module["setThrew"](1, 0);
  9786. }
  9787. }
  9788. function invoke_viiii(index,a1,a2,a3,a4) {
  9789. try {
  9790. Module["dynCall_viiii"](index,a1,a2,a3,a4);
  9791. } catch(e) {
  9792. if (typeof e !== 'number' && e !== 'longjmp') throw e;
  9793. Module["setThrew"](1, 0);
  9794. }
  9795. }
  9796. Module.asmGlobalArg = { "Math": Math, "Int8Array": Int8Array, "Int16Array": Int16Array, "Int32Array": Int32Array, "Uint8Array": Uint8Array, "Uint16Array": Uint16Array, "Uint32Array": Uint32Array, "Float32Array": Float32Array, "Float64Array": Float64Array, "NaN": NaN, "Infinity": Infinity };
  9797. Module.asmGlobalArg['Atomics'] = Atomics;
  9798. Module.asmLibraryArg = { "abort": abort, "assert": assert, "enlargeMemory": enlargeMemory, "getTotalMemory": getTotalMemory, "abortOnCannotGrowMemory": abortOnCannotGrowMemory, "abortStackOverflow": abortStackOverflow, "nullFunc_viiiii": nullFunc_viiiii, "nullFunc_vd": nullFunc_vd, "nullFunc_vid": nullFunc_vid, "nullFunc_vi": nullFunc_vi, "nullFunc_vii": nullFunc_vii, "nullFunc_ii": nullFunc_ii, "nullFunc_viddd": nullFunc_viddd, "nullFunc_vidd": nullFunc_vidd, "nullFunc_iiii": nullFunc_iiii, "nullFunc_viiiiiiii": nullFunc_viiiiiiii, "nullFunc_viiiiii": nullFunc_viiiiii, "nullFunc_viii": nullFunc_viii, "nullFunc_vidddd": nullFunc_vidddd, "nullFunc_vdi": nullFunc_vdi, "nullFunc_viiiiiii": nullFunc_viiiiiii, "nullFunc_viiiiiiiii": nullFunc_viiiiiiiii, "nullFunc_iii": nullFunc_iii, "nullFunc_i": nullFunc_i, "nullFunc_vdddddd": nullFunc_vdddddd, "nullFunc_vdddd": nullFunc_vdddd, "nullFunc_vdd": nullFunc_vdd, "nullFunc_v": nullFunc_v, "nullFunc_viid": nullFunc_viid, "nullFunc_viiii": nullFunc_viiii, "invoke_viiiii": invoke_viiiii, "invoke_vd": invoke_vd, "invoke_vid": invoke_vid, "invoke_vi": invoke_vi, "invoke_vii": invoke_vii, "invoke_ii": invoke_ii, "invoke_viddd": invoke_viddd, "invoke_vidd": invoke_vidd, "invoke_iiii": invoke_iiii, "invoke_viiiiiiii": invoke_viiiiiiii, "invoke_viiiiii": invoke_viiiiii, "invoke_viii": invoke_viii, "invoke_vidddd": invoke_vidddd, "invoke_vdi": invoke_vdi, "invoke_viiiiiii": invoke_viiiiiii, "invoke_viiiiiiiii": invoke_viiiiiiiii, "invoke_iii": invoke_iii, "invoke_i": invoke_i, "invoke_vdddddd": invoke_vdddddd, "invoke_vdddd": invoke_vdddd, "invoke_vdd": invoke_vdd, "invoke_v": invoke_v, "invoke_viid": invoke_viid, "invoke_viiii": invoke_viiii, "_emscripten_glGetTexParameterfv": _emscripten_glGetTexParameterfv, "_glUseProgram": _glUseProgram, "_glfwCreateWindow": _glfwCreateWindow, "_emscripten_glReleaseShaderCompiler": _emscripten_glReleaseShaderCompiler, "_emscripten_glBlendFuncSeparate": _emscripten_glBlendFuncSeparate, "_emscripten_glVertexAttribPointer": _emscripten_glVertexAttribPointer, "_emscripten_glGetIntegerv": _emscripten_glGetIntegerv, "_emscripten_glCullFace": _emscripten_glCullFace, "_emscripten_glIsProgram": _emscripten_glIsProgram, "_emscripten_glStencilMaskSeparate": _emscripten_glStencilMaskSeparate, "_emscripten_glViewport": _emscripten_glViewport, "_emscripten_glFrontFace": _emscripten_glFrontFace, "___assert_fail": ___assert_fail, "_glDeleteProgram": _glDeleteProgram, "_emscripten_glUniform3fv": _emscripten_glUniform3fv, "_emscripten_glPolygonOffset": _emscripten_glPolygonOffset, "_emscripten_glUseProgram": _emscripten_glUseProgram, "_emscripten_glBlendColor": _emscripten_glBlendColor, "_glBindBuffer": _glBindBuffer, "_emscripten_glDepthFunc": _emscripten_glDepthFunc, "_glGetShaderInfoLog": _glGetShaderInfoLog, "_clock_gettime": _clock_gettime, "_emscripten_set_fullscreenchange_callback": _emscripten_set_fullscreenchange_callback, "_emscripten_set_touchmove_callback": _emscripten_set_touchmove_callback, "_emscripten_set_main_loop_timing": _emscripten_set_main_loop_timing, "_glDisable": _glDisable, "_glBlendFunc": _glBlendFunc, "_emscripten_glDisableVertexAttribArray": _emscripten_glDisableVertexAttribArray, "_glGetAttribLocation": _glGetAttribLocation, "_glDisableVertexAttribArray": _glDisableVertexAttribArray, "_glCreateShader": _glCreateShader, "_emscripten_glCompileShader": _emscripten_glCompileShader, "_sysconf": _sysconf, "_utime": _utime, "_emscripten_glSampleCoverage": _emscripten_glSampleCoverage, "_emscripten_glVertexPointer": _emscripten_glVertexPointer, "_emscripten_set_touchstart_callback": _emscripten_set_touchstart_callback, "emscriptenWebGLComputeImageSize": emscriptenWebGLComputeImageSize, "_emscripten_glGetBooleanv": _emscripten_glGetBooleanv, "_emscripten_glGetShaderSource": _emscripten_glGetShaderSource, "_chroot": _chroot, "_glUniform4f": _glUniform4f, "_llvm_stacksave": _llvm_stacksave, "_emscripten_glUniform1i": _emscripten_glUniform1i, "_emscripten_glLoadMatrixf": _emscripten_glLoadMatrixf, "_emscripten_glGenBuffers": _emscripten_glGenBuffers, "_emscripten_glDeleteObjectARB": _emscripten_glDeleteObjectARB, "_glfwSetWindowSizeCallback": _glfwSetWindowSizeCallback, "_emscripten_glGetShaderPrecisionFormat": _emscripten_glGetShaderPrecisionFormat, "_glfwInit": _glfwInit, "_glGenBuffers": _glGenBuffers, "_glShaderSource": _glShaderSource, "_emscripten_glGetString": _emscripten_glGetString, "_emscripten_glIsFramebuffer": _emscripten_glIsFramebuffer, "_emscripten_glIsEnabled": _emscripten_glIsEnabled, "_emscripten_glScissor": _emscripten_glScissor, "__pthread_testcancel_js": __pthread_testcancel_js, "_emscripten_glVertexAttrib4fv": _emscripten_glVertexAttrib4fv, "_emscripten_glFramebufferTexture2D": _emscripten_glFramebufferTexture2D, "_emscripten_glTexParameteriv": _emscripten_glTexParameteriv, "_unsetenv": _unsetenv, "_emscripten_glBindProgramARB": _emscripten_glBindProgramARB, "_emscripten_glStencilOpSeparate": _emscripten_glStencilOpSeparate, "_emscripten_glFramebufferRenderbuffer": _emscripten_glFramebufferRenderbuffer, "___syscall140": ___syscall140, "_glfwSetErrorCallback": _glfwSetErrorCallback, "_glfwDefaultWindowHints": _glfwDefaultWindowHints, "_glfwDestroyWindow": _glfwDestroyWindow, "___syscall146": ___syscall146, "_emscripten_glGetActiveAttrib": _emscripten_glGetActiveAttrib, "_emscripten_glAttachShader": _emscripten_glAttachShader, "_emscripten_get_now_is_monotonic": _emscripten_get_now_is_monotonic, "_emscripten_glUniform2i": _emscripten_glUniform2i, "_emscripten_glUniform2f": _emscripten_glUniform2f, "_emscripten_glTexParameterfv": _emscripten_glTexParameterfv, "_emscripten_glIsBuffer": _emscripten_glIsBuffer, "_emscripten_glUniformMatrix2fv": _emscripten_glUniformMatrix2fv, "_glGetProgramInfoLog": _glGetProgramInfoLog, "_glfwSetScrollCallback": _glfwSetScrollCallback, "_emscripten_glTexParameterf": _emscripten_glTexParameterf, "_emscripten_glGetAttachedShaders": _emscripten_glGetAttachedShaders, "_emscripten_glGenTextures": _emscripten_glGenTextures, "_emscripten_glTexParameteri": _emscripten_glTexParameteri, "_llvm_stackrestore": _llvm_stackrestore, "_glfwMakeContextCurrent": _glfwMakeContextCurrent, "_emscripten_glClear": _emscripten_glClear, "_glDrawElements": _glDrawElements, "_glBufferSubData": _glBufferSubData, "_emscripten_glValidateProgram": _emscripten_glValidateProgram, "_emscripten_glVertexAttrib2fv": _emscripten_glVertexAttrib2fv, "_glViewport": _glViewport, "_emscripten_glUniform4iv": _emscripten_glUniform4iv, "_emscripten_glGetTexParameteriv": _emscripten_glGetTexParameteriv, "___setErrNo": ___setErrNo, "_eglGetProcAddress": _eglGetProcAddress, "_emscripten_glBindAttribLocation": _emscripten_glBindAttribLocation, "_glDeleteTextures": _glDeleteTextures, "_glDepthFunc": _glDepthFunc, "_emscripten_glClientActiveTexture": _emscripten_glClientActiveTexture, "_emscripten_glVertexAttrib2f": _emscripten_glVertexAttrib2f, "_emscripten_asm_const_v": _emscripten_asm_const_v, "_emscripten_glFlush": _emscripten_glFlush, "_emscripten_glBlendFunc": _emscripten_glBlendFunc, "_emscripten_glCheckFramebufferStatus": _emscripten_glCheckFramebufferStatus, "_emscripten_glGenerateMipmap": _emscripten_glGenerateMipmap, "_emscripten_glGetError": _emscripten_glGetError, "_emscripten_glClearDepthf": _emscripten_glClearDepthf, "_pthread_self": _pthread_self, "_emscripten_glBufferData": _emscripten_glBufferData, "_emscripten_glUniform3i": _emscripten_glUniform3i, "_emscripten_glGenRenderbuffers": _emscripten_glGenRenderbuffers, "_emscripten_glRotatef": _emscripten_glRotatef, "_emscripten_glDeleteShader": _emscripten_glDeleteShader, "_glEnable": _glEnable, "_emscripten_glGetShaderiv": _emscripten_glGetShaderiv, "_emscripten_glReadPixels": _emscripten_glReadPixels, "_emscripten_glMatrixMode": _emscripten_glMatrixMode, "_glGetString": _glGetString, "_emscripten_glClearStencil": _emscripten_glClearStencil, "_emscripten_glGetUniformLocation": _emscripten_glGetUniformLocation, "emscriptenWebGLGet": emscriptenWebGLGet, "_emscripten_glEnableVertexAttribArray": _emscripten_glEnableVertexAttribArray, "__register_pthread_ptr": __register_pthread_ptr, "_emscripten_get_now": _emscripten_get_now, "_emscripten_glNormalPointer": _emscripten_glNormalPointer, "_glAttachShader": _glAttachShader, "_emscripten_glTexCoordPointer": _emscripten_glTexCoordPointer, "_emscripten_glEnable": _emscripten_glEnable, "_glCreateProgram": _glCreateProgram, "_glUniformMatrix4fv": _glUniformMatrix4fv, "_emscripten_glClearDepth": _emscripten_glClearDepth, "___lock": ___lock, "emscriptenWebGLGetTexPixelData": emscriptenWebGLGetTexPixelData, "___syscall6": ___syscall6, "_emscripten_glStencilFuncSeparate": _emscripten_glStencilFuncSeparate, "_emscripten_glVertexAttrib3f": _emscripten_glVertexAttrib3f, "_time": _time, "_gettimeofday": _gettimeofday, "_emscripten_glVertexAttrib1f": _emscripten_glVertexAttrib1f, "_emscripten_glGetFramebufferAttachmentParameteriv": _emscripten_glGetFramebufferAttachmentParameteriv, "_emscripten_glBlendEquationSeparate": _emscripten_glBlendEquationSeparate, "_exit": _exit, "_emscripten_glEnableClientState": _emscripten_glEnableClientState, "__spawn_thread": __spawn_thread, "_emscripten_glUniform4i": _emscripten_glUniform4i, "_emscripten_conditional_set_current_thread_status_js": _emscripten_conditional_set_current_thread_status_js, "_putenv": _putenv, "_pthread_join": _pthread_join, "_glCullFace": _glCullFace, "_emscripten_glGetPointerv": _emscripten_glGetPointerv, "_emscripten_set_keypress_callback": _emscripten_set_keypress_callback, "__emscripten_sample_gamepad_data": __emscripten_sample_gamepad_data, "_fpathconf": _fpathconf, "_emscripten_get_gamepad_status": _emscripten_get_gamepad_status, "_emscripten_glUniform4f": _emscripten_glUniform4f, "_emscripten_glUniform2fv": _emscripten_glUniform2fv, "_glfwGetVideoModes": _glfwGetVideoModes, "___unlock": ___unlock, "_emscripten_set_click_callback": _emscripten_set_click_callback, "_emscripten_glFrustum": _emscripten_glFrustum, "_emscripten_is_main_runtime_thread": _emscripten_is_main_runtime_thread, "_emscripten_glShaderBinary": _emscripten_glShaderBinary, "_emscripten_glDrawElements": _emscripten_glDrawElements, "_glVertexAttribPointer": _glVertexAttribPointer, "_emscripten_get_num_gamepads": _emscripten_get_num_gamepads, "___buildEnvironment": ___buildEnvironment, "_glCompressedTexImage2D": _glCompressedTexImage2D, "_utimes": _utimes, "_emscripten_glUniform1iv": _emscripten_glUniform1iv, "_emscripten_glGetVertexAttribPointerv": _emscripten_glGetVertexAttribPointerv, "_glClearDepthf": _glClearDepthf, "_emscripten_glCompressedTexSubImage2D": _emscripten_glCompressedTexSubImage2D, "emscriptenWebGLGetUniform": emscriptenWebGLGetUniform, "_tzset": _tzset, "_emscripten_glDeleteVertexArrays": _emscripten_glDeleteVertexArrays, "_glfwSetWindowShouldClose": _glfwSetWindowShouldClose, "_emscripten_glUniform1fv": _emscripten_glUniform1fv, "_emscripten_glGetActiveUniform": _emscripten_glGetActiveUniform, "_glBindTexture": _glBindTexture, "_emscripten_glUniform3iv": _emscripten_glUniform3iv, "_emscripten_glUniform2iv": _emscripten_glUniform2iv, "_emscripten_glHint": _emscripten_glHint, "_glfwSetCharCallback": _glfwSetCharCallback, "emscriptenWebGLGetVertexAttrib": emscriptenWebGLGetVertexAttrib, "_glGetFloatv": _glGetFloatv, "_emscripten_glDeleteProgram": _emscripten_glDeleteProgram, "_emscripten_glDeleteRenderbuffers": _emscripten_glDeleteRenderbuffers, "___clock_gettime": ___clock_gettime, "_emscripten_glDrawElementsInstanced": _emscripten_glDrawElementsInstanced, "_emscripten_glVertexAttrib4f": _emscripten_glVertexAttrib4f, "_glDrawArrays": _glDrawArrays, "_emscripten_glTexSubImage2D": _emscripten_glTexSubImage2D, "_clearenv": _clearenv, "_emscripten_glPixelStorei": _emscripten_glPixelStorei, "_glCompileShader": _glCompileShader, "_emscripten_get_pointerlock_status": _emscripten_get_pointerlock_status, "_emscripten_memcpy_big": _emscripten_memcpy_big, "_emscripten_glUniformMatrix3fv": _emscripten_glUniformMatrix3fv, "_emscripten_glColorPointer": _emscripten_glColorPointer, "_getenv": _getenv, "_emscripten_glDepthRange": _emscripten_glDepthRange, "_emscripten_glGetBufferParameteriv": _emscripten_glGetBufferParameteriv, "_emscripten_glFinish": _emscripten_glFinish, "_emscripten_glRenderbufferStorage": _emscripten_glRenderbufferStorage, "_emscripten_set_gamepaddisconnected_callback": _emscripten_set_gamepaddisconnected_callback, "_emscripten_asm_const_iii": _emscripten_asm_const_iii, "_emscripten_glDepthMask": _emscripten_glDepthMask, "_glfwSetWindowIconifyCallback": _glfwSetWindowIconifyCallback, "_emscripten_glDrawBuffers": _emscripten_glDrawBuffers, "_glfwTerminate": _glfwTerminate, "_emscripten_futex_wake": _emscripten_futex_wake, "_glFrontFace": _glFrontFace, "_emscripten_glGetObjectParameterivARB": _emscripten_glGetObjectParameterivARB, "_emscripten_exit_pointerlock": _emscripten_exit_pointerlock, "_glfwSwapInterval": _glfwSwapInterval, "_glUniform1i": _glUniform1i, "_glEnableVertexAttribArray": _glEnableVertexAttribArray, "_emscripten_glStencilFunc": _emscripten_glStencilFunc, "_abort": _abort, "_emscripten_glGetUniformiv": _emscripten_glGetUniformiv, "__cleanup_thread": __cleanup_thread, "_glDeleteBuffers": _glDeleteBuffers, "_glBufferData": _glBufferData, "_glTexImage2D": _glTexImage2D, "_emscripten_set_current_thread_status_js": _emscripten_set_current_thread_status_js, "_glfwSetKeyCallback": _glfwSetKeyCallback, "_emscripten_glGenFramebuffers": _emscripten_glGenFramebuffers, "_emscripten_glUniformMatrix4fv": _emscripten_glUniformMatrix4fv, "_emscripten_glLoadIdentity": _emscripten_glLoadIdentity, "_glDeleteShader": _glDeleteShader, "_emscripten_glUniform1f": _emscripten_glUniform1f, "_glGetProgramiv": _glGetProgramiv, "_emscripten_glBindFramebuffer": _emscripten_glBindFramebuffer, "_emscripten_glIsRenderbuffer": _emscripten_glIsRenderbuffer, "_glfwGetTime": _glfwGetTime, "_emscripten_glShaderSource": _emscripten_glShaderSource, "_emscripten_set_gamepadconnected_callback": _emscripten_set_gamepadconnected_callback, "_emscripten_syscall": _emscripten_syscall, "_emscripten_glGetVertexAttribiv": _emscripten_glGetVertexAttribiv, "_emscripten_glBindVertexArray": _emscripten_glBindVertexArray, "_emscripten_glDrawArraysInstanced": _emscripten_glDrawArraysInstanced, "_emscripten_set_touchcancel_callback": _emscripten_set_touchcancel_callback, "_emscripten_glCreateShader": _emscripten_glCreateShader, "_emscripten_glStencilMask": _emscripten_glStencilMask, "_emscripten_glDeleteTextures": _emscripten_glDeleteTextures, "_emscripten_glBindRenderbuffer": _emscripten_glBindRenderbuffer, "_glfwGetPrimaryMonitor": _glfwGetPrimaryMonitor, "_glLinkProgram": _glLinkProgram, "_emscripten_glVertexAttribDivisor": _emscripten_glVertexAttribDivisor, "_emscripten_set_touchend_callback": _emscripten_set_touchend_callback, "_emscripten_glGetUniformfv": _emscripten_glGetUniformfv, "_emscripten_glGetVertexAttribfv": _emscripten_glGetVertexAttribfv, "_emscripten_glGetRenderbufferParameteriv": _emscripten_glGetRenderbufferParameteriv, "_emscripten_futex_wait": _emscripten_futex_wait, "_emscripten_glDeleteFramebuffers": _emscripten_glDeleteFramebuffers, "_glGetShaderiv": _glGetShaderiv, "_emscripten_glVertexAttrib3fv": _emscripten_glVertexAttrib3fv, "_glGetUniformLocation": _glGetUniformLocation, "_emscripten_glGetInfoLogARB": _emscripten_glGetInfoLogARB, "_emscripten_request_pointerlock": _emscripten_request_pointerlock, "_glClear": _glClear, "_glGenTextures": _glGenTextures, "_emscripten_glDisable": _emscripten_glDisable, "_emscripten_glDepthRangef": _emscripten_glDepthRangef, "__exit": __exit, "_emscripten_glLineWidth": _emscripten_glLineWidth, "_emscripten_glUniform3f": _emscripten_glUniform3f, "_emscripten_glGetShaderInfoLog": _emscripten_glGetShaderInfoLog, "_emscripten_glStencilOp": _emscripten_glStencilOp, "___pthread_setcancelstate": ___pthread_setcancelstate, "_glBindAttribLocation": _glBindAttribLocation, "_glPixelStorei": _glPixelStorei, "_emscripten_glColorMask": _emscripten_glColorMask, "_emscripten_glLinkProgram": _emscripten_glLinkProgram, "_emscripten_glBlendEquation": _emscripten_glBlendEquation, "_emscripten_glIsTexture": _emscripten_glIsTexture, "_confstr": _confstr, "_emscripten_glGetProgramiv": _emscripten_glGetProgramiv, "_emscripten_glVertexAttrib1fv": _emscripten_glVertexAttrib1fv, "_emscripten_glBindTexture": _emscripten_glBindTexture, "_glfwSetMouseButtonCallback": _glfwSetMouseButtonCallback, "_glfwGetCursorPos": _glfwGetCursorPos, "_emscripten_glActiveTexture": _emscripten_glActiveTexture, "_emscripten_glDrawRangeElements": _emscripten_glDrawRangeElements, "___syscall54": ___syscall54, "_emscripten_glDeleteBuffers": _emscripten_glDeleteBuffers, "_emscripten_glBufferSubData": _emscripten_glBufferSubData, "_glfwSwapBuffers": _glfwSwapBuffers, "_pthread_create": _pthread_create, "_emscripten_set_main_loop": _emscripten_set_main_loop, "_emscripten_glGetProgramInfoLog": _emscripten_glGetProgramInfoLog, "_glfwWindowHint": _glfwWindowHint, "_pthread_getschedparam": _pthread_getschedparam, "_emscripten_glIsShader": _emscripten_glIsShader, "_emscripten_glUniform4fv": _emscripten_glUniform4fv, "_emscripten_glGenVertexArrays": _emscripten_glGenVertexArrays, "_emscripten_glDrawArrays": _emscripten_glDrawArrays, "_emscripten_glCompressedTexImage2D": _emscripten_glCompressedTexImage2D, "_emscripten_glClearColor": _emscripten_glClearColor, "_glfwSetCursorEnterCallback": _glfwSetCursorEnterCallback, "_emscripten_glCreateProgram": _emscripten_glCreateProgram, "_emscripten_glCopyTexSubImage2D": _emscripten_glCopyTexSubImage2D, "_emscripten_glGetAttribLocation": _emscripten_glGetAttribLocation, "_glTexParameteri": _glTexParameteri, "_emscripten_glBindBuffer": _emscripten_glBindBuffer, "_atexit": _atexit, "_emscripten_glGetFloatv": _emscripten_glGetFloatv, "_emscripten_glDetachShader": _emscripten_glDetachShader, "_glClearColor": _glClearColor, "_glfwSetCursorPosCallback": _glfwSetCursorPosCallback, "_setenv": _setenv, "_emscripten_glCopyTexImage2D": _emscripten_glCopyTexImage2D, "_emscripten_glTexImage2D": _emscripten_glTexImage2D, "DYNAMICTOP_PTR": DYNAMICTOP_PTR, "tempDoublePtr": tempDoublePtr, "ABORT": ABORT, "STACKTOP": STACKTOP, "STACK_MAX": STACK_MAX, "cttz_i8": cttz_i8 };
  9799. // EMSCRIPTEN_START_ASM
  9800. var asm = (function(global, env, buffer) {
  9801. 'use asm';
  9802. var HEAP8 = new global.Int8Array(buffer);
  9803. var HEAP16 = new global.Int16Array(buffer);
  9804. var HEAP32 = new global.Int32Array(buffer);
  9805. var HEAPU8 = new global.Uint8Array(buffer);
  9806. var HEAPU16 = new global.Uint16Array(buffer);
  9807. var HEAPU32 = new global.Uint32Array(buffer);
  9808. var HEAPF32 = new global.Float32Array(buffer);
  9809. var HEAPF64 = new global.Float64Array(buffer);
  9810. var DYNAMICTOP_PTR=env.DYNAMICTOP_PTR|0;
  9811. var tempDoublePtr=env.tempDoublePtr|0;
  9812. var ABORT=env.ABORT|0;
  9813. var STACKTOP=env.STACKTOP|0;
  9814. var STACK_MAX=env.STACK_MAX|0;
  9815. var cttz_i8=env.cttz_i8|0;
  9816. var __THREW__ = 0;
  9817. var threwValue = 0;
  9818. var setjmpId = 0;
  9819. var undef = 0;
  9820. var nan = global.NaN, inf = global.Infinity;
  9821. var tempInt = 0, tempBigInt = 0, tempBigIntP = 0, tempBigIntS = 0, tempBigIntR = 0.0, tempBigIntI = 0, tempBigIntD = 0, tempValue = 0, tempDouble = 0.0;
  9822. var tempRet0 = 0;
  9823. var Math_floor=global.Math.floor;
  9824. var Math_abs=global.Math.abs;
  9825. var Math_sqrt=global.Math.sqrt;
  9826. var Math_pow=global.Math.pow;
  9827. var Math_cos=global.Math.cos;
  9828. var Math_sin=global.Math.sin;
  9829. var Math_tan=global.Math.tan;
  9830. var Math_acos=global.Math.acos;
  9831. var Math_asin=global.Math.asin;
  9832. var Math_atan=global.Math.atan;
  9833. var Math_atan2=global.Math.atan2;
  9834. var Math_exp=global.Math.exp;
  9835. var Math_log=global.Math.log;
  9836. var Math_ceil=global.Math.ceil;
  9837. var Math_imul=global.Math.imul;
  9838. var Math_min=global.Math.min;
  9839. var Math_max=global.Math.max;
  9840. var Math_clz32=global.Math.clz32;
  9841. var abort=env.abort;
  9842. var assert=env.assert;
  9843. var enlargeMemory=env.enlargeMemory;
  9844. var getTotalMemory=env.getTotalMemory;
  9845. var abortOnCannotGrowMemory=env.abortOnCannotGrowMemory;
  9846. var abortStackOverflow=env.abortStackOverflow;
  9847. var nullFunc_viiiii=env.nullFunc_viiiii;
  9848. var nullFunc_vd=env.nullFunc_vd;
  9849. var nullFunc_vid=env.nullFunc_vid;
  9850. var nullFunc_vi=env.nullFunc_vi;
  9851. var nullFunc_vii=env.nullFunc_vii;
  9852. var nullFunc_ii=env.nullFunc_ii;
  9853. var nullFunc_viddd=env.nullFunc_viddd;
  9854. var nullFunc_vidd=env.nullFunc_vidd;
  9855. var nullFunc_iiii=env.nullFunc_iiii;
  9856. var nullFunc_viiiiiiii=env.nullFunc_viiiiiiii;
  9857. var nullFunc_viiiiii=env.nullFunc_viiiiii;
  9858. var nullFunc_viii=env.nullFunc_viii;
  9859. var nullFunc_vidddd=env.nullFunc_vidddd;
  9860. var nullFunc_vdi=env.nullFunc_vdi;
  9861. var nullFunc_viiiiiii=env.nullFunc_viiiiiii;
  9862. var nullFunc_viiiiiiiii=env.nullFunc_viiiiiiiii;
  9863. var nullFunc_iii=env.nullFunc_iii;
  9864. var nullFunc_i=env.nullFunc_i;
  9865. var nullFunc_vdddddd=env.nullFunc_vdddddd;
  9866. var nullFunc_vdddd=env.nullFunc_vdddd;
  9867. var nullFunc_vdd=env.nullFunc_vdd;
  9868. var nullFunc_v=env.nullFunc_v;
  9869. var nullFunc_viid=env.nullFunc_viid;
  9870. var nullFunc_viiii=env.nullFunc_viiii;
  9871. var invoke_viiiii=env.invoke_viiiii;
  9872. var invoke_vd=env.invoke_vd;
  9873. var invoke_vid=env.invoke_vid;
  9874. var invoke_vi=env.invoke_vi;
  9875. var invoke_vii=env.invoke_vii;
  9876. var invoke_ii=env.invoke_ii;
  9877. var invoke_viddd=env.invoke_viddd;
  9878. var invoke_vidd=env.invoke_vidd;
  9879. var invoke_iiii=env.invoke_iiii;
  9880. var invoke_viiiiiiii=env.invoke_viiiiiiii;
  9881. var invoke_viiiiii=env.invoke_viiiiii;
  9882. var invoke_viii=env.invoke_viii;
  9883. var invoke_vidddd=env.invoke_vidddd;
  9884. var invoke_vdi=env.invoke_vdi;
  9885. var invoke_viiiiiii=env.invoke_viiiiiii;
  9886. var invoke_viiiiiiiii=env.invoke_viiiiiiiii;
  9887. var invoke_iii=env.invoke_iii;
  9888. var invoke_i=env.invoke_i;
  9889. var invoke_vdddddd=env.invoke_vdddddd;
  9890. var invoke_vdddd=env.invoke_vdddd;
  9891. var invoke_vdd=env.invoke_vdd;
  9892. var invoke_v=env.invoke_v;
  9893. var invoke_viid=env.invoke_viid;
  9894. var invoke_viiii=env.invoke_viiii;
  9895. var _emscripten_glGetTexParameterfv=env._emscripten_glGetTexParameterfv;
  9896. var _glUseProgram=env._glUseProgram;
  9897. var _glfwCreateWindow=env._glfwCreateWindow;
  9898. var _emscripten_glReleaseShaderCompiler=env._emscripten_glReleaseShaderCompiler;
  9899. var _emscripten_glBlendFuncSeparate=env._emscripten_glBlendFuncSeparate;
  9900. var _emscripten_glVertexAttribPointer=env._emscripten_glVertexAttribPointer;
  9901. var _emscripten_glGetIntegerv=env._emscripten_glGetIntegerv;
  9902. var _emscripten_glCullFace=env._emscripten_glCullFace;
  9903. var _emscripten_glIsProgram=env._emscripten_glIsProgram;
  9904. var _emscripten_glStencilMaskSeparate=env._emscripten_glStencilMaskSeparate;
  9905. var _emscripten_glViewport=env._emscripten_glViewport;
  9906. var _emscripten_glFrontFace=env._emscripten_glFrontFace;
  9907. var ___assert_fail=env.___assert_fail;
  9908. var _glDeleteProgram=env._glDeleteProgram;
  9909. var _emscripten_glUniform3fv=env._emscripten_glUniform3fv;
  9910. var _emscripten_glPolygonOffset=env._emscripten_glPolygonOffset;
  9911. var _emscripten_glUseProgram=env._emscripten_glUseProgram;
  9912. var _emscripten_glBlendColor=env._emscripten_glBlendColor;
  9913. var _glBindBuffer=env._glBindBuffer;
  9914. var _emscripten_glDepthFunc=env._emscripten_glDepthFunc;
  9915. var _glGetShaderInfoLog=env._glGetShaderInfoLog;
  9916. var _clock_gettime=env._clock_gettime;
  9917. var _emscripten_set_fullscreenchange_callback=env._emscripten_set_fullscreenchange_callback;
  9918. var _emscripten_set_touchmove_callback=env._emscripten_set_touchmove_callback;
  9919. var _emscripten_set_main_loop_timing=env._emscripten_set_main_loop_timing;
  9920. var _glDisable=env._glDisable;
  9921. var _glBlendFunc=env._glBlendFunc;
  9922. var _emscripten_glDisableVertexAttribArray=env._emscripten_glDisableVertexAttribArray;
  9923. var _glGetAttribLocation=env._glGetAttribLocation;
  9924. var _glDisableVertexAttribArray=env._glDisableVertexAttribArray;
  9925. var _glCreateShader=env._glCreateShader;
  9926. var _emscripten_glCompileShader=env._emscripten_glCompileShader;
  9927. var _sysconf=env._sysconf;
  9928. var _utime=env._utime;
  9929. var _emscripten_glSampleCoverage=env._emscripten_glSampleCoverage;
  9930. var _emscripten_glVertexPointer=env._emscripten_glVertexPointer;
  9931. var _emscripten_set_touchstart_callback=env._emscripten_set_touchstart_callback;
  9932. var emscriptenWebGLComputeImageSize=env.emscriptenWebGLComputeImageSize;
  9933. var _emscripten_glGetBooleanv=env._emscripten_glGetBooleanv;
  9934. var _emscripten_glGetShaderSource=env._emscripten_glGetShaderSource;
  9935. var _chroot=env._chroot;
  9936. var _glUniform4f=env._glUniform4f;
  9937. var _llvm_stacksave=env._llvm_stacksave;
  9938. var _emscripten_glUniform1i=env._emscripten_glUniform1i;
  9939. var _emscripten_glLoadMatrixf=env._emscripten_glLoadMatrixf;
  9940. var _emscripten_glGenBuffers=env._emscripten_glGenBuffers;
  9941. var _emscripten_glDeleteObjectARB=env._emscripten_glDeleteObjectARB;
  9942. var _glfwSetWindowSizeCallback=env._glfwSetWindowSizeCallback;
  9943. var _emscripten_glGetShaderPrecisionFormat=env._emscripten_glGetShaderPrecisionFormat;
  9944. var _glfwInit=env._glfwInit;
  9945. var _glGenBuffers=env._glGenBuffers;
  9946. var _glShaderSource=env._glShaderSource;
  9947. var _emscripten_glGetString=env._emscripten_glGetString;
  9948. var _emscripten_glIsFramebuffer=env._emscripten_glIsFramebuffer;
  9949. var _emscripten_glIsEnabled=env._emscripten_glIsEnabled;
  9950. var _emscripten_glScissor=env._emscripten_glScissor;
  9951. var __pthread_testcancel_js=env.__pthread_testcancel_js;
  9952. var _emscripten_glVertexAttrib4fv=env._emscripten_glVertexAttrib4fv;
  9953. var _emscripten_glFramebufferTexture2D=env._emscripten_glFramebufferTexture2D;
  9954. var _emscripten_glTexParameteriv=env._emscripten_glTexParameteriv;
  9955. var _unsetenv=env._unsetenv;
  9956. var _emscripten_glBindProgramARB=env._emscripten_glBindProgramARB;
  9957. var _emscripten_glStencilOpSeparate=env._emscripten_glStencilOpSeparate;
  9958. var _emscripten_glFramebufferRenderbuffer=env._emscripten_glFramebufferRenderbuffer;
  9959. var ___syscall140=env.___syscall140;
  9960. var _glfwSetErrorCallback=env._glfwSetErrorCallback;
  9961. var _glfwDefaultWindowHints=env._glfwDefaultWindowHints;
  9962. var _glfwDestroyWindow=env._glfwDestroyWindow;
  9963. var ___syscall146=env.___syscall146;
  9964. var _emscripten_glGetActiveAttrib=env._emscripten_glGetActiveAttrib;
  9965. var _emscripten_glAttachShader=env._emscripten_glAttachShader;
  9966. var _emscripten_get_now_is_monotonic=env._emscripten_get_now_is_monotonic;
  9967. var _emscripten_glUniform2i=env._emscripten_glUniform2i;
  9968. var _emscripten_glUniform2f=env._emscripten_glUniform2f;
  9969. var _emscripten_glTexParameterfv=env._emscripten_glTexParameterfv;
  9970. var _emscripten_glIsBuffer=env._emscripten_glIsBuffer;
  9971. var _emscripten_glUniformMatrix2fv=env._emscripten_glUniformMatrix2fv;
  9972. var _glGetProgramInfoLog=env._glGetProgramInfoLog;
  9973. var _glfwSetScrollCallback=env._glfwSetScrollCallback;
  9974. var _emscripten_glTexParameterf=env._emscripten_glTexParameterf;
  9975. var _emscripten_glGetAttachedShaders=env._emscripten_glGetAttachedShaders;
  9976. var _emscripten_glGenTextures=env._emscripten_glGenTextures;
  9977. var _emscripten_glTexParameteri=env._emscripten_glTexParameteri;
  9978. var _llvm_stackrestore=env._llvm_stackrestore;
  9979. var _glfwMakeContextCurrent=env._glfwMakeContextCurrent;
  9980. var _emscripten_glClear=env._emscripten_glClear;
  9981. var _glDrawElements=env._glDrawElements;
  9982. var _glBufferSubData=env._glBufferSubData;
  9983. var _emscripten_glValidateProgram=env._emscripten_glValidateProgram;
  9984. var _emscripten_glVertexAttrib2fv=env._emscripten_glVertexAttrib2fv;
  9985. var _glViewport=env._glViewport;
  9986. var _emscripten_glUniform4iv=env._emscripten_glUniform4iv;
  9987. var _emscripten_glGetTexParameteriv=env._emscripten_glGetTexParameteriv;
  9988. var ___setErrNo=env.___setErrNo;
  9989. var _eglGetProcAddress=env._eglGetProcAddress;
  9990. var _emscripten_glBindAttribLocation=env._emscripten_glBindAttribLocation;
  9991. var _glDeleteTextures=env._glDeleteTextures;
  9992. var _glDepthFunc=env._glDepthFunc;
  9993. var _emscripten_glClientActiveTexture=env._emscripten_glClientActiveTexture;
  9994. var _emscripten_glVertexAttrib2f=env._emscripten_glVertexAttrib2f;
  9995. var _emscripten_asm_const_v=env._emscripten_asm_const_v;
  9996. var _emscripten_glFlush=env._emscripten_glFlush;
  9997. var _emscripten_glBlendFunc=env._emscripten_glBlendFunc;
  9998. var _emscripten_glCheckFramebufferStatus=env._emscripten_glCheckFramebufferStatus;
  9999. var _emscripten_glGenerateMipmap=env._emscripten_glGenerateMipmap;
  10000. var _emscripten_glGetError=env._emscripten_glGetError;
  10001. var _emscripten_glClearDepthf=env._emscripten_glClearDepthf;
  10002. var _pthread_self=env._pthread_self;
  10003. var _emscripten_glBufferData=env._emscripten_glBufferData;
  10004. var _emscripten_glUniform3i=env._emscripten_glUniform3i;
  10005. var _emscripten_glGenRenderbuffers=env._emscripten_glGenRenderbuffers;
  10006. var _emscripten_glRotatef=env._emscripten_glRotatef;
  10007. var _emscripten_glDeleteShader=env._emscripten_glDeleteShader;
  10008. var _glEnable=env._glEnable;
  10009. var _emscripten_glGetShaderiv=env._emscripten_glGetShaderiv;
  10010. var _emscripten_glReadPixels=env._emscripten_glReadPixels;
  10011. var _emscripten_glMatrixMode=env._emscripten_glMatrixMode;
  10012. var _glGetString=env._glGetString;
  10013. var _emscripten_glClearStencil=env._emscripten_glClearStencil;
  10014. var _emscripten_glGetUniformLocation=env._emscripten_glGetUniformLocation;
  10015. var emscriptenWebGLGet=env.emscriptenWebGLGet;
  10016. var _emscripten_glEnableVertexAttribArray=env._emscripten_glEnableVertexAttribArray;
  10017. var __register_pthread_ptr=env.__register_pthread_ptr;
  10018. var _emscripten_get_now=env._emscripten_get_now;
  10019. var _emscripten_glNormalPointer=env._emscripten_glNormalPointer;
  10020. var _glAttachShader=env._glAttachShader;
  10021. var _emscripten_glTexCoordPointer=env._emscripten_glTexCoordPointer;
  10022. var _emscripten_glEnable=env._emscripten_glEnable;
  10023. var _glCreateProgram=env._glCreateProgram;
  10024. var _glUniformMatrix4fv=env._glUniformMatrix4fv;
  10025. var _emscripten_glClearDepth=env._emscripten_glClearDepth;
  10026. var ___lock=env.___lock;
  10027. var emscriptenWebGLGetTexPixelData=env.emscriptenWebGLGetTexPixelData;
  10028. var ___syscall6=env.___syscall6;
  10029. var _emscripten_glStencilFuncSeparate=env._emscripten_glStencilFuncSeparate;
  10030. var _emscripten_glVertexAttrib3f=env._emscripten_glVertexAttrib3f;
  10031. var _time=env._time;
  10032. var _gettimeofday=env._gettimeofday;
  10033. var _emscripten_glVertexAttrib1f=env._emscripten_glVertexAttrib1f;
  10034. var _emscripten_glGetFramebufferAttachmentParameteriv=env._emscripten_glGetFramebufferAttachmentParameteriv;
  10035. var _emscripten_glBlendEquationSeparate=env._emscripten_glBlendEquationSeparate;
  10036. var _exit=env._exit;
  10037. var _emscripten_glEnableClientState=env._emscripten_glEnableClientState;
  10038. var __spawn_thread=env.__spawn_thread;
  10039. var _emscripten_glUniform4i=env._emscripten_glUniform4i;
  10040. var _emscripten_conditional_set_current_thread_status_js=env._emscripten_conditional_set_current_thread_status_js;
  10041. var _putenv=env._putenv;
  10042. var _pthread_join=env._pthread_join;
  10043. var _glCullFace=env._glCullFace;
  10044. var _emscripten_glGetPointerv=env._emscripten_glGetPointerv;
  10045. var _emscripten_set_keypress_callback=env._emscripten_set_keypress_callback;
  10046. var __emscripten_sample_gamepad_data=env.__emscripten_sample_gamepad_data;
  10047. var _fpathconf=env._fpathconf;
  10048. var _emscripten_get_gamepad_status=env._emscripten_get_gamepad_status;
  10049. var _emscripten_glUniform4f=env._emscripten_glUniform4f;
  10050. var _emscripten_glUniform2fv=env._emscripten_glUniform2fv;
  10051. var _glfwGetVideoModes=env._glfwGetVideoModes;
  10052. var ___unlock=env.___unlock;
  10053. var _emscripten_set_click_callback=env._emscripten_set_click_callback;
  10054. var _emscripten_glFrustum=env._emscripten_glFrustum;
  10055. var _emscripten_is_main_runtime_thread=env._emscripten_is_main_runtime_thread;
  10056. var _emscripten_glShaderBinary=env._emscripten_glShaderBinary;
  10057. var _emscripten_glDrawElements=env._emscripten_glDrawElements;
  10058. var _glVertexAttribPointer=env._glVertexAttribPointer;
  10059. var _emscripten_get_num_gamepads=env._emscripten_get_num_gamepads;
  10060. var ___buildEnvironment=env.___buildEnvironment;
  10061. var _glCompressedTexImage2D=env._glCompressedTexImage2D;
  10062. var _utimes=env._utimes;
  10063. var _emscripten_glUniform1iv=env._emscripten_glUniform1iv;
  10064. var _emscripten_glGetVertexAttribPointerv=env._emscripten_glGetVertexAttribPointerv;
  10065. var _glClearDepthf=env._glClearDepthf;
  10066. var _emscripten_glCompressedTexSubImage2D=env._emscripten_glCompressedTexSubImage2D;
  10067. var emscriptenWebGLGetUniform=env.emscriptenWebGLGetUniform;
  10068. var _tzset=env._tzset;
  10069. var _emscripten_glDeleteVertexArrays=env._emscripten_glDeleteVertexArrays;
  10070. var _glfwSetWindowShouldClose=env._glfwSetWindowShouldClose;
  10071. var _emscripten_glUniform1fv=env._emscripten_glUniform1fv;
  10072. var _emscripten_glGetActiveUniform=env._emscripten_glGetActiveUniform;
  10073. var _glBindTexture=env._glBindTexture;
  10074. var _emscripten_glUniform3iv=env._emscripten_glUniform3iv;
  10075. var _emscripten_glUniform2iv=env._emscripten_glUniform2iv;
  10076. var _emscripten_glHint=env._emscripten_glHint;
  10077. var _glfwSetCharCallback=env._glfwSetCharCallback;
  10078. var emscriptenWebGLGetVertexAttrib=env.emscriptenWebGLGetVertexAttrib;
  10079. var _glGetFloatv=env._glGetFloatv;
  10080. var _emscripten_glDeleteProgram=env._emscripten_glDeleteProgram;
  10081. var _emscripten_glDeleteRenderbuffers=env._emscripten_glDeleteRenderbuffers;
  10082. var ___clock_gettime=env.___clock_gettime;
  10083. var _emscripten_glDrawElementsInstanced=env._emscripten_glDrawElementsInstanced;
  10084. var _emscripten_glVertexAttrib4f=env._emscripten_glVertexAttrib4f;
  10085. var _glDrawArrays=env._glDrawArrays;
  10086. var _emscripten_glTexSubImage2D=env._emscripten_glTexSubImage2D;
  10087. var _clearenv=env._clearenv;
  10088. var _emscripten_glPixelStorei=env._emscripten_glPixelStorei;
  10089. var _glCompileShader=env._glCompileShader;
  10090. var _emscripten_get_pointerlock_status=env._emscripten_get_pointerlock_status;
  10091. var _emscripten_memcpy_big=env._emscripten_memcpy_big;
  10092. var _emscripten_glUniformMatrix3fv=env._emscripten_glUniformMatrix3fv;
  10093. var _emscripten_glColorPointer=env._emscripten_glColorPointer;
  10094. var _getenv=env._getenv;
  10095. var _emscripten_glDepthRange=env._emscripten_glDepthRange;
  10096. var _emscripten_glGetBufferParameteriv=env._emscripten_glGetBufferParameteriv;
  10097. var _emscripten_glFinish=env._emscripten_glFinish;
  10098. var _emscripten_glRenderbufferStorage=env._emscripten_glRenderbufferStorage;
  10099. var _emscripten_set_gamepaddisconnected_callback=env._emscripten_set_gamepaddisconnected_callback;
  10100. var _emscripten_asm_const_iii=env._emscripten_asm_const_iii;
  10101. var _emscripten_glDepthMask=env._emscripten_glDepthMask;
  10102. var _glfwSetWindowIconifyCallback=env._glfwSetWindowIconifyCallback;
  10103. var _emscripten_glDrawBuffers=env._emscripten_glDrawBuffers;
  10104. var _glfwTerminate=env._glfwTerminate;
  10105. var _emscripten_futex_wake=env._emscripten_futex_wake;
  10106. var _glFrontFace=env._glFrontFace;
  10107. var _emscripten_glGetObjectParameterivARB=env._emscripten_glGetObjectParameterivARB;
  10108. var _emscripten_exit_pointerlock=env._emscripten_exit_pointerlock;
  10109. var _glfwSwapInterval=env._glfwSwapInterval;
  10110. var _glUniform1i=env._glUniform1i;
  10111. var _glEnableVertexAttribArray=env._glEnableVertexAttribArray;
  10112. var _emscripten_glStencilFunc=env._emscripten_glStencilFunc;
  10113. var _abort=env._abort;
  10114. var _emscripten_glGetUniformiv=env._emscripten_glGetUniformiv;
  10115. var __cleanup_thread=env.__cleanup_thread;
  10116. var _glDeleteBuffers=env._glDeleteBuffers;
  10117. var _glBufferData=env._glBufferData;
  10118. var _glTexImage2D=env._glTexImage2D;
  10119. var _emscripten_set_current_thread_status_js=env._emscripten_set_current_thread_status_js;
  10120. var _glfwSetKeyCallback=env._glfwSetKeyCallback;
  10121. var _emscripten_glGenFramebuffers=env._emscripten_glGenFramebuffers;
  10122. var _emscripten_glUniformMatrix4fv=env._emscripten_glUniformMatrix4fv;
  10123. var _emscripten_glLoadIdentity=env._emscripten_glLoadIdentity;
  10124. var _glDeleteShader=env._glDeleteShader;
  10125. var _emscripten_glUniform1f=env._emscripten_glUniform1f;
  10126. var _glGetProgramiv=env._glGetProgramiv;
  10127. var _emscripten_glBindFramebuffer=env._emscripten_glBindFramebuffer;
  10128. var _emscripten_glIsRenderbuffer=env._emscripten_glIsRenderbuffer;
  10129. var _glfwGetTime=env._glfwGetTime;
  10130. var _emscripten_glShaderSource=env._emscripten_glShaderSource;
  10131. var _emscripten_set_gamepadconnected_callback=env._emscripten_set_gamepadconnected_callback;
  10132. var _emscripten_syscall=env._emscripten_syscall;
  10133. var _emscripten_glGetVertexAttribiv=env._emscripten_glGetVertexAttribiv;
  10134. var _emscripten_glBindVertexArray=env._emscripten_glBindVertexArray;
  10135. var _emscripten_glDrawArraysInstanced=env._emscripten_glDrawArraysInstanced;
  10136. var _emscripten_set_touchcancel_callback=env._emscripten_set_touchcancel_callback;
  10137. var _emscripten_glCreateShader=env._emscripten_glCreateShader;
  10138. var _emscripten_glStencilMask=env._emscripten_glStencilMask;
  10139. var _emscripten_glDeleteTextures=env._emscripten_glDeleteTextures;
  10140. var _emscripten_glBindRenderbuffer=env._emscripten_glBindRenderbuffer;
  10141. var _glfwGetPrimaryMonitor=env._glfwGetPrimaryMonitor;
  10142. var _glLinkProgram=env._glLinkProgram;
  10143. var _emscripten_glVertexAttribDivisor=env._emscripten_glVertexAttribDivisor;
  10144. var _emscripten_set_touchend_callback=env._emscripten_set_touchend_callback;
  10145. var _emscripten_glGetUniformfv=env._emscripten_glGetUniformfv;
  10146. var _emscripten_glGetVertexAttribfv=env._emscripten_glGetVertexAttribfv;
  10147. var _emscripten_glGetRenderbufferParameteriv=env._emscripten_glGetRenderbufferParameteriv;
  10148. var _emscripten_futex_wait=env._emscripten_futex_wait;
  10149. var _emscripten_glDeleteFramebuffers=env._emscripten_glDeleteFramebuffers;
  10150. var _glGetShaderiv=env._glGetShaderiv;
  10151. var _emscripten_glVertexAttrib3fv=env._emscripten_glVertexAttrib3fv;
  10152. var _glGetUniformLocation=env._glGetUniformLocation;
  10153. var _emscripten_glGetInfoLogARB=env._emscripten_glGetInfoLogARB;
  10154. var _emscripten_request_pointerlock=env._emscripten_request_pointerlock;
  10155. var _glClear=env._glClear;
  10156. var _glGenTextures=env._glGenTextures;
  10157. var _emscripten_glDisable=env._emscripten_glDisable;
  10158. var _emscripten_glDepthRangef=env._emscripten_glDepthRangef;
  10159. var __exit=env.__exit;
  10160. var _emscripten_glLineWidth=env._emscripten_glLineWidth;
  10161. var _emscripten_glUniform3f=env._emscripten_glUniform3f;
  10162. var _emscripten_glGetShaderInfoLog=env._emscripten_glGetShaderInfoLog;
  10163. var _emscripten_glStencilOp=env._emscripten_glStencilOp;
  10164. var ___pthread_setcancelstate=env.___pthread_setcancelstate;
  10165. var _glBindAttribLocation=env._glBindAttribLocation;
  10166. var _glPixelStorei=env._glPixelStorei;
  10167. var _emscripten_glColorMask=env._emscripten_glColorMask;
  10168. var _emscripten_glLinkProgram=env._emscripten_glLinkProgram;
  10169. var _emscripten_glBlendEquation=env._emscripten_glBlendEquation;
  10170. var _emscripten_glIsTexture=env._emscripten_glIsTexture;
  10171. var _confstr=env._confstr;
  10172. var _emscripten_glGetProgramiv=env._emscripten_glGetProgramiv;
  10173. var _emscripten_glVertexAttrib1fv=env._emscripten_glVertexAttrib1fv;
  10174. var _emscripten_glBindTexture=env._emscripten_glBindTexture;
  10175. var _glfwSetMouseButtonCallback=env._glfwSetMouseButtonCallback;
  10176. var _glfwGetCursorPos=env._glfwGetCursorPos;
  10177. var _emscripten_glActiveTexture=env._emscripten_glActiveTexture;
  10178. var _emscripten_glDrawRangeElements=env._emscripten_glDrawRangeElements;
  10179. var ___syscall54=env.___syscall54;
  10180. var _emscripten_glDeleteBuffers=env._emscripten_glDeleteBuffers;
  10181. var _emscripten_glBufferSubData=env._emscripten_glBufferSubData;
  10182. var _glfwSwapBuffers=env._glfwSwapBuffers;
  10183. var _pthread_create=env._pthread_create;
  10184. var _emscripten_set_main_loop=env._emscripten_set_main_loop;
  10185. var _emscripten_glGetProgramInfoLog=env._emscripten_glGetProgramInfoLog;
  10186. var _glfwWindowHint=env._glfwWindowHint;
  10187. var _pthread_getschedparam=env._pthread_getschedparam;
  10188. var _emscripten_glIsShader=env._emscripten_glIsShader;
  10189. var _emscripten_glUniform4fv=env._emscripten_glUniform4fv;
  10190. var _emscripten_glGenVertexArrays=env._emscripten_glGenVertexArrays;
  10191. var _emscripten_glDrawArrays=env._emscripten_glDrawArrays;
  10192. var _emscripten_glCompressedTexImage2D=env._emscripten_glCompressedTexImage2D;
  10193. var _emscripten_glClearColor=env._emscripten_glClearColor;
  10194. var _glfwSetCursorEnterCallback=env._glfwSetCursorEnterCallback;
  10195. var _emscripten_glCreateProgram=env._emscripten_glCreateProgram;
  10196. var _emscripten_glCopyTexSubImage2D=env._emscripten_glCopyTexSubImage2D;
  10197. var _emscripten_glGetAttribLocation=env._emscripten_glGetAttribLocation;
  10198. var _glTexParameteri=env._glTexParameteri;
  10199. var _emscripten_glBindBuffer=env._emscripten_glBindBuffer;
  10200. var _atexit=env._atexit;
  10201. var _emscripten_glGetFloatv=env._emscripten_glGetFloatv;
  10202. var _emscripten_glDetachShader=env._emscripten_glDetachShader;
  10203. var _glClearColor=env._glClearColor;
  10204. var _glfwSetCursorPosCallback=env._glfwSetCursorPosCallback;
  10205. var _setenv=env._setenv;
  10206. var _emscripten_glCopyTexImage2D=env._emscripten_glCopyTexImage2D;
  10207. var _emscripten_glTexImage2D=env._emscripten_glTexImage2D;
  10208. var Atomics_load=global.Atomics.load;
  10209. var Atomics_store=global.Atomics.store;
  10210. var Atomics_exchange=global.Atomics.exchange;
  10211. var Atomics_compareExchange=global.Atomics.compareExchange;
  10212. var Atomics_add=global.Atomics.add;
  10213. var Atomics_sub=global.Atomics.sub;
  10214. var Atomics_and=global.Atomics.and;
  10215. var Atomics_or=global.Atomics.or;
  10216. var Atomics_xor=global.Atomics.xor;
  10217. var tempFloat = 0.0;
  10218. // EMSCRIPTEN_START_FUNCS
  10219. function stackAlloc(size) {
  10220. size = size|0;
  10221. var ret = 0;
  10222. ret = STACKTOP;
  10223. STACKTOP = (STACKTOP + size)|0;
  10224. STACKTOP = (STACKTOP + 15)&-16;
  10225. if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(size|0);
  10226. return ret|0;
  10227. }
  10228. function stackSave() {
  10229. return STACKTOP|0;
  10230. }
  10231. function stackRestore(top) {
  10232. top = top|0;
  10233. STACKTOP = top;
  10234. }
  10235. function establishStackSpace(stackBase, stackMax) {
  10236. stackBase = stackBase|0;
  10237. stackMax = stackMax|0;
  10238. STACKTOP = stackBase;
  10239. STACK_MAX = stackMax;
  10240. }
  10241. function setThrew(threw, value) {
  10242. threw = threw|0;
  10243. value = value|0;
  10244. if ((__THREW__|0) == 0) {
  10245. __THREW__ = threw;
  10246. threwValue = value;
  10247. }
  10248. }
  10249. function setTempRet0(value) {
  10250. value = value|0;
  10251. tempRet0 = value;
  10252. }
  10253. function getTempRet0() {
  10254. return tempRet0|0;
  10255. }
  10256. function _InitPhysics() {
  10257. var label = 0, sp = 0;
  10258. sp = STACKTOP;
  10259. (_pthread_create((14272|0),(0|0),(2|0),(0|0))|0);
  10260. return;
  10261. }
  10262. function _PhysicsLoop($0) {
  10263. $0 = $0|0;
  10264. var $$0 = 0, $$010 = 0, $$011 = 0, $$09 = 0, $$0912 = 0, $$0913 = 0, $$pr = 0.0, $1 = 0, $10 = 0.0, $11 = 0.0, $12 = 0, $13 = 0.0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0;
  10265. var $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $3 = 0.0, $4 = 0.0, $5 = 0.0, $6 = 0.0, $7 = 0.0, $8 = 0, $9 = 0.0, label = 0, sp = 0;
  10266. sp = STACKTOP;
  10267. HEAP32[3569] = 1;
  10268. HEAPF64[1746] = 0.0;
  10269. _InitTimer();
  10270. $1 = HEAP32[3569]|0;
  10271. $2 = ($1|0)==(0);
  10272. if (!($2)) {
  10273. while(1) {
  10274. $3 = (+_GetCurrentTime());
  10275. HEAPF64[1747] = $3;
  10276. $4 = +HEAPF64[1748];
  10277. $5 = $3 - $4;
  10278. HEAPF64[1749] = $5;
  10279. $6 = +HEAPF64[1746];
  10280. $7 = $5 + $6;
  10281. HEAPF64[1746] = $7;
  10282. _MathClamp();
  10283. $$pr = +HEAPF64[1746];
  10284. $8 = !($$pr >= 0.016666666666666666);
  10285. if (!($8)) {
  10286. while(1) {
  10287. _PhysicsStep();
  10288. $9 = +HEAPF64[1749];
  10289. $10 = +HEAPF64[1746];
  10290. $11 = $10 - $9;
  10291. HEAPF64[1746] = $11;
  10292. $12 = !($11 >= 0.016666666666666666);
  10293. if ($12) {
  10294. break;
  10295. }
  10296. }
  10297. }
  10298. $13 = +HEAPF64[1747];
  10299. HEAPF64[1748] = $13;
  10300. $14 = HEAP32[3569]|0;
  10301. $15 = ($14|0)==(0);
  10302. if ($15) {
  10303. break;
  10304. }
  10305. }
  10306. }
  10307. $16 = HEAP32[3636]|0;
  10308. $$0912 = (($16) + -1)|0;
  10309. $17 = ($$0912|0)>(-1);
  10310. if ($17) {
  10311. $$0913 = $$0912;
  10312. while(1) {
  10313. $20 = (14548 + ($$0913<<2)|0);
  10314. $21 = HEAP32[$20>>2]|0;
  10315. _DestroyPhysicsManifold($21);
  10316. $$09 = (($$0913) + -1)|0;
  10317. $22 = ($$09|0)>(-1);
  10318. if ($22) {
  10319. $$0913 = $$09;
  10320. } else {
  10321. break;
  10322. }
  10323. }
  10324. }
  10325. $18 = HEAP32[3571]|0;
  10326. $$010 = (($18) + -1)|0;
  10327. $19 = ($$010|0)>(-1);
  10328. if ($19) {
  10329. $$011 = $$010;
  10330. } else {
  10331. return (0|0);
  10332. }
  10333. while(1) {
  10334. $23 = (14288 + ($$011<<2)|0);
  10335. $24 = HEAP32[$23>>2]|0;
  10336. _DestroyPhysicsBody($24);
  10337. $$0 = (($$011) + -1)|0;
  10338. $25 = ($$0|0)>(-1);
  10339. if ($25) {
  10340. $$011 = $$0;
  10341. } else {
  10342. break;
  10343. }
  10344. }
  10345. return (0|0);
  10346. }
  10347. function _CreatePhysicsBodyCircle($0,$1,$2) {
  10348. $0 = $0|0;
  10349. $1 = +$1;
  10350. $2 = +$2;
  10351. var $$byval_copy = 0, $3 = 0, label = 0, sp = 0;
  10352. sp = STACKTOP;
  10353. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  10354. $$byval_copy = sp;
  10355. ;HEAP32[$$byval_copy>>2]=HEAP32[$0>>2]|0;HEAP32[$$byval_copy+4>>2]=HEAP32[$0+4>>2]|0;
  10356. $3 = (_CreatePhysicsBodyPolygon($$byval_copy,$1,24,$2)|0);
  10357. STACKTOP = sp;return ($3|0);
  10358. }
  10359. function _CreatePhysicsBodyPolygon($0,$1,$2,$3) {
  10360. $0 = $0|0;
  10361. $1 = +$1;
  10362. $2 = $2|0;
  10363. $3 = +$3;
  10364. var $$0116149 = 0, $$0116149158159 = 0, $$0119144 = 0, $$0120136 = 0, $$0121$lcssa161 = 0.0, $$0121134 = 0.0, $$0122$lcssa160 = 0.0, $$0122133 = 0.0, $$0131 = 0, $$sroa$0$0132 = 0.0, $$sroa$049$0$$sroa_idx = 0, $$sroa$8$0135 = 0.0, $10 = 0, $100 = 0.0, $101 = 0, $102 = 0.0, $103 = 0, $104 = 0, $105 = 0.0, $106 = 0.0;
  10365. var $107 = 0, $108 = 0.0, $109 = 0, $11 = 0, $110 = 0, $111 = 0.0, $112 = 0.0, $113 = 0, $114 = 0, $115 = 0, $116 = 0, $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0.0;
  10366. var $125 = 0.0, $126 = 0, $127 = 0.0, $128 = 0.0, $129 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0;
  10367. var $28 = 0, $29 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0.0, $42 = 0.0, $43 = 0.0, $44 = 0.0, $45 = 0.0, $46 = 0.0;
  10368. var $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0;
  10369. var $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0.0, $77 = 0.0, $78 = 0.0, $79 = 0.0, $8 = 0, $80 = 0.0, $81 = 0.0, $82 = 0.0;
  10370. var $83 = 0.0, $84 = 0.0, $85 = 0.0, $86 = 0.0, $87 = 0.0, $88 = 0.0, $89 = 0.0, $9 = 0, $90 = 0.0, $91 = 0.0, $92 = 0.0, $93 = 0.0, $94 = 0.0, $95 = 0.0, $96 = 0.0, $97 = 0.0, $98 = 0.0, $99 = 0.0, $exitcond = 0, $tmpcast$byval_copy = 0;
  10371. var $tmpcast123$byval_copy = 0, label = 0, sp = 0;
  10372. sp = STACKTOP;
  10373. STACKTOP = STACKTOP + 448|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(448|0);
  10374. $tmpcast123$byval_copy = sp + 432|0;
  10375. $tmpcast$byval_copy = sp + 424|0;
  10376. $4 = sp + 16|0;
  10377. $5 = sp + 8|0;
  10378. $6 = sp;
  10379. $7 = (_malloc(500)|0);
  10380. $8 = HEAP32[3570]|0;
  10381. $9 = (($8) + 500)|0;
  10382. HEAP32[3570] = $9;
  10383. $10 = HEAP32[3571]|0;
  10384. $11 = ($10|0)==(0);
  10385. $$0116149 = 0;
  10386. L1: while(1) {
  10387. if ($11) {
  10388. $$0116149158159 = 0;
  10389. break;
  10390. } else {
  10391. $$0119144 = 0;
  10392. }
  10393. while(1) {
  10394. $14 = (14288 + ($$0119144<<2)|0);
  10395. $15 = HEAP32[$14>>2]|0;
  10396. $16 = HEAP32[$15>>2]|0;
  10397. $17 = ($16|0)==($$0116149|0);
  10398. $13 = (($$0119144) + 1)|0;
  10399. if ($17) {
  10400. break;
  10401. }
  10402. $12 = ($13>>>0)<($10>>>0);
  10403. if ($12) {
  10404. $$0119144 = $13;
  10405. } else {
  10406. label = 6;
  10407. break L1;
  10408. }
  10409. }
  10410. $18 = (($$0116149) + 1)|0;
  10411. $19 = ($18|0)<(64);
  10412. if ($19) {
  10413. $$0116149 = $18;
  10414. } else {
  10415. label = 14;
  10416. break;
  10417. }
  10418. }
  10419. if ((label|0) == 14) {
  10420. STACKTOP = sp;return ($7|0);
  10421. }
  10422. if ((label|0) == 6) {
  10423. $20 = ($$0116149|0)==(-1);
  10424. if ($20) {
  10425. STACKTOP = sp;return ($7|0);
  10426. } else {
  10427. $$0116149158159 = $$0116149;
  10428. }
  10429. }
  10430. HEAP32[$7>>2] = $$0116149158159;
  10431. $21 = ((($7)) + 4|0);
  10432. HEAP32[$21>>2] = 1;
  10433. $22 = ((($7)) + 8|0);
  10434. $23 = $0;
  10435. $24 = $23;
  10436. $25 = HEAP32[$24>>2]|0;
  10437. $26 = (($23) + 4)|0;
  10438. $27 = $26;
  10439. $28 = HEAP32[$27>>2]|0;
  10440. $29 = $22;
  10441. $30 = $29;
  10442. HEAP32[$30>>2] = $25;
  10443. $31 = (($29) + 4)|0;
  10444. $32 = $31;
  10445. HEAP32[$32>>2] = $28;
  10446. $$sroa$049$0$$sroa_idx = ((($7)) + 16|0);
  10447. $33 = ((($7)) + 84|0);
  10448. ;HEAP32[$$sroa$049$0$$sroa_idx>>2]=0|0;HEAP32[$$sroa$049$0$$sroa_idx+4>>2]=0|0;HEAP32[$$sroa$049$0$$sroa_idx+8>>2]=0|0;HEAP32[$$sroa$049$0$$sroa_idx+12>>2]=0|0;HEAP32[$$sroa$049$0$$sroa_idx+16>>2]=0|0;HEAP32[$$sroa$049$0$$sroa_idx+20>>2]=0|0;HEAP32[$$sroa$049$0$$sroa_idx+24>>2]=0|0;
  10449. HEAP32[$33>>2] = 1;
  10450. $34 = ((($7)) + 88|0);
  10451. HEAP32[$34>>2] = $7;
  10452. $35 = ((($7)) + 96|0);
  10453. _CreateRandomPolygon($4,$1,$2);
  10454. _memcpy(($35|0),($4|0),404)|0;
  10455. $36 = HEAP32[$35>>2]|0;
  10456. $37 = ($36|0)==(0);
  10457. if ($37) {
  10458. $$0121$lcssa161 = 0.0;$$0122$lcssa160 = 0.0;
  10459. } else {
  10460. $38 = ((($7)) + 100|0);
  10461. $39 = ((($5)) + 4|0);
  10462. $40 = ((($6)) + 4|0);
  10463. $$0120136 = 0;$$0121134 = 0.0;$$0122133 = 0.0;$$sroa$0$0132 = 0.0;$$sroa$8$0135 = 0.0;
  10464. while(1) {
  10465. $50 = (($38) + ($$0120136<<3)|0);
  10466. $51 = $50;
  10467. $52 = $51;
  10468. $53 = HEAP32[$52>>2]|0;
  10469. $54 = (($51) + 4)|0;
  10470. $55 = $54;
  10471. $56 = HEAP32[$55>>2]|0;
  10472. $57 = $5;
  10473. $58 = $57;
  10474. HEAP32[$58>>2] = $53;
  10475. $59 = (($57) + 4)|0;
  10476. $60 = $59;
  10477. HEAP32[$60>>2] = $56;
  10478. $61 = (($$0120136) + 1)|0;
  10479. $62 = HEAP32[$35>>2]|0;
  10480. $63 = ($61>>>0)<($62>>>0);
  10481. $64 = $63 ? $61 : 0;
  10482. $65 = (($38) + ($64<<3)|0);
  10483. $66 = $65;
  10484. $67 = $66;
  10485. $68 = HEAP32[$67>>2]|0;
  10486. $69 = (($66) + 4)|0;
  10487. $70 = $69;
  10488. $71 = HEAP32[$70>>2]|0;
  10489. $72 = $6;
  10490. $73 = $72;
  10491. HEAP32[$73>>2] = $68;
  10492. $74 = (($72) + 4)|0;
  10493. $75 = $74;
  10494. HEAP32[$75>>2] = $71;
  10495. ;HEAP32[$tmpcast$byval_copy>>2]=HEAP32[$5>>2]|0;HEAP32[$tmpcast$byval_copy+4>>2]=HEAP32[$5+4>>2]|0;
  10496. ;HEAP32[$tmpcast123$byval_copy>>2]=HEAP32[$6>>2]|0;HEAP32[$tmpcast123$byval_copy+4>>2]=HEAP32[$6+4>>2]|0;
  10497. $76 = (+_MathCrossVector2($tmpcast$byval_copy,$tmpcast123$byval_copy));
  10498. $77 = $76 * 0.5;
  10499. $42 = $$0122133 + $77;
  10500. $78 = $77 * 0.3333333432674408;
  10501. $79 = +HEAPF32[$5>>2];
  10502. $80 = +HEAPF32[$6>>2];
  10503. $81 = $79 + $80;
  10504. $82 = $78 * $81;
  10505. $44 = $$sroa$0$0132 + $82;
  10506. $83 = +HEAPF32[$39>>2];
  10507. $84 = +HEAPF32[$40>>2];
  10508. $85 = $83 + $84;
  10509. $86 = $78 * $85;
  10510. $46 = $$sroa$8$0135 + $86;
  10511. $87 = $79 * $79;
  10512. $88 = $79 * $80;
  10513. $89 = $87 + $88;
  10514. $90 = $80 * $80;
  10515. $91 = $90 + $89;
  10516. $92 = $83 * $83;
  10517. $93 = $83 * $84;
  10518. $94 = $92 + $93;
  10519. $95 = $84 * $84;
  10520. $96 = $95 + $94;
  10521. $97 = $76 * 0.083333335816860198;
  10522. $98 = $91 + $96;
  10523. $99 = $97 * $98;
  10524. $100 = $$0121134 + $99;
  10525. $48 = HEAP32[$35>>2]|0;
  10526. $101 = ($61>>>0)<($48>>>0);
  10527. if ($101) {
  10528. $$0120136 = $61;$$0121134 = $100;$$0122133 = $42;$$sroa$0$0132 = $44;$$sroa$8$0135 = $46;
  10529. } else {
  10530. break;
  10531. }
  10532. }
  10533. $41 = 1.0 / $42;
  10534. $43 = $44 * $41;
  10535. $45 = $41 * $46;
  10536. $47 = ($48|0)==(0);
  10537. if ($47) {
  10538. $$0121$lcssa161 = $100;$$0122$lcssa160 = $42;
  10539. } else {
  10540. $49 = ((($7)) + 100|0);
  10541. $$0131 = 0;
  10542. while(1) {
  10543. $123 = (($49) + ($$0131<<3)|0);
  10544. $124 = +HEAPF32[$123>>2];
  10545. $125 = $124 - $43;
  10546. HEAPF32[$123>>2] = $125;
  10547. $126 = (((($49) + ($$0131<<3)|0)) + 4|0);
  10548. $127 = +HEAPF32[$126>>2];
  10549. $128 = $127 - $45;
  10550. HEAPF32[$126>>2] = $128;
  10551. $129 = (($$0131) + 1)|0;
  10552. $exitcond = ($129|0)==($48|0);
  10553. if ($exitcond) {
  10554. $$0121$lcssa161 = $100;$$0122$lcssa160 = $42;
  10555. break;
  10556. } else {
  10557. $$0131 = $129;
  10558. }
  10559. }
  10560. }
  10561. }
  10562. $102 = $$0122$lcssa160 * $3;
  10563. $103 = ((($7)) + 52|0);
  10564. HEAPF32[$103>>2] = $102;
  10565. $104 = $102 != 0.0;
  10566. $105 = 1.0 / $102;
  10567. $106 = $104 ? $105 : 0.0;
  10568. $107 = ((($7)) + 56|0);
  10569. HEAPF32[$107>>2] = $106;
  10570. $108 = $$0121$lcssa161 * $3;
  10571. $109 = ((($7)) + 44|0);
  10572. HEAPF32[$109>>2] = $108;
  10573. $110 = $108 != 0.0;
  10574. $111 = 1.0 / $108;
  10575. $112 = $110 ? $111 : 0.0;
  10576. $113 = ((($7)) + 48|0);
  10577. HEAPF32[$113>>2] = $112;
  10578. $114 = ((($7)) + 60|0);
  10579. HEAPF32[$114>>2] = 0.40000000596046448;
  10580. $115 = ((($7)) + 64|0);
  10581. HEAPF32[$115>>2] = 0.20000000298023224;
  10582. $116 = ((($7)) + 68|0);
  10583. HEAPF32[$116>>2] = 0.0;
  10584. $117 = ((($7)) + 72|0);
  10585. HEAP32[$117>>2] = 1;
  10586. $118 = ((($7)) + 76|0);
  10587. HEAP32[$118>>2] = 0;
  10588. $119 = ((($7)) + 80|0);
  10589. HEAP32[$119>>2] = 0;
  10590. $120 = HEAP32[3571]|0;
  10591. $121 = (14288 + ($120<<2)|0);
  10592. HEAP32[$121>>2] = $7;
  10593. $122 = (($120) + 1)|0;
  10594. HEAP32[3571] = $122;
  10595. STACKTOP = sp;return ($7|0);
  10596. }
  10597. function _CreatePhysicsBodyRectangle($0,$1,$2,$3) {
  10598. $0 = $0|0;
  10599. $1 = +$1;
  10600. $2 = +$2;
  10601. $3 = +$3;
  10602. var $$0116149 = 0, $$0116149158159 = 0, $$0119144 = 0, $$0120136 = 0, $$0121$lcssa161 = 0.0, $$0121134 = 0.0, $$0122$lcssa160 = 0.0, $$0122133 = 0.0, $$0131 = 0, $$sroa$0$0132 = 0.0, $$sroa$049$0$$sroa_idx = 0, $$sroa$8$0135 = 0.0, $10 = 0, $100 = 0.0, $101 = 0.0, $102 = 0.0, $103 = 0, $104 = 0.0, $105 = 0, $106 = 0;
  10603. var $107 = 0.0, $108 = 0.0, $109 = 0, $11 = 0, $110 = 0.0, $111 = 0, $112 = 0, $113 = 0.0, $114 = 0.0, $115 = 0, $116 = 0, $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0;
  10604. var $125 = 0, $126 = 0.0, $127 = 0.0, $128 = 0, $129 = 0.0, $13 = 0, $130 = 0.0, $131 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0;
  10605. var $26 = 0, $27 = 0, $28 = 0, $29 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0.0, $44 = 0.0;
  10606. var $45 = 0.0, $46 = 0.0, $47 = 0.0, $48 = 0.0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0;
  10607. var $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0.0, $79 = 0.0, $8 = 0, $80 = 0.0;
  10608. var $81 = 0.0, $82 = 0.0, $83 = 0.0, $84 = 0.0, $85 = 0.0, $86 = 0.0, $87 = 0.0, $88 = 0.0, $89 = 0.0, $9 = 0, $90 = 0.0, $91 = 0.0, $92 = 0.0, $93 = 0.0, $94 = 0.0, $95 = 0.0, $96 = 0.0, $97 = 0.0, $98 = 0.0, $99 = 0.0;
  10609. var $exitcond = 0, $tmpcast$byval_copy = 0, $tmpcast123$byval_copy = 0, label = 0, sp = 0;
  10610. sp = STACKTOP;
  10611. STACKTOP = STACKTOP + 448|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(448|0);
  10612. $tmpcast123$byval_copy = sp + 440|0;
  10613. $tmpcast$byval_copy = sp + 432|0;
  10614. $4 = sp + 424|0;
  10615. $5 = sp + 16|0;
  10616. $6 = sp + 8|0;
  10617. $7 = sp;
  10618. $8 = (_malloc(500)|0);
  10619. $9 = HEAP32[3570]|0;
  10620. $10 = (($9) + 500)|0;
  10621. HEAP32[3570] = $10;
  10622. $11 = HEAP32[3571]|0;
  10623. $12 = ($11|0)==(0);
  10624. $$0116149 = 0;
  10625. L1: while(1) {
  10626. if ($12) {
  10627. $$0116149158159 = 0;
  10628. break;
  10629. } else {
  10630. $$0119144 = 0;
  10631. }
  10632. while(1) {
  10633. $15 = (14288 + ($$0119144<<2)|0);
  10634. $16 = HEAP32[$15>>2]|0;
  10635. $17 = HEAP32[$16>>2]|0;
  10636. $18 = ($17|0)==($$0116149|0);
  10637. $14 = (($$0119144) + 1)|0;
  10638. if ($18) {
  10639. break;
  10640. }
  10641. $13 = ($14>>>0)<($11>>>0);
  10642. if ($13) {
  10643. $$0119144 = $14;
  10644. } else {
  10645. label = 6;
  10646. break L1;
  10647. }
  10648. }
  10649. $19 = (($$0116149) + 1)|0;
  10650. $20 = ($19|0)<(64);
  10651. if ($20) {
  10652. $$0116149 = $19;
  10653. } else {
  10654. label = 14;
  10655. break;
  10656. }
  10657. }
  10658. if ((label|0) == 14) {
  10659. STACKTOP = sp;return ($8|0);
  10660. }
  10661. if ((label|0) == 6) {
  10662. $21 = ($$0116149|0)==(-1);
  10663. if ($21) {
  10664. STACKTOP = sp;return ($8|0);
  10665. } else {
  10666. $$0116149158159 = $$0116149;
  10667. }
  10668. }
  10669. HEAP32[$8>>2] = $$0116149158159;
  10670. $22 = ((($8)) + 4|0);
  10671. HEAP32[$22>>2] = 1;
  10672. $23 = ((($8)) + 8|0);
  10673. $24 = $0;
  10674. $25 = $24;
  10675. $26 = HEAP32[$25>>2]|0;
  10676. $27 = (($24) + 4)|0;
  10677. $28 = $27;
  10678. $29 = HEAP32[$28>>2]|0;
  10679. $30 = $23;
  10680. $31 = $30;
  10681. HEAP32[$31>>2] = $26;
  10682. $32 = (($30) + 4)|0;
  10683. $33 = $32;
  10684. HEAP32[$33>>2] = $29;
  10685. $$sroa$049$0$$sroa_idx = ((($8)) + 16|0);
  10686. $34 = ((($8)) + 84|0);
  10687. ;HEAP32[$$sroa$049$0$$sroa_idx>>2]=0|0;HEAP32[$$sroa$049$0$$sroa_idx+4>>2]=0|0;HEAP32[$$sroa$049$0$$sroa_idx+8>>2]=0|0;HEAP32[$$sroa$049$0$$sroa_idx+12>>2]=0|0;HEAP32[$$sroa$049$0$$sroa_idx+16>>2]=0|0;HEAP32[$$sroa$049$0$$sroa_idx+20>>2]=0|0;HEAP32[$$sroa$049$0$$sroa_idx+24>>2]=0|0;
  10688. HEAP32[$34>>2] = 1;
  10689. $35 = ((($8)) + 88|0);
  10690. HEAP32[$35>>2] = $8;
  10691. $36 = ((($8)) + 96|0);
  10692. HEAPF32[$4>>2] = $1;
  10693. $37 = ((($4)) + 4|0);
  10694. HEAPF32[$37>>2] = $2;
  10695. ;HEAP32[$tmpcast$byval_copy>>2]=HEAP32[$0>>2]|0;HEAP32[$tmpcast$byval_copy+4>>2]=HEAP32[$0+4>>2]|0;
  10696. ;HEAP32[$tmpcast123$byval_copy>>2]=HEAP32[$4>>2]|0;HEAP32[$tmpcast123$byval_copy+4>>2]=HEAP32[$4+4>>2]|0;
  10697. _CreateRectanglePolygon($5,$tmpcast$byval_copy,$tmpcast123$byval_copy);
  10698. _memcpy(($36|0),($5|0),404)|0;
  10699. $38 = HEAP32[$36>>2]|0;
  10700. $39 = ($38|0)==(0);
  10701. if ($39) {
  10702. $$0121$lcssa161 = 0.0;$$0122$lcssa160 = 0.0;
  10703. } else {
  10704. $40 = ((($8)) + 100|0);
  10705. $41 = ((($6)) + 4|0);
  10706. $42 = ((($7)) + 4|0);
  10707. $$0120136 = 0;$$0121134 = 0.0;$$0122133 = 0.0;$$sroa$0$0132 = 0.0;$$sroa$8$0135 = 0.0;
  10708. while(1) {
  10709. $52 = (($40) + ($$0120136<<3)|0);
  10710. $53 = $52;
  10711. $54 = $53;
  10712. $55 = HEAP32[$54>>2]|0;
  10713. $56 = (($53) + 4)|0;
  10714. $57 = $56;
  10715. $58 = HEAP32[$57>>2]|0;
  10716. $59 = $6;
  10717. $60 = $59;
  10718. HEAP32[$60>>2] = $55;
  10719. $61 = (($59) + 4)|0;
  10720. $62 = $61;
  10721. HEAP32[$62>>2] = $58;
  10722. $63 = (($$0120136) + 1)|0;
  10723. $64 = HEAP32[$36>>2]|0;
  10724. $65 = ($63>>>0)<($64>>>0);
  10725. $66 = $65 ? $63 : 0;
  10726. $67 = (($40) + ($66<<3)|0);
  10727. $68 = $67;
  10728. $69 = $68;
  10729. $70 = HEAP32[$69>>2]|0;
  10730. $71 = (($68) + 4)|0;
  10731. $72 = $71;
  10732. $73 = HEAP32[$72>>2]|0;
  10733. $74 = $7;
  10734. $75 = $74;
  10735. HEAP32[$75>>2] = $70;
  10736. $76 = (($74) + 4)|0;
  10737. $77 = $76;
  10738. HEAP32[$77>>2] = $73;
  10739. ;HEAP32[$tmpcast$byval_copy>>2]=HEAP32[$6>>2]|0;HEAP32[$tmpcast$byval_copy+4>>2]=HEAP32[$6+4>>2]|0;
  10740. ;HEAP32[$tmpcast123$byval_copy>>2]=HEAP32[$7>>2]|0;HEAP32[$tmpcast123$byval_copy+4>>2]=HEAP32[$7+4>>2]|0;
  10741. $78 = (+_MathCrossVector2($tmpcast$byval_copy,$tmpcast123$byval_copy));
  10742. $79 = $78 * 0.5;
  10743. $44 = $$0122133 + $79;
  10744. $80 = $79 * 0.3333333432674408;
  10745. $81 = +HEAPF32[$6>>2];
  10746. $82 = +HEAPF32[$7>>2];
  10747. $83 = $81 + $82;
  10748. $84 = $80 * $83;
  10749. $46 = $$sroa$0$0132 + $84;
  10750. $85 = +HEAPF32[$41>>2];
  10751. $86 = +HEAPF32[$42>>2];
  10752. $87 = $85 + $86;
  10753. $88 = $80 * $87;
  10754. $48 = $$sroa$8$0135 + $88;
  10755. $89 = $81 * $81;
  10756. $90 = $81 * $82;
  10757. $91 = $89 + $90;
  10758. $92 = $82 * $82;
  10759. $93 = $92 + $91;
  10760. $94 = $85 * $85;
  10761. $95 = $85 * $86;
  10762. $96 = $94 + $95;
  10763. $97 = $86 * $86;
  10764. $98 = $97 + $96;
  10765. $99 = $78 * 0.083333335816860198;
  10766. $100 = $93 + $98;
  10767. $101 = $99 * $100;
  10768. $102 = $$0121134 + $101;
  10769. $50 = HEAP32[$36>>2]|0;
  10770. $103 = ($63>>>0)<($50>>>0);
  10771. if ($103) {
  10772. $$0120136 = $63;$$0121134 = $102;$$0122133 = $44;$$sroa$0$0132 = $46;$$sroa$8$0135 = $48;
  10773. } else {
  10774. break;
  10775. }
  10776. }
  10777. $43 = 1.0 / $44;
  10778. $45 = $46 * $43;
  10779. $47 = $43 * $48;
  10780. $49 = ($50|0)==(0);
  10781. if ($49) {
  10782. $$0121$lcssa161 = $102;$$0122$lcssa160 = $44;
  10783. } else {
  10784. $51 = ((($8)) + 100|0);
  10785. $$0131 = 0;
  10786. while(1) {
  10787. $125 = (($51) + ($$0131<<3)|0);
  10788. $126 = +HEAPF32[$125>>2];
  10789. $127 = $126 - $45;
  10790. HEAPF32[$125>>2] = $127;
  10791. $128 = (((($51) + ($$0131<<3)|0)) + 4|0);
  10792. $129 = +HEAPF32[$128>>2];
  10793. $130 = $129 - $47;
  10794. HEAPF32[$128>>2] = $130;
  10795. $131 = (($$0131) + 1)|0;
  10796. $exitcond = ($131|0)==($50|0);
  10797. if ($exitcond) {
  10798. $$0121$lcssa161 = $102;$$0122$lcssa160 = $44;
  10799. break;
  10800. } else {
  10801. $$0131 = $131;
  10802. }
  10803. }
  10804. }
  10805. }
  10806. $104 = $$0122$lcssa160 * $3;
  10807. $105 = ((($8)) + 52|0);
  10808. HEAPF32[$105>>2] = $104;
  10809. $106 = $104 != 0.0;
  10810. $107 = 1.0 / $104;
  10811. $108 = $106 ? $107 : 0.0;
  10812. $109 = ((($8)) + 56|0);
  10813. HEAPF32[$109>>2] = $108;
  10814. $110 = $$0121$lcssa161 * $3;
  10815. $111 = ((($8)) + 44|0);
  10816. HEAPF32[$111>>2] = $110;
  10817. $112 = $110 != 0.0;
  10818. $113 = 1.0 / $110;
  10819. $114 = $112 ? $113 : 0.0;
  10820. $115 = ((($8)) + 48|0);
  10821. HEAPF32[$115>>2] = $114;
  10822. $116 = ((($8)) + 60|0);
  10823. HEAPF32[$116>>2] = 0.40000000596046448;
  10824. $117 = ((($8)) + 64|0);
  10825. HEAPF32[$117>>2] = 0.20000000298023224;
  10826. $118 = ((($8)) + 68|0);
  10827. HEAPF32[$118>>2] = 0.0;
  10828. $119 = ((($8)) + 72|0);
  10829. HEAP32[$119>>2] = 1;
  10830. $120 = ((($8)) + 76|0);
  10831. HEAP32[$120>>2] = 0;
  10832. $121 = ((($8)) + 80|0);
  10833. HEAP32[$121>>2] = 0;
  10834. $122 = HEAP32[3571]|0;
  10835. $123 = (14288 + ($122<<2)|0);
  10836. HEAP32[$123>>2] = $8;
  10837. $124 = (($122) + 1)|0;
  10838. HEAP32[3571] = $124;
  10839. STACKTOP = sp;return ($8|0);
  10840. }
  10841. function _CreateRectanglePolygon($0,$1,$2) {
  10842. $0 = $0|0;
  10843. $1 = $1|0;
  10844. $2 = $2|0;
  10845. var $$024 = 0, $$byval_copy = 0, $$byval_copy1 = 0, $$sroa$012$0$$sroa_idx = 0, $$sroa$015$0$$sroa_idx = 0, $$sroa$018$0$$sroa_idx = 0, $$sroa$021$0$$sroa_idx = 0, $$sroa$2$0$$sroa_idx1 = 0, $$sroa$213$0$$sroa_idx14 = 0, $$sroa$216$0$$sroa_idx17 = 0, $$sroa$219$0$$sroa_idx20 = 0, $$sroa$222$0$$sroa_idx23 = 0, $10 = 0.0, $11 = 0.0, $12 = 0, $13 = 0.0, $14 = 0, $15 = 0.0, $16 = 0.0, $17 = 0.0;
  10846. var $18 = 0.0, $19 = 0.0, $20 = 0.0, $21 = 0.0, $22 = 0.0, $23 = 0.0, $24 = 0.0, $25 = 0.0, $26 = 0.0, $27 = 0.0, $28 = 0.0, $29 = 0.0, $3 = 0, $30 = 0.0, $31 = 0.0, $32 = 0.0, $33 = 0.0, $34 = 0.0, $35 = 0.0, $36 = 0.0;
  10847. var $37 = 0.0, $38 = 0.0, $39 = 0.0, $4 = 0, $40 = 0.0, $41 = 0.0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0.0, $54 = 0.0;
  10848. var $55 = 0, $56 = 0, $6 = 0, $7 = 0, $8 = 0.0, $9 = 0.0, label = 0, sp = 0;
  10849. sp = STACKTOP;
  10850. STACKTOP = STACKTOP + 448|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(448|0);
  10851. $$byval_copy1 = sp + 440|0;
  10852. $$byval_copy = sp + 432|0;
  10853. $3 = sp + 24|0;
  10854. $4 = sp;
  10855. $5 = sp + 16|0;
  10856. $6 = ((($3)) + 36|0);
  10857. _memset(($6|0),0,368)|0;
  10858. HEAP32[$3>>2] = 4;
  10859. $7 = ((($3)) + 388|0);
  10860. _Mat2Radians($4,0.0);
  10861. ;HEAP32[$7>>2]=HEAP32[$4>>2]|0;HEAP32[$7+4>>2]=HEAP32[$4+4>>2]|0;HEAP32[$7+8>>2]=HEAP32[$4+8>>2]|0;HEAP32[$7+12>>2]=HEAP32[$4+12>>2]|0;
  10862. $8 = +HEAPF32[$1>>2];
  10863. $9 = +HEAPF32[$2>>2];
  10864. $10 = $9 * 0.5;
  10865. $11 = $8 + $10;
  10866. $12 = ((($1)) + 4|0);
  10867. $13 = +HEAPF32[$12>>2];
  10868. $14 = ((($2)) + 4|0);
  10869. $15 = +HEAPF32[$14>>2];
  10870. $16 = $15 * 0.5;
  10871. $17 = $13 - $16;
  10872. $$sroa$021$0$$sroa_idx = ((($3)) + 4|0);
  10873. HEAPF32[$$sroa$021$0$$sroa_idx>>2] = $11;
  10874. $$sroa$222$0$$sroa_idx23 = ((($3)) + 8|0);
  10875. HEAPF32[$$sroa$222$0$$sroa_idx23>>2] = $17;
  10876. $18 = +HEAPF32[$1>>2];
  10877. $19 = +HEAPF32[$2>>2];
  10878. $20 = $19 * 0.5;
  10879. $21 = $18 + $20;
  10880. $22 = +HEAPF32[$12>>2];
  10881. $23 = +HEAPF32[$14>>2];
  10882. $24 = $23 * 0.5;
  10883. $25 = $22 + $24;
  10884. $$sroa$018$0$$sroa_idx = ((($3)) + 12|0);
  10885. HEAPF32[$$sroa$018$0$$sroa_idx>>2] = $21;
  10886. $$sroa$219$0$$sroa_idx20 = ((($3)) + 16|0);
  10887. HEAPF32[$$sroa$219$0$$sroa_idx20>>2] = $25;
  10888. $26 = +HEAPF32[$1>>2];
  10889. $27 = +HEAPF32[$2>>2];
  10890. $28 = $27 * 0.5;
  10891. $29 = $26 - $28;
  10892. $30 = +HEAPF32[$12>>2];
  10893. $31 = +HEAPF32[$14>>2];
  10894. $32 = $31 * 0.5;
  10895. $33 = $30 + $32;
  10896. $$sroa$015$0$$sroa_idx = ((($3)) + 20|0);
  10897. HEAPF32[$$sroa$015$0$$sroa_idx>>2] = $29;
  10898. $$sroa$216$0$$sroa_idx17 = ((($3)) + 24|0);
  10899. HEAPF32[$$sroa$216$0$$sroa_idx17>>2] = $33;
  10900. $34 = +HEAPF32[$1>>2];
  10901. $35 = +HEAPF32[$2>>2];
  10902. $36 = $35 * 0.5;
  10903. $37 = $34 - $36;
  10904. $38 = +HEAPF32[$12>>2];
  10905. $39 = +HEAPF32[$14>>2];
  10906. $40 = $39 * 0.5;
  10907. $41 = $38 - $40;
  10908. $$sroa$012$0$$sroa_idx = ((($3)) + 28|0);
  10909. HEAPF32[$$sroa$012$0$$sroa_idx>>2] = $37;
  10910. $$sroa$213$0$$sroa_idx14 = ((($3)) + 32|0);
  10911. HEAPF32[$$sroa$213$0$$sroa_idx14>>2] = $41;
  10912. $42 = HEAP32[$3>>2]|0;
  10913. $43 = ($42|0)==(0);
  10914. if ($43) {
  10915. _memcpy(($0|0),($3|0),404)|0;
  10916. STACKTOP = sp;return;
  10917. }
  10918. $44 = ((($5)) + 4|0);
  10919. $$024 = 0;$47 = $42;
  10920. while(1) {
  10921. $45 = (($$024) + 1)|0;
  10922. $46 = ($45>>>0)<($47>>>0);
  10923. $48 = $46 ? $45 : 0;
  10924. $49 = (((($3)) + 4|0) + ($48<<3)|0);
  10925. $50 = (((($3)) + 4|0) + ($$024<<3)|0);
  10926. ;HEAP32[$$byval_copy>>2]=HEAP32[$49>>2]|0;HEAP32[$$byval_copy+4>>2]=HEAP32[$49+4>>2]|0;
  10927. ;HEAP32[$$byval_copy1>>2]=HEAP32[$50>>2]|0;HEAP32[$$byval_copy1+4>>2]=HEAP32[$50+4>>2]|0;
  10928. _Vector2Subtract_4($5,$$byval_copy,$$byval_copy1);
  10929. $51 = (((($3)) + 196|0) + ($$024<<3)|0);
  10930. $52 = HEAP32[$44>>2]|0;
  10931. $53 = +HEAPF32[$5>>2];
  10932. $54 = -$53;
  10933. HEAP32[$51>>2] = $52;
  10934. $$sroa$2$0$$sroa_idx1 = (((((($3)) + 196|0) + ($$024<<3)|0)) + 4|0);
  10935. HEAPF32[$$sroa$2$0$$sroa_idx1>>2] = $54;
  10936. _MathNormalize($51);
  10937. $55 = HEAP32[$3>>2]|0;
  10938. $56 = ($45>>>0)<($55>>>0);
  10939. if ($56) {
  10940. $$024 = $45;$47 = $55;
  10941. } else {
  10942. break;
  10943. }
  10944. }
  10945. _memcpy(($0|0),($3|0),404)|0;
  10946. STACKTOP = sp;return;
  10947. }
  10948. function _MathCrossVector2($0,$1) {
  10949. $0 = $0|0;
  10950. $1 = $1|0;
  10951. var $10 = 0.0, $2 = 0.0, $3 = 0, $4 = 0.0, $5 = 0.0, $6 = 0, $7 = 0.0, $8 = 0.0, $9 = 0.0, label = 0, sp = 0;
  10952. sp = STACKTOP;
  10953. $2 = +HEAPF32[$0>>2];
  10954. $3 = ((($1)) + 4|0);
  10955. $4 = +HEAPF32[$3>>2];
  10956. $5 = $2 * $4;
  10957. $6 = ((($0)) + 4|0);
  10958. $7 = +HEAPF32[$6>>2];
  10959. $8 = +HEAPF32[$1>>2];
  10960. $9 = $7 * $8;
  10961. $10 = $5 - $9;
  10962. return (+$10);
  10963. }
  10964. function _CreateRandomPolygon($0,$1,$2) {
  10965. $0 = $0|0;
  10966. $1 = +$1;
  10967. $2 = $2|0;
  10968. var $$02829 = 0, $$030 = 0, $$byval_copy = 0, $$byval_copy1 = 0, $$pr = 0, $$sroa$2$0$$sroa_idx1 = 0, $10 = 0.0, $11 = 0.0, $12 = 0.0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0.0, $21 = 0.0, $22 = 0.0, $23 = 0.0;
  10969. var $24 = 0.0, $25 = 0, $26 = 0.0, $27 = 0.0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0.0, $39 = 0.0, $4 = 0, $40 = 0, $41 = 0;
  10970. var $5 = 0, $6 = 0, $7 = 0, $8 = 0.0, $9 = 0, label = 0, sp = 0;
  10971. sp = STACKTOP;
  10972. STACKTOP = STACKTOP + 448|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(448|0);
  10973. $$byval_copy1 = sp + 440|0;
  10974. $$byval_copy = sp + 432|0;
  10975. $3 = sp + 24|0;
  10976. $4 = sp;
  10977. $5 = sp + 16|0;
  10978. $6 = ((($3)) + 4|0);
  10979. _memset(($6|0),0,400)|0;
  10980. HEAP32[$3>>2] = $2;
  10981. $7 = (_GetRandomNumber()|0);
  10982. $8 = (+($7|0));
  10983. $9 = ((($3)) + 388|0);
  10984. $10 = $8;
  10985. $11 = $10 * 0.017453292519943295;
  10986. $12 = $11;
  10987. _Mat2Radians($4,$12);
  10988. ;HEAP32[$9>>2]=HEAP32[$4>>2]|0;HEAP32[$9+4>>2]=HEAP32[$4+4>>2]|0;HEAP32[$9+8>>2]=HEAP32[$4+8>>2]|0;HEAP32[$9+12>>2]=HEAP32[$4+12>>2]|0;
  10989. $13 = HEAP32[$3>>2]|0;
  10990. $14 = ($13|0)==(0);
  10991. if ($14) {
  10992. _memcpy(($0|0),($3|0),404)|0;
  10993. STACKTOP = sp;return;
  10994. }
  10995. $15 = (360 / ($2|0))&-1;
  10996. $16 = HEAP32[$3>>2]|0;
  10997. $$030 = 0;
  10998. while(1) {
  10999. $19 = Math_imul($15, $$030)|0;
  11000. $20 = (+($19|0));
  11001. $21 = $20 * 0.017453292519943295;
  11002. $22 = $21;
  11003. $23 = (+Math_cos((+$22)));
  11004. $24 = $23 * $1;
  11005. $25 = (((($3)) + 4|0) + ($$030<<3)|0);
  11006. HEAPF32[$25>>2] = $24;
  11007. $26 = (+Math_sin((+$22)));
  11008. $27 = $26 * $1;
  11009. $28 = (((((($3)) + 4|0) + ($$030<<3)|0)) + 4|0);
  11010. HEAPF32[$28>>2] = $27;
  11011. $29 = (($$030) + 1)|0;
  11012. $30 = ($29>>>0)<($16>>>0);
  11013. if ($30) {
  11014. $$030 = $29;
  11015. } else {
  11016. break;
  11017. }
  11018. }
  11019. $$pr = HEAP32[$3>>2]|0;
  11020. $17 = ($$pr|0)==(0);
  11021. if ($17) {
  11022. _memcpy(($0|0),($3|0),404)|0;
  11023. STACKTOP = sp;return;
  11024. }
  11025. $18 = ((($5)) + 4|0);
  11026. $$02829 = 0;
  11027. while(1) {
  11028. $31 = (($$02829) + 1)|0;
  11029. $32 = ($31|0)<($2|0);
  11030. $33 = $32 ? $31 : 0;
  11031. $34 = (((($3)) + 4|0) + ($33<<3)|0);
  11032. $35 = (((($3)) + 4|0) + ($$02829<<3)|0);
  11033. ;HEAP32[$$byval_copy>>2]=HEAP32[$34>>2]|0;HEAP32[$$byval_copy+4>>2]=HEAP32[$34+4>>2]|0;
  11034. ;HEAP32[$$byval_copy1>>2]=HEAP32[$35>>2]|0;HEAP32[$$byval_copy1+4>>2]=HEAP32[$35+4>>2]|0;
  11035. _Vector2Subtract_4($5,$$byval_copy,$$byval_copy1);
  11036. $36 = (((($3)) + 196|0) + ($$02829<<3)|0);
  11037. $37 = HEAP32[$18>>2]|0;
  11038. $38 = +HEAPF32[$5>>2];
  11039. $39 = -$38;
  11040. HEAP32[$36>>2] = $37;
  11041. $$sroa$2$0$$sroa_idx1 = (((((($3)) + 196|0) + ($$02829<<3)|0)) + 4|0);
  11042. HEAPF32[$$sroa$2$0$$sroa_idx1>>2] = $39;
  11043. _MathNormalize($36);
  11044. $40 = HEAP32[$3>>2]|0;
  11045. $41 = ($31>>>0)<($40>>>0);
  11046. if ($41) {
  11047. $$02829 = $31;
  11048. } else {
  11049. break;
  11050. }
  11051. }
  11052. _memcpy(($0|0),($3|0),404)|0;
  11053. STACKTOP = sp;return;
  11054. }
  11055. function _Vector2Add_2($0,$1,$2) {
  11056. $0 = $0|0;
  11057. $1 = $1|0;
  11058. $2 = $2|0;
  11059. var $10 = 0.0, $11 = 0.0, $3 = 0.0, $4 = 0.0, $5 = 0.0, $6 = 0, $7 = 0, $8 = 0.0, $9 = 0, label = 0, sp = 0;
  11060. sp = STACKTOP;
  11061. $3 = +HEAPF32[$1>>2];
  11062. $4 = +HEAPF32[$2>>2];
  11063. $5 = $3 + $4;
  11064. HEAPF32[$0>>2] = $5;
  11065. $6 = ((($0)) + 4|0);
  11066. $7 = ((($1)) + 4|0);
  11067. $8 = +HEAPF32[$7>>2];
  11068. $9 = ((($2)) + 4|0);
  11069. $10 = +HEAPF32[$9>>2];
  11070. $11 = $8 + $10;
  11071. HEAPF32[$6>>2] = $11;
  11072. return;
  11073. }
  11074. function _Mat2MultiplyVector2($0,$1,$2) {
  11075. $0 = $0|0;
  11076. $1 = $1|0;
  11077. $2 = $2|0;
  11078. var $10 = 0.0, $11 = 0.0, $12 = 0, $13 = 0, $14 = 0.0, $15 = 0.0, $16 = 0, $17 = 0.0, $18 = 0.0, $19 = 0.0, $3 = 0.0, $4 = 0.0, $5 = 0.0, $6 = 0, $7 = 0.0, $8 = 0, $9 = 0.0, label = 0, sp = 0;
  11079. sp = STACKTOP;
  11080. $3 = +HEAPF32[$1>>2];
  11081. $4 = +HEAPF32[$2>>2];
  11082. $5 = $3 * $4;
  11083. $6 = ((($1)) + 4|0);
  11084. $7 = +HEAPF32[$6>>2];
  11085. $8 = ((($2)) + 4|0);
  11086. $9 = +HEAPF32[$8>>2];
  11087. $10 = $7 * $9;
  11088. $11 = $5 + $10;
  11089. HEAPF32[$0>>2] = $11;
  11090. $12 = ((($0)) + 4|0);
  11091. $13 = ((($1)) + 8|0);
  11092. $14 = +HEAPF32[$13>>2];
  11093. $15 = $4 * $14;
  11094. $16 = ((($1)) + 12|0);
  11095. $17 = +HEAPF32[$16>>2];
  11096. $18 = $9 * $17;
  11097. $19 = $15 + $18;
  11098. HEAPF32[$12>>2] = $19;
  11099. return;
  11100. }
  11101. function _DestroyPhysicsBody($0) {
  11102. $0 = $0|0;
  11103. var $$02023 = 0, $$021 = 0, $$022 = 0, $$lcssa = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0;
  11104. var $24 = 0, $25 = 0, $26 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  11105. sp = STACKTOP;
  11106. $1 = ($0|0)==(0|0);
  11107. if ($1) {
  11108. return;
  11109. }
  11110. $2 = HEAP32[$0>>2]|0;
  11111. $3 = HEAP32[3571]|0;
  11112. $4 = ($3|0)==(0);
  11113. L4: do {
  11114. if ($4) {
  11115. $$021 = -1;
  11116. } else {
  11117. $5 = HEAP32[3571]|0;
  11118. $$02023 = 0;
  11119. while(1) {
  11120. $6 = (14288 + ($$02023<<2)|0);
  11121. $7 = HEAP32[$6>>2]|0;
  11122. $8 = HEAP32[$7>>2]|0;
  11123. $9 = ($8|0)==($2|0);
  11124. if ($9) {
  11125. $$021 = $$02023;
  11126. break L4;
  11127. }
  11128. $10 = (($$02023) + 1)|0;
  11129. $11 = ($10>>>0)<($5>>>0);
  11130. if ($11) {
  11131. $$02023 = $10;
  11132. } else {
  11133. $$021 = -1;
  11134. break;
  11135. }
  11136. }
  11137. }
  11138. } while(0);
  11139. $12 = (14288 + ($$021<<2)|0);
  11140. $13 = HEAP32[$12>>2]|0;
  11141. _free($13);
  11142. $14 = HEAP32[3570]|0;
  11143. $15 = (($14) + -500)|0;
  11144. HEAP32[3570] = $15;
  11145. HEAP32[$12>>2] = 0;
  11146. $16 = HEAP32[3571]|0;
  11147. $17 = ($$021>>>0)<($16>>>0);
  11148. if ($17) {
  11149. $18 = HEAP32[3571]|0;
  11150. $$022 = $$021;$22 = $16;
  11151. while(1) {
  11152. $20 = (($$022) + 1)|0;
  11153. $21 = ($20>>>0)<($22>>>0);
  11154. if ($21) {
  11155. $24 = (14288 + ($$022<<2)|0);
  11156. $25 = (14288 + ($20<<2)|0);
  11157. $26 = HEAP32[$25>>2]|0;
  11158. HEAP32[$24>>2] = $26;
  11159. }
  11160. $23 = ($20>>>0)<($18>>>0);
  11161. if ($23) {
  11162. $$022 = $20;$22 = $18;
  11163. } else {
  11164. $$lcssa = $18;
  11165. break;
  11166. }
  11167. }
  11168. } else {
  11169. $$lcssa = $16;
  11170. }
  11171. $19 = (($$lcssa) + -1)|0;
  11172. HEAP32[3571] = $19;
  11173. return;
  11174. }
  11175. function _Vector2Subtract_4($0,$1,$2) {
  11176. $0 = $0|0;
  11177. $1 = $1|0;
  11178. $2 = $2|0;
  11179. var $10 = 0.0, $11 = 0.0, $3 = 0.0, $4 = 0.0, $5 = 0.0, $6 = 0, $7 = 0, $8 = 0.0, $9 = 0, label = 0, sp = 0;
  11180. sp = STACKTOP;
  11181. $3 = +HEAPF32[$1>>2];
  11182. $4 = +HEAPF32[$2>>2];
  11183. $5 = $3 - $4;
  11184. HEAPF32[$0>>2] = $5;
  11185. $6 = ((($0)) + 4|0);
  11186. $7 = ((($1)) + 4|0);
  11187. $8 = +HEAPF32[$7>>2];
  11188. $9 = ((($2)) + 4|0);
  11189. $10 = +HEAPF32[$9>>2];
  11190. $11 = $8 - $10;
  11191. HEAPF32[$6>>2] = $11;
  11192. return;
  11193. }
  11194. function _MathNormalize($0) {
  11195. $0 = $0|0;
  11196. var $$op = 0.0, $$sroa$0$0$copyload = 0.0, $$sroa$5$0$$sroa_idx3 = 0, $$sroa$5$0$copyload = 0.0, $1 = 0.0, $2 = 0.0, $3 = 0.0, $4 = 0.0, $5 = 0, $6 = 0.0, $7 = 0.0, $8 = 0.0, label = 0, sp = 0;
  11197. sp = STACKTOP;
  11198. $$sroa$0$0$copyload = +HEAPF32[$0>>2];
  11199. $$sroa$5$0$$sroa_idx3 = ((($0)) + 4|0);
  11200. $$sroa$5$0$copyload = +HEAPF32[$$sroa$5$0$$sroa_idx3>>2];
  11201. $1 = $$sroa$0$0$copyload * $$sroa$0$0$copyload;
  11202. $2 = $$sroa$5$0$copyload * $$sroa$5$0$copyload;
  11203. $3 = $1 + $2;
  11204. $4 = (+Math_sqrt((+$3)));
  11205. $5 = $4 == 0.0;
  11206. $$op = 1.0 / $4;
  11207. $6 = $5 ? 1.0 : $$op;
  11208. $7 = $$sroa$0$0$copyload * $6;
  11209. HEAPF32[$0>>2] = $7;
  11210. $8 = $$sroa$5$0$copyload * $6;
  11211. HEAPF32[$$sroa$5$0$$sroa_idx3>>2] = $8;
  11212. return;
  11213. }
  11214. function _GetPhysicsBodiesCount() {
  11215. var $0 = 0, label = 0, sp = 0;
  11216. sp = STACKTOP;
  11217. $0 = HEAP32[3571]|0;
  11218. return ($0|0);
  11219. }
  11220. function _GetPhysicsBody($0) {
  11221. $0 = $0|0;
  11222. var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, label = 0, sp = 0;
  11223. sp = STACKTOP;
  11224. $1 = HEAP32[3571]|0;
  11225. $2 = ($1>>>0)>($0>>>0);
  11226. if (!($2)) {
  11227. $$0 = 0;
  11228. return ($$0|0);
  11229. }
  11230. $3 = (14288 + ($0<<2)|0);
  11231. $4 = HEAP32[$3>>2]|0;
  11232. $$0 = $4;
  11233. return ($$0|0);
  11234. }
  11235. function _GetPhysicsShapeVerticesCount($0) {
  11236. $0 = $0|0;
  11237. var $$1 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  11238. sp = STACKTOP;
  11239. $1 = HEAP32[3571]|0;
  11240. $2 = ($1>>>0)>($0>>>0);
  11241. L1: do {
  11242. if ($2) {
  11243. $3 = (14288 + ($0<<2)|0);
  11244. $4 = HEAP32[$3>>2]|0;
  11245. $5 = ($4|0)==(0|0);
  11246. if ($5) {
  11247. $$1 = 0;
  11248. } else {
  11249. $6 = ((($4)) + 84|0);
  11250. $7 = HEAP32[$6>>2]|0;
  11251. switch ($7|0) {
  11252. case 0: {
  11253. $$1 = 24;
  11254. break L1;
  11255. break;
  11256. }
  11257. case 1: {
  11258. $8 = ((($4)) + 96|0);
  11259. $9 = HEAP32[$8>>2]|0;
  11260. $$1 = $9;
  11261. break L1;
  11262. break;
  11263. }
  11264. default: {
  11265. $$1 = 0;
  11266. break L1;
  11267. }
  11268. }
  11269. }
  11270. } else {
  11271. $$1 = 0;
  11272. }
  11273. } while(0);
  11274. return ($$1|0);
  11275. }
  11276. function _GetPhysicsShapeVertex($0,$1,$2) {
  11277. $0 = $0|0;
  11278. $1 = $1|0;
  11279. $2 = $2|0;
  11280. var $$byval_copy2 = 0, $$byval_copy3 = 0, $$sroa$0$0 = 0.0, $$sroa$0$0$copyload = 0.0, $$sroa$6$0 = 0.0, $$sroa$6$0$$sroa_idx4 = 0, $$sroa$6$0$$sroa_idx5 = 0, $$sroa$6$0$copyload = 0.0, $10 = 0.0, $11 = 0, $12 = 0.0, $13 = 0.0, $14 = 0.0, $15 = 0.0, $16 = 0, $17 = 0.0, $18 = 0.0, $19 = 0.0, $20 = 0, $21 = 0.0;
  11281. var $22 = 0.0, $23 = 0.0, $24 = 0.0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  11282. sp = STACKTOP;
  11283. STACKTOP = STACKTOP + 448|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(448|0);
  11284. $$byval_copy3 = sp + 440|0;
  11285. $$byval_copy2 = sp + 424|0;
  11286. $3 = sp;
  11287. $4 = sp + 416|0;
  11288. $5 = sp + 408|0;
  11289. $6 = ($1|0)==(0|0);
  11290. L1: do {
  11291. if ($6) {
  11292. $$sroa$0$0 = 0.0;$$sroa$6$0 = 0.0;
  11293. } else {
  11294. $7 = ((($1)) + 84|0);
  11295. $8 = HEAP32[$7>>2]|0;
  11296. switch ($8|0) {
  11297. case 0: {
  11298. $9 = ((($1)) + 8|0);
  11299. $10 = +HEAPF32[$9>>2];
  11300. $11 = ($2*15)|0;
  11301. $12 = (+($11|0));
  11302. $13 = $12 * 0.017453292519943295;
  11303. $14 = $13;
  11304. $15 = (+Math_cos((+$14)));
  11305. $16 = ((($1)) + 92|0);
  11306. $17 = +HEAPF32[$16>>2];
  11307. $18 = $15 * $17;
  11308. $19 = $10 + $18;
  11309. $20 = ((($1)) + 12|0);
  11310. $21 = +HEAPF32[$20>>2];
  11311. $22 = (+Math_sin((+$14)));
  11312. $23 = $17 * $22;
  11313. $24 = $21 + $23;
  11314. $$sroa$0$0 = $19;$$sroa$6$0 = $24;
  11315. break L1;
  11316. break;
  11317. }
  11318. case 1: {
  11319. $25 = ((($1)) + 96|0);
  11320. _memcpy(($3|0),($25|0),404)|0;
  11321. $26 = ((($1)) + 8|0);
  11322. $27 = ((($3)) + 388|0);
  11323. $28 = (((($3)) + 4|0) + ($2<<3)|0);
  11324. ;HEAP32[$$byval_copy2>>2]=HEAP32[$27>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$27+4>>2]|0;HEAP32[$$byval_copy2+8>>2]=HEAP32[$27+8>>2]|0;HEAP32[$$byval_copy2+12>>2]=HEAP32[$27+12>>2]|0;
  11325. ;HEAP32[$$byval_copy3>>2]=HEAP32[$28>>2]|0;HEAP32[$$byval_copy3+4>>2]=HEAP32[$28+4>>2]|0;
  11326. _Mat2MultiplyVector2($4,$$byval_copy2,$$byval_copy3);
  11327. ;HEAP32[$$byval_copy2>>2]=HEAP32[$26>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$26+4>>2]|0;
  11328. ;HEAP32[$$byval_copy3>>2]=HEAP32[$4>>2]|0;HEAP32[$$byval_copy3+4>>2]=HEAP32[$4+4>>2]|0;
  11329. _Vector2Add_2($5,$$byval_copy2,$$byval_copy3);
  11330. $$sroa$0$0$copyload = +HEAPF32[$5>>2];
  11331. $$sroa$6$0$$sroa_idx4 = ((($5)) + 4|0);
  11332. $$sroa$6$0$copyload = +HEAPF32[$$sroa$6$0$$sroa_idx4>>2];
  11333. $$sroa$0$0 = $$sroa$0$0$copyload;$$sroa$6$0 = $$sroa$6$0$copyload;
  11334. break L1;
  11335. break;
  11336. }
  11337. default: {
  11338. $$sroa$0$0 = 0.0;$$sroa$6$0 = 0.0;
  11339. break L1;
  11340. }
  11341. }
  11342. }
  11343. } while(0);
  11344. HEAPF32[$0>>2] = $$sroa$0$0;
  11345. $$sroa$6$0$$sroa_idx5 = ((($0)) + 4|0);
  11346. HEAPF32[$$sroa$6$0$$sroa_idx5>>2] = $$sroa$6$0;
  11347. STACKTOP = sp;return;
  11348. }
  11349. function _Mat2Radians($0,$1) {
  11350. $0 = $0|0;
  11351. $1 = +$1;
  11352. var $2 = 0.0, $3 = 0.0, $4 = 0, $5 = 0.0, $6 = 0, $7 = 0, label = 0, sp = 0;
  11353. sp = STACKTOP;
  11354. $2 = (+Math_cos((+$1)));
  11355. $3 = (+Math_sin((+$1)));
  11356. HEAPF32[$0>>2] = $2;
  11357. $4 = ((($0)) + 4|0);
  11358. $5 = -$3;
  11359. HEAPF32[$4>>2] = $5;
  11360. $6 = ((($0)) + 8|0);
  11361. HEAPF32[$6>>2] = $3;
  11362. $7 = ((($0)) + 12|0);
  11363. HEAPF32[$7>>2] = $2;
  11364. return;
  11365. }
  11366. function _ClosePhysics() {
  11367. var $0 = 0, label = 0, sp = 0;
  11368. sp = STACKTOP;
  11369. HEAP32[3569] = 0;
  11370. $0 = HEAP32[3568]|0;
  11371. (_pthread_join(($0|0),(0|0))|0);
  11372. return;
  11373. }
  11374. function _main() {
  11375. var $$byval_copy3 = 0, $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0.0, $13 = 0, $14 = 0, $15 = 0.0, $16 = 0, $17 = 0.0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0.0, $23 = 0.0, $24 = 0, $25 = 0;
  11376. var $26 = 0, $27 = 0.0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0.0, $32 = 0.0, $33 = 0, $34 = 0, $35 = 0, $36 = 0.0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0.0, $41 = 0.0, $42 = 0, $43 = 0;
  11377. var $44 = 0, $45 = 0.0, $46 = 0, $47 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  11378. sp = STACKTOP;
  11379. STACKTOP = STACKTOP + 48|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(48|0);
  11380. $$byval_copy3 = sp + 32|0;
  11381. $0 = sp + 24|0;
  11382. $1 = sp + 16|0;
  11383. $2 = sp + 8|0;
  11384. $3 = sp;
  11385. _SetConfigFlags(32);
  11386. $4 = HEAP32[2]|0;
  11387. $5 = HEAP32[3]|0;
  11388. _InitWindow($4,$5,3248);
  11389. $6 = HEAP32[2]|0;
  11390. $7 = (_MeasureText(3286,30)|0);
  11391. $8 = (($6) + -10)|0;
  11392. $9 = (($8) - ($7))|0;
  11393. HEAP32[7733] = $9;
  11394. _InitPhysics();
  11395. $10 = HEAP32[2]|0;
  11396. $11 = (($10|0) / 2)&-1;
  11397. $12 = (+($11|0));
  11398. HEAPF32[$0>>2] = $12;
  11399. $13 = ((($0)) + 4|0);
  11400. $14 = HEAP32[3]|0;
  11401. $15 = (+($14|0));
  11402. HEAPF32[$13>>2] = $15;
  11403. $16 = HEAP32[2]|0;
  11404. $17 = (+($16|0));
  11405. ;HEAP32[$$byval_copy3>>2]=HEAP32[$0>>2]|0;HEAP32[$$byval_copy3+4>>2]=HEAP32[$0+4>>2]|0;
  11406. $18 = (_CreatePhysicsBodyRectangle($$byval_copy3,$17,100.0,10.0)|0);
  11407. $19 = ((($18)) + 4|0);
  11408. HEAP32[$19>>2] = 0;
  11409. $20 = ((($18)) + 68|0);
  11410. HEAPF32[$20>>2] = 1.0;
  11411. $21 = HEAP32[2]|0;
  11412. $22 = (+($21|0));
  11413. $23 = $22 * 0.25;
  11414. HEAPF32[$1>>2] = $23;
  11415. $24 = ((($1)) + 4|0);
  11416. $25 = HEAP32[3]|0;
  11417. $26 = (($25|0) / 2)&-1;
  11418. $27 = (+($26|0));
  11419. HEAPF32[$24>>2] = $27;
  11420. ;HEAP32[$$byval_copy3>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy3+4>>2]=HEAP32[$1+4>>2]|0;
  11421. $28 = (_CreatePhysicsBodyCircle($$byval_copy3,30.0,10.0)|0);
  11422. HEAP32[7734] = $28;
  11423. $29 = ((($28)) + 68|0);
  11424. HEAPF32[$29>>2] = 0.0;
  11425. $30 = HEAP32[2]|0;
  11426. $31 = (+($30|0));
  11427. $32 = $31 * 0.5;
  11428. HEAPF32[$2>>2] = $32;
  11429. $33 = ((($2)) + 4|0);
  11430. $34 = HEAP32[3]|0;
  11431. $35 = (($34|0) / 2)&-1;
  11432. $36 = (+($35|0));
  11433. HEAPF32[$33>>2] = $36;
  11434. ;HEAP32[$$byval_copy3>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy3+4>>2]=HEAP32[$2+4>>2]|0;
  11435. $37 = (_CreatePhysicsBodyCircle($$byval_copy3,30.0,10.0)|0);
  11436. HEAP32[7735] = $37;
  11437. $38 = ((($37)) + 68|0);
  11438. HEAPF32[$38>>2] = 0.5;
  11439. $39 = HEAP32[2]|0;
  11440. $40 = (+($39|0));
  11441. $41 = $40 * 0.75;
  11442. HEAPF32[$3>>2] = $41;
  11443. $42 = ((($3)) + 4|0);
  11444. $43 = HEAP32[3]|0;
  11445. $44 = (($43|0) / 2)&-1;
  11446. $45 = (+($44|0));
  11447. HEAPF32[$42>>2] = $45;
  11448. ;HEAP32[$$byval_copy3>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy3+4>>2]=HEAP32[$3+4>>2]|0;
  11449. $46 = (_CreatePhysicsBodyCircle($$byval_copy3,30.0,10.0)|0);
  11450. HEAP32[7736] = $46;
  11451. $47 = ((($46)) + 68|0);
  11452. HEAPF32[$47>>2] = 1.0;
  11453. _emscripten_set_main_loop((1|0),0,1);
  11454. _ClosePhysics();
  11455. _CloseWindow();
  11456. STACKTOP = sp;return 0;
  11457. }
  11458. function _UpdateDrawFrame() {
  11459. var $$04142 = 0, $$043 = 0, $$byval_copy1 = 0, $$byval_copy2 = 0, $$byval_copy3 = 0, $$sroa$0$0$$sroa_idx = 0, $$sroa$026$0$$sroa_idx = 0, $$sroa$029$0$$sroa_idx = 0, $$sroa$032$0$$sroa_idx = 0, $$sroa$035$0$$sroa_idx = 0, $$sroa$038$0$$sroa_idx = 0, $$sroa$2$0$$sroa_idx25 = 0, $$sroa$227$0$$sroa_idx28 = 0, $$sroa$230$0$$sroa_idx31 = 0, $$sroa$233$0$$sroa_idx34 = 0, $$sroa$236$0$$sroa_idx37 = 0, $$sroa$239$0$$sroa_idx40 = 0, $0 = 0, $1 = 0, $10 = 0;
  11460. var $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0.0, $16 = 0.0, $17 = 0, $18 = 0, $19 = 0.0, $2 = 0, $20 = 0, $21 = 0.0, $22 = 0, $23 = 0.0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0;
  11461. var $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0.0, $43 = 0, $44 = 0, $45 = 0.0, $46 = 0.0, $47 = 0;
  11462. var $48 = 0, $49 = 0, $5 = 0, $50 = 0.0, $51 = 0.0, $52 = 0, $53 = 0, $54 = 0, $55 = 0.0, $56 = 0, $57 = 0, $58 = 0.0, $59 = 0.0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0.0, $64 = 0.0, $65 = 0;
  11463. var $66 = 0, $67 = 0, $68 = 0.0, $69 = 0, $7 = 0, $70 = 0, $71 = 0.0, $72 = 0.0, $73 = 0, $74 = 0, $75 = 0, $76 = 0.0, $77 = 0.0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0;
  11464. var $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $exitcond = 0, $exitcond47 = 0, label = 0, sp = 0;
  11465. sp = STACKTOP;
  11466. STACKTOP = STACKTOP + 80|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(80|0);
  11467. $$byval_copy3 = sp + 72|0;
  11468. $$byval_copy2 = sp + 56|0;
  11469. $$byval_copy1 = sp + 48|0;
  11470. $0 = sp + 68|0;
  11471. $1 = sp + 24|0;
  11472. $2 = sp + 8|0;
  11473. $3 = sp + 64|0;
  11474. $4 = sp + 44|0;
  11475. $5 = sp + 40|0;
  11476. $6 = sp + 36|0;
  11477. $7 = sp + 32|0;
  11478. $8 = sp + 20|0;
  11479. $9 = sp + 16|0;
  11480. $10 = sp;
  11481. $11 = (_IsKeyPressed(82)|0);
  11482. $12 = ($11|0)==(0);
  11483. if (!($12)) {
  11484. $13 = HEAP32[7734]|0;
  11485. $14 = HEAP32[2]|0;
  11486. $15 = (+($14|0));
  11487. $16 = $15 * 0.25;
  11488. $17 = HEAP32[3]|0;
  11489. $18 = (($17|0) / 2)&-1;
  11490. $19 = (+($18|0));
  11491. $$sroa$038$0$$sroa_idx = ((($13)) + 8|0);
  11492. HEAPF32[$$sroa$038$0$$sroa_idx>>2] = $16;
  11493. $$sroa$239$0$$sroa_idx40 = ((($13)) + 12|0);
  11494. HEAPF32[$$sroa$239$0$$sroa_idx40>>2] = $19;
  11495. $$sroa$035$0$$sroa_idx = ((($13)) + 16|0);
  11496. HEAPF32[$$sroa$035$0$$sroa_idx>>2] = 0.0;
  11497. $$sroa$236$0$$sroa_idx37 = ((($13)) + 20|0);
  11498. HEAPF32[$$sroa$236$0$$sroa_idx37>>2] = 0.0;
  11499. $20 = HEAP32[7735]|0;
  11500. $21 = $15 * 0.5;
  11501. $$sroa$032$0$$sroa_idx = ((($20)) + 8|0);
  11502. HEAPF32[$$sroa$032$0$$sroa_idx>>2] = $21;
  11503. $$sroa$233$0$$sroa_idx34 = ((($20)) + 12|0);
  11504. HEAPF32[$$sroa$233$0$$sroa_idx34>>2] = $19;
  11505. $$sroa$029$0$$sroa_idx = ((($20)) + 16|0);
  11506. HEAPF32[$$sroa$029$0$$sroa_idx>>2] = 0.0;
  11507. $$sroa$230$0$$sroa_idx31 = ((($20)) + 20|0);
  11508. HEAPF32[$$sroa$230$0$$sroa_idx31>>2] = 0.0;
  11509. $22 = HEAP32[7736]|0;
  11510. $23 = $15 * 0.75;
  11511. $$sroa$026$0$$sroa_idx = ((($22)) + 8|0);
  11512. HEAPF32[$$sroa$026$0$$sroa_idx>>2] = $23;
  11513. $$sroa$227$0$$sroa_idx28 = ((($22)) + 12|0);
  11514. HEAPF32[$$sroa$227$0$$sroa_idx28>>2] = $19;
  11515. $$sroa$0$0$$sroa_idx = ((($22)) + 16|0);
  11516. HEAPF32[$$sroa$0$0$$sroa_idx>>2] = 0.0;
  11517. $$sroa$2$0$$sroa_idx25 = ((($22)) + 20|0);
  11518. HEAPF32[$$sroa$2$0$$sroa_idx25>>2] = 0.0;
  11519. }
  11520. _BeginDrawing();
  11521. HEAP8[$0>>0] = 0;
  11522. $24 = ((($0)) + 1|0);
  11523. HEAP8[$24>>0] = 0;
  11524. $25 = ((($0)) + 2|0);
  11525. HEAP8[$25>>0] = 0;
  11526. $26 = ((($0)) + 3|0);
  11527. HEAP8[$26>>0] = -1;
  11528. ;HEAP8[$$byval_copy3>>0]=HEAP8[$0>>0]|0;HEAP8[$$byval_copy3+1>>0]=HEAP8[$0+1>>0]|0;HEAP8[$$byval_copy3+2>>0]=HEAP8[$0+2>>0]|0;HEAP8[$$byval_copy3+3>>0]=HEAP8[$0+3>>0]|0;
  11529. _ClearBackground($$byval_copy3);
  11530. $27 = HEAP32[2]|0;
  11531. $28 = (($27) + -90)|0;
  11532. $29 = HEAP32[3]|0;
  11533. $30 = (($29) + -30)|0;
  11534. _DrawFPS($28,$30);
  11535. $31 = (_GetPhysicsBodiesCount()|0);
  11536. $32 = ($31|0)>(0);
  11537. if ($32) {
  11538. $33 = ((($3)) + 1|0);
  11539. $34 = ((($3)) + 2|0);
  11540. $35 = ((($3)) + 3|0);
  11541. $$043 = 0;
  11542. while(1) {
  11543. $85 = (_GetPhysicsBody($$043)|0);
  11544. $86 = (_GetPhysicsShapeVerticesCount($$043)|0);
  11545. $87 = ($86|0)>(0);
  11546. if ($87) {
  11547. $$04142 = 0;
  11548. while(1) {
  11549. _GetPhysicsShapeVertex($1,$85,$$04142);
  11550. $89 = (($$04142) + 1)|0;
  11551. $90 = ($89|0)<($86|0);
  11552. $91 = $90 ? $89 : 0;
  11553. _GetPhysicsShapeVertex($2,$85,$91);
  11554. HEAP8[$3>>0] = 0;
  11555. HEAP8[$33>>0] = -28;
  11556. HEAP8[$34>>0] = 48;
  11557. HEAP8[$35>>0] = -1;
  11558. ;HEAP32[$$byval_copy1>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy1+4>>2]=HEAP32[$1+4>>2]|0;
  11559. ;HEAP32[$$byval_copy2>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$2+4>>2]|0;
  11560. ;HEAP8[$$byval_copy3>>0]=HEAP8[$3>>0]|0;HEAP8[$$byval_copy3+1>>0]=HEAP8[$3+1>>0]|0;HEAP8[$$byval_copy3+2>>0]=HEAP8[$3+2>>0]|0;HEAP8[$$byval_copy3+3>>0]=HEAP8[$3+3>>0]|0;
  11561. _DrawLineV($$byval_copy1,$$byval_copy2,$$byval_copy3);
  11562. $exitcond = ($89|0)==($86|0);
  11563. if ($exitcond) {
  11564. break;
  11565. } else {
  11566. $$04142 = $89;
  11567. }
  11568. }
  11569. }
  11570. $88 = (($$043) + 1)|0;
  11571. $exitcond47 = ($88|0)==($31|0);
  11572. if ($exitcond47) {
  11573. break;
  11574. } else {
  11575. $$043 = $88;
  11576. }
  11577. }
  11578. }
  11579. $36 = HEAP32[2]|0;
  11580. $37 = (_MeasureText(3293,30)|0);
  11581. $38 = (($36) - ($37))|0;
  11582. $39 = (($38|0) / 2)&-1;
  11583. HEAP32[$4>>2] = -1;
  11584. ;HEAP8[$$byval_copy3>>0]=HEAP8[$4>>0]|0;HEAP8[$$byval_copy3+1>>0]=HEAP8[$4+1>>0]|0;HEAP8[$$byval_copy3+2>>0]=HEAP8[$4+2>>0]|0;HEAP8[$$byval_copy3+3>>0]=HEAP8[$4+3>>0]|0;
  11585. _DrawText(3293,$39,75,30,$$byval_copy3);
  11586. $40 = HEAP32[7734]|0;
  11587. $41 = ((($40)) + 8|0);
  11588. $42 = +HEAPF32[$41>>2];
  11589. $43 = (_MeasureText(3312,20)|0);
  11590. $44 = (($43|0) / 2)&-1;
  11591. $45 = (+($44|0));
  11592. $46 = $42 - $45;
  11593. $47 = (~~(($46)));
  11594. $48 = HEAP32[7734]|0;
  11595. $49 = ((($48)) + 12|0);
  11596. $50 = +HEAPF32[$49>>2];
  11597. $51 = $50 + -7.0;
  11598. $52 = (~~(($51)));
  11599. HEAP32[$5>>2] = -1;
  11600. ;HEAP8[$$byval_copy3>>0]=HEAP8[$5>>0]|0;HEAP8[$$byval_copy3+1>>0]=HEAP8[$5+1>>0]|0;HEAP8[$$byval_copy3+2>>0]=HEAP8[$5+2>>0]|0;HEAP8[$$byval_copy3+3>>0]=HEAP8[$5+3>>0]|0;
  11601. _DrawText(3312,$47,$52,20,$$byval_copy3);
  11602. $53 = HEAP32[7735]|0;
  11603. $54 = ((($53)) + 8|0);
  11604. $55 = +HEAPF32[$54>>2];
  11605. $56 = (_MeasureText(3314,20)|0);
  11606. $57 = (($56|0) / 2)&-1;
  11607. $58 = (+($57|0));
  11608. $59 = $55 - $58;
  11609. $60 = (~~(($59)));
  11610. $61 = HEAP32[7735]|0;
  11611. $62 = ((($61)) + 12|0);
  11612. $63 = +HEAPF32[$62>>2];
  11613. $64 = $63 + -7.0;
  11614. $65 = (~~(($64)));
  11615. HEAP32[$6>>2] = -1;
  11616. ;HEAP8[$$byval_copy3>>0]=HEAP8[$6>>0]|0;HEAP8[$$byval_copy3+1>>0]=HEAP8[$6+1>>0]|0;HEAP8[$$byval_copy3+2>>0]=HEAP8[$6+2>>0]|0;HEAP8[$$byval_copy3+3>>0]=HEAP8[$6+3>>0]|0;
  11617. _DrawText(3314,$60,$65,20,$$byval_copy3);
  11618. $66 = HEAP32[7736]|0;
  11619. $67 = ((($66)) + 8|0);
  11620. $68 = +HEAPF32[$67>>2];
  11621. $69 = (_MeasureText(3318,20)|0);
  11622. $70 = (($69|0) / 2)&-1;
  11623. $71 = (+($70|0));
  11624. $72 = $68 - $71;
  11625. $73 = (~~(($72)));
  11626. $74 = HEAP32[7736]|0;
  11627. $75 = ((($74)) + 12|0);
  11628. $76 = +HEAPF32[$75>>2];
  11629. $77 = $76 + -7.0;
  11630. $78 = (~~(($77)));
  11631. HEAP32[$7>>2] = -1;
  11632. ;HEAP8[$$byval_copy3>>0]=HEAP8[$7>>0]|0;HEAP8[$$byval_copy3+1>>0]=HEAP8[$7+1>>0]|0;HEAP8[$$byval_copy3+2>>0]=HEAP8[$7+2>>0]|0;HEAP8[$$byval_copy3+3>>0]=HEAP8[$7+3>>0]|0;
  11633. _DrawText(3318,$73,$78,20,$$byval_copy3);
  11634. HEAP32[$8>>2] = -1;
  11635. ;HEAP8[$$byval_copy3>>0]=HEAP8[$8>>0]|0;HEAP8[$$byval_copy3+1>>0]=HEAP8[$8+1>>0]|0;HEAP8[$$byval_copy3+2>>0]=HEAP8[$8+2>>0]|0;HEAP8[$$byval_copy3+3>>0]=HEAP8[$8+3>>0]|0;
  11636. _DrawText(3320,10,10,10,$$byval_copy3);
  11637. $79 = HEAP32[7733]|0;
  11638. $80 = HEAP32[4]|0;
  11639. HEAP32[$9>>2] = -1;
  11640. ;HEAP8[$$byval_copy3>>0]=HEAP8[$9>>0]|0;HEAP8[$$byval_copy3+1>>0]=HEAP8[$9+1>>0]|0;HEAP8[$$byval_copy3+2>>0]=HEAP8[$9+2>>0]|0;HEAP8[$$byval_copy3+3>>0]=HEAP8[$9+3>>0]|0;
  11641. _DrawText(3286,$79,$80,30,$$byval_copy3);
  11642. $81 = HEAP32[7733]|0;
  11643. $82 = (($81) + 50)|0;
  11644. $83 = HEAP32[4]|0;
  11645. $84 = (($83) + -7)|0;
  11646. HEAP32[$10>>2] = -1;
  11647. ;HEAP8[$$byval_copy3>>0]=HEAP8[$10>>0]|0;HEAP8[$$byval_copy3+1>>0]=HEAP8[$10+1>>0]|0;HEAP8[$$byval_copy3+2>>0]=HEAP8[$10+2>>0]|0;HEAP8[$$byval_copy3+3>>0]=HEAP8[$10+3>>0]|0;
  11648. _DrawText(3347,$82,$84,10,$$byval_copy3);
  11649. _EndDrawing();
  11650. STACKTOP = sp;return;
  11651. }
  11652. function _GetRandomNumber() {
  11653. var $0 = 0, $1 = 0, label = 0, sp = 0;
  11654. sp = STACKTOP;
  11655. $0 = (_rand()|0);
  11656. $1 = (($0|0) % 361)&-1;
  11657. return ($1|0);
  11658. }
  11659. function _InitTimer() {
  11660. var $0 = 0, $1 = 0.0, label = 0, sp = 0;
  11661. sp = STACKTOP;
  11662. $0 = (_time((0|0))|0);
  11663. _srand($0);
  11664. $1 = (+_GetCurrentTime());
  11665. HEAPF64[1748] = $1;
  11666. return;
  11667. }
  11668. function _GetCurrentTime() {
  11669. var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0.0, $13 = 0.0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  11670. sp = STACKTOP;
  11671. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  11672. $0 = sp;
  11673. (_clock_gettime(1,($0|0))|0);
  11674. $1 = HEAP32[$0>>2]|0;
  11675. $2 = ($1|0)<(0);
  11676. $3 = $2 << 31 >> 31;
  11677. $4 = (___muldi3(($1|0),($3|0),1000000000,0)|0);
  11678. $5 = tempRet0;
  11679. $6 = ((($0)) + 4|0);
  11680. $7 = HEAP32[$6>>2]|0;
  11681. $8 = ($7|0)<(0);
  11682. $9 = $8 << 31 >> 31;
  11683. $10 = (_i64Add(($4|0),($5|0),($7|0),($9|0))|0);
  11684. $11 = tempRet0;
  11685. $12 = (+($10>>>0)) + (4294967296.0*(+($11>>>0)));
  11686. $13 = $12 * 9.9999999999999995E-7;
  11687. STACKTOP = sp;return (+$13);
  11688. }
  11689. function _MathClamp() {
  11690. var $$sink = 0.0, $0 = 0.0, $1 = 0, $2 = 0, label = 0, sp = 0;
  11691. sp = STACKTOP;
  11692. $0 = +HEAPF64[1746];
  11693. $1 = $0 < 0.0;
  11694. if ($1) {
  11695. $$sink = 0.0;
  11696. } else {
  11697. $2 = $0 > 0.02;
  11698. if ($2) {
  11699. $$sink = 0.02;
  11700. } else {
  11701. return;
  11702. }
  11703. }
  11704. HEAPF64[1746] = $$sink;
  11705. return;
  11706. }
  11707. function _PhysicsStep() {
  11708. var $$0 = 0, $$0125165 = 0, $$0126163 = 0, $$0127147 = 0, $$0129148 = 0, $$0130 = 0, $$0130160 = 0, $$0130161 = 0, $$0131150 = 0, $$0132 = 0, $$0133152 = 0, $$0134155 = 0, $$0134155$ph = 0, $$0135158 = 0, $$0136156 = 0, $$0167 = 0, $$0168 = 0, $$pr = 0, $$pr172 = 0, $$sroa$0$0$$sroa_idx = 0;
  11709. var $$sroa$2$0$$sroa_idx1 = 0, $0 = 0, $1 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0;
  11710. var $115 = 0, $116 = 0, $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0;
  11711. var $133 = 0, $134 = 0, $135 = 0, $136 = 0, $137 = 0, $138 = 0, $139 = 0, $14 = 0, $140 = 0, $141 = 0, $142 = 0, $143 = 0, $144 = 0, $145 = 0, $146 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0;
  11712. var $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0.0, $32 = 0, $33 = 0, $34 = 0.0, $35 = 0, $36 = 0, $37 = 0;
  11713. var $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0;
  11714. var $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0;
  11715. var $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0;
  11716. var $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $exitcond = 0, label = 0, sp = 0;
  11717. sp = STACKTOP;
  11718. $0 = HEAP32[7737]|0;
  11719. $1 = (($0) + 1)|0;
  11720. HEAP32[7737] = $1;
  11721. $2 = HEAP32[3636]|0;
  11722. $$0167 = (($2) + -1)|0;
  11723. $3 = ($$0167|0)>(-1);
  11724. if ($3) {
  11725. $$0168 = $$0167;
  11726. while(1) {
  11727. $6 = (14548 + ($$0168<<2)|0);
  11728. $7 = HEAP32[$6>>2]|0;
  11729. $8 = ($7|0)==(0|0);
  11730. if (!($8)) {
  11731. _DestroyPhysicsManifold($7);
  11732. }
  11733. $$0 = (($$0168) + -1)|0;
  11734. $9 = ($$0|0)>(-1);
  11735. if ($9) {
  11736. $$0168 = $$0;
  11737. } else {
  11738. break;
  11739. }
  11740. }
  11741. }
  11742. $4 = HEAP32[3571]|0;
  11743. $5 = ($4|0)==(0);
  11744. if ($5) {
  11745. $17 = $4;
  11746. label = 8;
  11747. } else {
  11748. $$0125165 = 0;
  11749. while(1) {
  11750. $11 = (14288 + ($$0125165<<2)|0);
  11751. $12 = HEAP32[$11>>2]|0;
  11752. $13 = ((($12)) + 76|0);
  11753. HEAP32[$13>>2] = 0;
  11754. $14 = (($$0125165) + 1)|0;
  11755. $15 = ($14>>>0)<($4>>>0);
  11756. if ($15) {
  11757. $$0125165 = $14;
  11758. } else {
  11759. break;
  11760. }
  11761. }
  11762. $$pr = HEAP32[3571]|0;
  11763. $10 = ($$pr|0)==(0);
  11764. if (!($10)) {
  11765. $$0126163 = 0;
  11766. while(1) {
  11767. $19 = (14288 + ($$0126163<<2)|0);
  11768. $20 = HEAP32[$19>>2]|0;
  11769. $21 = ($20|0)==(0|0);
  11770. if (!($21)) {
  11771. $$0130160 = (($$0126163) + 1)|0;
  11772. $22 = HEAP32[3571]|0;
  11773. $23 = ($$0130160>>>0)<($22>>>0);
  11774. if ($23) {
  11775. $24 = ((($20)) + 56|0);
  11776. $25 = ((($20)) + 84|0);
  11777. $$0130161 = $$0130160;
  11778. while(1) {
  11779. $26 = (14288 + ($$0130161<<2)|0);
  11780. $27 = HEAP32[$26>>2]|0;
  11781. $28 = ($27|0)==(0|0);
  11782. do {
  11783. if (!($28)) {
  11784. $31 = +HEAPF32[$24>>2];
  11785. $32 = $31 == 0.0;
  11786. if ($32) {
  11787. $33 = ((($27)) + 56|0);
  11788. $34 = +HEAPF32[$33>>2];
  11789. $35 = $34 == 0.0;
  11790. if ($35) {
  11791. break;
  11792. }
  11793. }
  11794. $36 = HEAP32[$25>>2]|0;
  11795. $37 = ($36|0)==(1);
  11796. if ($37) {
  11797. $38 = ((($27)) + 84|0);
  11798. $39 = HEAP32[$38>>2]|0;
  11799. $40 = ($39|0)==(0);
  11800. if ($40) {
  11801. $41 = (_CreatePhysicsManifold($27,$20)|0);
  11802. $$0132 = $41;
  11803. } else {
  11804. label = 20;
  11805. }
  11806. } else {
  11807. label = 20;
  11808. }
  11809. if ((label|0) == 20) {
  11810. label = 0;
  11811. $42 = (_CreatePhysicsManifold($20,$27)|0);
  11812. $$0132 = $42;
  11813. }
  11814. _SolvePhysicsManifold($$0132);
  11815. $43 = ((($$0132)) + 40|0);
  11816. $44 = HEAP32[$43>>2]|0;
  11817. $45 = ($44|0)==(0);
  11818. if (!($45)) {
  11819. $46 = (_CreatePhysicsManifold($20,$27)|0);
  11820. $47 = ((($$0132)) + 12|0);
  11821. $48 = HEAP32[$47>>2]|0;
  11822. $49 = ((($46)) + 12|0);
  11823. HEAP32[$49>>2] = $48;
  11824. $50 = ((($46)) + 16|0);
  11825. $51 = ((($$0132)) + 16|0);
  11826. $52 = $51;
  11827. $53 = $52;
  11828. $54 = HEAP32[$53>>2]|0;
  11829. $55 = (($52) + 4)|0;
  11830. $56 = $55;
  11831. $57 = HEAP32[$56>>2]|0;
  11832. $58 = $50;
  11833. $59 = $58;
  11834. HEAP32[$59>>2] = $54;
  11835. $60 = (($58) + 4)|0;
  11836. $61 = $60;
  11837. HEAP32[$61>>2] = $57;
  11838. $62 = ((($46)) + 24|0);
  11839. $63 = ((($$0132)) + 24|0);
  11840. $64 = $63;
  11841. $65 = $64;
  11842. $66 = HEAP32[$65>>2]|0;
  11843. $67 = (($64) + 4)|0;
  11844. $68 = $67;
  11845. $69 = HEAP32[$68>>2]|0;
  11846. $70 = $62;
  11847. $71 = $70;
  11848. HEAP32[$71>>2] = $66;
  11849. $72 = (($70) + 4)|0;
  11850. $73 = $72;
  11851. HEAP32[$73>>2] = $69;
  11852. $74 = ((($46)) + 32|0);
  11853. $75 = ((($$0132)) + 32|0);
  11854. $76 = $75;
  11855. $77 = $76;
  11856. $78 = HEAP32[$77>>2]|0;
  11857. $79 = (($76) + 4)|0;
  11858. $80 = $79;
  11859. $81 = HEAP32[$80>>2]|0;
  11860. $82 = $74;
  11861. $83 = $82;
  11862. HEAP32[$83>>2] = $78;
  11863. $84 = (($82) + 4)|0;
  11864. $85 = $84;
  11865. HEAP32[$85>>2] = $81;
  11866. $86 = HEAP32[$43>>2]|0;
  11867. $87 = ((($46)) + 40|0);
  11868. HEAP32[$87>>2] = $86;
  11869. $88 = ((($$0132)) + 44|0);
  11870. $89 = HEAP32[$88>>2]|0;
  11871. $90 = ((($46)) + 44|0);
  11872. HEAP32[$90>>2] = $89;
  11873. $91 = ((($$0132)) + 48|0);
  11874. $92 = HEAP32[$91>>2]|0;
  11875. $93 = ((($46)) + 48|0);
  11876. HEAP32[$93>>2] = $92;
  11877. $94 = ((($$0132)) + 52|0);
  11878. $95 = HEAP32[$94>>2]|0;
  11879. $96 = ((($46)) + 52|0);
  11880. HEAP32[$96>>2] = $95;
  11881. }
  11882. }
  11883. } while(0);
  11884. $$0130 = (($$0130161) + 1)|0;
  11885. $29 = HEAP32[3571]|0;
  11886. $30 = ($$0130>>>0)<($29>>>0);
  11887. if ($30) {
  11888. $$0130161 = $$0130;
  11889. } else {
  11890. break;
  11891. }
  11892. }
  11893. }
  11894. }
  11895. $97 = (($$0126163) + 1)|0;
  11896. $98 = HEAP32[3571]|0;
  11897. $99 = ($97>>>0)<($98>>>0);
  11898. if ($99) {
  11899. $$0126163 = $97;
  11900. } else {
  11901. $17 = $98;
  11902. label = 8;
  11903. break;
  11904. }
  11905. }
  11906. }
  11907. }
  11908. if ((label|0) == 8) {
  11909. $16 = ($17|0)==(0);
  11910. if (!($16)) {
  11911. $18 = HEAP32[3571]|0;
  11912. $$0135158 = 0;
  11913. while(1) {
  11914. $103 = (14288 + ($$0135158<<2)|0);
  11915. $104 = HEAP32[$103>>2]|0;
  11916. $105 = ($104|0)==(0|0);
  11917. if (!($105)) {
  11918. _IntegratePhysicsForces($104);
  11919. }
  11920. $106 = (($$0135158) + 1)|0;
  11921. $107 = ($106>>>0)<($18>>>0);
  11922. if ($107) {
  11923. $$0135158 = $106;
  11924. } else {
  11925. break;
  11926. }
  11927. }
  11928. }
  11929. }
  11930. $100 = HEAP32[3636]|0;
  11931. $101 = ($100|0)==(0);
  11932. if ($101) {
  11933. $$0134155 = 0;$114 = 0;
  11934. } else {
  11935. $102 = HEAP32[3636]|0;
  11936. $$0136156 = 0;
  11937. while(1) {
  11938. $108 = (14548 + ($$0136156<<2)|0);
  11939. $109 = HEAP32[$108>>2]|0;
  11940. $110 = ($109|0)==(0|0);
  11941. if (!($110)) {
  11942. _InitializePhysicsManifolds($109);
  11943. }
  11944. $111 = (($$0136156) + 1)|0;
  11945. $112 = ($111>>>0)<($102>>>0);
  11946. if ($112) {
  11947. $$0136156 = $111;
  11948. } else {
  11949. $$0134155$ph = 0;
  11950. label = 32;
  11951. break;
  11952. }
  11953. }
  11954. }
  11955. while(1) {
  11956. if ((label|0) == 32) {
  11957. label = 0;
  11958. $$pr172 = HEAP32[3636]|0;
  11959. $$0134155 = $$0134155$ph;$114 = $$pr172;
  11960. }
  11961. $113 = ($114|0)==(0);
  11962. if (!($113)) {
  11963. $115 = (14548 + ($$0134155<<2)|0);
  11964. $$0133152 = 0;
  11965. while(1) {
  11966. $120 = HEAP32[$115>>2]|0;
  11967. $121 = ($120|0)==(0|0);
  11968. if (!($121)) {
  11969. _IntegratePhysicsImpulses($120);
  11970. }
  11971. $122 = (($$0133152) + 1)|0;
  11972. $123 = HEAP32[3636]|0;
  11973. $124 = ($122>>>0)<($123>>>0);
  11974. if ($124) {
  11975. $$0133152 = $122;
  11976. } else {
  11977. break;
  11978. }
  11979. }
  11980. }
  11981. $119 = (($$0134155) + 1)|0;
  11982. $exitcond = ($119|0)==(100);
  11983. if ($exitcond) {
  11984. break;
  11985. } else {
  11986. $$0134155$ph = $119;
  11987. label = 32;
  11988. }
  11989. }
  11990. $116 = HEAP32[3571]|0;
  11991. $117 = ($116|0)==(0);
  11992. if (!($117)) {
  11993. $118 = HEAP32[3571]|0;
  11994. $$0131150 = 0;
  11995. while(1) {
  11996. $128 = (14288 + ($$0131150<<2)|0);
  11997. $129 = HEAP32[$128>>2]|0;
  11998. $130 = ($129|0)==(0|0);
  11999. if (!($130)) {
  12000. _IntegratePhysicsVelocity($129);
  12001. }
  12002. $131 = (($$0131150) + 1)|0;
  12003. $132 = ($131>>>0)<($118>>>0);
  12004. if ($132) {
  12005. $$0131150 = $131;
  12006. } else {
  12007. break;
  12008. }
  12009. }
  12010. }
  12011. $125 = HEAP32[3636]|0;
  12012. $126 = ($125|0)==(0);
  12013. if (!($126)) {
  12014. $127 = HEAP32[3636]|0;
  12015. $$0129148 = 0;
  12016. while(1) {
  12017. $136 = (14548 + ($$0129148<<2)|0);
  12018. $137 = HEAP32[$136>>2]|0;
  12019. $138 = ($137|0)==(0|0);
  12020. if (!($138)) {
  12021. _CorrectPhysicsPositions($137);
  12022. }
  12023. $139 = (($$0129148) + 1)|0;
  12024. $140 = ($139>>>0)<($127>>>0);
  12025. if ($140) {
  12026. $$0129148 = $139;
  12027. } else {
  12028. break;
  12029. }
  12030. }
  12031. }
  12032. $133 = HEAP32[3571]|0;
  12033. $134 = ($133|0)==(0);
  12034. if ($134) {
  12035. return;
  12036. }
  12037. $135 = HEAP32[3571]|0;
  12038. $$0127147 = 0;
  12039. while(1) {
  12040. $141 = (14288 + ($$0127147<<2)|0);
  12041. $142 = HEAP32[$141>>2]|0;
  12042. $143 = ($142|0)==(0|0);
  12043. if (!($143)) {
  12044. $$sroa$0$0$$sroa_idx = ((($142)) + 24|0);
  12045. HEAPF32[$$sroa$0$0$$sroa_idx>>2] = 0.0;
  12046. $$sroa$2$0$$sroa_idx1 = ((($142)) + 28|0);
  12047. HEAPF32[$$sroa$2$0$$sroa_idx1>>2] = 0.0;
  12048. $144 = ((($142)) + 36|0);
  12049. HEAPF32[$144>>2] = 0.0;
  12050. }
  12051. $145 = (($$0127147) + 1)|0;
  12052. $146 = ($145>>>0)<($135>>>0);
  12053. if ($146) {
  12054. $$0127147 = $145;
  12055. } else {
  12056. break;
  12057. }
  12058. }
  12059. return;
  12060. }
  12061. function _DestroyPhysicsManifold($0) {
  12062. $0 = $0|0;
  12063. var $$02023 = 0, $$021 = 0, $$022 = 0, $$lcssa = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0;
  12064. var $24 = 0, $25 = 0, $26 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  12065. sp = STACKTOP;
  12066. $1 = ($0|0)==(0|0);
  12067. if ($1) {
  12068. return;
  12069. }
  12070. $2 = HEAP32[$0>>2]|0;
  12071. $3 = HEAP32[3636]|0;
  12072. $4 = ($3|0)==(0);
  12073. L4: do {
  12074. if ($4) {
  12075. $$021 = -1;
  12076. } else {
  12077. $5 = HEAP32[3636]|0;
  12078. $$02023 = 0;
  12079. while(1) {
  12080. $6 = (14548 + ($$02023<<2)|0);
  12081. $7 = HEAP32[$6>>2]|0;
  12082. $8 = HEAP32[$7>>2]|0;
  12083. $9 = ($8|0)==($2|0);
  12084. if ($9) {
  12085. $$021 = $$02023;
  12086. break L4;
  12087. }
  12088. $10 = (($$02023) + 1)|0;
  12089. $11 = ($10>>>0)<($5>>>0);
  12090. if ($11) {
  12091. $$02023 = $10;
  12092. } else {
  12093. $$021 = -1;
  12094. break;
  12095. }
  12096. }
  12097. }
  12098. } while(0);
  12099. $12 = (14548 + ($$021<<2)|0);
  12100. $13 = HEAP32[$12>>2]|0;
  12101. _free($13);
  12102. $14 = HEAP32[3570]|0;
  12103. $15 = (($14) + -56)|0;
  12104. HEAP32[3570] = $15;
  12105. HEAP32[$12>>2] = 0;
  12106. $16 = HEAP32[3636]|0;
  12107. $17 = ($$021>>>0)<($16>>>0);
  12108. if ($17) {
  12109. $18 = HEAP32[3636]|0;
  12110. $$022 = $$021;$22 = $16;
  12111. while(1) {
  12112. $20 = (($$022) + 1)|0;
  12113. $21 = ($20>>>0)<($22>>>0);
  12114. if ($21) {
  12115. $24 = (14548 + ($$022<<2)|0);
  12116. $25 = (14548 + ($20<<2)|0);
  12117. $26 = HEAP32[$25>>2]|0;
  12118. HEAP32[$24>>2] = $26;
  12119. }
  12120. $23 = ($20>>>0)<($18>>>0);
  12121. if ($23) {
  12122. $$022 = $20;$22 = $18;
  12123. } else {
  12124. $$lcssa = $18;
  12125. break;
  12126. }
  12127. }
  12128. } else {
  12129. $$lcssa = $16;
  12130. }
  12131. $19 = (($$lcssa) + -1)|0;
  12132. HEAP32[3636] = $19;
  12133. return;
  12134. }
  12135. function _CreatePhysicsManifold($0,$1) {
  12136. $0 = $0|0;
  12137. $1 = $1|0;
  12138. var $$04457 = 0, $$044576162 = 0, $$04755 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0;
  12139. var $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, stop = 0;
  12140. sp = STACKTOP;
  12141. $2 = (_malloc(56)|0);
  12142. $3 = HEAP32[3570]|0;
  12143. $4 = (($3) + 56)|0;
  12144. HEAP32[3570] = $4;
  12145. $5 = HEAP32[3636]|0;
  12146. $6 = ($5|0)==(0);
  12147. $$04457 = 0;
  12148. L1: while(1) {
  12149. if ($6) {
  12150. $$044576162 = 0;
  12151. break;
  12152. } else {
  12153. $$04755 = 0;
  12154. }
  12155. while(1) {
  12156. $9 = (14548 + ($$04755<<2)|0);
  12157. $10 = HEAP32[$9>>2]|0;
  12158. $11 = HEAP32[$10>>2]|0;
  12159. $12 = ($11|0)==($$04457|0);
  12160. $8 = (($$04755) + 1)|0;
  12161. if ($12) {
  12162. break;
  12163. }
  12164. $7 = ($8>>>0)<($5>>>0);
  12165. if ($7) {
  12166. $$04755 = $8;
  12167. } else {
  12168. label = 6;
  12169. break L1;
  12170. }
  12171. }
  12172. $13 = (($$04457) + 1)|0;
  12173. $14 = ($13|0)<(4096);
  12174. if ($14) {
  12175. $$04457 = $13;
  12176. } else {
  12177. label = 8;
  12178. break;
  12179. }
  12180. }
  12181. if ((label|0) == 8) {
  12182. return ($2|0);
  12183. }
  12184. if ((label|0) == 6) {
  12185. $15 = ($$04457|0)==(-1);
  12186. if ($15) {
  12187. return ($2|0);
  12188. } else {
  12189. $$044576162 = $$04457;
  12190. }
  12191. }
  12192. HEAP32[$2>>2] = $$044576162;
  12193. $16 = ((($2)) + 4|0);
  12194. HEAP32[$16>>2] = $0;
  12195. $17 = ((($2)) + 8|0);
  12196. HEAP32[$17>>2] = $1;
  12197. $18 = ((($2)) + 12|0);
  12198. dest=$18; stop=dest+44|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  12199. $19 = HEAP32[3636]|0;
  12200. $20 = (14548 + ($19<<2)|0);
  12201. HEAP32[$20>>2] = $2;
  12202. $21 = (($19) + 1)|0;
  12203. HEAP32[3636] = $21;
  12204. return ($2|0);
  12205. }
  12206. function _SolvePhysicsManifold($0) {
  12207. $0 = $0|0;
  12208. var $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0.0, $2 = 0, $20 = 0, $21 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0;
  12209. var $9 = 0, label = 0, sp = 0;
  12210. sp = STACKTOP;
  12211. $1 = ((($0)) + 4|0);
  12212. $2 = HEAP32[$1>>2]|0;
  12213. $3 = ((($2)) + 84|0);
  12214. $4 = HEAP32[$3>>2]|0;
  12215. L1: do {
  12216. switch ($4|0) {
  12217. case 0: {
  12218. $5 = ((($0)) + 8|0);
  12219. $6 = HEAP32[$5>>2]|0;
  12220. $7 = ((($6)) + 84|0);
  12221. $8 = HEAP32[$7>>2]|0;
  12222. switch ($8|0) {
  12223. case 0: {
  12224. _SolveCircleToCircle($0);
  12225. break L1;
  12226. break;
  12227. }
  12228. case 1: {
  12229. _SolveCircleToPolygon($0);
  12230. break L1;
  12231. break;
  12232. }
  12233. default: {
  12234. break L1;
  12235. }
  12236. }
  12237. break;
  12238. }
  12239. case 1: {
  12240. $9 = ((($0)) + 8|0);
  12241. $10 = HEAP32[$9>>2]|0;
  12242. $11 = ((($10)) + 84|0);
  12243. $12 = HEAP32[$11>>2]|0;
  12244. switch ($12|0) {
  12245. case 0: {
  12246. _SolvePolygonToCircle($0);
  12247. break L1;
  12248. break;
  12249. }
  12250. case 1: {
  12251. _SolvePolygonToPolygon($0);
  12252. break L1;
  12253. break;
  12254. }
  12255. default: {
  12256. break L1;
  12257. }
  12258. }
  12259. break;
  12260. }
  12261. default: {
  12262. }
  12263. }
  12264. } while(0);
  12265. $13 = ((($0)) + 8|0);
  12266. $14 = HEAP32[$13>>2]|0;
  12267. $15 = ((($14)) + 76|0);
  12268. $16 = HEAP32[$15>>2]|0;
  12269. $17 = ($16|0)==(0);
  12270. if (!($17)) {
  12271. return;
  12272. }
  12273. $18 = ((($0)) + 20|0);
  12274. $19 = +HEAPF32[$18>>2];
  12275. $20 = $19 < 0.0;
  12276. $21 = $20&1;
  12277. HEAP32[$15>>2] = $21;
  12278. return;
  12279. }
  12280. function _IntegratePhysicsForces($0) {
  12281. $0 = $0|0;
  12282. var $1 = 0, $10 = 0.0, $11 = 0.0, $12 = 0.0, $13 = 0.0, $14 = 0, $15 = 0.0, $16 = 0.0, $17 = 0.0, $18 = 0.0, $19 = 0, $2 = 0.0, $20 = 0.0, $21 = 0.0, $22 = 0.0, $23 = 0.0, $24 = 0, $25 = 0.0, $26 = 0.0, $27 = 0.0;
  12283. var $28 = 0.0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0.0, $33 = 0.0, $34 = 0.0, $35 = 0.0, $36 = 0.0, $37 = 0.0, $38 = 0.0, $39 = 0.0, $4 = 0, $40 = 0.0, $41 = 0.0, $42 = 0.0, $43 = 0.0, $44 = 0.0, $45 = 0.0;
  12284. var $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0.0, $51 = 0, $52 = 0.0, $53 = 0.0, $54 = 0.0, $55 = 0.0, $56 = 0, $57 = 0.0, $58 = 0.0, $59 = 0.0, $6 = 0, $60 = 0.0, $7 = 0, $8 = 0.0, $9 = 0.0;
  12285. var label = 0, sp = 0;
  12286. sp = STACKTOP;
  12287. $1 = ((($0)) + 56|0);
  12288. $2 = +HEAPF32[$1>>2];
  12289. $3 = $2 == 0.0;
  12290. if ($3) {
  12291. return;
  12292. }
  12293. $4 = ((($0)) + 4|0);
  12294. $5 = HEAP32[$4>>2]|0;
  12295. $6 = ($5|0)==(0);
  12296. if ($6) {
  12297. return;
  12298. }
  12299. $7 = ((($0)) + 24|0);
  12300. $8 = +HEAPF32[$7>>2];
  12301. $9 = $2 * $8;
  12302. $10 = $9;
  12303. $11 = +HEAPF64[1749];
  12304. $12 = $11 * 0.5;
  12305. $13 = $10 * $12;
  12306. $14 = ((($0)) + 16|0);
  12307. $15 = +HEAPF32[$14>>2];
  12308. $16 = $15;
  12309. $17 = $16 + $13;
  12310. $18 = $17;
  12311. HEAPF32[$14>>2] = $18;
  12312. $19 = ((($0)) + 28|0);
  12313. $20 = +HEAPF32[$19>>2];
  12314. $21 = $2 * $20;
  12315. $22 = $21;
  12316. $23 = $12 * $22;
  12317. $24 = ((($0)) + 20|0);
  12318. $25 = +HEAPF32[$24>>2];
  12319. $26 = $25;
  12320. $27 = $26 + $23;
  12321. $28 = $27;
  12322. HEAPF32[$24>>2] = $28;
  12323. $29 = ((($0)) + 72|0);
  12324. $30 = HEAP32[$29>>2]|0;
  12325. $31 = ($30|0)==(0);
  12326. if (!($31)) {
  12327. $32 = +HEAPF32[7738];
  12328. $33 = $32;
  12329. $34 = $12 * $33;
  12330. $35 = +HEAPF32[$14>>2];
  12331. $36 = $35;
  12332. $37 = $36 + $34;
  12333. $38 = $37;
  12334. HEAPF32[$14>>2] = $38;
  12335. $39 = +HEAPF32[5];
  12336. $40 = $39;
  12337. $41 = $12 * $40;
  12338. $42 = +HEAPF32[$24>>2];
  12339. $43 = $42;
  12340. $44 = $43 + $41;
  12341. $45 = $44;
  12342. HEAPF32[$24>>2] = $45;
  12343. }
  12344. $46 = ((($0)) + 80|0);
  12345. $47 = HEAP32[$46>>2]|0;
  12346. $48 = ($47|0)==(0);
  12347. if (!($48)) {
  12348. return;
  12349. }
  12350. $49 = ((($0)) + 36|0);
  12351. $50 = +HEAPF32[$49>>2];
  12352. $51 = ((($0)) + 48|0);
  12353. $52 = +HEAPF32[$51>>2];
  12354. $53 = $50 * $52;
  12355. $54 = $53;
  12356. $55 = $12 * $54;
  12357. $56 = ((($0)) + 32|0);
  12358. $57 = +HEAPF32[$56>>2];
  12359. $58 = $57;
  12360. $59 = $58 + $55;
  12361. $60 = $59;
  12362. HEAPF32[$56>>2] = $60;
  12363. return;
  12364. }
  12365. function _InitializePhysicsManifolds($0) {
  12366. $0 = $0|0;
  12367. var $$byval_copy14 = 0, $$byval_copy9 = 0, $1 = 0, $10 = 0, $11 = 0.0, $12 = 0, $13 = 0.0, $14 = 0.0, $15 = 0.0, $16 = 0, $17 = 0, $18 = 0.0, $19 = 0, $2 = 0, $20 = 0.0, $21 = 0.0, $22 = 0.0, $23 = 0, $24 = 0, $25 = 0.0;
  12368. var $26 = 0, $27 = 0.0, $28 = 0.0, $29 = 0.0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0.0, $43 = 0.0;
  12369. var $44 = 0.0, $45 = 0.0, $46 = 0.0, $47 = 0, $48 = 0.0, $49 = 0.0, $5 = 0, $50 = 0.0, $51 = 0.0, $52 = 0, $53 = 0.0, $54 = 0.0, $55 = 0.0, $56 = 0.0, $57 = 0.0, $58 = 0.0, $59 = 0.0, $6 = 0, $60 = 0.0, $61 = 0.0;
  12370. var $62 = 0.0, $63 = 0.0, $64 = 0.0, $65 = 0.0, $66 = 0.0, $67 = 0.0, $68 = 0.0, $69 = 0.0, $7 = 0, $70 = 0.0, $71 = 0.0, $72 = 0, $73 = 0, $74 = 0.0, $75 = 0.0, $76 = 0.0, $77 = 0.0, $78 = 0.0, $79 = 0.0, $8 = 0;
  12371. var $80 = 0.0, $81 = 0.0, $82 = 0.0, $83 = 0.0, $84 = 0.0, $85 = 0.0, $86 = 0.0, $87 = 0.0, $88 = 0.0, $89 = 0.0, $9 = 0, $90 = 0.0, $91 = 0.0, $92 = 0.0, $93 = 0, label = 0, sp = 0;
  12372. sp = STACKTOP;
  12373. STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
  12374. $$byval_copy14 = sp + 48|0;
  12375. $$byval_copy9 = sp + 40|0;
  12376. $1 = sp + 24|0;
  12377. $2 = sp + 16|0;
  12378. $3 = sp + 8|0;
  12379. $4 = sp;
  12380. $5 = sp + 32|0;
  12381. $6 = ((($0)) + 4|0);
  12382. $7 = HEAP32[$6>>2]|0;
  12383. $8 = ((($0)) + 8|0);
  12384. $9 = HEAP32[$8>>2]|0;
  12385. $10 = ((($7)) + 68|0);
  12386. $11 = +HEAPF32[$10>>2];
  12387. $12 = ((($9)) + 68|0);
  12388. $13 = +HEAPF32[$12>>2];
  12389. $14 = $11 * $13;
  12390. $15 = (+Math_sqrt((+$14)));
  12391. $16 = ((($0)) + 44|0);
  12392. HEAPF32[$16>>2] = $15;
  12393. $17 = ((($7)) + 60|0);
  12394. $18 = +HEAPF32[$17>>2];
  12395. $19 = ((($9)) + 60|0);
  12396. $20 = +HEAPF32[$19>>2];
  12397. $21 = $18 * $20;
  12398. $22 = (+Math_sqrt((+$21)));
  12399. $23 = ((($0)) + 52|0);
  12400. HEAPF32[$23>>2] = $22;
  12401. $24 = ((($7)) + 64|0);
  12402. $25 = +HEAPF32[$24>>2];
  12403. $26 = ((($9)) + 64|0);
  12404. $27 = +HEAPF32[$26>>2];
  12405. $28 = $25 * $27;
  12406. $29 = (+Math_sqrt((+$28)));
  12407. $30 = ((($0)) + 48|0);
  12408. HEAPF32[$30>>2] = $29;
  12409. $31 = ((($7)) + 8|0);
  12410. $32 = ((($9)) + 8|0);
  12411. $33 = ((($7)) + 32|0);
  12412. $34 = ((($9)) + 32|0);
  12413. $35 = ((($9)) + 16|0);
  12414. $36 = ((($7)) + 16|0);
  12415. $37 = ((($9)) + 20|0);
  12416. $38 = ((($3)) + 4|0);
  12417. $39 = ((($7)) + 20|0);
  12418. $40 = ((($$byval_copy9)) + 4|0);
  12419. $41 = ((($4)) + 4|0);
  12420. $42 = +HEAPF32[7738];
  12421. $43 = $42;
  12422. $44 = +HEAPF64[1749];
  12423. $45 = $43 * $44;
  12424. $46 = $45;
  12425. $47 = ((($5)) + 4|0);
  12426. $48 = +HEAPF32[5];
  12427. $49 = $48;
  12428. $50 = $49 * $44;
  12429. $51 = $50;
  12430. $52 = ((($0)) + 24|0);
  12431. ;HEAP32[$$byval_copy9>>2]=HEAP32[$52>>2]|0;HEAP32[$$byval_copy9+4>>2]=HEAP32[$52+4>>2]|0;
  12432. ;HEAP32[$$byval_copy14>>2]=HEAP32[$31>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$31+4>>2]|0;
  12433. _Vector2Subtract_4($1,$$byval_copy9,$$byval_copy14);
  12434. ;HEAP32[$$byval_copy9>>2]=HEAP32[$52>>2]|0;HEAP32[$$byval_copy9+4>>2]=HEAP32[$52+4>>2]|0;
  12435. ;HEAP32[$$byval_copy14>>2]=HEAP32[$32>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$32+4>>2]|0;
  12436. _Vector2Subtract_4($2,$$byval_copy9,$$byval_copy14);
  12437. $53 = +HEAPF32[$33>>2];
  12438. ;HEAP32[$$byval_copy14>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$1+4>>2]|0;
  12439. _MathCross($$byval_copy9,$53,$$byval_copy14);
  12440. $54 = +HEAPF32[$34>>2];
  12441. ;HEAP32[$$byval_copy14>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$2+4>>2]|0;
  12442. _MathCross($3,$54,$$byval_copy14);
  12443. $55 = +HEAPF32[$35>>2];
  12444. $56 = +HEAPF32[$3>>2];
  12445. $57 = $55 + $56;
  12446. $58 = +HEAPF32[$36>>2];
  12447. $59 = $57 - $58;
  12448. $60 = +HEAPF32[$$byval_copy9>>2];
  12449. $61 = $59 - $60;
  12450. HEAPF32[$4>>2] = $61;
  12451. $62 = +HEAPF32[$37>>2];
  12452. $63 = +HEAPF32[$38>>2];
  12453. $64 = $62 + $63;
  12454. $65 = +HEAPF32[$39>>2];
  12455. $66 = $64 - $65;
  12456. $67 = +HEAPF32[$40>>2];
  12457. $68 = $66 - $67;
  12458. HEAPF32[$41>>2] = $68;
  12459. ;HEAP32[$$byval_copy14>>2]=HEAP32[$4>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$4+4>>2]|0;
  12460. $69 = (+_MathLenSqr($$byval_copy14));
  12461. HEAPF32[$5>>2] = $46;
  12462. HEAPF32[$47>>2] = $51;
  12463. ;HEAP32[$$byval_copy14>>2]=HEAP32[$5>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$5+4>>2]|0;
  12464. $70 = (+_MathLenSqr($$byval_copy14));
  12465. $71 = $70 + 9.9999999747524271E-7;
  12466. $72 = $69 < $71;
  12467. if ($72) {
  12468. HEAPF32[$16>>2] = 0.0;
  12469. }
  12470. $73 = ((($0)) + 32|0);
  12471. ;HEAP32[$$byval_copy9>>2]=HEAP32[$73>>2]|0;HEAP32[$$byval_copy9+4>>2]=HEAP32[$73+4>>2]|0;
  12472. ;HEAP32[$$byval_copy14>>2]=HEAP32[$31>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$31+4>>2]|0;
  12473. _Vector2Subtract_4($1,$$byval_copy9,$$byval_copy14);
  12474. ;HEAP32[$$byval_copy9>>2]=HEAP32[$73>>2]|0;HEAP32[$$byval_copy9+4>>2]=HEAP32[$73+4>>2]|0;
  12475. ;HEAP32[$$byval_copy14>>2]=HEAP32[$32>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$32+4>>2]|0;
  12476. _Vector2Subtract_4($2,$$byval_copy9,$$byval_copy14);
  12477. $74 = +HEAPF32[$33>>2];
  12478. ;HEAP32[$$byval_copy14>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$1+4>>2]|0;
  12479. _MathCross($$byval_copy9,$74,$$byval_copy14);
  12480. $75 = +HEAPF32[$34>>2];
  12481. ;HEAP32[$$byval_copy14>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$2+4>>2]|0;
  12482. _MathCross($3,$75,$$byval_copy14);
  12483. $76 = +HEAPF32[$35>>2];
  12484. $77 = +HEAPF32[$3>>2];
  12485. $78 = $76 + $77;
  12486. $79 = +HEAPF32[$36>>2];
  12487. $80 = $78 - $79;
  12488. $81 = +HEAPF32[$$byval_copy9>>2];
  12489. $82 = $80 - $81;
  12490. HEAPF32[$4>>2] = $82;
  12491. $83 = +HEAPF32[$37>>2];
  12492. $84 = +HEAPF32[$38>>2];
  12493. $85 = $83 + $84;
  12494. $86 = +HEAPF32[$39>>2];
  12495. $87 = $85 - $86;
  12496. $88 = +HEAPF32[$40>>2];
  12497. $89 = $87 - $88;
  12498. HEAPF32[$41>>2] = $89;
  12499. ;HEAP32[$$byval_copy14>>2]=HEAP32[$4>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$4+4>>2]|0;
  12500. $90 = (+_MathLenSqr($$byval_copy14));
  12501. HEAPF32[$5>>2] = $46;
  12502. HEAPF32[$47>>2] = $51;
  12503. ;HEAP32[$$byval_copy14>>2]=HEAP32[$5>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$5+4>>2]|0;
  12504. $91 = (+_MathLenSqr($$byval_copy14));
  12505. $92 = $91 + 9.9999999747524271E-7;
  12506. $93 = $90 < $92;
  12507. if (!($93)) {
  12508. STACKTOP = sp;return;
  12509. }
  12510. HEAPF32[$16>>2] = 0.0;
  12511. STACKTOP = sp;return;
  12512. }
  12513. function _IntegratePhysicsImpulses($0) {
  12514. $0 = $0|0;
  12515. var $$0 = 0, $$0135139 = 0, $$1 = 0, $$byval_copy29 = 0, $$sink = 0.0, $$sink138 = 0.0, $$sroa$047$0$$sroa_idx = 0, $$sroa$050$0$$sroa_idx = 0, $$sroa$2$0$$sroa_idx2 = 0, $$sroa$248$0$$sroa_idx49 = 0, $$sroa$251$0$$sroa_idx52 = 0, $1 = 0, $10 = 0, $100 = 0.0, $101 = 0.0, $102 = 0, $103 = 0.0, $104 = 0.0, $105 = 0.0, $106 = 0.0;
  12516. var $107 = 0.0, $108 = 0.0, $109 = 0, $11 = 0, $110 = 0, $111 = 0.0, $112 = 0.0, $113 = 0.0, $114 = 0.0, $115 = 0.0, $116 = 0.0, $117 = 0.0, $118 = 0.0, $119 = 0.0, $12 = 0, $120 = 0, $121 = 0, $122 = 0.0, $123 = 0.0, $124 = 0.0;
  12517. var $125 = 0.0, $126 = 0.0, $127 = 0.0, $128 = 0.0, $129 = 0.0, $13 = 0, $130 = 0.0, $131 = 0, $132 = 0, $133 = 0.0, $134 = 0.0, $135 = 0.0, $136 = 0.0, $137 = 0.0, $138 = 0.0, $139 = 0.0, $14 = 0, $140 = 0.0, $141 = 0.0, $142 = 0;
  12518. var $143 = 0, $144 = 0.0, $145 = 0.0, $146 = 0.0, $147 = 0.0, $148 = 0.0, $149 = 0.0, $15 = 0, $150 = 0.0, $151 = 0.0, $152 = 0.0, $153 = 0.0, $154 = 0.0, $155 = 0.0, $156 = 0.0, $157 = 0.0, $158 = 0.0, $159 = 0.0, $16 = 0, $160 = 0.0;
  12519. var $161 = 0.0, $162 = 0.0, $163 = 0.0, $164 = 0.0, $165 = 0.0, $166 = 0.0, $167 = 0.0, $168 = 0.0, $169 = 0.0, $17 = 0, $170 = 0.0, $171 = 0.0, $172 = 0.0, $173 = 0.0, $174 = 0.0, $175 = 0.0, $176 = 0.0, $177 = 0.0, $178 = 0.0, $179 = 0.0;
  12520. var $18 = 0, $180 = 0, $181 = 0.0, $182 = 0.0, $183 = 0, $184 = 0, $185 = 0, $186 = 0, $187 = 0, $188 = 0.0, $189 = 0.0, $19 = 0, $190 = 0, $191 = 0.0, $192 = 0.0, $193 = 0.0, $194 = 0.0, $195 = 0.0, $196 = 0.0, $197 = 0.0;
  12521. var $198 = 0.0, $199 = 0.0, $2 = 0, $20 = 0, $200 = 0.0, $201 = 0, $202 = 0, $203 = 0.0, $204 = 0.0, $205 = 0.0, $206 = 0.0, $207 = 0.0, $208 = 0.0, $209 = 0.0, $21 = 0, $210 = 0.0, $211 = 0.0, $212 = 0, $213 = 0, $214 = 0.0;
  12522. var $215 = 0.0, $216 = 0.0, $217 = 0.0, $218 = 0.0, $219 = 0.0, $22 = 0.0, $220 = 0.0, $221 = 0.0, $222 = 0.0, $223 = 0, $224 = 0, $225 = 0.0, $226 = 0.0, $227 = 0.0, $228 = 0.0, $229 = 0.0, $23 = 0, $230 = 0.0, $231 = 0.0, $232 = 0.0;
  12523. var $233 = 0.0, $234 = 0, $235 = 0, $236 = 0.0, $237 = 0.0, $238 = 0.0, $239 = 0.0, $24 = 0.0, $240 = 0.0, $25 = 0.0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0;
  12524. var $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0;
  12525. var $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0.0, $65 = 0.0, $66 = 0.0, $67 = 0.0, $68 = 0.0, $69 = 0.0, $7 = 0, $70 = 0.0;
  12526. var $71 = 0.0, $72 = 0.0, $73 = 0.0, $74 = 0.0, $75 = 0.0, $76 = 0.0, $77 = 0.0, $78 = 0.0, $79 = 0.0, $8 = 0, $80 = 0.0, $81 = 0.0, $82 = 0.0, $83 = 0, $84 = 0.0, $85 = 0.0, $86 = 0.0, $87 = 0.0, $88 = 0.0, $89 = 0.0;
  12527. var $9 = 0, $90 = 0.0, $91 = 0.0, $92 = 0.0, $93 = 0.0, $94 = 0.0, $95 = 0.0, $96 = 0.0, $97 = 0.0, $98 = 0.0, $99 = 0.0, $cond1 = 0, $fabsf = 0.0, $fabsf136 = 0.0, $tmpcast137$byval_copy = 0, label = 0, sp = 0;
  12528. sp = STACKTOP;
  12529. STACKTOP = STACKTOP + 144|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(144|0);
  12530. $tmpcast137$byval_copy = sp + 136|0;
  12531. $$byval_copy29 = sp + 128|0;
  12532. $1 = sp + 40|0;
  12533. $2 = sp + 32|0;
  12534. $3 = sp + 8|0;
  12535. $4 = sp + 120|0;
  12536. $5 = sp + 112|0;
  12537. $6 = sp + 104|0;
  12538. $7 = sp + 96|0;
  12539. $8 = sp + 24|0;
  12540. $9 = sp + 88|0;
  12541. $10 = sp + 80|0;
  12542. $11 = sp + 72|0;
  12543. $12 = sp + 64|0;
  12544. $13 = sp + 56|0;
  12545. $14 = sp + 16|0;
  12546. $15 = sp;
  12547. $16 = sp + 48|0;
  12548. $17 = ((($0)) + 4|0);
  12549. $18 = HEAP32[$17>>2]|0;
  12550. $19 = ((($0)) + 8|0);
  12551. $20 = HEAP32[$19>>2]|0;
  12552. $21 = ((($18)) + 56|0);
  12553. $22 = +HEAPF32[$21>>2];
  12554. $23 = ((($20)) + 56|0);
  12555. $24 = +HEAPF32[$23>>2];
  12556. $25 = $22 + $24;
  12557. $fabsf = (+Math_abs((+$25)));
  12558. $26 = !($fabsf <= 9.9999999747524271E-7);
  12559. if (!($26)) {
  12560. $$sroa$050$0$$sroa_idx = ((($18)) + 16|0);
  12561. HEAPF32[$$sroa$050$0$$sroa_idx>>2] = 0.0;
  12562. $$sroa$251$0$$sroa_idx52 = ((($18)) + 20|0);
  12563. HEAPF32[$$sroa$251$0$$sroa_idx52>>2] = 0.0;
  12564. $$sroa$047$0$$sroa_idx = ((($20)) + 16|0);
  12565. HEAPF32[$$sroa$047$0$$sroa_idx>>2] = 0.0;
  12566. $$sroa$248$0$$sroa_idx49 = ((($20)) + 20|0);
  12567. HEAPF32[$$sroa$248$0$$sroa_idx49>>2] = 0.0;
  12568. STACKTOP = sp;return;
  12569. }
  12570. $27 = ((($0)) + 40|0);
  12571. $28 = HEAP32[$27>>2]|0;
  12572. $29 = ($28|0)==(0);
  12573. if ($29) {
  12574. STACKTOP = sp;return;
  12575. }
  12576. $30 = ((($18)) + 8|0);
  12577. $31 = ((($20)) + 8|0);
  12578. $32 = ((($20)) + 16|0);
  12579. $33 = ((($20)) + 32|0);
  12580. $34 = ((($18)) + 16|0);
  12581. $35 = ((($18)) + 32|0);
  12582. $36 = ((($20)) + 20|0);
  12583. $37 = ((($6)) + 4|0);
  12584. $38 = ((($18)) + 20|0);
  12585. $39 = ((($7)) + 4|0);
  12586. $40 = ((($3)) + 4|0);
  12587. $41 = ((($0)) + 16|0);
  12588. $42 = ((($18)) + 48|0);
  12589. $43 = ((($20)) + 48|0);
  12590. $44 = ((($0)) + 44|0);
  12591. $45 = ((($8)) + 4|0);
  12592. $46 = ((($0)) + 20|0);
  12593. $47 = ((($18)) + 4|0);
  12594. $48 = ((($20)) + 4|0);
  12595. $49 = ((($12)) + 4|0);
  12596. $50 = ((($13)) + 4|0);
  12597. $51 = ((($14)) + 4|0);
  12598. $52 = ((($0)) + 52|0);
  12599. $$sroa$2$0$$sroa_idx2 = ((($15)) + 4|0);
  12600. $53 = ((($20)) + 80|0);
  12601. $54 = ((($18)) + 80|0);
  12602. $55 = ((($16)) + 4|0);
  12603. $56 = ((($0)) + 48|0);
  12604. $57 = ((($20)) + 80|0);
  12605. $58 = ((($18)) + 80|0);
  12606. $59 = ((($9)) + 4|0);
  12607. $$0135139 = 0;
  12608. while(1) {
  12609. $63 = (((($0)) + 24|0) + ($$0135139<<3)|0);
  12610. ;HEAP32[$$byval_copy29>>2]=HEAP32[$63>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$63+4>>2]|0;
  12611. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$30>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$30+4>>2]|0;
  12612. _Vector2Subtract_4($1,$$byval_copy29,$tmpcast137$byval_copy);
  12613. ;HEAP32[$$byval_copy29>>2]=HEAP32[$63>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$63+4>>2]|0;
  12614. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$31>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$31+4>>2]|0;
  12615. _Vector2Subtract_4($2,$$byval_copy29,$tmpcast137$byval_copy);
  12616. $64 = +HEAPF32[$32>>2];
  12617. $65 = +HEAPF32[$33>>2];
  12618. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$2>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$2+4>>2]|0;
  12619. _MathCross($4,$65,$tmpcast137$byval_copy);
  12620. $66 = +HEAPF32[$4>>2];
  12621. $67 = $64 + $66;
  12622. $68 = +HEAPF32[$34>>2];
  12623. $69 = $67 - $68;
  12624. $70 = +HEAPF32[$35>>2];
  12625. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$1+4>>2]|0;
  12626. _MathCross($5,$70,$tmpcast137$byval_copy);
  12627. $71 = +HEAPF32[$5>>2];
  12628. $72 = $69 - $71;
  12629. HEAPF32[$3>>2] = $72;
  12630. $73 = +HEAPF32[$36>>2];
  12631. $74 = +HEAPF32[$33>>2];
  12632. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$2>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$2+4>>2]|0;
  12633. _MathCross($6,$74,$tmpcast137$byval_copy);
  12634. $75 = +HEAPF32[$37>>2];
  12635. $76 = $73 + $75;
  12636. $77 = +HEAPF32[$38>>2];
  12637. $78 = $76 - $77;
  12638. $79 = +HEAPF32[$35>>2];
  12639. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$1+4>>2]|0;
  12640. _MathCross($7,$79,$tmpcast137$byval_copy);
  12641. $80 = +HEAPF32[$39>>2];
  12642. $81 = $78 - $80;
  12643. HEAPF32[$40>>2] = $81;
  12644. ;HEAP32[$$byval_copy29>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$3+4>>2]|0;
  12645. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$41>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$41+4>>2]|0;
  12646. $82 = (+_MathDot($$byval_copy29,$tmpcast137$byval_copy));
  12647. $83 = $82 > 0.0;
  12648. if ($83) {
  12649. $$1 = 1;
  12650. } else {
  12651. ;HEAP32[$$byval_copy29>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$1+4>>2]|0;
  12652. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$41>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$41+4>>2]|0;
  12653. $84 = (+_MathCrossVector2($$byval_copy29,$tmpcast137$byval_copy));
  12654. ;HEAP32[$$byval_copy29>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$2+4>>2]|0;
  12655. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$41>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$41+4>>2]|0;
  12656. $85 = (+_MathCrossVector2($$byval_copy29,$tmpcast137$byval_copy));
  12657. $86 = +HEAPF32[$21>>2];
  12658. $87 = +HEAPF32[$23>>2];
  12659. $88 = $86 + $87;
  12660. $89 = $84 * $84;
  12661. $90 = +HEAPF32[$42>>2];
  12662. $91 = $89 * $90;
  12663. $92 = $88 + $91;
  12664. $93 = $85 * $85;
  12665. $94 = +HEAPF32[$43>>2];
  12666. $95 = $93 * $94;
  12667. $96 = $92 + $95;
  12668. $97 = +HEAPF32[$44>>2];
  12669. $98 = $97 + 1.0;
  12670. $99 = $82 * $98;
  12671. $100 = -$99;
  12672. $101 = $100 / $96;
  12673. $102 = HEAP32[$27>>2]|0;
  12674. $103 = (+($102>>>0));
  12675. $104 = $101 / $103;
  12676. $105 = +HEAPF32[$41>>2];
  12677. $106 = $105 * $104;
  12678. HEAPF32[$8>>2] = $106;
  12679. $107 = +HEAPF32[$46>>2];
  12680. $108 = $104 * $107;
  12681. HEAPF32[$45>>2] = $108;
  12682. $109 = HEAP32[$47>>2]|0;
  12683. $110 = ($109|0)==(0);
  12684. if (!($110)) {
  12685. $111 = +HEAPF32[$21>>2];
  12686. $112 = +HEAPF32[$8>>2];
  12687. $113 = $111 * $112;
  12688. $114 = +HEAPF32[$34>>2];
  12689. $115 = $114 - $113;
  12690. HEAPF32[$34>>2] = $115;
  12691. $116 = +HEAPF32[$45>>2];
  12692. $117 = $111 * $116;
  12693. $118 = +HEAPF32[$38>>2];
  12694. $119 = $118 - $117;
  12695. HEAPF32[$38>>2] = $119;
  12696. $120 = HEAP32[$58>>2]|0;
  12697. $121 = ($120|0)==(0);
  12698. if ($121) {
  12699. $122 = +HEAPF32[$42>>2];
  12700. $123 = +HEAPF32[$8>>2];
  12701. $124 = -$123;
  12702. HEAPF32[$9>>2] = $124;
  12703. $125 = +HEAPF32[$45>>2];
  12704. $126 = -$125;
  12705. HEAPF32[$59>>2] = $126;
  12706. ;HEAP32[$$byval_copy29>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$1+4>>2]|0;
  12707. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$9>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$9+4>>2]|0;
  12708. $127 = (+_MathCrossVector2($$byval_copy29,$tmpcast137$byval_copy));
  12709. $128 = $122 * $127;
  12710. $129 = +HEAPF32[$35>>2];
  12711. $130 = $129 + $128;
  12712. HEAPF32[$35>>2] = $130;
  12713. }
  12714. }
  12715. $131 = HEAP32[$48>>2]|0;
  12716. $132 = ($131|0)==(0);
  12717. if (!($132)) {
  12718. $133 = +HEAPF32[$23>>2];
  12719. $134 = +HEAPF32[$8>>2];
  12720. $135 = $133 * $134;
  12721. $136 = +HEAPF32[$32>>2];
  12722. $137 = $136 + $135;
  12723. HEAPF32[$32>>2] = $137;
  12724. $138 = +HEAPF32[$45>>2];
  12725. $139 = $133 * $138;
  12726. $140 = +HEAPF32[$36>>2];
  12727. $141 = $140 + $139;
  12728. HEAPF32[$36>>2] = $141;
  12729. $142 = HEAP32[$57>>2]|0;
  12730. $143 = ($142|0)==(0);
  12731. if ($143) {
  12732. $144 = +HEAPF32[$43>>2];
  12733. ;HEAP32[$$byval_copy29>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$2+4>>2]|0;
  12734. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$8>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$8+4>>2]|0;
  12735. $145 = (+_MathCrossVector2($$byval_copy29,$tmpcast137$byval_copy));
  12736. $146 = $144 * $145;
  12737. $147 = +HEAPF32[$33>>2];
  12738. $148 = $147 + $146;
  12739. HEAPF32[$33>>2] = $148;
  12740. }
  12741. }
  12742. $149 = +HEAPF32[$32>>2];
  12743. $150 = +HEAPF32[$33>>2];
  12744. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$2>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$2+4>>2]|0;
  12745. _MathCross($10,$150,$tmpcast137$byval_copy);
  12746. $151 = +HEAPF32[$10>>2];
  12747. $152 = $149 + $151;
  12748. $153 = +HEAPF32[$34>>2];
  12749. $154 = $152 - $153;
  12750. $155 = +HEAPF32[$35>>2];
  12751. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$1+4>>2]|0;
  12752. _MathCross($11,$155,$tmpcast137$byval_copy);
  12753. $156 = +HEAPF32[$11>>2];
  12754. $157 = $154 - $156;
  12755. HEAPF32[$3>>2] = $157;
  12756. $158 = +HEAPF32[$36>>2];
  12757. $159 = +HEAPF32[$33>>2];
  12758. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$2>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$2+4>>2]|0;
  12759. _MathCross($12,$159,$tmpcast137$byval_copy);
  12760. $160 = +HEAPF32[$49>>2];
  12761. $161 = $158 + $160;
  12762. $162 = +HEAPF32[$38>>2];
  12763. $163 = $161 - $162;
  12764. $164 = +HEAPF32[$35>>2];
  12765. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$1+4>>2]|0;
  12766. _MathCross($13,$164,$tmpcast137$byval_copy);
  12767. $165 = +HEAPF32[$50>>2];
  12768. $166 = $163 - $165;
  12769. HEAPF32[$40>>2] = $166;
  12770. $167 = +HEAPF32[$3>>2];
  12771. $168 = +HEAPF32[$41>>2];
  12772. ;HEAP32[$$byval_copy29>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$3+4>>2]|0;
  12773. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$41>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$41+4>>2]|0;
  12774. $169 = (+_MathDot($$byval_copy29,$tmpcast137$byval_copy));
  12775. $170 = $168 * $169;
  12776. $171 = $167 - $170;
  12777. HEAPF32[$14>>2] = $171;
  12778. $172 = +HEAPF32[$40>>2];
  12779. $173 = +HEAPF32[$46>>2];
  12780. ;HEAP32[$$byval_copy29>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$3+4>>2]|0;
  12781. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$41>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$41+4>>2]|0;
  12782. $174 = (+_MathDot($$byval_copy29,$tmpcast137$byval_copy));
  12783. $175 = $173 * $174;
  12784. $176 = $172 - $175;
  12785. HEAPF32[$51>>2] = $176;
  12786. _MathNormalize($14);
  12787. ;HEAP32[$$byval_copy29>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$3+4>>2]|0;
  12788. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$14>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$14+4>>2]|0;
  12789. $177 = (+_MathDot($$byval_copy29,$tmpcast137$byval_copy));
  12790. $178 = -$177;
  12791. $179 = $178 / $96;
  12792. $180 = HEAP32[$27>>2]|0;
  12793. $181 = (+($180>>>0));
  12794. $182 = $179 / $181;
  12795. $fabsf136 = (+Math_abs((+$182)));
  12796. $183 = !($fabsf136 <= 9.9999999747524271E-7);
  12797. if ($183) {
  12798. $184 = $15;
  12799. $185 = $184;
  12800. HEAP32[$185>>2] = 0;
  12801. $186 = (($184) + 4)|0;
  12802. $187 = $186;
  12803. HEAP32[$187>>2] = 0;
  12804. $188 = +HEAPF32[$52>>2];
  12805. $189 = $104 * $188;
  12806. $190 = $fabsf136 < $189;
  12807. $191 = +HEAPF32[$14>>2];
  12808. $192 = +HEAPF32[$51>>2];
  12809. if ($190) {
  12810. $193 = $182 * $191;
  12811. $194 = $182 * $192;
  12812. $$sink = $194;$$sink138 = $193;
  12813. } else {
  12814. $195 = -$104;
  12815. $196 = $191 * $195;
  12816. $197 = +HEAPF32[$56>>2];
  12817. $198 = $196 * $197;
  12818. $199 = $192 * $195;
  12819. $200 = $199 * $197;
  12820. $$sink = $200;$$sink138 = $198;
  12821. }
  12822. HEAPF32[$15>>2] = $$sink138;
  12823. HEAPF32[$$sroa$2$0$$sroa_idx2>>2] = $$sink;
  12824. $201 = HEAP32[$47>>2]|0;
  12825. $202 = ($201|0)==(0);
  12826. if (!($202)) {
  12827. $203 = +HEAPF32[$21>>2];
  12828. $204 = +HEAPF32[$15>>2];
  12829. $205 = $203 * $204;
  12830. $206 = +HEAPF32[$34>>2];
  12831. $207 = $206 - $205;
  12832. HEAPF32[$34>>2] = $207;
  12833. $208 = +HEAPF32[$$sroa$2$0$$sroa_idx2>>2];
  12834. $209 = $203 * $208;
  12835. $210 = +HEAPF32[$38>>2];
  12836. $211 = $210 - $209;
  12837. HEAPF32[$38>>2] = $211;
  12838. $212 = HEAP32[$54>>2]|0;
  12839. $213 = ($212|0)==(0);
  12840. if ($213) {
  12841. $214 = +HEAPF32[$42>>2];
  12842. $215 = +HEAPF32[$15>>2];
  12843. $216 = -$215;
  12844. HEAPF32[$16>>2] = $216;
  12845. $217 = +HEAPF32[$$sroa$2$0$$sroa_idx2>>2];
  12846. $218 = -$217;
  12847. HEAPF32[$55>>2] = $218;
  12848. ;HEAP32[$$byval_copy29>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$1+4>>2]|0;
  12849. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$16>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$16+4>>2]|0;
  12850. $219 = (+_MathCrossVector2($$byval_copy29,$tmpcast137$byval_copy));
  12851. $220 = $214 * $219;
  12852. $221 = +HEAPF32[$35>>2];
  12853. $222 = $221 + $220;
  12854. HEAPF32[$35>>2] = $222;
  12855. }
  12856. }
  12857. $223 = HEAP32[$48>>2]|0;
  12858. $224 = ($223|0)==(0);
  12859. if (!($224)) {
  12860. $225 = +HEAPF32[$23>>2];
  12861. $226 = +HEAPF32[$15>>2];
  12862. $227 = $225 * $226;
  12863. $228 = +HEAPF32[$32>>2];
  12864. $229 = $228 + $227;
  12865. HEAPF32[$32>>2] = $229;
  12866. $230 = +HEAPF32[$$sroa$2$0$$sroa_idx2>>2];
  12867. $231 = $225 * $230;
  12868. $232 = +HEAPF32[$36>>2];
  12869. $233 = $232 + $231;
  12870. HEAPF32[$36>>2] = $233;
  12871. $234 = HEAP32[$53>>2]|0;
  12872. $235 = ($234|0)==(0);
  12873. if ($235) {
  12874. $236 = +HEAPF32[$43>>2];
  12875. ;HEAP32[$$byval_copy29>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$2+4>>2]|0;
  12876. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$15>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$15+4>>2]|0;
  12877. $237 = (+_MathCrossVector2($$byval_copy29,$tmpcast137$byval_copy));
  12878. $238 = $236 * $237;
  12879. $239 = +HEAPF32[$33>>2];
  12880. $240 = $239 + $238;
  12881. HEAPF32[$33>>2] = $240;
  12882. }
  12883. }
  12884. $$0 = 0;
  12885. } else {
  12886. $$0 = 1;
  12887. }
  12888. $$1 = $$0;
  12889. }
  12890. $cond1 = ($$1|0)==(0);
  12891. $62 = (($$0135139) + 1)|0;
  12892. if (!($cond1)) {
  12893. label = 26;
  12894. break;
  12895. }
  12896. $60 = HEAP32[$27>>2]|0;
  12897. $61 = ($62>>>0)<($60>>>0);
  12898. if ($61) {
  12899. $$0135139 = $62;
  12900. } else {
  12901. label = 26;
  12902. break;
  12903. }
  12904. }
  12905. if ((label|0) == 26) {
  12906. STACKTOP = sp;return;
  12907. }
  12908. }
  12909. function _IntegratePhysicsVelocity($0) {
  12910. $0 = $0|0;
  12911. var $1 = 0, $10 = 0.0, $11 = 0.0, $12 = 0.0, $13 = 0.0, $14 = 0, $15 = 0.0, $16 = 0.0, $17 = 0.0, $18 = 0, $19 = 0.0, $2 = 0, $20 = 0.0, $21 = 0.0, $22 = 0.0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0.0;
  12912. var $28 = 0.0, $29 = 0.0, $3 = 0, $30 = 0, $31 = 0.0, $32 = 0.0, $33 = 0.0, $34 = 0.0, $35 = 0, $36 = 0, $37 = 0.0, $4 = 0, $5 = 0.0, $6 = 0.0, $7 = 0.0, $8 = 0.0, $9 = 0, label = 0, sp = 0;
  12913. sp = STACKTOP;
  12914. $1 = ((($0)) + 4|0);
  12915. $2 = HEAP32[$1>>2]|0;
  12916. $3 = ($2|0)==(0);
  12917. if ($3) {
  12918. return;
  12919. }
  12920. $4 = ((($0)) + 16|0);
  12921. $5 = +HEAPF32[$4>>2];
  12922. $6 = $5;
  12923. $7 = +HEAPF64[1749];
  12924. $8 = $6 * $7;
  12925. $9 = ((($0)) + 8|0);
  12926. $10 = +HEAPF32[$9>>2];
  12927. $11 = $10;
  12928. $12 = $8 + $11;
  12929. $13 = $12;
  12930. HEAPF32[$9>>2] = $13;
  12931. $14 = ((($0)) + 20|0);
  12932. $15 = +HEAPF32[$14>>2];
  12933. $16 = $15;
  12934. $17 = $7 * $16;
  12935. $18 = ((($0)) + 12|0);
  12936. $19 = +HEAPF32[$18>>2];
  12937. $20 = $19;
  12938. $21 = $20 + $17;
  12939. $22 = $21;
  12940. HEAPF32[$18>>2] = $22;
  12941. $23 = ((($0)) + 80|0);
  12942. $24 = HEAP32[$23>>2]|0;
  12943. $25 = ($24|0)==(0);
  12944. if ($25) {
  12945. $26 = ((($0)) + 32|0);
  12946. $27 = +HEAPF32[$26>>2];
  12947. $28 = $27;
  12948. $29 = $7 * $28;
  12949. $30 = ((($0)) + 40|0);
  12950. $31 = +HEAPF32[$30>>2];
  12951. $32 = $31;
  12952. $33 = $32 + $29;
  12953. $34 = $33;
  12954. HEAPF32[$30>>2] = $34;
  12955. }
  12956. $35 = ((($0)) + 484|0);
  12957. $36 = ((($0)) + 40|0);
  12958. $37 = +HEAPF32[$36>>2];
  12959. _Mat2Set($35,$37);
  12960. _IntegratePhysicsForces($0);
  12961. return;
  12962. }
  12963. function _CorrectPhysicsPositions($0) {
  12964. $0 = $0|0;
  12965. var $1 = 0, $10 = 0, $11 = 0.0, $12 = 0, $13 = 0.0, $14 = 0.0, $15 = 0.0, $16 = 0, $17 = 0.0, $18 = 0.0, $19 = 0.0, $2 = 0, $20 = 0, $21 = 0.0, $22 = 0.0, $23 = 0.0, $24 = 0, $25 = 0, $26 = 0, $27 = 0.0;
  12966. var $28 = 0, $29 = 0.0, $3 = 0, $30 = 0.0, $31 = 0.0, $32 = 0, $33 = 0.0, $34 = 0.0, $35 = 0, $36 = 0, $37 = 0, $38 = 0.0, $39 = 0.0, $4 = 0, $40 = 0, $41 = 0.0, $42 = 0.0, $43 = 0.0, $44 = 0, $45 = 0.0;
  12967. var $46 = 0.0, $5 = 0, $6 = 0.0, $7 = 0.0, $8 = 0, $9 = 0.0, label = 0, sp = 0;
  12968. sp = STACKTOP;
  12969. $1 = ((($0)) + 4|0);
  12970. $2 = HEAP32[$1>>2]|0;
  12971. $3 = ((($0)) + 8|0);
  12972. $4 = HEAP32[$3>>2]|0;
  12973. $5 = ((($0)) + 12|0);
  12974. $6 = +HEAPF32[$5>>2];
  12975. $7 = $6 + -0.05000000074505806;
  12976. $8 = $7 > 0.0;
  12977. $9 = $8 ? $7 : 0.0;
  12978. $10 = ((($2)) + 56|0);
  12979. $11 = +HEAPF32[$10>>2];
  12980. $12 = ((($4)) + 56|0);
  12981. $13 = +HEAPF32[$12>>2];
  12982. $14 = $11 + $13;
  12983. $15 = $9 / $14;
  12984. $16 = ((($0)) + 16|0);
  12985. $17 = +HEAPF32[$16>>2];
  12986. $18 = $17 * $15;
  12987. $19 = $18 * 0.40000000596046448;
  12988. $20 = ((($0)) + 20|0);
  12989. $21 = +HEAPF32[$20>>2];
  12990. $22 = $15 * $21;
  12991. $23 = $22 * 0.40000000596046448;
  12992. $24 = ((($2)) + 4|0);
  12993. $25 = HEAP32[$24>>2]|0;
  12994. $26 = ($25|0)==(0);
  12995. if (!($26)) {
  12996. $27 = $11 * $19;
  12997. $28 = ((($2)) + 8|0);
  12998. $29 = +HEAPF32[$28>>2];
  12999. $30 = $29 - $27;
  13000. HEAPF32[$28>>2] = $30;
  13001. $31 = $11 * $23;
  13002. $32 = ((($2)) + 12|0);
  13003. $33 = +HEAPF32[$32>>2];
  13004. $34 = $33 - $31;
  13005. HEAPF32[$32>>2] = $34;
  13006. }
  13007. $35 = ((($4)) + 4|0);
  13008. $36 = HEAP32[$35>>2]|0;
  13009. $37 = ($36|0)==(0);
  13010. if ($37) {
  13011. return;
  13012. }
  13013. $38 = +HEAPF32[$12>>2];
  13014. $39 = $19 * $38;
  13015. $40 = ((($4)) + 8|0);
  13016. $41 = +HEAPF32[$40>>2];
  13017. $42 = $41 + $39;
  13018. HEAPF32[$40>>2] = $42;
  13019. $43 = $23 * $38;
  13020. $44 = ((($4)) + 12|0);
  13021. $45 = +HEAPF32[$44>>2];
  13022. $46 = $43 + $45;
  13023. HEAPF32[$44>>2] = $46;
  13024. return;
  13025. }
  13026. function _SolveCircleToCircle($0) {
  13027. $0 = $0|0;
  13028. var $$byval_copy = 0, $$byval_copy2 = 0, $$sroa$0$0$$sroa_idx = 0, $$sroa$02$0$$sroa_idx = 0, $$sroa$05$0$$sroa_idx = 0, $$sroa$2$0$$sroa_idx1 = 0, $$sroa$23$0$$sroa_idx4 = 0, $$sroa$26$0$$sroa_idx7 = 0, $1 = 0, $10 = 0.0, $11 = 0, $12 = 0.0, $13 = 0.0, $14 = 0.0, $15 = 0, $16 = 0, $17 = 0.0, $18 = 0, $19 = 0, $2 = 0;
  13029. var $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0.0, $34 = 0, $35 = 0.0, $36 = 0.0, $37 = 0, $38 = 0.0;
  13030. var $39 = 0.0, $4 = 0, $40 = 0.0, $41 = 0.0, $42 = 0.0, $43 = 0.0, $44 = 0.0, $45 = 0, $46 = 0.0, $47 = 0.0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0.0, $53 = 0, $54 = 0, $6 = 0, $7 = 0;
  13031. var $8 = 0.0, $9 = 0, label = 0, sp = 0;
  13032. sp = STACKTOP;
  13033. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  13034. $$byval_copy2 = sp + 16|0;
  13035. $$byval_copy = sp + 8|0;
  13036. $1 = sp;
  13037. $2 = ((($0)) + 4|0);
  13038. $3 = HEAP32[$2>>2]|0;
  13039. $4 = ((($0)) + 8|0);
  13040. $5 = HEAP32[$4>>2]|0;
  13041. $6 = ((($5)) + 8|0);
  13042. $7 = ((($3)) + 8|0);
  13043. ;HEAP32[$$byval_copy>>2]=HEAP32[$6>>2]|0;HEAP32[$$byval_copy+4>>2]=HEAP32[$6+4>>2]|0;
  13044. ;HEAP32[$$byval_copy2>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$7+4>>2]|0;
  13045. _Vector2Subtract_4($1,$$byval_copy,$$byval_copy2);
  13046. ;HEAP32[$$byval_copy2>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$1+4>>2]|0;
  13047. $8 = (+_MathLenSqr($$byval_copy2));
  13048. $9 = ((($3)) + 92|0);
  13049. $10 = +HEAPF32[$9>>2];
  13050. $11 = ((($5)) + 92|0);
  13051. $12 = +HEAPF32[$11>>2];
  13052. $13 = $10 + $12;
  13053. $14 = $13 * $13;
  13054. $15 = !($8 >= $14);
  13055. if (!($15)) {
  13056. $16 = ((($0)) + 40|0);
  13057. HEAP32[$16>>2] = 0;
  13058. STACKTOP = sp;return;
  13059. }
  13060. $17 = (+Math_sqrt((+$8)));
  13061. $18 = ((($0)) + 40|0);
  13062. HEAP32[$18>>2] = 1;
  13063. $19 = $17 == 0.0;
  13064. if ($19) {
  13065. $20 = HEAP32[$9>>2]|0;
  13066. $21 = ((($0)) + 12|0);
  13067. HEAP32[$21>>2] = $20;
  13068. $$sroa$05$0$$sroa_idx = ((($0)) + 16|0);
  13069. HEAPF32[$$sroa$05$0$$sroa_idx>>2] = 1.0;
  13070. $$sroa$26$0$$sroa_idx7 = ((($0)) + 20|0);
  13071. HEAPF32[$$sroa$26$0$$sroa_idx7>>2] = 0.0;
  13072. $22 = ((($0)) + 24|0);
  13073. $23 = $7;
  13074. $24 = $23;
  13075. $25 = HEAP32[$24>>2]|0;
  13076. $26 = (($23) + 4)|0;
  13077. $27 = $26;
  13078. $28 = HEAP32[$27>>2]|0;
  13079. $29 = $22;
  13080. $30 = $29;
  13081. HEAP32[$30>>2] = $25;
  13082. $31 = (($29) + 4)|0;
  13083. $32 = $31;
  13084. HEAP32[$32>>2] = $28;
  13085. } else {
  13086. $33 = $13 - $17;
  13087. $34 = ((($0)) + 12|0);
  13088. HEAPF32[$34>>2] = $33;
  13089. $35 = +HEAPF32[$1>>2];
  13090. $36 = $35 / $17;
  13091. $37 = ((($1)) + 4|0);
  13092. $38 = +HEAPF32[$37>>2];
  13093. $39 = $38 / $17;
  13094. $$sroa$02$0$$sroa_idx = ((($0)) + 16|0);
  13095. HEAPF32[$$sroa$02$0$$sroa_idx>>2] = $36;
  13096. $$sroa$23$0$$sroa_idx4 = ((($0)) + 20|0);
  13097. HEAPF32[$$sroa$23$0$$sroa_idx4>>2] = $39;
  13098. $40 = +HEAPF32[$9>>2];
  13099. $41 = $36 * $40;
  13100. $42 = +HEAPF32[$7>>2];
  13101. $43 = $41 + $42;
  13102. $44 = $39 * $40;
  13103. $45 = ((($3)) + 12|0);
  13104. $46 = +HEAPF32[$45>>2];
  13105. $47 = $44 + $46;
  13106. $$sroa$0$0$$sroa_idx = ((($0)) + 24|0);
  13107. HEAPF32[$$sroa$0$0$$sroa_idx>>2] = $43;
  13108. $$sroa$2$0$$sroa_idx1 = ((($0)) + 28|0);
  13109. HEAPF32[$$sroa$2$0$$sroa_idx1>>2] = $47;
  13110. }
  13111. $48 = ((($3)) + 76|0);
  13112. $49 = HEAP32[$48>>2]|0;
  13113. $50 = ($49|0)==(0);
  13114. if (!($50)) {
  13115. STACKTOP = sp;return;
  13116. }
  13117. $51 = ((($0)) + 20|0);
  13118. $52 = +HEAPF32[$51>>2];
  13119. $53 = $52 < 0.0;
  13120. $54 = $53&1;
  13121. HEAP32[$48>>2] = $54;
  13122. STACKTOP = sp;return;
  13123. }
  13124. function _SolveCircleToPolygon($0) {
  13125. $0 = $0|0;
  13126. var $$0$lcssa = 0.0, $$0125 = 0.0, $$093$lcssa = 0, $$093124 = 0, $$097123 = 0, $$1 = 0.0, $$194 = 0, $$byval_copy41 = 0, $$sroa$0$0$$sroa_idx = 0, $$sroa$011$0$$sroa_idx = 0, $$sroa$014$0$$sroa_idx = 0, $$sroa$04$0$$sroa_idx = 0, $$sroa$2$0$$sroa_idx3 = 0, $$sroa$212$0$$sroa_idx13 = 0, $$sroa$215$0$$sroa_idx16 = 0, $$sroa$25$0$$sroa_idx6 = 0, $1 = 0, $10 = 0, $100 = 0.0, $101 = 0.0;
  13127. var $102 = 0, $103 = 0, $104 = 0.0, $105 = 0.0, $106 = 0.0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0, $116 = 0, $117 = 0, $118 = 0, $119 = 0, $12 = 0;
  13128. var $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0, $133 = 0, $134 = 0, $135 = 0, $136 = 0, $137 = 0, $138 = 0;
  13129. var $139 = 0, $14 = 0, $140 = 0, $141 = 0, $142 = 0, $143 = 0, $144 = 0, $145 = 0, $146 = 0, $147 = 0, $148 = 0, $149 = 0, $15 = 0, $150 = 0, $151 = 0, $152 = 0, $153 = 0, $154 = 0, $155 = 0, $156 = 0.0;
  13130. var $157 = 0.0, $158 = 0.0, $159 = 0, $16 = 0, $160 = 0, $161 = 0, $162 = 0, $163 = 0, $164 = 0, $165 = 0, $166 = 0, $167 = 0, $168 = 0, $169 = 0, $17 = 0, $170 = 0, $171 = 0, $172 = 0, $173 = 0, $174 = 0;
  13131. var $175 = 0, $176 = 0, $177 = 0, $178 = 0, $179 = 0, $18 = 0, $180 = 0, $181 = 0, $182 = 0, $183 = 0, $184 = 0, $185 = 0, $186 = 0, $187 = 0, $188 = 0, $189 = 0, $19 = 0, $190 = 0, $191 = 0, $192 = 0;
  13132. var $193 = 0, $194 = 0, $195 = 0, $196 = 0, $197 = 0, $198 = 0, $199 = 0, $2 = 0, $20 = 0, $200 = 0, $201 = 0, $202 = 0, $203 = 0, $204 = 0, $205 = 0, $206 = 0, $207 = 0, $208 = 0, $209 = 0, $21 = 0;
  13133. var $210 = 0, $211 = 0, $212 = 0, $213 = 0, $214 = 0, $215 = 0, $216 = 0, $217 = 0, $218 = 0.0, $219 = 0.0, $22 = 0, $220 = 0, $221 = 0, $222 = 0, $223 = 0, $224 = 0, $225 = 0, $226 = 0, $227 = 0, $228 = 0;
  13134. var $229 = 0, $23 = 0, $230 = 0, $231 = 0, $232 = 0.0, $233 = 0.0, $234 = 0, $235 = 0.0, $236 = 0.0, $237 = 0.0, $238 = 0.0, $239 = 0.0, $24 = 0, $240 = 0.0, $241 = 0.0, $242 = 0, $243 = 0.0, $244 = 0.0, $25 = 0, $26 = 0;
  13135. var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
  13136. var $45 = 0.0, $46 = 0.0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0;
  13137. var $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0;
  13138. var $81 = 0.0, $82 = 0.0, $83 = 0, $84 = 0.0, $85 = 0.0, $86 = 0, $87 = 0.0, $88 = 0.0, $89 = 0.0, $9 = 0, $90 = 0.0, $91 = 0.0, $92 = 0, $93 = 0.0, $94 = 0.0, $95 = 0, $96 = 0, $97 = 0.0, $98 = 0.0, $99 = 0;
  13139. var $tmpcast104$byval_copy42 = 0, label = 0, sp = 0;
  13140. sp = STACKTOP;
  13141. STACKTOP = STACKTOP + 608|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(608|0);
  13142. $tmpcast104$byval_copy42 = sp + 584|0;
  13143. $$byval_copy41 = sp + 568|0;
  13144. $1 = sp + 24|0;
  13145. $2 = sp + 552|0;
  13146. $3 = sp + 544|0;
  13147. $4 = sp + 88|0;
  13148. $5 = sp + 536|0;
  13149. $6 = sp + 16|0;
  13150. $7 = sp + 8|0;
  13151. $8 = sp;
  13152. $9 = sp + 528|0;
  13153. $10 = sp + 520|0;
  13154. $11 = sp + 512|0;
  13155. $12 = sp + 504|0;
  13156. $13 = sp + 80|0;
  13157. $14 = sp + 72|0;
  13158. $15 = sp + 64|0;
  13159. $16 = sp + 56|0;
  13160. $17 = sp + 48|0;
  13161. $18 = sp + 40|0;
  13162. $19 = sp + 496|0;
  13163. $20 = sp + 32|0;
  13164. $21 = ((($0)) + 4|0);
  13165. $22 = HEAP32[$21>>2]|0;
  13166. $23 = ((($0)) + 8|0);
  13167. $24 = HEAP32[$23>>2]|0;
  13168. $25 = ((($0)) + 40|0);
  13169. HEAP32[$25>>2] = 0;
  13170. $26 = ((($22)) + 8|0);
  13171. $27 = $26;
  13172. $28 = $27;
  13173. $29 = HEAP32[$28>>2]|0;
  13174. $30 = (($27) + 4)|0;
  13175. $31 = $30;
  13176. $32 = HEAP32[$31>>2]|0;
  13177. $33 = $1;
  13178. $34 = $33;
  13179. HEAP32[$34>>2] = $29;
  13180. $35 = (($33) + 4)|0;
  13181. $36 = $35;
  13182. HEAP32[$36>>2] = $32;
  13183. $37 = ((($24)) + 96|0);
  13184. $38 = ((($24)) + 484|0);
  13185. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$38>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$38+4>>2]|0;HEAP32[$tmpcast104$byval_copy42+8>>2]=HEAP32[$38+8>>2]|0;HEAP32[$tmpcast104$byval_copy42+12>>2]=HEAP32[$38+12>>2]|0;
  13186. _Mat2Transpose($2,$tmpcast104$byval_copy42);
  13187. $39 = ((($24)) + 8|0);
  13188. ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
  13189. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$39>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$39+4>>2]|0;
  13190. _Vector2Subtract_4($3,$$byval_copy41,$tmpcast104$byval_copy42);
  13191. ;HEAP32[$$byval_copy41>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$2+4>>2]|0;HEAP32[$$byval_copy41+8>>2]=HEAP32[$2+8>>2]|0;HEAP32[$$byval_copy41+12>>2]=HEAP32[$2+12>>2]|0;
  13192. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$3>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$3+4>>2]|0;
  13193. _Mat2MultiplyVector2($1,$$byval_copy41,$tmpcast104$byval_copy42);
  13194. _memcpy(($4|0),($37|0),404)|0;
  13195. $40 = HEAP32[$4>>2]|0;
  13196. $41 = ($40|0)==(0);
  13197. L1: do {
  13198. if ($41) {
  13199. $$0$lcssa = -3.4028234663852886E+38;$$093$lcssa = 0;
  13200. } else {
  13201. $42 = ((($22)) + 92|0);
  13202. $$0125 = -3.4028234663852886E+38;$$093124 = 0;$$097123 = 0;
  13203. while(1) {
  13204. $43 = (((($4)) + 196|0) + ($$097123<<3)|0);
  13205. $44 = (((($4)) + 4|0) + ($$097123<<3)|0);
  13206. ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
  13207. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$44>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$44+4>>2]|0;
  13208. _Vector2Subtract_4($5,$$byval_copy41,$tmpcast104$byval_copy42);
  13209. ;HEAP32[$$byval_copy41>>2]=HEAP32[$43>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$43+4>>2]|0;
  13210. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$5>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$5+4>>2]|0;
  13211. $45 = (+_MathDot($$byval_copy41,$tmpcast104$byval_copy42));
  13212. $46 = +HEAPF32[$42>>2];
  13213. $47 = $45 > $46;
  13214. $48 = $45 > $$0125;
  13215. if ($47) {
  13216. break;
  13217. }
  13218. $$1 = $48 ? $45 : $$0125;
  13219. $$194 = $48 ? $$097123 : $$093124;
  13220. $49 = (($$097123) + 1)|0;
  13221. $50 = HEAP32[$4>>2]|0;
  13222. $51 = ($49>>>0)<($50>>>0);
  13223. if ($51) {
  13224. $$0125 = $$1;$$093124 = $$194;$$097123 = $49;
  13225. } else {
  13226. $$0$lcssa = $$1;$$093$lcssa = $$194;
  13227. break L1;
  13228. }
  13229. }
  13230. STACKTOP = sp;return;
  13231. }
  13232. } while(0);
  13233. $52 = (((($4)) + 4|0) + ($$093$lcssa<<3)|0);
  13234. $53 = $52;
  13235. $54 = $53;
  13236. $55 = HEAP32[$54>>2]|0;
  13237. $56 = (($53) + 4)|0;
  13238. $57 = $56;
  13239. $58 = HEAP32[$57>>2]|0;
  13240. $59 = $6;
  13241. $60 = $59;
  13242. HEAP32[$60>>2] = $55;
  13243. $61 = (($59) + 4)|0;
  13244. $62 = $61;
  13245. HEAP32[$62>>2] = $58;
  13246. $63 = (($$093$lcssa) + 1)|0;
  13247. $64 = HEAP32[$4>>2]|0;
  13248. $65 = ($63>>>0)<($64>>>0);
  13249. $66 = $65 ? $63 : 0;
  13250. $67 = (((($4)) + 4|0) + ($66<<3)|0);
  13251. $68 = $67;
  13252. $69 = $68;
  13253. $70 = HEAP32[$69>>2]|0;
  13254. $71 = (($68) + 4)|0;
  13255. $72 = $71;
  13256. $73 = HEAP32[$72>>2]|0;
  13257. $74 = $7;
  13258. $75 = $74;
  13259. HEAP32[$75>>2] = $70;
  13260. $76 = (($74) + 4)|0;
  13261. $77 = $76;
  13262. HEAP32[$77>>2] = $73;
  13263. $78 = $$0$lcssa < 9.9999999747524271E-7;
  13264. do {
  13265. if ($78) {
  13266. HEAP32[$25>>2] = 1;
  13267. $79 = ((($4)) + 388|0);
  13268. $80 = (((($4)) + 196|0) + ($$093$lcssa<<3)|0);
  13269. ;HEAP32[$$byval_copy41>>2]=HEAP32[$79>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$79+4>>2]|0;HEAP32[$$byval_copy41+8>>2]=HEAP32[$79+8>>2]|0;HEAP32[$$byval_copy41+12>>2]=HEAP32[$79+12>>2]|0;
  13270. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$80>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$80+4>>2]|0;
  13271. _Mat2MultiplyVector2($8,$$byval_copy41,$tmpcast104$byval_copy42);
  13272. $81 = +HEAPF32[$8>>2];
  13273. $82 = -$81;
  13274. $83 = ((($8)) + 4|0);
  13275. $84 = +HEAPF32[$83>>2];
  13276. $85 = -$84;
  13277. $$sroa$014$0$$sroa_idx = ((($0)) + 16|0);
  13278. HEAPF32[$$sroa$014$0$$sroa_idx>>2] = $82;
  13279. $$sroa$215$0$$sroa_idx16 = ((($0)) + 20|0);
  13280. HEAPF32[$$sroa$215$0$$sroa_idx16>>2] = $85;
  13281. $86 = ((($22)) + 92|0);
  13282. $87 = +HEAPF32[$86>>2];
  13283. $88 = $87 * $82;
  13284. $89 = +HEAPF32[$26>>2];
  13285. $90 = $88 + $89;
  13286. $91 = $87 * $85;
  13287. $92 = ((($22)) + 12|0);
  13288. $93 = +HEAPF32[$92>>2];
  13289. $94 = $91 + $93;
  13290. $$sroa$011$0$$sroa_idx = ((($0)) + 24|0);
  13291. HEAPF32[$$sroa$011$0$$sroa_idx>>2] = $90;
  13292. $$sroa$212$0$$sroa_idx13 = ((($0)) + 28|0);
  13293. HEAPF32[$$sroa$212$0$$sroa_idx13>>2] = $94;
  13294. $95 = HEAP32[$86>>2]|0;
  13295. $96 = ((($0)) + 12|0);
  13296. HEAP32[$96>>2] = $95;
  13297. } else {
  13298. ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
  13299. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$6>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$6+4>>2]|0;
  13300. _Vector2Subtract_4($9,$$byval_copy41,$tmpcast104$byval_copy42);
  13301. ;HEAP32[$$byval_copy41>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$7+4>>2]|0;
  13302. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$6>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$6+4>>2]|0;
  13303. _Vector2Subtract_4($10,$$byval_copy41,$tmpcast104$byval_copy42);
  13304. ;HEAP32[$$byval_copy41>>2]=HEAP32[$9>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$9+4>>2]|0;
  13305. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$10>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$10+4>>2]|0;
  13306. $97 = (+_MathDot($$byval_copy41,$tmpcast104$byval_copy42));
  13307. ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
  13308. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$7>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$7+4>>2]|0;
  13309. _Vector2Subtract_4($11,$$byval_copy41,$tmpcast104$byval_copy42);
  13310. ;HEAP32[$$byval_copy41>>2]=HEAP32[$6>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$6+4>>2]|0;
  13311. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$7>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$7+4>>2]|0;
  13312. _Vector2Subtract_4($12,$$byval_copy41,$tmpcast104$byval_copy42);
  13313. ;HEAP32[$$byval_copy41>>2]=HEAP32[$11>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$11+4>>2]|0;
  13314. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$12>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$12+4>>2]|0;
  13315. $98 = (+_MathDot($$byval_copy41,$tmpcast104$byval_copy42));
  13316. $99 = ((($22)) + 92|0);
  13317. $100 = +HEAPF32[$99>>2];
  13318. $101 = $100 - $$0$lcssa;
  13319. $102 = ((($0)) + 12|0);
  13320. HEAPF32[$102>>2] = $101;
  13321. $103 = !($97 <= 0.0);
  13322. if (!($103)) {
  13323. ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
  13324. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$6>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$6+4>>2]|0;
  13325. $104 = (+_DistSqr($$byval_copy41,$tmpcast104$byval_copy42));
  13326. $105 = +HEAPF32[$99>>2];
  13327. $106 = $105 * $105;
  13328. $107 = $104 > $106;
  13329. if ($107) {
  13330. break;
  13331. }
  13332. HEAP32[$25>>2] = 1;
  13333. ;HEAP32[$$byval_copy41>>2]=HEAP32[$6>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$6+4>>2]|0;
  13334. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$1+4>>2]|0;
  13335. _Vector2Subtract_4($8,$$byval_copy41,$tmpcast104$byval_copy42);
  13336. $108 = ((($4)) + 388|0);
  13337. ;HEAP32[$$byval_copy41>>2]=HEAP32[$108>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$108+4>>2]|0;HEAP32[$$byval_copy41+8>>2]=HEAP32[$108+8>>2]|0;HEAP32[$$byval_copy41+12>>2]=HEAP32[$108+12>>2]|0;
  13338. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$8>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$8+4>>2]|0;
  13339. _Mat2MultiplyVector2($13,$$byval_copy41,$tmpcast104$byval_copy42);
  13340. $109 = $13;
  13341. $110 = $109;
  13342. $111 = HEAP32[$110>>2]|0;
  13343. $112 = (($109) + 4)|0;
  13344. $113 = $112;
  13345. $114 = HEAP32[$113>>2]|0;
  13346. $115 = $8;
  13347. $116 = $115;
  13348. HEAP32[$116>>2] = $111;
  13349. $117 = (($115) + 4)|0;
  13350. $118 = $117;
  13351. HEAP32[$118>>2] = $114;
  13352. _MathNormalize($8);
  13353. $119 = ((($0)) + 16|0);
  13354. $120 = $8;
  13355. $121 = $120;
  13356. $122 = HEAP32[$121>>2]|0;
  13357. $123 = (($120) + 4)|0;
  13358. $124 = $123;
  13359. $125 = HEAP32[$124>>2]|0;
  13360. $126 = $119;
  13361. $127 = $126;
  13362. HEAP32[$127>>2] = $122;
  13363. $128 = (($126) + 4)|0;
  13364. $129 = $128;
  13365. HEAP32[$129>>2] = $125;
  13366. ;HEAP32[$$byval_copy41>>2]=HEAP32[$108>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$108+4>>2]|0;HEAP32[$$byval_copy41+8>>2]=HEAP32[$108+8>>2]|0;HEAP32[$$byval_copy41+12>>2]=HEAP32[$108+12>>2]|0;
  13367. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$6>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$6+4>>2]|0;
  13368. _Mat2MultiplyVector2($14,$$byval_copy41,$tmpcast104$byval_copy42);
  13369. $130 = $14;
  13370. $131 = $130;
  13371. $132 = HEAP32[$131>>2]|0;
  13372. $133 = (($130) + 4)|0;
  13373. $134 = $133;
  13374. $135 = HEAP32[$134>>2]|0;
  13375. $136 = $6;
  13376. $137 = $136;
  13377. HEAP32[$137>>2] = $132;
  13378. $138 = (($136) + 4)|0;
  13379. $139 = $138;
  13380. HEAP32[$139>>2] = $135;
  13381. ;HEAP32[$$byval_copy41>>2]=HEAP32[$6>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$6+4>>2]|0;
  13382. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$39>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$39+4>>2]|0;
  13383. _Vector2Add_2($15,$$byval_copy41,$tmpcast104$byval_copy42);
  13384. $140 = $15;
  13385. $141 = $140;
  13386. $142 = HEAP32[$141>>2]|0;
  13387. $143 = (($140) + 4)|0;
  13388. $144 = $143;
  13389. $145 = HEAP32[$144>>2]|0;
  13390. $146 = $6;
  13391. $147 = $146;
  13392. HEAP32[$147>>2] = $142;
  13393. $148 = (($146) + 4)|0;
  13394. $149 = $148;
  13395. HEAP32[$149>>2] = $145;
  13396. $150 = ((($0)) + 24|0);
  13397. $151 = $150;
  13398. $152 = $151;
  13399. HEAP32[$152>>2] = $142;
  13400. $153 = (($151) + 4)|0;
  13401. $154 = $153;
  13402. HEAP32[$154>>2] = $145;
  13403. break;
  13404. }
  13405. $155 = !($98 <= 0.0);
  13406. if (!($155)) {
  13407. ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
  13408. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$7>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$7+4>>2]|0;
  13409. $156 = (+_DistSqr($$byval_copy41,$tmpcast104$byval_copy42));
  13410. $157 = +HEAPF32[$99>>2];
  13411. $158 = $157 * $157;
  13412. $159 = $156 > $158;
  13413. if ($159) {
  13414. break;
  13415. }
  13416. HEAP32[$25>>2] = 1;
  13417. ;HEAP32[$$byval_copy41>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$7+4>>2]|0;
  13418. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$1+4>>2]|0;
  13419. _Vector2Subtract_4($8,$$byval_copy41,$tmpcast104$byval_copy42);
  13420. $160 = ((($4)) + 388|0);
  13421. ;HEAP32[$$byval_copy41>>2]=HEAP32[$160>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$160+4>>2]|0;HEAP32[$$byval_copy41+8>>2]=HEAP32[$160+8>>2]|0;HEAP32[$$byval_copy41+12>>2]=HEAP32[$160+12>>2]|0;
  13422. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$7>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$7+4>>2]|0;
  13423. _Mat2MultiplyVector2($16,$$byval_copy41,$tmpcast104$byval_copy42);
  13424. $161 = $16;
  13425. $162 = $161;
  13426. $163 = HEAP32[$162>>2]|0;
  13427. $164 = (($161) + 4)|0;
  13428. $165 = $164;
  13429. $166 = HEAP32[$165>>2]|0;
  13430. $167 = $7;
  13431. $168 = $167;
  13432. HEAP32[$168>>2] = $163;
  13433. $169 = (($167) + 4)|0;
  13434. $170 = $169;
  13435. HEAP32[$170>>2] = $166;
  13436. ;HEAP32[$$byval_copy41>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$7+4>>2]|0;
  13437. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$39>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$39+4>>2]|0;
  13438. _Vector2Add_2($17,$$byval_copy41,$tmpcast104$byval_copy42);
  13439. $171 = $17;
  13440. $172 = $171;
  13441. $173 = HEAP32[$172>>2]|0;
  13442. $174 = (($171) + 4)|0;
  13443. $175 = $174;
  13444. $176 = HEAP32[$175>>2]|0;
  13445. $177 = $7;
  13446. $178 = $177;
  13447. HEAP32[$178>>2] = $173;
  13448. $179 = (($177) + 4)|0;
  13449. $180 = $179;
  13450. HEAP32[$180>>2] = $176;
  13451. $181 = ((($0)) + 24|0);
  13452. $182 = $181;
  13453. $183 = $182;
  13454. HEAP32[$183>>2] = $173;
  13455. $184 = (($182) + 4)|0;
  13456. $185 = $184;
  13457. HEAP32[$185>>2] = $176;
  13458. ;HEAP32[$$byval_copy41>>2]=HEAP32[$160>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$160+4>>2]|0;HEAP32[$$byval_copy41+8>>2]=HEAP32[$160+8>>2]|0;HEAP32[$$byval_copy41+12>>2]=HEAP32[$160+12>>2]|0;
  13459. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$8>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$8+4>>2]|0;
  13460. _Mat2MultiplyVector2($18,$$byval_copy41,$tmpcast104$byval_copy42);
  13461. $186 = $18;
  13462. $187 = $186;
  13463. $188 = HEAP32[$187>>2]|0;
  13464. $189 = (($186) + 4)|0;
  13465. $190 = $189;
  13466. $191 = HEAP32[$190>>2]|0;
  13467. $192 = $8;
  13468. $193 = $192;
  13469. HEAP32[$193>>2] = $188;
  13470. $194 = (($192) + 4)|0;
  13471. $195 = $194;
  13472. HEAP32[$195>>2] = $191;
  13473. _MathNormalize($8);
  13474. $196 = ((($0)) + 16|0);
  13475. $197 = $8;
  13476. $198 = $197;
  13477. $199 = HEAP32[$198>>2]|0;
  13478. $200 = (($197) + 4)|0;
  13479. $201 = $200;
  13480. $202 = HEAP32[$201>>2]|0;
  13481. $203 = $196;
  13482. $204 = $203;
  13483. HEAP32[$204>>2] = $199;
  13484. $205 = (($203) + 4)|0;
  13485. $206 = $205;
  13486. HEAP32[$206>>2] = $202;
  13487. break;
  13488. }
  13489. $207 = (((($4)) + 196|0) + ($$093$lcssa<<3)|0);
  13490. $208 = $207;
  13491. $209 = $208;
  13492. $210 = HEAP32[$209>>2]|0;
  13493. $211 = (($208) + 4)|0;
  13494. $212 = $211;
  13495. $213 = HEAP32[$212>>2]|0;
  13496. $214 = $8;
  13497. $215 = $214;
  13498. HEAP32[$215>>2] = $210;
  13499. $216 = (($214) + 4)|0;
  13500. $217 = $216;
  13501. HEAP32[$217>>2] = $213;
  13502. ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
  13503. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$6>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$6+4>>2]|0;
  13504. _Vector2Subtract_4($19,$$byval_copy41,$tmpcast104$byval_copy42);
  13505. ;HEAP32[$$byval_copy41>>2]=HEAP32[$19>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$19+4>>2]|0;
  13506. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$8>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$8+4>>2]|0;
  13507. $218 = (+_MathDot($$byval_copy41,$tmpcast104$byval_copy42));
  13508. $219 = +HEAPF32[$99>>2];
  13509. $220 = $218 > $219;
  13510. if ($220) {
  13511. break;
  13512. } else {
  13513. $221 = ((($4)) + 388|0);
  13514. ;HEAP32[$$byval_copy41>>2]=HEAP32[$221>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$221+4>>2]|0;HEAP32[$$byval_copy41+8>>2]=HEAP32[$221+8>>2]|0;HEAP32[$$byval_copy41+12>>2]=HEAP32[$221+12>>2]|0;
  13515. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$8>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$8+4>>2]|0;
  13516. _Mat2MultiplyVector2($20,$$byval_copy41,$tmpcast104$byval_copy42);
  13517. $222 = $20;
  13518. $223 = $222;
  13519. $224 = HEAP32[$223>>2]|0;
  13520. $225 = (($222) + 4)|0;
  13521. $226 = $225;
  13522. $227 = HEAP32[$226>>2]|0;
  13523. $228 = $8;
  13524. $229 = $228;
  13525. HEAP32[$229>>2] = $224;
  13526. $230 = (($228) + 4)|0;
  13527. $231 = $230;
  13528. HEAP32[$231>>2] = $227;
  13529. $232 = +HEAPF32[$8>>2];
  13530. $233 = -$232;
  13531. $234 = ((($8)) + 4|0);
  13532. $235 = +HEAPF32[$234>>2];
  13533. $236 = -$235;
  13534. $$sroa$04$0$$sroa_idx = ((($0)) + 16|0);
  13535. HEAPF32[$$sroa$04$0$$sroa_idx>>2] = $233;
  13536. $$sroa$25$0$$sroa_idx6 = ((($0)) + 20|0);
  13537. HEAPF32[$$sroa$25$0$$sroa_idx6>>2] = $236;
  13538. $237 = +HEAPF32[$99>>2];
  13539. $238 = $237 * $233;
  13540. $239 = +HEAPF32[$26>>2];
  13541. $240 = $238 + $239;
  13542. $241 = $237 * $236;
  13543. $242 = ((($22)) + 12|0);
  13544. $243 = +HEAPF32[$242>>2];
  13545. $244 = $241 + $243;
  13546. $$sroa$0$0$$sroa_idx = ((($0)) + 24|0);
  13547. HEAPF32[$$sroa$0$0$$sroa_idx>>2] = $240;
  13548. $$sroa$2$0$$sroa_idx3 = ((($0)) + 28|0);
  13549. HEAPF32[$$sroa$2$0$$sroa_idx3>>2] = $244;
  13550. HEAP32[$25>>2] = 1;
  13551. break;
  13552. }
  13553. }
  13554. } while(0);
  13555. STACKTOP = sp;return;
  13556. }
  13557. function _SolvePolygonToCircle($0) {
  13558. $0 = $0|0;
  13559. var $1 = 0, $10 = 0.0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0.0, $7 = 0.0, $8 = 0, $9 = 0.0, label = 0, sp = 0;
  13560. sp = STACKTOP;
  13561. $1 = ((($0)) + 4|0);
  13562. $2 = HEAP32[$1>>2]|0;
  13563. $3 = ((($0)) + 8|0);
  13564. $4 = HEAP32[$3>>2]|0;
  13565. HEAP32[$1>>2] = $4;
  13566. HEAP32[$3>>2] = $2;
  13567. _SolveCircleToPolygon($0);
  13568. $5 = ((($0)) + 16|0);
  13569. $6 = +HEAPF32[$5>>2];
  13570. $7 = -$6;
  13571. HEAPF32[$5>>2] = $7;
  13572. $8 = ((($0)) + 20|0);
  13573. $9 = +HEAPF32[$8>>2];
  13574. $10 = -$9;
  13575. HEAPF32[$8>>2] = $10;
  13576. return;
  13577. }
  13578. function _SolvePolygonToPolygon($0) {
  13579. $0 = $0|0;
  13580. var $$0 = 0, $$051 = 0, $$051$in = 0, $$052 = 0, $$1 = 0, $$byval_copy24 = 0, $$sink = 0.0, $$sroa$0$0$$sroa_idx = 0, $$sroa$2$0$$sroa_idx12 = 0, $1 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0.0;
  13581. var $109 = 0.0, $11 = 0, $110 = 0.0, $111 = 0.0, $112 = 0.0, $113 = 0.0, $114 = 0.0, $115 = 0.0, $116 = 0, $117 = 0.0, $118 = 0.0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0.0, $125 = 0.0, $126 = 0.0;
  13582. var $127 = 0.0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0, $133 = 0, $134 = 0, $135 = 0, $136 = 0, $137 = 0, $138 = 0, $139 = 0.0, $14 = 0, $140 = 0.0, $141 = 0, $142 = 0.0, $143 = 0, $144 = 0;
  13583. var $145 = 0, $146 = 0, $147 = 0, $148 = 0, $149 = 0, $15 = 0, $150 = 0, $151 = 0, $152 = 0, $153 = 0, $154 = 0, $155 = 0.0, $156 = 0.0, $157 = 0, $158 = 0, $159 = 0, $16 = 0, $160 = 0, $161 = 0, $162 = 0;
  13584. var $163 = 0, $164 = 0, $165 = 0, $166 = 0, $167 = 0, $168 = 0, $169 = 0.0, $17 = 0, $170 = 0.0, $171 = 0, $172 = 0.0, $173 = 0.0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0;
  13585. var $25 = 0.0, $26 = 0, $27 = 0.0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0;
  13586. var $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0;
  13587. var $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0;
  13588. var $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0;
  13589. var $98 = 0, $99 = 0, $tmpcast58$byval_copy23 = 0, label = 0, sp = 0;
  13590. sp = STACKTOP;
  13591. STACKTOP = STACKTOP + 3008|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(3008|0);
  13592. $$byval_copy24 = sp + 2584|0;
  13593. $tmpcast58$byval_copy23 = sp + 2168|0;
  13594. $1 = sp + 1744|0;
  13595. $2 = sp + 1328|0;
  13596. $3 = sp + 1324|0;
  13597. $4 = sp + 1320|0;
  13598. $5 = sp + 904|0;
  13599. $6 = sp + 488|0;
  13600. $7 = sp + 24|0;
  13601. $8 = sp + 80|0;
  13602. $9 = sp + 16|0;
  13603. $10 = sp + 8|0;
  13604. $11 = sp + 64|0;
  13605. $12 = sp + 56|0;
  13606. $13 = sp + 48|0;
  13607. $14 = sp + 40|0;
  13608. $15 = sp + 72|0;
  13609. $16 = sp;
  13610. $17 = sp + 2160|0;
  13611. $18 = ((($0)) + 4|0);
  13612. $19 = HEAP32[$18>>2]|0;
  13613. $20 = ((($19)) + 84|0);
  13614. _memcpy(($1|0),($20|0),416)|0;
  13615. $21 = ((($0)) + 8|0);
  13616. $22 = HEAP32[$21>>2]|0;
  13617. $23 = ((($22)) + 84|0);
  13618. _memcpy(($2|0),($23|0),416)|0;
  13619. $24 = ((($0)) + 40|0);
  13620. HEAP32[$24>>2] = 0;
  13621. HEAP32[$3>>2] = 0;
  13622. _memcpy(($tmpcast58$byval_copy23|0),($1|0),416)|0;
  13623. _memcpy(($$byval_copy24|0),($2|0),416)|0;
  13624. $25 = (+_FindAxisLeastPenetration($3,$tmpcast58$byval_copy23,$$byval_copy24));
  13625. $26 = !($25 >= 0.0);
  13626. if (!($26)) {
  13627. STACKTOP = sp;return;
  13628. }
  13629. HEAP32[$4>>2] = 0;
  13630. _memcpy(($tmpcast58$byval_copy23|0),($2|0),416)|0;
  13631. _memcpy(($$byval_copy24|0),($1|0),416)|0;
  13632. $27 = (+_FindAxisLeastPenetration($4,$tmpcast58$byval_copy23,$$byval_copy24));
  13633. $28 = !($27 >= 0.0);
  13634. if ($28) {
  13635. $29 = (_BiasGreaterThan($25,$27)|0);
  13636. $30 = ($29|0)==(0);
  13637. if ($30) {
  13638. _memcpy(($5|0),($2|0),416)|0;
  13639. _memcpy(($6|0),($1|0),416)|0;
  13640. $$051$in = $4;$$052 = 1;
  13641. } else {
  13642. _memcpy(($5|0),($1|0),416)|0;
  13643. _memcpy(($6|0),($2|0),416)|0;
  13644. $$051$in = $3;$$052 = 0;
  13645. }
  13646. $$051 = HEAP32[$$051$in>>2]|0;
  13647. $31 = ((($7)) + 8|0);
  13648. _memcpy(($tmpcast58$byval_copy23|0),($5|0),416)|0;
  13649. _memcpy(($$byval_copy24|0),($6|0),416)|0;
  13650. _FindIncidentFace($7,$31,$tmpcast58$byval_copy23,$$byval_copy24,$$051);
  13651. $32 = ((($5)) + 12|0);
  13652. _memcpy(($8|0),($32|0),404)|0;
  13653. $33 = (((($8)) + 4|0) + ($$051<<3)|0);
  13654. $34 = $33;
  13655. $35 = $34;
  13656. $36 = HEAP32[$35>>2]|0;
  13657. $37 = (($34) + 4)|0;
  13658. $38 = $37;
  13659. $39 = HEAP32[$38>>2]|0;
  13660. $40 = $9;
  13661. $41 = $40;
  13662. HEAP32[$41>>2] = $36;
  13663. $42 = (($40) + 4)|0;
  13664. $43 = $42;
  13665. HEAP32[$43>>2] = $39;
  13666. $44 = (($$051) + 1)|0;
  13667. $45 = HEAP32[$8>>2]|0;
  13668. $46 = ($44>>>0)<($45>>>0);
  13669. $47 = $46 ? $44 : 0;
  13670. $48 = (((($8)) + 4|0) + ($47<<3)|0);
  13671. $49 = $48;
  13672. $50 = $49;
  13673. $51 = HEAP32[$50>>2]|0;
  13674. $52 = (($49) + 4)|0;
  13675. $53 = $52;
  13676. $54 = HEAP32[$53>>2]|0;
  13677. $55 = $10;
  13678. $56 = $55;
  13679. HEAP32[$56>>2] = $51;
  13680. $57 = (($55) + 4)|0;
  13681. $58 = $57;
  13682. HEAP32[$58>>2] = $54;
  13683. $59 = ((($8)) + 388|0);
  13684. ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$59>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$59+4>>2]|0;HEAP32[$tmpcast58$byval_copy23+8>>2]=HEAP32[$59+8>>2]|0;HEAP32[$tmpcast58$byval_copy23+12>>2]=HEAP32[$59+12>>2]|0;
  13685. ;HEAP32[$$byval_copy24>>2]=HEAP32[$9>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$9+4>>2]|0;
  13686. _Mat2MultiplyVector2($11,$tmpcast58$byval_copy23,$$byval_copy24);
  13687. $60 = $11;
  13688. $61 = $60;
  13689. $62 = HEAP32[$61>>2]|0;
  13690. $63 = (($60) + 4)|0;
  13691. $64 = $63;
  13692. $65 = HEAP32[$64>>2]|0;
  13693. $66 = $9;
  13694. $67 = $66;
  13695. HEAP32[$67>>2] = $62;
  13696. $68 = (($66) + 4)|0;
  13697. $69 = $68;
  13698. HEAP32[$69>>2] = $65;
  13699. $70 = ((($5)) + 4|0);
  13700. $71 = HEAP32[$70>>2]|0;
  13701. $72 = ((($71)) + 8|0);
  13702. ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$9>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$9+4>>2]|0;
  13703. ;HEAP32[$$byval_copy24>>2]=HEAP32[$72>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$72+4>>2]|0;
  13704. _Vector2Add_2($12,$tmpcast58$byval_copy23,$$byval_copy24);
  13705. $73 = $12;
  13706. $74 = $73;
  13707. $75 = HEAP32[$74>>2]|0;
  13708. $76 = (($73) + 4)|0;
  13709. $77 = $76;
  13710. $78 = HEAP32[$77>>2]|0;
  13711. $79 = $9;
  13712. $80 = $79;
  13713. HEAP32[$80>>2] = $75;
  13714. $81 = (($79) + 4)|0;
  13715. $82 = $81;
  13716. HEAP32[$82>>2] = $78;
  13717. ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$59>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$59+4>>2]|0;HEAP32[$tmpcast58$byval_copy23+8>>2]=HEAP32[$59+8>>2]|0;HEAP32[$tmpcast58$byval_copy23+12>>2]=HEAP32[$59+12>>2]|0;
  13718. ;HEAP32[$$byval_copy24>>2]=HEAP32[$10>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$10+4>>2]|0;
  13719. _Mat2MultiplyVector2($13,$tmpcast58$byval_copy23,$$byval_copy24);
  13720. $83 = $13;
  13721. $84 = $83;
  13722. $85 = HEAP32[$84>>2]|0;
  13723. $86 = (($83) + 4)|0;
  13724. $87 = $86;
  13725. $88 = HEAP32[$87>>2]|0;
  13726. $89 = $10;
  13727. $90 = $89;
  13728. HEAP32[$90>>2] = $85;
  13729. $91 = (($89) + 4)|0;
  13730. $92 = $91;
  13731. HEAP32[$92>>2] = $88;
  13732. $93 = HEAP32[$70>>2]|0;
  13733. $94 = ((($93)) + 8|0);
  13734. ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$10>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$10+4>>2]|0;
  13735. ;HEAP32[$$byval_copy24>>2]=HEAP32[$94>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$94+4>>2]|0;
  13736. _Vector2Add_2($14,$tmpcast58$byval_copy23,$$byval_copy24);
  13737. $95 = $14;
  13738. $96 = $95;
  13739. $97 = HEAP32[$96>>2]|0;
  13740. $98 = (($95) + 4)|0;
  13741. $99 = $98;
  13742. $100 = HEAP32[$99>>2]|0;
  13743. $101 = $10;
  13744. $102 = $101;
  13745. HEAP32[$102>>2] = $97;
  13746. $103 = (($101) + 4)|0;
  13747. $104 = $103;
  13748. HEAP32[$104>>2] = $100;
  13749. ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$10>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$10+4>>2]|0;
  13750. ;HEAP32[$$byval_copy24>>2]=HEAP32[$9>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$9+4>>2]|0;
  13751. _Vector2Subtract_4($15,$tmpcast58$byval_copy23,$$byval_copy24);
  13752. _MathNormalize($15);
  13753. $105 = ((($15)) + 4|0);
  13754. $106 = HEAP32[$105>>2]|0;
  13755. HEAP32[$16>>2] = $106;
  13756. $107 = ((($16)) + 4|0);
  13757. $108 = +HEAPF32[$15>>2];
  13758. $109 = -$108;
  13759. HEAPF32[$107>>2] = $109;
  13760. ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$16>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$16+4>>2]|0;
  13761. ;HEAP32[$$byval_copy24>>2]=HEAP32[$9>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$9+4>>2]|0;
  13762. $110 = (+_MathDot($tmpcast58$byval_copy23,$$byval_copy24));
  13763. ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$15>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$15+4>>2]|0;
  13764. ;HEAP32[$$byval_copy24>>2]=HEAP32[$9>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$9+4>>2]|0;
  13765. $111 = (+_MathDot($tmpcast58$byval_copy23,$$byval_copy24));
  13766. $112 = -$111;
  13767. ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$15>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$15+4>>2]|0;
  13768. ;HEAP32[$$byval_copy24>>2]=HEAP32[$10>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$10+4>>2]|0;
  13769. $113 = (+_MathDot($tmpcast58$byval_copy23,$$byval_copy24));
  13770. $114 = +HEAPF32[$15>>2];
  13771. $115 = -$114;
  13772. HEAPF32[$17>>2] = $115;
  13773. $116 = ((($17)) + 4|0);
  13774. $117 = +HEAPF32[$105>>2];
  13775. $118 = -$117;
  13776. HEAPF32[$116>>2] = $118;
  13777. ;HEAP32[$$byval_copy24>>2]=HEAP32[$17>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$17+4>>2]|0;
  13778. $119 = (_Clip($$byval_copy24,$112,$7,$31)|0);
  13779. $120 = ($119|0)<(2);
  13780. if (!($120)) {
  13781. ;HEAP32[$$byval_copy24>>2]=HEAP32[$15>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$15+4>>2]|0;
  13782. $121 = (_Clip($$byval_copy24,$113,$7,$31)|0);
  13783. $122 = ($121|0)<(2);
  13784. if (!($122)) {
  13785. $123 = ($$052|0)==(0);
  13786. if ($123) {
  13787. $128 = ((($0)) + 16|0);
  13788. $129 = $16;
  13789. $130 = $129;
  13790. $131 = HEAP32[$130>>2]|0;
  13791. $132 = (($129) + 4)|0;
  13792. $133 = $132;
  13793. $134 = HEAP32[$133>>2]|0;
  13794. $135 = $128;
  13795. $136 = $135;
  13796. HEAP32[$136>>2] = $131;
  13797. $137 = (($135) + 4)|0;
  13798. $138 = $137;
  13799. HEAP32[$138>>2] = $134;
  13800. } else {
  13801. $124 = +HEAPF32[$16>>2];
  13802. $125 = -$124;
  13803. $126 = +HEAPF32[$107>>2];
  13804. $127 = -$126;
  13805. $$sroa$0$0$$sroa_idx = ((($0)) + 16|0);
  13806. HEAPF32[$$sroa$0$0$$sroa_idx>>2] = $125;
  13807. $$sroa$2$0$$sroa_idx12 = ((($0)) + 20|0);
  13808. HEAPF32[$$sroa$2$0$$sroa_idx12>>2] = $127;
  13809. }
  13810. ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$16>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$16+4>>2]|0;
  13811. ;HEAP32[$$byval_copy24>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$7+4>>2]|0;
  13812. $139 = (+_MathDot($tmpcast58$byval_copy23,$$byval_copy24));
  13813. $140 = $139 - $110;
  13814. $141 = !($140 <= 0.0);
  13815. if ($141) {
  13816. $$0 = 0;$$sink = 0.0;
  13817. } else {
  13818. $142 = -$140;
  13819. $143 = ((($0)) + 24|0);
  13820. $144 = $7;
  13821. $145 = $144;
  13822. $146 = HEAP32[$145>>2]|0;
  13823. $147 = (($144) + 4)|0;
  13824. $148 = $147;
  13825. $149 = HEAP32[$148>>2]|0;
  13826. $150 = $143;
  13827. $151 = $150;
  13828. HEAP32[$151>>2] = $146;
  13829. $152 = (($150) + 4)|0;
  13830. $153 = $152;
  13831. HEAP32[$153>>2] = $149;
  13832. $$0 = 1;$$sink = $142;
  13833. }
  13834. $154 = ((($0)) + 12|0);
  13835. HEAPF32[$154>>2] = $$sink;
  13836. ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$16>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$16+4>>2]|0;
  13837. ;HEAP32[$$byval_copy24>>2]=HEAP32[$31>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$31+4>>2]|0;
  13838. $155 = (+_MathDot($tmpcast58$byval_copy23,$$byval_copy24));
  13839. $156 = $155 - $110;
  13840. $157 = !($156 <= 0.0);
  13841. if ($157) {
  13842. $$1 = $$0;
  13843. } else {
  13844. $158 = (((($0)) + 24|0) + ($$0<<3)|0);
  13845. $159 = $31;
  13846. $160 = $159;
  13847. $161 = HEAP32[$160>>2]|0;
  13848. $162 = (($159) + 4)|0;
  13849. $163 = $162;
  13850. $164 = HEAP32[$163>>2]|0;
  13851. $165 = $158;
  13852. $166 = $165;
  13853. HEAP32[$166>>2] = $161;
  13854. $167 = (($165) + 4)|0;
  13855. $168 = $167;
  13856. HEAP32[$168>>2] = $164;
  13857. $169 = +HEAPF32[$154>>2];
  13858. $170 = $169 - $156;
  13859. $171 = (($$0) + 1)|0;
  13860. $172 = (+($171|0));
  13861. $173 = $170 / $172;
  13862. HEAPF32[$154>>2] = $173;
  13863. $$1 = $171;
  13864. }
  13865. HEAP32[$24>>2] = $$1;
  13866. }
  13867. }
  13868. }
  13869. STACKTOP = sp;return;
  13870. }
  13871. function _MathLenSqr($0) {
  13872. $0 = $0|0;
  13873. var $1 = 0.0, $2 = 0.0, $3 = 0, $4 = 0.0, $5 = 0.0, $6 = 0.0, label = 0, sp = 0;
  13874. sp = STACKTOP;
  13875. $1 = +HEAPF32[$0>>2];
  13876. $2 = $1 * $1;
  13877. $3 = ((($0)) + 4|0);
  13878. $4 = +HEAPF32[$3>>2];
  13879. $5 = $4 * $4;
  13880. $6 = $2 + $5;
  13881. return (+$6);
  13882. }
  13883. function _Mat2Transpose($0,$1) {
  13884. $0 = $0|0;
  13885. $1 = $1|0;
  13886. var $10 = 0, $11 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  13887. sp = STACKTOP;
  13888. $2 = HEAP32[$1>>2]|0;
  13889. HEAP32[$0>>2] = $2;
  13890. $3 = ((($0)) + 4|0);
  13891. $4 = ((($1)) + 8|0);
  13892. $5 = HEAP32[$4>>2]|0;
  13893. HEAP32[$3>>2] = $5;
  13894. $6 = ((($0)) + 8|0);
  13895. $7 = ((($1)) + 4|0);
  13896. $8 = HEAP32[$7>>2]|0;
  13897. HEAP32[$6>>2] = $8;
  13898. $9 = ((($0)) + 12|0);
  13899. $10 = ((($1)) + 12|0);
  13900. $11 = HEAP32[$10>>2]|0;
  13901. HEAP32[$9>>2] = $11;
  13902. return;
  13903. }
  13904. function _MathDot($0,$1) {
  13905. $0 = $0|0;
  13906. $1 = $1|0;
  13907. var $10 = 0.0, $2 = 0.0, $3 = 0.0, $4 = 0.0, $5 = 0, $6 = 0.0, $7 = 0, $8 = 0.0, $9 = 0.0, label = 0, sp = 0;
  13908. sp = STACKTOP;
  13909. $2 = +HEAPF32[$0>>2];
  13910. $3 = +HEAPF32[$1>>2];
  13911. $4 = $2 * $3;
  13912. $5 = ((($0)) + 4|0);
  13913. $6 = +HEAPF32[$5>>2];
  13914. $7 = ((($1)) + 4|0);
  13915. $8 = +HEAPF32[$7>>2];
  13916. $9 = $6 * $8;
  13917. $10 = $4 + $9;
  13918. return (+$10);
  13919. }
  13920. function _DistSqr($0,$1) {
  13921. $0 = $0|0;
  13922. $1 = $1|0;
  13923. var $$byval_copy2 = 0, $$byval_copy3 = 0, $2 = 0, $3 = 0.0, label = 0, sp = 0;
  13924. sp = STACKTOP;
  13925. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  13926. $$byval_copy3 = sp + 16|0;
  13927. $$byval_copy2 = sp + 8|0;
  13928. $2 = sp;
  13929. ;HEAP32[$$byval_copy2>>2]=HEAP32[$0>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$0+4>>2]|0;
  13930. ;HEAP32[$$byval_copy3>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy3+4>>2]=HEAP32[$1+4>>2]|0;
  13931. _Vector2Subtract_4($2,$$byval_copy2,$$byval_copy3);
  13932. ;HEAP32[$$byval_copy2>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$2+4>>2]|0;
  13933. ;HEAP32[$$byval_copy3>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy3+4>>2]=HEAP32[$2+4>>2]|0;
  13934. $3 = (+_MathDot($$byval_copy2,$$byval_copy3));
  13935. STACKTOP = sp;return (+$3);
  13936. }
  13937. function _FindAxisLeastPenetration($0,$1,$2) {
  13938. $0 = $0|0;
  13939. $1 = $1|0;
  13940. $2 = $2|0;
  13941. var $$0$lcssa = 0.0, $$01727 = 0, $$018$lcssa = 0, $$01826 = 0, $$028 = 0.0, $$1 = 0.0, $$119 = 0, $$byval_copy16 = 0, $10 = 0, $100 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0;
  13942. var $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0.0, $38 = 0.0, $39 = 0.0;
  13943. var $4 = 0, $40 = 0.0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0;
  13944. var $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0;
  13945. var $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0;
  13946. var $94 = 0, $95 = 0, $96 = 0.0, $97 = 0, $98 = 0, $99 = 0, $tmpcast$byval_copy15 = 0, label = 0, sp = 0;
  13947. sp = STACKTOP;
  13948. STACKTOP = STACKTOP + 1344|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(1344|0);
  13949. $$byval_copy16 = sp + 1320|0;
  13950. $tmpcast$byval_copy15 = sp + 904|0;
  13951. $3 = sp + 484|0;
  13952. $4 = sp + 80|0;
  13953. $5 = sp + 8|0;
  13954. $6 = sp + 72|0;
  13955. $7 = sp + 56|0;
  13956. $8 = sp + 48|0;
  13957. $9 = sp + 896|0;
  13958. $10 = sp;
  13959. $11 = sp + 40|0;
  13960. $12 = sp + 32|0;
  13961. $13 = sp + 24|0;
  13962. $14 = sp + 16|0;
  13963. $15 = sp + 888|0;
  13964. $16 = ((($1)) + 12|0);
  13965. _memcpy(($3|0),($16|0),404)|0;
  13966. $17 = ((($2)) + 12|0);
  13967. _memcpy(($4|0),($17|0),404)|0;
  13968. $18 = HEAP32[$3>>2]|0;
  13969. $19 = ($18|0)==(0);
  13970. if ($19) {
  13971. $$0$lcssa = -3.4028234663852886E+38;$$018$lcssa = 0;
  13972. HEAP32[$0>>2] = $$018$lcssa;
  13973. STACKTOP = sp;return (+$$0$lcssa);
  13974. }
  13975. $20 = ((($3)) + 388|0);
  13976. $21 = ((($4)) + 388|0);
  13977. $22 = ((($9)) + 4|0);
  13978. $23 = ((($5)) + 4|0);
  13979. $24 = ((($1)) + 4|0);
  13980. $25 = ((($2)) + 4|0);
  13981. $$01727 = 0;$$01826 = 0;$$028 = -3.4028234663852886E+38;
  13982. while(1) {
  13983. $26 = (((($3)) + 196|0) + ($$01727<<3)|0);
  13984. $27 = $26;
  13985. $28 = $27;
  13986. $29 = HEAP32[$28>>2]|0;
  13987. $30 = (($27) + 4)|0;
  13988. $31 = $30;
  13989. $32 = HEAP32[$31>>2]|0;
  13990. $33 = $5;
  13991. $34 = $33;
  13992. HEAP32[$34>>2] = $29;
  13993. $35 = (($33) + 4)|0;
  13994. $36 = $35;
  13995. HEAP32[$36>>2] = $32;
  13996. ;HEAP32[$tmpcast$byval_copy15>>2]=HEAP32[$20>>2]|0;HEAP32[$tmpcast$byval_copy15+4>>2]=HEAP32[$20+4>>2]|0;HEAP32[$tmpcast$byval_copy15+8>>2]=HEAP32[$20+8>>2]|0;HEAP32[$tmpcast$byval_copy15+12>>2]=HEAP32[$20+12>>2]|0;
  13997. ;HEAP32[$$byval_copy16>>2]=HEAP32[$5>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$5+4>>2]|0;
  13998. _Mat2MultiplyVector2($6,$tmpcast$byval_copy15,$$byval_copy16);
  13999. ;HEAP32[$$byval_copy16>>2]=HEAP32[$21>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$21+4>>2]|0;HEAP32[$$byval_copy16+8>>2]=HEAP32[$21+8>>2]|0;HEAP32[$$byval_copy16+12>>2]=HEAP32[$21+12>>2]|0;
  14000. _Mat2Transpose($7,$$byval_copy16);
  14001. ;HEAP32[$tmpcast$byval_copy15>>2]=HEAP32[$7>>2]|0;HEAP32[$tmpcast$byval_copy15+4>>2]=HEAP32[$7+4>>2]|0;HEAP32[$tmpcast$byval_copy15+8>>2]=HEAP32[$7+8>>2]|0;HEAP32[$tmpcast$byval_copy15+12>>2]=HEAP32[$7+12>>2]|0;
  14002. ;HEAP32[$$byval_copy16>>2]=HEAP32[$6>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$6+4>>2]|0;
  14003. _Mat2MultiplyVector2($5,$tmpcast$byval_copy15,$$byval_copy16);
  14004. $37 = +HEAPF32[$5>>2];
  14005. $38 = -$37;
  14006. HEAPF32[$9>>2] = $38;
  14007. $39 = +HEAPF32[$23>>2];
  14008. $40 = -$39;
  14009. HEAPF32[$22>>2] = $40;
  14010. _memcpy(($tmpcast$byval_copy15|0),($2|0),416)|0;
  14011. ;HEAP32[$$byval_copy16>>2]=HEAP32[$9>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$9+4>>2]|0;
  14012. _GetSupport($8,$tmpcast$byval_copy15,$$byval_copy16);
  14013. $41 = (((($3)) + 4|0) + ($$01727<<3)|0);
  14014. $42 = $41;
  14015. $43 = $42;
  14016. $44 = HEAP32[$43>>2]|0;
  14017. $45 = (($42) + 4)|0;
  14018. $46 = $45;
  14019. $47 = HEAP32[$46>>2]|0;
  14020. $48 = $10;
  14021. $49 = $48;
  14022. HEAP32[$49>>2] = $44;
  14023. $50 = (($48) + 4)|0;
  14024. $51 = $50;
  14025. HEAP32[$51>>2] = $47;
  14026. ;HEAP32[$tmpcast$byval_copy15>>2]=HEAP32[$20>>2]|0;HEAP32[$tmpcast$byval_copy15+4>>2]=HEAP32[$20+4>>2]|0;HEAP32[$tmpcast$byval_copy15+8>>2]=HEAP32[$20+8>>2]|0;HEAP32[$tmpcast$byval_copy15+12>>2]=HEAP32[$20+12>>2]|0;
  14027. ;HEAP32[$$byval_copy16>>2]=HEAP32[$10>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$10+4>>2]|0;
  14028. _Mat2MultiplyVector2($11,$tmpcast$byval_copy15,$$byval_copy16);
  14029. $52 = $11;
  14030. $53 = $52;
  14031. $54 = HEAP32[$53>>2]|0;
  14032. $55 = (($52) + 4)|0;
  14033. $56 = $55;
  14034. $57 = HEAP32[$56>>2]|0;
  14035. $58 = $10;
  14036. $59 = $58;
  14037. HEAP32[$59>>2] = $54;
  14038. $60 = (($58) + 4)|0;
  14039. $61 = $60;
  14040. HEAP32[$61>>2] = $57;
  14041. $62 = HEAP32[$24>>2]|0;
  14042. $63 = ((($62)) + 8|0);
  14043. ;HEAP32[$tmpcast$byval_copy15>>2]=HEAP32[$10>>2]|0;HEAP32[$tmpcast$byval_copy15+4>>2]=HEAP32[$10+4>>2]|0;
  14044. ;HEAP32[$$byval_copy16>>2]=HEAP32[$63>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$63+4>>2]|0;
  14045. _Vector2Add_2($12,$tmpcast$byval_copy15,$$byval_copy16);
  14046. $64 = $12;
  14047. $65 = $64;
  14048. $66 = HEAP32[$65>>2]|0;
  14049. $67 = (($64) + 4)|0;
  14050. $68 = $67;
  14051. $69 = HEAP32[$68>>2]|0;
  14052. $70 = $10;
  14053. $71 = $70;
  14054. HEAP32[$71>>2] = $66;
  14055. $72 = (($70) + 4)|0;
  14056. $73 = $72;
  14057. HEAP32[$73>>2] = $69;
  14058. $74 = HEAP32[$25>>2]|0;
  14059. $75 = ((($74)) + 8|0);
  14060. ;HEAP32[$tmpcast$byval_copy15>>2]=HEAP32[$10>>2]|0;HEAP32[$tmpcast$byval_copy15+4>>2]=HEAP32[$10+4>>2]|0;
  14061. ;HEAP32[$$byval_copy16>>2]=HEAP32[$75>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$75+4>>2]|0;
  14062. _Vector2Subtract_4($13,$tmpcast$byval_copy15,$$byval_copy16);
  14063. $76 = $13;
  14064. $77 = $76;
  14065. $78 = HEAP32[$77>>2]|0;
  14066. $79 = (($76) + 4)|0;
  14067. $80 = $79;
  14068. $81 = HEAP32[$80>>2]|0;
  14069. $82 = $10;
  14070. $83 = $82;
  14071. HEAP32[$83>>2] = $78;
  14072. $84 = (($82) + 4)|0;
  14073. $85 = $84;
  14074. HEAP32[$85>>2] = $81;
  14075. ;HEAP32[$tmpcast$byval_copy15>>2]=HEAP32[$7>>2]|0;HEAP32[$tmpcast$byval_copy15+4>>2]=HEAP32[$7+4>>2]|0;HEAP32[$tmpcast$byval_copy15+8>>2]=HEAP32[$7+8>>2]|0;HEAP32[$tmpcast$byval_copy15+12>>2]=HEAP32[$7+12>>2]|0;
  14076. ;HEAP32[$$byval_copy16>>2]=HEAP32[$10>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$10+4>>2]|0;
  14077. _Mat2MultiplyVector2($14,$tmpcast$byval_copy15,$$byval_copy16);
  14078. $86 = $14;
  14079. $87 = $86;
  14080. $88 = HEAP32[$87>>2]|0;
  14081. $89 = (($86) + 4)|0;
  14082. $90 = $89;
  14083. $91 = HEAP32[$90>>2]|0;
  14084. $92 = $10;
  14085. $93 = $92;
  14086. HEAP32[$93>>2] = $88;
  14087. $94 = (($92) + 4)|0;
  14088. $95 = $94;
  14089. HEAP32[$95>>2] = $91;
  14090. ;HEAP32[$tmpcast$byval_copy15>>2]=HEAP32[$8>>2]|0;HEAP32[$tmpcast$byval_copy15+4>>2]=HEAP32[$8+4>>2]|0;
  14091. ;HEAP32[$$byval_copy16>>2]=HEAP32[$10>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$10+4>>2]|0;
  14092. _Vector2Subtract_4($15,$tmpcast$byval_copy15,$$byval_copy16);
  14093. ;HEAP32[$tmpcast$byval_copy15>>2]=HEAP32[$5>>2]|0;HEAP32[$tmpcast$byval_copy15+4>>2]=HEAP32[$5+4>>2]|0;
  14094. ;HEAP32[$$byval_copy16>>2]=HEAP32[$15>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$15+4>>2]|0;
  14095. $96 = (+_MathDot($tmpcast$byval_copy15,$$byval_copy16));
  14096. $97 = $96 > $$028;
  14097. $$119 = $97 ? $$01727 : $$01826;
  14098. $$1 = $97 ? $96 : $$028;
  14099. $98 = (($$01727) + 1)|0;
  14100. $99 = HEAP32[$3>>2]|0;
  14101. $100 = ($98>>>0)<($99>>>0);
  14102. if ($100) {
  14103. $$01727 = $98;$$01826 = $$119;$$028 = $$1;
  14104. } else {
  14105. $$0$lcssa = $$1;$$018$lcssa = $$119;
  14106. break;
  14107. }
  14108. }
  14109. HEAP32[$0>>2] = $$018$lcssa;
  14110. STACKTOP = sp;return (+$$0$lcssa);
  14111. }
  14112. function _BiasGreaterThan($0,$1) {
  14113. $0 = +$0;
  14114. $1 = +$1;
  14115. var $2 = 0.0, $3 = 0.0, $4 = 0.0, $5 = 0, $6 = 0, label = 0, sp = 0;
  14116. sp = STACKTOP;
  14117. $2 = $1 * 0.94999998807907104;
  14118. $3 = $0 * 0.0099999997764825821;
  14119. $4 = $3 + $2;
  14120. $5 = $4 <= $0;
  14121. $6 = $5&1;
  14122. return ($6|0);
  14123. }
  14124. function _FindIncidentFace($0,$1,$2,$3,$4) {
  14125. $0 = $0|0;
  14126. $1 = $1|0;
  14127. $2 = $2|0;
  14128. $3 = $3|0;
  14129. $4 = $4|0;
  14130. var $$0$lcssa = 0, $$02434 = 0, $$02533 = 0.0, $$035 = 0, $$1 = 0, $$126 = 0.0, $$byval_copy13 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0.0, $106 = 0, $107 = 0, $108 = 0, $11 = 0, $12 = 0, $13 = 0;
  14131. var $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0;
  14132. var $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0;
  14133. var $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0;
  14134. var $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0;
  14135. var $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $tmpcast$byval_copy12 = 0, label = 0, sp = 0;
  14136. sp = STACKTOP;
  14137. STACKTOP = STACKTOP + 912|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(912|0);
  14138. $$byval_copy13 = sp + 896|0;
  14139. $tmpcast$byval_copy12 = sp + 880|0;
  14140. $5 = sp + 460|0;
  14141. $6 = sp + 56|0;
  14142. $7 = sp;
  14143. $8 = sp + 48|0;
  14144. $9 = sp + 864|0;
  14145. $10 = sp + 40|0;
  14146. $11 = sp + 32|0;
  14147. $12 = sp + 24|0;
  14148. $13 = sp + 16|0;
  14149. $14 = sp + 8|0;
  14150. $15 = ((($2)) + 12|0);
  14151. _memcpy(($5|0),($15|0),404)|0;
  14152. $16 = ((($3)) + 12|0);
  14153. _memcpy(($6|0),($16|0),404)|0;
  14154. $17 = (((($5)) + 196|0) + ($4<<3)|0);
  14155. $18 = $17;
  14156. $19 = $18;
  14157. $20 = HEAP32[$19>>2]|0;
  14158. $21 = (($18) + 4)|0;
  14159. $22 = $21;
  14160. $23 = HEAP32[$22>>2]|0;
  14161. $24 = $7;
  14162. $25 = $24;
  14163. HEAP32[$25>>2] = $20;
  14164. $26 = (($24) + 4)|0;
  14165. $27 = $26;
  14166. HEAP32[$27>>2] = $23;
  14167. $28 = ((($5)) + 388|0);
  14168. ;HEAP32[$tmpcast$byval_copy12>>2]=HEAP32[$28>>2]|0;HEAP32[$tmpcast$byval_copy12+4>>2]=HEAP32[$28+4>>2]|0;HEAP32[$tmpcast$byval_copy12+8>>2]=HEAP32[$28+8>>2]|0;HEAP32[$tmpcast$byval_copy12+12>>2]=HEAP32[$28+12>>2]|0;
  14169. ;HEAP32[$$byval_copy13>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$7+4>>2]|0;
  14170. _Mat2MultiplyVector2($8,$tmpcast$byval_copy12,$$byval_copy13);
  14171. $29 = $8;
  14172. $30 = $29;
  14173. $31 = HEAP32[$30>>2]|0;
  14174. $32 = (($29) + 4)|0;
  14175. $33 = $32;
  14176. $34 = HEAP32[$33>>2]|0;
  14177. $35 = $7;
  14178. $36 = $35;
  14179. HEAP32[$36>>2] = $31;
  14180. $37 = (($35) + 4)|0;
  14181. $38 = $37;
  14182. HEAP32[$38>>2] = $34;
  14183. $39 = ((($6)) + 388|0);
  14184. ;HEAP32[$$byval_copy13>>2]=HEAP32[$39>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$39+4>>2]|0;HEAP32[$$byval_copy13+8>>2]=HEAP32[$39+8>>2]|0;HEAP32[$$byval_copy13+12>>2]=HEAP32[$39+12>>2]|0;
  14185. _Mat2Transpose($9,$$byval_copy13);
  14186. ;HEAP32[$tmpcast$byval_copy12>>2]=HEAP32[$9>>2]|0;HEAP32[$tmpcast$byval_copy12+4>>2]=HEAP32[$9+4>>2]|0;HEAP32[$tmpcast$byval_copy12+8>>2]=HEAP32[$9+8>>2]|0;HEAP32[$tmpcast$byval_copy12+12>>2]=HEAP32[$9+12>>2]|0;
  14187. ;HEAP32[$$byval_copy13>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$7+4>>2]|0;
  14188. _Mat2MultiplyVector2($10,$tmpcast$byval_copy12,$$byval_copy13);
  14189. $40 = $10;
  14190. $41 = $40;
  14191. $42 = HEAP32[$41>>2]|0;
  14192. $43 = (($40) + 4)|0;
  14193. $44 = $43;
  14194. $45 = HEAP32[$44>>2]|0;
  14195. $46 = $7;
  14196. $47 = $46;
  14197. HEAP32[$47>>2] = $42;
  14198. $48 = (($46) + 4)|0;
  14199. $49 = $48;
  14200. HEAP32[$49>>2] = $45;
  14201. $50 = HEAP32[$6>>2]|0;
  14202. $51 = ($50|0)==(0);
  14203. if ($51) {
  14204. $$0$lcssa = 0;
  14205. } else {
  14206. $52 = HEAP32[$6>>2]|0;
  14207. $$02434 = 0;$$02533 = 3.4028234663852886E+38;$$035 = 0;
  14208. while(1) {
  14209. $104 = (((($6)) + 196|0) + ($$02434<<3)|0);
  14210. ;HEAP32[$tmpcast$byval_copy12>>2]=HEAP32[$7>>2]|0;HEAP32[$tmpcast$byval_copy12+4>>2]=HEAP32[$7+4>>2]|0;
  14211. ;HEAP32[$$byval_copy13>>2]=HEAP32[$104>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$104+4>>2]|0;
  14212. $105 = (+_MathDot($tmpcast$byval_copy12,$$byval_copy13));
  14213. $106 = $105 < $$02533;
  14214. $$126 = $106 ? $105 : $$02533;
  14215. $$1 = $106 ? $$02434 : $$035;
  14216. $107 = (($$02434) + 1)|0;
  14217. $108 = ($107>>>0)<($52>>>0);
  14218. if ($108) {
  14219. $$02434 = $107;$$02533 = $$126;$$035 = $$1;
  14220. } else {
  14221. $$0$lcssa = $$1;
  14222. break;
  14223. }
  14224. }
  14225. }
  14226. $53 = (((($6)) + 4|0) + ($$0$lcssa<<3)|0);
  14227. ;HEAP32[$tmpcast$byval_copy12>>2]=HEAP32[$39>>2]|0;HEAP32[$tmpcast$byval_copy12+4>>2]=HEAP32[$39+4>>2]|0;HEAP32[$tmpcast$byval_copy12+8>>2]=HEAP32[$39+8>>2]|0;HEAP32[$tmpcast$byval_copy12+12>>2]=HEAP32[$39+12>>2]|0;
  14228. ;HEAP32[$$byval_copy13>>2]=HEAP32[$53>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$53+4>>2]|0;
  14229. _Mat2MultiplyVector2($11,$tmpcast$byval_copy12,$$byval_copy13);
  14230. $54 = $11;
  14231. $55 = $54;
  14232. $56 = HEAP32[$55>>2]|0;
  14233. $57 = (($54) + 4)|0;
  14234. $58 = $57;
  14235. $59 = HEAP32[$58>>2]|0;
  14236. $60 = $0;
  14237. $61 = $60;
  14238. HEAP32[$61>>2] = $56;
  14239. $62 = (($60) + 4)|0;
  14240. $63 = $62;
  14241. HEAP32[$63>>2] = $59;
  14242. $64 = ((($3)) + 4|0);
  14243. $65 = HEAP32[$64>>2]|0;
  14244. $66 = ((($65)) + 8|0);
  14245. ;HEAP32[$tmpcast$byval_copy12>>2]=HEAP32[$0>>2]|0;HEAP32[$tmpcast$byval_copy12+4>>2]=HEAP32[$0+4>>2]|0;
  14246. ;HEAP32[$$byval_copy13>>2]=HEAP32[$66>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$66+4>>2]|0;
  14247. _Vector2Add_2($12,$tmpcast$byval_copy12,$$byval_copy13);
  14248. $67 = $12;
  14249. $68 = $67;
  14250. $69 = HEAP32[$68>>2]|0;
  14251. $70 = (($67) + 4)|0;
  14252. $71 = $70;
  14253. $72 = HEAP32[$71>>2]|0;
  14254. $73 = $0;
  14255. $74 = $73;
  14256. HEAP32[$74>>2] = $69;
  14257. $75 = (($73) + 4)|0;
  14258. $76 = $75;
  14259. HEAP32[$76>>2] = $72;
  14260. $77 = (($$0$lcssa) + 1)|0;
  14261. $78 = HEAP32[$6>>2]|0;
  14262. $79 = ($77>>>0)<($78>>>0);
  14263. $80 = $79 ? $77 : 0;
  14264. $81 = (((($6)) + 4|0) + ($80<<3)|0);
  14265. ;HEAP32[$tmpcast$byval_copy12>>2]=HEAP32[$39>>2]|0;HEAP32[$tmpcast$byval_copy12+4>>2]=HEAP32[$39+4>>2]|0;HEAP32[$tmpcast$byval_copy12+8>>2]=HEAP32[$39+8>>2]|0;HEAP32[$tmpcast$byval_copy12+12>>2]=HEAP32[$39+12>>2]|0;
  14266. ;HEAP32[$$byval_copy13>>2]=HEAP32[$81>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$81+4>>2]|0;
  14267. _Mat2MultiplyVector2($13,$tmpcast$byval_copy12,$$byval_copy13);
  14268. $82 = $13;
  14269. $83 = $82;
  14270. $84 = HEAP32[$83>>2]|0;
  14271. $85 = (($82) + 4)|0;
  14272. $86 = $85;
  14273. $87 = HEAP32[$86>>2]|0;
  14274. $88 = $1;
  14275. $89 = $88;
  14276. HEAP32[$89>>2] = $84;
  14277. $90 = (($88) + 4)|0;
  14278. $91 = $90;
  14279. HEAP32[$91>>2] = $87;
  14280. $92 = HEAP32[$64>>2]|0;
  14281. $93 = ((($92)) + 8|0);
  14282. ;HEAP32[$tmpcast$byval_copy12>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast$byval_copy12+4>>2]=HEAP32[$1+4>>2]|0;
  14283. ;HEAP32[$$byval_copy13>>2]=HEAP32[$93>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$93+4>>2]|0;
  14284. _Vector2Add_2($14,$tmpcast$byval_copy12,$$byval_copy13);
  14285. $94 = $14;
  14286. $95 = $94;
  14287. $96 = HEAP32[$95>>2]|0;
  14288. $97 = (($94) + 4)|0;
  14289. $98 = $97;
  14290. $99 = HEAP32[$98>>2]|0;
  14291. $100 = $1;
  14292. $101 = $100;
  14293. HEAP32[$101>>2] = $96;
  14294. $102 = (($100) + 4)|0;
  14295. $103 = $102;
  14296. HEAP32[$103>>2] = $99;
  14297. STACKTOP = sp;return;
  14298. }
  14299. function _Clip($0,$1,$2,$3) {
  14300. $0 = $0|0;
  14301. $1 = +$1;
  14302. $2 = $2|0;
  14303. $3 = $3|0;
  14304. var $$0 = 0, $$1 = 0, $$2 = 0, $$byval_copy6 = 0, $$byval_copy7 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0;
  14305. var $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0.0, $29 = 0.0, $30 = 0.0, $31 = 0.0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0;
  14306. var $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0;
  14307. var $56 = 0.0, $57 = 0, $58 = 0.0, $59 = 0.0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0.0, $72 = 0.0, $73 = 0;
  14308. var $74 = 0.0, $75 = 0.0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0;
  14309. var $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, label = 0, sp = 0;
  14310. sp = STACKTOP;
  14311. STACKTOP = STACKTOP + 48|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(48|0);
  14312. $$byval_copy7 = sp + 40|0;
  14313. $$byval_copy6 = sp + 32|0;
  14314. $4 = sp;
  14315. $5 = sp + 24|0;
  14316. $6 = sp + 16|0;
  14317. $7 = $2;
  14318. $8 = $7;
  14319. $9 = HEAP32[$8>>2]|0;
  14320. $10 = (($7) + 4)|0;
  14321. $11 = $10;
  14322. $12 = HEAP32[$11>>2]|0;
  14323. $13 = $4;
  14324. $14 = $13;
  14325. HEAP32[$14>>2] = $9;
  14326. $15 = (($13) + 4)|0;
  14327. $16 = $15;
  14328. HEAP32[$16>>2] = $12;
  14329. $17 = ((($4)) + 8|0);
  14330. $18 = $3;
  14331. $19 = $18;
  14332. $20 = HEAP32[$19>>2]|0;
  14333. $21 = (($18) + 4)|0;
  14334. $22 = $21;
  14335. $23 = HEAP32[$22>>2]|0;
  14336. $24 = $17;
  14337. $25 = $24;
  14338. HEAP32[$25>>2] = $20;
  14339. $26 = (($24) + 4)|0;
  14340. $27 = $26;
  14341. HEAP32[$27>>2] = $23;
  14342. ;HEAP32[$$byval_copy6>>2]=HEAP32[$0>>2]|0;HEAP32[$$byval_copy6+4>>2]=HEAP32[$0+4>>2]|0;
  14343. ;HEAP32[$$byval_copy7>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy7+4>>2]=HEAP32[$2+4>>2]|0;
  14344. $28 = (+_MathDot($$byval_copy6,$$byval_copy7));
  14345. $29 = $28 - $1;
  14346. ;HEAP32[$$byval_copy6>>2]=HEAP32[$0>>2]|0;HEAP32[$$byval_copy6+4>>2]=HEAP32[$0+4>>2]|0;
  14347. ;HEAP32[$$byval_copy7>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy7+4>>2]=HEAP32[$3+4>>2]|0;
  14348. $30 = (+_MathDot($$byval_copy6,$$byval_copy7));
  14349. $31 = $30 - $1;
  14350. $32 = !($29 <= 0.0);
  14351. if ($32) {
  14352. $$0 = 0;
  14353. } else {
  14354. $33 = $2;
  14355. $34 = $33;
  14356. $35 = HEAP32[$34>>2]|0;
  14357. $36 = (($33) + 4)|0;
  14358. $37 = $36;
  14359. $38 = HEAP32[$37>>2]|0;
  14360. $39 = $4;
  14361. $40 = $39;
  14362. HEAP32[$40>>2] = $35;
  14363. $41 = (($39) + 4)|0;
  14364. $42 = $41;
  14365. HEAP32[$42>>2] = $38;
  14366. $$0 = 1;
  14367. }
  14368. $43 = !($31 <= 0.0);
  14369. if ($43) {
  14370. $$1 = $$0;
  14371. } else {
  14372. $44 = (($4) + ($$0<<3)|0);
  14373. $45 = (($$0) + 1)|0;
  14374. $46 = $3;
  14375. $47 = $46;
  14376. $48 = HEAP32[$47>>2]|0;
  14377. $49 = (($46) + 4)|0;
  14378. $50 = $49;
  14379. $51 = HEAP32[$50>>2]|0;
  14380. $52 = $44;
  14381. $53 = $52;
  14382. HEAP32[$53>>2] = $48;
  14383. $54 = (($52) + 4)|0;
  14384. $55 = $54;
  14385. HEAP32[$55>>2] = $51;
  14386. $$1 = $45;
  14387. }
  14388. $56 = $29 * $31;
  14389. $57 = $56 < 0.0;
  14390. if (!($57)) {
  14391. $$2 = $$1;
  14392. $87 = $4;
  14393. $88 = $87;
  14394. $89 = HEAP32[$88>>2]|0;
  14395. $90 = (($87) + 4)|0;
  14396. $91 = $90;
  14397. $92 = HEAP32[$91>>2]|0;
  14398. $93 = $2;
  14399. $94 = $93;
  14400. HEAP32[$94>>2] = $89;
  14401. $95 = (($93) + 4)|0;
  14402. $96 = $95;
  14403. HEAP32[$96>>2] = $92;
  14404. $97 = $17;
  14405. $98 = $97;
  14406. $99 = HEAP32[$98>>2]|0;
  14407. $100 = (($97) + 4)|0;
  14408. $101 = $100;
  14409. $102 = HEAP32[$101>>2]|0;
  14410. $103 = $3;
  14411. $104 = $103;
  14412. HEAP32[$104>>2] = $99;
  14413. $105 = (($103) + 4)|0;
  14414. $106 = $105;
  14415. HEAP32[$106>>2] = $102;
  14416. STACKTOP = sp;return ($$2|0);
  14417. }
  14418. $58 = $29 - $31;
  14419. $59 = $29 / $58;
  14420. $60 = (($4) + ($$1<<3)|0);
  14421. $61 = $2;
  14422. $62 = $61;
  14423. $63 = HEAP32[$62>>2]|0;
  14424. $64 = (($61) + 4)|0;
  14425. $65 = $64;
  14426. $66 = HEAP32[$65>>2]|0;
  14427. $67 = $60;
  14428. $68 = $67;
  14429. HEAP32[$68>>2] = $63;
  14430. $69 = (($67) + 4)|0;
  14431. $70 = $69;
  14432. HEAP32[$70>>2] = $66;
  14433. ;HEAP32[$$byval_copy6>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy6+4>>2]=HEAP32[$3+4>>2]|0;
  14434. ;HEAP32[$$byval_copy7>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy7+4>>2]=HEAP32[$2+4>>2]|0;
  14435. _Vector2Subtract_4($5,$$byval_copy6,$$byval_copy7);
  14436. $71 = +HEAPF32[$5>>2];
  14437. $72 = $59 * $71;
  14438. HEAPF32[$5>>2] = $72;
  14439. $73 = ((($5)) + 4|0);
  14440. $74 = +HEAPF32[$73>>2];
  14441. $75 = $59 * $74;
  14442. HEAPF32[$73>>2] = $75;
  14443. ;HEAP32[$$byval_copy6>>2]=HEAP32[$60>>2]|0;HEAP32[$$byval_copy6+4>>2]=HEAP32[$60+4>>2]|0;
  14444. ;HEAP32[$$byval_copy7>>2]=HEAP32[$5>>2]|0;HEAP32[$$byval_copy7+4>>2]=HEAP32[$5+4>>2]|0;
  14445. _Vector2Add_2($6,$$byval_copy6,$$byval_copy7);
  14446. $76 = $6;
  14447. $77 = $76;
  14448. $78 = HEAP32[$77>>2]|0;
  14449. $79 = (($76) + 4)|0;
  14450. $80 = $79;
  14451. $81 = HEAP32[$80>>2]|0;
  14452. $82 = $60;
  14453. $83 = $82;
  14454. HEAP32[$83>>2] = $78;
  14455. $84 = (($82) + 4)|0;
  14456. $85 = $84;
  14457. HEAP32[$85>>2] = $81;
  14458. $86 = (($$1) + 1)|0;
  14459. $$2 = $86;
  14460. $87 = $4;
  14461. $88 = $87;
  14462. $89 = HEAP32[$88>>2]|0;
  14463. $90 = (($87) + 4)|0;
  14464. $91 = $90;
  14465. $92 = HEAP32[$91>>2]|0;
  14466. $93 = $2;
  14467. $94 = $93;
  14468. HEAP32[$94>>2] = $89;
  14469. $95 = (($93) + 4)|0;
  14470. $96 = $95;
  14471. HEAP32[$96>>2] = $92;
  14472. $97 = $17;
  14473. $98 = $97;
  14474. $99 = HEAP32[$98>>2]|0;
  14475. $100 = (($97) + 4)|0;
  14476. $101 = $100;
  14477. $102 = HEAP32[$101>>2]|0;
  14478. $103 = $3;
  14479. $104 = $103;
  14480. HEAP32[$104>>2] = $99;
  14481. $105 = (($103) + 4)|0;
  14482. $106 = $105;
  14483. HEAP32[$106>>2] = $102;
  14484. STACKTOP = sp;return ($$2|0);
  14485. }
  14486. function _GetSupport($0,$1,$2) {
  14487. $0 = $0|0;
  14488. $1 = $1|0;
  14489. $2 = $2|0;
  14490. var $$01318 = 0, $$019 = 0.0, $$1 = 0.0, $$byval_copy = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0;
  14491. var $26 = 0.0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $tmpcast$byval_copy = 0, label = 0, sp = 0;
  14492. sp = STACKTOP;
  14493. STACKTOP = STACKTOP + 432|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(432|0);
  14494. $$byval_copy = sp + 424|0;
  14495. $tmpcast$byval_copy = sp + 416|0;
  14496. $3 = sp + 8|0;
  14497. $4 = sp;
  14498. $5 = ((($1)) + 12|0);
  14499. _memcpy(($3|0),($5|0),404)|0;
  14500. $6 = HEAP32[$3>>2]|0;
  14501. $7 = ($6|0)==(0);
  14502. if ($7) {
  14503. $11 = 0;$14 = 0;
  14504. $9 = $0;
  14505. $10 = $9;
  14506. HEAP32[$10>>2] = $11;
  14507. $12 = (($9) + 4)|0;
  14508. $13 = $12;
  14509. HEAP32[$13>>2] = $14;
  14510. STACKTOP = sp;return;
  14511. }
  14512. $8 = HEAP32[$3>>2]|0;
  14513. $$01318 = 0;$$019 = -3.4028234663852886E+38;$29 = 0;$31 = 0;
  14514. while(1) {
  14515. $15 = (((($3)) + 4|0) + ($$01318<<3)|0);
  14516. $16 = $15;
  14517. $17 = $16;
  14518. $18 = HEAP32[$17>>2]|0;
  14519. $19 = (($16) + 4)|0;
  14520. $20 = $19;
  14521. $21 = HEAP32[$20>>2]|0;
  14522. $22 = $4;
  14523. $23 = $22;
  14524. HEAP32[$23>>2] = $18;
  14525. $24 = (($22) + 4)|0;
  14526. $25 = $24;
  14527. HEAP32[$25>>2] = $21;
  14528. ;HEAP32[$tmpcast$byval_copy>>2]=HEAP32[$4>>2]|0;HEAP32[$tmpcast$byval_copy+4>>2]=HEAP32[$4+4>>2]|0;
  14529. ;HEAP32[$$byval_copy>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy+4>>2]=HEAP32[$2+4>>2]|0;
  14530. $26 = (+_MathDot($tmpcast$byval_copy,$$byval_copy));
  14531. $27 = $26 > $$019;
  14532. $28 = $27 ? $18 : $29;
  14533. $30 = $27 ? $21 : $31;
  14534. $$1 = $27 ? $26 : $$019;
  14535. $32 = (($$01318) + 1)|0;
  14536. $33 = ($32>>>0)<($8>>>0);
  14537. if ($33) {
  14538. $$01318 = $32;$$019 = $$1;$29 = $28;$31 = $30;
  14539. } else {
  14540. $11 = $28;$14 = $30;
  14541. break;
  14542. }
  14543. }
  14544. $9 = $0;
  14545. $10 = $9;
  14546. HEAP32[$10>>2] = $11;
  14547. $12 = (($9) + 4)|0;
  14548. $13 = $12;
  14549. HEAP32[$13>>2] = $14;
  14550. STACKTOP = sp;return;
  14551. }
  14552. function _MathCross($0,$1,$2) {
  14553. $0 = $0|0;
  14554. $1 = +$1;
  14555. $2 = $2|0;
  14556. var $3 = 0, $4 = 0.0, $5 = 0.0, $6 = 0.0, $7 = 0, $8 = 0.0, $9 = 0.0, label = 0, sp = 0;
  14557. sp = STACKTOP;
  14558. $3 = ((($2)) + 4|0);
  14559. $4 = +HEAPF32[$3>>2];
  14560. $5 = $4 * $1;
  14561. $6 = -$5;
  14562. HEAPF32[$0>>2] = $6;
  14563. $7 = ((($0)) + 4|0);
  14564. $8 = +HEAPF32[$2>>2];
  14565. $9 = $8 * $1;
  14566. HEAPF32[$7>>2] = $9;
  14567. return;
  14568. }
  14569. function _Mat2Set($0,$1) {
  14570. $0 = $0|0;
  14571. $1 = +$1;
  14572. var $2 = 0.0, $3 = 0.0, $4 = 0.0, $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0;
  14573. sp = STACKTOP;
  14574. $2 = (+Math_cos((+$1)));
  14575. $3 = (+Math_sin((+$1)));
  14576. HEAPF32[$0>>2] = $2;
  14577. $4 = -$3;
  14578. $5 = ((($0)) + 4|0);
  14579. HEAPF32[$5>>2] = $4;
  14580. $6 = ((($0)) + 8|0);
  14581. HEAPF32[$6>>2] = $3;
  14582. $7 = ((($0)) + 12|0);
  14583. HEAPF32[$7>>2] = $2;
  14584. return;
  14585. }
  14586. function _Vector2Distance($0,$1) {
  14587. $0 = $0|0;
  14588. $1 = $1|0;
  14589. var $10 = 0.0, $11 = 0.0, $12 = 0.0, $13 = 0.0, $2 = 0.0, $3 = 0.0, $4 = 0.0, $5 = 0.0, $6 = 0, $7 = 0.0, $8 = 0, $9 = 0.0, label = 0, sp = 0;
  14590. sp = STACKTOP;
  14591. $2 = +HEAPF32[$0>>2];
  14592. $3 = +HEAPF32[$1>>2];
  14593. $4 = $2 - $3;
  14594. $5 = $4 * $4;
  14595. $6 = ((($0)) + 4|0);
  14596. $7 = +HEAPF32[$6>>2];
  14597. $8 = ((($1)) + 4|0);
  14598. $9 = +HEAPF32[$8>>2];
  14599. $10 = $7 - $9;
  14600. $11 = $10 * $10;
  14601. $12 = $5 + $11;
  14602. $13 = (+Math_sqrt((+$12)));
  14603. return (+$13);
  14604. }
  14605. function _Vector2Angle($0,$1) {
  14606. $0 = $0|0;
  14607. $1 = $1|0;
  14608. var $$0 = 0.0, $10 = 0.0, $11 = 0.0, $12 = 0, $13 = 0.0, $2 = 0, $3 = 0.0, $4 = 0, $5 = 0.0, $6 = 0.0, $7 = 0.0, $8 = 0.0, $9 = 0.0, label = 0, sp = 0;
  14609. sp = STACKTOP;
  14610. $2 = ((($1)) + 4|0);
  14611. $3 = +HEAPF32[$2>>2];
  14612. $4 = ((($0)) + 4|0);
  14613. $5 = +HEAPF32[$4>>2];
  14614. $6 = $3 - $5;
  14615. $7 = +HEAPF32[$1>>2];
  14616. $8 = +HEAPF32[$0>>2];
  14617. $9 = $7 - $8;
  14618. $10 = (+Math_atan2((+$6),(+$9)));
  14619. $11 = $10 * 57.2957763671875;
  14620. $12 = $11 < 0.0;
  14621. $13 = $11 + 360.0;
  14622. $$0 = $12 ? $13 : $11;
  14623. return (+$$0);
  14624. }
  14625. function _VectorZero($0) {
  14626. $0 = $0|0;
  14627. var $1 = 0, $2 = 0, label = 0, sp = 0;
  14628. sp = STACKTOP;
  14629. HEAPF32[$0>>2] = 0.0;
  14630. $1 = ((($0)) + 4|0);
  14631. HEAPF32[$1>>2] = 0.0;
  14632. $2 = ((($0)) + 8|0);
  14633. HEAPF32[$2>>2] = 0.0;
  14634. return;
  14635. }
  14636. function _VectorLength($0) {
  14637. $0 = $0|0;
  14638. var $1 = 0.0, $10 = 0.0, $11 = 0.0, $2 = 0.0, $3 = 0, $4 = 0.0, $5 = 0.0, $6 = 0.0, $7 = 0, $8 = 0.0, $9 = 0.0, label = 0, sp = 0;
  14639. sp = STACKTOP;
  14640. $1 = +HEAPF32[$0>>2];
  14641. $2 = $1 * $1;
  14642. $3 = ((($0)) + 4|0);
  14643. $4 = +HEAPF32[$3>>2];
  14644. $5 = $4 * $4;
  14645. $6 = $2 + $5;
  14646. $7 = ((($0)) + 8|0);
  14647. $8 = +HEAPF32[$7>>2];
  14648. $9 = $8 * $8;
  14649. $10 = $6 + $9;
  14650. $11 = (+Math_sqrt((+$10)));
  14651. return (+$11);
  14652. }
  14653. function _VectorNormalize($0) {
  14654. $0 = $0|0;
  14655. var $$byval_copy = 0, $$op = 0.0, $1 = 0.0, $10 = 0.0, $11 = 0.0, $2 = 0, $3 = 0.0, $4 = 0.0, $5 = 0.0, $6 = 0, $7 = 0.0, $8 = 0.0, $9 = 0, label = 0, sp = 0;
  14656. sp = STACKTOP;
  14657. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  14658. $$byval_copy = sp;
  14659. ;HEAP32[$$byval_copy>>2]=HEAP32[$0>>2]|0;HEAP32[$$byval_copy+4>>2]=HEAP32[$0+4>>2]|0;HEAP32[$$byval_copy+8>>2]=HEAP32[$0+8>>2]|0;
  14660. $1 = (+_VectorLength($$byval_copy));
  14661. $2 = $1 == 0.0;
  14662. $$op = 1.0 / $1;
  14663. $3 = $2 ? 1.0 : $$op;
  14664. $4 = +HEAPF32[$0>>2];
  14665. $5 = $4 * $3;
  14666. HEAPF32[$0>>2] = $5;
  14667. $6 = ((($0)) + 4|0);
  14668. $7 = +HEAPF32[$6>>2];
  14669. $8 = $3 * $7;
  14670. HEAPF32[$6>>2] = $8;
  14671. $9 = ((($0)) + 8|0);
  14672. $10 = +HEAPF32[$9>>2];
  14673. $11 = $3 * $10;
  14674. HEAPF32[$9>>2] = $11;
  14675. STACKTOP = sp;return;
  14676. }
  14677. function _VectorTransform($0,$1) {
  14678. $0 = $0|0;
  14679. $1 = $1|0;
  14680. var $10 = 0.0, $11 = 0.0, $12 = 0.0, $13 = 0, $14 = 0.0, $15 = 0.0, $16 = 0.0, $17 = 0, $18 = 0.0, $19 = 0.0, $2 = 0.0, $20 = 0, $21 = 0.0, $22 = 0.0, $23 = 0, $24 = 0.0, $25 = 0.0, $26 = 0.0, $27 = 0, $28 = 0.0;
  14681. var $29 = 0.0, $3 = 0, $30 = 0.0, $31 = 0, $32 = 0.0, $33 = 0.0, $34 = 0, $35 = 0.0, $36 = 0.0, $37 = 0, $38 = 0.0, $39 = 0.0, $4 = 0.0, $40 = 0.0, $41 = 0, $42 = 0.0, $43 = 0.0, $44 = 0.0, $45 = 0, $46 = 0.0;
  14682. var $47 = 0.0, $5 = 0, $6 = 0.0, $7 = 0.0, $8 = 0.0, $9 = 0, label = 0, sp = 0;
  14683. sp = STACKTOP;
  14684. $2 = +HEAPF32[$0>>2];
  14685. $3 = ((($0)) + 4|0);
  14686. $4 = +HEAPF32[$3>>2];
  14687. $5 = ((($0)) + 8|0);
  14688. $6 = +HEAPF32[$5>>2];
  14689. $7 = +HEAPF32[$1>>2];
  14690. $8 = $2 * $7;
  14691. $9 = ((($1)) + 4|0);
  14692. $10 = +HEAPF32[$9>>2];
  14693. $11 = $4 * $10;
  14694. $12 = $8 + $11;
  14695. $13 = ((($1)) + 8|0);
  14696. $14 = +HEAPF32[$13>>2];
  14697. $15 = $6 * $14;
  14698. $16 = $12 + $15;
  14699. $17 = ((($1)) + 12|0);
  14700. $18 = +HEAPF32[$17>>2];
  14701. $19 = $18 + $16;
  14702. HEAPF32[$0>>2] = $19;
  14703. $20 = ((($1)) + 16|0);
  14704. $21 = +HEAPF32[$20>>2];
  14705. $22 = $2 * $21;
  14706. $23 = ((($1)) + 20|0);
  14707. $24 = +HEAPF32[$23>>2];
  14708. $25 = $4 * $24;
  14709. $26 = $22 + $25;
  14710. $27 = ((($1)) + 24|0);
  14711. $28 = +HEAPF32[$27>>2];
  14712. $29 = $6 * $28;
  14713. $30 = $26 + $29;
  14714. $31 = ((($1)) + 28|0);
  14715. $32 = +HEAPF32[$31>>2];
  14716. $33 = $32 + $30;
  14717. HEAPF32[$3>>2] = $33;
  14718. $34 = ((($1)) + 32|0);
  14719. $35 = +HEAPF32[$34>>2];
  14720. $36 = $2 * $35;
  14721. $37 = ((($1)) + 36|0);
  14722. $38 = +HEAPF32[$37>>2];
  14723. $39 = $4 * $38;
  14724. $40 = $36 + $39;
  14725. $41 = ((($1)) + 40|0);
  14726. $42 = +HEAPF32[$41>>2];
  14727. $43 = $6 * $42;
  14728. $44 = $40 + $43;
  14729. $45 = ((($1)) + 44|0);
  14730. $46 = +HEAPF32[$45>>2];
  14731. $47 = $46 + $44;
  14732. HEAPF32[$5>>2] = $47;
  14733. return;
  14734. }
  14735. function _MatrixTranspose($0) {
  14736. $0 = $0|0;
  14737. var $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $3 = 0, $4 = 0, $5 = 0;
  14738. var $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  14739. sp = STACKTOP;
  14740. $1 = ((($0)) + 4|0);
  14741. $2 = HEAP32[$1>>2]|0;
  14742. $3 = ((($0)) + 8|0);
  14743. $4 = HEAP32[$3>>2]|0;
  14744. $5 = ((($0)) + 12|0);
  14745. $6 = HEAP32[$5>>2]|0;
  14746. $7 = ((($0)) + 16|0);
  14747. $8 = HEAP32[$7>>2]|0;
  14748. $9 = ((($0)) + 24|0);
  14749. $10 = HEAP32[$9>>2]|0;
  14750. $11 = ((($0)) + 28|0);
  14751. $12 = HEAP32[$11>>2]|0;
  14752. $13 = ((($0)) + 32|0);
  14753. $14 = HEAP32[$13>>2]|0;
  14754. $15 = ((($0)) + 36|0);
  14755. $16 = HEAP32[$15>>2]|0;
  14756. $17 = ((($0)) + 44|0);
  14757. $18 = HEAP32[$17>>2]|0;
  14758. $19 = ((($0)) + 48|0);
  14759. $20 = HEAP32[$19>>2]|0;
  14760. $21 = ((($0)) + 52|0);
  14761. $22 = HEAP32[$21>>2]|0;
  14762. $23 = ((($0)) + 56|0);
  14763. $24 = HEAP32[$23>>2]|0;
  14764. HEAP32[$1>>2] = $8;
  14765. HEAP32[$3>>2] = $14;
  14766. HEAP32[$5>>2] = $20;
  14767. HEAP32[$7>>2] = $2;
  14768. HEAP32[$9>>2] = $16;
  14769. HEAP32[$11>>2] = $22;
  14770. HEAP32[$13>>2] = $4;
  14771. HEAP32[$15>>2] = $10;
  14772. HEAP32[$17>>2] = $24;
  14773. HEAP32[$19>>2] = $6;
  14774. HEAP32[$21>>2] = $12;
  14775. HEAP32[$23>>2] = $18;
  14776. return;
  14777. }
  14778. function _MatrixIdentity($0) {
  14779. $0 = $0|0;
  14780. var $$sroa$5$0$$sroa_idx = 0, $$sroa$55$0$$sroa_idx6 = 0, $$sroa$6$0$$sroa_idx = 0, $$sroa$611$0$$sroa_idx12 = 0, $$sroa$7$0$$sroa_idx = 0, $$sroa$717$0$$sroa_idx18 = 0, label = 0, sp = 0;
  14781. sp = STACKTOP;
  14782. HEAPF32[$0>>2] = 1.0;
  14783. $$sroa$5$0$$sroa_idx = ((($0)) + 4|0);
  14784. ;HEAP32[$$sroa$5$0$$sroa_idx>>2]=0|0;HEAP32[$$sroa$5$0$$sroa_idx+4>>2]=0|0;HEAP32[$$sroa$5$0$$sroa_idx+8>>2]=0|0;HEAP32[$$sroa$5$0$$sroa_idx+12>>2]=0|0;
  14785. $$sroa$55$0$$sroa_idx6 = ((($0)) + 20|0);
  14786. HEAPF32[$$sroa$55$0$$sroa_idx6>>2] = 1.0;
  14787. $$sroa$6$0$$sroa_idx = ((($0)) + 24|0);
  14788. ;HEAP32[$$sroa$6$0$$sroa_idx>>2]=0|0;HEAP32[$$sroa$6$0$$sroa_idx+4>>2]=0|0;HEAP32[$$sroa$6$0$$sroa_idx+8>>2]=0|0;HEAP32[$$sroa$6$0$$sroa_idx+12>>2]=0|0;
  14789. $$sroa$611$0$$sroa_idx12 = ((($0)) + 40|0);
  14790. HEAPF32[$$sroa$611$0$$sroa_idx12>>2] = 1.0;
  14791. $$sroa$7$0$$sroa_idx = ((($0)) + 44|0);
  14792. ;HEAP32[$$sroa$7$0$$sroa_idx>>2]=0|0;HEAP32[$$sroa$7$0$$sroa_idx+4>>2]=0|0;HEAP32[$$sroa$7$0$$sroa_idx+8>>2]=0|0;HEAP32[$$sroa$7$0$$sroa_idx+12>>2]=0|0;
  14793. $$sroa$717$0$$sroa_idx18 = ((($0)) + 60|0);
  14794. HEAPF32[$$sroa$717$0$$sroa_idx18>>2] = 1.0;
  14795. return;
  14796. }
  14797. function _MatrixTranslate($0,$1,$2,$3) {
  14798. $0 = $0|0;
  14799. $1 = +$1;
  14800. $2 = +$2;
  14801. $3 = +$3;
  14802. var $$sroa$13$0$$sroa_idx20 = 0, $$sroa$14$0$$sroa_idx22 = 0, $$sroa$15$0$$sroa_idx24 = 0, $$sroa$16$0$$sroa_idx26 = 0, $$sroa$17$0$$sroa_idx28 = 0, $$sroa$18$0$$sroa_idx30 = 0, $$sroa$4$0$$sroa_idx2 = 0, $$sroa$8$0$$sroa_idx10 = 0, $$sroa$9$0$$sroa_idx12 = 0, label = 0, sp = 0;
  14803. sp = STACKTOP;
  14804. HEAPF32[$0>>2] = 1.0;
  14805. $$sroa$4$0$$sroa_idx2 = ((($0)) + 4|0);
  14806. $$sroa$8$0$$sroa_idx10 = ((($0)) + 20|0);
  14807. ;HEAP32[$$sroa$4$0$$sroa_idx2>>2]=0|0;HEAP32[$$sroa$4$0$$sroa_idx2+4>>2]=0|0;HEAP32[$$sroa$4$0$$sroa_idx2+8>>2]=0|0;HEAP32[$$sroa$4$0$$sroa_idx2+12>>2]=0|0;
  14808. HEAPF32[$$sroa$8$0$$sroa_idx10>>2] = 1.0;
  14809. $$sroa$9$0$$sroa_idx12 = ((($0)) + 24|0);
  14810. $$sroa$13$0$$sroa_idx20 = ((($0)) + 40|0);
  14811. ;HEAP32[$$sroa$9$0$$sroa_idx12>>2]=0|0;HEAP32[$$sroa$9$0$$sroa_idx12+4>>2]=0|0;HEAP32[$$sroa$9$0$$sroa_idx12+8>>2]=0|0;HEAP32[$$sroa$9$0$$sroa_idx12+12>>2]=0|0;
  14812. HEAPF32[$$sroa$13$0$$sroa_idx20>>2] = 1.0;
  14813. $$sroa$14$0$$sroa_idx22 = ((($0)) + 44|0);
  14814. HEAPF32[$$sroa$14$0$$sroa_idx22>>2] = 0.0;
  14815. $$sroa$15$0$$sroa_idx24 = ((($0)) + 48|0);
  14816. HEAPF32[$$sroa$15$0$$sroa_idx24>>2] = $1;
  14817. $$sroa$16$0$$sroa_idx26 = ((($0)) + 52|0);
  14818. HEAPF32[$$sroa$16$0$$sroa_idx26>>2] = $2;
  14819. $$sroa$17$0$$sroa_idx28 = ((($0)) + 56|0);
  14820. HEAPF32[$$sroa$17$0$$sroa_idx28>>2] = $3;
  14821. $$sroa$18$0$$sroa_idx30 = ((($0)) + 60|0);
  14822. HEAPF32[$$sroa$18$0$$sroa_idx30>>2] = 1.0;
  14823. return;
  14824. }
  14825. function _MatrixRotate($0,$1,$2) {
  14826. $0 = $0|0;
  14827. $1 = $1|0;
  14828. $2 = +$2;
  14829. var $$ = 0.0, $$221 = 0.0, $$222 = 0.0, $$sroa$10$0$$sroa_idx199 = 0, $$sroa$11$0$$sroa_idx201 = 0, $$sroa$12$0$$sroa_idx203 = 0, $$sroa$13$0$$sroa_idx205 = 0, $$sroa$14$0$$sroa_idx207 = 0, $$sroa$15$0$$sroa_idx209 = 0, $$sroa$16$0$$sroa_idx211 = 0, $$sroa$17$0$$sroa_idx213 = 0, $$sroa$18$0$$sroa_idx215 = 0, $$sroa$4$0$$sroa_idx187 = 0, $$sroa$5$0$$sroa_idx189 = 0, $$sroa$6$0$$sroa_idx191 = 0, $$sroa$7$0$$sroa_idx193 = 0, $$sroa$8$0$$sroa_idx195 = 0, $$sroa$9$0$$sroa_idx197 = 0, $10 = 0.0, $100 = 0.0;
  14830. var $101 = 0.0, $102 = 0.0, $103 = 0.0, $104 = 0.0, $105 = 0.0, $106 = 0.0, $107 = 0.0, $108 = 0.0, $109 = 0.0, $11 = 0.0, $110 = 0.0, $111 = 0.0, $112 = 0.0, $113 = 0.0, $114 = 0.0, $115 = 0.0, $116 = 0.0, $117 = 0.0, $118 = 0.0, $119 = 0.0;
  14831. var $12 = 0.0, $120 = 0.0, $121 = 0.0, $122 = 0.0, $123 = 0.0, $124 = 0.0, $125 = 0.0, $126 = 0.0, $127 = 0.0, $128 = 0.0, $129 = 0.0, $13 = 0.0, $130 = 0.0, $131 = 0, $132 = 0, $133 = 0, $134 = 0, $135 = 0, $136 = 0, $137 = 0;
  14832. var $138 = 0, $14 = 0.0, $15 = 0, $16 = 0, $17 = 0.0, $18 = 0.0, $19 = 0.0, $20 = 0.0, $21 = 0.0, $22 = 0.0, $23 = 0.0, $24 = 0.0, $25 = 0, $26 = 0.0, $27 = 0, $28 = 0.0, $29 = 0, $3 = 0, $30 = 0.0, $31 = 0;
  14833. var $32 = 0.0, $33 = 0, $34 = 0.0, $35 = 0, $36 = 0.0, $37 = 0, $38 = 0.0, $39 = 0, $4 = 0.0, $40 = 0.0, $41 = 0, $42 = 0.0, $43 = 0, $44 = 0.0, $45 = 0, $46 = 0.0, $47 = 0.0, $48 = 0.0, $49 = 0.0, $5 = 0;
  14834. var $50 = 0.0, $51 = 0.0, $52 = 0.0, $53 = 0.0, $54 = 0.0, $55 = 0.0, $56 = 0.0, $57 = 0.0, $58 = 0.0, $59 = 0.0, $6 = 0.0, $60 = 0.0, $61 = 0.0, $62 = 0.0, $63 = 0.0, $64 = 0.0, $65 = 0.0, $66 = 0.0, $67 = 0.0, $68 = 0.0;
  14835. var $69 = 0.0, $7 = 0, $70 = 0.0, $71 = 0.0, $72 = 0.0, $73 = 0.0, $74 = 0.0, $75 = 0.0, $76 = 0.0, $77 = 0.0, $78 = 0.0, $79 = 0.0, $8 = 0.0, $80 = 0.0, $81 = 0.0, $82 = 0.0, $83 = 0.0, $84 = 0.0, $85 = 0.0, $86 = 0.0;
  14836. var $87 = 0.0, $88 = 0.0, $89 = 0.0, $9 = 0.0, $90 = 0.0, $91 = 0.0, $92 = 0.0, $93 = 0.0, $94 = 0.0, $95 = 0.0, $96 = 0.0, $97 = 0.0, $98 = 0.0, $99 = 0.0, $or$cond = 0, label = 0, sp = 0;
  14837. sp = STACKTOP;
  14838. STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
  14839. $3 = sp;
  14840. _MatrixIdentity($3);
  14841. $4 = +HEAPF32[$1>>2];
  14842. $5 = ((($1)) + 4|0);
  14843. $6 = +HEAPF32[$5>>2];
  14844. $7 = ((($1)) + 8|0);
  14845. $8 = +HEAPF32[$7>>2];
  14846. $9 = $4 * $4;
  14847. $10 = $6 * $6;
  14848. $11 = $9 + $10;
  14849. $12 = $8 * $8;
  14850. $13 = $11 + $12;
  14851. $14 = (+Math_sqrt((+$13)));
  14852. $15 = $14 != 1.0;
  14853. $16 = $14 != 0.0;
  14854. $or$cond = $15 & $16;
  14855. $17 = 1.0 / $14;
  14856. $18 = $4 * $17;
  14857. $19 = $6 * $17;
  14858. $20 = $8 * $17;
  14859. $$ = $or$cond ? $20 : $8;
  14860. $$221 = $or$cond ? $19 : $6;
  14861. $$222 = $or$cond ? $18 : $4;
  14862. $21 = (+Math_sin((+$2)));
  14863. $22 = (+Math_cos((+$2)));
  14864. $23 = 1.0 - $22;
  14865. $24 = +HEAPF32[$3>>2];
  14866. $25 = ((($3)) + 16|0);
  14867. $26 = +HEAPF32[$25>>2];
  14868. $27 = ((($3)) + 32|0);
  14869. $28 = +HEAPF32[$27>>2];
  14870. $29 = ((($3)) + 48|0);
  14871. $30 = +HEAPF32[$29>>2];
  14872. $31 = ((($3)) + 4|0);
  14873. $32 = +HEAPF32[$31>>2];
  14874. $33 = ((($3)) + 20|0);
  14875. $34 = +HEAPF32[$33>>2];
  14876. $35 = ((($3)) + 36|0);
  14877. $36 = +HEAPF32[$35>>2];
  14878. $37 = ((($3)) + 52|0);
  14879. $38 = +HEAPF32[$37>>2];
  14880. $39 = ((($3)) + 8|0);
  14881. $40 = +HEAPF32[$39>>2];
  14882. $41 = ((($3)) + 24|0);
  14883. $42 = +HEAPF32[$41>>2];
  14884. $43 = ((($3)) + 40|0);
  14885. $44 = +HEAPF32[$43>>2];
  14886. $45 = ((($3)) + 56|0);
  14887. $46 = +HEAPF32[$45>>2];
  14888. $47 = $$222 * $$222;
  14889. $48 = $23 * $47;
  14890. $49 = $22 + $48;
  14891. $50 = $$221 * $$222;
  14892. $51 = $23 * $50;
  14893. $52 = $21 * $$;
  14894. $53 = $52 + $51;
  14895. $54 = $$ * $$222;
  14896. $55 = $23 * $54;
  14897. $56 = $21 * $$221;
  14898. $57 = $55 - $56;
  14899. $58 = $51 - $52;
  14900. $59 = $$221 * $$221;
  14901. $60 = $23 * $59;
  14902. $61 = $22 + $60;
  14903. $62 = $$ * $$221;
  14904. $63 = $23 * $62;
  14905. $64 = $21 * $$222;
  14906. $65 = $64 + $63;
  14907. $66 = $56 + $55;
  14908. $67 = $63 - $64;
  14909. $68 = $$ * $$;
  14910. $69 = $23 * $68;
  14911. $70 = $22 + $69;
  14912. $71 = $24 * $49;
  14913. $72 = $53 * $32;
  14914. $73 = $71 + $72;
  14915. $74 = $57 * $40;
  14916. $75 = $73 + $74;
  14917. $76 = $26 * $49;
  14918. $77 = $53 * $34;
  14919. $78 = $76 + $77;
  14920. $79 = $57 * $42;
  14921. $80 = $78 + $79;
  14922. $81 = $28 * $49;
  14923. $82 = $53 * $36;
  14924. $83 = $81 + $82;
  14925. $84 = $57 * $44;
  14926. $85 = $83 + $84;
  14927. $86 = $30 * $49;
  14928. $87 = $53 * $38;
  14929. $88 = $86 + $87;
  14930. $89 = $57 * $46;
  14931. $90 = $88 + $89;
  14932. $91 = $24 * $58;
  14933. $92 = $61 * $32;
  14934. $93 = $91 + $92;
  14935. $94 = $65 * $40;
  14936. $95 = $93 + $94;
  14937. $96 = $26 * $58;
  14938. $97 = $61 * $34;
  14939. $98 = $96 + $97;
  14940. $99 = $65 * $42;
  14941. $100 = $98 + $99;
  14942. $101 = $28 * $58;
  14943. $102 = $61 * $36;
  14944. $103 = $101 + $102;
  14945. $104 = $65 * $44;
  14946. $105 = $103 + $104;
  14947. $106 = $30 * $58;
  14948. $107 = $61 * $38;
  14949. $108 = $106 + $107;
  14950. $109 = $65 * $46;
  14951. $110 = $108 + $109;
  14952. $111 = $24 * $66;
  14953. $112 = $67 * $32;
  14954. $113 = $111 + $112;
  14955. $114 = $70 * $40;
  14956. $115 = $113 + $114;
  14957. $116 = $26 * $66;
  14958. $117 = $67 * $34;
  14959. $118 = $116 + $117;
  14960. $119 = $70 * $42;
  14961. $120 = $118 + $119;
  14962. $121 = $28 * $66;
  14963. $122 = $67 * $36;
  14964. $123 = $121 + $122;
  14965. $124 = $70 * $44;
  14966. $125 = $123 + $124;
  14967. $126 = $30 * $66;
  14968. $127 = $67 * $38;
  14969. $128 = $126 + $127;
  14970. $129 = $70 * $46;
  14971. $130 = $128 + $129;
  14972. $131 = ((($3)) + 12|0);
  14973. $132 = HEAP32[$131>>2]|0;
  14974. $133 = ((($3)) + 28|0);
  14975. $134 = HEAP32[$133>>2]|0;
  14976. $135 = ((($3)) + 44|0);
  14977. $136 = HEAP32[$135>>2]|0;
  14978. $137 = ((($3)) + 60|0);
  14979. $138 = HEAP32[$137>>2]|0;
  14980. HEAPF32[$0>>2] = $75;
  14981. $$sroa$4$0$$sroa_idx187 = ((($0)) + 4|0);
  14982. HEAPF32[$$sroa$4$0$$sroa_idx187>>2] = $95;
  14983. $$sroa$5$0$$sroa_idx189 = ((($0)) + 8|0);
  14984. HEAPF32[$$sroa$5$0$$sroa_idx189>>2] = $115;
  14985. $$sroa$6$0$$sroa_idx191 = ((($0)) + 12|0);
  14986. HEAP32[$$sroa$6$0$$sroa_idx191>>2] = $132;
  14987. $$sroa$7$0$$sroa_idx193 = ((($0)) + 16|0);
  14988. HEAPF32[$$sroa$7$0$$sroa_idx193>>2] = $80;
  14989. $$sroa$8$0$$sroa_idx195 = ((($0)) + 20|0);
  14990. HEAPF32[$$sroa$8$0$$sroa_idx195>>2] = $100;
  14991. $$sroa$9$0$$sroa_idx197 = ((($0)) + 24|0);
  14992. HEAPF32[$$sroa$9$0$$sroa_idx197>>2] = $120;
  14993. $$sroa$10$0$$sroa_idx199 = ((($0)) + 28|0);
  14994. HEAP32[$$sroa$10$0$$sroa_idx199>>2] = $134;
  14995. $$sroa$11$0$$sroa_idx201 = ((($0)) + 32|0);
  14996. HEAPF32[$$sroa$11$0$$sroa_idx201>>2] = $85;
  14997. $$sroa$12$0$$sroa_idx203 = ((($0)) + 36|0);
  14998. HEAPF32[$$sroa$12$0$$sroa_idx203>>2] = $105;
  14999. $$sroa$13$0$$sroa_idx205 = ((($0)) + 40|0);
  15000. HEAPF32[$$sroa$13$0$$sroa_idx205>>2] = $125;
  15001. $$sroa$14$0$$sroa_idx207 = ((($0)) + 44|0);
  15002. HEAP32[$$sroa$14$0$$sroa_idx207>>2] = $136;
  15003. $$sroa$15$0$$sroa_idx209 = ((($0)) + 48|0);
  15004. HEAPF32[$$sroa$15$0$$sroa_idx209>>2] = $90;
  15005. $$sroa$16$0$$sroa_idx211 = ((($0)) + 52|0);
  15006. HEAPF32[$$sroa$16$0$$sroa_idx211>>2] = $110;
  15007. $$sroa$17$0$$sroa_idx213 = ((($0)) + 56|0);
  15008. HEAPF32[$$sroa$17$0$$sroa_idx213>>2] = $130;
  15009. $$sroa$18$0$$sroa_idx215 = ((($0)) + 60|0);
  15010. HEAP32[$$sroa$18$0$$sroa_idx215>>2] = $138;
  15011. STACKTOP = sp;return;
  15012. }
  15013. function _MatrixScale($0,$1,$2,$3) {
  15014. $0 = $0|0;
  15015. $1 = +$1;
  15016. $2 = +$2;
  15017. $3 = +$3;
  15018. var $$sroa$5$0$$sroa_idx = 0, $$sroa$55$0$$sroa_idx6 = 0, $$sroa$6$0$$sroa_idx = 0, $$sroa$611$0$$sroa_idx12 = 0, $$sroa$7$0$$sroa_idx = 0, $$sroa$717$0$$sroa_idx18 = 0, label = 0, sp = 0;
  15019. sp = STACKTOP;
  15020. HEAPF32[$0>>2] = $1;
  15021. $$sroa$5$0$$sroa_idx = ((($0)) + 4|0);
  15022. ;HEAP32[$$sroa$5$0$$sroa_idx>>2]=0|0;HEAP32[$$sroa$5$0$$sroa_idx+4>>2]=0|0;HEAP32[$$sroa$5$0$$sroa_idx+8>>2]=0|0;HEAP32[$$sroa$5$0$$sroa_idx+12>>2]=0|0;
  15023. $$sroa$55$0$$sroa_idx6 = ((($0)) + 20|0);
  15024. HEAPF32[$$sroa$55$0$$sroa_idx6>>2] = $2;
  15025. $$sroa$6$0$$sroa_idx = ((($0)) + 24|0);
  15026. ;HEAP32[$$sroa$6$0$$sroa_idx>>2]=0|0;HEAP32[$$sroa$6$0$$sroa_idx+4>>2]=0|0;HEAP32[$$sroa$6$0$$sroa_idx+8>>2]=0|0;HEAP32[$$sroa$6$0$$sroa_idx+12>>2]=0|0;
  15027. $$sroa$611$0$$sroa_idx12 = ((($0)) + 40|0);
  15028. HEAPF32[$$sroa$611$0$$sroa_idx12>>2] = $3;
  15029. $$sroa$7$0$$sroa_idx = ((($0)) + 44|0);
  15030. ;HEAP32[$$sroa$7$0$$sroa_idx>>2]=0|0;HEAP32[$$sroa$7$0$$sroa_idx+4>>2]=0|0;HEAP32[$$sroa$7$0$$sroa_idx+8>>2]=0|0;HEAP32[$$sroa$7$0$$sroa_idx+12>>2]=0|0;
  15031. $$sroa$717$0$$sroa_idx18 = ((($0)) + 60|0);
  15032. HEAPF32[$$sroa$717$0$$sroa_idx18>>2] = 1.0;
  15033. return;
  15034. }
  15035. function _MatrixMultiply($0,$1,$2) {
  15036. $0 = $0|0;
  15037. $1 = $1|0;
  15038. $2 = $2|0;
  15039. var $$sroa$10$0$$sroa_idx14 = 0, $$sroa$11$0$$sroa_idx16 = 0, $$sroa$12$0$$sroa_idx18 = 0, $$sroa$13$0$$sroa_idx20 = 0, $$sroa$14$0$$sroa_idx22 = 0, $$sroa$15$0$$sroa_idx24 = 0, $$sroa$16$0$$sroa_idx26 = 0, $$sroa$17$0$$sroa_idx28 = 0, $$sroa$18$0$$sroa_idx30 = 0, $$sroa$4$0$$sroa_idx2 = 0, $$sroa$5$0$$sroa_idx4 = 0, $$sroa$6$0$$sroa_idx6 = 0, $$sroa$7$0$$sroa_idx8 = 0, $$sroa$8$0$$sroa_idx10 = 0, $$sroa$9$0$$sroa_idx12 = 0, $10 = 0.0, $100 = 0.0, $101 = 0.0, $102 = 0.0, $103 = 0.0;
  15040. var $104 = 0.0, $105 = 0, $106 = 0.0, $107 = 0.0, $108 = 0, $109 = 0.0, $11 = 0.0, $110 = 0.0, $111 = 0.0, $112 = 0, $113 = 0.0, $114 = 0.0, $115 = 0.0, $116 = 0, $117 = 0.0, $118 = 0.0, $119 = 0.0, $12 = 0, $120 = 0.0, $121 = 0.0;
  15041. var $122 = 0.0, $123 = 0.0, $124 = 0.0, $125 = 0.0, $126 = 0.0, $127 = 0.0, $128 = 0.0, $129 = 0.0, $13 = 0.0, $130 = 0.0, $131 = 0.0, $132 = 0.0, $133 = 0.0, $134 = 0.0, $135 = 0.0, $136 = 0.0, $137 = 0.0, $138 = 0.0, $139 = 0.0, $14 = 0;
  15042. var $140 = 0.0, $141 = 0, $142 = 0.0, $143 = 0.0, $144 = 0, $145 = 0.0, $146 = 0.0, $147 = 0.0, $148 = 0, $149 = 0.0, $15 = 0.0, $150 = 0.0, $151 = 0.0, $152 = 0, $153 = 0.0, $154 = 0.0, $155 = 0.0, $156 = 0.0, $157 = 0.0, $158 = 0.0;
  15043. var $159 = 0.0, $16 = 0.0, $160 = 0.0, $161 = 0.0, $162 = 0.0, $163 = 0.0, $164 = 0.0, $165 = 0.0, $166 = 0.0, $167 = 0.0, $168 = 0.0, $169 = 0.0, $17 = 0.0, $170 = 0.0, $171 = 0.0, $172 = 0.0, $173 = 0.0, $174 = 0.0, $175 = 0.0, $176 = 0.0;
  15044. var $18 = 0, $19 = 0.0, $20 = 0, $21 = 0.0, $22 = 0.0, $23 = 0.0, $24 = 0, $25 = 0.0, $26 = 0.0, $27 = 0, $28 = 0.0, $29 = 0.0, $3 = 0.0, $30 = 0.0, $31 = 0, $32 = 0.0, $33 = 0.0, $34 = 0.0, $35 = 0, $36 = 0.0;
  15045. var $37 = 0.0, $38 = 0.0, $39 = 0, $4 = 0.0, $40 = 0.0, $41 = 0.0, $42 = 0, $43 = 0.0, $44 = 0.0, $45 = 0.0, $46 = 0, $47 = 0.0, $48 = 0.0, $49 = 0.0, $5 = 0.0, $50 = 0, $51 = 0.0, $52 = 0.0, $53 = 0.0, $54 = 0;
  15046. var $55 = 0.0, $56 = 0.0, $57 = 0, $58 = 0.0, $59 = 0.0, $6 = 0, $60 = 0.0, $61 = 0, $62 = 0.0, $63 = 0.0, $64 = 0.0, $65 = 0, $66 = 0.0, $67 = 0.0, $68 = 0.0, $69 = 0, $7 = 0.0, $70 = 0.0, $71 = 0.0, $72 = 0;
  15047. var $73 = 0.0, $74 = 0.0, $75 = 0.0, $76 = 0, $77 = 0.0, $78 = 0.0, $79 = 0.0, $8 = 0, $80 = 0, $81 = 0.0, $82 = 0.0, $83 = 0.0, $84 = 0.0, $85 = 0.0, $86 = 0.0, $87 = 0.0, $88 = 0.0, $89 = 0.0, $9 = 0.0, $90 = 0.0;
  15048. var $91 = 0.0, $92 = 0.0, $93 = 0.0, $94 = 0.0, $95 = 0.0, $96 = 0.0, $97 = 0.0, $98 = 0.0, $99 = 0.0, label = 0, sp = 0;
  15049. sp = STACKTOP;
  15050. $3 = +HEAPF32[$2>>2];
  15051. $4 = +HEAPF32[$1>>2];
  15052. $5 = $3 * $4;
  15053. $6 = ((($2)) + 16|0);
  15054. $7 = +HEAPF32[$6>>2];
  15055. $8 = ((($1)) + 4|0);
  15056. $9 = +HEAPF32[$8>>2];
  15057. $10 = $7 * $9;
  15058. $11 = $5 + $10;
  15059. $12 = ((($2)) + 32|0);
  15060. $13 = +HEAPF32[$12>>2];
  15061. $14 = ((($1)) + 8|0);
  15062. $15 = +HEAPF32[$14>>2];
  15063. $16 = $13 * $15;
  15064. $17 = $11 + $16;
  15065. $18 = ((($2)) + 48|0);
  15066. $19 = +HEAPF32[$18>>2];
  15067. $20 = ((($1)) + 12|0);
  15068. $21 = +HEAPF32[$20>>2];
  15069. $22 = $19 * $21;
  15070. $23 = $17 + $22;
  15071. $24 = ((($1)) + 16|0);
  15072. $25 = +HEAPF32[$24>>2];
  15073. $26 = $3 * $25;
  15074. $27 = ((($1)) + 20|0);
  15075. $28 = +HEAPF32[$27>>2];
  15076. $29 = $7 * $28;
  15077. $30 = $26 + $29;
  15078. $31 = ((($1)) + 24|0);
  15079. $32 = +HEAPF32[$31>>2];
  15080. $33 = $13 * $32;
  15081. $34 = $30 + $33;
  15082. $35 = ((($1)) + 28|0);
  15083. $36 = +HEAPF32[$35>>2];
  15084. $37 = $19 * $36;
  15085. $38 = $34 + $37;
  15086. $39 = ((($1)) + 32|0);
  15087. $40 = +HEAPF32[$39>>2];
  15088. $41 = $3 * $40;
  15089. $42 = ((($1)) + 36|0);
  15090. $43 = +HEAPF32[$42>>2];
  15091. $44 = $7 * $43;
  15092. $45 = $41 + $44;
  15093. $46 = ((($1)) + 40|0);
  15094. $47 = +HEAPF32[$46>>2];
  15095. $48 = $13 * $47;
  15096. $49 = $45 + $48;
  15097. $50 = ((($1)) + 44|0);
  15098. $51 = +HEAPF32[$50>>2];
  15099. $52 = $19 * $51;
  15100. $53 = $49 + $52;
  15101. $54 = ((($1)) + 48|0);
  15102. $55 = +HEAPF32[$54>>2];
  15103. $56 = $3 * $55;
  15104. $57 = ((($1)) + 52|0);
  15105. $58 = +HEAPF32[$57>>2];
  15106. $59 = $7 * $58;
  15107. $60 = $56 + $59;
  15108. $61 = ((($1)) + 56|0);
  15109. $62 = +HEAPF32[$61>>2];
  15110. $63 = $13 * $62;
  15111. $64 = $60 + $63;
  15112. $65 = ((($1)) + 60|0);
  15113. $66 = +HEAPF32[$65>>2];
  15114. $67 = $19 * $66;
  15115. $68 = $64 + $67;
  15116. $69 = ((($2)) + 4|0);
  15117. $70 = +HEAPF32[$69>>2];
  15118. $71 = $4 * $70;
  15119. $72 = ((($2)) + 20|0);
  15120. $73 = +HEAPF32[$72>>2];
  15121. $74 = $9 * $73;
  15122. $75 = $71 + $74;
  15123. $76 = ((($2)) + 36|0);
  15124. $77 = +HEAPF32[$76>>2];
  15125. $78 = $15 * $77;
  15126. $79 = $75 + $78;
  15127. $80 = ((($2)) + 52|0);
  15128. $81 = +HEAPF32[$80>>2];
  15129. $82 = $21 * $81;
  15130. $83 = $79 + $82;
  15131. $84 = $25 * $70;
  15132. $85 = $28 * $73;
  15133. $86 = $84 + $85;
  15134. $87 = $32 * $77;
  15135. $88 = $86 + $87;
  15136. $89 = $36 * $81;
  15137. $90 = $88 + $89;
  15138. $91 = $40 * $70;
  15139. $92 = $43 * $73;
  15140. $93 = $91 + $92;
  15141. $94 = $47 * $77;
  15142. $95 = $93 + $94;
  15143. $96 = $51 * $81;
  15144. $97 = $95 + $96;
  15145. $98 = $55 * $70;
  15146. $99 = $58 * $73;
  15147. $100 = $98 + $99;
  15148. $101 = $62 * $77;
  15149. $102 = $100 + $101;
  15150. $103 = $66 * $81;
  15151. $104 = $102 + $103;
  15152. $105 = ((($2)) + 8|0);
  15153. $106 = +HEAPF32[$105>>2];
  15154. $107 = $4 * $106;
  15155. $108 = ((($2)) + 24|0);
  15156. $109 = +HEAPF32[$108>>2];
  15157. $110 = $9 * $109;
  15158. $111 = $107 + $110;
  15159. $112 = ((($2)) + 40|0);
  15160. $113 = +HEAPF32[$112>>2];
  15161. $114 = $15 * $113;
  15162. $115 = $111 + $114;
  15163. $116 = ((($2)) + 56|0);
  15164. $117 = +HEAPF32[$116>>2];
  15165. $118 = $21 * $117;
  15166. $119 = $115 + $118;
  15167. $120 = $25 * $106;
  15168. $121 = $28 * $109;
  15169. $122 = $120 + $121;
  15170. $123 = $32 * $113;
  15171. $124 = $122 + $123;
  15172. $125 = $36 * $117;
  15173. $126 = $124 + $125;
  15174. $127 = $40 * $106;
  15175. $128 = $43 * $109;
  15176. $129 = $127 + $128;
  15177. $130 = $47 * $113;
  15178. $131 = $129 + $130;
  15179. $132 = $51 * $117;
  15180. $133 = $131 + $132;
  15181. $134 = $55 * $106;
  15182. $135 = $58 * $109;
  15183. $136 = $134 + $135;
  15184. $137 = $62 * $113;
  15185. $138 = $136 + $137;
  15186. $139 = $66 * $117;
  15187. $140 = $138 + $139;
  15188. $141 = ((($2)) + 12|0);
  15189. $142 = +HEAPF32[$141>>2];
  15190. $143 = $4 * $142;
  15191. $144 = ((($2)) + 28|0);
  15192. $145 = +HEAPF32[$144>>2];
  15193. $146 = $9 * $145;
  15194. $147 = $143 + $146;
  15195. $148 = ((($2)) + 44|0);
  15196. $149 = +HEAPF32[$148>>2];
  15197. $150 = $15 * $149;
  15198. $151 = $147 + $150;
  15199. $152 = ((($2)) + 60|0);
  15200. $153 = +HEAPF32[$152>>2];
  15201. $154 = $21 * $153;
  15202. $155 = $151 + $154;
  15203. $156 = $25 * $142;
  15204. $157 = $28 * $145;
  15205. $158 = $156 + $157;
  15206. $159 = $32 * $149;
  15207. $160 = $158 + $159;
  15208. $161 = $36 * $153;
  15209. $162 = $160 + $161;
  15210. $163 = $40 * $142;
  15211. $164 = $43 * $145;
  15212. $165 = $163 + $164;
  15213. $166 = $47 * $149;
  15214. $167 = $165 + $166;
  15215. $168 = $51 * $153;
  15216. $169 = $167 + $168;
  15217. $170 = $55 * $142;
  15218. $171 = $58 * $145;
  15219. $172 = $170 + $171;
  15220. $173 = $62 * $149;
  15221. $174 = $172 + $173;
  15222. $175 = $66 * $153;
  15223. $176 = $174 + $175;
  15224. HEAPF32[$0>>2] = $23;
  15225. $$sroa$4$0$$sroa_idx2 = ((($0)) + 4|0);
  15226. HEAPF32[$$sroa$4$0$$sroa_idx2>>2] = $83;
  15227. $$sroa$5$0$$sroa_idx4 = ((($0)) + 8|0);
  15228. HEAPF32[$$sroa$5$0$$sroa_idx4>>2] = $119;
  15229. $$sroa$6$0$$sroa_idx6 = ((($0)) + 12|0);
  15230. HEAPF32[$$sroa$6$0$$sroa_idx6>>2] = $155;
  15231. $$sroa$7$0$$sroa_idx8 = ((($0)) + 16|0);
  15232. HEAPF32[$$sroa$7$0$$sroa_idx8>>2] = $38;
  15233. $$sroa$8$0$$sroa_idx10 = ((($0)) + 20|0);
  15234. HEAPF32[$$sroa$8$0$$sroa_idx10>>2] = $90;
  15235. $$sroa$9$0$$sroa_idx12 = ((($0)) + 24|0);
  15236. HEAPF32[$$sroa$9$0$$sroa_idx12>>2] = $126;
  15237. $$sroa$10$0$$sroa_idx14 = ((($0)) + 28|0);
  15238. HEAPF32[$$sroa$10$0$$sroa_idx14>>2] = $162;
  15239. $$sroa$11$0$$sroa_idx16 = ((($0)) + 32|0);
  15240. HEAPF32[$$sroa$11$0$$sroa_idx16>>2] = $53;
  15241. $$sroa$12$0$$sroa_idx18 = ((($0)) + 36|0);
  15242. HEAPF32[$$sroa$12$0$$sroa_idx18>>2] = $97;
  15243. $$sroa$13$0$$sroa_idx20 = ((($0)) + 40|0);
  15244. HEAPF32[$$sroa$13$0$$sroa_idx20>>2] = $133;
  15245. $$sroa$14$0$$sroa_idx22 = ((($0)) + 44|0);
  15246. HEAPF32[$$sroa$14$0$$sroa_idx22>>2] = $169;
  15247. $$sroa$15$0$$sroa_idx24 = ((($0)) + 48|0);
  15248. HEAPF32[$$sroa$15$0$$sroa_idx24>>2] = $68;
  15249. $$sroa$16$0$$sroa_idx26 = ((($0)) + 52|0);
  15250. HEAPF32[$$sroa$16$0$$sroa_idx26>>2] = $104;
  15251. $$sroa$17$0$$sroa_idx28 = ((($0)) + 56|0);
  15252. HEAPF32[$$sroa$17$0$$sroa_idx28>>2] = $140;
  15253. $$sroa$18$0$$sroa_idx30 = ((($0)) + 60|0);
  15254. HEAPF32[$$sroa$18$0$$sroa_idx30>>2] = $176;
  15255. return;
  15256. }
  15257. function _MatrixOrtho($0,$1,$2,$3,$4,$5,$6) {
  15258. $0 = $0|0;
  15259. $1 = +$1;
  15260. $2 = +$2;
  15261. $3 = +$3;
  15262. $4 = +$4;
  15263. $5 = +$5;
  15264. $6 = +$6;
  15265. var $$sroa$10$0$$sroa_idx24 = 0, $$sroa$11$0$$sroa_idx26 = 0, $$sroa$12$0$$sroa_idx28 = 0, $$sroa$13$0$$sroa_idx30 = 0, $$sroa$14$0$$sroa_idx32 = 0, $$sroa$15$0$$sroa_idx34 = 0, $$sroa$16$0$$sroa_idx36 = 0, $$sroa$17$0$$sroa_idx38 = 0, $$sroa$18$0$$sroa_idx40 = 0, $$sroa$4$0$$sroa_idx12 = 0, $$sroa$5$0$$sroa_idx14 = 0, $$sroa$6$0$$sroa_idx16 = 0, $$sroa$7$0$$sroa_idx18 = 0, $$sroa$8$0$$sroa_idx20 = 0, $$sroa$9$0$$sroa_idx22 = 0, $10 = 0.0, $11 = 0.0, $12 = 0.0, $13 = 0.0, $14 = 0.0;
  15266. var $15 = 0.0, $16 = 0.0, $17 = 0.0, $18 = 0.0, $19 = 0.0, $20 = 0.0, $21 = 0.0, $22 = 0.0, $23 = 0.0, $24 = 0.0, $25 = 0.0, $26 = 0.0, $27 = 0.0, $28 = 0.0, $29 = 0.0, $30 = 0.0, $7 = 0.0, $8 = 0.0, $9 = 0.0, label = 0;
  15267. var sp = 0;
  15268. sp = STACKTOP;
  15269. $7 = $2 - $1;
  15270. $8 = $7;
  15271. $9 = $4 - $3;
  15272. $10 = $9;
  15273. $11 = $6 - $5;
  15274. $12 = $11;
  15275. $13 = 2.0 / $8;
  15276. $14 = 2.0 / $10;
  15277. $15 = -2.0 / $12;
  15278. $16 = $1 + $2;
  15279. $17 = -$16;
  15280. $18 = $8;
  15281. $19 = $17 / $18;
  15282. $20 = $19;
  15283. $21 = $3 + $4;
  15284. $22 = -$21;
  15285. $23 = $10;
  15286. $24 = $22 / $23;
  15287. $25 = $24;
  15288. $26 = $5 + $6;
  15289. $27 = -$26;
  15290. $28 = $12;
  15291. $29 = $27 / $28;
  15292. $30 = $29;
  15293. HEAPF32[$0>>2] = $13;
  15294. $$sroa$4$0$$sroa_idx12 = ((($0)) + 4|0);
  15295. HEAPF32[$$sroa$4$0$$sroa_idx12>>2] = 0.0;
  15296. $$sroa$5$0$$sroa_idx14 = ((($0)) + 8|0);
  15297. HEAPF32[$$sroa$5$0$$sroa_idx14>>2] = 0.0;
  15298. $$sroa$6$0$$sroa_idx16 = ((($0)) + 12|0);
  15299. HEAPF32[$$sroa$6$0$$sroa_idx16>>2] = $20;
  15300. $$sroa$7$0$$sroa_idx18 = ((($0)) + 16|0);
  15301. HEAPF32[$$sroa$7$0$$sroa_idx18>>2] = 0.0;
  15302. $$sroa$8$0$$sroa_idx20 = ((($0)) + 20|0);
  15303. HEAPF32[$$sroa$8$0$$sroa_idx20>>2] = $14;
  15304. $$sroa$9$0$$sroa_idx22 = ((($0)) + 24|0);
  15305. HEAPF32[$$sroa$9$0$$sroa_idx22>>2] = 0.0;
  15306. $$sroa$10$0$$sroa_idx24 = ((($0)) + 28|0);
  15307. HEAPF32[$$sroa$10$0$$sroa_idx24>>2] = $25;
  15308. $$sroa$11$0$$sroa_idx26 = ((($0)) + 32|0);
  15309. HEAPF32[$$sroa$11$0$$sroa_idx26>>2] = 0.0;
  15310. $$sroa$12$0$$sroa_idx28 = ((($0)) + 36|0);
  15311. HEAPF32[$$sroa$12$0$$sroa_idx28>>2] = 0.0;
  15312. $$sroa$13$0$$sroa_idx30 = ((($0)) + 40|0);
  15313. HEAPF32[$$sroa$13$0$$sroa_idx30>>2] = $15;
  15314. $$sroa$14$0$$sroa_idx32 = ((($0)) + 44|0);
  15315. HEAPF32[$$sroa$14$0$$sroa_idx32>>2] = $30;
  15316. $$sroa$15$0$$sroa_idx34 = ((($0)) + 48|0);
  15317. HEAPF32[$$sroa$15$0$$sroa_idx34>>2] = 0.0;
  15318. $$sroa$16$0$$sroa_idx36 = ((($0)) + 52|0);
  15319. HEAPF32[$$sroa$16$0$$sroa_idx36>>2] = 0.0;
  15320. $$sroa$17$0$$sroa_idx38 = ((($0)) + 56|0);
  15321. HEAPF32[$$sroa$17$0$$sroa_idx38>>2] = 0.0;
  15322. $$sroa$18$0$$sroa_idx40 = ((($0)) + 60|0);
  15323. HEAPF32[$$sroa$18$0$$sroa_idx40>>2] = 1.0;
  15324. return;
  15325. }
  15326. function _ProcessGestureEvent($0) {
  15327. $0 = $0|0;
  15328. var $$$sink = 0, $$sink = 0, $$sink10 = 0, $$sink11 = 0, $$sink16 = 0, $1 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0.0, $111 = 0.0;
  15329. var $112 = 0.0, $113 = 0.0, $114 = 0.0, $115 = 0.0, $116 = 0.0, $117 = 0, $118 = 0, $119 = 0, $12 = 0.0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0;
  15330. var $130 = 0, $131 = 0, $132 = 0, $133 = 0, $134 = 0, $135 = 0, $136 = 0, $137 = 0, $138 = 0, $139 = 0, $14 = 0, $140 = 0, $141 = 0, $142 = 0, $143 = 0, $144 = 0, $145 = 0, $146 = 0, $147 = 0, $148 = 0;
  15331. var $149 = 0, $15 = 0, $150 = 0, $151 = 0, $152 = 0, $153 = 0, $154 = 0, $155 = 0, $156 = 0, $157 = 0, $158 = 0, $159 = 0.0, $16 = 0, $160 = 0.0, $161 = 0.0, $162 = 0.0, $163 = 0.0, $164 = 0.0, $165 = 0.0, $166 = 0;
  15332. var $167 = 0.0, $168 = 0, $169 = 0.0, $17 = 0, $170 = 0.0, $171 = 0.0, $172 = 0, $173 = 0.0, $174 = 0.0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0;
  15333. var $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0;
  15334. var $46 = 0, $47 = 0, $48 = 0.0, $49 = 0.0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0.0, $56 = 0.0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0;
  15335. var $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0.0, $81 = 0;
  15336. var $82 = 0.0, $83 = 0.0, $84 = 0.0, $85 = 0.0, $86 = 0.0, $87 = 0.0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $moveDownPosition$byval_copy11 = 0;
  15337. var $moveDownPosition2$byval_copy12 = 0, $or$cond = 0, $or$cond3 = 0, $or$cond5 = 0, $or$cond7 = 0, $or$cond9 = 0, label = 0, sp = 0;
  15338. sp = STACKTOP;
  15339. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  15340. $moveDownPosition2$byval_copy12 = sp + 8|0;
  15341. $moveDownPosition$byval_copy11 = sp;
  15342. $1 = ((($0)) + 4|0);
  15343. $2 = HEAP32[$1>>2]|0;
  15344. HEAP32[7740] = $2;
  15345. $3 = ($2|0)<(2);
  15346. $4 = HEAP32[$0>>2]|0;
  15347. $5 = ($4|0)==(1);
  15348. if (!($3)) {
  15349. if ($5) {
  15350. $88 = ((($0)) + 24|0);
  15351. $89 = $88;
  15352. $90 = $89;
  15353. $91 = HEAP32[$90>>2]|0;
  15354. $92 = (($89) + 4)|0;
  15355. $93 = $92;
  15356. $94 = HEAP32[$93>>2]|0;
  15357. $95 = 14000;
  15358. $96 = $95;
  15359. HEAP32[$96>>2] = $91;
  15360. $97 = (($95) + 4)|0;
  15361. $98 = $97;
  15362. HEAP32[$98>>2] = $94;
  15363. $99 = ((($0)) + 32|0);
  15364. $100 = $99;
  15365. $101 = $100;
  15366. $102 = HEAP32[$101>>2]|0;
  15367. $103 = (($100) + 4)|0;
  15368. $104 = $103;
  15369. $105 = HEAP32[$104>>2]|0;
  15370. $106 = 14040;
  15371. $107 = $106;
  15372. HEAP32[$107>>2] = $102;
  15373. $108 = (($106) + 4)|0;
  15374. $109 = $108;
  15375. HEAP32[$109>>2] = $105;
  15376. $110 = +HEAPF32[3510];
  15377. $111 = +HEAPF32[3500];
  15378. $112 = $110 - $111;
  15379. HEAPF32[3512] = $112;
  15380. $113 = +HEAPF32[(14044)>>2];
  15381. $114 = +HEAPF32[(14004)>>2];
  15382. $115 = $113 - $114;
  15383. HEAPF32[(14052)>>2] = $115;
  15384. HEAP32[7739] = 4;
  15385. STACKTOP = sp;return;
  15386. }
  15387. switch ($4|0) {
  15388. case 2: {
  15389. ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14032>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14032+4>>2]|0;
  15390. ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14056>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14056+4>>2]|0;
  15391. $116 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
  15392. HEAPF32[7745] = $116;
  15393. $117 = 14032;
  15394. $118 = $117;
  15395. $119 = HEAP32[$118>>2]|0;
  15396. $120 = (($117) + 4)|0;
  15397. $121 = $120;
  15398. $122 = HEAP32[$121>>2]|0;
  15399. $123 = 14000;
  15400. $124 = $123;
  15401. HEAP32[$124>>2] = $119;
  15402. $125 = (($123) + 4)|0;
  15403. $126 = $125;
  15404. HEAP32[$126>>2] = $122;
  15405. $127 = 14056;
  15406. $128 = $127;
  15407. $129 = HEAP32[$128>>2]|0;
  15408. $130 = (($127) + 4)|0;
  15409. $131 = $130;
  15410. $132 = HEAP32[$131>>2]|0;
  15411. $133 = 14040;
  15412. $134 = $133;
  15413. HEAP32[$134>>2] = $129;
  15414. $135 = (($133) + 4)|0;
  15415. $136 = $135;
  15416. HEAP32[$136>>2] = $132;
  15417. $137 = ((($0)) + 24|0);
  15418. $138 = $137;
  15419. $139 = $138;
  15420. $140 = HEAP32[$139>>2]|0;
  15421. $141 = (($138) + 4)|0;
  15422. $142 = $141;
  15423. $143 = HEAP32[$142>>2]|0;
  15424. $144 = 14032;
  15425. $145 = $144;
  15426. HEAP32[$145>>2] = $140;
  15427. $146 = (($144) + 4)|0;
  15428. $147 = $146;
  15429. HEAP32[$147>>2] = $143;
  15430. $148 = ((($0)) + 32|0);
  15431. $149 = $148;
  15432. $150 = $149;
  15433. $151 = HEAP32[$150>>2]|0;
  15434. $152 = (($149) + 4)|0;
  15435. $153 = $152;
  15436. $154 = HEAP32[$153>>2]|0;
  15437. $155 = 14056;
  15438. $156 = $155;
  15439. HEAP32[$156>>2] = $151;
  15440. $157 = (($155) + 4)|0;
  15441. $158 = $157;
  15442. HEAP32[$158>>2] = $154;
  15443. $159 = +HEAPF32[3514];
  15444. $160 = +HEAPF32[3508];
  15445. $161 = $159 - $160;
  15446. HEAPF32[3512] = $161;
  15447. $162 = +HEAPF32[(14060)>>2];
  15448. $163 = +HEAPF32[(14036)>>2];
  15449. $164 = $162 - $163;
  15450. HEAPF32[(14052)>>2] = $164;
  15451. ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14000>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14000+4>>2]|0;
  15452. ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14032>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14032+4>>2]|0;
  15453. $165 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
  15454. $166 = !($165 >= 0.004999999888241291);
  15455. if ($166) {
  15456. ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14040>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14040+4>>2]|0;
  15457. ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14056>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14056+4>>2]|0;
  15458. $167 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
  15459. $168 = !($167 >= 0.004999999888241291);
  15460. if ($168) {
  15461. $$sink16 = 4;
  15462. } else {
  15463. label = 29;
  15464. }
  15465. } else {
  15466. label = 29;
  15467. }
  15468. if ((label|0) == 29) {
  15469. ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14032>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14032+4>>2]|0;
  15470. ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14056>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14056+4>>2]|0;
  15471. $169 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
  15472. $170 = +HEAPF32[7745];
  15473. $171 = $169 - $170;
  15474. $172 = $171 < 0.0;
  15475. $$sink11 = $172 ? 256 : 512;
  15476. $$sink16 = $$sink11;
  15477. }
  15478. HEAP32[7739] = $$sink16;
  15479. ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14032>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14032+4>>2]|0;
  15480. ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14056>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14056+4>>2]|0;
  15481. $173 = (+_Vector2Angle($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
  15482. $174 = 360.0 - $173;
  15483. HEAPF32[7746] = $174;
  15484. STACKTOP = sp;return;
  15485. break;
  15486. }
  15487. case 0: {
  15488. HEAPF32[7745] = 0.0;
  15489. HEAPF32[7746] = 0.0;
  15490. HEAPF32[3512] = 0.0;
  15491. HEAPF32[(14052)>>2] = 0.0;
  15492. HEAP32[7740] = 0;
  15493. HEAP32[7739] = 0;
  15494. STACKTOP = sp;return;
  15495. break;
  15496. }
  15497. default: {
  15498. STACKTOP = sp;return;
  15499. }
  15500. }
  15501. }
  15502. if ($5) {
  15503. $6 = HEAP32[7741]|0;
  15504. $7 = (($6) + 1)|0;
  15505. HEAP32[7741] = $7;
  15506. $8 = HEAP32[7739]|0;
  15507. $9 = ($8|0)==(0);
  15508. $10 = ($6|0)>(0);
  15509. $or$cond = $10 & $9;
  15510. if ($or$cond) {
  15511. $11 = ((($0)) + 24|0);
  15512. ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14000>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14000+4>>2]|0;
  15513. ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[$11>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[$11+4>>2]|0;
  15514. $12 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
  15515. $13 = $12 < 0.029999999329447746;
  15516. if ($13) {
  15517. HEAP32[7739] = 2;
  15518. HEAP32[7741] = 0;
  15519. } else {
  15520. label = 6;
  15521. }
  15522. } else {
  15523. label = 6;
  15524. }
  15525. if ((label|0) == 6) {
  15526. HEAP32[7741] = 1;
  15527. HEAP32[7739] = 1;
  15528. }
  15529. $14 = ((($0)) + 24|0);
  15530. $15 = $14;
  15531. $16 = $15;
  15532. $17 = HEAP32[$16>>2]|0;
  15533. $18 = (($15) + 4)|0;
  15534. $19 = $18;
  15535. $20 = HEAP32[$19>>2]|0;
  15536. $21 = 14000;
  15537. $22 = $21;
  15538. HEAP32[$22>>2] = $17;
  15539. $23 = (($21) + 4)|0;
  15540. $24 = $23;
  15541. HEAP32[$24>>2] = $20;
  15542. $25 = 14008;
  15543. $26 = $25;
  15544. HEAP32[$26>>2] = $17;
  15545. $27 = (($25) + 4)|0;
  15546. $28 = $27;
  15547. HEAP32[$28>>2] = $20;
  15548. $29 = 14016;
  15549. $30 = $29;
  15550. HEAP32[$30>>2] = $17;
  15551. $31 = (($29) + 4)|0;
  15552. $32 = $31;
  15553. HEAP32[$32>>2] = $20;
  15554. $33 = ((($0)) + 8|0);
  15555. $34 = HEAP32[$33>>2]|0;
  15556. HEAP32[6] = $34;
  15557. HEAPF32[3506] = 0.0;
  15558. HEAPF32[(14028)>>2] = 0.0;
  15559. STACKTOP = sp;return;
  15560. }
  15561. switch ($4|0) {
  15562. case 0: {
  15563. $35 = HEAP32[7739]|0;
  15564. $36 = ($35|0)==(8);
  15565. if ($36) {
  15566. $37 = ((($0)) + 24|0);
  15567. $38 = $37;
  15568. $39 = $38;
  15569. $40 = HEAP32[$39>>2]|0;
  15570. $41 = (($38) + 4)|0;
  15571. $42 = $41;
  15572. $43 = HEAP32[$42>>2]|0;
  15573. $44 = 14016;
  15574. $45 = $44;
  15575. HEAP32[$45>>2] = $40;
  15576. $46 = (($44) + 4)|0;
  15577. $47 = $46;
  15578. HEAP32[$47>>2] = $43;
  15579. }
  15580. ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14000>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14000+4>>2]|0;
  15581. ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14016>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14016+4>>2]|0;
  15582. $48 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
  15583. $49 = $48 / 0.0;
  15584. HEAPF32[7742] = $49;
  15585. HEAP32[7743] = 0;
  15586. $50 = $49 > 5.0000002374872565E-4;
  15587. if ($50) {
  15588. $51 = HEAP32[6]|0;
  15589. $52 = ((($0)) + 8|0);
  15590. $53 = HEAP32[$52>>2]|0;
  15591. $54 = ($51|0)==($53|0);
  15592. if ($54) {
  15593. ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14000>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14000+4>>2]|0;
  15594. ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14016>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14016+4>>2]|0;
  15595. $55 = (+_Vector2Angle($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
  15596. $56 = 360.0 - $55;
  15597. HEAPF32[7744] = $56;
  15598. $57 = $56 < 30.0;
  15599. $58 = $56 > 330.0;
  15600. $or$cond3 = $57 | $58;
  15601. if ($or$cond3) {
  15602. $$sink10 = 16;
  15603. } else {
  15604. $59 = $56 > 30.0;
  15605. $60 = $56 < 120.0;
  15606. $or$cond5 = $59 & $60;
  15607. if ($or$cond5) {
  15608. $$sink10 = 64;
  15609. } else {
  15610. $61 = $56 > 120.0;
  15611. $62 = $56 < 210.0;
  15612. $or$cond7 = $61 & $62;
  15613. $63 = $56 > 210.0;
  15614. $64 = $56 < 300.0;
  15615. $or$cond9 = $63 & $64;
  15616. $$sink = $or$cond9 ? 128 : 0;
  15617. $$$sink = $or$cond7 ? 32 : $$sink;
  15618. $$sink10 = $$$sink;
  15619. }
  15620. }
  15621. } else {
  15622. label = 16;
  15623. }
  15624. } else {
  15625. label = 16;
  15626. }
  15627. if ((label|0) == 16) {
  15628. HEAPF32[7742] = 0.0;
  15629. HEAPF32[7744] = 0.0;
  15630. $$sink10 = 0;
  15631. }
  15632. HEAP32[7739] = $$sink10;
  15633. HEAPF32[3502] = 0.0;
  15634. HEAPF32[(14012)>>2] = 0.0;
  15635. HEAP32[7740] = 0;
  15636. STACKTOP = sp;return;
  15637. break;
  15638. }
  15639. case 2: {
  15640. $65 = HEAP32[7743]|0;
  15641. $66 = ($65|0)==(0);
  15642. if ($66) {
  15643. HEAP32[7743] = 1;
  15644. }
  15645. $67 = ((($0)) + 24|0);
  15646. $68 = $67;
  15647. $69 = $68;
  15648. $70 = HEAP32[$69>>2]|0;
  15649. $71 = (($68) + 4)|0;
  15650. $72 = $71;
  15651. $73 = HEAP32[$72>>2]|0;
  15652. $74 = 14032;
  15653. $75 = $74;
  15654. HEAP32[$75>>2] = $70;
  15655. $76 = (($74) + 4)|0;
  15656. $77 = $76;
  15657. HEAP32[$77>>2] = $73;
  15658. $78 = HEAP32[7739]|0;
  15659. $79 = ($78|0)==(4);
  15660. if ($79) {
  15661. ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14000>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14000+4>>2]|0;
  15662. ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14032>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14032+4>>2]|0;
  15663. $80 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
  15664. $81 = !($80 >= 0.014999999664723873);
  15665. if (!($81)) {
  15666. HEAP32[7739] = 8;
  15667. }
  15668. }
  15669. $82 = +HEAPF32[3508];
  15670. $83 = +HEAPF32[3502];
  15671. $84 = $82 - $83;
  15672. HEAPF32[3506] = $84;
  15673. $85 = +HEAPF32[(14036)>>2];
  15674. $86 = +HEAPF32[(14012)>>2];
  15675. $87 = $85 - $86;
  15676. HEAPF32[(14028)>>2] = $87;
  15677. STACKTOP = sp;return;
  15678. break;
  15679. }
  15680. default: {
  15681. STACKTOP = sp;return;
  15682. }
  15683. }
  15684. }
  15685. function _UpdateGestures() {
  15686. var $$off = 0, $0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $or$cond3 = 0, label = 0, sp = 0;
  15687. sp = STACKTOP;
  15688. $0 = HEAP32[7739]|0;
  15689. $$off = (($0) + -1)|0;
  15690. $1 = ($$off>>>0)<(2);
  15691. $2 = HEAP32[7740]|0;
  15692. $3 = ($2|0)<(2);
  15693. $or$cond3 = $1 & $3;
  15694. if ($or$cond3) {
  15695. HEAP32[7739] = 4;
  15696. }
  15697. $4 = HEAP32[7739]|0;
  15698. $5 = (($4) + -16)|0;
  15699. $6 = $5 >>> 4;
  15700. $7 = $5 << 28;
  15701. $8 = $6 | $7;
  15702. switch ($8|0) {
  15703. case 0: case 1: case 3: case 7: {
  15704. break;
  15705. }
  15706. default: {
  15707. return;
  15708. }
  15709. }
  15710. HEAP32[7739] = 0;
  15711. return;
  15712. }
  15713. function _GetMousePosition($0) {
  15714. $0 = $0|0;
  15715. var $1 = 0, $10 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  15716. sp = STACKTOP;
  15717. $1 = 14064;
  15718. $2 = $1;
  15719. $3 = HEAP32[$2>>2]|0;
  15720. $4 = (($1) + 4)|0;
  15721. $5 = $4;
  15722. $6 = HEAP32[$5>>2]|0;
  15723. $7 = $0;
  15724. $8 = $7;
  15725. HEAP32[$8>>2] = $3;
  15726. $9 = (($7) + 4)|0;
  15727. $10 = $9;
  15728. HEAP32[$10>>2] = $6;
  15729. return;
  15730. }
  15731. function _GetScreenWidth() {
  15732. var $0 = 0, label = 0, sp = 0;
  15733. sp = STACKTOP;
  15734. $0 = HEAP32[7749]|0;
  15735. return ($0|0);
  15736. }
  15737. function _GetScreenHeight() {
  15738. var $0 = 0, label = 0, sp = 0;
  15739. sp = STACKTOP;
  15740. $0 = HEAP32[7748]|0;
  15741. return ($0|0);
  15742. }
  15743. function _InitWindow($0,$1,$2) {
  15744. $0 = $0|0;
  15745. $1 = $1|0;
  15746. $2 = $2|0;
  15747. var $10 = 0, $3 = 0, $4 = 0.0, $5 = 0.0, $6 = 0, $7 = 0.0, $8 = 0.0, $9 = 0, $vararg_buffer = 0, label = 0, sp = 0;
  15748. sp = STACKTOP;
  15749. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  15750. $vararg_buffer = sp;
  15751. _TraceLog(0,3358,$vararg_buffer);
  15752. HEAP32[7751] = $2;
  15753. _InitGraphicsDevice($0,$1);
  15754. _LoadDefaultFont();
  15755. _InitTimer_10();
  15756. (_emscripten_set_fullscreenchange_callback((0|0),(0|0),1,(4|0))|0);
  15757. (_emscripten_set_keypress_callback((3387|0),(0|0),1,(5|0))|0);
  15758. (_emscripten_set_click_callback((3387|0),(0|0),1,(6|0))|0);
  15759. (_emscripten_set_touchstart_callback((3387|0),(0|0),1,(7|0))|0);
  15760. (_emscripten_set_touchend_callback((3387|0),(0|0),1,(7|0))|0);
  15761. (_emscripten_set_touchmove_callback((3387|0),(0|0),1,(7|0))|0);
  15762. (_emscripten_set_touchcancel_callback((3387|0),(0|0),1,(7|0))|0);
  15763. (_emscripten_set_gamepadconnected_callback((0|0),1,(8|0))|0);
  15764. (_emscripten_set_gamepaddisconnected_callback((0|0),1,(8|0))|0);
  15765. $3 = HEAP32[7749]|0;
  15766. $4 = (+($3|0));
  15767. $5 = $4 * 0.5;
  15768. HEAPF32[3516] = $5;
  15769. $6 = HEAP32[7748]|0;
  15770. $7 = (+($6|0));
  15771. $8 = $7 * 0.5;
  15772. HEAPF32[(14068)>>2] = $8;
  15773. $9 = HEAP32[7752]|0;
  15774. $10 = ($9|0)==(0);
  15775. if ($10) {
  15776. STACKTOP = sp;return;
  15777. }
  15778. _SetTargetFPS(60);
  15779. _LogoAnimation();
  15780. STACKTOP = sp;return;
  15781. }
  15782. function _TraceLog($0,$1,$varargs) {
  15783. $0 = $0|0;
  15784. $1 = $1|0;
  15785. $varargs = $varargs|0;
  15786. var $10 = 0, $11 = 0, $12 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $endptr = 0, $strlen = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  15787. sp = STACKTOP;
  15788. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  15789. $2 = sp;
  15790. switch ($0|0) {
  15791. case 0: {
  15792. ;HEAP8[14104>>0]=HEAP8[7916>>0]|0;HEAP8[14104+1>>0]=HEAP8[7916+1>>0]|0;HEAP8[14104+2>>0]=HEAP8[7916+2>>0]|0;HEAP8[14104+3>>0]=HEAP8[7916+3>>0]|0;HEAP8[14104+4>>0]=HEAP8[7916+4>>0]|0;HEAP8[14104+5>>0]=HEAP8[7916+5>>0]|0;HEAP8[14104+6>>0]=HEAP8[7916+6>>0]|0;
  15793. break;
  15794. }
  15795. case 1: {
  15796. $3 = 14104;
  15797. $4 = $3;
  15798. HEAP32[$4>>2] = 1330795077;
  15799. $5 = (($3) + 4)|0;
  15800. $6 = $5;
  15801. HEAP32[$6>>2] = 2112082;
  15802. break;
  15803. }
  15804. case 2: {
  15805. dest=14104; src=7923; stop=dest+10|0; do { HEAP8[dest>>0]=HEAP8[src>>0]|0; dest=dest+1|0; src=src+1|0; } while ((dest|0) < (stop|0));
  15806. break;
  15807. }
  15808. case 3: {
  15809. $7 = 14104;
  15810. $8 = $7;
  15811. HEAP32[$8>>2] = 1430406468;
  15812. $9 = (($7) + 4)|0;
  15813. $10 = $9;
  15814. HEAP32[$10>>2] = 2112071;
  15815. break;
  15816. }
  15817. default: {
  15818. }
  15819. }
  15820. (_strcat(14104,$1)|0);
  15821. $strlen = (_strlen(14104)|0);
  15822. $endptr = (14104 + ($strlen)|0);
  15823. HEAP8[$endptr>>0]=10&255;HEAP8[$endptr+1>>0]=10>>8;
  15824. HEAP32[$2>>2] = $varargs;
  15825. $11 = ($0|0)==(3);
  15826. if ($11) {
  15827. STACKTOP = sp;return;
  15828. }
  15829. (_vprintf(14104,$2)|0);
  15830. $12 = ($0|0)==(1);
  15831. if ($12) {
  15832. _exit(1);
  15833. // unreachable;
  15834. } else {
  15835. STACKTOP = sp;return;
  15836. }
  15837. }
  15838. function _InitGraphicsDevice($0,$1) {
  15839. $0 = $0|0;
  15840. $1 = $1|0;
  15841. var $$015 = 0, $$byval_copy = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
  15842. var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
  15843. var $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0;
  15844. var $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0.0, $79 = 0, $8 = 0, $80 = 0;
  15845. var $81 = 0, $82 = 0.0, $83 = 0, $84 = 0, $85 = 0, $9 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, $vararg_buffer10 = 0, $vararg_buffer14 = 0, $vararg_buffer18 = 0, $vararg_buffer22 = 0, $vararg_buffer3 = 0, $vararg_buffer6 = 0, $vararg_buffer8 = 0, $vararg_ptr13 = 0, $vararg_ptr17 = 0, $vararg_ptr21 = 0, $vararg_ptr5 = 0, dest = 0;
  15846. var label = 0, sp = 0, src = 0, stop = 0;
  15847. sp = STACKTOP;
  15848. STACKTOP = STACKTOP + 144|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(144|0);
  15849. $$byval_copy = sp + 136|0;
  15850. $vararg_buffer22 = sp + 64|0;
  15851. $vararg_buffer18 = sp + 56|0;
  15852. $vararg_buffer14 = sp + 48|0;
  15853. $vararg_buffer10 = sp + 40|0;
  15854. $vararg_buffer8 = sp + 32|0;
  15855. $vararg_buffer6 = sp + 24|0;
  15856. $vararg_buffer3 = sp + 16|0;
  15857. $vararg_buffer1 = sp + 8|0;
  15858. $vararg_buffer = sp;
  15859. $2 = sp + 72|0;
  15860. $3 = sp + 140|0;
  15861. HEAP32[7749] = $0;
  15862. HEAP32[7748] = $1;
  15863. _MatrixIdentity($2);
  15864. dest=31084; src=$2; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  15865. (_glfwSetErrorCallback((1|0))|0);
  15866. $4 = (_glfwInit()|0);
  15867. $5 = ($4|0)==(0);
  15868. if ($5) {
  15869. _TraceLog(1,4058,$vararg_buffer);
  15870. }
  15871. $6 = HEAP32[7749]|0;
  15872. HEAP32[7787] = $6;
  15873. $7 = HEAP32[7748]|0;
  15874. HEAP32[7788] = $7;
  15875. _glfwDefaultWindowHints();
  15876. $8 = HEAP8[35960]|0;
  15877. $9 = $8 & 4;
  15878. $10 = ($9<<24>>24)==(0);
  15879. if ($10) {
  15880. _glfwWindowHint(131075,0);
  15881. } else {
  15882. _glfwWindowHint(131075,1);
  15883. }
  15884. $11 = HEAP8[35960]|0;
  15885. $12 = $11 & 8;
  15886. $13 = ($12<<24>>24)==(0);
  15887. if (!($13)) {
  15888. _glfwWindowHint(131077,1);
  15889. }
  15890. $14 = HEAP8[35960]|0;
  15891. $15 = $14 & 32;
  15892. $16 = ($15<<24>>24)==(0);
  15893. if (!($16)) {
  15894. _glfwWindowHint(135181,4);
  15895. _TraceLog(0,4084,$vararg_buffer1);
  15896. }
  15897. $17 = (_rlGetVersion()|0);
  15898. $18 = ($17|0)==(2);
  15899. if ($18) {
  15900. _glfwWindowHint(139266,2);
  15901. _glfwWindowHint(139267,1);
  15902. } else {
  15903. $19 = (_rlGetVersion()|0);
  15904. $20 = ($19|0)==(3);
  15905. if ($20) {
  15906. _glfwWindowHint(139266,3);
  15907. _glfwWindowHint(139267,3);
  15908. _glfwWindowHint(139272,204801);
  15909. _glfwWindowHint(139270,0);
  15910. }
  15911. }
  15912. $21 = HEAP32[7789]|0;
  15913. $22 = ($21|0)==(0);
  15914. if ($22) {
  15915. $47 = HEAP32[7749]|0;
  15916. $48 = HEAP32[7748]|0;
  15917. $49 = HEAP32[7751]|0;
  15918. $50 = (_glfwCreateWindow(($47|0),($48|0),($49|0),(0|0),(0|0))|0);
  15919. HEAP32[7747] = $50;
  15920. $51 = HEAP32[7749]|0;
  15921. HEAP32[7790] = $51;
  15922. $52 = HEAP32[7748]|0;
  15923. HEAP32[7791] = $52;
  15924. $54 = $50;
  15925. } else {
  15926. $23 = (_glfwGetPrimaryMonitor()|0);
  15927. $24 = (_glfwGetVideoModes(($23|0),($$byval_copy|0))|0);
  15928. $25 = HEAP32[$$byval_copy>>2]|0;
  15929. $26 = ($25|0)>(0);
  15930. L22: do {
  15931. if ($26) {
  15932. $27 = HEAP32[7749]|0;
  15933. $28 = HEAP32[$$byval_copy>>2]|0;
  15934. $29 = HEAP32[7748]|0;
  15935. $$015 = 0;
  15936. while(1) {
  15937. $30 = (($24) + (($$015*24)|0)|0);
  15938. $31 = HEAP32[$30>>2]|0;
  15939. $32 = ($31|0)<($27|0);
  15940. if (!($32)) {
  15941. $33 = (((($24) + (($$015*24)|0)|0)) + 4|0);
  15942. $34 = HEAP32[$33>>2]|0;
  15943. $35 = ($34|0)<($29|0);
  15944. if (!($35)) {
  15945. break;
  15946. }
  15947. }
  15948. $36 = (($$015) + 1)|0;
  15949. $37 = ($36|0)<($28|0);
  15950. if ($37) {
  15951. $$015 = $36;
  15952. } else {
  15953. break L22;
  15954. }
  15955. }
  15956. HEAP32[7787] = $31;
  15957. HEAP32[7788] = $34;
  15958. }
  15959. } while(0);
  15960. $38 = HEAP32[7787]|0;
  15961. $39 = HEAP32[7788]|0;
  15962. HEAP32[$vararg_buffer3>>2] = $38;
  15963. $vararg_ptr5 = ((($vararg_buffer3)) + 4|0);
  15964. HEAP32[$vararg_ptr5>>2] = $39;
  15965. _TraceLog(2,4109,$vararg_buffer3);
  15966. $40 = HEAP32[7787]|0;
  15967. $41 = HEAP32[7788]|0;
  15968. _SetupFramebufferSize($40,$41);
  15969. $42 = HEAP32[7787]|0;
  15970. $43 = HEAP32[7788]|0;
  15971. $44 = HEAP32[7751]|0;
  15972. $45 = (_glfwGetPrimaryMonitor()|0);
  15973. $46 = (_glfwCreateWindow(($42|0),($43|0),($44|0),($45|0),(0|0))|0);
  15974. HEAP32[7747] = $46;
  15975. $54 = $46;
  15976. }
  15977. $53 = ($54|0)==(0|0);
  15978. if ($53) {
  15979. _glfwTerminate();
  15980. _TraceLog(1,4147,$vararg_buffer6);
  15981. } else {
  15982. _TraceLog(0,4180,$vararg_buffer8);
  15983. $55 = HEAP32[7790]|0;
  15984. $56 = HEAP32[7791]|0;
  15985. HEAP32[$vararg_buffer10>>2] = $55;
  15986. $vararg_ptr13 = ((($vararg_buffer10)) + 4|0);
  15987. HEAP32[$vararg_ptr13>>2] = $56;
  15988. _TraceLog(0,4220,$vararg_buffer10);
  15989. $57 = HEAP32[7749]|0;
  15990. $58 = HEAP32[7748]|0;
  15991. HEAP32[$vararg_buffer14>>2] = $57;
  15992. $vararg_ptr17 = ((($vararg_buffer14)) + 4|0);
  15993. HEAP32[$vararg_ptr17>>2] = $58;
  15994. _TraceLog(0,4241,$vararg_buffer14);
  15995. $59 = HEAP32[7792]|0;
  15996. $60 = HEAP32[7793]|0;
  15997. HEAP32[$vararg_buffer18>>2] = $59;
  15998. $vararg_ptr21 = ((($vararg_buffer18)) + 4|0);
  15999. HEAP32[$vararg_ptr21>>2] = $60;
  16000. _TraceLog(0,4262,$vararg_buffer18);
  16001. }
  16002. $61 = HEAP32[7747]|0;
  16003. (_glfwSetWindowSizeCallback(($61|0),(1|0))|0);
  16004. $62 = HEAP32[7747]|0;
  16005. (_glfwSetCursorEnterCallback(($62|0),(2|0))|0);
  16006. $63 = HEAP32[7747]|0;
  16007. (_glfwSetKeyCallback(($63|0),(1|0))|0);
  16008. $64 = HEAP32[7747]|0;
  16009. (_glfwSetMouseButtonCallback(($64|0),(1|0))|0);
  16010. $65 = HEAP32[7747]|0;
  16011. (_glfwSetCursorPosCallback(($65|0),(1|0))|0);
  16012. $66 = HEAP32[7747]|0;
  16013. (_glfwSetCharCallback(($66|0),(3|0))|0);
  16014. $67 = HEAP32[7747]|0;
  16015. (_glfwSetScrollCallback(($67|0),(2|0))|0);
  16016. $68 = HEAP32[7747]|0;
  16017. (_glfwSetWindowIconifyCallback(($68|0),(4|0))|0);
  16018. $69 = HEAP32[7747]|0;
  16019. _glfwMakeContextCurrent(($69|0));
  16020. _glfwSwapInterval(0);
  16021. $70 = HEAP8[35960]|0;
  16022. $71 = $70 & 64;
  16023. $72 = ($71<<24>>24)==(0);
  16024. if ($72) {
  16025. $73 = HEAP32[7749]|0;
  16026. $74 = HEAP32[7748]|0;
  16027. _rlglInit($73,$74);
  16028. _SetupViewport();
  16029. _rlMatrixMode(5889);
  16030. _rlLoadIdentity();
  16031. $75 = HEAP32[7790]|0;
  16032. $76 = HEAP32[7792]|0;
  16033. $77 = (($75) - ($76))|0;
  16034. $78 = (+($77|0));
  16035. $79 = HEAP32[7791]|0;
  16036. $80 = HEAP32[7793]|0;
  16037. $81 = (($79) - ($80))|0;
  16038. $82 = (+($81|0));
  16039. _rlOrtho(0.0,$78,$82,0.0,0.0,1.0);
  16040. _rlMatrixMode(5888);
  16041. _rlLoadIdentity();
  16042. HEAP8[$3>>0] = -11;
  16043. $83 = ((($3)) + 1|0);
  16044. HEAP8[$83>>0] = -11;
  16045. $84 = ((($3)) + 2|0);
  16046. HEAP8[$84>>0] = -11;
  16047. $85 = ((($3)) + 3|0);
  16048. HEAP8[$85>>0] = -1;
  16049. ;HEAP8[$$byval_copy>>0]=HEAP8[$3>>0]|0;HEAP8[$$byval_copy+1>>0]=HEAP8[$3+1>>0]|0;HEAP8[$$byval_copy+2>>0]=HEAP8[$3+2>>0]|0;HEAP8[$$byval_copy+3>>0]=HEAP8[$3+3>>0]|0;
  16050. _ClearBackground($$byval_copy);
  16051. STACKTOP = sp;return;
  16052. }
  16053. _glfwSwapInterval(1);
  16054. _TraceLog(0,4287,$vararg_buffer22);
  16055. $73 = HEAP32[7749]|0;
  16056. $74 = HEAP32[7748]|0;
  16057. _rlglInit($73,$74);
  16058. _SetupViewport();
  16059. _rlMatrixMode(5889);
  16060. _rlLoadIdentity();
  16061. $75 = HEAP32[7790]|0;
  16062. $76 = HEAP32[7792]|0;
  16063. $77 = (($75) - ($76))|0;
  16064. $78 = (+($77|0));
  16065. $79 = HEAP32[7791]|0;
  16066. $80 = HEAP32[7793]|0;
  16067. $81 = (($79) - ($80))|0;
  16068. $82 = (+($81|0));
  16069. _rlOrtho(0.0,$78,$82,0.0,0.0,1.0);
  16070. _rlMatrixMode(5888);
  16071. _rlLoadIdentity();
  16072. HEAP8[$3>>0] = -11;
  16073. $83 = ((($3)) + 1|0);
  16074. HEAP8[$83>>0] = -11;
  16075. $84 = ((($3)) + 2|0);
  16076. HEAP8[$84>>0] = -11;
  16077. $85 = ((($3)) + 3|0);
  16078. HEAP8[$85>>0] = -1;
  16079. ;HEAP8[$$byval_copy>>0]=HEAP8[$3>>0]|0;HEAP8[$$byval_copy+1>>0]=HEAP8[$3+1>>0]|0;HEAP8[$$byval_copy+2>>0]=HEAP8[$3+2>>0]|0;HEAP8[$$byval_copy+3>>0]=HEAP8[$3+3>>0]|0;
  16080. _ClearBackground($$byval_copy);
  16081. STACKTOP = sp;return;
  16082. }
  16083. function _LoadDefaultFont() {
  16084. var $$ = 0, $$0101 = 0, $$090100 = 0, $$09299 = 0, $$095104 = 0, $$096103 = 0, $$097102 = 0, $$191 = 0, $$193 = 0, $$byval_copy1 = 0, $$lcssa = 0, $$sroa$0$0$$sroa_idx = 0, $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0;
  16085. var $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0;
  16086. var $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0;
  16087. var $vararg_buffer = 0, label = 0, sp = 0;
  16088. sp = STACKTOP;
  16089. STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
  16090. $$byval_copy1 = sp + 44|0;
  16091. $vararg_buffer = sp;
  16092. $0 = sp + 4|0;
  16093. $1 = sp + 24|0;
  16094. HEAP32[(31052)>>2] = 224;
  16095. $2 = (_malloc(65536)|0);
  16096. _memset(($2|0),0,65536)|0;
  16097. $$095104 = 0;$$096103 = 0;
  16098. while(1) {
  16099. $3 = (28 + ($$095104<<2)|0);
  16100. $4 = HEAP32[$3>>2]|0;
  16101. $$097102 = 31;
  16102. while(1) {
  16103. $16 = 1 << $$097102;
  16104. $17 = $4 & $16;
  16105. $18 = ($17|0)==(0);
  16106. if (!($18)) {
  16107. $19 = (($$097102) + ($$096103))|0;
  16108. $$sroa$0$0$$sroa_idx = (($2) + ($19<<2)|0);
  16109. HEAP8[$$sroa$0$0$$sroa_idx>>0]=-1&255;HEAP8[$$sroa$0$0$$sroa_idx+1>>0]=(-1>>8)&255;HEAP8[$$sroa$0$0$$sroa_idx+2>>0]=(-1>>16)&255;HEAP8[$$sroa$0$0$$sroa_idx+3>>0]=-1>>24;
  16110. }
  16111. $20 = (($$097102) + -1)|0;
  16112. $21 = ($$097102|0)>(0);
  16113. if ($21) {
  16114. $$097102 = $20;
  16115. } else {
  16116. break;
  16117. }
  16118. }
  16119. $12 = (($$095104) + 1)|0;
  16120. $13 = ($$095104|0)>(511);
  16121. $$ = $13 ? 0 : $12;
  16122. $14 = (($$096103) + 32)|0;
  16123. $15 = ($14|0)<(16384);
  16124. if ($15) {
  16125. $$095104 = $$;$$096103 = $14;
  16126. } else {
  16127. break;
  16128. }
  16129. }
  16130. _LoadImageEx($0,$2,128,128);
  16131. _ImageFormat($0,2);
  16132. _free($2);
  16133. ;HEAP32[$$byval_copy1>>2]=HEAP32[$0>>2]|0;HEAP32[$$byval_copy1+4>>2]=HEAP32[$0+4>>2]|0;HEAP32[$$byval_copy1+8>>2]=HEAP32[$0+8>>2]|0;HEAP32[$$byval_copy1+12>>2]=HEAP32[$0+12>>2]|0;HEAP32[$$byval_copy1+16>>2]=HEAP32[$0+16>>2]|0;
  16134. _LoadTextureFromImage($1,$$byval_copy1);
  16135. ;HEAP32[31028>>2]=HEAP32[$1>>2]|0;HEAP32[31028+4>>2]=HEAP32[$1+4>>2]|0;HEAP32[31028+8>>2]=HEAP32[$1+8>>2]|0;HEAP32[31028+12>>2]=HEAP32[$1+12>>2]|0;HEAP32[31028+16>>2]=HEAP32[$1+16>>2]|0;
  16136. ;HEAP32[$$byval_copy1>>2]=HEAP32[$0>>2]|0;HEAP32[$$byval_copy1+4>>2]=HEAP32[$0+4>>2]|0;HEAP32[$$byval_copy1+8>>2]=HEAP32[$0+8>>2]|0;HEAP32[$$byval_copy1+12>>2]=HEAP32[$0+12>>2]|0;HEAP32[$$byval_copy1+16>>2]=HEAP32[$0+16>>2]|0;
  16137. _UnloadImage($$byval_copy1);
  16138. $5 = HEAP32[(31052)>>2]|0;
  16139. $6 = $5 << 5;
  16140. $7 = (_malloc($6)|0);
  16141. HEAP32[(31056)>>2] = $7;
  16142. $8 = ($5|0)>(0);
  16143. if (!($8)) {
  16144. $$lcssa = $7;
  16145. $22 = ((($$lcssa)) + 16|0);
  16146. $23 = HEAP32[$22>>2]|0;
  16147. HEAP32[(31048)>>2] = $23;
  16148. $24 = HEAP32[7757]|0;
  16149. HEAP32[$vararg_buffer>>2] = $24;
  16150. _TraceLog(0,3582,$vararg_buffer);
  16151. STACKTOP = sp;return;
  16152. }
  16153. $9 = HEAP32[(31032)>>2]|0;
  16154. $10 = HEAP32[(31052)>>2]|0;
  16155. $11 = HEAP32[(31056)>>2]|0;
  16156. $$0101 = 0;$$090100 = 1;$$09299 = 0;$27 = $7;
  16157. while(1) {
  16158. $25 = (($$0101) + 32)|0;
  16159. $26 = (($27) + ($$0101<<5)|0);
  16160. HEAP32[$26>>2] = $25;
  16161. $28 = (((($27) + ($$0101<<5)|0)) + 4|0);
  16162. HEAP32[$28>>2] = $$090100;
  16163. $29 = ($$09299*11)|0;
  16164. $30 = (($29) + 1)|0;
  16165. $31 = (((($27) + ($$0101<<5)|0)) + 8|0);
  16166. HEAP32[$31>>2] = $30;
  16167. $32 = (2076 + ($$0101<<2)|0);
  16168. $33 = HEAP32[$32>>2]|0;
  16169. $34 = (((($27) + ($$0101<<5)|0)) + 12|0);
  16170. HEAP32[$34>>2] = $33;
  16171. $35 = (((($27) + ($$0101<<5)|0)) + 16|0);
  16172. HEAP32[$35>>2] = 10;
  16173. $36 = (($$090100) + 1)|0;
  16174. $37 = (($36) + ($33))|0;
  16175. $38 = ($37|0)<($9|0);
  16176. $39 = (($$09299) + 1)|0;
  16177. if ($38) {
  16178. $$191 = $37;$$193 = $$09299;
  16179. } else {
  16180. $40 = ($39*11)|0;
  16181. $41 = (($40) + 1)|0;
  16182. $42 = (($33) + 2)|0;
  16183. HEAP32[$28>>2] = 1;
  16184. HEAP32[$31>>2] = $41;
  16185. $$191 = $42;$$193 = $39;
  16186. }
  16187. $43 = (((($27) + ($$0101<<5)|0)) + 20|0);
  16188. HEAP32[$43>>2] = 0;
  16189. $44 = (((($27) + ($$0101<<5)|0)) + 24|0);
  16190. HEAP32[$44>>2] = 0;
  16191. $45 = (((($27) + ($$0101<<5)|0)) + 28|0);
  16192. HEAP32[$45>>2] = 0;
  16193. $46 = (($$0101) + 1)|0;
  16194. $47 = ($46|0)<($10|0);
  16195. if ($47) {
  16196. $$0101 = $46;$$090100 = $$191;$$09299 = $$193;$27 = $11;
  16197. } else {
  16198. $$lcssa = $11;
  16199. break;
  16200. }
  16201. }
  16202. $22 = ((($$lcssa)) + 16|0);
  16203. $23 = HEAP32[$22>>2]|0;
  16204. HEAP32[(31048)>>2] = $23;
  16205. $24 = HEAP32[7757]|0;
  16206. HEAP32[$vararg_buffer>>2] = $24;
  16207. _TraceLog(0,3582,$vararg_buffer);
  16208. STACKTOP = sp;return;
  16209. }
  16210. function _InitTimer_10() {
  16211. var $0 = 0, $1 = 0.0, label = 0, sp = 0;
  16212. sp = STACKTOP;
  16213. $0 = (_time((0|0))|0);
  16214. _srand($0);
  16215. $1 = (+_GetTime());
  16216. HEAPF64[1762] = $1;
  16217. return;
  16218. }
  16219. function _EmscriptenFullscreenChangeCallback($0,$1,$2) {
  16220. $0 = $0|0;
  16221. $1 = $1|0;
  16222. $2 = $2|0;
  16223. var $10 = 0, $11 = 0, $12 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $vararg_buffer = 0, $vararg_buffer4 = 0, $vararg_ptr1 = 0, $vararg_ptr2 = 0, $vararg_ptr3 = 0, $vararg_ptr7 = 0, $vararg_ptr8 = 0, $vararg_ptr9 = 0, label = 0, sp = 0;
  16224. sp = STACKTOP;
  16225. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  16226. $vararg_buffer4 = sp + 16|0;
  16227. $vararg_buffer = sp;
  16228. $3 = HEAP32[$1>>2]|0;
  16229. $4 = ($3|0)==(0);
  16230. $5 = ((($1)) + 264|0);
  16231. $6 = HEAP32[$5>>2]|0;
  16232. $7 = ((($1)) + 268|0);
  16233. $8 = HEAP32[$7>>2]|0;
  16234. $9 = ((($1)) + 272|0);
  16235. $10 = HEAP32[$9>>2]|0;
  16236. $11 = ((($1)) + 276|0);
  16237. $12 = HEAP32[$11>>2]|0;
  16238. if ($4) {
  16239. HEAP32[$vararg_buffer4>>2] = $6;
  16240. $vararg_ptr7 = ((($vararg_buffer4)) + 4|0);
  16241. HEAP32[$vararg_ptr7>>2] = $8;
  16242. $vararg_ptr8 = ((($vararg_buffer4)) + 8|0);
  16243. HEAP32[$vararg_ptr8>>2] = $10;
  16244. $vararg_ptr9 = ((($vararg_buffer4)) + 12|0);
  16245. HEAP32[$vararg_ptr9>>2] = $12;
  16246. _TraceLog(0,3515,$vararg_buffer4);
  16247. STACKTOP = sp;return 0;
  16248. } else {
  16249. HEAP32[$vararg_buffer>>2] = $6;
  16250. $vararg_ptr1 = ((($vararg_buffer)) + 4|0);
  16251. HEAP32[$vararg_ptr1>>2] = $8;
  16252. $vararg_ptr2 = ((($vararg_buffer)) + 8|0);
  16253. HEAP32[$vararg_ptr2>>2] = $10;
  16254. $vararg_ptr3 = ((($vararg_buffer)) + 12|0);
  16255. HEAP32[$vararg_ptr3>>2] = $12;
  16256. _TraceLog(0,3446,$vararg_buffer);
  16257. STACKTOP = sp;return 0;
  16258. }
  16259. return (0)|0;
  16260. }
  16261. function _EmscriptenKeyboardCallback($0,$1,$2) {
  16262. $0 = $0|0;
  16263. $1 = $1|0;
  16264. $2 = $2|0;
  16265. var $3 = 0, $4 = 0, $5 = 0, $6 = 0, label = 0, sp = 0;
  16266. sp = STACKTOP;
  16267. $3 = ($0|0)==(1);
  16268. if (!($3)) {
  16269. return 0;
  16270. }
  16271. $4 = ((($1)) + 32|0);
  16272. $5 = (_strcmp($4,3439)|0);
  16273. $6 = ($5|0)==(0);
  16274. if (!($6)) {
  16275. return 0;
  16276. }
  16277. (_emscripten_exit_pointerlock()|0);
  16278. return 0;
  16279. }
  16280. function _EmscriptenMouseCallback($0,$1,$2) {
  16281. $0 = $0|0;
  16282. $1 = $1|0;
  16283. $2 = $2|0;
  16284. var $3 = 0, $4 = 0, $5 = 0, $6 = 0, label = 0, sp = 0;
  16285. sp = STACKTOP;
  16286. STACKTOP = STACKTOP + 272|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(272|0);
  16287. $3 = sp;
  16288. $4 = ($0|0)==(4);
  16289. if (!($4)) {
  16290. STACKTOP = sp;return 0;
  16291. }
  16292. (_emscripten_get_pointerlock_status(($3|0))|0);
  16293. $5 = HEAP32[$3>>2]|0;
  16294. $6 = ($5|0)==(0);
  16295. if ($6) {
  16296. (_emscripten_request_pointerlock((0|0),1)|0);
  16297. } else {
  16298. (_emscripten_exit_pointerlock()|0);
  16299. (_emscripten_get_pointerlock_status(($3|0))|0);
  16300. }
  16301. STACKTOP = sp;return 0;
  16302. }
  16303. function _EmscriptenTouchCallback($0,$1,$2) {
  16304. $0 = $0|0;
  16305. $1 = $1|0;
  16306. $2 = $2|0;
  16307. var $$byval_copy = 0, $$sink = 0, $$sroa$0$0$$sroa_idx = 0, $$sroa$03$0$$sroa_idx = 0, $$sroa$2$0$$sroa_idx2 = 0, $$sroa$24$0$$sroa_idx5 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0.0, $15 = 0, $16 = 0, $17 = 0.0, $18 = 0, $19 = 0, $20 = 0.0, $21 = 0, $22 = 0, $23 = 0.0;
  16308. var $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0;
  16309. var $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0.0, $48 = 0.0, $49 = 0.0, $5 = 0, $50 = 0, $51 = 0.0, $52 = 0.0, $53 = 0.0, $54 = 0, $55 = 0.0, $56 = 0.0, $57 = 0.0, $58 = 0, $59 = 0.0, $6 = 0;
  16310. var $60 = 0.0, $61 = 0.0, $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  16311. sp = STACKTOP;
  16312. STACKTOP = STACKTOP + 112|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(112|0);
  16313. $$byval_copy = sp + 56|0;
  16314. $3 = sp;
  16315. switch ($0|0) {
  16316. case 22: {
  16317. $$sink = 1;
  16318. label = 4;
  16319. break;
  16320. }
  16321. case 23: {
  16322. $$sink = 0;
  16323. label = 4;
  16324. break;
  16325. }
  16326. case 24: {
  16327. $$sink = 2;
  16328. label = 4;
  16329. break;
  16330. }
  16331. default: {
  16332. }
  16333. }
  16334. if ((label|0) == 4) {
  16335. HEAP32[$3>>2] = $$sink;
  16336. }
  16337. $4 = HEAP32[$1>>2]|0;
  16338. $5 = ((($3)) + 4|0);
  16339. HEAP32[$5>>2] = $4;
  16340. $6 = ((($1)) + 20|0);
  16341. $7 = HEAP32[$6>>2]|0;
  16342. $8 = ((($3)) + 8|0);
  16343. HEAP32[$8>>2] = $7;
  16344. $9 = ((($1)) + 72|0);
  16345. $10 = HEAP32[$9>>2]|0;
  16346. $11 = ((($3)) + 12|0);
  16347. HEAP32[$11>>2] = $10;
  16348. $12 = ((($1)) + 56|0);
  16349. $13 = HEAP32[$12>>2]|0;
  16350. $14 = (+($13|0));
  16351. $15 = ((($1)) + 60|0);
  16352. $16 = HEAP32[$15>>2]|0;
  16353. $17 = (+($16|0));
  16354. $$sroa$03$0$$sroa_idx = ((($3)) + 24|0);
  16355. HEAPF32[$$sroa$03$0$$sroa_idx>>2] = $14;
  16356. $$sroa$24$0$$sroa_idx5 = ((($3)) + 28|0);
  16357. HEAPF32[$$sroa$24$0$$sroa_idx5>>2] = $17;
  16358. $18 = ((($1)) + 108|0);
  16359. $19 = HEAP32[$18>>2]|0;
  16360. $20 = (+($19|0));
  16361. $21 = ((($1)) + 112|0);
  16362. $22 = HEAP32[$21>>2]|0;
  16363. $23 = (+($22|0));
  16364. $$sroa$0$0$$sroa_idx = ((($3)) + 32|0);
  16365. HEAPF32[$$sroa$0$0$$sroa_idx>>2] = $20;
  16366. $$sroa$2$0$$sroa_idx2 = ((($3)) + 36|0);
  16367. HEAPF32[$$sroa$2$0$$sroa_idx2>>2] = $23;
  16368. $24 = ((($3)) + 24|0);
  16369. $25 = $24;
  16370. $26 = $25;
  16371. $27 = HEAP32[$26>>2]|0;
  16372. $28 = (($25) + 4)|0;
  16373. $29 = $28;
  16374. $30 = HEAP32[$29>>2]|0;
  16375. $31 = 14080;
  16376. $32 = $31;
  16377. HEAP32[$32>>2] = $27;
  16378. $33 = (($31) + 4)|0;
  16379. $34 = $33;
  16380. HEAP32[$34>>2] = $30;
  16381. $35 = ((($3)) + 32|0);
  16382. $36 = $35;
  16383. $37 = $36;
  16384. $38 = HEAP32[$37>>2]|0;
  16385. $39 = (($36) + 4)|0;
  16386. $40 = $39;
  16387. $41 = HEAP32[$40>>2]|0;
  16388. $42 = (14088);
  16389. $43 = $42;
  16390. HEAP32[$43>>2] = $38;
  16391. $44 = (($42) + 4)|0;
  16392. $45 = $44;
  16393. HEAP32[$45>>2] = $41;
  16394. $46 = (_GetScreenWidth()|0);
  16395. $47 = (+($46|0));
  16396. $48 = +HEAPF32[$24>>2];
  16397. $49 = $48 / $47;
  16398. HEAPF32[$24>>2] = $49;
  16399. $50 = (_GetScreenHeight()|0);
  16400. $51 = (+($50|0));
  16401. $52 = +HEAPF32[$$sroa$24$0$$sroa_idx5>>2];
  16402. $53 = $52 / $51;
  16403. HEAPF32[$$sroa$24$0$$sroa_idx5>>2] = $53;
  16404. $54 = (_GetScreenWidth()|0);
  16405. $55 = (+($54|0));
  16406. $56 = +HEAPF32[$35>>2];
  16407. $57 = $56 / $55;
  16408. HEAPF32[$35>>2] = $57;
  16409. $58 = (_GetScreenHeight()|0);
  16410. $59 = (+($58|0));
  16411. $60 = +HEAPF32[$$sroa$2$0$$sroa_idx2>>2];
  16412. $61 = $60 / $59;
  16413. HEAPF32[$$sroa$2$0$$sroa_idx2>>2] = $61;
  16414. dest=$$byval_copy; src=$3; stop=dest+56|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  16415. _ProcessGestureEvent($$byval_copy);
  16416. STACKTOP = sp;return 1;
  16417. }
  16418. function _EmscriptenGamepadCallback($0,$1,$2) {
  16419. $0 = $0|0;
  16420. $1 = $1|0;
  16421. $2 = $2|0;
  16422. var $$sink = 0, $10 = 0, $11 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  16423. sp = STACKTOP;
  16424. $3 = ((($1)) + 1296|0);
  16425. $4 = HEAP32[$3>>2]|0;
  16426. $5 = ($4|0)==(0);
  16427. if ($5) {
  16428. label = 3;
  16429. } else {
  16430. $6 = ((($1)) + 1300|0);
  16431. $7 = HEAP32[$6>>2]|0;
  16432. $8 = ($7|0)<(4);
  16433. if ($8) {
  16434. $$sink = 1;
  16435. } else {
  16436. label = 3;
  16437. }
  16438. }
  16439. if ((label|0) == 3) {
  16440. $$sink = 0;
  16441. }
  16442. $9 = ((($1)) + 1300|0);
  16443. $10 = HEAP32[$9>>2]|0;
  16444. $11 = (31012 + ($10<<2)|0);
  16445. HEAP32[$11>>2] = $$sink;
  16446. return 0;
  16447. }
  16448. function _SetTargetFPS($0) {
  16449. $0 = $0|0;
  16450. var $$ = 0.0, $$op = 0.0, $1 = 0, $2 = 0.0, $3 = 0.0, $4 = 0.0, $5 = 0.0, $6 = 0.0, $vararg_buffer = 0, label = 0, sp = 0;
  16451. sp = STACKTOP;
  16452. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  16453. $vararg_buffer = sp;
  16454. $1 = ($0|0)<(1);
  16455. $2 = (+($0|0));
  16456. $3 = 1.0 / $2;
  16457. $$ = $1 ? 0.0 : $3;
  16458. HEAPF64[1759] = $$;
  16459. $4 = $3;
  16460. $$op = $4 * 1000.0;
  16461. $5 = $$op;
  16462. $6 = $1 ? 0.0 : $5;
  16463. HEAPF64[$vararg_buffer>>3] = $6;
  16464. _TraceLog(0,3395,$vararg_buffer);
  16465. STACKTOP = sp;return;
  16466. }
  16467. function _LogoAnimation() {
  16468. var label = 0, sp = 0;
  16469. sp = STACKTOP;
  16470. HEAP32[7752] = 0;
  16471. return;
  16472. }
  16473. function _GetTime() {
  16474. var $0 = 0.0, label = 0, sp = 0;
  16475. sp = STACKTOP;
  16476. $0 = (+_glfwGetTime());
  16477. return (+$0);
  16478. }
  16479. function _LoadImageEx($0,$1,$2,$3) {
  16480. $0 = $0|0;
  16481. $1 = $1|0;
  16482. $2 = $2|0;
  16483. $3 = $3|0;
  16484. var $$03334 = 0, $$035 = 0, $$sroa$12$0$$sroa_idx21 = 0, $$sroa$15$0$$sroa_idx24 = 0, $$sroa$16$0$$sroa_idx26 = 0, $$sroa$9$0$$sroa_idx18 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0;
  16485. var $24 = 0, $25 = 0, $26 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $exitcond = 0, label = 0, sp = 0;
  16486. sp = STACKTOP;
  16487. $4 = $2 << 2;
  16488. $5 = Math_imul($4, $3)|0;
  16489. $6 = (_malloc($5)|0);
  16490. $7 = ($5|0)>(0);
  16491. if ($7) {
  16492. $8 = (($5) + -1)|0;
  16493. $9 = $8 >>> 2;
  16494. $$03334 = 0;$$035 = 0;
  16495. while(1) {
  16496. $10 = (($1) + ($$03334<<2)|0);
  16497. $11 = HEAP8[$10>>0]|0;
  16498. $12 = (($6) + ($$035)|0);
  16499. HEAP8[$12>>0] = $11;
  16500. $13 = (((($1) + ($$03334<<2)|0)) + 1|0);
  16501. $14 = HEAP8[$13>>0]|0;
  16502. $15 = $$035 | 1;
  16503. $16 = (($6) + ($15)|0);
  16504. HEAP8[$16>>0] = $14;
  16505. $17 = (((($1) + ($$03334<<2)|0)) + 2|0);
  16506. $18 = HEAP8[$17>>0]|0;
  16507. $19 = $$035 | 2;
  16508. $20 = (($6) + ($19)|0);
  16509. HEAP8[$20>>0] = $18;
  16510. $21 = (((($1) + ($$03334<<2)|0)) + 3|0);
  16511. $22 = HEAP8[$21>>0]|0;
  16512. $23 = $$035 | 3;
  16513. $24 = (($6) + ($23)|0);
  16514. HEAP8[$24>>0] = $22;
  16515. $25 = (($$03334) + 1)|0;
  16516. $26 = (($$035) + 4)|0;
  16517. $exitcond = ($$03334|0)==($9|0);
  16518. if ($exitcond) {
  16519. break;
  16520. } else {
  16521. $$03334 = $25;$$035 = $26;
  16522. }
  16523. }
  16524. }
  16525. HEAP32[$0>>2] = $6;
  16526. $$sroa$9$0$$sroa_idx18 = ((($0)) + 4|0);
  16527. HEAP32[$$sroa$9$0$$sroa_idx18>>2] = $2;
  16528. $$sroa$12$0$$sroa_idx21 = ((($0)) + 8|0);
  16529. HEAP32[$$sroa$12$0$$sroa_idx21>>2] = $3;
  16530. $$sroa$15$0$$sroa_idx24 = ((($0)) + 12|0);
  16531. HEAP32[$$sroa$15$0$$sroa_idx24>>2] = 1;
  16532. $$sroa$16$0$$sroa_idx26 = ((($0)) + 16|0);
  16533. HEAP32[$$sroa$16$0$$sroa_idx26>>2] = 7;
  16534. return;
  16535. }
  16536. function _ImageFormat($0,$1) {
  16537. $0 = $0|0;
  16538. $1 = $1|0;
  16539. var $$0166199 = 0, $$0167197 = 0, $$0168195 = 0, $$0169192 = 0, $$0170190 = 0, $$0171188 = 0, $$0172189 = 0, $$0202 = 0, $$1194 = 0, $$2201 = 0, $$byval_copy = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0.0, $103 = 0.0, $104 = 0.0, $105 = 0, $106 = 0, $107 = 0;
  16540. var $108 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0, $116 = 0, $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0;
  16541. var $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0, $133 = 0, $134 = 0, $135 = 0, $136 = 0, $137 = 0, $138 = 0, $139 = 0, $14 = 0, $140 = 0, $141 = 0, $142 = 0, $143 = 0;
  16542. var $144 = 0, $145 = 0, $146 = 0, $147 = 0, $148 = 0, $149 = 0, $15 = 0, $150 = 0, $151 = 0, $152 = 0, $153 = 0, $154 = 0, $155 = 0, $156 = 0, $157 = 0, $158 = 0, $159 = 0, $16 = 0, $160 = 0, $161 = 0;
  16543. var $162 = 0, $163 = 0, $164 = 0, $165 = 0, $166 = 0, $167 = 0, $168 = 0, $169 = 0.0, $17 = 0, $170 = 0.0, $171 = 0.0, $172 = 0, $173 = 0, $174 = 0, $175 = 0.0, $176 = 0.0, $177 = 0.0, $178 = 0, $179 = 0, $18 = 0;
  16544. var $180 = 0, $181 = 0.0, $182 = 0.0, $183 = 0.0, $184 = 0, $185 = 0, $186 = 0, $187 = 0, $188 = 0, $189 = 0, $19 = 0.0, $190 = 0, $191 = 0, $192 = 0, $193 = 0, $194 = 0, $195 = 0, $196 = 0, $197 = 0, $198 = 0;
  16545. var $199 = 0, $2 = 0, $20 = 0.0, $200 = 0, $201 = 0, $202 = 0, $203 = 0, $204 = 0, $205 = 0, $206 = 0, $207 = 0, $208 = 0, $209 = 0, $21 = 0, $210 = 0, $211 = 0, $212 = 0, $213 = 0, $214 = 0, $215 = 0;
  16546. var $216 = 0, $217 = 0, $218 = 0.0, $219 = 0.0, $22 = 0, $220 = 0.0, $221 = 0, $222 = 0, $223 = 0, $224 = 0.0, $225 = 0.0, $226 = 0.0, $227 = 0, $228 = 0, $229 = 0, $23 = 0.0, $230 = 0.0, $231 = 0.0, $232 = 0.0, $233 = 0;
  16547. var $234 = 0, $235 = 0, $236 = 0.0, $237 = 0.0, $238 = 0.0, $239 = 0, $24 = 0.0, $240 = 0, $241 = 0, $242 = 0, $243 = 0, $244 = 0, $245 = 0, $246 = 0, $247 = 0, $248 = 0, $249 = 0, $25 = 0.0, $250 = 0, $251 = 0;
  16548. var $252 = 0, $253 = 0, $254 = 0, $255 = 0, $256 = 0, $257 = 0, $258 = 0, $259 = 0, $26 = 0, $260 = 0, $261 = 0, $262 = 0, $263 = 0, $264 = 0, $265 = 0, $266 = 0, $267 = 0, $268 = 0, $269 = 0, $27 = 0;
  16549. var $270 = 0, $271 = 0, $272 = 0, $273 = 0, $274 = 0, $275 = 0, $276 = 0, $277 = 0, $278 = 0, $279 = 0, $28 = 0.0, $280 = 0, $281 = 0, $282 = 0, $283 = 0, $284 = 0, $285 = 0, $286 = 0, $287 = 0, $288 = 0;
  16550. var $289 = 0, $29 = 0.0, $290 = 0, $3 = 0, $30 = 0.0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
  16551. var $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0.0, $53 = 0.0, $54 = 0, $55 = 0, $56 = 0.0, $57 = 0.0, $58 = 0.0, $59 = 0, $6 = 0, $60 = 0, $61 = 0.0, $62 = 0.0;
  16552. var $63 = 0.0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0;
  16553. var $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0.0, $91 = 0.0, $92 = 0.0, $93 = 0, $94 = 0, $95 = 0, $96 = 0.0, $97 = 0.0, $98 = 0.0, $99 = 0;
  16554. var $or$cond = 0, $roundf = 0.0, $roundf173 = 0.0, $roundf174 = 0.0, $roundf175 = 0.0, $roundf176 = 0.0, $roundf177 = 0.0, $roundf178 = 0.0, $roundf179 = 0.0, $roundf180 = 0.0, $roundf181 = 0.0, $vararg_buffer = 0, label = 0, sp = 0;
  16555. sp = STACKTOP;
  16556. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  16557. $$byval_copy = sp + 4|0;
  16558. $vararg_buffer = sp;
  16559. $2 = ((($0)) + 16|0);
  16560. $3 = HEAP32[$2>>2]|0;
  16561. $4 = ($3|0)==($1|0);
  16562. if ($4) {
  16563. STACKTOP = sp;return;
  16564. }
  16565. $5 = ($3|0)<(8);
  16566. $6 = ($1|0)<(8);
  16567. $or$cond = $6 & $5;
  16568. if (!($or$cond)) {
  16569. _TraceLog(2,3958,$vararg_buffer);
  16570. STACKTOP = sp;return;
  16571. }
  16572. ;HEAP32[$$byval_copy>>2]=HEAP32[$0>>2]|0;HEAP32[$$byval_copy+4>>2]=HEAP32[$0+4>>2]|0;HEAP32[$$byval_copy+8>>2]=HEAP32[$0+8>>2]|0;HEAP32[$$byval_copy+12>>2]=HEAP32[$0+12>>2]|0;HEAP32[$$byval_copy+16>>2]=HEAP32[$0+16>>2]|0;
  16573. $7 = (_GetImageData($$byval_copy)|0);
  16574. $8 = HEAP32[$0>>2]|0;
  16575. _free($8);
  16576. HEAP32[$2>>2] = $1;
  16577. switch ($1|0) {
  16578. case 1: {
  16579. $9 = ((($0)) + 4|0);
  16580. $10 = HEAP32[$9>>2]|0;
  16581. $11 = ((($0)) + 8|0);
  16582. $12 = HEAP32[$11>>2]|0;
  16583. $13 = Math_imul($12, $10)|0;
  16584. $14 = (_malloc($13)|0);
  16585. HEAP32[$0>>2] = $14;
  16586. $15 = Math_imul($12, $10)|0;
  16587. $16 = ($15|0)>(0);
  16588. if ($16) {
  16589. $$0171188 = 0;
  16590. while(1) {
  16591. $17 = (($7) + ($$0171188<<2)|0);
  16592. $18 = HEAP8[$17>>0]|0;
  16593. $19 = (+($18&255));
  16594. $20 = $19 * 0.29899999499320984;
  16595. $21 = (((($7) + ($$0171188<<2)|0)) + 1|0);
  16596. $22 = HEAP8[$21>>0]|0;
  16597. $23 = (+($22&255));
  16598. $24 = $23 * 0.58700001239776611;
  16599. $25 = $20 + $24;
  16600. $26 = (((($7) + ($$0171188<<2)|0)) + 2|0);
  16601. $27 = HEAP8[$26>>0]|0;
  16602. $28 = (+($27&255));
  16603. $29 = $28 * 0.11400000005960464;
  16604. $30 = $25 + $29;
  16605. $31 = (~~(($30))&255);
  16606. $32 = HEAP32[$0>>2]|0;
  16607. $33 = (($32) + ($$0171188)|0);
  16608. HEAP8[$33>>0] = $31;
  16609. $34 = (($$0171188) + 1)|0;
  16610. $35 = HEAP32[$9>>2]|0;
  16611. $36 = HEAP32[$11>>2]|0;
  16612. $37 = Math_imul($36, $35)|0;
  16613. $38 = ($34|0)<($37|0);
  16614. if ($38) {
  16615. $$0171188 = $34;
  16616. } else {
  16617. break;
  16618. }
  16619. }
  16620. }
  16621. break;
  16622. }
  16623. case 2: {
  16624. $39 = ((($0)) + 4|0);
  16625. $40 = HEAP32[$39>>2]|0;
  16626. $41 = ((($0)) + 8|0);
  16627. $42 = HEAP32[$41>>2]|0;
  16628. $43 = $40 << 1;
  16629. $44 = Math_imul($43, $42)|0;
  16630. $45 = (_malloc($44)|0);
  16631. HEAP32[$0>>2] = $45;
  16632. $46 = HEAP32[$39>>2]|0;
  16633. $47 = $46 << 1;
  16634. $48 = Math_imul($47, $42)|0;
  16635. $49 = ($48|0)>(0);
  16636. if ($49) {
  16637. $$0170190 = 0;$$0172189 = 0;
  16638. while(1) {
  16639. $50 = (($7) + ($$0172189<<2)|0);
  16640. $51 = HEAP8[$50>>0]|0;
  16641. $52 = (+($51&255));
  16642. $53 = $52 * 0.29899999499320984;
  16643. $54 = (((($7) + ($$0172189<<2)|0)) + 1|0);
  16644. $55 = HEAP8[$54>>0]|0;
  16645. $56 = (+($55&255));
  16646. $57 = $56 * 0.58700001239776611;
  16647. $58 = $53 + $57;
  16648. $59 = (((($7) + ($$0172189<<2)|0)) + 2|0);
  16649. $60 = HEAP8[$59>>0]|0;
  16650. $61 = (+($60&255));
  16651. $62 = $61 * 0.11400000005960464;
  16652. $63 = $58 + $62;
  16653. $64 = (~~(($63))&255);
  16654. $65 = HEAP32[$0>>2]|0;
  16655. $66 = (($65) + ($$0170190)|0);
  16656. HEAP8[$66>>0] = $64;
  16657. $67 = (((($7) + ($$0172189<<2)|0)) + 3|0);
  16658. $68 = HEAP8[$67>>0]|0;
  16659. $69 = HEAP32[$0>>2]|0;
  16660. $70 = $$0170190 | 1;
  16661. $71 = (($69) + ($70)|0);
  16662. HEAP8[$71>>0] = $68;
  16663. $72 = (($$0172189) + 1)|0;
  16664. $73 = (($$0170190) + 2)|0;
  16665. $74 = HEAP32[$39>>2]|0;
  16666. $75 = HEAP32[$41>>2]|0;
  16667. $76 = $74 << 1;
  16668. $77 = Math_imul($76, $75)|0;
  16669. $78 = ($73|0)<($77|0);
  16670. if ($78) {
  16671. $$0170190 = $73;$$0172189 = $72;
  16672. } else {
  16673. break;
  16674. }
  16675. }
  16676. }
  16677. break;
  16678. }
  16679. case 3: {
  16680. $79 = ((($0)) + 4|0);
  16681. $80 = HEAP32[$79>>2]|0;
  16682. $81 = ((($0)) + 8|0);
  16683. $82 = HEAP32[$81>>2]|0;
  16684. $83 = $80 << 1;
  16685. $84 = Math_imul($83, $82)|0;
  16686. $85 = (_malloc($84)|0);
  16687. HEAP32[$0>>2] = $85;
  16688. $86 = HEAP32[$79>>2]|0;
  16689. $87 = Math_imul($82, $86)|0;
  16690. $88 = ($87|0)>(0);
  16691. if ($88) {
  16692. $89 = HEAP8[$7>>0]|0;
  16693. $90 = (+($89&255));
  16694. $91 = $90 * 31.0;
  16695. $92 = $91 / 255.0;
  16696. $roundf179 = (+_roundf((+$92)));
  16697. $93 = (~~(($roundf179))&255);
  16698. $94 = ((($7)) + 1|0);
  16699. $95 = HEAP8[$94>>0]|0;
  16700. $96 = (+($95&255));
  16701. $97 = $96 * 63.0;
  16702. $98 = $97 / 255.0;
  16703. $roundf180 = (+_roundf((+$98)));
  16704. $99 = (~~(($roundf180))&255);
  16705. $100 = ((($7)) + 2|0);
  16706. $101 = HEAP8[$100>>0]|0;
  16707. $102 = (+($101&255));
  16708. $103 = $102 * 31.0;
  16709. $104 = $103 / 255.0;
  16710. $roundf181 = (+_roundf((+$104)));
  16711. $105 = (~~(($roundf181))&255);
  16712. $106 = $93&255;
  16713. $107 = $106 << 11;
  16714. $108 = $99&255;
  16715. $109 = $108 << 5;
  16716. $110 = $109 | $107;
  16717. $111 = $105&255;
  16718. $112 = $110 | $111;
  16719. $113 = $112&65535;
  16720. $114 = HEAP32[$0>>2]|0;
  16721. $115 = HEAP32[$79>>2]|0;
  16722. $116 = HEAP32[$81>>2]|0;
  16723. $117 = Math_imul($116, $115)|0;
  16724. $$0169192 = 0;
  16725. while(1) {
  16726. $118 = (($114) + ($$0169192<<1)|0);
  16727. HEAP16[$118>>1] = $113;
  16728. $119 = (($$0169192) + 1)|0;
  16729. $120 = ($119|0)<($117|0);
  16730. if ($120) {
  16731. $$0169192 = $119;
  16732. } else {
  16733. break;
  16734. }
  16735. }
  16736. }
  16737. break;
  16738. }
  16739. case 4: {
  16740. $121 = ((($0)) + 4|0);
  16741. $122 = HEAP32[$121>>2]|0;
  16742. $123 = ((($0)) + 8|0);
  16743. $124 = HEAP32[$123>>2]|0;
  16744. $125 = ($122*3)|0;
  16745. $126 = Math_imul($125, $124)|0;
  16746. $127 = (_malloc($126)|0);
  16747. HEAP32[$0>>2] = $127;
  16748. $128 = HEAP32[$121>>2]|0;
  16749. $129 = ($128*3)|0;
  16750. $130 = Math_imul($129, $124)|0;
  16751. $131 = ($130|0)>(0);
  16752. if ($131) {
  16753. $$0168195 = 0;$$1194 = 0;
  16754. while(1) {
  16755. $132 = (($7) + ($$1194<<2)|0);
  16756. $133 = HEAP8[$132>>0]|0;
  16757. $134 = HEAP32[$0>>2]|0;
  16758. $135 = (($134) + ($$0168195)|0);
  16759. HEAP8[$135>>0] = $133;
  16760. $136 = (((($7) + ($$1194<<2)|0)) + 1|0);
  16761. $137 = HEAP8[$136>>0]|0;
  16762. $138 = HEAP32[$0>>2]|0;
  16763. $139 = (($$0168195) + 1)|0;
  16764. $140 = (($138) + ($139)|0);
  16765. HEAP8[$140>>0] = $137;
  16766. $141 = (((($7) + ($$1194<<2)|0)) + 2|0);
  16767. $142 = HEAP8[$141>>0]|0;
  16768. $143 = HEAP32[$0>>2]|0;
  16769. $144 = (($$0168195) + 2)|0;
  16770. $145 = (($143) + ($144)|0);
  16771. HEAP8[$145>>0] = $142;
  16772. $146 = (($$1194) + 1)|0;
  16773. $147 = (($$0168195) + 3)|0;
  16774. $148 = HEAP32[$121>>2]|0;
  16775. $149 = HEAP32[$123>>2]|0;
  16776. $150 = ($148*3)|0;
  16777. $151 = Math_imul($150, $149)|0;
  16778. $152 = ($147|0)<($151|0);
  16779. if ($152) {
  16780. $$0168195 = $147;$$1194 = $146;
  16781. } else {
  16782. break;
  16783. }
  16784. }
  16785. }
  16786. break;
  16787. }
  16788. case 5: {
  16789. $153 = ((($0)) + 4|0);
  16790. $154 = HEAP32[$153>>2]|0;
  16791. $155 = ((($0)) + 8|0);
  16792. $156 = HEAP32[$155>>2]|0;
  16793. $157 = $154 << 1;
  16794. $158 = Math_imul($157, $156)|0;
  16795. $159 = (_malloc($158)|0);
  16796. HEAP32[$0>>2] = $159;
  16797. $160 = HEAP32[$153>>2]|0;
  16798. $161 = Math_imul($156, $160)|0;
  16799. $162 = ($161|0)>(0);
  16800. if ($162) {
  16801. $163 = HEAP32[$0>>2]|0;
  16802. $164 = HEAP32[$153>>2]|0;
  16803. $165 = HEAP32[$155>>2]|0;
  16804. $166 = Math_imul($165, $164)|0;
  16805. $$0167197 = 0;
  16806. while(1) {
  16807. $167 = (($7) + ($$0167197<<2)|0);
  16808. $168 = HEAP8[$167>>0]|0;
  16809. $169 = (+($168&255));
  16810. $170 = $169 * 31.0;
  16811. $171 = $170 / 255.0;
  16812. $roundf176 = (+_roundf((+$171)));
  16813. $172 = (~~(($roundf176))&255);
  16814. $173 = (((($7) + ($$0167197<<2)|0)) + 1|0);
  16815. $174 = HEAP8[$173>>0]|0;
  16816. $175 = (+($174&255));
  16817. $176 = $175 * 31.0;
  16818. $177 = $176 / 255.0;
  16819. $roundf177 = (+_roundf((+$177)));
  16820. $178 = (~~(($roundf177))&255);
  16821. $179 = (((($7) + ($$0167197<<2)|0)) + 2|0);
  16822. $180 = HEAP8[$179>>0]|0;
  16823. $181 = (+($180&255));
  16824. $182 = $181 * 31.0;
  16825. $183 = $182 / 255.0;
  16826. $roundf178 = (+_roundf((+$183)));
  16827. $184 = (~~(($roundf178))&255);
  16828. $185 = (((($7) + ($$0167197<<2)|0)) + 3|0);
  16829. $186 = HEAP8[$185>>0]|0;
  16830. $187 = ($186&255)>(50);
  16831. $188 = $172&255;
  16832. $189 = $188 << 11;
  16833. $190 = $178&255;
  16834. $191 = $190 << 6;
  16835. $192 = $191 | $189;
  16836. $193 = $184&255;
  16837. $194 = $193 << 1;
  16838. $195 = $192 | $194;
  16839. $196 = $187&1;
  16840. $197 = $195 | $196;
  16841. $198 = $197&65535;
  16842. $199 = (($163) + ($$0167197<<1)|0);
  16843. HEAP16[$199>>1] = $198;
  16844. $200 = (($$0167197) + 1)|0;
  16845. $201 = ($200|0)<($166|0);
  16846. if ($201) {
  16847. $$0167197 = $200;
  16848. } else {
  16849. break;
  16850. }
  16851. }
  16852. }
  16853. break;
  16854. }
  16855. case 6: {
  16856. $202 = ((($0)) + 4|0);
  16857. $203 = HEAP32[$202>>2]|0;
  16858. $204 = ((($0)) + 8|0);
  16859. $205 = HEAP32[$204>>2]|0;
  16860. $206 = $203 << 1;
  16861. $207 = Math_imul($206, $205)|0;
  16862. $208 = (_malloc($207)|0);
  16863. HEAP32[$0>>2] = $208;
  16864. $209 = HEAP32[$202>>2]|0;
  16865. $210 = Math_imul($205, $209)|0;
  16866. $211 = ($210|0)>(0);
  16867. if ($211) {
  16868. $212 = HEAP32[$0>>2]|0;
  16869. $213 = HEAP32[$202>>2]|0;
  16870. $214 = HEAP32[$204>>2]|0;
  16871. $215 = Math_imul($214, $213)|0;
  16872. $$0166199 = 0;
  16873. while(1) {
  16874. $216 = (($7) + ($$0166199<<2)|0);
  16875. $217 = HEAP8[$216>>0]|0;
  16876. $218 = (+($217&255));
  16877. $219 = $218 * 15.0;
  16878. $220 = $219 / 255.0;
  16879. $roundf = (+_roundf((+$220)));
  16880. $221 = (~~(($roundf))&255);
  16881. $222 = (((($7) + ($$0166199<<2)|0)) + 1|0);
  16882. $223 = HEAP8[$222>>0]|0;
  16883. $224 = (+($223&255));
  16884. $225 = $224 * 15.0;
  16885. $226 = $225 / 255.0;
  16886. $roundf173 = (+_roundf((+$226)));
  16887. $227 = (~~(($roundf173))&255);
  16888. $228 = (((($7) + ($$0166199<<2)|0)) + 2|0);
  16889. $229 = HEAP8[$228>>0]|0;
  16890. $230 = (+($229&255));
  16891. $231 = $230 * 15.0;
  16892. $232 = $231 / 255.0;
  16893. $roundf174 = (+_roundf((+$232)));
  16894. $233 = (~~(($roundf174))&255);
  16895. $234 = (((($7) + ($$0166199<<2)|0)) + 3|0);
  16896. $235 = HEAP8[$234>>0]|0;
  16897. $236 = (+($235&255));
  16898. $237 = $236 * 15.0;
  16899. $238 = $237 / 255.0;
  16900. $roundf175 = (+_roundf((+$238)));
  16901. $239 = (~~(($roundf175))&255);
  16902. $240 = $221&255;
  16903. $241 = $240 << 12;
  16904. $242 = $227&255;
  16905. $243 = $242 << 8;
  16906. $244 = $243 | $241;
  16907. $245 = $233&255;
  16908. $246 = $245 << 4;
  16909. $247 = $244 | $246;
  16910. $248 = $239&255;
  16911. $249 = $247 | $248;
  16912. $250 = $249&65535;
  16913. $251 = (($212) + ($$0166199<<1)|0);
  16914. HEAP16[$251>>1] = $250;
  16915. $252 = (($$0166199) + 1)|0;
  16916. $253 = ($252|0)<($215|0);
  16917. if ($253) {
  16918. $$0166199 = $252;
  16919. } else {
  16920. break;
  16921. }
  16922. }
  16923. }
  16924. break;
  16925. }
  16926. case 7: {
  16927. $254 = ((($0)) + 4|0);
  16928. $255 = HEAP32[$254>>2]|0;
  16929. $256 = ((($0)) + 8|0);
  16930. $257 = HEAP32[$256>>2]|0;
  16931. $258 = $255 << 2;
  16932. $259 = Math_imul($258, $257)|0;
  16933. $260 = (_malloc($259)|0);
  16934. HEAP32[$0>>2] = $260;
  16935. $261 = HEAP32[$254>>2]|0;
  16936. $262 = $261 << 2;
  16937. $263 = Math_imul($262, $257)|0;
  16938. $264 = ($263|0)>(0);
  16939. if ($264) {
  16940. $$0202 = 0;$$2201 = 0;
  16941. while(1) {
  16942. $265 = (($7) + ($$2201<<2)|0);
  16943. $266 = HEAP8[$265>>0]|0;
  16944. $267 = HEAP32[$0>>2]|0;
  16945. $268 = (($267) + ($$0202)|0);
  16946. HEAP8[$268>>0] = $266;
  16947. $269 = (((($7) + ($$2201<<2)|0)) + 1|0);
  16948. $270 = HEAP8[$269>>0]|0;
  16949. $271 = HEAP32[$0>>2]|0;
  16950. $272 = $$0202 | 1;
  16951. $273 = (($271) + ($272)|0);
  16952. HEAP8[$273>>0] = $270;
  16953. $274 = (((($7) + ($$2201<<2)|0)) + 2|0);
  16954. $275 = HEAP8[$274>>0]|0;
  16955. $276 = HEAP32[$0>>2]|0;
  16956. $277 = $$0202 | 2;
  16957. $278 = (($276) + ($277)|0);
  16958. HEAP8[$278>>0] = $275;
  16959. $279 = (((($7) + ($$2201<<2)|0)) + 3|0);
  16960. $280 = HEAP8[$279>>0]|0;
  16961. $281 = HEAP32[$0>>2]|0;
  16962. $282 = $$0202 | 3;
  16963. $283 = (($281) + ($282)|0);
  16964. HEAP8[$283>>0] = $280;
  16965. $284 = (($$2201) + 1)|0;
  16966. $285 = (($$0202) + 4)|0;
  16967. $286 = HEAP32[$254>>2]|0;
  16968. $287 = HEAP32[$256>>2]|0;
  16969. $288 = $286 << 2;
  16970. $289 = Math_imul($288, $287)|0;
  16971. $290 = ($285|0)<($289|0);
  16972. if ($290) {
  16973. $$0202 = $285;$$2201 = $284;
  16974. } else {
  16975. break;
  16976. }
  16977. }
  16978. }
  16979. break;
  16980. }
  16981. default: {
  16982. }
  16983. }
  16984. _free($7);
  16985. STACKTOP = sp;return;
  16986. }
  16987. function _LoadTextureFromImage($0,$1) {
  16988. $0 = $0|0;
  16989. $1 = $1|0;
  16990. var $$sroa$11$0$$sroa_idx8 = 0, $$sroa$5$0$$sroa_idx2 = 0, $$sroa$7$0$$sroa_idx4 = 0, $$sroa$9$0$$sroa_idx6 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  16991. sp = STACKTOP;
  16992. $2 = HEAP32[$1>>2]|0;
  16993. $3 = ((($1)) + 4|0);
  16994. $4 = HEAP32[$3>>2]|0;
  16995. $5 = ((($1)) + 8|0);
  16996. $6 = HEAP32[$5>>2]|0;
  16997. $7 = ((($1)) + 16|0);
  16998. $8 = HEAP32[$7>>2]|0;
  16999. $9 = ((($1)) + 12|0);
  17000. $10 = HEAP32[$9>>2]|0;
  17001. $11 = (_rlglLoadTexture($2,$4,$6,$8,$10)|0);
  17002. $12 = HEAP32[$3>>2]|0;
  17003. $13 = HEAP32[$5>>2]|0;
  17004. HEAP32[$0>>2] = $11;
  17005. $$sroa$5$0$$sroa_idx2 = ((($0)) + 4|0);
  17006. HEAP32[$$sroa$5$0$$sroa_idx2>>2] = $12;
  17007. $$sroa$7$0$$sroa_idx4 = ((($0)) + 8|0);
  17008. HEAP32[$$sroa$7$0$$sroa_idx4>>2] = $13;
  17009. $$sroa$9$0$$sroa_idx6 = ((($0)) + 12|0);
  17010. HEAP32[$$sroa$9$0$$sroa_idx6>>2] = $10;
  17011. $$sroa$11$0$$sroa_idx8 = ((($0)) + 16|0);
  17012. HEAP32[$$sroa$11$0$$sroa_idx8>>2] = $8;
  17013. return;
  17014. }
  17015. function _UnloadImage($0) {
  17016. $0 = $0|0;
  17017. var $1 = 0, label = 0, sp = 0;
  17018. sp = STACKTOP;
  17019. $1 = HEAP32[$0>>2]|0;
  17020. _free($1);
  17021. return;
  17022. }
  17023. function _rlglLoadTexture($0,$1,$2,$3,$4) {
  17024. $0 = $0|0;
  17025. $1 = $1|0;
  17026. $2 = $2|0;
  17027. $3 = $3|0;
  17028. $4 = $4|0;
  17029. var $$0 = 0, $$off = 0, $$off92 = 0, $$off93 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0;
  17030. var $26 = 0, $27 = 0, $28 = 0, $29 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0;
  17031. var $46 = 0, $47 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, $or$cond100 = 0, $or$cond7 = 0, $or$cond96 = 0, $or$cond98 = 0, $switch = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, $vararg_buffer11 = 0, $vararg_buffer15 = 0, $vararg_buffer3 = 0, $vararg_buffer5 = 0, $vararg_buffer7 = 0;
  17032. var $vararg_buffer9 = 0, $vararg_ptr13 = 0, $vararg_ptr14 = 0, label = 0, sp = 0;
  17033. sp = STACKTOP;
  17034. STACKTOP = STACKTOP + 80|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(80|0);
  17035. $vararg_buffer15 = sp + 64|0;
  17036. $vararg_buffer11 = sp + 48|0;
  17037. $vararg_buffer9 = sp + 40|0;
  17038. $vararg_buffer7 = sp + 32|0;
  17039. $vararg_buffer5 = sp + 24|0;
  17040. $vararg_buffer3 = sp + 16|0;
  17041. $vararg_buffer1 = sp + 8|0;
  17042. $vararg_buffer = sp;
  17043. $5 = sp + 68|0;
  17044. _glBindTexture(3553,0);
  17045. HEAP32[$5>>2] = 0;
  17046. $6 = HEAP32[7765]|0;
  17047. $7 = ($6|0)==(0);
  17048. $8 = $3 & -4;
  17049. $switch = ($8|0)==(8);
  17050. $or$cond100 = $switch & $7;
  17051. if ($or$cond100) {
  17052. _TraceLog(2,3627,$vararg_buffer);
  17053. $$0 = HEAP32[$5>>2]|0;
  17054. STACKTOP = sp;return ($$0|0);
  17055. }
  17056. $9 = HEAP32[7766]|0;
  17057. $10 = ($9|0)==(0);
  17058. $11 = ($3|0)==(12);
  17059. $or$cond7 = $11 & $10;
  17060. if ($or$cond7) {
  17061. _TraceLog(2,3671,$vararg_buffer1);
  17062. $$0 = HEAP32[$5>>2]|0;
  17063. STACKTOP = sp;return ($$0|0);
  17064. }
  17065. $12 = HEAP32[7767]|0;
  17066. $13 = ($12|0)==(0);
  17067. $$off = (($3) + -13)|0;
  17068. $14 = ($$off>>>0)<(2);
  17069. $or$cond = $14 & $13;
  17070. if ($or$cond) {
  17071. _TraceLog(2,3716,$vararg_buffer3);
  17072. $$0 = HEAP32[$5>>2]|0;
  17073. STACKTOP = sp;return ($$0|0);
  17074. }
  17075. $15 = HEAP32[7768]|0;
  17076. $16 = ($15|0)==(0);
  17077. $$off92 = (($3) + -15)|0;
  17078. $17 = ($$off92>>>0)<(2);
  17079. $or$cond96 = $17 & $16;
  17080. if ($or$cond96) {
  17081. _TraceLog(2,3761,$vararg_buffer5);
  17082. $$0 = HEAP32[$5>>2]|0;
  17083. STACKTOP = sp;return ($$0|0);
  17084. }
  17085. $18 = HEAP32[7769]|0;
  17086. $19 = ($18|0)==(0);
  17087. $$off93 = (($3) + -17)|0;
  17088. $20 = ($$off93>>>0)<(2);
  17089. $or$cond98 = $20 & $19;
  17090. if ($or$cond98) {
  17091. _TraceLog(2,3806,$vararg_buffer7);
  17092. $$0 = HEAP32[$5>>2]|0;
  17093. STACKTOP = sp;return ($$0|0);
  17094. }
  17095. _glGenTextures(1,($5|0));
  17096. $21 = HEAP32[$5>>2]|0;
  17097. _glBindTexture(3553,($21|0));
  17098. do {
  17099. switch ($3|0) {
  17100. case 1: {
  17101. _glTexImage2D(3553,0,6409,($1|0),($2|0),0,6409,5121,($0|0));
  17102. break;
  17103. }
  17104. case 2: {
  17105. _glTexImage2D(3553,0,6410,($1|0),($2|0),0,6410,5121,($0|0));
  17106. break;
  17107. }
  17108. case 3: {
  17109. _glTexImage2D(3553,0,6407,($1|0),($2|0),0,6407,33635,($0|0));
  17110. break;
  17111. }
  17112. case 4: {
  17113. _glTexImage2D(3553,0,6407,($1|0),($2|0),0,6407,5121,($0|0));
  17114. break;
  17115. }
  17116. case 5: {
  17117. _glTexImage2D(3553,0,6408,($1|0),($2|0),0,6408,32820,($0|0));
  17118. break;
  17119. }
  17120. case 6: {
  17121. _glTexImage2D(3553,0,6408,($1|0),($2|0),0,6408,32819,($0|0));
  17122. break;
  17123. }
  17124. case 7: {
  17125. _glTexImage2D(3553,0,6408,($1|0),($2|0),0,6408,5121,($0|0));
  17126. break;
  17127. }
  17128. case 8: {
  17129. $22 = HEAP32[7765]|0;
  17130. $23 = ($22|0)==(0);
  17131. if (!($23)) {
  17132. _LoadCompressedTexture($0,$1,$2,$4,33776);
  17133. }
  17134. break;
  17135. }
  17136. case 9: {
  17137. $24 = HEAP32[7765]|0;
  17138. $25 = ($24|0)==(0);
  17139. if (!($25)) {
  17140. _LoadCompressedTexture($0,$1,$2,$4,33777);
  17141. }
  17142. break;
  17143. }
  17144. case 10: {
  17145. $26 = HEAP32[7765]|0;
  17146. $27 = ($26|0)==(0);
  17147. if (!($27)) {
  17148. _LoadCompressedTexture($0,$1,$2,$4,33778);
  17149. }
  17150. break;
  17151. }
  17152. case 11: {
  17153. $28 = HEAP32[7765]|0;
  17154. $29 = ($28|0)==(0);
  17155. if (!($29)) {
  17156. _LoadCompressedTexture($0,$1,$2,$4,33779);
  17157. }
  17158. break;
  17159. }
  17160. case 12: {
  17161. $30 = HEAP32[7766]|0;
  17162. $31 = ($30|0)==(0);
  17163. if (!($31)) {
  17164. _LoadCompressedTexture($0,$1,$2,$4,36196);
  17165. }
  17166. break;
  17167. }
  17168. case 13: {
  17169. $32 = HEAP32[7767]|0;
  17170. $33 = ($32|0)==(0);
  17171. if (!($33)) {
  17172. _LoadCompressedTexture($0,$1,$2,$4,37492);
  17173. }
  17174. break;
  17175. }
  17176. case 14: {
  17177. $34 = HEAP32[7767]|0;
  17178. $35 = ($34|0)==(0);
  17179. if (!($35)) {
  17180. _LoadCompressedTexture($0,$1,$2,$4,37496);
  17181. }
  17182. break;
  17183. }
  17184. case 15: {
  17185. $36 = HEAP32[7768]|0;
  17186. $37 = ($36|0)==(0);
  17187. if (!($37)) {
  17188. _LoadCompressedTexture($0,$1,$2,$4,35840);
  17189. }
  17190. break;
  17191. }
  17192. case 16: {
  17193. $38 = HEAP32[7768]|0;
  17194. $39 = ($38|0)==(0);
  17195. if (!($39)) {
  17196. _LoadCompressedTexture($0,$1,$2,$4,35842);
  17197. }
  17198. break;
  17199. }
  17200. case 17: {
  17201. $40 = HEAP32[7769]|0;
  17202. $41 = ($40|0)==(0);
  17203. if (!($41)) {
  17204. _LoadCompressedTexture($0,$1,$2,$4,37808);
  17205. }
  17206. break;
  17207. }
  17208. case 18: {
  17209. $42 = HEAP32[7769]|0;
  17210. $43 = ($42|0)==(0);
  17211. if (!($43)) {
  17212. _LoadCompressedTexture($0,$1,$2,$4,37815);
  17213. }
  17214. break;
  17215. }
  17216. default: {
  17217. _TraceLog(2,3851,$vararg_buffer9);
  17218. }
  17219. }
  17220. } while(0);
  17221. $44 = HEAP32[7770]|0;
  17222. $45 = ($44|0)==(0);
  17223. if ($45) {
  17224. _glTexParameteri(3553,10242,33071);
  17225. _glTexParameteri(3553,10243,33071);
  17226. } else {
  17227. _glTexParameteri(3553,10242,10497);
  17228. _glTexParameteri(3553,10243,10497);
  17229. }
  17230. _glTexParameteri(3553,10240,9728);
  17231. _glTexParameteri(3553,10241,9728);
  17232. _glBindTexture(3553,0);
  17233. $46 = HEAP32[$5>>2]|0;
  17234. $47 = ($46|0)==(0);
  17235. if ($47) {
  17236. _TraceLog(2,3929,$vararg_buffer15);
  17237. $$0 = HEAP32[$5>>2]|0;
  17238. STACKTOP = sp;return ($$0|0);
  17239. } else {
  17240. HEAP32[$vararg_buffer11>>2] = $46;
  17241. $vararg_ptr13 = ((($vararg_buffer11)) + 4|0);
  17242. HEAP32[$vararg_ptr13>>2] = $1;
  17243. $vararg_ptr14 = ((($vararg_buffer11)) + 8|0);
  17244. HEAP32[$vararg_ptr14>>2] = $2;
  17245. _TraceLog(0,3880,$vararg_buffer11);
  17246. $$0 = HEAP32[$5>>2]|0;
  17247. STACKTOP = sp;return ($$0|0);
  17248. }
  17249. return (0)|0;
  17250. }
  17251. function _LoadCompressedTexture($0,$1,$2,$3,$4) {
  17252. $0 = $0|0;
  17253. $1 = $1|0;
  17254. $2 = $2|0;
  17255. $3 = $3|0;
  17256. $4 = $4|0;
  17257. var $$ = 0, $$03645 = 0, $$03744 = 0, $$038 = 0, $$03943 = 0, $$046 = 0, $$140 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0;
  17258. var $23 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, $or$cond42 = 0, label = 0, sp = 0;
  17259. sp = STACKTOP;
  17260. _glPixelStorei(3317,1);
  17261. switch ($4|0) {
  17262. case 33776: case 33777: case 36196: case 37492: {
  17263. $$038 = 8;
  17264. break;
  17265. }
  17266. default: {
  17267. $$038 = 16;
  17268. }
  17269. }
  17270. $5 = ($3|0)<(1);
  17271. $6 = $1 | $2;
  17272. $7 = ($6|0)==(0);
  17273. $or$cond42 = $5 | $7;
  17274. if ($or$cond42) {
  17275. return;
  17276. } else {
  17277. $$03645 = 0;$$03744 = 0;$$03943 = $2;$$046 = $1;
  17278. }
  17279. while(1) {
  17280. $8 = (($$046) + 3)|0;
  17281. $9 = (($8|0) / 4)&-1;
  17282. $10 = (($$03943) + 3)|0;
  17283. $11 = (($10|0) / 4)&-1;
  17284. $12 = Math_imul($11, $$038)|0;
  17285. $13 = Math_imul($12, $9)|0;
  17286. $14 = (($0) + ($$03744)|0);
  17287. _glCompressedTexImage2D(3553,($$03645|0),($4|0),($$046|0),($$03943|0),0,($13|0),($14|0));
  17288. $15 = (($13) + ($$03744))|0;
  17289. $16 = (($$046|0) / 2)&-1;
  17290. $17 = (($$03943|0) / 2)&-1;
  17291. $18 = ($$046|0)<(2);
  17292. $$ = $18 ? 1 : $16;
  17293. $19 = ($$03943|0)<(2);
  17294. $$140 = $19 ? 1 : $17;
  17295. $20 = (($$03645) + 1)|0;
  17296. $21 = ($20|0)>=($3|0);
  17297. $22 = $$ | $$140;
  17298. $23 = ($22|0)==(0);
  17299. $or$cond = $21 | $23;
  17300. if ($or$cond) {
  17301. break;
  17302. } else {
  17303. $$03645 = $20;$$03744 = $15;$$03943 = $$140;$$046 = $$;
  17304. }
  17305. }
  17306. return;
  17307. }
  17308. function _GetImageData($0) {
  17309. $0 = $0|0;
  17310. var $$0104105 = 0, $$0106 = 0, $$1 = 0, $1 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0.0, $103 = 0.0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0;
  17311. var $114 = 0, $115 = 0, $116 = 0, $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $131 = 0;
  17312. var $132 = 0, $133 = 0, $134 = 0, $135 = 0, $136 = 0, $137 = 0, $138 = 0, $139 = 0, $14 = 0, $140 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0;
  17313. var $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0.0, $4 = 0, $40 = 0.0, $41 = 0;
  17314. var $42 = 0, $43 = 0, $44 = 0, $45 = 0.0, $46 = 0.0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0.0, $52 = 0.0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0;
  17315. var $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0.0, $65 = 0.0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0.0, $71 = 0.0, $72 = 0, $73 = 0, $74 = 0, $75 = 0.0, $76 = 0.0, $77 = 0, $78 = 0;
  17316. var $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0.0, $86 = 0.0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0.0, $92 = 0.0, $93 = 0, $94 = 0, $95 = 0, $96 = 0;
  17317. var $97 = 0.0, $98 = 0.0, $99 = 0, $vararg_buffer = 0, label = 0, sp = 0;
  17318. sp = STACKTOP;
  17319. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  17320. $vararg_buffer = sp;
  17321. $1 = ((($0)) + 4|0);
  17322. $2 = HEAP32[$1>>2]|0;
  17323. $3 = ((($0)) + 8|0);
  17324. $4 = HEAP32[$3>>2]|0;
  17325. $5 = $2 << 2;
  17326. $6 = Math_imul($5, $4)|0;
  17327. $7 = (_malloc($6)|0);
  17328. $8 = HEAP32[$1>>2]|0;
  17329. $9 = Math_imul($4, $8)|0;
  17330. $10 = ($9|0)>(0);
  17331. if (!($10)) {
  17332. STACKTOP = sp;return ($7|0);
  17333. }
  17334. $11 = ((($0)) + 16|0);
  17335. $12 = HEAP32[$11>>2]|0;
  17336. $13 = HEAP32[$0>>2]|0;
  17337. $$0104105 = 0;$$0106 = 0;
  17338. while(1) {
  17339. switch ($12|0) {
  17340. case 1: {
  17341. $14 = (($13) + ($$0106)|0);
  17342. $15 = HEAP8[$14>>0]|0;
  17343. $16 = (($7) + ($$0104105<<2)|0);
  17344. HEAP8[$16>>0] = $15;
  17345. $17 = HEAP8[$14>>0]|0;
  17346. $18 = (((($7) + ($$0104105<<2)|0)) + 1|0);
  17347. HEAP8[$18>>0] = $17;
  17348. $19 = HEAP8[$14>>0]|0;
  17349. $20 = (((($7) + ($$0104105<<2)|0)) + 2|0);
  17350. HEAP8[$20>>0] = $19;
  17351. $21 = (((($7) + ($$0104105<<2)|0)) + 3|0);
  17352. HEAP8[$21>>0] = -1;
  17353. $22 = (($$0106) + 1)|0;
  17354. $$1 = $22;
  17355. break;
  17356. }
  17357. case 2: {
  17358. $23 = (($13) + ($$0106)|0);
  17359. $24 = HEAP8[$23>>0]|0;
  17360. $25 = (($7) + ($$0104105<<2)|0);
  17361. HEAP8[$25>>0] = $24;
  17362. $26 = HEAP8[$23>>0]|0;
  17363. $27 = (((($7) + ($$0104105<<2)|0)) + 1|0);
  17364. HEAP8[$27>>0] = $26;
  17365. $28 = HEAP8[$23>>0]|0;
  17366. $29 = (((($7) + ($$0104105<<2)|0)) + 2|0);
  17367. HEAP8[$29>>0] = $28;
  17368. $30 = (($$0106) + 1)|0;
  17369. $31 = (($13) + ($30)|0);
  17370. $32 = HEAP8[$31>>0]|0;
  17371. $33 = (((($7) + ($$0104105<<2)|0)) + 3|0);
  17372. HEAP8[$33>>0] = $32;
  17373. $34 = (($$0106) + 2)|0;
  17374. $$1 = $34;
  17375. break;
  17376. }
  17377. case 5: {
  17378. $35 = (($13) + ($$0106<<1)|0);
  17379. $36 = HEAP16[$35>>1]|0;
  17380. $37 = $36&65535;
  17381. $38 = $37 >>> 11;
  17382. $39 = (+($38|0));
  17383. $40 = $39 * 8.0;
  17384. $41 = (~~(($40))&255);
  17385. $42 = (($7) + ($$0104105<<2)|0);
  17386. HEAP8[$42>>0] = $41;
  17387. $43 = $37 >>> 6;
  17388. $44 = $43 & 31;
  17389. $45 = (+($44|0));
  17390. $46 = $45 * 8.0;
  17391. $47 = (~~(($46))&255);
  17392. $48 = (((($7) + ($$0104105<<2)|0)) + 1|0);
  17393. HEAP8[$48>>0] = $47;
  17394. $49 = $37 >>> 1;
  17395. $50 = $49 & 31;
  17396. $51 = (+($50|0));
  17397. $52 = $51 * 8.0;
  17398. $53 = (~~(($52))&255);
  17399. $54 = (((($7) + ($$0104105<<2)|0)) + 2|0);
  17400. HEAP8[$54>>0] = $53;
  17401. $55 = $37 & 1;
  17402. $56 = (0 - ($55))|0;
  17403. $57 = $56&255;
  17404. $58 = (((($7) + ($$0104105<<2)|0)) + 3|0);
  17405. HEAP8[$58>>0] = $57;
  17406. $59 = (($$0106) + 1)|0;
  17407. $$1 = $59;
  17408. break;
  17409. }
  17410. case 3: {
  17411. $60 = (($13) + ($$0106<<1)|0);
  17412. $61 = HEAP16[$60>>1]|0;
  17413. $62 = $61&65535;
  17414. $63 = $62 >>> 11;
  17415. $64 = (+($63|0));
  17416. $65 = $64 * 8.0;
  17417. $66 = (~~(($65))&255);
  17418. $67 = (($7) + ($$0104105<<2)|0);
  17419. HEAP8[$67>>0] = $66;
  17420. $68 = $62 >>> 5;
  17421. $69 = $68 & 63;
  17422. $70 = (+($69|0));
  17423. $71 = $70 * 4.0;
  17424. $72 = (~~(($71))&255);
  17425. $73 = (((($7) + ($$0104105<<2)|0)) + 1|0);
  17426. HEAP8[$73>>0] = $72;
  17427. $74 = $62 & 31;
  17428. $75 = (+($74|0));
  17429. $76 = $75 * 8.0;
  17430. $77 = (~~(($76))&255);
  17431. $78 = (((($7) + ($$0104105<<2)|0)) + 2|0);
  17432. HEAP8[$78>>0] = $77;
  17433. $79 = (((($7) + ($$0104105<<2)|0)) + 3|0);
  17434. HEAP8[$79>>0] = -1;
  17435. $80 = (($$0106) + 1)|0;
  17436. $$1 = $80;
  17437. break;
  17438. }
  17439. case 6: {
  17440. $81 = (($13) + ($$0106<<1)|0);
  17441. $82 = HEAP16[$81>>1]|0;
  17442. $83 = $82&65535;
  17443. $84 = $83 >>> 12;
  17444. $85 = (+($84|0));
  17445. $86 = $85 * 17.0;
  17446. $87 = (~~(($86))&255);
  17447. $88 = (($7) + ($$0104105<<2)|0);
  17448. HEAP8[$88>>0] = $87;
  17449. $89 = $83 >>> 8;
  17450. $90 = $89 & 15;
  17451. $91 = (+($90|0));
  17452. $92 = $91 * 17.0;
  17453. $93 = (~~(($92))&255);
  17454. $94 = (((($7) + ($$0104105<<2)|0)) + 1|0);
  17455. HEAP8[$94>>0] = $93;
  17456. $95 = $83 >>> 4;
  17457. $96 = $95 & 15;
  17458. $97 = (+($96|0));
  17459. $98 = $97 * 17.0;
  17460. $99 = (~~(($98))&255);
  17461. $100 = (((($7) + ($$0104105<<2)|0)) + 2|0);
  17462. HEAP8[$100>>0] = $99;
  17463. $101 = $83 & 15;
  17464. $102 = (+($101|0));
  17465. $103 = $102 * 17.0;
  17466. $104 = (~~(($103))&255);
  17467. $105 = (((($7) + ($$0104105<<2)|0)) + 3|0);
  17468. HEAP8[$105>>0] = $104;
  17469. $106 = (($$0106) + 1)|0;
  17470. $$1 = $106;
  17471. break;
  17472. }
  17473. case 7: {
  17474. $107 = (($13) + ($$0106)|0);
  17475. $108 = HEAP8[$107>>0]|0;
  17476. $109 = (($7) + ($$0104105<<2)|0);
  17477. HEAP8[$109>>0] = $108;
  17478. $110 = (($$0106) + 1)|0;
  17479. $111 = (($13) + ($110)|0);
  17480. $112 = HEAP8[$111>>0]|0;
  17481. $113 = (((($7) + ($$0104105<<2)|0)) + 1|0);
  17482. HEAP8[$113>>0] = $112;
  17483. $114 = (($$0106) + 2)|0;
  17484. $115 = (($13) + ($114)|0);
  17485. $116 = HEAP8[$115>>0]|0;
  17486. $117 = (((($7) + ($$0104105<<2)|0)) + 2|0);
  17487. HEAP8[$117>>0] = $116;
  17488. $118 = (($$0106) + 3)|0;
  17489. $119 = (($13) + ($118)|0);
  17490. $120 = HEAP8[$119>>0]|0;
  17491. $121 = (((($7) + ($$0104105<<2)|0)) + 3|0);
  17492. HEAP8[$121>>0] = $120;
  17493. $122 = (($$0106) + 4)|0;
  17494. $$1 = $122;
  17495. break;
  17496. }
  17497. case 4: {
  17498. $123 = (($13) + ($$0106)|0);
  17499. $124 = HEAP8[$123>>0]|0;
  17500. $125 = (($7) + ($$0104105<<2)|0);
  17501. HEAP8[$125>>0] = $124;
  17502. $126 = (($$0106) + 1)|0;
  17503. $127 = (($13) + ($126)|0);
  17504. $128 = HEAP8[$127>>0]|0;
  17505. $129 = (((($7) + ($$0104105<<2)|0)) + 1|0);
  17506. HEAP8[$129>>0] = $128;
  17507. $130 = (($$0106) + 2)|0;
  17508. $131 = (($13) + ($130)|0);
  17509. $132 = HEAP8[$131>>0]|0;
  17510. $133 = (((($7) + ($$0104105<<2)|0)) + 2|0);
  17511. HEAP8[$133>>0] = $132;
  17512. $134 = (((($7) + ($$0104105<<2)|0)) + 3|0);
  17513. HEAP8[$134>>0] = -1;
  17514. $135 = (($$0106) + 3)|0;
  17515. $$1 = $135;
  17516. break;
  17517. }
  17518. default: {
  17519. _TraceLog(2,4012,$vararg_buffer);
  17520. $$1 = $$0106;
  17521. }
  17522. }
  17523. $136 = (($$0104105) + 1)|0;
  17524. $137 = HEAP32[$1>>2]|0;
  17525. $138 = HEAP32[$3>>2]|0;
  17526. $139 = Math_imul($138, $137)|0;
  17527. $140 = ($136|0)<($139|0);
  17528. if ($140) {
  17529. $$0104105 = $136;$$0106 = $$1;
  17530. } else {
  17531. break;
  17532. }
  17533. }
  17534. STACKTOP = sp;return ($7|0);
  17535. }
  17536. function _ErrorCallback($0,$1) {
  17537. $0 = $0|0;
  17538. $1 = $1|0;
  17539. var $vararg_buffer = 0, $vararg_ptr1 = 0, label = 0, sp = 0;
  17540. sp = STACKTOP;
  17541. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  17542. $vararg_buffer = sp;
  17543. HEAP32[$vararg_buffer>>2] = $0;
  17544. $vararg_ptr1 = ((($vararg_buffer)) + 4|0);
  17545. HEAP32[$vararg_ptr1>>2] = $1;
  17546. _TraceLog(2,7878,$vararg_buffer);
  17547. STACKTOP = sp;return;
  17548. }
  17549. function _rlGetVersion() {
  17550. var label = 0, sp = 0;
  17551. sp = STACKTOP;
  17552. return 4;
  17553. }
  17554. function _SetupFramebufferSize($0,$1) {
  17555. $0 = $0|0;
  17556. $1 = $1|0;
  17557. var $$sink = 0, $$sink1 = 0, $10 = 0.0, $11 = 0.0, $12 = 0.0, $13 = 0, $14 = 0.0, $15 = 0.0, $16 = 0, $17 = 0, $18 = 0.0, $19 = 0.0, $2 = 0, $20 = 0, $21 = 0, $22 = 0.0, $23 = 0, $24 = 0, $25 = 0, $26 = 0.0;
  17558. var $27 = 0, $28 = 0.0, $29 = 0.0, $3 = 0, $30 = 0, $31 = 0, $32 = 0.0, $33 = 0.0, $34 = 0.0, $35 = 0, $36 = 0.0, $37 = 0, $38 = 0.0, $39 = 0.0, $4 = 0, $40 = 0, $41 = 0.0, $42 = 0, $43 = 0, $44 = 0.0;
  17559. var $45 = 0, $46 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0.0, $9 = 0, $or$cond = 0, $roundf = 0.0, $roundf38 = 0.0, $roundf39 = 0.0, $roundf40 = 0.0, $vararg_buffer = 0, $vararg_buffer4 = 0, $vararg_buffer8 = 0, $vararg_ptr1 = 0, $vararg_ptr11 = 0, $vararg_ptr12 = 0, $vararg_ptr13 = 0, $vararg_ptr2 = 0;
  17560. var $vararg_ptr3 = 0, $vararg_ptr7 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  17561. sp = STACKTOP;
  17562. STACKTOP = STACKTOP + 112|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(112|0);
  17563. $vararg_buffer8 = sp + 24|0;
  17564. $vararg_buffer4 = sp + 16|0;
  17565. $vararg_buffer = sp;
  17566. $2 = sp + 40|0;
  17567. $3 = HEAP32[7749]|0;
  17568. $4 = ($3|0)>($0|0);
  17569. if (!($4)) {
  17570. $5 = HEAP32[7748]|0;
  17571. $6 = ($5|0)>($1|0);
  17572. if (!($6)) {
  17573. $30 = ($3|0)<($0|0);
  17574. $31 = ($5|0)<($1|0);
  17575. $or$cond = $30 | $31;
  17576. if (!($or$cond)) {
  17577. HEAP32[7790] = $3;
  17578. HEAP32[7791] = $5;
  17579. HEAP32[7792] = 0;
  17580. HEAP32[7793] = 0;
  17581. STACKTOP = sp;return;
  17582. }
  17583. HEAP32[$vararg_buffer8>>2] = $3;
  17584. $vararg_ptr11 = ((($vararg_buffer8)) + 4|0);
  17585. HEAP32[$vararg_ptr11>>2] = $5;
  17586. $vararg_ptr12 = ((($vararg_buffer8)) + 8|0);
  17587. HEAP32[$vararg_ptr12>>2] = $0;
  17588. $vararg_ptr13 = ((($vararg_buffer8)) + 12|0);
  17589. HEAP32[$vararg_ptr13>>2] = $1;
  17590. _TraceLog(0,7812,$vararg_buffer8);
  17591. $32 = (+($0|0));
  17592. $33 = (+($1|0));
  17593. $34 = $32 / $33;
  17594. $35 = HEAP32[7749]|0;
  17595. $36 = (+($35|0));
  17596. $37 = HEAP32[7748]|0;
  17597. $38 = (+($37|0));
  17598. $39 = $36 / $38;
  17599. $40 = !($34 <= $39);
  17600. if ($40) {
  17601. $44 = $34 * $38;
  17602. $roundf = (+_roundf((+$44)));
  17603. $45 = (~~(($roundf)));
  17604. HEAP32[7790] = $45;
  17605. HEAP32[7791] = $37;
  17606. $46 = (($45) - ($35))|0;
  17607. HEAP32[7792] = $46;
  17608. $$sink1 = 0;
  17609. } else {
  17610. HEAP32[7790] = $35;
  17611. $41 = $36 / $34;
  17612. $roundf38 = (+_roundf((+$41)));
  17613. $42 = (~~(($roundf38)));
  17614. HEAP32[7791] = $42;
  17615. HEAP32[7792] = 0;
  17616. $43 = (($42) - ($37))|0;
  17617. $$sink1 = $43;
  17618. }
  17619. HEAP32[7793] = $$sink1;
  17620. STACKTOP = sp;return;
  17621. }
  17622. }
  17623. $7 = HEAP32[7748]|0;
  17624. HEAP32[$vararg_buffer>>2] = $3;
  17625. $vararg_ptr1 = ((($vararg_buffer)) + 4|0);
  17626. HEAP32[$vararg_ptr1>>2] = $7;
  17627. $vararg_ptr2 = ((($vararg_buffer)) + 8|0);
  17628. HEAP32[$vararg_ptr2>>2] = $0;
  17629. $vararg_ptr3 = ((($vararg_buffer)) + 12|0);
  17630. HEAP32[$vararg_ptr3>>2] = $1;
  17631. _TraceLog(2,7669,$vararg_buffer);
  17632. $8 = (+($0|0));
  17633. $9 = HEAP32[7749]|0;
  17634. $10 = (+($9|0));
  17635. $11 = $8 / $10;
  17636. $12 = (+($1|0));
  17637. $13 = HEAP32[7748]|0;
  17638. $14 = (+($13|0));
  17639. $15 = $12 / $14;
  17640. $16 = !($11 <= $15);
  17641. if ($16) {
  17642. $22 = $10 * $15;
  17643. $roundf39 = (+_roundf((+$22)));
  17644. $23 = (~~(($roundf39)));
  17645. HEAP32[7790] = $23;
  17646. HEAP32[7791] = $1;
  17647. $24 = (($0) - ($23))|0;
  17648. HEAP32[7792] = $24;
  17649. $$sink = 0;
  17650. } else {
  17651. HEAP32[7790] = $0;
  17652. $17 = HEAP32[7748]|0;
  17653. $18 = (+($17|0));
  17654. $19 = $11 * $18;
  17655. $roundf40 = (+_roundf((+$19)));
  17656. $20 = (~~(($roundf40)));
  17657. HEAP32[7791] = $20;
  17658. HEAP32[7792] = 0;
  17659. $21 = (($1) - ($20))|0;
  17660. $$sink = $21;
  17661. }
  17662. HEAP32[7793] = $$sink;
  17663. $25 = HEAP32[7790]|0;
  17664. $26 = (+($25|0));
  17665. $27 = HEAP32[7749]|0;
  17666. $28 = (+($27|0));
  17667. $29 = $26 / $28;
  17668. _MatrixScale($2,$29,$29,$29);
  17669. dest=31084; src=$2; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  17670. HEAP32[7790] = $0;
  17671. HEAP32[7791] = $1;
  17672. HEAP32[$vararg_buffer4>>2] = $0;
  17673. $vararg_ptr7 = ((($vararg_buffer4)) + 4|0);
  17674. HEAP32[$vararg_ptr7>>2] = $1;
  17675. _TraceLog(2,7747,$vararg_buffer4);
  17676. STACKTOP = sp;return;
  17677. }
  17678. function _WindowSizeCallback($0,$1,$2) {
  17679. $0 = $0|0;
  17680. $1 = $1|0;
  17681. $2 = $2|0;
  17682. var $3 = 0.0, $4 = 0.0, label = 0, sp = 0;
  17683. sp = STACKTOP;
  17684. _rlViewport(0,0,$1,$2);
  17685. _rlMatrixMode(5889);
  17686. _rlLoadIdentity();
  17687. $3 = (+($1|0));
  17688. $4 = (+($2|0));
  17689. _rlOrtho(0.0,$3,$4,0.0,0.0,1.0);
  17690. _rlMatrixMode(5888);
  17691. _rlLoadIdentity();
  17692. _rlClearScreenBuffers();
  17693. HEAP32[7749] = $1;
  17694. HEAP32[7748] = $2;
  17695. HEAP32[7790] = $1;
  17696. HEAP32[7791] = $2;
  17697. return;
  17698. }
  17699. function _CursorEnterCallback($0,$1) {
  17700. $0 = $0|0;
  17701. $1 = $1|0;
  17702. var label = 0, sp = 0;
  17703. sp = STACKTOP;
  17704. return;
  17705. }
  17706. function _KeyCallback($0,$1,$2,$3,$4) {
  17707. $0 = $0|0;
  17708. $1 = $1|0;
  17709. $2 = $2|0;
  17710. $3 = $3|0;
  17711. $4 = $4|0;
  17712. var $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, label = 0, sp = 0;
  17713. sp = STACKTOP;
  17714. $5 = HEAP32[744]|0;
  17715. $6 = ($5|0)==($1|0);
  17716. $7 = ($3|0)==(1);
  17717. $or$cond = $7 & $6;
  17718. if ($or$cond) {
  17719. _glfwSetWindowShouldClose(($0|0),1);
  17720. return;
  17721. }
  17722. $8 = $3&255;
  17723. $9 = (35967 + ($1)|0);
  17724. HEAP8[$9>>0] = $8;
  17725. if (!($7)) {
  17726. return;
  17727. }
  17728. HEAP32[743] = $1;
  17729. return;
  17730. }
  17731. function _MouseButtonCallback($0,$1,$2,$3) {
  17732. $0 = $0|0;
  17733. $1 = $1|0;
  17734. $2 = $2|0;
  17735. $3 = $3|0;
  17736. var $$byval_copy = 0, $$sink = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0.0, $27 = 0.0;
  17737. var $28 = 0.0, $29 = 0, $30 = 0.0, $31 = 0, $32 = 0.0, $33 = 0.0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  17738. sp = STACKTOP;
  17739. STACKTOP = STACKTOP + 128|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(128|0);
  17740. $$byval_copy = sp + 64|0;
  17741. $4 = sp + 8|0;
  17742. $5 = sp;
  17743. $6 = $2&255;
  17744. $7 = (35961 + ($1)|0);
  17745. HEAP8[$7>>0] = $6;
  17746. $8 = (_IsMouseButtonPressed(0)|0);
  17747. $9 = ($8|0)==(0);
  17748. if ($9) {
  17749. $10 = (_IsMouseButtonReleased(0)|0);
  17750. $11 = ($10|0)==(0);
  17751. if (!($11)) {
  17752. $$sink = 0;
  17753. label = 3;
  17754. }
  17755. } else {
  17756. $$sink = 1;
  17757. label = 3;
  17758. }
  17759. if ((label|0) == 3) {
  17760. HEAP32[$4>>2] = $$sink;
  17761. }
  17762. $12 = ((($4)) + 8|0);
  17763. HEAP32[$12>>2] = 0;
  17764. $13 = ((($4)) + 4|0);
  17765. HEAP32[$13>>2] = 1;
  17766. $14 = ((($4)) + 24|0);
  17767. _GetMousePosition($5);
  17768. $15 = $5;
  17769. $16 = $15;
  17770. $17 = HEAP32[$16>>2]|0;
  17771. $18 = (($15) + 4)|0;
  17772. $19 = $18;
  17773. $20 = HEAP32[$19>>2]|0;
  17774. $21 = $14;
  17775. $22 = $21;
  17776. HEAP32[$22>>2] = $17;
  17777. $23 = (($21) + 4)|0;
  17778. $24 = $23;
  17779. HEAP32[$24>>2] = $20;
  17780. $25 = (_GetScreenWidth()|0);
  17781. $26 = (+($25|0));
  17782. $27 = +HEAPF32[$14>>2];
  17783. $28 = $27 / $26;
  17784. HEAPF32[$14>>2] = $28;
  17785. $29 = (_GetScreenHeight()|0);
  17786. $30 = (+($29|0));
  17787. $31 = ((($4)) + 28|0);
  17788. $32 = +HEAPF32[$31>>2];
  17789. $33 = $32 / $30;
  17790. HEAPF32[$31>>2] = $33;
  17791. dest=$$byval_copy; src=$4; stop=dest+56|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  17792. _ProcessGestureEvent($$byval_copy);
  17793. STACKTOP = sp;return;
  17794. }
  17795. function _MouseCursorPosCallback($0,$1,$2) {
  17796. $0 = $0|0;
  17797. $1 = +$1;
  17798. $2 = +$2;
  17799. var $$byval_copy = 0, $$sroa$0$0$$sroa_idx = 0, $$sroa$2$0$$sroa_idx1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0.0, $21 = 0.0, $22 = 0.0, $23 = 0, $24 = 0.0, $25 = 0.0, $26 = 0.0;
  17800. var $3 = 0, $4 = 0, $5 = 0, $6 = 0.0, $7 = 0.0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  17801. sp = STACKTOP;
  17802. STACKTOP = STACKTOP + 112|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(112|0);
  17803. $$byval_copy = sp + 56|0;
  17804. $3 = sp;
  17805. HEAP32[$3>>2] = 2;
  17806. $4 = ((($3)) + 8|0);
  17807. HEAP32[$4>>2] = 0;
  17808. $5 = ((($3)) + 4|0);
  17809. HEAP32[$5>>2] = 1;
  17810. $6 = $1;
  17811. $7 = $2;
  17812. $$sroa$0$0$$sroa_idx = ((($3)) + 24|0);
  17813. HEAPF32[$$sroa$0$0$$sroa_idx>>2] = $6;
  17814. $$sroa$2$0$$sroa_idx1 = ((($3)) + 28|0);
  17815. HEAPF32[$$sroa$2$0$$sroa_idx1>>2] = $7;
  17816. $8 = ((($3)) + 24|0);
  17817. $9 = $8;
  17818. $10 = $9;
  17819. $11 = HEAP32[$10>>2]|0;
  17820. $12 = (($9) + 4)|0;
  17821. $13 = $12;
  17822. $14 = HEAP32[$13>>2]|0;
  17823. $15 = 14080;
  17824. $16 = $15;
  17825. HEAP32[$16>>2] = $11;
  17826. $17 = (($15) + 4)|0;
  17827. $18 = $17;
  17828. HEAP32[$18>>2] = $14;
  17829. $19 = (_GetScreenWidth()|0);
  17830. $20 = (+($19|0));
  17831. $21 = +HEAPF32[$8>>2];
  17832. $22 = $21 / $20;
  17833. HEAPF32[$8>>2] = $22;
  17834. $23 = (_GetScreenHeight()|0);
  17835. $24 = (+($23|0));
  17836. $25 = +HEAPF32[$$sroa$2$0$$sroa_idx1>>2];
  17837. $26 = $25 / $24;
  17838. HEAPF32[$$sroa$2$0$$sroa_idx1>>2] = $26;
  17839. dest=$$byval_copy; src=$3; stop=dest+56|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  17840. _ProcessGestureEvent($$byval_copy);
  17841. STACKTOP = sp;return;
  17842. }
  17843. function _CharCallback($0,$1) {
  17844. $0 = $0|0;
  17845. $1 = $1|0;
  17846. var label = 0, sp = 0;
  17847. sp = STACKTOP;
  17848. HEAP32[743] = $1;
  17849. return;
  17850. }
  17851. function _ScrollCallback($0,$1,$2) {
  17852. $0 = $0|0;
  17853. $1 = +$1;
  17854. $2 = +$2;
  17855. var $3 = 0, label = 0, sp = 0;
  17856. sp = STACKTOP;
  17857. $3 = (~~(($2)));
  17858. HEAP32[8163] = $3;
  17859. return;
  17860. }
  17861. function _WindowIconifyCallback($0,$1) {
  17862. $0 = $0|0;
  17863. $1 = $1|0;
  17864. var $$sink = 0, $2 = 0, label = 0, sp = 0;
  17865. sp = STACKTOP;
  17866. $2 = ($1|0)!=(0);
  17867. $$sink = $2&1;
  17868. HEAP32[8162] = $$sink;
  17869. return;
  17870. }
  17871. function _rlglInit($0,$1) {
  17872. $0 = $0|0;
  17873. $1 = $1|0;
  17874. var $$05965 = 0, $$06066 = 0, $$06167 = 0, $$062 = 0, $$sink63 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0;
  17875. var $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0;
  17876. var $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0;
  17877. var $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0.0, $72 = 0.0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0;
  17878. var $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $9 = 0, $exitcond = 0, $exitcond69 = 0, $exitcond70 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, $vararg_buffer10 = 0, $vararg_buffer13 = 0, $vararg_buffer15 = 0, $vararg_buffer17 = 0, $vararg_buffer19 = 0;
  17879. var $vararg_buffer21 = 0, $vararg_buffer23 = 0, $vararg_buffer25 = 0, $vararg_buffer27 = 0, $vararg_buffer29 = 0, $vararg_buffer31 = 0, $vararg_buffer34 = 0, $vararg_buffer36 = 0, $vararg_buffer39 = 0, $vararg_buffer4 = 0, $vararg_buffer41 = 0, $vararg_buffer7 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  17880. sp = STACKTOP;
  17881. STACKTOP = STACKTOP + 2464|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(2464|0);
  17882. $vararg_buffer41 = sp + 2184|0;
  17883. $vararg_buffer39 = sp + 2176|0;
  17884. $vararg_buffer36 = sp + 2168|0;
  17885. $vararg_buffer34 = sp + 2160|0;
  17886. $vararg_buffer31 = sp + 2152|0;
  17887. $vararg_buffer29 = sp + 2144|0;
  17888. $vararg_buffer27 = sp + 2136|0;
  17889. $vararg_buffer25 = sp + 2128|0;
  17890. $vararg_buffer23 = sp + 2120|0;
  17891. $vararg_buffer21 = sp + 2112|0;
  17892. $vararg_buffer19 = sp + 2104|0;
  17893. $vararg_buffer17 = sp + 2096|0;
  17894. $vararg_buffer15 = sp + 2088|0;
  17895. $vararg_buffer13 = sp + 2080|0;
  17896. $vararg_buffer10 = sp + 2072|0;
  17897. $vararg_buffer7 = sp + 24|0;
  17898. $vararg_buffer4 = sp + 16|0;
  17899. $vararg_buffer1 = sp + 8|0;
  17900. $vararg_buffer = sp;
  17901. $2 = sp + 2400|0;
  17902. $3 = sp + 2384|0;
  17903. $4 = sp + 2320|0;
  17904. $5 = sp + 2256|0;
  17905. $6 = sp + 2192|0;
  17906. $7 = (_glGetString(7936)|0);
  17907. HEAP32[$vararg_buffer>>2] = $7;
  17908. _TraceLog(0,4310,$vararg_buffer);
  17909. $8 = (_glGetString(7937)|0);
  17910. HEAP32[$vararg_buffer1>>2] = $8;
  17911. _TraceLog(0,4328,$vararg_buffer1);
  17912. $9 = (_glGetString(7938)|0);
  17913. HEAP32[$vararg_buffer4>>2] = $9;
  17914. _TraceLog(0,4346,$vararg_buffer4);
  17915. $10 = (_glGetString(35724)|0);
  17916. HEAP32[$vararg_buffer7>>2] = $10;
  17917. _TraceLog(0,4364,$vararg_buffer7);
  17918. $11 = (_glGetString(7939)|0);
  17919. $12 = (_strlen($11)|0);
  17920. $13 = (($12) + 1)|0;
  17921. $14 = (_malloc($13)|0);
  17922. _memcpy(($14|0),($11|0),($13|0))|0;
  17923. $$062 = 0;$$sink63 = $14;
  17924. while(1) {
  17925. $15 = (_strtok($$sink63,4382)|0);
  17926. $16 = (($vararg_buffer7) + ($$062<<2)|0);
  17927. HEAP32[$16>>2] = $15;
  17928. $17 = ($15|0)==(0|0);
  17929. $18 = (($$062) + 1)|0;
  17930. if ($17) {
  17931. break;
  17932. } else {
  17933. $$062 = $18;$$sink63 = 0;
  17934. }
  17935. }
  17936. _free($14);
  17937. $19 = (($$062) + -1)|0;
  17938. HEAP32[$vararg_buffer10>>2] = $19;
  17939. _TraceLog(0,4384,$vararg_buffer10);
  17940. $20 = ($$062|0)>(1);
  17941. if ($20) {
  17942. $$06167 = 0;
  17943. while(1) {
  17944. $23 = (($vararg_buffer7) + ($$06167<<2)|0);
  17945. $24 = HEAP32[$23>>2]|0;
  17946. $25 = (_strcmp($24,4419)|0);
  17947. $26 = ($25|0)==(0);
  17948. if ($26) {
  17949. HEAP32[7828] = 1;
  17950. $27 = (_eglGetProcAddress((4446|0))|0);
  17951. HEAP32[7829] = $27;
  17952. $28 = (_eglGetProcAddress((4467|0))|0);
  17953. HEAP32[7830] = $28;
  17954. $29 = (_eglGetProcAddress((4488|0))|0);
  17955. HEAP32[7831] = $29;
  17956. }
  17957. $30 = (_strcmp($24,4512)|0);
  17958. $31 = ($30|0)==(0);
  17959. if ($31) {
  17960. HEAP32[7770] = 1;
  17961. }
  17962. $32 = (_strcmp($24,4532)|0);
  17963. $33 = ($32|0)==(0);
  17964. if ($33) {
  17965. label = 12;
  17966. } else {
  17967. $34 = HEAP32[$23>>2]|0;
  17968. $35 = (_strcmp($34,4564)|0);
  17969. $36 = ($35|0)==(0);
  17970. if ($36) {
  17971. label = 12;
  17972. } else {
  17973. $37 = (_strcmp($34,4597)|0);
  17974. $38 = ($37|0)==(0);
  17975. if ($38) {
  17976. label = 12;
  17977. }
  17978. }
  17979. }
  17980. if ((label|0) == 12) {
  17981. label = 0;
  17982. HEAP32[7765] = 1;
  17983. }
  17984. $39 = (_strcmp($24,4637)|0);
  17985. $40 = ($39|0)==(0);
  17986. if ($40) {
  17987. label = 15;
  17988. } else {
  17989. $41 = HEAP32[$23>>2]|0;
  17990. $42 = (_strcmp($41,4673)|0);
  17991. $43 = ($42|0)==(0);
  17992. if ($43) {
  17993. label = 15;
  17994. }
  17995. }
  17996. if ((label|0) == 15) {
  17997. label = 0;
  17998. HEAP32[7766] = 1;
  17999. }
  18000. $44 = HEAP32[$23>>2]|0;
  18001. $45 = (_strcmp($44,4706)|0);
  18002. $46 = ($45|0)==(0);
  18003. if ($46) {
  18004. HEAP32[7767] = 1;
  18005. }
  18006. $47 = (_strcmp($44,4731)|0);
  18007. $48 = ($47|0)==(0);
  18008. if ($48) {
  18009. HEAP32[7768] = 1;
  18010. }
  18011. $49 = (_strcmp($44,4764)|0);
  18012. $50 = ($49|0)==(0);
  18013. if ($50) {
  18014. HEAP32[7769] = 1;
  18015. }
  18016. $51 = (_strcmp($44,4800)|0);
  18017. $52 = ($51|0)==(0);
  18018. if ($52) {
  18019. HEAP32[7832] = 1;
  18020. _glGetFloatv(34047,(31332|0));
  18021. }
  18022. $53 = HEAP32[$23>>2]|0;
  18023. $54 = (_strcmp($53,4834)|0);
  18024. $55 = ($54|0)==(0);
  18025. if ($55) {
  18026. HEAP32[7834] = 1;
  18027. }
  18028. $56 = (($$06167) + 1)|0;
  18029. $exitcond70 = ($56|0)==($19|0);
  18030. if ($exitcond70) {
  18031. break;
  18032. } else {
  18033. $$06167 = $56;
  18034. }
  18035. }
  18036. }
  18037. $21 = HEAP32[7828]|0;
  18038. $22 = ($21|0)==(0);
  18039. if ($22) {
  18040. _TraceLog(2,4937,$vararg_buffer15);
  18041. } else {
  18042. _TraceLog(0,4862,$vararg_buffer13);
  18043. }
  18044. $57 = HEAP32[7770]|0;
  18045. $58 = ($57|0)==(0);
  18046. if ($58) {
  18047. _TraceLog(2,5073,$vararg_buffer19);
  18048. } else {
  18049. _TraceLog(0,4998,$vararg_buffer17);
  18050. }
  18051. $59 = HEAP32[7765]|0;
  18052. $60 = ($59|0)==(0);
  18053. if (!($60)) {
  18054. _TraceLog(0,5165,$vararg_buffer21);
  18055. }
  18056. $61 = HEAP32[7766]|0;
  18057. $62 = ($61|0)==(0);
  18058. if (!($62)) {
  18059. _TraceLog(0,5211,$vararg_buffer23);
  18060. }
  18061. $63 = HEAP32[7767]|0;
  18062. $64 = ($63|0)==(0);
  18063. if (!($64)) {
  18064. _TraceLog(0,5258,$vararg_buffer25);
  18065. }
  18066. $65 = HEAP32[7768]|0;
  18067. $66 = ($65|0)==(0);
  18068. if (!($66)) {
  18069. _TraceLog(0,5309,$vararg_buffer27);
  18070. }
  18071. $67 = HEAP32[7769]|0;
  18072. $68 = ($67|0)==(0);
  18073. if (!($68)) {
  18074. _TraceLog(0,5356,$vararg_buffer29);
  18075. }
  18076. $69 = HEAP32[7832]|0;
  18077. $70 = ($69|0)==(0);
  18078. if (!($70)) {
  18079. $71 = +HEAPF32[7833];
  18080. $72 = $71;
  18081. HEAPF64[$vararg_buffer31>>3] = $72;
  18082. _TraceLog(0,5403,$vararg_buffer31);
  18083. }
  18084. $73 = HEAP32[7834]|0;
  18085. $74 = ($73|0)==(0);
  18086. if (!($74)) {
  18087. _TraceLog(0,5469,$vararg_buffer34);
  18088. }
  18089. HEAP32[$vararg_buffer10>>2] = -1;
  18090. $75 = (_rlglLoadTexture($vararg_buffer10,1,1,7,1)|0);
  18091. HEAP32[7835] = $75;
  18092. $76 = ($75|0)==(0);
  18093. if ($76) {
  18094. _TraceLog(2,5573,$vararg_buffer39);
  18095. } else {
  18096. HEAP32[$vararg_buffer36>>2] = $75;
  18097. _TraceLog(0,5522,$vararg_buffer36);
  18098. }
  18099. _LoadDefaultShader($2);
  18100. dest=31344; src=$2; stop=dest+56|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18101. dest=31400; src=$2; stop=dest+56|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18102. _LoadDefaultBuffers();
  18103. $77 = (_malloc(49152)|0);
  18104. HEAP32[7864] = $77;
  18105. $$06066 = 0;
  18106. while(1) {
  18107. $79 = HEAP32[7864]|0;
  18108. $80 = (($79) + (($$06066*12)|0)|0);
  18109. _VectorZero($3);
  18110. ;HEAP32[$80>>2]=HEAP32[$3>>2]|0;HEAP32[$80+4>>2]=HEAP32[$3+4>>2]|0;HEAP32[$80+8>>2]=HEAP32[$3+8>>2]|0;
  18111. $81 = (($$06066) + 1)|0;
  18112. $exitcond69 = ($81|0)==(4096);
  18113. if ($exitcond69) {
  18114. break;
  18115. } else {
  18116. $$06066 = $81;
  18117. }
  18118. }
  18119. $78 = (_malloc(36864)|0);
  18120. HEAP32[7865] = $78;
  18121. $$05965 = 0;
  18122. while(1) {
  18123. $82 = (((($78) + (($$05965*144)|0)|0)) + 8|0);
  18124. HEAP32[$82>>2] = 0;
  18125. $83 = (($78) + (($$05965*144)|0)|0);
  18126. HEAP32[$83>>2] = 0;
  18127. $84 = (($$05965) + 1)|0;
  18128. $exitcond = ($84|0)==(256);
  18129. if ($exitcond) {
  18130. break;
  18131. } else {
  18132. $$05965 = $84;
  18133. }
  18134. }
  18135. HEAP32[7866] = 1;
  18136. $85 = HEAP32[7835]|0;
  18137. $86 = ((($78)) + 8|0);
  18138. HEAP32[$86>>2] = $85;
  18139. HEAP32[7867] = 4;
  18140. _MatrixIdentity($4);
  18141. dest=31472; src=$4; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18142. _MatrixIdentity($4);
  18143. dest=(31536); src=$4; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18144. _MatrixIdentity($4);
  18145. dest=(31600); src=$4; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18146. _MatrixIdentity($4);
  18147. dest=(31664); src=$4; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18148. _MatrixIdentity($4);
  18149. dest=(31728); src=$4; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18150. _MatrixIdentity($4);
  18151. dest=(31792); src=$4; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18152. _MatrixIdentity($4);
  18153. dest=(31856); src=$4; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18154. _MatrixIdentity($4);
  18155. dest=(31920); src=$4; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18156. _MatrixIdentity($4);
  18157. dest=(31984); src=$4; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18158. _MatrixIdentity($4);
  18159. dest=(32048); src=$4; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18160. _MatrixIdentity($4);
  18161. dest=(32112); src=$4; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18162. _MatrixIdentity($4);
  18163. dest=(32176); src=$4; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18164. _MatrixIdentity($4);
  18165. dest=(32240); src=$4; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18166. _MatrixIdentity($4);
  18167. dest=(32304); src=$4; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18168. _MatrixIdentity($4);
  18169. dest=(32368); src=$4; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18170. _MatrixIdentity($4);
  18171. dest=(32432); src=$4; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18172. _MatrixIdentity($5);
  18173. dest=31180; src=$5; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18174. _MatrixIdentity($6);
  18175. dest=31244; src=$6; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18176. HEAP32[7794] = 31244;
  18177. _glDepthFunc(515);
  18178. _glDisable(2929);
  18179. _glBlendFunc(770,771);
  18180. _glEnable(3042);
  18181. _glCullFace(1029);
  18182. _glFrontFace(2305);
  18183. _glEnable(2884);
  18184. _glClearColor(0.0,0.0,0.0,1.0);
  18185. _glClearDepthf(1.0);
  18186. _glClear(16640);
  18187. HEAP32[8124] = $0;
  18188. HEAP32[8125] = $1;
  18189. _TraceLog(0,5612,$vararg_buffer41);
  18190. STACKTOP = sp;return;
  18191. }
  18192. function _SetupViewport() {
  18193. var $0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0;
  18194. sp = STACKTOP;
  18195. $0 = HEAP32[7792]|0;
  18196. $1 = (($0|0) / 2)&-1;
  18197. $2 = HEAP32[7793]|0;
  18198. $3 = (($2|0) / 2)&-1;
  18199. $4 = HEAP32[7790]|0;
  18200. $5 = (($4) - ($0))|0;
  18201. $6 = HEAP32[7791]|0;
  18202. $7 = (($6) - ($2))|0;
  18203. _rlViewport($1,$3,$5,$7);
  18204. return;
  18205. }
  18206. function _rlMatrixMode($0) {
  18207. $0 = $0|0;
  18208. var $modelview$sink = 0, label = 0, sp = 0;
  18209. sp = STACKTOP;
  18210. switch ($0|0) {
  18211. case 5889: {
  18212. $modelview$sink = 31180;
  18213. label = 3;
  18214. break;
  18215. }
  18216. case 5888: {
  18217. $modelview$sink = 31244;
  18218. label = 3;
  18219. break;
  18220. }
  18221. default: {
  18222. }
  18223. }
  18224. if ((label|0) == 3) {
  18225. HEAP32[7794] = $modelview$sink;
  18226. }
  18227. HEAP32[7827] = $0;
  18228. return;
  18229. }
  18230. function _rlLoadIdentity() {
  18231. var $0 = 0, $1 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  18232. sp = STACKTOP;
  18233. STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
  18234. $0 = sp;
  18235. $1 = HEAP32[7794]|0;
  18236. _MatrixIdentity($0);
  18237. dest=$1; src=$0; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18238. STACKTOP = sp;return;
  18239. }
  18240. function _rlOrtho($0,$1,$2,$3,$4,$5) {
  18241. $0 = +$0;
  18242. $1 = +$1;
  18243. $2 = +$2;
  18244. $3 = +$3;
  18245. $4 = +$4;
  18246. $5 = +$5;
  18247. var $$byval_copy = 0, $$byval_copy1 = 0, $6 = 0, $7 = 0, $8 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  18248. sp = STACKTOP;
  18249. STACKTOP = STACKTOP + 256|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(256|0);
  18250. $$byval_copy1 = sp + 192|0;
  18251. $$byval_copy = sp + 128|0;
  18252. $6 = sp + 64|0;
  18253. $7 = sp;
  18254. _MatrixOrtho($6,$0,$1,$2,$3,$4,$5);
  18255. _MatrixTranspose($6);
  18256. $8 = HEAP32[7794]|0;
  18257. dest=$$byval_copy; src=$8; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18258. dest=$$byval_copy1; src=$6; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18259. _MatrixMultiply($7,$$byval_copy,$$byval_copy1);
  18260. dest=$8; src=$7; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18261. STACKTOP = sp;return;
  18262. }
  18263. function _ClearBackground($0) {
  18264. $0 = $0|0;
  18265. var $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0;
  18266. sp = STACKTOP;
  18267. $1 = HEAP8[$0>>0]|0;
  18268. $2 = ((($0)) + 1|0);
  18269. $3 = HEAP8[$2>>0]|0;
  18270. $4 = ((($0)) + 2|0);
  18271. $5 = HEAP8[$4>>0]|0;
  18272. $6 = ((($0)) + 3|0);
  18273. $7 = HEAP8[$6>>0]|0;
  18274. _rlClearColor($1,$3,$5,$7);
  18275. return;
  18276. }
  18277. function _rlClearColor($0,$1,$2,$3) {
  18278. $0 = $0|0;
  18279. $1 = $1|0;
  18280. $2 = $2|0;
  18281. $3 = $3|0;
  18282. var $10 = 0.0, $11 = 0.0, $4 = 0.0, $5 = 0.0, $6 = 0.0, $7 = 0.0, $8 = 0.0, $9 = 0.0, label = 0, sp = 0;
  18283. sp = STACKTOP;
  18284. $4 = (+($0&255));
  18285. $5 = $4 / 255.0;
  18286. $6 = (+($1&255));
  18287. $7 = $6 / 255.0;
  18288. $8 = (+($2&255));
  18289. $9 = $8 / 255.0;
  18290. $10 = (+($3&255));
  18291. $11 = $10 / 255.0;
  18292. _glClearColor((+$5),(+$7),(+$9),(+$11));
  18293. return;
  18294. }
  18295. function _rlViewport($0,$1,$2,$3) {
  18296. $0 = $0|0;
  18297. $1 = $1|0;
  18298. $2 = $2|0;
  18299. $3 = $3|0;
  18300. var label = 0, sp = 0;
  18301. sp = STACKTOP;
  18302. _glViewport(($0|0),($1|0),($2|0),($3|0));
  18303. return;
  18304. }
  18305. function _LoadDefaultShader($0) {
  18306. $0 = $0|0;
  18307. var $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  18308. sp = STACKTOP;
  18309. STACKTOP = STACKTOP + 1008|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(1008|0);
  18310. $vararg_buffer1 = sp + 8|0;
  18311. $vararg_buffer = sp;
  18312. $1 = sp + 16|0;
  18313. $2 = sp + 513|0;
  18314. $3 = sp + 72|0;
  18315. _memcpy(($2|0),(6188|0),489)|0;
  18316. _memcpy(($3|0),(6677|0),441)|0;
  18317. $4 = (_LoadShaderProgram($2,$3)|0);
  18318. HEAP32[$1>>2] = $4;
  18319. $5 = ($4|0)==(0);
  18320. if ($5) {
  18321. HEAP32[$vararg_buffer1>>2] = $4;
  18322. _TraceLog(2,7166,$vararg_buffer1);
  18323. } else {
  18324. HEAP32[$vararg_buffer>>2] = $4;
  18325. _TraceLog(0,7118,$vararg_buffer);
  18326. }
  18327. $6 = HEAP32[$1>>2]|0;
  18328. $7 = ($6|0)==(0);
  18329. if (!($7)) {
  18330. _LoadDefaultShaderLocations($1);
  18331. }
  18332. dest=$0; src=$1; stop=dest+56|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18333. STACKTOP = sp;return;
  18334. }
  18335. function _LoadDefaultBuffers() {
  18336. var $$05365 = 0, $$05467 = 0, $$05770 = 0, $$05972 = 0, $$066 = 0, $0 = 0, $1 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0;
  18337. var $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0;
  18338. var $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0;
  18339. var $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0;
  18340. var $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0;
  18341. var $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $exitcond = 0, $exitcond75 = 0, $exitcond78 = 0, $exitcond80 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, $vararg_buffer10 = 0, $vararg_buffer14 = 0, $vararg_buffer17 = 0;
  18342. var $vararg_buffer3 = 0, $vararg_buffer7 = 0, $vararg_ptr13 = 0, $vararg_ptr20 = 0, $vararg_ptr21 = 0, $vararg_ptr22 = 0, $vararg_ptr6 = 0, label = 0, sp = 0;
  18343. sp = STACKTOP;
  18344. STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
  18345. $vararg_buffer17 = sp + 48|0;
  18346. $vararg_buffer14 = sp + 40|0;
  18347. $vararg_buffer10 = sp + 32|0;
  18348. $vararg_buffer7 = sp + 24|0;
  18349. $vararg_buffer3 = sp + 16|0;
  18350. $vararg_buffer1 = sp + 8|0;
  18351. $vararg_buffer = sp;
  18352. $0 = (_malloc(24576)|0);
  18353. HEAP32[(32516)>>2] = $0;
  18354. $1 = (_malloc(8192)|0);
  18355. HEAP32[(32524)>>2] = $1;
  18356. HEAP32[(32520)>>2] = 0;
  18357. HEAP32[(32528)>>2] = 0;
  18358. _memset(($0|0),0,24576)|0;
  18359. $$05972 = 0;
  18360. while(1) {
  18361. $2 = HEAP32[(32524)>>2]|0;
  18362. $3 = (($2) + ($$05972)|0);
  18363. HEAP8[$3>>0] = 0;
  18364. $4 = (($$05972) + 1)|0;
  18365. $exitcond80 = ($4|0)==(8192);
  18366. if ($exitcond80) {
  18367. break;
  18368. } else {
  18369. $$05972 = $4;
  18370. }
  18371. }
  18372. HEAP32[8126] = 0;
  18373. HEAP32[(32512)>>2] = 0;
  18374. HEAP32[(32508)>>2] = 0;
  18375. $5 = (_malloc(73728)|0);
  18376. HEAP32[(32564)>>2] = $5;
  18377. $6 = (_malloc(24576)|0);
  18378. HEAP32[(32572)>>2] = $6;
  18379. HEAP32[(32568)>>2] = 0;
  18380. HEAP32[(32576)>>2] = 0;
  18381. _memset(($5|0),0,73728)|0;
  18382. $$05770 = 0;
  18383. while(1) {
  18384. $7 = HEAP32[(32572)>>2]|0;
  18385. $8 = (($7) + ($$05770)|0);
  18386. HEAP8[$8>>0] = 0;
  18387. $9 = (($$05770) + 1)|0;
  18388. $exitcond78 = ($9|0)==(24576);
  18389. if ($exitcond78) {
  18390. break;
  18391. } else {
  18392. $$05770 = $9;
  18393. }
  18394. }
  18395. HEAP32[8138] = 0;
  18396. HEAP32[(32560)>>2] = 0;
  18397. HEAP32[(32556)>>2] = 0;
  18398. $10 = (_malloc(49152)|0);
  18399. HEAP32[(32612)>>2] = $10;
  18400. $11 = (_malloc(32768)|0);
  18401. HEAP32[(32616)>>2] = $11;
  18402. $12 = (_malloc(16384)|0);
  18403. HEAP32[(32620)>>2] = $12;
  18404. $13 = (_malloc(12288)|0);
  18405. HEAP32[(32624)>>2] = $13;
  18406. $14 = HEAP32[(32612)>>2]|0;
  18407. _memset(($14|0),0,49152)|0;
  18408. $15 = HEAP32[(32616)>>2]|0;
  18409. _memset(($15|0),0,32768)|0;
  18410. $$05467 = 0;
  18411. while(1) {
  18412. $17 = HEAP32[(32620)>>2]|0;
  18413. $18 = (($17) + ($$05467)|0);
  18414. HEAP8[$18>>0] = 0;
  18415. $19 = (($$05467) + 1)|0;
  18416. $exitcond75 = ($19|0)==(16384);
  18417. if ($exitcond75) {
  18418. break;
  18419. } else {
  18420. $$05467 = $19;
  18421. }
  18422. }
  18423. $16 = HEAP32[(32624)>>2]|0;
  18424. $$05365 = 0;$$066 = 0;
  18425. while(1) {
  18426. $22 = $$05365 << 2;
  18427. $23 = $22&65535;
  18428. $24 = (($16) + ($$066<<1)|0);
  18429. HEAP16[$24>>1] = $23;
  18430. $25 = $22 | 1;
  18431. $26 = $25&65535;
  18432. $27 = $$066 | 1;
  18433. $28 = (($16) + ($27<<1)|0);
  18434. HEAP16[$28>>1] = $26;
  18435. $29 = $22 | 2;
  18436. $30 = $29&65535;
  18437. $31 = (($$066) + 2)|0;
  18438. $32 = (($16) + ($31<<1)|0);
  18439. HEAP16[$32>>1] = $30;
  18440. $33 = (($$066) + 3)|0;
  18441. $34 = (($16) + ($33<<1)|0);
  18442. HEAP16[$34>>1] = $23;
  18443. $35 = (($$066) + 4)|0;
  18444. $36 = (($16) + ($35<<1)|0);
  18445. HEAP16[$36>>1] = $30;
  18446. $37 = $22 | 3;
  18447. $38 = $37&65535;
  18448. $39 = (($$066) + 5)|0;
  18449. $40 = (($16) + ($39<<1)|0);
  18450. HEAP16[$40>>1] = $38;
  18451. $41 = (($$05365) + 1)|0;
  18452. $42 = (($$066) + 6)|0;
  18453. $exitcond = ($41|0)==(1024);
  18454. if ($exitcond) {
  18455. break;
  18456. } else {
  18457. $$05365 = $41;$$066 = $42;
  18458. }
  18459. }
  18460. HEAP32[8150] = 0;
  18461. HEAP32[(32604)>>2] = 0;
  18462. HEAP32[(32608)>>2] = 0;
  18463. _TraceLog(0,5659,$vararg_buffer);
  18464. $20 = HEAP32[7828]|0;
  18465. $21 = ($20|0)==(0);
  18466. if (!($21)) {
  18467. $43 = HEAP32[7829]|0;
  18468. FUNCTION_TABLE_vii[$43 & 63](1,(32532));
  18469. $44 = HEAP32[7830]|0;
  18470. $45 = HEAP32[(32532)>>2]|0;
  18471. FUNCTION_TABLE_vi[$44 & 31]($45);
  18472. }
  18473. _glGenBuffers(2,((32536)|0));
  18474. $46 = HEAP32[(32536)>>2]|0;
  18475. _glBindBuffer(34962,($46|0));
  18476. $47 = HEAP32[(32516)>>2]|0;
  18477. _glBufferData(34962,24576,($47|0),35048);
  18478. $48 = HEAP32[(31404)>>2]|0;
  18479. _glEnableVertexAttribArray(($48|0));
  18480. $49 = HEAP32[(31404)>>2]|0;
  18481. _glVertexAttribPointer(($49|0),3,5126,0,0,(0|0));
  18482. _glGenBuffers(2,((32540)|0));
  18483. $50 = HEAP32[(32540)>>2]|0;
  18484. _glBindBuffer(34962,($50|0));
  18485. $51 = HEAP32[(32524)>>2]|0;
  18486. _glBufferData(34962,8192,($51|0),35048);
  18487. $52 = HEAP32[(31424)>>2]|0;
  18488. _glEnableVertexAttribArray(($52|0));
  18489. $53 = HEAP32[(31424)>>2]|0;
  18490. _glVertexAttribPointer(($53|0),4,5121,1,0,(0|0));
  18491. $54 = HEAP32[7828]|0;
  18492. $55 = ($54|0)==(0);
  18493. if ($55) {
  18494. $57 = HEAP32[(32536)>>2]|0;
  18495. $58 = HEAP32[(32540)>>2]|0;
  18496. HEAP32[$vararg_buffer3>>2] = $57;
  18497. $vararg_ptr6 = ((($vararg_buffer3)) + 4|0);
  18498. HEAP32[$vararg_ptr6>>2] = $58;
  18499. _TraceLog(0,5797,$vararg_buffer3);
  18500. } else {
  18501. $56 = HEAP32[(32532)>>2]|0;
  18502. HEAP32[$vararg_buffer1>>2] = $56;
  18503. _TraceLog(0,5732,$vararg_buffer1);
  18504. }
  18505. $59 = HEAP32[7828]|0;
  18506. $60 = ($59|0)==(0);
  18507. if (!($60)) {
  18508. $61 = HEAP32[7829]|0;
  18509. FUNCTION_TABLE_vii[$61 & 63](1,(32580));
  18510. $62 = HEAP32[7830]|0;
  18511. $63 = HEAP32[(32580)>>2]|0;
  18512. FUNCTION_TABLE_vi[$62 & 31]($63);
  18513. }
  18514. _glGenBuffers(1,((32584)|0));
  18515. $64 = HEAP32[(32584)>>2]|0;
  18516. _glBindBuffer(34962,($64|0));
  18517. $65 = HEAP32[(32564)>>2]|0;
  18518. _glBufferData(34962,73728,($65|0),35048);
  18519. $66 = HEAP32[(31404)>>2]|0;
  18520. _glEnableVertexAttribArray(($66|0));
  18521. $67 = HEAP32[(31404)>>2]|0;
  18522. _glVertexAttribPointer(($67|0),3,5126,0,0,(0|0));
  18523. _glGenBuffers(1,((32588)|0));
  18524. $68 = HEAP32[(32588)>>2]|0;
  18525. _glBindBuffer(34962,($68|0));
  18526. $69 = HEAP32[(32572)>>2]|0;
  18527. _glBufferData(34962,24576,($69|0),35048);
  18528. $70 = HEAP32[(31424)>>2]|0;
  18529. _glEnableVertexAttribArray(($70|0));
  18530. $71 = HEAP32[(31424)>>2]|0;
  18531. _glVertexAttribPointer(($71|0),4,5121,1,0,(0|0));
  18532. $72 = HEAP32[7828]|0;
  18533. $73 = ($72|0)==(0);
  18534. if ($73) {
  18535. $75 = HEAP32[(32584)>>2]|0;
  18536. $76 = HEAP32[(32588)>>2]|0;
  18537. HEAP32[$vararg_buffer10>>2] = $75;
  18538. $vararg_ptr13 = ((($vararg_buffer10)) + 4|0);
  18539. HEAP32[$vararg_ptr13>>2] = $76;
  18540. _TraceLog(0,5943,$vararg_buffer10);
  18541. } else {
  18542. $74 = HEAP32[(32580)>>2]|0;
  18543. HEAP32[$vararg_buffer7>>2] = $74;
  18544. _TraceLog(0,5874,$vararg_buffer7);
  18545. }
  18546. $77 = HEAP32[7828]|0;
  18547. $78 = ($77|0)==(0);
  18548. if (!($78)) {
  18549. $79 = HEAP32[7829]|0;
  18550. FUNCTION_TABLE_vii[$79 & 63](1,(32628));
  18551. $80 = HEAP32[7830]|0;
  18552. $81 = HEAP32[(32628)>>2]|0;
  18553. FUNCTION_TABLE_vi[$80 & 31]($81);
  18554. }
  18555. _glGenBuffers(1,((32632)|0));
  18556. $82 = HEAP32[(32632)>>2]|0;
  18557. _glBindBuffer(34962,($82|0));
  18558. $83 = HEAP32[(32612)>>2]|0;
  18559. _glBufferData(34962,49152,($83|0),35048);
  18560. $84 = HEAP32[(31404)>>2]|0;
  18561. _glEnableVertexAttribArray(($84|0));
  18562. $85 = HEAP32[(31404)>>2]|0;
  18563. _glVertexAttribPointer(($85|0),3,5126,0,0,(0|0));
  18564. _glGenBuffers(1,((32636)|0));
  18565. $86 = HEAP32[(32636)>>2]|0;
  18566. _glBindBuffer(34962,($86|0));
  18567. $87 = HEAP32[(32616)>>2]|0;
  18568. _glBufferData(34962,32768,($87|0),35048);
  18569. $88 = HEAP32[(31408)>>2]|0;
  18570. _glEnableVertexAttribArray(($88|0));
  18571. $89 = HEAP32[(31408)>>2]|0;
  18572. _glVertexAttribPointer(($89|0),2,5126,0,0,(0|0));
  18573. _glGenBuffers(1,((32640)|0));
  18574. $90 = HEAP32[(32640)>>2]|0;
  18575. _glBindBuffer(34962,($90|0));
  18576. $91 = HEAP32[(32620)>>2]|0;
  18577. _glBufferData(34962,16384,($91|0),35048);
  18578. $92 = HEAP32[(31424)>>2]|0;
  18579. _glEnableVertexAttribArray(($92|0));
  18580. $93 = HEAP32[(31424)>>2]|0;
  18581. _glVertexAttribPointer(($93|0),4,5121,1,0,(0|0));
  18582. _glGenBuffers(1,((32644)|0));
  18583. $94 = HEAP32[(32644)>>2]|0;
  18584. _glBindBuffer(34963,($94|0));
  18585. $95 = HEAP32[(32624)>>2]|0;
  18586. _glBufferData(34963,12288,($95|0),35044);
  18587. $96 = HEAP32[7828]|0;
  18588. $97 = ($96|0)==(0);
  18589. if ($97) {
  18590. $99 = HEAP32[(32632)>>2]|0;
  18591. $100 = HEAP32[(32636)>>2]|0;
  18592. $101 = HEAP32[(32640)>>2]|0;
  18593. $102 = HEAP32[(32644)>>2]|0;
  18594. HEAP32[$vararg_buffer17>>2] = $99;
  18595. $vararg_ptr20 = ((($vararg_buffer17)) + 4|0);
  18596. HEAP32[$vararg_ptr20>>2] = $100;
  18597. $vararg_ptr21 = ((($vararg_buffer17)) + 8|0);
  18598. HEAP32[$vararg_ptr21>>2] = $101;
  18599. $vararg_ptr22 = ((($vararg_buffer17)) + 12|0);
  18600. HEAP32[$vararg_ptr22>>2] = $102;
  18601. _TraceLog(0,6089,$vararg_buffer17);
  18602. } else {
  18603. $98 = HEAP32[(32628)>>2]|0;
  18604. HEAP32[$vararg_buffer14>>2] = $98;
  18605. _TraceLog(0,6024,$vararg_buffer14);
  18606. }
  18607. $103 = HEAP32[7828]|0;
  18608. $104 = ($103|0)==(0);
  18609. if ($104) {
  18610. STACKTOP = sp;return;
  18611. }
  18612. $105 = HEAP32[7830]|0;
  18613. FUNCTION_TABLE_vi[$105 & 31](0);
  18614. STACKTOP = sp;return;
  18615. }
  18616. function _LoadShaderProgram($0,$1) {
  18617. $0 = $0|0;
  18618. $1 = $1|0;
  18619. var $$0 = 0, $$alloca_mul = 0, $$alloca_mul34 = 0, $$alloca_mul36 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0;
  18620. var $25 = 0, $26 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, $vararg_buffer10 = 0, $vararg_buffer13 = 0, $vararg_buffer16 = 0, $vararg_buffer19 = 0, $vararg_buffer22 = 0, $vararg_buffer4 = 0, $vararg_buffer7 = 0, label = 0, sp = 0;
  18621. sp = STACKTOP;
  18622. STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
  18623. $vararg_buffer22 = sp + 64|0;
  18624. $vararg_buffer19 = sp + 56|0;
  18625. $vararg_buffer16 = sp + 48|0;
  18626. $vararg_buffer13 = sp + 40|0;
  18627. $vararg_buffer10 = sp + 32|0;
  18628. $vararg_buffer7 = sp + 24|0;
  18629. $vararg_buffer4 = sp + 16|0;
  18630. $vararg_buffer1 = sp + 8|0;
  18631. $vararg_buffer = sp;
  18632. $2 = sp + 80|0;
  18633. $3 = sp + 76|0;
  18634. $4 = sp + 72|0;
  18635. $5 = sp + 68|0;
  18636. $6 = (_glCreateShader(35633)|0);
  18637. $7 = (_glCreateShader(35632)|0);
  18638. HEAP32[$2>>2] = $0;
  18639. HEAP32[$3>>2] = $1;
  18640. _glShaderSource(($6|0),1,($2|0),(0|0));
  18641. _glShaderSource(($7|0),1,($3|0),(0|0));
  18642. HEAP32[$4>>2] = 0;
  18643. _glCompileShader(($6|0));
  18644. _glGetShaderiv(($6|0),35713,($4|0));
  18645. $8 = HEAP32[$4>>2]|0;
  18646. $9 = ($8|0)==(1);
  18647. if ($9) {
  18648. HEAP32[$vararg_buffer4>>2] = $6;
  18649. _TraceLog(0,7422,$vararg_buffer4);
  18650. } else {
  18651. HEAP32[$vararg_buffer>>2] = $6;
  18652. _TraceLog(2,7370,$vararg_buffer);
  18653. HEAP32[$vararg_buffer>>2] = 0;
  18654. _glGetShaderiv(($6|0),35716,($vararg_buffer|0));
  18655. $10 = HEAP32[$vararg_buffer>>2]|0;
  18656. $11 = (_llvm_stacksave()|0);
  18657. $$alloca_mul = $10;
  18658. $12 = STACKTOP; STACKTOP = STACKTOP + ((((1*$$alloca_mul)|0)+15)&-16)|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(((((1*$$alloca_mul)|0)+15)&-16)|0);;
  18659. $13 = HEAP32[$vararg_buffer>>2]|0;
  18660. _glGetShaderInfoLog(($6|0),($13|0),($5|0),($12|0));
  18661. HEAP32[$vararg_buffer1>>2] = $12;
  18662. _TraceLog(0,7419,$vararg_buffer1);
  18663. _llvm_stackrestore(($11|0));
  18664. }
  18665. _glCompileShader(($7|0));
  18666. _glGetShaderiv(($7|0),35713,($4|0));
  18667. $14 = HEAP32[$4>>2]|0;
  18668. $15 = ($14|0)==(1);
  18669. if ($15) {
  18670. HEAP32[$vararg_buffer13>>2] = $7;
  18671. _TraceLog(0,7523,$vararg_buffer13);
  18672. } else {
  18673. HEAP32[$vararg_buffer7>>2] = $7;
  18674. _TraceLog(2,7472,$vararg_buffer7);
  18675. HEAP32[$vararg_buffer7>>2] = 0;
  18676. _glGetShaderiv(($7|0),35716,($vararg_buffer7|0));
  18677. $16 = HEAP32[$vararg_buffer7>>2]|0;
  18678. $17 = (_llvm_stacksave()|0);
  18679. $$alloca_mul34 = $16;
  18680. $18 = STACKTOP; STACKTOP = STACKTOP + ((((1*$$alloca_mul34)|0)+15)&-16)|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(((((1*$$alloca_mul34)|0)+15)&-16)|0);;
  18681. $19 = HEAP32[$vararg_buffer7>>2]|0;
  18682. _glGetShaderInfoLog(($7|0),($19|0),($5|0),($18|0));
  18683. HEAP32[$vararg_buffer10>>2] = $18;
  18684. _TraceLog(0,7419,$vararg_buffer10);
  18685. _llvm_stackrestore(($17|0));
  18686. }
  18687. $20 = (_glCreateProgram()|0);
  18688. _glAttachShader(($20|0),($6|0));
  18689. _glAttachShader(($20|0),($7|0));
  18690. _glBindAttribLocation(($20|0),0,(7214|0));
  18691. _glBindAttribLocation(($20|0),1,(7229|0));
  18692. _glBindAttribLocation(($20|0),2,(7260|0));
  18693. _glBindAttribLocation(($20|0),3,(7287|0));
  18694. _glBindAttribLocation(($20|0),4,(7273|0));
  18695. _glBindAttribLocation(($20|0),5,(7244|0));
  18696. _glLinkProgram(($20|0));
  18697. _glGetProgramiv(($20|0),35714,($4|0));
  18698. $21 = HEAP32[$4>>2]|0;
  18699. $22 = ($21|0)==(0);
  18700. if ($22) {
  18701. HEAP32[$vararg_buffer16>>2] = $20;
  18702. _TraceLog(2,7575,$vararg_buffer16);
  18703. HEAP32[$vararg_buffer16>>2] = 0;
  18704. _glGetProgramiv(($20|0),35716,($vararg_buffer16|0));
  18705. $23 = HEAP32[$vararg_buffer16>>2]|0;
  18706. $24 = (_llvm_stacksave()|0);
  18707. $$alloca_mul36 = $23;
  18708. $25 = STACKTOP; STACKTOP = STACKTOP + ((((1*$$alloca_mul36)|0)+15)&-16)|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(((((1*$$alloca_mul36)|0)+15)&-16)|0);;
  18709. $26 = HEAP32[$vararg_buffer16>>2]|0;
  18710. _glGetProgramInfoLog(($20|0),($26|0),($5|0),($25|0));
  18711. HEAP32[$vararg_buffer19>>2] = $25;
  18712. _TraceLog(0,7419,$vararg_buffer19);
  18713. _glDeleteProgram(($20|0));
  18714. _llvm_stackrestore(($24|0));
  18715. $$0 = 0;
  18716. _glDeleteShader(($6|0));
  18717. _glDeleteShader(($7|0));
  18718. STACKTOP = sp;return ($$0|0);
  18719. } else {
  18720. HEAP32[$vararg_buffer22>>2] = $20;
  18721. _TraceLog(0,7621,$vararg_buffer22);
  18722. $$0 = $20;
  18723. _glDeleteShader(($6|0));
  18724. _glDeleteShader(($7|0));
  18725. STACKTOP = sp;return ($$0|0);
  18726. }
  18727. return (0)|0;
  18728. }
  18729. function _LoadDefaultShaderLocations($0) {
  18730. $0 = $0|0;
  18731. var $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0;
  18732. var $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0;
  18733. var sp = 0;
  18734. sp = STACKTOP;
  18735. $1 = HEAP32[$0>>2]|0;
  18736. $2 = (_glGetAttribLocation(($1|0),(7214|0))|0);
  18737. $3 = ((($0)) + 4|0);
  18738. HEAP32[$3>>2] = $2;
  18739. $4 = HEAP32[$0>>2]|0;
  18740. $5 = (_glGetAttribLocation(($4|0),(7229|0))|0);
  18741. $6 = ((($0)) + 8|0);
  18742. HEAP32[$6>>2] = $5;
  18743. $7 = HEAP32[$0>>2]|0;
  18744. $8 = (_glGetAttribLocation(($7|0),(7244|0))|0);
  18745. $9 = ((($0)) + 12|0);
  18746. HEAP32[$9>>2] = $8;
  18747. $10 = HEAP32[$0>>2]|0;
  18748. $11 = (_glGetAttribLocation(($10|0),(7260|0))|0);
  18749. $12 = ((($0)) + 16|0);
  18750. HEAP32[$12>>2] = $11;
  18751. $13 = HEAP32[$0>>2]|0;
  18752. $14 = (_glGetAttribLocation(($13|0),(7273|0))|0);
  18753. $15 = ((($0)) + 20|0);
  18754. HEAP32[$15>>2] = $14;
  18755. $16 = HEAP32[$0>>2]|0;
  18756. $17 = (_glGetAttribLocation(($16|0),(7287|0))|0);
  18757. $18 = ((($0)) + 24|0);
  18758. HEAP32[$18>>2] = $17;
  18759. $19 = HEAP32[$0>>2]|0;
  18760. $20 = (_glGetUniformLocation(($19|0),(7299|0))|0);
  18761. $21 = ((($0)) + 28|0);
  18762. HEAP32[$21>>2] = $20;
  18763. $22 = HEAP32[$0>>2]|0;
  18764. $23 = (_glGetUniformLocation(($22|0),(7309|0))|0);
  18765. $24 = ((($0)) + 32|0);
  18766. HEAP32[$24>>2] = $23;
  18767. $25 = HEAP32[$0>>2]|0;
  18768. $26 = (_glGetUniformLocation(($25|0),(7320|0))|0);
  18769. $27 = ((($0)) + 36|0);
  18770. HEAP32[$27>>2] = $26;
  18771. $28 = HEAP32[$0>>2]|0;
  18772. $29 = (_glGetUniformLocation(($28|0),(7331|0))|0);
  18773. $30 = ((($0)) + 40|0);
  18774. HEAP32[$30>>2] = $29;
  18775. $31 = HEAP32[$0>>2]|0;
  18776. $32 = (_glGetUniformLocation(($31|0),(7343|0))|0);
  18777. $33 = ((($0)) + 44|0);
  18778. HEAP32[$33>>2] = $32;
  18779. $34 = HEAP32[$0>>2]|0;
  18780. $35 = (_glGetUniformLocation(($34|0),(7352|0))|0);
  18781. $36 = ((($0)) + 48|0);
  18782. HEAP32[$36>>2] = $35;
  18783. $37 = HEAP32[$0>>2]|0;
  18784. $38 = (_glGetUniformLocation(($37|0),(7361|0))|0);
  18785. $39 = ((($0)) + 52|0);
  18786. HEAP32[$39>>2] = $38;
  18787. return;
  18788. }
  18789. function _IsMouseButtonPressed($0) {
  18790. $0 = $0|0;
  18791. var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $or$cond = 0, label = 0, sp = 0;
  18792. sp = STACKTOP;
  18793. $1 = (35961 + ($0)|0);
  18794. $2 = HEAP8[$1>>0]|0;
  18795. $3 = (35964 + ($0)|0);
  18796. $4 = HEAP8[$3>>0]|0;
  18797. $5 = ($2<<24>>24)!=($4<<24>>24);
  18798. $6 = ($2<<24>>24)==(1);
  18799. $or$cond = $6 & $5;
  18800. $$0 = $or$cond&1;
  18801. return ($$0|0);
  18802. }
  18803. function _IsMouseButtonReleased($0) {
  18804. $0 = $0|0;
  18805. var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $or$cond = 0, label = 0, sp = 0;
  18806. sp = STACKTOP;
  18807. $1 = (35961 + ($0)|0);
  18808. $2 = HEAP8[$1>>0]|0;
  18809. $3 = (35964 + ($0)|0);
  18810. $4 = HEAP8[$3>>0]|0;
  18811. $5 = ($2<<24>>24)!=($4<<24>>24);
  18812. $6 = ($2<<24>>24)==(0);
  18813. $or$cond = $6 & $5;
  18814. $$0 = $or$cond&1;
  18815. return ($$0|0);
  18816. }
  18817. function _rlClearScreenBuffers() {
  18818. var label = 0, sp = 0;
  18819. sp = STACKTOP;
  18820. _glClear(16640);
  18821. return;
  18822. }
  18823. function _CloseWindow() {
  18824. var $0 = 0, $vararg_buffer = 0, label = 0, sp = 0;
  18825. sp = STACKTOP;
  18826. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  18827. $vararg_buffer = sp;
  18828. _UnloadDefaultFont();
  18829. _rlglClose();
  18830. $0 = HEAP32[7747]|0;
  18831. _glfwDestroyWindow(($0|0));
  18832. _glfwTerminate();
  18833. _TraceLog(0,7933,$vararg_buffer);
  18834. STACKTOP = sp;return;
  18835. }
  18836. function _UnloadDefaultFont() {
  18837. var $$byval_copy = 0, $0 = 0, label = 0, sp = 0;
  18838. sp = STACKTOP;
  18839. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  18840. $$byval_copy = sp;
  18841. ;HEAP32[$$byval_copy>>2]=HEAP32[31028>>2]|0;HEAP32[$$byval_copy+4>>2]=HEAP32[31028+4>>2]|0;HEAP32[$$byval_copy+8>>2]=HEAP32[31028+8>>2]|0;HEAP32[$$byval_copy+12>>2]=HEAP32[31028+12>>2]|0;HEAP32[$$byval_copy+16>>2]=HEAP32[31028+16>>2]|0;
  18842. _UnloadTexture($$byval_copy);
  18843. $0 = HEAP32[(31056)>>2]|0;
  18844. _free($0);
  18845. STACKTOP = sp;return;
  18846. }
  18847. function _rlglClose() {
  18848. var $0 = 0, $1 = 0, $vararg_buffer = 0, label = 0, sp = 0;
  18849. sp = STACKTOP;
  18850. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  18851. $vararg_buffer = sp;
  18852. _UnloadDefaultShader();
  18853. _UnloadDefaultBuffers();
  18854. _glDeleteTextures(1,(31340|0));
  18855. $0 = HEAP32[7835]|0;
  18856. HEAP32[$vararg_buffer>>2] = $0;
  18857. _TraceLog(0,7960,$vararg_buffer);
  18858. $1 = HEAP32[7865]|0;
  18859. _free($1);
  18860. STACKTOP = sp;return;
  18861. }
  18862. function _UnloadDefaultShader() {
  18863. var $0 = 0, label = 0, sp = 0;
  18864. sp = STACKTOP;
  18865. _glUseProgram(0);
  18866. $0 = HEAP32[7836]|0;
  18867. _glDeleteProgram(($0|0));
  18868. return;
  18869. }
  18870. function _UnloadDefaultBuffers() {
  18871. var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  18872. sp = STACKTOP;
  18873. $0 = HEAP32[7828]|0;
  18874. $1 = ($0|0)==(0);
  18875. if (!($1)) {
  18876. $2 = HEAP32[7830]|0;
  18877. FUNCTION_TABLE_vi[$2 & 31](0);
  18878. }
  18879. _glDisableVertexAttribArray(0);
  18880. _glDisableVertexAttribArray(1);
  18881. _glDisableVertexAttribArray(2);
  18882. _glDisableVertexAttribArray(3);
  18883. _glBindBuffer(34962,0);
  18884. _glBindBuffer(34963,0);
  18885. _glDeleteBuffers(1,((32536)|0));
  18886. _glDeleteBuffers(1,((32540)|0));
  18887. _glDeleteBuffers(1,((32584)|0));
  18888. _glDeleteBuffers(1,((32588)|0));
  18889. _glDeleteBuffers(1,((32632)|0));
  18890. _glDeleteBuffers(1,((32636)|0));
  18891. _glDeleteBuffers(1,((32640)|0));
  18892. _glDeleteBuffers(1,((32644)|0));
  18893. $3 = HEAP32[7828]|0;
  18894. $4 = ($3|0)==(0);
  18895. if (!($4)) {
  18896. $5 = HEAP32[7831]|0;
  18897. FUNCTION_TABLE_vii[$5 & 63](1,(32532));
  18898. $6 = HEAP32[7831]|0;
  18899. FUNCTION_TABLE_vii[$6 & 63](1,(32580));
  18900. $7 = HEAP32[7831]|0;
  18901. FUNCTION_TABLE_vii[$7 & 63](1,(32628));
  18902. }
  18903. $8 = HEAP32[(32516)>>2]|0;
  18904. _free($8);
  18905. $9 = HEAP32[(32524)>>2]|0;
  18906. _free($9);
  18907. $10 = HEAP32[(32564)>>2]|0;
  18908. _free($10);
  18909. $11 = HEAP32[(32572)>>2]|0;
  18910. _free($11);
  18911. $12 = HEAP32[(32612)>>2]|0;
  18912. _free($12);
  18913. $13 = HEAP32[(32616)>>2]|0;
  18914. _free($13);
  18915. $14 = HEAP32[(32620)>>2]|0;
  18916. _free($14);
  18917. $15 = HEAP32[(32624)>>2]|0;
  18918. _free($15);
  18919. return;
  18920. }
  18921. function _UnloadTexture($0) {
  18922. $0 = $0|0;
  18923. var $1 = 0, $2 = 0, $3 = 0, $vararg_buffer = 0, label = 0, sp = 0;
  18924. sp = STACKTOP;
  18925. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  18926. $vararg_buffer = sp;
  18927. $1 = HEAP32[$0>>2]|0;
  18928. $2 = ($1|0)==(0);
  18929. if ($2) {
  18930. STACKTOP = sp;return;
  18931. }
  18932. _rlDeleteTextures($1);
  18933. $3 = HEAP32[$0>>2]|0;
  18934. HEAP32[$vararg_buffer>>2] = $3;
  18935. _TraceLog(0,8025,$vararg_buffer);
  18936. STACKTOP = sp;return;
  18937. }
  18938. function _rlDeleteTextures($0) {
  18939. $0 = $0|0;
  18940. var $1 = 0, $2 = 0, label = 0, sp = 0;
  18941. sp = STACKTOP;
  18942. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  18943. $1 = sp;
  18944. HEAP32[$1>>2] = $0;
  18945. $2 = ($0|0)==(0);
  18946. if (!($2)) {
  18947. _glDeleteTextures(1,($1|0));
  18948. }
  18949. STACKTOP = sp;return;
  18950. }
  18951. function _BeginDrawing() {
  18952. var $0 = 0.0, $1 = 0.0, $2 = 0.0, $downscaleView$byval_copy = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  18953. sp = STACKTOP;
  18954. STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
  18955. $downscaleView$byval_copy = sp;
  18956. $0 = (+_GetTime());
  18957. HEAPF64[1779] = $0;
  18958. $1 = +HEAPF64[1762];
  18959. $2 = $0 - $1;
  18960. HEAPF64[1780] = $2;
  18961. HEAPF64[1762] = $0;
  18962. _rlClearScreenBuffers();
  18963. _rlLoadIdentity();
  18964. dest=$downscaleView$byval_copy; src=31084; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  18965. (_MatrixToFloat($downscaleView$byval_copy)|0);
  18966. _rlMultMatrixf(32656);
  18967. STACKTOP = sp;return;
  18968. }
  18969. function _MatrixToFloat($0) {
  18970. $0 = $0|0;
  18971. var $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0;
  18972. var $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  18973. sp = STACKTOP;
  18974. $1 = HEAP32[$0>>2]|0;
  18975. HEAP32[8164] = $1;
  18976. $2 = ((($0)) + 4|0);
  18977. $3 = HEAP32[$2>>2]|0;
  18978. HEAP32[(32660)>>2] = $3;
  18979. $4 = ((($0)) + 8|0);
  18980. $5 = HEAP32[$4>>2]|0;
  18981. HEAP32[(32664)>>2] = $5;
  18982. $6 = ((($0)) + 12|0);
  18983. $7 = HEAP32[$6>>2]|0;
  18984. HEAP32[(32668)>>2] = $7;
  18985. $8 = ((($0)) + 16|0);
  18986. $9 = HEAP32[$8>>2]|0;
  18987. HEAP32[(32672)>>2] = $9;
  18988. $10 = ((($0)) + 20|0);
  18989. $11 = HEAP32[$10>>2]|0;
  18990. HEAP32[(32676)>>2] = $11;
  18991. $12 = ((($0)) + 24|0);
  18992. $13 = HEAP32[$12>>2]|0;
  18993. HEAP32[(32680)>>2] = $13;
  18994. $14 = ((($0)) + 28|0);
  18995. $15 = HEAP32[$14>>2]|0;
  18996. HEAP32[(32684)>>2] = $15;
  18997. $16 = ((($0)) + 32|0);
  18998. $17 = HEAP32[$16>>2]|0;
  18999. HEAP32[(32688)>>2] = $17;
  19000. $18 = ((($0)) + 36|0);
  19001. $19 = HEAP32[$18>>2]|0;
  19002. HEAP32[(32692)>>2] = $19;
  19003. $20 = ((($0)) + 40|0);
  19004. $21 = HEAP32[$20>>2]|0;
  19005. HEAP32[(32696)>>2] = $21;
  19006. $22 = ((($0)) + 44|0);
  19007. $23 = HEAP32[$22>>2]|0;
  19008. HEAP32[(32700)>>2] = $23;
  19009. $24 = ((($0)) + 48|0);
  19010. $25 = HEAP32[$24>>2]|0;
  19011. HEAP32[(32704)>>2] = $25;
  19012. $26 = ((($0)) + 52|0);
  19013. $27 = HEAP32[$26>>2]|0;
  19014. HEAP32[(32708)>>2] = $27;
  19015. $28 = ((($0)) + 56|0);
  19016. $29 = HEAP32[$28>>2]|0;
  19017. HEAP32[(32712)>>2] = $29;
  19018. $30 = ((($0)) + 60|0);
  19019. $31 = HEAP32[$30>>2]|0;
  19020. HEAP32[(32716)>>2] = $31;
  19021. return (32656|0);
  19022. }
  19023. function _rlMultMatrixf($0) {
  19024. $0 = $0|0;
  19025. var $$byval_copy = 0, $$byval_copy1 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0;
  19026. var $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0;
  19027. var $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  19028. sp = STACKTOP;
  19029. STACKTOP = STACKTOP + 256|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(256|0);
  19030. $$byval_copy1 = sp + 192|0;
  19031. $$byval_copy = sp + 128|0;
  19032. $1 = sp + 64|0;
  19033. $2 = sp;
  19034. $3 = HEAP32[$0>>2]|0;
  19035. HEAP32[$1>>2] = $3;
  19036. $4 = ((($1)) + 4|0);
  19037. $5 = ((($0)) + 4|0);
  19038. $6 = HEAP32[$5>>2]|0;
  19039. HEAP32[$4>>2] = $6;
  19040. $7 = ((($1)) + 8|0);
  19041. $8 = ((($0)) + 8|0);
  19042. $9 = HEAP32[$8>>2]|0;
  19043. HEAP32[$7>>2] = $9;
  19044. $10 = ((($1)) + 12|0);
  19045. $11 = ((($0)) + 12|0);
  19046. $12 = HEAP32[$11>>2]|0;
  19047. HEAP32[$10>>2] = $12;
  19048. $13 = ((($1)) + 16|0);
  19049. $14 = ((($0)) + 16|0);
  19050. $15 = HEAP32[$14>>2]|0;
  19051. HEAP32[$13>>2] = $15;
  19052. $16 = ((($1)) + 20|0);
  19053. $17 = ((($0)) + 20|0);
  19054. $18 = HEAP32[$17>>2]|0;
  19055. HEAP32[$16>>2] = $18;
  19056. $19 = ((($1)) + 24|0);
  19057. $20 = ((($0)) + 24|0);
  19058. $21 = HEAP32[$20>>2]|0;
  19059. HEAP32[$19>>2] = $21;
  19060. $22 = ((($1)) + 28|0);
  19061. $23 = ((($0)) + 28|0);
  19062. $24 = HEAP32[$23>>2]|0;
  19063. HEAP32[$22>>2] = $24;
  19064. $25 = ((($1)) + 32|0);
  19065. $26 = ((($0)) + 32|0);
  19066. $27 = HEAP32[$26>>2]|0;
  19067. HEAP32[$25>>2] = $27;
  19068. $28 = ((($1)) + 36|0);
  19069. $29 = ((($0)) + 36|0);
  19070. $30 = HEAP32[$29>>2]|0;
  19071. HEAP32[$28>>2] = $30;
  19072. $31 = ((($1)) + 40|0);
  19073. $32 = ((($0)) + 40|0);
  19074. $33 = HEAP32[$32>>2]|0;
  19075. HEAP32[$31>>2] = $33;
  19076. $34 = ((($1)) + 44|0);
  19077. $35 = ((($0)) + 44|0);
  19078. $36 = HEAP32[$35>>2]|0;
  19079. HEAP32[$34>>2] = $36;
  19080. $37 = ((($1)) + 48|0);
  19081. $38 = ((($0)) + 48|0);
  19082. $39 = HEAP32[$38>>2]|0;
  19083. HEAP32[$37>>2] = $39;
  19084. $40 = ((($1)) + 52|0);
  19085. $41 = ((($0)) + 52|0);
  19086. $42 = HEAP32[$41>>2]|0;
  19087. HEAP32[$40>>2] = $42;
  19088. $43 = ((($1)) + 56|0);
  19089. $44 = ((($0)) + 56|0);
  19090. $45 = HEAP32[$44>>2]|0;
  19091. HEAP32[$43>>2] = $45;
  19092. $46 = ((($1)) + 60|0);
  19093. $47 = ((($0)) + 60|0);
  19094. $48 = HEAP32[$47>>2]|0;
  19095. HEAP32[$46>>2] = $48;
  19096. $49 = HEAP32[7794]|0;
  19097. dest=$$byval_copy; src=$49; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19098. dest=$$byval_copy1; src=$1; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19099. _MatrixMultiply($2,$$byval_copy,$$byval_copy1);
  19100. dest=$49; src=$2; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19101. STACKTOP = sp;return;
  19102. }
  19103. function _EndDrawing() {
  19104. var $0 = 0.0, $1 = 0.0, $10 = 0.0, $11 = 0.0, $12 = 0.0, $13 = 0.0, $14 = 0.0, $2 = 0.0, $3 = 0.0, $4 = 0.0, $5 = 0.0, $6 = 0, $7 = 0.0, $8 = 0.0, $9 = 0.0, label = 0, sp = 0;
  19105. sp = STACKTOP;
  19106. _rlglDraw();
  19107. _SwapBuffers();
  19108. _PollInputEvents();
  19109. $0 = (+_GetTime());
  19110. HEAPF64[1779] = $0;
  19111. $1 = +HEAPF64[1762];
  19112. $2 = $0 - $1;
  19113. HEAPF64[1781] = $2;
  19114. HEAPF64[1762] = $0;
  19115. $3 = +HEAPF64[1780];
  19116. $4 = $2 + $3;
  19117. HEAPF64[1782] = $4;
  19118. $5 = +HEAPF64[1759];
  19119. $6 = $4 < $5;
  19120. if (!($6)) {
  19121. return;
  19122. }
  19123. $7 = $5 - $4;
  19124. $8 = $7 * 1000.0;
  19125. $9 = $8;
  19126. _Wait($9);
  19127. $10 = (+_GetTime());
  19128. HEAPF64[1779] = $10;
  19129. $11 = +HEAPF64[1762];
  19130. $12 = $10 - $11;
  19131. HEAPF64[1762] = $10;
  19132. $13 = +HEAPF64[1782];
  19133. $14 = $12 + $13;
  19134. HEAPF64[1782] = $14;
  19135. return;
  19136. }
  19137. function _rlglDraw() {
  19138. var label = 0, sp = 0;
  19139. sp = STACKTOP;
  19140. _UpdateDefaultBuffers();
  19141. _DrawDefaultBuffers();
  19142. return;
  19143. }
  19144. function _SwapBuffers() {
  19145. var $0 = 0, label = 0, sp = 0;
  19146. sp = STACKTOP;
  19147. $0 = HEAP32[7747]|0;
  19148. _glfwSwapBuffers(($0|0));
  19149. return;
  19150. }
  19151. function _PollInputEvents() {
  19152. var $$04857 = 0, $$05160 = 0, $$058 = 0, $$lcssa = 0, $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0;
  19153. var $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0.0, $31 = 0.0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0.0, $40 = 0;
  19154. var $5 = 0.0, $6 = 0.0, $7 = 0.0, $8 = 0, $9 = 0, $scevgep = 0, $scevgep67 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  19155. sp = STACKTOP;
  19156. STACKTOP = STACKTOP + 1456|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(1456|0);
  19157. $0 = sp + 1440|0;
  19158. $1 = sp + 1432|0;
  19159. $2 = sp;
  19160. _UpdateGestures();
  19161. HEAP32[743] = -1;
  19162. HEAP32[745] = -1;
  19163. HEAP32[8180] = 0;
  19164. $3 = HEAP32[7747]|0;
  19165. _glfwGetCursorPos(($3|0),($0|0),($1|0));
  19166. $4 = +HEAPF64[$0>>3];
  19167. $5 = $4;
  19168. HEAPF32[3516] = $5;
  19169. $6 = +HEAPF64[$1>>3];
  19170. $7 = $6;
  19171. HEAPF32[(14068)>>2] = $7;
  19172. _memcpy((36479|0),(35967|0),512)|0;
  19173. ;HEAP8[35964>>0]=HEAP8[35961>>0]|0;HEAP8[35964+1>>0]=HEAP8[35961+1>>0]|0;HEAP8[35964+2>>0]=HEAP8[35961+2>>0]|0;
  19174. $8 = HEAP32[8163]|0;
  19175. HEAP32[7750] = $8;
  19176. HEAP32[8163] = 0;
  19177. $9 = (_emscripten_get_num_gamepads()|0);
  19178. $10 = ($9|0)>(0);
  19179. if (!($10)) {
  19180. STACKTOP = sp;return;
  19181. }
  19182. $11 = ((($2)) + 12|0);
  19183. $12 = ((($2)) + 8|0);
  19184. $$05160 = 0;
  19185. while(1) {
  19186. $scevgep = (36991 + ($$05160<<5)|0);
  19187. $scevgep67 = (37119 + ($$05160<<5)|0);
  19188. dest=$scevgep; src=$scevgep67; stop=dest+32|0; do { HEAP8[dest>>0]=HEAP8[src>>0]|0; dest=dest+1|0; src=src+1|0; } while ((dest|0) < (stop|0));
  19189. $13 = (_emscripten_get_gamepad_status(($$05160|0),($2|0))|0);
  19190. $14 = ($13|0)==(0);
  19191. if ($14) {
  19192. $15 = HEAP32[$11>>2]|0;
  19193. $16 = ($15|0)>(0);
  19194. if ($16) {
  19195. $17 = HEAP32[$11>>2]|0;
  19196. $$04857 = 0;
  19197. while(1) {
  19198. $21 = (((($2)) + 1040|0) + ($$04857<<2)|0);
  19199. $22 = HEAP32[$21>>2]|0;
  19200. $23 = ($22|0)==(1);
  19201. $24 = ((37119 + ($$05160<<5)|0) + ($$04857)|0);
  19202. if ($23) {
  19203. HEAP8[$24>>0] = 1;
  19204. HEAP32[745] = $$04857;
  19205. } else {
  19206. HEAP8[$24>>0] = 0;
  19207. }
  19208. $25 = (($$04857) + 1)|0;
  19209. $26 = ($25|0)<($17|0);
  19210. $27 = ($25|0)<(32);
  19211. $28 = $27 & $26;
  19212. if ($28) {
  19213. $$04857 = $25;
  19214. } else {
  19215. break;
  19216. }
  19217. }
  19218. }
  19219. $18 = HEAP32[$12>>2]|0;
  19220. $19 = ($18|0)>(0);
  19221. if ($19) {
  19222. $20 = HEAP32[$12>>2]|0;
  19223. $$058 = 0;
  19224. while(1) {
  19225. $29 = (((($2)) + 16|0) + ($$058<<3)|0);
  19226. $30 = +HEAPF64[$29>>3];
  19227. $31 = $30;
  19228. $32 = ((32724 + ($$05160<<5)|0) + ($$058<<2)|0);
  19229. HEAPF32[$32>>2] = $31;
  19230. $33 = (($$058) + 1)|0;
  19231. $34 = ($33|0)<($20|0);
  19232. $35 = ($33|0)<(8);
  19233. $36 = $35 & $34;
  19234. if ($36) {
  19235. $$058 = $33;
  19236. } else {
  19237. $$lcssa = $20;
  19238. break;
  19239. }
  19240. }
  19241. } else {
  19242. $$lcssa = $18;
  19243. }
  19244. HEAP32[8180] = $$lcssa;
  19245. }
  19246. $37 = (($$05160) + 1)|0;
  19247. $38 = ($37|0)<($9|0);
  19248. $39 = ($37|0)<(4);
  19249. $40 = $38 & $39;
  19250. if ($40) {
  19251. $$05160 = $37;
  19252. } else {
  19253. break;
  19254. }
  19255. }
  19256. STACKTOP = sp;return;
  19257. }
  19258. function _Wait($0) {
  19259. $0 = +$0;
  19260. var $1 = 0.0, $2 = 0.0, $3 = 0.0, $4 = 0.0, $5 = 0, $6 = 0.0, $7 = 0.0, $8 = 0, label = 0, sp = 0;
  19261. sp = STACKTOP;
  19262. $1 = (+_GetTime());
  19263. $2 = 0.0 - $1;
  19264. $3 = $0 / 1000.0;
  19265. $4 = $3;
  19266. $5 = $2 < $4;
  19267. if (!($5)) {
  19268. return;
  19269. }
  19270. while(1) {
  19271. $6 = (+_GetTime());
  19272. $7 = $6 - $1;
  19273. $8 = $7 < $4;
  19274. if (!($8)) {
  19275. break;
  19276. }
  19277. }
  19278. return;
  19279. }
  19280. function _UpdateDefaultBuffers() {
  19281. var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0;
  19282. var $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
  19283. var $45 = 0, $46 = 0, $47 = 0, $48 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  19284. sp = STACKTOP;
  19285. $0 = HEAP32[8126]|0;
  19286. $1 = ($0|0)>(0);
  19287. if ($1) {
  19288. $2 = HEAP32[7828]|0;
  19289. $3 = ($2|0)==(0);
  19290. if (!($3)) {
  19291. $4 = HEAP32[7830]|0;
  19292. $5 = HEAP32[(32532)>>2]|0;
  19293. FUNCTION_TABLE_vi[$4 & 31]($5);
  19294. }
  19295. $6 = HEAP32[(32536)>>2]|0;
  19296. _glBindBuffer(34962,($6|0));
  19297. $7 = HEAP32[8126]|0;
  19298. $8 = ($7*12)|0;
  19299. $9 = HEAP32[(32516)>>2]|0;
  19300. _glBufferSubData(34962,0,($8|0),($9|0));
  19301. $10 = HEAP32[(32540)>>2]|0;
  19302. _glBindBuffer(34962,($10|0));
  19303. $11 = HEAP32[(32512)>>2]|0;
  19304. $12 = $11 << 2;
  19305. $13 = HEAP32[(32524)>>2]|0;
  19306. _glBufferSubData(34962,0,($12|0),($13|0));
  19307. }
  19308. $14 = HEAP32[8138]|0;
  19309. $15 = ($14|0)>(0);
  19310. if ($15) {
  19311. $16 = HEAP32[7828]|0;
  19312. $17 = ($16|0)==(0);
  19313. if (!($17)) {
  19314. $18 = HEAP32[7830]|0;
  19315. $19 = HEAP32[(32580)>>2]|0;
  19316. FUNCTION_TABLE_vi[$18 & 31]($19);
  19317. }
  19318. $20 = HEAP32[(32584)>>2]|0;
  19319. _glBindBuffer(34962,($20|0));
  19320. $21 = HEAP32[8138]|0;
  19321. $22 = ($21*12)|0;
  19322. $23 = HEAP32[(32564)>>2]|0;
  19323. _glBufferSubData(34962,0,($22|0),($23|0));
  19324. $24 = HEAP32[(32588)>>2]|0;
  19325. _glBindBuffer(34962,($24|0));
  19326. $25 = HEAP32[(32560)>>2]|0;
  19327. $26 = $25 << 2;
  19328. $27 = HEAP32[(32572)>>2]|0;
  19329. _glBufferSubData(34962,0,($26|0),($27|0));
  19330. }
  19331. $28 = HEAP32[8150]|0;
  19332. $29 = ($28|0)>(0);
  19333. if ($29) {
  19334. $30 = HEAP32[7828]|0;
  19335. $31 = ($30|0)==(0);
  19336. if (!($31)) {
  19337. $32 = HEAP32[7830]|0;
  19338. $33 = HEAP32[(32628)>>2]|0;
  19339. FUNCTION_TABLE_vi[$32 & 31]($33);
  19340. }
  19341. $34 = HEAP32[(32632)>>2]|0;
  19342. _glBindBuffer(34962,($34|0));
  19343. $35 = HEAP32[8150]|0;
  19344. $36 = ($35*12)|0;
  19345. $37 = HEAP32[(32612)>>2]|0;
  19346. _glBufferSubData(34962,0,($36|0),($37|0));
  19347. $38 = HEAP32[(32636)>>2]|0;
  19348. _glBindBuffer(34962,($38|0));
  19349. $39 = HEAP32[8150]|0;
  19350. $40 = $39 << 3;
  19351. $41 = HEAP32[(32616)>>2]|0;
  19352. _glBufferSubData(34962,0,($40|0),($41|0));
  19353. $42 = HEAP32[(32640)>>2]|0;
  19354. _glBindBuffer(34962,($42|0));
  19355. $43 = HEAP32[8150]|0;
  19356. $44 = $43 << 2;
  19357. $45 = HEAP32[(32620)>>2]|0;
  19358. _glBufferSubData(34962,0,($44|0),($45|0));
  19359. }
  19360. $46 = HEAP32[7828]|0;
  19361. $47 = ($46|0)==(0);
  19362. if ($47) {
  19363. return;
  19364. }
  19365. $48 = HEAP32[7830]|0;
  19366. FUNCTION_TABLE_vi[$48 & 31](0);
  19367. return;
  19368. }
  19369. function _DrawDefaultBuffers() {
  19370. var $$ = 0, $$02830 = 0, $$02932 = 0, $$031 = 0, $$byval_copy2 = 0, $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0;
  19371. var $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0;
  19372. var $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0;
  19373. var $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0;
  19374. var $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $modelview$byval_copy = 0;
  19375. var $or$cond = 0, $or$cond3 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  19376. sp = STACKTOP;
  19377. STACKTOP = STACKTOP + 320|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(320|0);
  19378. $$byval_copy2 = sp + 256|0;
  19379. $modelview$byval_copy = sp + 192|0;
  19380. $0 = sp + 128|0;
  19381. $1 = sp + 64|0;
  19382. $2 = sp;
  19383. dest=$0; src=31180; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19384. dest=$1; src=31244; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19385. $3 = HEAP32[8213]|0;
  19386. $4 = ($3|0)!=(0);
  19387. $$ = $4 ? 2 : 1;
  19388. $$02932 = 0;
  19389. while(1) {
  19390. if ($4) {
  19391. dest=$modelview$byval_copy; src=$0; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19392. dest=$$byval_copy2; src=$1; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19393. _SetStereoView($$02932,$modelview$byval_copy,$$byval_copy2);
  19394. }
  19395. $8 = HEAP32[8126]|0;
  19396. $9 = ($8|0)>(0);
  19397. $10 = HEAP32[8138]|0;
  19398. $11 = ($10|0)>(0);
  19399. $or$cond = $9 | $11;
  19400. $12 = HEAP32[8150]|0;
  19401. $13 = ($12|0)>(0);
  19402. $or$cond3 = $or$cond | $13;
  19403. if ($or$cond3) {
  19404. $14 = HEAP32[7850]|0;
  19405. _glUseProgram(($14|0));
  19406. dest=$modelview$byval_copy; src=31244; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19407. dest=$$byval_copy2; src=31180; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19408. _MatrixMultiply($2,$modelview$byval_copy,$$byval_copy2);
  19409. $15 = HEAP32[(31428)>>2]|0;
  19410. dest=$$byval_copy2; src=$2; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19411. $16 = (_MatrixToFloat($$byval_copy2)|0);
  19412. _glUniformMatrix4fv(($15|0),1,0,($16|0));
  19413. $17 = HEAP32[(31432)>>2]|0;
  19414. _glUniform4f(($17|0),1.0,1.0,1.0,1.0);
  19415. $18 = HEAP32[(31444)>>2]|0;
  19416. _glUniform1i(($18|0),0);
  19417. }
  19418. $19 = HEAP32[8126]|0;
  19419. $20 = ($19|0)>(0);
  19420. if ($20) {
  19421. $21 = HEAP32[7835]|0;
  19422. _glBindTexture(3553,($21|0));
  19423. $22 = HEAP32[7828]|0;
  19424. $23 = ($22|0)==(0);
  19425. if ($23) {
  19426. $26 = HEAP32[(32536)>>2]|0;
  19427. _glBindBuffer(34962,($26|0));
  19428. $27 = HEAP32[(31404)>>2]|0;
  19429. _glVertexAttribPointer(($27|0),3,5126,0,0,(0|0));
  19430. $28 = HEAP32[(31404)>>2]|0;
  19431. _glEnableVertexAttribArray(($28|0));
  19432. $29 = HEAP32[(32540)>>2]|0;
  19433. _glBindBuffer(34962,($29|0));
  19434. $30 = HEAP32[(31424)>>2]|0;
  19435. _glVertexAttribPointer(($30|0),4,5121,1,0,(0|0));
  19436. $31 = HEAP32[(31424)>>2]|0;
  19437. _glEnableVertexAttribArray(($31|0));
  19438. } else {
  19439. $24 = HEAP32[7830]|0;
  19440. $25 = HEAP32[(32532)>>2]|0;
  19441. FUNCTION_TABLE_vi[$24 & 31]($25);
  19442. }
  19443. $32 = HEAP32[8126]|0;
  19444. _glDrawArrays(1,0,($32|0));
  19445. $33 = HEAP32[7828]|0;
  19446. $34 = ($33|0)==(0);
  19447. if ($34) {
  19448. _glBindBuffer(34962,0);
  19449. }
  19450. _glBindTexture(3553,0);
  19451. }
  19452. $35 = HEAP32[8138]|0;
  19453. $36 = ($35|0)>(0);
  19454. if ($36) {
  19455. $37 = HEAP32[7835]|0;
  19456. _glBindTexture(3553,($37|0));
  19457. $38 = HEAP32[7828]|0;
  19458. $39 = ($38|0)==(0);
  19459. if ($39) {
  19460. $42 = HEAP32[(32584)>>2]|0;
  19461. _glBindBuffer(34962,($42|0));
  19462. $43 = HEAP32[(31404)>>2]|0;
  19463. _glVertexAttribPointer(($43|0),3,5126,0,0,(0|0));
  19464. $44 = HEAP32[(31404)>>2]|0;
  19465. _glEnableVertexAttribArray(($44|0));
  19466. $45 = HEAP32[(32588)>>2]|0;
  19467. _glBindBuffer(34962,($45|0));
  19468. $46 = HEAP32[(31424)>>2]|0;
  19469. _glVertexAttribPointer(($46|0),4,5121,1,0,(0|0));
  19470. $47 = HEAP32[(31424)>>2]|0;
  19471. _glEnableVertexAttribArray(($47|0));
  19472. } else {
  19473. $40 = HEAP32[7830]|0;
  19474. $41 = HEAP32[(32580)>>2]|0;
  19475. FUNCTION_TABLE_vi[$40 & 31]($41);
  19476. }
  19477. $48 = HEAP32[8138]|0;
  19478. _glDrawArrays(4,0,($48|0));
  19479. $49 = HEAP32[7828]|0;
  19480. $50 = ($49|0)==(0);
  19481. if ($50) {
  19482. _glBindBuffer(34962,0);
  19483. }
  19484. _glBindTexture(3553,0);
  19485. }
  19486. $51 = HEAP32[8150]|0;
  19487. $52 = ($51|0)>(0);
  19488. if ($52) {
  19489. $53 = HEAP32[7828]|0;
  19490. $54 = ($53|0)==(0);
  19491. if ($54) {
  19492. $57 = HEAP32[(32632)>>2]|0;
  19493. _glBindBuffer(34962,($57|0));
  19494. $58 = HEAP32[(31404)>>2]|0;
  19495. _glVertexAttribPointer(($58|0),3,5126,0,0,(0|0));
  19496. $59 = HEAP32[(31404)>>2]|0;
  19497. _glEnableVertexAttribArray(($59|0));
  19498. $60 = HEAP32[(32636)>>2]|0;
  19499. _glBindBuffer(34962,($60|0));
  19500. $61 = HEAP32[(31408)>>2]|0;
  19501. _glVertexAttribPointer(($61|0),2,5126,0,0,(0|0));
  19502. $62 = HEAP32[(31408)>>2]|0;
  19503. _glEnableVertexAttribArray(($62|0));
  19504. $63 = HEAP32[(32640)>>2]|0;
  19505. _glBindBuffer(34962,($63|0));
  19506. $64 = HEAP32[(31424)>>2]|0;
  19507. _glVertexAttribPointer(($64|0),4,5121,1,0,(0|0));
  19508. $65 = HEAP32[(31424)>>2]|0;
  19509. _glEnableVertexAttribArray(($65|0));
  19510. $66 = HEAP32[(32644)>>2]|0;
  19511. _glBindBuffer(34963,($66|0));
  19512. } else {
  19513. $55 = HEAP32[7830]|0;
  19514. $56 = HEAP32[(32628)>>2]|0;
  19515. FUNCTION_TABLE_vi[$55 & 31]($56);
  19516. }
  19517. $67 = HEAP32[7866]|0;
  19518. $68 = ($67|0)>(0);
  19519. if ($68) {
  19520. $$02830 = 0;$$031 = 0;
  19521. while(1) {
  19522. $71 = HEAP32[7865]|0;
  19523. $72 = (($71) + (($$031*144)|0)|0);
  19524. $73 = HEAP32[$72>>2]|0;
  19525. $74 = (($73|0) / 4)&-1;
  19526. $75 = ($74*6)|0;
  19527. $76 = (((($71) + (($$031*144)|0)|0)) + 8|0);
  19528. $77 = HEAP32[$76>>2]|0;
  19529. _glBindTexture(3553,($77|0));
  19530. $78 = $$02830 << 1;
  19531. $79 = $78;
  19532. _glDrawElements(4,($75|0),5123,($79|0));
  19533. $80 = HEAP32[7865]|0;
  19534. $81 = (($80) + (($$031*144)|0)|0);
  19535. $82 = HEAP32[$81>>2]|0;
  19536. $83 = (($82|0) / 4)&-1;
  19537. $84 = ($83*6)|0;
  19538. $85 = (($84) + ($$02830))|0;
  19539. $86 = (($$031) + 1)|0;
  19540. $87 = HEAP32[7866]|0;
  19541. $88 = ($86|0)<($87|0);
  19542. if ($88) {
  19543. $$02830 = $85;$$031 = $86;
  19544. } else {
  19545. break;
  19546. }
  19547. }
  19548. }
  19549. $69 = HEAP32[7828]|0;
  19550. $70 = ($69|0)==(0);
  19551. if ($70) {
  19552. _glBindBuffer(34962,0);
  19553. _glBindBuffer(34963,0);
  19554. }
  19555. _glBindTexture(3553,0);
  19556. }
  19557. $89 = HEAP32[7828]|0;
  19558. $90 = ($89|0)==(0);
  19559. if (!($90)) {
  19560. $91 = HEAP32[7830]|0;
  19561. FUNCTION_TABLE_vi[$91 & 31](0);
  19562. }
  19563. _glUseProgram(0);
  19564. $92 = (($$02932) + 1)|0;
  19565. $93 = ($92|0)<($$|0);
  19566. if ($93) {
  19567. $$02932 = $92;
  19568. } else {
  19569. break;
  19570. }
  19571. }
  19572. HEAP32[7866] = 1;
  19573. $5 = HEAP32[7835]|0;
  19574. $6 = HEAP32[7865]|0;
  19575. $7 = ((($6)) + 8|0);
  19576. HEAP32[$7>>2] = $5;
  19577. HEAP32[$6>>2] = 0;
  19578. HEAP32[8126] = 0;
  19579. HEAP32[(32512)>>2] = 0;
  19580. HEAP32[8138] = 0;
  19581. HEAP32[(32560)>>2] = 0;
  19582. HEAP32[8150] = 0;
  19583. HEAP32[(32604)>>2] = 0;
  19584. HEAP32[(32608)>>2] = 0;
  19585. HEAPF32[746] = -1.0;
  19586. dest=31180; src=$0; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19587. dest=31244; src=$1; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19588. STACKTOP = sp;return;
  19589. }
  19590. function _SetStereoView($0,$1,$2) {
  19591. $0 = $0|0;
  19592. $1 = $1|0;
  19593. $2 = $2|0;
  19594. var $$byval_copy = 0, $$byval_copy3 = 0, $10 = 0, $11 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  19595. sp = STACKTOP;
  19596. STACKTOP = STACKTOP + 256|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(256|0);
  19597. $$byval_copy3 = sp + 192|0;
  19598. $$byval_copy = sp + 64|0;
  19599. $3 = sp;
  19600. $4 = sp + 128|0;
  19601. dest=$3; src=$1; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19602. $5 = HEAP32[8124]|0;
  19603. $6 = Math_imul($5, $0)|0;
  19604. $7 = (($6|0) / 2)&-1;
  19605. $8 = (($5|0) / 2)&-1;
  19606. $9 = HEAP32[8125]|0;
  19607. _rlViewport($7,0,$8,$9);
  19608. $10 = (33084 + ($0<<6)|0);
  19609. dest=$$byval_copy; src=$2; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19610. dest=$$byval_copy3; src=$10; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19611. _MatrixMultiply($4,$$byval_copy,$$byval_copy3);
  19612. $11 = (32956 + ($0<<6)|0);
  19613. dest=$3; src=$11; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19614. dest=$$byval_copy3; src=$4; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19615. _SetMatrixModelview($$byval_copy3);
  19616. dest=$$byval_copy3; src=$3; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19617. _SetMatrixProjection($$byval_copy3);
  19618. STACKTOP = sp;return;
  19619. }
  19620. function _SetMatrixModelview($0) {
  19621. $0 = $0|0;
  19622. var dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  19623. sp = STACKTOP;
  19624. dest=31244; src=$0; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19625. return;
  19626. }
  19627. function _SetMatrixProjection($0) {
  19628. $0 = $0|0;
  19629. var dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  19630. sp = STACKTOP;
  19631. dest=31180; src=$0; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19632. return;
  19633. }
  19634. function _rlPushMatrix() {
  19635. var $0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $vararg_buffer = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  19636. sp = STACKTOP;
  19637. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  19638. $vararg_buffer = sp;
  19639. $0 = HEAP32[8303]|0;
  19640. $1 = ($0|0)==(15);
  19641. if ($1) {
  19642. HEAP32[$vararg_buffer>>2] = 16;
  19643. _TraceLog(1,8075,$vararg_buffer);
  19644. }
  19645. $2 = HEAP32[8303]|0;
  19646. $3 = (31472 + ($2<<6)|0);
  19647. $4 = HEAP32[7794]|0;
  19648. dest=$3; src=$4; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19649. _rlLoadIdentity();
  19650. $5 = HEAP32[8303]|0;
  19651. $6 = (($5) + 1)|0;
  19652. HEAP32[8303] = $6;
  19653. $7 = HEAP32[7827]|0;
  19654. $8 = ($7|0)==(5888);
  19655. if (!($8)) {
  19656. STACKTOP = sp;return;
  19657. }
  19658. HEAP32[8304] = 1;
  19659. STACKTOP = sp;return;
  19660. }
  19661. function _rlPopMatrix() {
  19662. var $0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, label = 0, sp = 0;
  19663. sp = STACKTOP;
  19664. $0 = HEAP32[8303]|0;
  19665. $1 = ($0|0)>(0);
  19666. if (!($1)) {
  19667. return;
  19668. }
  19669. $2 = HEAP32[8303]|0;
  19670. $3 = (($2) + -1)|0;
  19671. $4 = (31472 + ($3<<6)|0);
  19672. $5 = HEAP32[7794]|0;
  19673. _memmove(($5|0),($4|0),64)|0;
  19674. $6 = (($2) + -1)|0;
  19675. HEAP32[8303] = $6;
  19676. return;
  19677. }
  19678. function _GetFPS() {
  19679. var $0 = 0.0, $1 = 0.0, $2 = 0, label = 0, sp = 0;
  19680. sp = STACKTOP;
  19681. $0 = (+_GetFrameTime());
  19682. $1 = 1.0 / $0;
  19683. $2 = (~~(($1)));
  19684. return ($2|0);
  19685. }
  19686. function _GetFrameTime() {
  19687. var $0 = 0.0, $1 = 0.0, label = 0, sp = 0;
  19688. sp = STACKTOP;
  19689. $0 = +HEAPF64[1782];
  19690. $1 = $0;
  19691. return (+$1);
  19692. }
  19693. function _SetConfigFlags($0) {
  19694. $0 = $0|0;
  19695. var $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, label = 0, sp = 0;
  19696. sp = STACKTOP;
  19697. HEAP8[35960] = $0;
  19698. $1 = $0 & 1;
  19699. $2 = ($1<<24>>24)==(0);
  19700. if (!($2)) {
  19701. HEAP32[7752] = 1;
  19702. }
  19703. $3 = HEAP8[35960]|0;
  19704. $4 = $3 & 2;
  19705. $5 = ($4<<24>>24)==(0);
  19706. if ($5) {
  19707. return;
  19708. }
  19709. HEAP32[7789] = 1;
  19710. return;
  19711. }
  19712. function _IsKeyPressed($0) {
  19713. $0 = $0|0;
  19714. var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $or$cond = 0, label = 0, sp = 0;
  19715. sp = STACKTOP;
  19716. $1 = (35967 + ($0)|0);
  19717. $2 = HEAP8[$1>>0]|0;
  19718. $3 = (36479 + ($0)|0);
  19719. $4 = HEAP8[$3>>0]|0;
  19720. $5 = ($2<<24>>24)!=($4<<24>>24);
  19721. $6 = ($2<<24>>24)==(1);
  19722. $or$cond = $6 & $5;
  19723. $$0 = $or$cond&1;
  19724. return ($$0|0);
  19725. }
  19726. function _rlTranslatef($0,$1,$2) {
  19727. $0 = +$0;
  19728. $1 = +$1;
  19729. $2 = +$2;
  19730. var $$byval_copy = 0, $$byval_copy1 = 0, $3 = 0, $4 = 0, $5 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  19731. sp = STACKTOP;
  19732. STACKTOP = STACKTOP + 256|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(256|0);
  19733. $$byval_copy1 = sp + 192|0;
  19734. $$byval_copy = sp + 128|0;
  19735. $3 = sp + 64|0;
  19736. $4 = sp;
  19737. _MatrixTranslate($3,$0,$1,$2);
  19738. _MatrixTranspose($3);
  19739. $5 = HEAP32[7794]|0;
  19740. dest=$$byval_copy; src=$5; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19741. dest=$$byval_copy1; src=$3; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19742. _MatrixMultiply($4,$$byval_copy,$$byval_copy1);
  19743. dest=$5; src=$4; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19744. STACKTOP = sp;return;
  19745. }
  19746. function _rlRotatef($0,$1,$2,$3) {
  19747. $0 = +$0;
  19748. $1 = +$1;
  19749. $2 = +$2;
  19750. $3 = +$3;
  19751. var $$byval_copy1 = 0, $$byval_copy2 = 0, $10 = 0.0, $11 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  19752. sp = STACKTOP;
  19753. STACKTOP = STACKTOP + 336|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(336|0);
  19754. $$byval_copy2 = sp + 272|0;
  19755. $$byval_copy1 = sp + 208|0;
  19756. $4 = sp + 144|0;
  19757. $5 = sp + 64|0;
  19758. $6 = sp + 80|0;
  19759. $7 = sp;
  19760. _MatrixIdentity($4);
  19761. HEAPF32[$5>>2] = $1;
  19762. $8 = ((($5)) + 4|0);
  19763. HEAPF32[$8>>2] = $2;
  19764. $9 = ((($5)) + 8|0);
  19765. HEAPF32[$9>>2] = $3;
  19766. _VectorNormalize($5);
  19767. $10 = $0 * 0.01745329238474369;
  19768. ;HEAP32[$$byval_copy2>>2]=HEAP32[$5>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$5+4>>2]|0;HEAP32[$$byval_copy2+8>>2]=HEAP32[$5+8>>2]|0;
  19769. _MatrixRotate($6,$$byval_copy2,$10);
  19770. dest=$4; src=$6; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19771. _MatrixTranspose($4);
  19772. $11 = HEAP32[7794]|0;
  19773. dest=$$byval_copy1; src=$11; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19774. dest=$$byval_copy2; src=$4; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19775. _MatrixMultiply($7,$$byval_copy1,$$byval_copy2);
  19776. dest=$11; src=$7; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19777. STACKTOP = sp;return;
  19778. }
  19779. function _rlBegin($0) {
  19780. $0 = $0|0;
  19781. var label = 0, sp = 0;
  19782. sp = STACKTOP;
  19783. HEAP32[7867] = $0;
  19784. return;
  19785. }
  19786. function _rlEnd() {
  19787. var $$03956 = 0, $$04052 = 0, $$04154 = 0, $$04248 = 0, $$04347 = 0, $$byval_copy = 0, $$promoted = 0, $0 = 0, $1 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0;
  19788. var $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0, $116 = 0, $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0;
  19789. var $128 = 0, $129 = 0, $13 = 0.0, $130 = 0, $131 = 0, $132 = 0, $133 = 0, $134 = 0, $135 = 0, $136 = 0, $137 = 0, $138 = 0, $139 = 0, $14 = 0, $140 = 0, $141 = 0, $142 = 0, $143 = 0, $144 = 0, $145 = 0;
  19790. var $146 = 0, $147 = 0, $148 = 0.0, $149 = 0.0, $15 = 0.0, $16 = 0, $17 = 0.0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0;
  19791. var $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0;
  19792. var $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0;
  19793. var $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0;
  19794. var $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $exitcond = 0, $exitcond60 = 0, $exitcond63 = 0;
  19795. var $scevgep = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  19796. sp = STACKTOP;
  19797. STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
  19798. $$byval_copy = sp;
  19799. $0 = HEAP32[8304]|0;
  19800. $1 = ($0|0)==(0);
  19801. if (!($1)) {
  19802. $2 = HEAP32[8305]|0;
  19803. $3 = ($2|0)>(0);
  19804. if ($3) {
  19805. $$03956 = 0;
  19806. while(1) {
  19807. $6 = HEAP32[7864]|0;
  19808. $7 = (($6) + (($$03956*12)|0)|0);
  19809. $8 = HEAP32[7794]|0;
  19810. dest=$$byval_copy; src=$8; stop=dest+64|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  19811. _VectorTransform($7,$$byval_copy);
  19812. $9 = (($$03956) + 1)|0;
  19813. $5 = HEAP32[8305]|0;
  19814. $10 = ($9|0)<($5|0);
  19815. if ($10) {
  19816. $$03956 = $9;
  19817. } else {
  19818. break;
  19819. }
  19820. }
  19821. HEAP32[8304] = 0;
  19822. $4 = ($5|0)>(0);
  19823. if ($4) {
  19824. $$04154 = 0;
  19825. while(1) {
  19826. $11 = HEAP32[7864]|0;
  19827. $12 = (($11) + (($$04154*12)|0)|0);
  19828. $13 = +HEAPF32[$12>>2];
  19829. $14 = (((($11) + (($$04154*12)|0)|0)) + 4|0);
  19830. $15 = +HEAPF32[$14>>2];
  19831. $16 = (((($11) + (($$04154*12)|0)|0)) + 8|0);
  19832. $17 = +HEAPF32[$16>>2];
  19833. _rlVertex3f($13,$15,$17);
  19834. $18 = (($$04154) + 1)|0;
  19835. $19 = HEAP32[8305]|0;
  19836. $20 = ($18|0)<($19|0);
  19837. if ($20) {
  19838. $$04154 = $18;
  19839. } else {
  19840. break;
  19841. }
  19842. }
  19843. }
  19844. } else {
  19845. HEAP32[8304] = 0;
  19846. }
  19847. HEAP32[8305] = 0;
  19848. }
  19849. $21 = HEAP32[7867]|0;
  19850. switch ($21|0) {
  19851. case 1: {
  19852. $22 = HEAP32[8126]|0;
  19853. $23 = HEAP32[(32512)>>2]|0;
  19854. $24 = ($22|0)==($23|0);
  19855. if ($24) {
  19856. $148 = +HEAPF32[746];
  19857. $149 = $148 + 4.9999998736893758E-5;
  19858. HEAPF32[746] = $149;
  19859. STACKTOP = sp;return;
  19860. }
  19861. $25 = (($22) - ($23))|0;
  19862. $26 = ($25|0)>(0);
  19863. if ($26) {
  19864. $$04347 = 0;
  19865. } else {
  19866. $148 = +HEAPF32[746];
  19867. $149 = $148 + 4.9999998736893758E-5;
  19868. HEAPF32[746] = $149;
  19869. STACKTOP = sp;return;
  19870. }
  19871. while(1) {
  19872. $27 = HEAP32[(32524)>>2]|0;
  19873. $28 = HEAP32[(32512)>>2]|0;
  19874. $29 = $28 << 2;
  19875. $30 = (($29) + -4)|0;
  19876. $31 = (($27) + ($30)|0);
  19877. $32 = HEAP8[$31>>0]|0;
  19878. $33 = (($27) + ($29)|0);
  19879. HEAP8[$33>>0] = $32;
  19880. $34 = HEAP32[(32524)>>2]|0;
  19881. $35 = HEAP32[(32512)>>2]|0;
  19882. $36 = $35 << 2;
  19883. $37 = (($36) + -3)|0;
  19884. $38 = (($34) + ($37)|0);
  19885. $39 = HEAP8[$38>>0]|0;
  19886. $40 = $36 | 1;
  19887. $41 = (($34) + ($40)|0);
  19888. HEAP8[$41>>0] = $39;
  19889. $42 = HEAP32[(32524)>>2]|0;
  19890. $43 = HEAP32[(32512)>>2]|0;
  19891. $44 = $43 << 2;
  19892. $45 = (($44) + -2)|0;
  19893. $46 = (($42) + ($45)|0);
  19894. $47 = HEAP8[$46>>0]|0;
  19895. $48 = $44 | 2;
  19896. $49 = (($42) + ($48)|0);
  19897. HEAP8[$49>>0] = $47;
  19898. $50 = HEAP32[(32524)>>2]|0;
  19899. $51 = HEAP32[(32512)>>2]|0;
  19900. $52 = $51 << 2;
  19901. $53 = (($52) + -1)|0;
  19902. $54 = (($50) + ($53)|0);
  19903. $55 = HEAP8[$54>>0]|0;
  19904. $56 = $52 | 3;
  19905. $57 = (($50) + ($56)|0);
  19906. HEAP8[$57>>0] = $55;
  19907. $58 = HEAP32[(32512)>>2]|0;
  19908. $59 = (($58) + 1)|0;
  19909. HEAP32[(32512)>>2] = $59;
  19910. $60 = (($$04347) + 1)|0;
  19911. $exitcond = ($60|0)==($25|0);
  19912. if ($exitcond) {
  19913. break;
  19914. } else {
  19915. $$04347 = $60;
  19916. }
  19917. }
  19918. $148 = +HEAPF32[746];
  19919. $149 = $148 + 4.9999998736893758E-5;
  19920. HEAPF32[746] = $149;
  19921. STACKTOP = sp;return;
  19922. break;
  19923. }
  19924. case 4: {
  19925. $61 = HEAP32[8138]|0;
  19926. $62 = HEAP32[(32560)>>2]|0;
  19927. $63 = ($61|0)==($62|0);
  19928. if ($63) {
  19929. $148 = +HEAPF32[746];
  19930. $149 = $148 + 4.9999998736893758E-5;
  19931. HEAPF32[746] = $149;
  19932. STACKTOP = sp;return;
  19933. }
  19934. $64 = (($61) - ($62))|0;
  19935. $65 = ($64|0)>(0);
  19936. if ($65) {
  19937. $$04248 = 0;
  19938. } else {
  19939. $148 = +HEAPF32[746];
  19940. $149 = $148 + 4.9999998736893758E-5;
  19941. HEAPF32[746] = $149;
  19942. STACKTOP = sp;return;
  19943. }
  19944. while(1) {
  19945. $66 = HEAP32[(32572)>>2]|0;
  19946. $67 = HEAP32[(32560)>>2]|0;
  19947. $68 = $67 << 2;
  19948. $69 = (($68) + -4)|0;
  19949. $70 = (($66) + ($69)|0);
  19950. $71 = HEAP8[$70>>0]|0;
  19951. $72 = (($66) + ($68)|0);
  19952. HEAP8[$72>>0] = $71;
  19953. $73 = HEAP32[(32572)>>2]|0;
  19954. $74 = HEAP32[(32560)>>2]|0;
  19955. $75 = $74 << 2;
  19956. $76 = (($75) + -3)|0;
  19957. $77 = (($73) + ($76)|0);
  19958. $78 = HEAP8[$77>>0]|0;
  19959. $79 = $75 | 1;
  19960. $80 = (($73) + ($79)|0);
  19961. HEAP8[$80>>0] = $78;
  19962. $81 = HEAP32[(32572)>>2]|0;
  19963. $82 = HEAP32[(32560)>>2]|0;
  19964. $83 = $82 << 2;
  19965. $84 = (($83) + -2)|0;
  19966. $85 = (($81) + ($84)|0);
  19967. $86 = HEAP8[$85>>0]|0;
  19968. $87 = $83 | 2;
  19969. $88 = (($81) + ($87)|0);
  19970. HEAP8[$88>>0] = $86;
  19971. $89 = HEAP32[(32572)>>2]|0;
  19972. $90 = HEAP32[(32560)>>2]|0;
  19973. $91 = $90 << 2;
  19974. $92 = (($91) + -1)|0;
  19975. $93 = (($89) + ($92)|0);
  19976. $94 = HEAP8[$93>>0]|0;
  19977. $95 = $91 | 3;
  19978. $96 = (($89) + ($95)|0);
  19979. HEAP8[$96>>0] = $94;
  19980. $97 = HEAP32[(32560)>>2]|0;
  19981. $98 = (($97) + 1)|0;
  19982. HEAP32[(32560)>>2] = $98;
  19983. $99 = (($$04248) + 1)|0;
  19984. $exitcond60 = ($99|0)==($64|0);
  19985. if ($exitcond60) {
  19986. break;
  19987. } else {
  19988. $$04248 = $99;
  19989. }
  19990. }
  19991. $148 = +HEAPF32[746];
  19992. $149 = $148 + 4.9999998736893758E-5;
  19993. HEAPF32[746] = $149;
  19994. STACKTOP = sp;return;
  19995. break;
  19996. }
  19997. case 7: {
  19998. $100 = HEAP32[8150]|0;
  19999. $101 = HEAP32[(32608)>>2]|0;
  20000. $102 = ($100|0)==($101|0);
  20001. if (!($102)) {
  20002. $103 = (($100) - ($101))|0;
  20003. $104 = ($103|0)>(0);
  20004. if ($104) {
  20005. $$04052 = 0;
  20006. while(1) {
  20007. $105 = HEAP32[(32620)>>2]|0;
  20008. $106 = HEAP32[(32608)>>2]|0;
  20009. $107 = $106 << 2;
  20010. $108 = (($107) + -4)|0;
  20011. $109 = (($105) + ($108)|0);
  20012. $110 = HEAP8[$109>>0]|0;
  20013. $111 = (($105) + ($107)|0);
  20014. HEAP8[$111>>0] = $110;
  20015. $112 = HEAP32[(32620)>>2]|0;
  20016. $113 = HEAP32[(32608)>>2]|0;
  20017. $114 = $113 << 2;
  20018. $115 = (($114) + -3)|0;
  20019. $116 = (($112) + ($115)|0);
  20020. $117 = HEAP8[$116>>0]|0;
  20021. $118 = $114 | 1;
  20022. $119 = (($112) + ($118)|0);
  20023. HEAP8[$119>>0] = $117;
  20024. $120 = HEAP32[(32620)>>2]|0;
  20025. $121 = HEAP32[(32608)>>2]|0;
  20026. $122 = $121 << 2;
  20027. $123 = (($122) + -2)|0;
  20028. $124 = (($120) + ($123)|0);
  20029. $125 = HEAP8[$124>>0]|0;
  20030. $126 = $122 | 2;
  20031. $127 = (($120) + ($126)|0);
  20032. HEAP8[$127>>0] = $125;
  20033. $128 = HEAP32[(32620)>>2]|0;
  20034. $129 = HEAP32[(32608)>>2]|0;
  20035. $130 = $129 << 2;
  20036. $131 = (($130) + -1)|0;
  20037. $132 = (($128) + ($131)|0);
  20038. $133 = HEAP8[$132>>0]|0;
  20039. $134 = $130 | 3;
  20040. $135 = (($128) + ($134)|0);
  20041. HEAP8[$135>>0] = $133;
  20042. $136 = HEAP32[(32608)>>2]|0;
  20043. $137 = (($136) + 1)|0;
  20044. HEAP32[(32608)>>2] = $137;
  20045. $138 = (($$04052) + 1)|0;
  20046. $exitcond63 = ($138|0)==($103|0);
  20047. if ($exitcond63) {
  20048. break;
  20049. } else {
  20050. $$04052 = $138;
  20051. }
  20052. }
  20053. }
  20054. }
  20055. $139 = HEAP32[8150]|0;
  20056. $140 = HEAP32[(32604)>>2]|0;
  20057. $141 = ($139|0)>($140|0);
  20058. if (!($141)) {
  20059. $148 = +HEAPF32[746];
  20060. $149 = $148 + 4.9999998736893758E-5;
  20061. HEAPF32[746] = $149;
  20062. STACKTOP = sp;return;
  20063. }
  20064. $142 = HEAP32[(32616)>>2]|0;
  20065. $$promoted = HEAP32[(32604)>>2]|0;
  20066. $143 = $$promoted << 1;
  20067. $scevgep = (($142) + ($143<<2)|0);
  20068. $144 = (($139) - ($140))|0;
  20069. $145 = $144 << 3;
  20070. _memset(($scevgep|0),0,($145|0))|0;
  20071. $146 = (($139) + ($$promoted))|0;
  20072. $147 = (($146) - ($140))|0;
  20073. HEAP32[(32604)>>2] = $147;
  20074. $148 = +HEAPF32[746];
  20075. $149 = $148 + 4.9999998736893758E-5;
  20076. HEAPF32[746] = $149;
  20077. STACKTOP = sp;return;
  20078. break;
  20079. }
  20080. default: {
  20081. $148 = +HEAPF32[746];
  20082. $149 = $148 + 4.9999998736893758E-5;
  20083. HEAPF32[746] = $149;
  20084. STACKTOP = sp;return;
  20085. }
  20086. }
  20087. }
  20088. function _rlVertex3f($0,$1,$2) {
  20089. $0 = +$0;
  20090. $1 = +$1;
  20091. $2 = +$2;
  20092. var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0;
  20093. var $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0;
  20094. var $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, $vararg_buffer3 = 0, label = 0, sp = 0;
  20095. sp = STACKTOP;
  20096. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  20097. $vararg_buffer3 = sp + 16|0;
  20098. $vararg_buffer1 = sp + 8|0;
  20099. $vararg_buffer = sp;
  20100. $3 = HEAP32[8304]|0;
  20101. $4 = ($3|0)==(0);
  20102. if (!($4)) {
  20103. $5 = HEAP32[7864]|0;
  20104. $6 = HEAP32[8305]|0;
  20105. $7 = (($5) + (($6*12)|0)|0);
  20106. HEAPF32[$7>>2] = $0;
  20107. $8 = (((($5) + (($6*12)|0)|0)) + 4|0);
  20108. HEAPF32[$8>>2] = $1;
  20109. $9 = (((($5) + (($6*12)|0)|0)) + 8|0);
  20110. HEAPF32[$9>>2] = $2;
  20111. $10 = (($6) + 1)|0;
  20112. HEAP32[8305] = $10;
  20113. STACKTOP = sp;return;
  20114. }
  20115. $11 = HEAP32[7867]|0;
  20116. switch ($11|0) {
  20117. case 1: {
  20118. $12 = HEAP32[8126]|0;
  20119. $13 = ($12|0)<(2048);
  20120. if ($13) {
  20121. $14 = HEAP32[(32516)>>2]|0;
  20122. $15 = ($12*3)|0;
  20123. $16 = (($14) + ($15<<2)|0);
  20124. HEAPF32[$16>>2] = $0;
  20125. $17 = (($15) + 1)|0;
  20126. $18 = (($14) + ($17<<2)|0);
  20127. HEAPF32[$18>>2] = $1;
  20128. $19 = (($15) + 2)|0;
  20129. $20 = (($14) + ($19<<2)|0);
  20130. HEAPF32[$20>>2] = $2;
  20131. $21 = (($12) + 1)|0;
  20132. HEAP32[8126] = $21;
  20133. STACKTOP = sp;return;
  20134. } else {
  20135. _TraceLog(1,8113,$vararg_buffer);
  20136. STACKTOP = sp;return;
  20137. }
  20138. break;
  20139. }
  20140. case 4: {
  20141. $22 = HEAP32[8138]|0;
  20142. $23 = ($22|0)<(6144);
  20143. if ($23) {
  20144. $24 = HEAP32[(32564)>>2]|0;
  20145. $25 = ($22*3)|0;
  20146. $26 = (($24) + ($25<<2)|0);
  20147. HEAPF32[$26>>2] = $0;
  20148. $27 = (($25) + 1)|0;
  20149. $28 = (($24) + ($27<<2)|0);
  20150. HEAPF32[$28>>2] = $1;
  20151. $29 = (($25) + 2)|0;
  20152. $30 = (($24) + ($29<<2)|0);
  20153. HEAPF32[$30>>2] = $2;
  20154. $31 = (($22) + 1)|0;
  20155. HEAP32[8138] = $31;
  20156. STACKTOP = sp;return;
  20157. } else {
  20158. _TraceLog(1,8138,$vararg_buffer1);
  20159. STACKTOP = sp;return;
  20160. }
  20161. break;
  20162. }
  20163. case 7: {
  20164. $32 = HEAP32[8150]|0;
  20165. $33 = ($32|0)<(4096);
  20166. if ($33) {
  20167. $34 = HEAP32[(32612)>>2]|0;
  20168. $35 = ($32*3)|0;
  20169. $36 = (($34) + ($35<<2)|0);
  20170. HEAPF32[$36>>2] = $0;
  20171. $37 = (($35) + 1)|0;
  20172. $38 = (($34) + ($37<<2)|0);
  20173. HEAPF32[$38>>2] = $1;
  20174. $39 = (($35) + 2)|0;
  20175. $40 = (($34) + ($39<<2)|0);
  20176. HEAPF32[$40>>2] = $2;
  20177. $41 = (($32) + 1)|0;
  20178. HEAP32[8150] = $41;
  20179. $42 = HEAP32[7865]|0;
  20180. $43 = HEAP32[7866]|0;
  20181. $44 = (($43) + -1)|0;
  20182. $45 = (($42) + (($44*144)|0)|0);
  20183. $46 = HEAP32[$45>>2]|0;
  20184. $47 = (($46) + 1)|0;
  20185. HEAP32[$45>>2] = $47;
  20186. STACKTOP = sp;return;
  20187. } else {
  20188. _TraceLog(1,8167,$vararg_buffer3);
  20189. STACKTOP = sp;return;
  20190. }
  20191. break;
  20192. }
  20193. default: {
  20194. STACKTOP = sp;return;
  20195. }
  20196. }
  20197. }
  20198. function _rlVertex2f($0,$1) {
  20199. $0 = +$0;
  20200. $1 = +$1;
  20201. var $2 = 0.0, label = 0, sp = 0;
  20202. sp = STACKTOP;
  20203. $2 = +HEAPF32[746];
  20204. _rlVertex3f($0,$1,$2);
  20205. return;
  20206. }
  20207. function _rlTexCoord2f($0,$1) {
  20208. $0 = +$0;
  20209. $1 = +$1;
  20210. var $10 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  20211. sp = STACKTOP;
  20212. $2 = HEAP32[7867]|0;
  20213. $3 = ($2|0)==(7);
  20214. if (!($3)) {
  20215. return;
  20216. }
  20217. $4 = HEAP32[(32616)>>2]|0;
  20218. $5 = HEAP32[(32604)>>2]|0;
  20219. $6 = $5 << 1;
  20220. $7 = (($4) + ($6<<2)|0);
  20221. HEAPF32[$7>>2] = $0;
  20222. $8 = $6 | 1;
  20223. $9 = (($4) + ($8<<2)|0);
  20224. HEAPF32[$9>>2] = $1;
  20225. $10 = (($5) + 1)|0;
  20226. HEAP32[(32604)>>2] = $10;
  20227. return;
  20228. }
  20229. function _rlNormal3f($0,$1,$2) {
  20230. $0 = +$0;
  20231. $1 = +$1;
  20232. $2 = +$2;
  20233. var label = 0, sp = 0;
  20234. sp = STACKTOP;
  20235. return;
  20236. }
  20237. function _rlColor4ub($0,$1,$2,$3) {
  20238. $0 = $0|0;
  20239. $1 = $1|0;
  20240. $2 = $2|0;
  20241. $3 = $3|0;
  20242. var $$sink37 = 0, $$sink38 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $4 = 0, $5 = 0;
  20243. var $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  20244. sp = STACKTOP;
  20245. $4 = HEAP32[7867]|0;
  20246. switch ($4|0) {
  20247. case 1: {
  20248. $$sink37 = (32512);$$sink38 = (32524);
  20249. break;
  20250. }
  20251. case 4: {
  20252. $$sink37 = (32560);$$sink38 = (32572);
  20253. break;
  20254. }
  20255. case 7: {
  20256. $$sink37 = (32608);$$sink38 = (32620);
  20257. break;
  20258. }
  20259. default: {
  20260. return;
  20261. }
  20262. }
  20263. $5 = HEAP32[$$sink38>>2]|0;
  20264. $6 = HEAP32[$$sink37>>2]|0;
  20265. $7 = $6 << 2;
  20266. $8 = (($5) + ($7)|0);
  20267. HEAP8[$8>>0] = $0;
  20268. $9 = HEAP32[$$sink38>>2]|0;
  20269. $10 = HEAP32[$$sink37>>2]|0;
  20270. $11 = $10 << 2;
  20271. $12 = $11 | 1;
  20272. $13 = (($9) + ($12)|0);
  20273. HEAP8[$13>>0] = $1;
  20274. $14 = HEAP32[$$sink38>>2]|0;
  20275. $15 = HEAP32[$$sink37>>2]|0;
  20276. $16 = $15 << 2;
  20277. $17 = $16 | 2;
  20278. $18 = (($14) + ($17)|0);
  20279. HEAP8[$18>>0] = $2;
  20280. $19 = HEAP32[$$sink38>>2]|0;
  20281. $20 = HEAP32[$$sink37>>2]|0;
  20282. $21 = $20 << 2;
  20283. $22 = $21 | 3;
  20284. $23 = (($19) + ($22)|0);
  20285. HEAP8[$23>>0] = $3;
  20286. $24 = HEAP32[$$sink37>>2]|0;
  20287. $25 = (($24) + 1)|0;
  20288. HEAP32[$$sink37>>2] = $25;
  20289. return;
  20290. }
  20291. function _rlEnableTexture($0) {
  20292. $0 = $0|0;
  20293. var $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  20294. sp = STACKTOP;
  20295. $1 = HEAP32[7865]|0;
  20296. $2 = HEAP32[7866]|0;
  20297. $3 = (($2) + -1)|0;
  20298. $4 = (((($1) + (($3*144)|0)|0)) + 8|0);
  20299. $5 = HEAP32[$4>>2]|0;
  20300. $6 = ($5|0)==($0|0);
  20301. if ($6) {
  20302. return;
  20303. }
  20304. $7 = (($1) + (($3*144)|0)|0);
  20305. $8 = HEAP32[$7>>2]|0;
  20306. $9 = ($8|0)>(0);
  20307. if ($9) {
  20308. $10 = (($2) + 1)|0;
  20309. HEAP32[7866] = $10;
  20310. }
  20311. $11 = HEAP32[7866]|0;
  20312. $12 = (($11) + -1)|0;
  20313. $13 = (((($1) + (($12*144)|0)|0)) + 8|0);
  20314. HEAP32[$13>>2] = $0;
  20315. $14 = (($1) + (($12*144)|0)|0);
  20316. HEAP32[$14>>2] = 0;
  20317. return;
  20318. }
  20319. function _rlDisableTexture() {
  20320. var $0 = 0, $1 = 0, label = 0, sp = 0;
  20321. sp = STACKTOP;
  20322. $0 = HEAP32[8150]|0;
  20323. $1 = ($0|0)>(4095);
  20324. if (!($1)) {
  20325. return;
  20326. }
  20327. _rlglDraw();
  20328. return;
  20329. }
  20330. function _DrawLineV($0,$1,$2) {
  20331. $0 = $0|0;
  20332. $1 = $1|0;
  20333. $2 = $2|0;
  20334. var $10 = 0.0, $11 = 0, $12 = 0.0, $13 = 0.0, $14 = 0, $15 = 0.0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  20335. sp = STACKTOP;
  20336. _rlBegin(1);
  20337. $3 = HEAP8[$2>>0]|0;
  20338. $4 = ((($2)) + 1|0);
  20339. $5 = HEAP8[$4>>0]|0;
  20340. $6 = ((($2)) + 2|0);
  20341. $7 = HEAP8[$6>>0]|0;
  20342. $8 = ((($2)) + 3|0);
  20343. $9 = HEAP8[$8>>0]|0;
  20344. _rlColor4ub($3,$5,$7,$9);
  20345. $10 = +HEAPF32[$0>>2];
  20346. $11 = ((($0)) + 4|0);
  20347. $12 = +HEAPF32[$11>>2];
  20348. _rlVertex2f($10,$12);
  20349. $13 = +HEAPF32[$1>>2];
  20350. $14 = ((($1)) + 4|0);
  20351. $15 = +HEAPF32[$14>>2];
  20352. _rlVertex2f($13,$15);
  20353. _rlEnd();
  20354. return;
  20355. }
  20356. function _GetDefaultFont($0) {
  20357. $0 = $0|0;
  20358. var label = 0, sp = 0;
  20359. sp = STACKTOP;
  20360. ;HEAP32[$0>>2]=HEAP32[31028>>2]|0;HEAP32[$0+4>>2]=HEAP32[31028+4>>2]|0;HEAP32[$0+8>>2]=HEAP32[31028+8>>2]|0;HEAP32[$0+12>>2]=HEAP32[31028+12>>2]|0;HEAP32[$0+16>>2]=HEAP32[31028+16>>2]|0;HEAP32[$0+20>>2]=HEAP32[31028+20>>2]|0;HEAP32[$0+24>>2]=HEAP32[31028+24>>2]|0;HEAP32[$0+28>>2]=HEAP32[31028+28>>2]|0;
  20361. return;
  20362. }
  20363. function _MeasureTextEx($0,$1,$2,$3,$4) {
  20364. $0 = $0|0;
  20365. $1 = $1|0;
  20366. $2 = $2|0;
  20367. $3 = +$3;
  20368. $4 = $4|0;
  20369. var $$0$lcssa = 0, $$05064 = 0, $$052$lcssa = 0.0, $$05263 = 0.0, $$05462 = 0, $$055$lcssa = 0.0, $$05561 = 0.0, $$058$lcssa = 0.0, $$05860 = 0.0, $$065 = 0, $$151 = 0, $$151$$0 = 0, $$153 = 0.0, $$156 = 0.0, $$159 = 0.0, $$2 = 0.0, $$257 = 0.0, $$3 = 0.0, $$byval_copy = 0, $$pn = 0.0;
  20370. var $$pn$in = 0, $$sroa$4$0$$sroa_idx2 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0.0, $14 = 0, $15 = 0.0, $16 = 0.0, $17 = 0.0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0;
  20371. var $28 = 0, $29 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0.0, $36 = 0.0, $37 = 0.0, $38 = 0, $39 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0.0, $9 = 0.0, $exitcond = 0, $phitmp = 0, label = 0;
  20372. var sp = 0;
  20373. sp = STACKTOP;
  20374. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  20375. $$byval_copy = sp;
  20376. $5 = (_strlen($2)|0);
  20377. $6 = ((($1)) + 20|0);
  20378. $7 = HEAP32[$6>>2]|0;
  20379. $8 = (+($7|0));
  20380. $9 = $3 / $8;
  20381. $10 = ($5|0)>(0);
  20382. if (!($10)) {
  20383. $$0$lcssa = -1;$$052$lcssa = 0.0;$$055$lcssa = 0.0;$$058$lcssa = $8;
  20384. $12 = $$055$lcssa < $$052$lcssa;
  20385. $$3 = $12 ? $$052$lcssa : $$055$lcssa;
  20386. $13 = $9 * $$3;
  20387. $14 = Math_imul($$0$lcssa, $4)|0;
  20388. $15 = (+($14|0));
  20389. $16 = $13 + $15;
  20390. $17 = $9 * $$058$lcssa;
  20391. HEAPF32[$0>>2] = $16;
  20392. $$sroa$4$0$$sroa_idx2 = ((($0)) + 4|0);
  20393. HEAPF32[$$sroa$4$0$$sroa_idx2>>2] = $17;
  20394. STACKTOP = sp;return;
  20395. }
  20396. $11 = ((($1)) + 28|0);
  20397. $$05064 = 0;$$05263 = 0.0;$$05462 = 0;$$05561 = 0.0;$$05860 = $8;$$065 = 0;
  20398. while(1) {
  20399. $18 = (($$05064) + 1)|0;
  20400. $19 = (($2) + ($$05462)|0);
  20401. $20 = HEAP8[$19>>0]|0;
  20402. $21 = ($20<<24>>24)==(10);
  20403. if ($21) {
  20404. $33 = $$05561 < $$05263;
  20405. $$156 = $33 ? $$05263 : $$05561;
  20406. $34 = HEAP32[$6>>2]|0;
  20407. $35 = (+($34|0));
  20408. $36 = $35 * 1.5;
  20409. $37 = $$05860 + $36;
  20410. $$151 = 0;$$159 = $37;$$2 = 0.0;$$257 = $$156;
  20411. } else {
  20412. $22 = $20 << 24 >> 24;
  20413. ;HEAP32[$$byval_copy>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy+4>>2]=HEAP32[$1+4>>2]|0;HEAP32[$$byval_copy+8>>2]=HEAP32[$1+8>>2]|0;HEAP32[$$byval_copy+12>>2]=HEAP32[$1+12>>2]|0;HEAP32[$$byval_copy+16>>2]=HEAP32[$1+16>>2]|0;HEAP32[$$byval_copy+20>>2]=HEAP32[$1+20>>2]|0;HEAP32[$$byval_copy+24>>2]=HEAP32[$1+24>>2]|0;HEAP32[$$byval_copy+28>>2]=HEAP32[$1+28>>2]|0;
  20414. $23 = (_GetCharIndex($$byval_copy,$22)|0);
  20415. $24 = HEAP32[$11>>2]|0;
  20416. $25 = (((($24) + ($23<<5)|0)) + 28|0);
  20417. $26 = HEAP32[$25>>2]|0;
  20418. $27 = ($26|0)==(0);
  20419. if ($27) {
  20420. $28 = (((($24) + ($23<<5)|0)) + 20|0);
  20421. $29 = (((($24) + ($23<<5)|0)) + 12|0);
  20422. $30 = HEAP32[$29>>2]|0;
  20423. $31 = HEAP32[$28>>2]|0;
  20424. $32 = (($31) + ($30))|0;
  20425. $$pn$in = $32;
  20426. } else {
  20427. $$pn$in = $26;
  20428. }
  20429. $$pn = (+($$pn$in|0));
  20430. $$153 = $$05263 + $$pn;
  20431. $$151 = $18;$$159 = $$05860;$$2 = $$153;$$257 = $$05561;
  20432. }
  20433. $38 = ($$065|0)<($$151|0);
  20434. $$151$$0 = $38 ? $$151 : $$065;
  20435. $39 = (($$05462) + 1)|0;
  20436. $exitcond = ($39|0)==($5|0);
  20437. if ($exitcond) {
  20438. break;
  20439. } else {
  20440. $$05064 = $$151;$$05263 = $$2;$$05462 = $39;$$05561 = $$257;$$05860 = $$159;$$065 = $$151$$0;
  20441. }
  20442. }
  20443. $phitmp = (($$151$$0) + -1)|0;
  20444. $$0$lcssa = $phitmp;$$052$lcssa = $$2;$$055$lcssa = $$257;$$058$lcssa = $$159;
  20445. $12 = $$055$lcssa < $$052$lcssa;
  20446. $$3 = $12 ? $$052$lcssa : $$055$lcssa;
  20447. $13 = $9 * $$3;
  20448. $14 = Math_imul($$0$lcssa, $4)|0;
  20449. $15 = (+($14|0));
  20450. $16 = $13 + $15;
  20451. $17 = $9 * $$058$lcssa;
  20452. HEAPF32[$0>>2] = $16;
  20453. $$sroa$4$0$$sroa_idx2 = ((($0)) + 4|0);
  20454. HEAPF32[$$sroa$4$0$$sroa_idx2>>2] = $17;
  20455. STACKTOP = sp;return;
  20456. }
  20457. function _GetCharIndex($0,$1) {
  20458. $0 = $0|0;
  20459. $1 = $1|0;
  20460. var $$08 = 0, $$09 = 0, $10 = 0, $11 = 0, $12 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  20461. sp = STACKTOP;
  20462. $2 = ((($0)) + 24|0);
  20463. $3 = HEAP32[$2>>2]|0;
  20464. $4 = ($3|0)>(0);
  20465. if (!($4)) {
  20466. $$08 = 0;
  20467. return ($$08|0);
  20468. }
  20469. $5 = ((($0)) + 28|0);
  20470. $6 = HEAP32[$5>>2]|0;
  20471. $$09 = 0;
  20472. while(1) {
  20473. $7 = (($6) + ($$09<<5)|0);
  20474. $8 = HEAP32[$7>>2]|0;
  20475. $9 = ($8|0)==($1|0);
  20476. if ($9) {
  20477. $$08 = $$09;
  20478. label = 5;
  20479. break;
  20480. }
  20481. $10 = (($$09) + 1)|0;
  20482. $11 = HEAP32[$2>>2]|0;
  20483. $12 = ($10|0)<($11|0);
  20484. if ($12) {
  20485. $$09 = $10;
  20486. } else {
  20487. $$08 = 0;
  20488. label = 5;
  20489. break;
  20490. }
  20491. }
  20492. if ((label|0) == 5) {
  20493. return ($$08|0);
  20494. }
  20495. return (0)|0;
  20496. }
  20497. function _DrawTexturePro($0,$1,$2,$3,$4,$5) {
  20498. $0 = $0|0;
  20499. $1 = $1|0;
  20500. $2 = $2|0;
  20501. $3 = $3|0;
  20502. $4 = +$4;
  20503. $5 = $5|0;
  20504. var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0.0, $22 = 0, $23 = 0, $24 = 0.0, $25 = 0.0, $26 = 0.0, $27 = 0, $28 = 0.0, $29 = 0.0;
  20505. var $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0.0, $39 = 0, $40 = 0, $41 = 0.0, $42 = 0.0, $43 = 0, $44 = 0, $45 = 0.0, $46 = 0, $47 = 0, $48 = 0.0, $49 = 0.0;
  20506. var $50 = 0, $51 = 0.0, $52 = 0, $53 = 0.0, $54 = 0.0, $55 = 0, $56 = 0, $57 = 0, $58 = 0.0, $59 = 0, $6 = 0, $60 = 0.0, $61 = 0.0, $62 = 0, $63 = 0, $64 = 0.0, $65 = 0, $66 = 0, $67 = 0, $68 = 0.0;
  20507. var $69 = 0, $7 = 0, $70 = 0.0, $71 = 0.0, $72 = 0, $73 = 0, $74 = 0, $75 = 0.0, $76 = 0, $77 = 0.0, $78 = 0.0, $79 = 0, $8 = 0, $80 = 0, $81 = 0.0, $82 = 0, $83 = 0.0, $84 = 0, $85 = 0, $86 = 0;
  20508. var $87 = 0.0, $88 = 0, $89 = 0.0, $9 = 0, $90 = 0.0, $91 = 0, $92 = 0.0, $93 = 0, $94 = 0.0, $95 = 0.0, $96 = 0, $97 = 0.0, label = 0, sp = 0;
  20509. sp = STACKTOP;
  20510. $6 = HEAP32[$0>>2]|0;
  20511. $7 = ($6|0)==(0);
  20512. if ($7) {
  20513. return;
  20514. }
  20515. $8 = ((($1)) + 8|0);
  20516. $9 = HEAP32[$8>>2]|0;
  20517. $10 = ($9|0)<(0);
  20518. if ($10) {
  20519. $11 = HEAP32[$1>>2]|0;
  20520. $12 = (($11) - ($9))|0;
  20521. HEAP32[$1>>2] = $12;
  20522. }
  20523. $13 = ((($1)) + 12|0);
  20524. $14 = HEAP32[$13>>2]|0;
  20525. $15 = ($14|0)<(0);
  20526. if ($15) {
  20527. $16 = ((($1)) + 4|0);
  20528. $17 = HEAP32[$16>>2]|0;
  20529. $18 = (($17) - ($14))|0;
  20530. HEAP32[$16>>2] = $18;
  20531. }
  20532. $19 = HEAP32[$0>>2]|0;
  20533. _rlEnableTexture($19);
  20534. _rlPushMatrix();
  20535. $20 = HEAP32[$2>>2]|0;
  20536. $21 = (+($20|0));
  20537. $22 = ((($2)) + 4|0);
  20538. $23 = HEAP32[$22>>2]|0;
  20539. $24 = (+($23|0));
  20540. _rlTranslatef($21,$24,0.0);
  20541. _rlRotatef($4,0.0,0.0,1.0);
  20542. $25 = +HEAPF32[$3>>2];
  20543. $26 = -$25;
  20544. $27 = ((($3)) + 4|0);
  20545. $28 = +HEAPF32[$27>>2];
  20546. $29 = -$28;
  20547. _rlTranslatef($26,$29,0.0);
  20548. _rlBegin(7);
  20549. $30 = HEAP8[$5>>0]|0;
  20550. $31 = ((($5)) + 1|0);
  20551. $32 = HEAP8[$31>>0]|0;
  20552. $33 = ((($5)) + 2|0);
  20553. $34 = HEAP8[$33>>0]|0;
  20554. $35 = ((($5)) + 3|0);
  20555. $36 = HEAP8[$35>>0]|0;
  20556. _rlColor4ub($30,$32,$34,$36);
  20557. $37 = HEAP32[$1>>2]|0;
  20558. $38 = (+($37|0));
  20559. $39 = ((($0)) + 4|0);
  20560. $40 = HEAP32[$39>>2]|0;
  20561. $41 = (+($40|0));
  20562. $42 = $38 / $41;
  20563. $43 = ((($1)) + 4|0);
  20564. $44 = HEAP32[$43>>2]|0;
  20565. $45 = (+($44|0));
  20566. $46 = ((($0)) + 8|0);
  20567. $47 = HEAP32[$46>>2]|0;
  20568. $48 = (+($47|0));
  20569. $49 = $45 / $48;
  20570. _rlTexCoord2f($42,$49);
  20571. _rlVertex2f(0.0,0.0);
  20572. $50 = HEAP32[$1>>2]|0;
  20573. $51 = (+($50|0));
  20574. $52 = HEAP32[$39>>2]|0;
  20575. $53 = (+($52|0));
  20576. $54 = $51 / $53;
  20577. $55 = HEAP32[$43>>2]|0;
  20578. $56 = HEAP32[$13>>2]|0;
  20579. $57 = (($56) + ($55))|0;
  20580. $58 = (+($57|0));
  20581. $59 = HEAP32[$46>>2]|0;
  20582. $60 = (+($59|0));
  20583. $61 = $58 / $60;
  20584. _rlTexCoord2f($54,$61);
  20585. $62 = ((($2)) + 12|0);
  20586. $63 = HEAP32[$62>>2]|0;
  20587. $64 = (+($63|0));
  20588. _rlVertex2f(0.0,$64);
  20589. $65 = HEAP32[$1>>2]|0;
  20590. $66 = HEAP32[$8>>2]|0;
  20591. $67 = (($66) + ($65))|0;
  20592. $68 = (+($67|0));
  20593. $69 = HEAP32[$39>>2]|0;
  20594. $70 = (+($69|0));
  20595. $71 = $68 / $70;
  20596. $72 = HEAP32[$43>>2]|0;
  20597. $73 = HEAP32[$13>>2]|0;
  20598. $74 = (($73) + ($72))|0;
  20599. $75 = (+($74|0));
  20600. $76 = HEAP32[$46>>2]|0;
  20601. $77 = (+($76|0));
  20602. $78 = $75 / $77;
  20603. _rlTexCoord2f($71,$78);
  20604. $79 = ((($2)) + 8|0);
  20605. $80 = HEAP32[$79>>2]|0;
  20606. $81 = (+($80|0));
  20607. $82 = HEAP32[$62>>2]|0;
  20608. $83 = (+($82|0));
  20609. _rlVertex2f($81,$83);
  20610. $84 = HEAP32[$1>>2]|0;
  20611. $85 = HEAP32[$8>>2]|0;
  20612. $86 = (($85) + ($84))|0;
  20613. $87 = (+($86|0));
  20614. $88 = HEAP32[$39>>2]|0;
  20615. $89 = (+($88|0));
  20616. $90 = $87 / $89;
  20617. $91 = HEAP32[$43>>2]|0;
  20618. $92 = (+($91|0));
  20619. $93 = HEAP32[$46>>2]|0;
  20620. $94 = (+($93|0));
  20621. $95 = $92 / $94;
  20622. _rlTexCoord2f($90,$95);
  20623. $96 = HEAP32[$79>>2]|0;
  20624. $97 = (+($96|0));
  20625. _rlVertex2f($97,0.0);
  20626. _rlEnd();
  20627. _rlPopMatrix();
  20628. _rlDisableTexture();
  20629. return;
  20630. }
  20631. function _DrawText($0,$1,$2,$3,$4) {
  20632. $0 = $0|0;
  20633. $1 = $1|0;
  20634. $2 = $2|0;
  20635. $3 = $3|0;
  20636. $4 = $4|0;
  20637. var $$ = 0, $$byval_copy = 0, $$byval_copy1 = 0, $$byval_copy2 = 0, $10 = 0.0, $11 = 0, $12 = 0.0, $13 = 0, $14 = 0, $15 = 0.0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  20638. sp = STACKTOP;
  20639. STACKTOP = STACKTOP + 128|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(128|0);
  20640. $$byval_copy2 = sp + 112|0;
  20641. $$byval_copy1 = sp + 104|0;
  20642. $$byval_copy = sp + 72|0;
  20643. $5 = sp + 32|0;
  20644. $6 = sp + 64|0;
  20645. $7 = sp;
  20646. _GetDefaultFont($5);
  20647. $8 = HEAP32[$5>>2]|0;
  20648. $9 = ($8|0)==(0);
  20649. if ($9) {
  20650. STACKTOP = sp;return;
  20651. }
  20652. $10 = (+($1|0));
  20653. HEAPF32[$6>>2] = $10;
  20654. $11 = ((($6)) + 4|0);
  20655. $12 = (+($2|0));
  20656. HEAPF32[$11>>2] = $12;
  20657. $13 = ($3|0)>(10);
  20658. $$ = $13 ? $3 : 10;
  20659. $14 = (($$>>>0) / 10)&-1;
  20660. _GetDefaultFont($7);
  20661. $15 = (+($$|0));
  20662. ;HEAP32[$$byval_copy>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy+4>>2]=HEAP32[$7+4>>2]|0;HEAP32[$$byval_copy+8>>2]=HEAP32[$7+8>>2]|0;HEAP32[$$byval_copy+12>>2]=HEAP32[$7+12>>2]|0;HEAP32[$$byval_copy+16>>2]=HEAP32[$7+16>>2]|0;HEAP32[$$byval_copy+20>>2]=HEAP32[$7+20>>2]|0;HEAP32[$$byval_copy+24>>2]=HEAP32[$7+24>>2]|0;HEAP32[$$byval_copy+28>>2]=HEAP32[$7+28>>2]|0;
  20663. ;HEAP32[$$byval_copy1>>2]=HEAP32[$6>>2]|0;HEAP32[$$byval_copy1+4>>2]=HEAP32[$6+4>>2]|0;
  20664. ;HEAP8[$$byval_copy2>>0]=HEAP8[$4>>0]|0;HEAP8[$$byval_copy2+1>>0]=HEAP8[$4+1>>0]|0;HEAP8[$$byval_copy2+2>>0]=HEAP8[$4+2>>0]|0;HEAP8[$$byval_copy2+3>>0]=HEAP8[$4+3>>0]|0;
  20665. _DrawTextEx($$byval_copy,$0,$$byval_copy1,$15,$14,$$byval_copy2);
  20666. STACKTOP = sp;return;
  20667. }
  20668. function _DrawTextEx($0,$1,$2,$3,$4,$5) {
  20669. $0 = $0|0;
  20670. $1 = $1|0;
  20671. $2 = $2|0;
  20672. $3 = +$3;
  20673. $4 = $4|0;
  20674. $5 = $5|0;
  20675. var $$04954 = 0, $$05153 = 0, $$055 = 0, $$1 = 0, $$150 = 0, $$152 = 0, $$2 = 0, $$byval_copy1 = 0, $$byval_copy2 = 0, $$byval_copy3 = 0, $$byval_copy4 = 0, $$byval_copy5 = 0, $$sink = 0, $10 = 0, $11 = 0.0, $12 = 0.0, $13 = 0, $14 = 0, $15 = 0.0, $16 = 0;
  20676. var $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0.0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0.0, $28 = 0.0, $29 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0;
  20677. var $37 = 0, $38 = 0, $39 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0.0, $45 = 0.0, $46 = 0, $47 = 0, $48 = 0.0, $49 = 0.0, $50 = 0.0, $51 = 0, $52 = 0.0, $53 = 0.0, $54 = 0.0, $55 = 0, $56 = 0;
  20678. var $57 = 0.0, $58 = 0.0, $59 = 0.0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0.0, $64 = 0.0, $65 = 0, $66 = 0, $67 = 0, $68 = 0.0, $69 = 0.0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0;
  20679. var $75 = 0, $76 = 0, $77 = 0.0, $78 = 0.0, $79 = 0.0, $8 = 0, $80 = 0, $81 = 0, $82 = 0.0, $83 = 0.0, $84 = 0.0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $9 = 0, label = 0, sp = 0;
  20680. sp = STACKTOP;
  20681. STACKTOP = STACKTOP + 128|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(128|0);
  20682. $$byval_copy5 = sp + 88|0;
  20683. $$byval_copy4 = sp + 80|0;
  20684. $$byval_copy3 = sp + 64|0;
  20685. $$byval_copy2 = sp + 48|0;
  20686. $$byval_copy1 = sp + 24|0;
  20687. $6 = sp + 8|0;
  20688. $7 = sp;
  20689. $8 = (_strlen($1)|0);
  20690. $9 = ((($0)) + 20|0);
  20691. $10 = HEAP32[$9>>2]|0;
  20692. $11 = (+($10|0));
  20693. $12 = $3 / $11;
  20694. $13 = ($8|0)>(0);
  20695. if (!($13)) {
  20696. STACKTOP = sp;return;
  20697. }
  20698. $14 = ((($0)) + 28|0);
  20699. $15 = +HEAPF32[$2>>2];
  20700. $16 = ((($6)) + 4|0);
  20701. $17 = ((($2)) + 4|0);
  20702. $18 = ((($6)) + 8|0);
  20703. $19 = ((($6)) + 12|0);
  20704. $20 = ((($7)) + 4|0);
  20705. $21 = (+($4|0));
  20706. $$04954 = 0;$$05153 = 0;$$055 = 0;
  20707. while(1) {
  20708. $22 = (($1) + ($$055)|0);
  20709. $23 = HEAP8[$22>>0]|0;
  20710. switch ($23<<24>>24) {
  20711. case 10: {
  20712. $24 = HEAP32[$9>>2]|0;
  20713. $25 = (($24|0) / 2)&-1;
  20714. $26 = (($25) + ($24))|0;
  20715. $27 = (+($26|0));
  20716. $28 = $12 * $27;
  20717. $29 = (~~(($28)));
  20718. $30 = (($29) + ($$05153))|0;
  20719. $$150 = 0;$$152 = $30;$$2 = $$055;
  20720. break;
  20721. }
  20722. case -62: {
  20723. $31 = (($$055) + 1)|0;
  20724. $32 = (($1) + ($31)|0);
  20725. $33 = HEAP8[$32>>0]|0;
  20726. $34 = $33&255;
  20727. $$1 = $31;$$sink = $34;
  20728. label = 9;
  20729. break;
  20730. }
  20731. case -61: {
  20732. $35 = (($$055) + 1)|0;
  20733. $36 = (($1) + ($35)|0);
  20734. $37 = HEAP8[$36>>0]|0;
  20735. $38 = $37&255;
  20736. $39 = (($38) + 64)|0;
  20737. $$1 = $35;$$sink = $39;
  20738. label = 9;
  20739. break;
  20740. }
  20741. default: {
  20742. $40 = $23 << 24 >> 24;
  20743. $$1 = $$055;$$sink = $40;
  20744. label = 9;
  20745. }
  20746. }
  20747. do {
  20748. if ((label|0) == 9) {
  20749. label = 0;
  20750. ;HEAP32[$$byval_copy5>>2]=HEAP32[$0>>2]|0;HEAP32[$$byval_copy5+4>>2]=HEAP32[$0+4>>2]|0;HEAP32[$$byval_copy5+8>>2]=HEAP32[$0+8>>2]|0;HEAP32[$$byval_copy5+12>>2]=HEAP32[$0+12>>2]|0;HEAP32[$$byval_copy5+16>>2]=HEAP32[$0+16>>2]|0;HEAP32[$$byval_copy5+20>>2]=HEAP32[$0+20>>2]|0;HEAP32[$$byval_copy5+24>>2]=HEAP32[$0+24>>2]|0;HEAP32[$$byval_copy5+28>>2]=HEAP32[$0+28>>2]|0;
  20751. $41 = (_GetCharIndex($$byval_copy5,$$sink)|0);
  20752. $42 = HEAP32[$14>>2]|0;
  20753. $43 = (((($42) + ($41<<5)|0)) + 4|0);
  20754. $44 = (+($$04954|0));
  20755. $45 = $44 + $15;
  20756. $46 = (((($42) + ($41<<5)|0)) + 20|0);
  20757. $47 = HEAP32[$46>>2]|0;
  20758. $48 = (+($47|0));
  20759. $49 = $12 * $48;
  20760. $50 = $45 + $49;
  20761. $51 = (~~(($50)));
  20762. HEAP32[$6>>2] = $51;
  20763. $52 = +HEAPF32[$17>>2];
  20764. $53 = (+($$05153|0));
  20765. $54 = $53 + $52;
  20766. $55 = (((($42) + ($41<<5)|0)) + 24|0);
  20767. $56 = HEAP32[$55>>2]|0;
  20768. $57 = (+($56|0));
  20769. $58 = $12 * $57;
  20770. $59 = $54 + $58;
  20771. $60 = (~~(($59)));
  20772. HEAP32[$16>>2] = $60;
  20773. $61 = (((($42) + ($41<<5)|0)) + 12|0);
  20774. $62 = HEAP32[$61>>2]|0;
  20775. $63 = (+($62|0));
  20776. $64 = $12 * $63;
  20777. $65 = (~~(($64)));
  20778. HEAP32[$18>>2] = $65;
  20779. $66 = (((($42) + ($41<<5)|0)) + 16|0);
  20780. $67 = HEAP32[$66>>2]|0;
  20781. $68 = (+($67|0));
  20782. $69 = $12 * $68;
  20783. $70 = (~~(($69)));
  20784. HEAP32[$19>>2] = $70;
  20785. HEAPF32[$7>>2] = 0.0;
  20786. HEAPF32[$20>>2] = 0.0;
  20787. ;HEAP32[$$byval_copy1>>2]=HEAP32[$0>>2]|0;HEAP32[$$byval_copy1+4>>2]=HEAP32[$0+4>>2]|0;HEAP32[$$byval_copy1+8>>2]=HEAP32[$0+8>>2]|0;HEAP32[$$byval_copy1+12>>2]=HEAP32[$0+12>>2]|0;HEAP32[$$byval_copy1+16>>2]=HEAP32[$0+16>>2]|0;
  20788. ;HEAP32[$$byval_copy2>>2]=HEAP32[$43>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$43+4>>2]|0;HEAP32[$$byval_copy2+8>>2]=HEAP32[$43+8>>2]|0;HEAP32[$$byval_copy2+12>>2]=HEAP32[$43+12>>2]|0;
  20789. ;HEAP32[$$byval_copy3>>2]=HEAP32[$6>>2]|0;HEAP32[$$byval_copy3+4>>2]=HEAP32[$6+4>>2]|0;HEAP32[$$byval_copy3+8>>2]=HEAP32[$6+8>>2]|0;HEAP32[$$byval_copy3+12>>2]=HEAP32[$6+12>>2]|0;
  20790. ;HEAP32[$$byval_copy4>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy4+4>>2]=HEAP32[$7+4>>2]|0;
  20791. ;HEAP8[$$byval_copy5>>0]=HEAP8[$5>>0]|0;HEAP8[$$byval_copy5+1>>0]=HEAP8[$5+1>>0]|0;HEAP8[$$byval_copy5+2>>0]=HEAP8[$5+2>>0]|0;HEAP8[$$byval_copy5+3>>0]=HEAP8[$5+3>>0]|0;
  20792. _DrawTexturePro($$byval_copy1,$$byval_copy2,$$byval_copy3,$$byval_copy4,0.0,$$byval_copy5);
  20793. $71 = HEAP32[$14>>2]|0;
  20794. $72 = (((($71) + ($41<<5)|0)) + 28|0);
  20795. $73 = HEAP32[$72>>2]|0;
  20796. $74 = ($73|0)==(0);
  20797. if ($74) {
  20798. $75 = (((($71) + ($41<<5)|0)) + 12|0);
  20799. $76 = HEAP32[$75>>2]|0;
  20800. $77 = (+($76|0));
  20801. $78 = $12 * $77;
  20802. $79 = $21 + $78;
  20803. $80 = (~~(($79)));
  20804. $81 = (($80) + ($$04954))|0;
  20805. $$150 = $81;$$152 = $$05153;$$2 = $$1;
  20806. break;
  20807. } else {
  20808. $82 = (+($73|0));
  20809. $83 = $12 * $82;
  20810. $84 = $21 + $83;
  20811. $85 = (~~(($84)));
  20812. $86 = (($85) + ($$04954))|0;
  20813. $$150 = $86;$$152 = $$05153;$$2 = $$1;
  20814. break;
  20815. }
  20816. }
  20817. } while(0);
  20818. $87 = (($$2) + 1)|0;
  20819. $88 = ($87|0)<($8|0);
  20820. if ($88) {
  20821. $$04954 = $$150;$$05153 = $$152;$$055 = $87;
  20822. } else {
  20823. break;
  20824. }
  20825. }
  20826. STACKTOP = sp;return;
  20827. }
  20828. function _FormatText($0,$varargs) {
  20829. $0 = $0|0;
  20830. $varargs = $varargs|0;
  20831. var $1 = 0, label = 0, sp = 0;
  20832. sp = STACKTOP;
  20833. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  20834. $1 = sp;
  20835. HEAP32[$1>>2] = $varargs;
  20836. (_vsprintf(37247,$0,$1)|0);
  20837. STACKTOP = sp;return (37247|0);
  20838. }
  20839. function _MeasureText($0,$1) {
  20840. $0 = $0|0;
  20841. $1 = $1|0;
  20842. var $$ = 0, $$byval_copy = 0, $$sroa$0$0 = 0, $$sroa$0$0$copyload = 0.0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0.0, $phitmp = 0, label = 0, sp = 0;
  20843. sp = STACKTOP;
  20844. STACKTOP = STACKTOP + 112|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(112|0);
  20845. $$byval_copy = sp + 72|0;
  20846. $2 = sp + 40|0;
  20847. $3 = sp + 8|0;
  20848. $4 = sp;
  20849. _GetDefaultFont($2);
  20850. $5 = HEAP32[$2>>2]|0;
  20851. $6 = ($5|0)==(0);
  20852. if ($6) {
  20853. $$sroa$0$0 = 0;
  20854. STACKTOP = sp;return ($$sroa$0$0|0);
  20855. }
  20856. $7 = ($1|0)>(10);
  20857. $$ = $7 ? $1 : 10;
  20858. $8 = (($$>>>0) / 10)&-1;
  20859. _GetDefaultFont($3);
  20860. $9 = (+($$|0));
  20861. ;HEAP32[$$byval_copy>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy+4>>2]=HEAP32[$3+4>>2]|0;HEAP32[$$byval_copy+8>>2]=HEAP32[$3+8>>2]|0;HEAP32[$$byval_copy+12>>2]=HEAP32[$3+12>>2]|0;HEAP32[$$byval_copy+16>>2]=HEAP32[$3+16>>2]|0;HEAP32[$$byval_copy+20>>2]=HEAP32[$3+20>>2]|0;HEAP32[$$byval_copy+24>>2]=HEAP32[$3+24>>2]|0;HEAP32[$$byval_copy+28>>2]=HEAP32[$3+28>>2]|0;
  20862. _MeasureTextEx($4,$$byval_copy,$0,$9,$8);
  20863. $$sroa$0$0$copyload = +HEAPF32[$4>>2];
  20864. $phitmp = (~~(($$sroa$0$0$copyload)));
  20865. $$sroa$0$0 = $phitmp;
  20866. STACKTOP = sp;return ($$sroa$0$0|0);
  20867. }
  20868. function _DrawFPS($0,$1) {
  20869. $0 = $0|0;
  20870. $1 = $1|0;
  20871. var $$byval_copy = 0, $$sink = 0, $10 = 0, $11 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  20872. sp = STACKTOP;
  20873. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  20874. $$byval_copy = sp;
  20875. $2 = sp + 4|0;
  20876. $3 = HEAP32[8306]|0;
  20877. $4 = HEAP32[747]|0;
  20878. $5 = ($3|0)<($4|0);
  20879. if ($5) {
  20880. $6 = (($3) + 1)|0;
  20881. $$sink = $6;
  20882. } else {
  20883. $7 = (_GetFPS()|0);
  20884. HEAP32[8307] = $7;
  20885. HEAP32[747] = $7;
  20886. $$sink = 0;
  20887. }
  20888. HEAP32[8306] = $$sink;
  20889. $8 = HEAP32[8307]|0;
  20890. HEAP32[$$byval_copy>>2] = $8;
  20891. (_FormatText(8192,$$byval_copy)|0);
  20892. HEAP8[$2>>0] = 0;
  20893. $9 = ((($2)) + 1|0);
  20894. HEAP8[$9>>0] = -98;
  20895. $10 = ((($2)) + 2|0);
  20896. HEAP8[$10>>0] = 47;
  20897. $11 = ((($2)) + 3|0);
  20898. HEAP8[$11>>0] = -1;
  20899. ;HEAP8[$$byval_copy>>0]=HEAP8[$2>>0]|0;HEAP8[$$byval_copy+1>>0]=HEAP8[$2+1>>0]|0;HEAP8[$$byval_copy+2>>0]=HEAP8[$2+2>>0]|0;HEAP8[$$byval_copy+3>>0]=HEAP8[$2+3>>0]|0;
  20900. _DrawText(37247,$0,$1,20,$$byval_copy);
  20901. STACKTOP = sp;return;
  20902. }
  20903. function _emscripten_GetProcAddress($0) {
  20904. $0 = $0|0;
  20905. var $1 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0, $116 = 0;
  20906. var $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0, $133 = 0, $134 = 0;
  20907. var $135 = 0, $136 = 0, $137 = 0, $138 = 0, $139 = 0, $14 = 0, $140 = 0, $141 = 0, $142 = 0, $143 = 0, $144 = 0, $145 = 0, $146 = 0, $147 = 0, $148 = 0, $149 = 0, $15 = 0, $150 = 0, $151 = 0, $152 = 0;
  20908. var $153 = 0, $154 = 0, $155 = 0, $156 = 0, $157 = 0, $158 = 0, $159 = 0, $16 = 0, $160 = 0, $161 = 0, $162 = 0, $163 = 0, $164 = 0, $165 = 0, $166 = 0, $167 = 0, $168 = 0, $169 = 0, $17 = 0, $170 = 0;
  20909. var $171 = 0, $172 = 0, $173 = 0, $174 = 0, $175 = 0, $176 = 0, $177 = 0, $178 = 0, $179 = 0, $18 = 0, $180 = 0, $181 = 0, $182 = 0, $183 = 0, $184 = 0, $185 = 0, $186 = 0, $187 = 0, $188 = 0, $189 = 0;
  20910. var $19 = 0, $190 = 0, $191 = 0, $192 = 0, $193 = 0, $194 = 0, $195 = 0, $196 = 0, $197 = 0, $198 = 0, $199 = 0, $2 = 0, $20 = 0, $200 = 0, $201 = 0, $202 = 0, $203 = 0, $204 = 0, $205 = 0, $206 = 0;
  20911. var $207 = 0, $208 = 0, $209 = 0, $21 = 0, $210 = 0, $211 = 0, $212 = 0, $213 = 0, $214 = 0, $215 = 0, $216 = 0, $217 = 0, $218 = 0, $219 = 0, $22 = 0, $220 = 0, $221 = 0, $222 = 0, $223 = 0, $224 = 0;
  20912. var $225 = 0, $226 = 0, $227 = 0, $228 = 0, $229 = 0, $23 = 0, $230 = 0, $231 = 0, $232 = 0, $233 = 0, $234 = 0, $235 = 0, $236 = 0, $237 = 0, $238 = 0, $239 = 0, $24 = 0, $240 = 0, $241 = 0, $242 = 0;
  20913. var $243 = 0, $244 = 0, $245 = 0, $246 = 0, $247 = 0, $248 = 0, $249 = 0, $25 = 0, $250 = 0, $251 = 0, $252 = 0, $253 = 0, $254 = 0, $255 = 0, $256 = 0, $257 = 0, $258 = 0, $259 = 0, $26 = 0, $260 = 0;
  20914. var $261 = 0, $262 = 0, $263 = 0, $264 = 0, $265 = 0, $266 = 0, $267 = 0, $268 = 0, $269 = 0, $27 = 0, $270 = 0, $271 = 0, $272 = 0, $273 = 0, $274 = 0, $275 = 0, $276 = 0, $277 = 0, $278 = 0, $279 = 0;
  20915. var $28 = 0, $280 = 0, $281 = 0, $282 = 0, $283 = 0, $284 = 0, $285 = 0, $286 = 0, $287 = 0, $288 = 0, $289 = 0, $29 = 0, $290 = 0, $291 = 0, $292 = 0, $293 = 0, $294 = 0, $295 = 0, $296 = 0, $297 = 0;
  20916. var $298 = 0, $299 = 0, $3 = 0, $30 = 0, $300 = 0, $301 = 0, $302 = 0, $303 = 0, $304 = 0, $305 = 0, $306 = 0, $307 = 0, $308 = 0, $309 = 0, $31 = 0, $310 = 0, $311 = 0, $312 = 0, $313 = 0, $314 = 0;
  20917. var $315 = 0, $316 = 0, $317 = 0, $318 = 0, $319 = 0, $32 = 0, $320 = 0, $321 = 0, $322 = 0, $323 = 0, $324 = 0, $325 = 0, $326 = 0, $327 = 0, $328 = 0, $329 = 0, $33 = 0, $330 = 0, $331 = 0, $332 = 0;
  20918. var $333 = 0, $334 = 0, $335 = 0, $336 = 0, $337 = 0, $338 = 0, $339 = 0, $34 = 0, $340 = 0, $341 = 0, $342 = 0, $343 = 0, $344 = 0, $345 = 0, $346 = 0, $347 = 0, $348 = 0, $349 = 0, $35 = 0, $350 = 0;
  20919. var $351 = 0, $352 = 0, $353 = 0, $354 = 0, $355 = 0, $356 = 0, $357 = 0, $358 = 0, $359 = 0, $36 = 0, $360 = 0, $361 = 0, $362 = 0, $363 = 0, $364 = 0, $365 = 0, $366 = 0, $367 = 0, $368 = 0, $369 = 0;
  20920. var $37 = 0, $370 = 0, $371 = 0, $372 = 0, $373 = 0, $374 = 0, $375 = 0, $376 = 0, $377 = 0, $378 = 0, $379 = 0, $38 = 0, $380 = 0, $381 = 0, $382 = 0, $383 = 0, $384 = 0, $385 = 0, $386 = 0, $387 = 0;
  20921. var $388 = 0, $389 = 0, $39 = 0, $390 = 0, $391 = 0, $392 = 0, $393 = 0, $394 = 0, $395 = 0, $396 = 0, $397 = 0, $398 = 0, $399 = 0, $4 = 0, $40 = 0, $400 = 0, $401 = 0, $402 = 0, $403 = 0, $404 = 0;
  20922. var $405 = 0, $406 = 0, $407 = 0, $408 = 0, $409 = 0, $41 = 0, $410 = 0, $411 = 0, $412 = 0, $413 = 0, $414 = 0, $415 = 0, $416 = 0, $417 = 0, $418 = 0, $419 = 0, $42 = 0, $420 = 0, $421 = 0, $422 = 0;
  20923. var $423 = 0, $424 = 0, $425 = 0, $426 = 0, $427 = 0, $428 = 0, $429 = 0, $43 = 0, $430 = 0, $431 = 0, $432 = 0, $433 = 0, $434 = 0, $435 = 0, $436 = 0, $437 = 0, $438 = 0, $439 = 0, $44 = 0, $440 = 0;
  20924. var $441 = 0, $442 = 0, $443 = 0, $444 = 0, $445 = 0, $446 = 0, $447 = 0, $448 = 0, $449 = 0, $45 = 0, $450 = 0, $451 = 0, $452 = 0, $453 = 0, $454 = 0, $455 = 0, $456 = 0, $457 = 0, $458 = 0, $459 = 0;
  20925. var $46 = 0, $460 = 0, $461 = 0, $462 = 0, $463 = 0, $464 = 0, $465 = 0, $466 = 0, $467 = 0, $468 = 0, $469 = 0, $47 = 0, $470 = 0, $471 = 0, $472 = 0, $473 = 0, $474 = 0, $475 = 0, $476 = 0, $477 = 0;
  20926. var $478 = 0, $479 = 0, $48 = 0, $480 = 0, $481 = 0, $482 = 0, $483 = 0, $484 = 0, $485 = 0, $486 = 0, $487 = 0, $488 = 0, $489 = 0, $49 = 0, $490 = 0, $491 = 0, $492 = 0, $493 = 0, $494 = 0, $495 = 0;
  20927. var $496 = 0, $497 = 0, $498 = 0, $499 = 0, $5 = 0, $50 = 0, $500 = 0, $501 = 0, $502 = 0, $503 = 0, $504 = 0, $505 = 0, $506 = 0, $507 = 0, $508 = 0, $509 = 0, $51 = 0, $510 = 0, $511 = 0, $512 = 0;
  20928. var $513 = 0, $514 = 0, $515 = 0, $516 = 0, $517 = 0, $518 = 0, $519 = 0, $52 = 0, $520 = 0, $521 = 0, $522 = 0, $523 = 0, $524 = 0, $525 = 0, $526 = 0, $527 = 0, $528 = 0, $529 = 0, $53 = 0, $530 = 0;
  20929. var $531 = 0, $532 = 0, $533 = 0, $534 = 0, $535 = 0, $536 = 0, $537 = 0, $538 = 0, $539 = 0, $54 = 0, $540 = 0, $541 = 0, $542 = 0, $543 = 0, $544 = 0, $545 = 0, $546 = 0, $547 = 0, $548 = 0, $549 = 0;
  20930. var $55 = 0, $550 = 0, $551 = 0, $552 = 0, $553 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0;
  20931. var $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0;
  20932. var $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, label = 0, sp = 0;
  20933. sp = STACKTOP;
  20934. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  20935. $1 = sp + 12|0;
  20936. $2 = sp + 8|0;
  20937. $3 = sp + 4|0;
  20938. $4 = sp;
  20939. HEAP32[$2>>2] = $0;
  20940. $5 = HEAP32[$2>>2]|0;
  20941. $6 = (_strlen($5)|0);
  20942. $7 = (($6) + 1)|0;
  20943. $8 = (_malloc($7)|0);
  20944. HEAP32[$3>>2] = $8;
  20945. $9 = HEAP32[$3>>2]|0;
  20946. $10 = HEAP32[$2>>2]|0;
  20947. (_strcpy($9,$10)|0);
  20948. $11 = HEAP32[$3>>2]|0;
  20949. $12 = (_strstr($11,8200)|0);
  20950. HEAP32[$4>>2] = $12;
  20951. $13 = HEAP32[$4>>2]|0;
  20952. $14 = ($13|0)!=(0|0);
  20953. if ($14) {
  20954. $15 = HEAP32[$4>>2]|0;
  20955. HEAP8[$15>>0] = 0;
  20956. }
  20957. $16 = HEAP32[$3>>2]|0;
  20958. $17 = (_strstr($16,8204)|0);
  20959. HEAP32[$4>>2] = $17;
  20960. $18 = HEAP32[$4>>2]|0;
  20961. $19 = ($18|0)!=(0|0);
  20962. if ($19) {
  20963. $20 = HEAP32[$4>>2]|0;
  20964. HEAP8[$20>>0] = 0;
  20965. }
  20966. $21 = HEAP32[$3>>2]|0;
  20967. $22 = (_strstr($21,8208)|0);
  20968. HEAP32[$4>>2] = $22;
  20969. $23 = HEAP32[$4>>2]|0;
  20970. $24 = ($23|0)!=(0|0);
  20971. if ($24) {
  20972. $25 = HEAP32[$4>>2]|0;
  20973. HEAP8[$25>>0] = 0;
  20974. }
  20975. $26 = HEAP32[$3>>2]|0;
  20976. $27 = (_strstr($26,8212)|0);
  20977. HEAP32[$4>>2] = $27;
  20978. $28 = HEAP32[$4>>2]|0;
  20979. $29 = ($28|0)!=(0|0);
  20980. if ($29) {
  20981. $30 = HEAP32[$4>>2]|0;
  20982. HEAP8[$30>>0] = 0;
  20983. }
  20984. $31 = HEAP32[$3>>2]|0;
  20985. $32 = (_strcmp($31,8218)|0);
  20986. $33 = ($32|0)!=(0);
  20987. do {
  20988. if ($33) {
  20989. $34 = HEAP32[$3>>2]|0;
  20990. $35 = (_strcmp($34,8256)|0);
  20991. $36 = ($35|0)!=(0);
  20992. if (!($36)) {
  20993. HEAP32[$3>>2] = 8275;
  20994. break;
  20995. }
  20996. $37 = HEAP32[$3>>2]|0;
  20997. $38 = (_strcmp($37,8288)|0);
  20998. $39 = ($38|0)!=(0);
  20999. if (!($39)) {
  21000. HEAP32[$3>>2] = 8309;
  21001. break;
  21002. }
  21003. $40 = HEAP32[$3>>2]|0;
  21004. $41 = (_strcmp($40,8324)|0);
  21005. $42 = ($41|0)!=(0);
  21006. if (!($42)) {
  21007. HEAP32[$3>>2] = 8339;
  21008. break;
  21009. }
  21010. $43 = HEAP32[$3>>2]|0;
  21011. $44 = (_strcmp($43,8354)|0);
  21012. $45 = ($44|0)!=(0);
  21013. if (!($45)) {
  21014. HEAP32[$3>>2] = 8369;
  21015. }
  21016. } else {
  21017. HEAP32[$3>>2] = 8240;
  21018. }
  21019. } while(0);
  21020. $46 = HEAP32[$3>>2]|0;
  21021. $47 = (_strcmp($46,8384)|0);
  21022. $48 = ($47|0)!=(0);
  21023. do {
  21024. if ($48) {
  21025. $49 = HEAP32[$3>>2]|0;
  21026. $50 = (_strcmp($49,8398)|0);
  21027. $51 = ($50|0)!=(0);
  21028. if (!($51)) {
  21029. HEAP32[$1>>2] = 3;
  21030. break;
  21031. }
  21032. $52 = HEAP32[$3>>2]|0;
  21033. $53 = (_strcmp($52,8410)|0);
  21034. $54 = ($53|0)!=(0);
  21035. if (!($54)) {
  21036. HEAP32[$1>>2] = 6;
  21037. break;
  21038. }
  21039. $55 = HEAP32[$3>>2]|0;
  21040. $56 = (_strcmp($55,8424)|0);
  21041. $57 = ($56|0)!=(0);
  21042. if (!($57)) {
  21043. HEAP32[$1>>2] = 7;
  21044. break;
  21045. }
  21046. $58 = HEAP32[$3>>2]|0;
  21047. $59 = (_strcmp($58,8436)|0);
  21048. $60 = ($59|0)!=(0);
  21049. if (!($60)) {
  21050. HEAP32[$1>>2] = 8;
  21051. break;
  21052. }
  21053. $61 = HEAP32[$3>>2]|0;
  21054. $62 = (_strcmp($61,8450)|0);
  21055. $63 = ($62|0)!=(0);
  21056. if (!($63)) {
  21057. HEAP32[$1>>2] = 9;
  21058. break;
  21059. }
  21060. $64 = HEAP32[$3>>2]|0;
  21061. $65 = (_strcmp($64,8464)|0);
  21062. $66 = ($65|0)!=(0);
  21063. if (!($66)) {
  21064. HEAP32[$1>>2] = 10;
  21065. break;
  21066. }
  21067. $67 = HEAP32[$3>>2]|0;
  21068. $68 = (_strcmp($67,8481)|0);
  21069. $69 = ($68|0)!=(0);
  21070. if (!($69)) {
  21071. HEAP32[$1>>2] = 1;
  21072. break;
  21073. }
  21074. $70 = HEAP32[$3>>2]|0;
  21075. $71 = (_strcmp($70,8504)|0);
  21076. $72 = ($71|0)!=(0);
  21077. if (!($72)) {
  21078. HEAP32[$1>>2] = 1;
  21079. break;
  21080. }
  21081. $73 = HEAP32[$3>>2]|0;
  21082. $74 = (_strcmp($73,8530)|0);
  21083. $75 = ($74|0)!=(0);
  21084. if (!($75)) {
  21085. HEAP32[$1>>2] = 2;
  21086. break;
  21087. }
  21088. $76 = HEAP32[$3>>2]|0;
  21089. $77 = (_strcmp($76,8543)|0);
  21090. $78 = ($77|0)!=(0);
  21091. if (!($78)) {
  21092. HEAP32[$1>>2] = 3;
  21093. break;
  21094. }
  21095. $79 = HEAP32[$3>>2]|0;
  21096. $80 = (_strcmp($79,8559)|0);
  21097. $81 = ($80|0)!=(0);
  21098. if (!($81)) {
  21099. HEAP32[$1>>2] = 1;
  21100. break;
  21101. }
  21102. $82 = HEAP32[$3>>2]|0;
  21103. $83 = (_strcmp($82,8572)|0);
  21104. $84 = ($83|0)!=(0);
  21105. if (!($84)) {
  21106. HEAP32[$1>>2] = 11;
  21107. break;
  21108. }
  21109. $85 = HEAP32[$3>>2]|0;
  21110. $86 = (_strcmp($85,8586)|0);
  21111. $87 = ($86|0)!=(0);
  21112. if (!($87)) {
  21113. HEAP32[$1>>2] = 2;
  21114. break;
  21115. }
  21116. $88 = HEAP32[$3>>2]|0;
  21117. $89 = (_strcmp($88,8606)|0);
  21118. $90 = ($89|0)!=(0);
  21119. if (!($90)) {
  21120. HEAP32[$1>>2] = 3;
  21121. break;
  21122. }
  21123. $91 = HEAP32[$3>>2]|0;
  21124. $92 = (_strcmp($91,8626)|0);
  21125. $93 = ($92|0)!=(0);
  21126. if (!($93)) {
  21127. HEAP32[$1>>2] = 4;
  21128. break;
  21129. }
  21130. $94 = HEAP32[$3>>2]|0;
  21131. $95 = (_strcmp($94,8643)|0);
  21132. $96 = ($95|0)!=(0);
  21133. if (!($96)) {
  21134. HEAP32[$1>>2] = 5;
  21135. break;
  21136. }
  21137. $97 = HEAP32[$3>>2]|0;
  21138. $98 = (_strcmp($97,8660)|0);
  21139. $99 = ($98|0)!=(0);
  21140. if (!($99)) {
  21141. HEAP32[$1>>2] = 4;
  21142. break;
  21143. }
  21144. $100 = HEAP32[$3>>2]|0;
  21145. $101 = (_strcmp($100,8672)|0);
  21146. $102 = ($101|0)!=(0);
  21147. if (!($102)) {
  21148. HEAP32[$1>>2] = 12;
  21149. break;
  21150. }
  21151. $103 = HEAP32[$3>>2]|0;
  21152. $104 = (_strcmp($103,8685)|0);
  21153. $105 = ($104|0)!=(0);
  21154. if (!($105)) {
  21155. HEAP32[$1>>2] = 13;
  21156. break;
  21157. }
  21158. $106 = HEAP32[$3>>2]|0;
  21159. $107 = (_strcmp($106,8701)|0);
  21160. $108 = ($107|0)!=(0);
  21161. if (!($108)) {
  21162. HEAP32[$1>>2] = 6;
  21163. break;
  21164. }
  21165. $109 = HEAP32[$3>>2]|0;
  21166. $110 = (_strcmp($109,8724)|0);
  21167. $111 = ($110|0)!=(0);
  21168. if (!($111)) {
  21169. HEAP32[$1>>2] = 2;
  21170. break;
  21171. }
  21172. $112 = HEAP32[$3>>2]|0;
  21173. $113 = (_strcmp($112,8737)|0);
  21174. $114 = ($113|0)!=(0);
  21175. if (!($114)) {
  21176. HEAP32[$1>>2] = 3;
  21177. break;
  21178. }
  21179. $115 = HEAP32[$3>>2]|0;
  21180. $116 = (_strcmp($115,8753)|0);
  21181. $117 = ($116|0)!=(0);
  21182. if (!($117)) {
  21183. HEAP32[$1>>2] = 5;
  21184. break;
  21185. }
  21186. $118 = HEAP32[$3>>2]|0;
  21187. $119 = (_strcmp($118,8764)|0);
  21188. $120 = ($119|0)!=(0);
  21189. if (!($120)) {
  21190. HEAP32[$1>>2] = 14;
  21191. break;
  21192. }
  21193. $121 = HEAP32[$3>>2]|0;
  21194. $122 = (_strcmp($121,8783)|0);
  21195. $123 = ($122|0)!=(0);
  21196. if (!($123)) {
  21197. HEAP32[$1>>2] = 15;
  21198. break;
  21199. }
  21200. $124 = HEAP32[$3>>2]|0;
  21201. $125 = (_strcmp($124,8805)|0);
  21202. $126 = ($125|0)!=(0);
  21203. if (!($126)) {
  21204. HEAP32[$1>>2] = 16;
  21205. break;
  21206. }
  21207. $127 = HEAP32[$3>>2]|0;
  21208. $128 = (_strcmp($127,8824)|0);
  21209. $129 = ($128|0)!=(0);
  21210. if (!($129)) {
  21211. HEAP32[$1>>2] = 7;
  21212. break;
  21213. }
  21214. $130 = HEAP32[$3>>2]|0;
  21215. $131 = (_strcmp($130,8853)|0);
  21216. $132 = ($131|0)!=(0);
  21217. if (!($132)) {
  21218. HEAP32[$1>>2] = 6;
  21219. break;
  21220. }
  21221. $133 = HEAP32[$3>>2]|0;
  21222. $134 = (_strcmp($133,8870)|0);
  21223. $135 = ($134|0)!=(0);
  21224. if (!($135)) {
  21225. HEAP32[$1>>2] = 8;
  21226. break;
  21227. }
  21228. $136 = HEAP32[$3>>2]|0;
  21229. $137 = (_strcmp($136,8885)|0);
  21230. $138 = ($137|0)!=(0);
  21231. if (!($138)) {
  21232. HEAP32[$1>>2] = 9;
  21233. break;
  21234. }
  21235. $139 = HEAP32[$3>>2]|0;
  21236. $140 = (_strcmp($139,8900)|0);
  21237. $141 = ($140|0)!=(0);
  21238. if (!($141)) {
  21239. HEAP32[$1>>2] = 1;
  21240. break;
  21241. }
  21242. $142 = HEAP32[$3>>2]|0;
  21243. $143 = (_strcmp($142,8921)|0);
  21244. $144 = ($143|0)!=(0);
  21245. if (!($144)) {
  21246. HEAP32[$1>>2] = 10;
  21247. break;
  21248. }
  21249. $145 = HEAP32[$3>>2]|0;
  21250. $146 = (_strcmp($145,8941)|0);
  21251. $147 = ($146|0)!=(0);
  21252. if (!($147)) {
  21253. HEAP32[$1>>2] = 11;
  21254. break;
  21255. }
  21256. $148 = HEAP32[$3>>2]|0;
  21257. $149 = (_strcmp($148,8961)|0);
  21258. $150 = ($149|0)!=(0);
  21259. if (!($150)) {
  21260. HEAP32[$1>>2] = 12;
  21261. break;
  21262. }
  21263. $151 = HEAP32[$3>>2]|0;
  21264. $152 = (_strcmp($151,8987)|0);
  21265. $153 = ($152|0)!=(0);
  21266. if (!($153)) {
  21267. HEAP32[$1>>2] = 2;
  21268. break;
  21269. }
  21270. $154 = HEAP32[$3>>2]|0;
  21271. $155 = (_strcmp($154,9006)|0);
  21272. $156 = ($155|0)!=(0);
  21273. if (!($156)) {
  21274. HEAP32[$1>>2] = 1;
  21275. break;
  21276. }
  21277. $157 = HEAP32[$3>>2]|0;
  21278. $158 = (_strcmp($157,9018)|0);
  21279. $159 = ($158|0)!=(0);
  21280. if (!($159)) {
  21281. HEAP32[$1>>2] = 3;
  21282. break;
  21283. }
  21284. $160 = HEAP32[$3>>2]|0;
  21285. $161 = (_strcmp($160,9030)|0);
  21286. $162 = ($161|0)!=(0);
  21287. if (!($162)) {
  21288. HEAP32[$1>>2] = 1;
  21289. break;
  21290. }
  21291. $163 = HEAP32[$3>>2]|0;
  21292. $164 = (_strcmp($163,9042)|0);
  21293. $165 = ($164|0)!=(0);
  21294. if (!($165)) {
  21295. HEAP32[$1>>2] = 1;
  21296. break;
  21297. }
  21298. $166 = HEAP32[$3>>2]|0;
  21299. $167 = (_strcmp($166,9054)|0);
  21300. $168 = ($167|0)!=(0);
  21301. if (!($168)) {
  21302. HEAP32[$1>>2] = 17;
  21303. break;
  21304. }
  21305. $169 = HEAP32[$3>>2]|0;
  21306. $170 = (_strcmp($169,9066)|0);
  21307. $171 = ($170|0)!=(0);
  21308. if (!($171)) {
  21309. HEAP32[$1>>2] = 13;
  21310. break;
  21311. }
  21312. $172 = HEAP32[$3>>2]|0;
  21313. $173 = (_strcmp($172,9078)|0);
  21314. $174 = ($173|0)!=(0);
  21315. if (!($174)) {
  21316. HEAP32[$1>>2] = 4;
  21317. break;
  21318. }
  21319. $175 = HEAP32[$3>>2]|0;
  21320. $176 = (_strcmp($175,9090)|0);
  21321. $177 = ($176|0)!=(0);
  21322. if (!($177)) {
  21323. HEAP32[$1>>2] = 2;
  21324. break;
  21325. }
  21326. $178 = HEAP32[$3>>2]|0;
  21327. $179 = (_strcmp($178,9102)|0);
  21328. $180 = ($179|0)!=(0);
  21329. if (!($180)) {
  21330. HEAP32[$1>>2] = 14;
  21331. break;
  21332. }
  21333. $181 = HEAP32[$3>>2]|0;
  21334. $182 = (_strcmp($181,9115)|0);
  21335. $183 = ($182|0)!=(0);
  21336. if (!($183)) {
  21337. HEAP32[$1>>2] = 15;
  21338. break;
  21339. }
  21340. $184 = HEAP32[$3>>2]|0;
  21341. $185 = (_strcmp($184,9128)|0);
  21342. $186 = ($185|0)!=(0);
  21343. if (!($186)) {
  21344. HEAP32[$1>>2] = 16;
  21345. break;
  21346. }
  21347. $187 = HEAP32[$3>>2]|0;
  21348. $188 = (_strcmp($187,9141)|0);
  21349. $189 = ($188|0)!=(0);
  21350. if (!($189)) {
  21351. HEAP32[$1>>2] = 17;
  21352. break;
  21353. }
  21354. $190 = HEAP32[$3>>2]|0;
  21355. $191 = (_strcmp($190,9154)|0);
  21356. $192 = ($191|0)!=(0);
  21357. if (!($192)) {
  21358. HEAP32[$1>>2] = 18;
  21359. break;
  21360. }
  21361. $193 = HEAP32[$3>>2]|0;
  21362. $194 = (_strcmp($193,9167)|0);
  21363. $195 = ($194|0)!=(0);
  21364. if (!($195)) {
  21365. HEAP32[$1>>2] = 19;
  21366. break;
  21367. }
  21368. $196 = HEAP32[$3>>2]|0;
  21369. $197 = (_strcmp($196,9180)|0);
  21370. $198 = ($197|0)!=(0);
  21371. if (!($198)) {
  21372. HEAP32[$1>>2] = 20;
  21373. break;
  21374. }
  21375. $199 = HEAP32[$3>>2]|0;
  21376. $200 = (_strcmp($199,9193)|0);
  21377. $201 = ($200|0)!=(0);
  21378. if (!($201)) {
  21379. HEAP32[$1>>2] = 21;
  21380. break;
  21381. }
  21382. $202 = HEAP32[$3>>2]|0;
  21383. $203 = (_strcmp($202,9206)|0);
  21384. $204 = ($203|0)!=(0);
  21385. if (!($204)) {
  21386. HEAP32[$1>>2] = 5;
  21387. break;
  21388. }
  21389. $205 = HEAP32[$3>>2]|0;
  21390. $206 = (_strcmp($205,9225)|0);
  21391. $207 = ($206|0)!=(0);
  21392. if (!($207)) {
  21393. HEAP32[$1>>2] = 6;
  21394. break;
  21395. }
  21396. $208 = HEAP32[$3>>2]|0;
  21397. $209 = (_strcmp($208,9244)|0);
  21398. $210 = ($209|0)!=(0);
  21399. if (!($210)) {
  21400. HEAP32[$1>>2] = 7;
  21401. break;
  21402. }
  21403. $211 = HEAP32[$3>>2]|0;
  21404. $212 = (_strcmp($211,9263)|0);
  21405. $213 = ($212|0)!=(0);
  21406. if (!($213)) {
  21407. HEAP32[$1>>2] = 18;
  21408. break;
  21409. }
  21410. $214 = HEAP32[$3>>2]|0;
  21411. $215 = (_strcmp($214,9276)|0);
  21412. $216 = ($215|0)!=(0);
  21413. if (!($216)) {
  21414. HEAP32[$1>>2] = 19;
  21415. break;
  21416. }
  21417. $217 = HEAP32[$3>>2]|0;
  21418. $218 = (_strcmp($217,9294)|0);
  21419. $219 = ($218|0)!=(0);
  21420. if (!($219)) {
  21421. HEAP32[$1>>2] = 20;
  21422. break;
  21423. }
  21424. $220 = HEAP32[$3>>2]|0;
  21425. $221 = (_strcmp($220,9312)|0);
  21426. $222 = ($221|0)!=(0);
  21427. if (!($222)) {
  21428. HEAP32[$1>>2] = 21;
  21429. break;
  21430. }
  21431. $223 = HEAP32[$3>>2]|0;
  21432. $224 = (_strcmp($223,9330)|0);
  21433. $225 = ($224|0)!=(0);
  21434. if (!($225)) {
  21435. HEAP32[$1>>2] = 22;
  21436. break;
  21437. }
  21438. $226 = HEAP32[$3>>2]|0;
  21439. $227 = (_strcmp($226,9348)|0);
  21440. $228 = ($227|0)!=(0);
  21441. if (!($228)) {
  21442. HEAP32[$1>>2] = 2;
  21443. break;
  21444. }
  21445. $229 = HEAP32[$3>>2]|0;
  21446. $230 = (_strcmp($229,9368)|0);
  21447. $231 = ($230|0)!=(0);
  21448. if (!($231)) {
  21449. HEAP32[$1>>2] = 3;
  21450. break;
  21451. }
  21452. $232 = HEAP32[$3>>2]|0;
  21453. $233 = (_strcmp($232,8309)|0);
  21454. $234 = ($233|0)!=(0);
  21455. if (!($234)) {
  21456. HEAP32[$1>>2] = 7;
  21457. break;
  21458. }
  21459. $235 = HEAP32[$3>>2]|0;
  21460. $236 = (_strcmp($235,9386)|0);
  21461. $237 = ($236|0)!=(0);
  21462. if (!($237)) {
  21463. HEAP32[$1>>2] = 1;
  21464. break;
  21465. }
  21466. $238 = HEAP32[$3>>2]|0;
  21467. $239 = (_strcmp($238,9401)|0);
  21468. $240 = ($239|0)!=(0);
  21469. if (!($240)) {
  21470. HEAP32[$1>>2] = 8;
  21471. break;
  21472. }
  21473. $241 = HEAP32[$3>>2]|0;
  21474. $242 = (_strcmp($241,9422)|0);
  21475. $243 = ($242|0)!=(0);
  21476. if (!($243)) {
  21477. HEAP32[$1>>2] = 9;
  21478. break;
  21479. }
  21480. $244 = HEAP32[$3>>2]|0;
  21481. $245 = (_strcmp($244,9437)|0);
  21482. $246 = ($245|0)!=(0);
  21483. if (!($246)) {
  21484. HEAP32[$1>>2] = 10;
  21485. break;
  21486. }
  21487. $247 = HEAP32[$3>>2]|0;
  21488. $248 = (_strcmp($247,9455)|0);
  21489. $249 = ($248|0)!=(0);
  21490. if (!($249)) {
  21491. HEAP32[$1>>2] = 2;
  21492. break;
  21493. }
  21494. $250 = HEAP32[$3>>2]|0;
  21495. $251 = (_strcmp($250,9471)|0);
  21496. $252 = ($251|0)!=(0);
  21497. if (!($252)) {
  21498. HEAP32[$1>>2] = 11;
  21499. break;
  21500. }
  21501. $253 = HEAP32[$3>>2]|0;
  21502. $254 = (_strcmp($253,9490)|0);
  21503. $255 = ($254|0)!=(0);
  21504. if (!($255)) {
  21505. HEAP32[$1>>2] = 22;
  21506. break;
  21507. }
  21508. $256 = HEAP32[$3>>2]|0;
  21509. $257 = (_strcmp($256,9504)|0);
  21510. $258 = ($257|0)!=(0);
  21511. if (!($258)) {
  21512. HEAP32[$1>>2] = 23;
  21513. break;
  21514. }
  21515. $259 = HEAP32[$3>>2]|0;
  21516. $260 = (_strcmp($259,9519)|0);
  21517. $261 = ($260|0)!=(0);
  21518. if (!($261)) {
  21519. HEAP32[$1>>2] = 8;
  21520. break;
  21521. }
  21522. $262 = HEAP32[$3>>2]|0;
  21523. $263 = (_strcmp($262,8240)|0);
  21524. $264 = ($263|0)!=(0);
  21525. if (!($264)) {
  21526. HEAP32[$1>>2] = 1;
  21527. break;
  21528. }
  21529. $265 = HEAP32[$3>>2]|0;
  21530. $266 = (_strcmp($265,9530)|0);
  21531. $267 = ($266|0)!=(0);
  21532. if (!($267)) {
  21533. HEAP32[$1>>2] = 3;
  21534. break;
  21535. }
  21536. $268 = HEAP32[$3>>2]|0;
  21537. $269 = (_strcmp($268,8339)|0);
  21538. $270 = ($269|0)!=(0);
  21539. if (!($270)) {
  21540. HEAP32[$1>>2] = 23;
  21541. break;
  21542. }
  21543. $271 = HEAP32[$3>>2]|0;
  21544. $272 = (_strcmp($271,8369)|0);
  21545. $273 = ($272|0)!=(0);
  21546. if (!($273)) {
  21547. HEAP32[$1>>2] = 24;
  21548. break;
  21549. }
  21550. $274 = HEAP32[$3>>2]|0;
  21551. $275 = (_strcmp($274,9546)|0);
  21552. $276 = ($275|0)!=(0);
  21553. if (!($276)) {
  21554. HEAP32[$1>>2] = 12;
  21555. break;
  21556. }
  21557. $277 = HEAP32[$3>>2]|0;
  21558. $278 = (_strcmp($277,9573)|0);
  21559. $279 = ($278|0)!=(0);
  21560. if (!($279)) {
  21561. HEAP32[$1>>2] = 4;
  21562. break;
  21563. }
  21564. $280 = HEAP32[$3>>2]|0;
  21565. $281 = (_strcmp($280,9587)|0);
  21566. $282 = ($281|0)!=(0);
  21567. if (!($282)) {
  21568. HEAP32[$1>>2] = 13;
  21569. break;
  21570. }
  21571. $283 = HEAP32[$3>>2]|0;
  21572. $284 = (_strcmp($283,8275)|0);
  21573. $285 = ($284|0)!=(0);
  21574. if (!($285)) {
  21575. HEAP32[$1>>2] = 5;
  21576. break;
  21577. }
  21578. $286 = HEAP32[$3>>2]|0;
  21579. $287 = (_strcmp($286,9607)|0);
  21580. $288 = ($287|0)!=(0);
  21581. if (!($288)) {
  21582. HEAP32[$1>>2] = 6;
  21583. break;
  21584. }
  21585. $289 = HEAP32[$3>>2]|0;
  21586. $290 = (_strcmp($289,9625)|0);
  21587. $291 = ($290|0)!=(0);
  21588. if (!($291)) {
  21589. HEAP32[$1>>2] = 9;
  21590. break;
  21591. }
  21592. $292 = HEAP32[$3>>2]|0;
  21593. $293 = (_strcmp($292,9637)|0);
  21594. $294 = ($293|0)!=(0);
  21595. if (!($294)) {
  21596. HEAP32[$1>>2] = 24;
  21597. break;
  21598. }
  21599. $295 = HEAP32[$3>>2]|0;
  21600. $296 = (_strcmp($295,9658)|0);
  21601. $297 = ($296|0)!=(0);
  21602. if (!($297)) {
  21603. HEAP32[$1>>2] = 25;
  21604. break;
  21605. }
  21606. $298 = HEAP32[$3>>2]|0;
  21607. $299 = (_strcmp($298,9676)|0);
  21608. $300 = ($299|0)!=(0);
  21609. if (!($300)) {
  21610. HEAP32[$1>>2] = 26;
  21611. break;
  21612. }
  21613. $301 = HEAP32[$3>>2]|0;
  21614. $302 = (_strcmp($301,9694)|0);
  21615. $303 = ($302|0)!=(0);
  21616. if (!($303)) {
  21617. HEAP32[$1>>2] = 27;
  21618. break;
  21619. }
  21620. $304 = HEAP32[$3>>2]|0;
  21621. $305 = (_strcmp($304,9715)|0);
  21622. $306 = ($305|0)!=(0);
  21623. if (!($306)) {
  21624. HEAP32[$1>>2] = 14;
  21625. break;
  21626. }
  21627. $307 = HEAP32[$3>>2]|0;
  21628. $308 = (_strcmp($307,9741)|0);
  21629. $309 = ($308|0)!=(0);
  21630. if (!($309)) {
  21631. HEAP32[$1>>2] = 3;
  21632. break;
  21633. }
  21634. $310 = HEAP32[$3>>2]|0;
  21635. $311 = (_strcmp($310,9764)|0);
  21636. $312 = ($311|0)!=(0);
  21637. if (!($312)) {
  21638. HEAP32[$1>>2] = 15;
  21639. break;
  21640. }
  21641. $313 = HEAP32[$3>>2]|0;
  21642. $314 = (_strcmp($313,9802)|0);
  21643. $315 = ($314|0)!=(0);
  21644. if (!($315)) {
  21645. HEAP32[$1>>2] = 10;
  21646. break;
  21647. }
  21648. $316 = HEAP32[$3>>2]|0;
  21649. $317 = (_strcmp($316,9818)|0);
  21650. $318 = ($317|0)!=(0);
  21651. if (!($318)) {
  21652. HEAP32[$1>>2] = 7;
  21653. break;
  21654. }
  21655. $319 = HEAP32[$3>>2]|0;
  21656. $320 = (_strcmp($319,9833)|0);
  21657. $321 = ($320|0)!=(0);
  21658. if (!($321)) {
  21659. HEAP32[$1>>2] = 25;
  21660. break;
  21661. }
  21662. $322 = HEAP32[$3>>2]|0;
  21663. $323 = (_strcmp($322,9856)|0);
  21664. $324 = ($323|0)!=(0);
  21665. if (!($324)) {
  21666. HEAP32[$1>>2] = 16;
  21667. break;
  21668. }
  21669. $325 = HEAP32[$3>>2]|0;
  21670. $326 = (_strcmp($325,9869)|0);
  21671. $327 = ($326|0)!=(0);
  21672. if (!($327)) {
  21673. HEAP32[$1>>2] = 28;
  21674. break;
  21675. }
  21676. $328 = HEAP32[$3>>2]|0;
  21677. $329 = (_strcmp($328,9883)|0);
  21678. $330 = ($329|0)!=(0);
  21679. if (!($330)) {
  21680. HEAP32[$1>>2] = 29;
  21681. break;
  21682. }
  21683. $331 = HEAP32[$3>>2]|0;
  21684. $332 = (_strcmp($331,9897)|0);
  21685. $333 = ($332|0)!=(0);
  21686. if (!($333)) {
  21687. HEAP32[$1>>2] = 1;
  21688. break;
  21689. }
  21690. $334 = HEAP32[$3>>2]|0;
  21691. $335 = (_strcmp($334,9917)|0);
  21692. $336 = ($335|0)!=(0);
  21693. if (!($336)) {
  21694. HEAP32[$1>>2] = 8;
  21695. break;
  21696. }
  21697. $337 = HEAP32[$3>>2]|0;
  21698. $338 = (_strcmp($337,9937)|0);
  21699. $339 = ($338|0)!=(0);
  21700. if (!($339)) {
  21701. HEAP32[$1>>2] = 17;
  21702. break;
  21703. }
  21704. $340 = HEAP32[$3>>2]|0;
  21705. $341 = (_strcmp($340,9953)|0);
  21706. $342 = ($341|0)!=(0);
  21707. if (!($342)) {
  21708. HEAP32[$1>>2] = 18;
  21709. break;
  21710. }
  21711. $343 = HEAP32[$3>>2]|0;
  21712. $344 = (_strcmp($343,9971)|0);
  21713. $345 = ($344|0)!=(0);
  21714. if (!($345)) {
  21715. HEAP32[$1>>2] = 26;
  21716. break;
  21717. }
  21718. $346 = HEAP32[$3>>2]|0;
  21719. $347 = (_strcmp($346,9987)|0);
  21720. $348 = ($347|0)!=(0);
  21721. if (!($348)) {
  21722. HEAP32[$1>>2] = 19;
  21723. break;
  21724. }
  21725. $349 = HEAP32[$3>>2]|0;
  21726. $350 = (_strcmp($349,10002)|0);
  21727. $351 = ($350|0)!=(0);
  21728. if (!($351)) {
  21729. HEAP32[$1>>2] = 9;
  21730. break;
  21731. }
  21732. $352 = HEAP32[$3>>2]|0;
  21733. $353 = (_strcmp($352,10024)|0);
  21734. $354 = ($353|0)!=(0);
  21735. if (!($354)) {
  21736. HEAP32[$1>>2] = 30;
  21737. break;
  21738. }
  21739. $355 = HEAP32[$3>>2]|0;
  21740. $356 = (_strcmp($355,10042)|0);
  21741. $357 = ($356|0)!=(0);
  21742. if (!($357)) {
  21743. HEAP32[$1>>2] = 31;
  21744. break;
  21745. }
  21746. $358 = HEAP32[$3>>2]|0;
  21747. $359 = (_strcmp($358,10063)|0);
  21748. $360 = ($359|0)!=(0);
  21749. if (!($360)) {
  21750. HEAP32[$1>>2] = 10;
  21751. break;
  21752. }
  21753. $361 = HEAP32[$3>>2]|0;
  21754. $362 = (_strcmp($361,10081)|0);
  21755. $363 = ($362|0)!=(0);
  21756. if (!($363)) {
  21757. HEAP32[$1>>2] = 11;
  21758. break;
  21759. }
  21760. $364 = HEAP32[$3>>2]|0;
  21761. $365 = (_strcmp($364,10094)|0);
  21762. $366 = ($365|0)!=(0);
  21763. if (!($366)) {
  21764. HEAP32[$1>>2] = 2;
  21765. break;
  21766. }
  21767. $367 = HEAP32[$3>>2]|0;
  21768. $368 = (_strcmp($367,10109)|0);
  21769. $369 = ($368|0)!=(0);
  21770. if (!($369)) {
  21771. HEAP32[$1>>2] = 12;
  21772. break;
  21773. }
  21774. $370 = HEAP32[$3>>2]|0;
  21775. $371 = (_strcmp($370,10123)|0);
  21776. $372 = ($371|0)!=(0);
  21777. if (!($372)) {
  21778. HEAP32[$1>>2] = 1;
  21779. break;
  21780. }
  21781. $373 = HEAP32[$3>>2]|0;
  21782. $374 = (_strcmp($373,10133)|0);
  21783. $375 = ($374|0)!=(0);
  21784. if (!($375)) {
  21785. HEAP32[$1>>2] = 1;
  21786. break;
  21787. }
  21788. $376 = HEAP32[$3>>2]|0;
  21789. $377 = (_strcmp($376,10143)|0);
  21790. $378 = ($377|0)!=(0);
  21791. if (!($378)) {
  21792. HEAP32[$1>>2] = 2;
  21793. break;
  21794. }
  21795. $379 = HEAP32[$3>>2]|0;
  21796. $380 = (_strcmp($379,10165)|0);
  21797. $381 = ($380|0)!=(0);
  21798. if (!($381)) {
  21799. HEAP32[$1>>2] = 13;
  21800. break;
  21801. }
  21802. $382 = HEAP32[$3>>2]|0;
  21803. $383 = (_strcmp($382,10191)|0);
  21804. $384 = ($383|0)!=(0);
  21805. if (!($384)) {
  21806. HEAP32[$1>>2] = 14;
  21807. break;
  21808. }
  21809. $385 = HEAP32[$3>>2]|0;
  21810. $386 = (_strcmp($385,10218)|0);
  21811. $387 = ($386|0)!=(0);
  21812. if (!($387)) {
  21813. HEAP32[$1>>2] = 27;
  21814. break;
  21815. }
  21816. $388 = HEAP32[$3>>2]|0;
  21817. $389 = (_strcmp($388,10231)|0);
  21818. $390 = ($389|0)!=(0);
  21819. if (!($390)) {
  21820. HEAP32[$1>>2] = 20;
  21821. break;
  21822. }
  21823. $391 = HEAP32[$3>>2]|0;
  21824. $392 = (_strcmp($391,10246)|0);
  21825. $393 = ($392|0)!=(0);
  21826. if (!($393)) {
  21827. HEAP32[$1>>2] = 4;
  21828. break;
  21829. }
  21830. $394 = HEAP32[$3>>2]|0;
  21831. $395 = (_strcmp($394,10261)|0);
  21832. $396 = ($395|0)!=(0);
  21833. if (!($396)) {
  21834. HEAP32[$1>>2] = 3;
  21835. break;
  21836. }
  21837. $397 = HEAP32[$3>>2]|0;
  21838. $398 = (_strcmp($397,10285)|0);
  21839. $399 = ($398|0)!=(0);
  21840. if (!($399)) {
  21841. HEAP32[$1>>2] = 2;
  21842. break;
  21843. }
  21844. $400 = HEAP32[$3>>2]|0;
  21845. $401 = (_strcmp($400,10296)|0);
  21846. $402 = ($401|0)!=(0);
  21847. if (!($402)) {
  21848. HEAP32[$1>>2] = 32;
  21849. break;
  21850. }
  21851. $403 = HEAP32[$3>>2]|0;
  21852. $404 = (_strcmp($403,10318)|0);
  21853. $405 = ($404|0)!=(0);
  21854. if (!($405)) {
  21855. HEAP32[$1>>2] = 21;
  21856. break;
  21857. }
  21858. $406 = HEAP32[$3>>2]|0;
  21859. $407 = (_strcmp($406,10340)|0);
  21860. $408 = ($407|0)!=(0);
  21861. if (!($408)) {
  21862. HEAP32[$1>>2] = 5;
  21863. break;
  21864. }
  21865. $409 = HEAP32[$3>>2]|0;
  21866. $410 = (_strcmp($409,10364)|0);
  21867. $411 = ($410|0)!=(0);
  21868. if (!($411)) {
  21869. HEAP32[$1>>2] = 4;
  21870. break;
  21871. }
  21872. $412 = HEAP32[$3>>2]|0;
  21873. $413 = (_strcmp($412,10373)|0);
  21874. $414 = ($413|0)!=(0);
  21875. if (!($414)) {
  21876. HEAP32[$1>>2] = 5;
  21877. break;
  21878. }
  21879. $415 = HEAP32[$3>>2]|0;
  21880. $416 = (_strcmp($415,10381)|0);
  21881. $417 = ($416|0)!=(0);
  21882. if (!($417)) {
  21883. HEAP32[$1>>2] = 1;
  21884. break;
  21885. }
  21886. $418 = HEAP32[$3>>2]|0;
  21887. $419 = (_strcmp($418,10394)|0);
  21888. $420 = ($419|0)!=(0);
  21889. if (!($420)) {
  21890. HEAP32[$1>>2] = 2;
  21891. break;
  21892. }
  21893. $421 = HEAP32[$3>>2]|0;
  21894. $422 = (_strcmp($421,10408)|0);
  21895. $423 = ($422|0)!=(0);
  21896. if (!($423)) {
  21897. HEAP32[$1>>2] = 15;
  21898. break;
  21899. }
  21900. $424 = HEAP32[$3>>2]|0;
  21901. $425 = (_strcmp($424,10420)|0);
  21902. $426 = ($425|0)!=(0);
  21903. if (!($426)) {
  21904. HEAP32[$1>>2] = 16;
  21905. break;
  21906. }
  21907. $427 = HEAP32[$3>>2]|0;
  21908. $428 = (_strcmp($427,10429)|0);
  21909. $429 = ($428|0)!=(0);
  21910. if (!($429)) {
  21911. HEAP32[$1>>2] = 17;
  21912. break;
  21913. }
  21914. $430 = HEAP32[$3>>2]|0;
  21915. $431 = (_strcmp($430,10439)|0);
  21916. $432 = ($431|0)!=(0);
  21917. if (!($432)) {
  21918. HEAP32[$1>>2] = 18;
  21919. break;
  21920. }
  21921. $433 = HEAP32[$3>>2]|0;
  21922. $434 = (_strcmp($433,10451)|0);
  21923. $435 = ($434|0)!=(0);
  21924. if (!($435)) {
  21925. HEAP32[$1>>2] = 19;
  21926. break;
  21927. }
  21928. $436 = HEAP32[$3>>2]|0;
  21929. $437 = (_strcmp($436,10462)|0);
  21930. $438 = ($437|0)!=(0);
  21931. if (!($438)) {
  21932. HEAP32[$1>>2] = 20;
  21933. break;
  21934. }
  21935. $439 = HEAP32[$3>>2]|0;
  21936. $440 = (_strcmp($439,10470)|0);
  21937. $441 = ($440|0)!=(0);
  21938. if (!($441)) {
  21939. HEAP32[$1>>2] = 3;
  21940. break;
  21941. }
  21942. $442 = HEAP32[$3>>2]|0;
  21943. $443 = (_strcmp($442,10482)|0);
  21944. $444 = ($443|0)!=(0);
  21945. if (!($444)) {
  21946. HEAP32[$1>>2] = 21;
  21947. break;
  21948. }
  21949. $445 = HEAP32[$3>>2]|0;
  21950. $446 = (_strcmp($445,10497)|0);
  21951. $447 = ($446|0)!=(0);
  21952. if (!($447)) {
  21953. HEAP32[$1>>2] = 22;
  21954. break;
  21955. }
  21956. $448 = HEAP32[$3>>2]|0;
  21957. $449 = (_strcmp($448,10509)|0);
  21958. $450 = ($449|0)!=(0);
  21959. if (!($450)) {
  21960. HEAP32[$1>>2] = 23;
  21961. break;
  21962. }
  21963. $451 = HEAP32[$3>>2]|0;
  21964. $452 = (_strcmp($451,10523)|0);
  21965. $453 = ($452|0)!=(0);
  21966. if (!($453)) {
  21967. HEAP32[$1>>2] = 11;
  21968. break;
  21969. }
  21970. $454 = HEAP32[$3>>2]|0;
  21971. $455 = (_strcmp($454,10548)|0);
  21972. $456 = ($455|0)!=(0);
  21973. if (!($456)) {
  21974. HEAP32[$1>>2] = 24;
  21975. break;
  21976. }
  21977. $457 = HEAP32[$3>>2]|0;
  21978. $458 = (_strcmp($457,10565)|0);
  21979. $459 = ($458|0)!=(0);
  21980. if (!($459)) {
  21981. HEAP32[$1>>2] = 25;
  21982. break;
  21983. }
  21984. $460 = HEAP32[$3>>2]|0;
  21985. $461 = (_strcmp($460,10581)|0);
  21986. $462 = ($461|0)!=(0);
  21987. if (!($462)) {
  21988. HEAP32[$1>>2] = 26;
  21989. break;
  21990. }
  21991. $463 = HEAP32[$3>>2]|0;
  21992. $464 = (_strcmp($463,10597)|0);
  21993. $465 = ($464|0)!=(0);
  21994. if (!($465)) {
  21995. HEAP32[$1>>2] = 12;
  21996. break;
  21997. }
  21998. $466 = HEAP32[$3>>2]|0;
  21999. $467 = (_strcmp($466,10609)|0);
  22000. $468 = ($467|0)!=(0);
  22001. if (!($468)) {
  22002. HEAP32[$1>>2] = 33;
  22003. break;
  22004. }
  22005. $469 = HEAP32[$3>>2]|0;
  22006. $470 = (_strcmp($469,10621)|0);
  22007. $471 = ($470|0)!=(0);
  22008. if (!($471)) {
  22009. HEAP32[$1>>2] = 34;
  22010. break;
  22011. }
  22012. $472 = HEAP32[$3>>2]|0;
  22013. $473 = (_strcmp($472,10645)|0);
  22014. $474 = ($473|0)!=(0);
  22015. if (!($474)) {
  22016. HEAP32[$1>>2] = 1;
  22017. break;
  22018. }
  22019. $475 = HEAP32[$3>>2]|0;
  22020. $476 = (_strcmp($475,10658)|0);
  22021. $477 = ($476|0)!=(0);
  22022. if (!($477)) {
  22023. HEAP32[$1>>2] = 2;
  22024. break;
  22025. }
  22026. $478 = HEAP32[$3>>2]|0;
  22027. $479 = (_strcmp($478,10672)|0);
  22028. $480 = ($479|0)!=(0);
  22029. if (!($480)) {
  22030. HEAP32[$1>>2] = 35;
  22031. break;
  22032. }
  22033. $481 = HEAP32[$3>>2]|0;
  22034. $482 = (_strcmp($481,10694)|0);
  22035. $483 = ($482|0)!=(0);
  22036. if (!($483)) {
  22037. HEAP32[$1>>2] = 36;
  22038. break;
  22039. }
  22040. $484 = HEAP32[$3>>2]|0;
  22041. $485 = (_strcmp($484,10701)|0);
  22042. $486 = ($485|0)!=(0);
  22043. if (!($486)) {
  22044. HEAP32[$1>>2] = 3;
  22045. break;
  22046. }
  22047. $487 = HEAP32[$3>>2]|0;
  22048. $488 = (_strcmp($487,10717)|0);
  22049. $489 = ($488|0)!=(0);
  22050. if (!($489)) {
  22051. HEAP32[$1>>2] = 2;
  22052. break;
  22053. }
  22054. $490 = HEAP32[$3>>2]|0;
  22055. $491 = (_strcmp($490,10734)|0);
  22056. $492 = ($491|0)!=(0);
  22057. if (!($492)) {
  22058. HEAP32[$1>>2] = 1;
  22059. break;
  22060. }
  22061. $493 = HEAP32[$3>>2]|0;
  22062. $494 = (_strcmp($493,10751)|0);
  22063. $495 = ($494|0)!=(0);
  22064. if (!($495)) {
  22065. HEAP32[$1>>2] = 28;
  22066. break;
  22067. }
  22068. $496 = HEAP32[$3>>2]|0;
  22069. $497 = (_strcmp($496,10767)|0);
  22070. $498 = ($497|0)!=(0);
  22071. if (!($498)) {
  22072. HEAP32[$1>>2] = 1;
  22073. break;
  22074. }
  22075. $499 = HEAP32[$3>>2]|0;
  22076. $500 = (_strcmp($499,10783)|0);
  22077. $501 = ($500|0)!=(0);
  22078. if (!($501)) {
  22079. HEAP32[$1>>2] = 4;
  22080. break;
  22081. }
  22082. $502 = HEAP32[$3>>2]|0;
  22083. $503 = (_strcmp($502,10800)|0);
  22084. $504 = ($503|0)!=(0);
  22085. if (!($504)) {
  22086. HEAP32[$1>>2] = 29;
  22087. break;
  22088. }
  22089. $505 = HEAP32[$3>>2]|0;
  22090. $506 = (_strcmp($505,10814)|0);
  22091. $507 = ($506|0)!=(0);
  22092. if (!($507)) {
  22093. HEAP32[$1>>2] = 30;
  22094. break;
  22095. }
  22096. $508 = HEAP32[$3>>2]|0;
  22097. $509 = (_strcmp($508,10826)|0);
  22098. $510 = ($509|0)!=(0);
  22099. if (!($510)) {
  22100. HEAP32[$1>>2] = 22;
  22101. break;
  22102. }
  22103. $511 = HEAP32[$3>>2]|0;
  22104. $512 = (_strcmp($511,10837)|0);
  22105. $513 = ($512|0)!=(0);
  22106. if (!($513)) {
  22107. HEAP32[$1>>2] = 2;
  22108. break;
  22109. }
  22110. $514 = HEAP32[$3>>2]|0;
  22111. $515 = (_strcmp($514,10850)|0);
  22112. $516 = ($515|0)!=(0);
  22113. if (!($516)) {
  22114. HEAP32[$1>>2] = 23;
  22115. break;
  22116. }
  22117. $517 = HEAP32[$3>>2]|0;
  22118. $518 = (_strcmp($517,10860)|0);
  22119. $519 = ($518|0)!=(0);
  22120. if (!($519)) {
  22121. HEAP32[$1>>2] = 2;
  22122. break;
  22123. }
  22124. $520 = HEAP32[$3>>2]|0;
  22125. $521 = (_strcmp($520,10877)|0);
  22126. $522 = ($521|0)!=(0);
  22127. if (!($522)) {
  22128. HEAP32[$1>>2] = 24;
  22129. break;
  22130. }
  22131. $523 = HEAP32[$3>>2]|0;
  22132. $524 = (_strcmp($523,10889)|0);
  22133. $525 = ($524|0)!=(0);
  22134. if (!($525)) {
  22135. HEAP32[$1>>2] = 25;
  22136. break;
  22137. }
  22138. $526 = HEAP32[$3>>2]|0;
  22139. $527 = (_strcmp($526,10911)|0);
  22140. $528 = ($527|0)!=(0);
  22141. if (!($528)) {
  22142. HEAP32[$1>>2] = 26;
  22143. break;
  22144. }
  22145. $529 = HEAP32[$3>>2]|0;
  22146. $530 = (_strcmp($529,10931)|0);
  22147. $531 = ($530|0)!=(0);
  22148. if (!($531)) {
  22149. HEAP32[$1>>2] = 3;
  22150. break;
  22151. }
  22152. $532 = HEAP32[$3>>2]|0;
  22153. $533 = (_strcmp($532,10944)|0);
  22154. $534 = ($533|0)!=(0);
  22155. if (!($534)) {
  22156. HEAP32[$1>>2] = 27;
  22157. break;
  22158. }
  22159. $535 = HEAP32[$3>>2]|0;
  22160. $536 = (_strcmp($535,10966)|0);
  22161. $537 = ($536|0)!=(0);
  22162. if (!($537)) {
  22163. HEAP32[$1>>2] = 28;
  22164. break;
  22165. }
  22166. $538 = HEAP32[$3>>2]|0;
  22167. $539 = (_strcmp($538,10986)|0);
  22168. $540 = ($539|0)!=(0);
  22169. if (!($540)) {
  22170. HEAP32[$1>>2] = 2;
  22171. break;
  22172. }
  22173. $541 = HEAP32[$3>>2]|0;
  22174. $542 = (_strcmp($541,11003)|0);
  22175. $543 = ($542|0)!=(0);
  22176. if (!($543)) {
  22177. HEAP32[$1>>2] = 2;
  22178. break;
  22179. }
  22180. $544 = HEAP32[$3>>2]|0;
  22181. $545 = (_strcmp($544,11020)|0);
  22182. $546 = ($545|0)!=(0);
  22183. if (!($546)) {
  22184. HEAP32[$1>>2] = 3;
  22185. break;
  22186. }
  22187. $547 = HEAP32[$3>>2]|0;
  22188. $548 = (_strcmp($547,11040)|0);
  22189. $549 = ($548|0)!=(0);
  22190. if ($549) {
  22191. $550 = HEAP32[$2>>2]|0;
  22192. $551 = HEAP32[$3>>2]|0;
  22193. $552 = _emscripten_asm_const_iii(0, ($550|0), ($551|0))|0;
  22194. HEAP32[$1>>2] = 0;
  22195. break;
  22196. } else {
  22197. HEAP32[$1>>2] = 37;
  22198. break;
  22199. }
  22200. } else {
  22201. HEAP32[$1>>2] = 5;
  22202. }
  22203. } while(0);
  22204. $553 = HEAP32[$1>>2]|0;
  22205. STACKTOP = sp;return ($553|0);
  22206. }
  22207. function _emscripten_get_global_libc() {
  22208. var label = 0, sp = 0;
  22209. sp = STACKTOP;
  22210. return (33232|0);
  22211. }
  22212. function ___emscripten_pthread_data_constructor() {
  22213. var $0 = 0, $1 = 0, label = 0, sp = 0;
  22214. sp = STACKTOP;
  22215. $0 = (_pthread_self()|0);
  22216. $1 = ((($0)) + 188|0);
  22217. HEAP32[$1>>2] = (33272);
  22218. return;
  22219. }
  22220. function ___stdio_close($0) {
  22221. $0 = $0|0;
  22222. var $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $vararg_buffer = 0, label = 0, sp = 0;
  22223. sp = STACKTOP;
  22224. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  22225. $vararg_buffer = sp;
  22226. $1 = ((($0)) + 60|0);
  22227. $2 = HEAP32[$1>>2]|0;
  22228. $3 = (_dummy_736($2)|0);
  22229. HEAP32[$vararg_buffer>>2] = $3;
  22230. $4 = (___syscall6(6,($vararg_buffer|0))|0);
  22231. $5 = (___syscall_ret($4)|0);
  22232. STACKTOP = sp;return ($5|0);
  22233. }
  22234. function ___stdio_write($0,$1,$2) {
  22235. $0 = $0|0;
  22236. $1 = $1|0;
  22237. $2 = $2|0;
  22238. var $$0 = 0, $$04756 = 0, $$04855 = 0, $$04954 = 0, $$051 = 0, $$1 = 0, $$150 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0;
  22239. var $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0;
  22240. var $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $vararg_buffer = 0, $vararg_buffer3 = 0, $vararg_ptr1 = 0, $vararg_ptr2 = 0, $vararg_ptr6 = 0;
  22241. var $vararg_ptr7 = 0, label = 0, sp = 0;
  22242. sp = STACKTOP;
  22243. STACKTOP = STACKTOP + 48|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(48|0);
  22244. $vararg_buffer3 = sp + 16|0;
  22245. $vararg_buffer = sp;
  22246. $3 = sp + 32|0;
  22247. $4 = ((($0)) + 28|0);
  22248. $5 = HEAP32[$4>>2]|0;
  22249. HEAP32[$3>>2] = $5;
  22250. $6 = ((($3)) + 4|0);
  22251. $7 = ((($0)) + 20|0);
  22252. $8 = HEAP32[$7>>2]|0;
  22253. $9 = (($8) - ($5))|0;
  22254. HEAP32[$6>>2] = $9;
  22255. $10 = ((($3)) + 8|0);
  22256. HEAP32[$10>>2] = $1;
  22257. $11 = ((($3)) + 12|0);
  22258. HEAP32[$11>>2] = $2;
  22259. $12 = (($9) + ($2))|0;
  22260. $13 = ((($0)) + 60|0);
  22261. $14 = HEAP32[$13>>2]|0;
  22262. $15 = $3;
  22263. HEAP32[$vararg_buffer>>2] = $14;
  22264. $vararg_ptr1 = ((($vararg_buffer)) + 4|0);
  22265. HEAP32[$vararg_ptr1>>2] = $15;
  22266. $vararg_ptr2 = ((($vararg_buffer)) + 8|0);
  22267. HEAP32[$vararg_ptr2>>2] = 2;
  22268. $16 = (___syscall146(146,($vararg_buffer|0))|0);
  22269. $17 = (___syscall_ret($16)|0);
  22270. $18 = ($12|0)==($17|0);
  22271. L1: do {
  22272. if ($18) {
  22273. label = 3;
  22274. } else {
  22275. $$04756 = 2;$$04855 = $12;$$04954 = $3;$26 = $17;
  22276. while(1) {
  22277. $25 = ($26|0)<(0);
  22278. if ($25) {
  22279. break;
  22280. }
  22281. $34 = (($$04855) - ($26))|0;
  22282. $35 = ((($$04954)) + 4|0);
  22283. $36 = HEAP32[$35>>2]|0;
  22284. $37 = ($26>>>0)>($36>>>0);
  22285. $38 = ((($$04954)) + 8|0);
  22286. $$150 = $37 ? $38 : $$04954;
  22287. $39 = $37 << 31 >> 31;
  22288. $$1 = (($39) + ($$04756))|0;
  22289. $40 = $37 ? $36 : 0;
  22290. $$0 = (($26) - ($40))|0;
  22291. $41 = HEAP32[$$150>>2]|0;
  22292. $42 = (($41) + ($$0)|0);
  22293. HEAP32[$$150>>2] = $42;
  22294. $43 = ((($$150)) + 4|0);
  22295. $44 = HEAP32[$43>>2]|0;
  22296. $45 = (($44) - ($$0))|0;
  22297. HEAP32[$43>>2] = $45;
  22298. $46 = HEAP32[$13>>2]|0;
  22299. $47 = $$150;
  22300. HEAP32[$vararg_buffer3>>2] = $46;
  22301. $vararg_ptr6 = ((($vararg_buffer3)) + 4|0);
  22302. HEAP32[$vararg_ptr6>>2] = $47;
  22303. $vararg_ptr7 = ((($vararg_buffer3)) + 8|0);
  22304. HEAP32[$vararg_ptr7>>2] = $$1;
  22305. $48 = (___syscall146(146,($vararg_buffer3|0))|0);
  22306. $49 = (___syscall_ret($48)|0);
  22307. $50 = ($34|0)==($49|0);
  22308. if ($50) {
  22309. label = 3;
  22310. break L1;
  22311. } else {
  22312. $$04756 = $$1;$$04855 = $34;$$04954 = $$150;$26 = $49;
  22313. }
  22314. }
  22315. $27 = ((($0)) + 16|0);
  22316. HEAP32[$27>>2] = 0;
  22317. HEAP32[$4>>2] = 0;
  22318. HEAP32[$7>>2] = 0;
  22319. $28 = HEAP32[$0>>2]|0;
  22320. $29 = $28 | 32;
  22321. HEAP32[$0>>2] = $29;
  22322. $30 = ($$04756|0)==(2);
  22323. if ($30) {
  22324. $$051 = 0;
  22325. } else {
  22326. $31 = ((($$04954)) + 4|0);
  22327. $32 = HEAP32[$31>>2]|0;
  22328. $33 = (($2) - ($32))|0;
  22329. $$051 = $33;
  22330. }
  22331. }
  22332. } while(0);
  22333. if ((label|0) == 3) {
  22334. $19 = ((($0)) + 44|0);
  22335. $20 = HEAP32[$19>>2]|0;
  22336. $21 = ((($0)) + 48|0);
  22337. $22 = HEAP32[$21>>2]|0;
  22338. $23 = (($20) + ($22)|0);
  22339. $24 = ((($0)) + 16|0);
  22340. HEAP32[$24>>2] = $23;
  22341. HEAP32[$4>>2] = $20;
  22342. HEAP32[$7>>2] = $20;
  22343. $$051 = $2;
  22344. }
  22345. STACKTOP = sp;return ($$051|0);
  22346. }
  22347. function ___stdio_seek($0,$1,$2) {
  22348. $0 = $0|0;
  22349. $1 = $1|0;
  22350. $2 = $2|0;
  22351. var $$pre = 0, $10 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $vararg_buffer = 0, $vararg_ptr1 = 0, $vararg_ptr2 = 0, $vararg_ptr3 = 0, $vararg_ptr4 = 0, label = 0, sp = 0;
  22352. sp = STACKTOP;
  22353. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  22354. $vararg_buffer = sp;
  22355. $3 = sp + 20|0;
  22356. $4 = ((($0)) + 60|0);
  22357. $5 = HEAP32[$4>>2]|0;
  22358. $6 = $3;
  22359. HEAP32[$vararg_buffer>>2] = $5;
  22360. $vararg_ptr1 = ((($vararg_buffer)) + 4|0);
  22361. HEAP32[$vararg_ptr1>>2] = 0;
  22362. $vararg_ptr2 = ((($vararg_buffer)) + 8|0);
  22363. HEAP32[$vararg_ptr2>>2] = $1;
  22364. $vararg_ptr3 = ((($vararg_buffer)) + 12|0);
  22365. HEAP32[$vararg_ptr3>>2] = $6;
  22366. $vararg_ptr4 = ((($vararg_buffer)) + 16|0);
  22367. HEAP32[$vararg_ptr4>>2] = $2;
  22368. $7 = (___syscall140(140,($vararg_buffer|0))|0);
  22369. $8 = (___syscall_ret($7)|0);
  22370. $9 = ($8|0)<(0);
  22371. if ($9) {
  22372. HEAP32[$3>>2] = -1;
  22373. $10 = -1;
  22374. } else {
  22375. $$pre = HEAP32[$3>>2]|0;
  22376. $10 = $$pre;
  22377. }
  22378. STACKTOP = sp;return ($10|0);
  22379. }
  22380. function ___syscall_ret($0) {
  22381. $0 = $0|0;
  22382. var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, label = 0, sp = 0;
  22383. sp = STACKTOP;
  22384. $1 = ($0>>>0)>(4294963200);
  22385. if ($1) {
  22386. $2 = (0 - ($0))|0;
  22387. $3 = (___errno_location()|0);
  22388. HEAP32[$3>>2] = $2;
  22389. $$0 = -1;
  22390. } else {
  22391. $$0 = $0;
  22392. }
  22393. return ($$0|0);
  22394. }
  22395. function ___errno_location() {
  22396. var $0 = 0, $1 = 0, label = 0, sp = 0;
  22397. sp = STACKTOP;
  22398. $0 = (___pthread_self_108()|0);
  22399. $1 = ((($0)) + 64|0);
  22400. return ($1|0);
  22401. }
  22402. function ___pthread_self_108() {
  22403. var $0 = 0, label = 0, sp = 0;
  22404. sp = STACKTOP;
  22405. $0 = (_pthread_self()|0);
  22406. return ($0|0);
  22407. }
  22408. function _dummy_736($0) {
  22409. $0 = $0|0;
  22410. var label = 0, sp = 0;
  22411. sp = STACKTOP;
  22412. return ($0|0);
  22413. }
  22414. function ___stdout_write($0,$1,$2) {
  22415. $0 = $0|0;
  22416. $1 = $1|0;
  22417. $2 = $2|0;
  22418. var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $vararg_buffer = 0, $vararg_ptr1 = 0, $vararg_ptr2 = 0, label = 0, sp = 0;
  22419. sp = STACKTOP;
  22420. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  22421. $vararg_buffer = sp;
  22422. $3 = sp + 16|0;
  22423. $4 = ((($0)) + 36|0);
  22424. HEAP32[$4>>2] = 9;
  22425. $5 = HEAP32[$0>>2]|0;
  22426. $6 = $5 & 64;
  22427. $7 = ($6|0)==(0);
  22428. if ($7) {
  22429. $8 = ((($0)) + 60|0);
  22430. $9 = HEAP32[$8>>2]|0;
  22431. $10 = $3;
  22432. HEAP32[$vararg_buffer>>2] = $9;
  22433. $vararg_ptr1 = ((($vararg_buffer)) + 4|0);
  22434. HEAP32[$vararg_ptr1>>2] = 21523;
  22435. $vararg_ptr2 = ((($vararg_buffer)) + 8|0);
  22436. HEAP32[$vararg_ptr2>>2] = $10;
  22437. $11 = (___syscall54(54,($vararg_buffer|0))|0);
  22438. $12 = ($11|0)==(0);
  22439. if (!($12)) {
  22440. $13 = ((($0)) + 75|0);
  22441. HEAP8[$13>>0] = -1;
  22442. }
  22443. }
  22444. $14 = (___stdio_write($0,$1,$2)|0);
  22445. STACKTOP = sp;return ($14|0);
  22446. }
  22447. function _strcmp($0,$1) {
  22448. $0 = $0|0;
  22449. $1 = $1|0;
  22450. var $$011 = 0, $$0710 = 0, $$lcssa = 0, $$lcssa8 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, $or$cond9 = 0, label = 0;
  22451. var sp = 0;
  22452. sp = STACKTOP;
  22453. $2 = HEAP8[$0>>0]|0;
  22454. $3 = HEAP8[$1>>0]|0;
  22455. $4 = ($2<<24>>24)!=($3<<24>>24);
  22456. $5 = ($2<<24>>24)==(0);
  22457. $or$cond9 = $5 | $4;
  22458. if ($or$cond9) {
  22459. $$lcssa = $3;$$lcssa8 = $2;
  22460. } else {
  22461. $$011 = $1;$$0710 = $0;
  22462. while(1) {
  22463. $6 = ((($$0710)) + 1|0);
  22464. $7 = ((($$011)) + 1|0);
  22465. $8 = HEAP8[$6>>0]|0;
  22466. $9 = HEAP8[$7>>0]|0;
  22467. $10 = ($8<<24>>24)!=($9<<24>>24);
  22468. $11 = ($8<<24>>24)==(0);
  22469. $or$cond = $11 | $10;
  22470. if ($or$cond) {
  22471. $$lcssa = $9;$$lcssa8 = $8;
  22472. break;
  22473. } else {
  22474. $$011 = $7;$$0710 = $6;
  22475. }
  22476. }
  22477. }
  22478. $12 = $$lcssa8&255;
  22479. $13 = $$lcssa&255;
  22480. $14 = (($12) - ($13))|0;
  22481. return ($14|0);
  22482. }
  22483. function _memcmp($0,$1,$2) {
  22484. $0 = $0|0;
  22485. $1 = $1|0;
  22486. $2 = $2|0;
  22487. var $$01318 = 0, $$01417 = 0, $$019 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  22488. sp = STACKTOP;
  22489. $3 = ($2|0)==(0);
  22490. L1: do {
  22491. if ($3) {
  22492. $14 = 0;
  22493. } else {
  22494. $$01318 = $0;$$01417 = $2;$$019 = $1;
  22495. while(1) {
  22496. $4 = HEAP8[$$01318>>0]|0;
  22497. $5 = HEAP8[$$019>>0]|0;
  22498. $6 = ($4<<24>>24)==($5<<24>>24);
  22499. if (!($6)) {
  22500. break;
  22501. }
  22502. $7 = (($$01417) + -1)|0;
  22503. $8 = ((($$01318)) + 1|0);
  22504. $9 = ((($$019)) + 1|0);
  22505. $10 = ($7|0)==(0);
  22506. if ($10) {
  22507. $14 = 0;
  22508. break L1;
  22509. } else {
  22510. $$01318 = $8;$$01417 = $7;$$019 = $9;
  22511. }
  22512. }
  22513. $11 = $4&255;
  22514. $12 = $5&255;
  22515. $13 = (($11) - ($12))|0;
  22516. $14 = $13;
  22517. }
  22518. } while(0);
  22519. return ($14|0);
  22520. }
  22521. function _vsprintf($0,$1,$2) {
  22522. $0 = $0|0;
  22523. $1 = $1|0;
  22524. $2 = $2|0;
  22525. var $3 = 0, label = 0, sp = 0;
  22526. sp = STACKTOP;
  22527. $3 = (_vsnprintf($0,2147483647,$1,$2)|0);
  22528. return ($3|0);
  22529. }
  22530. function _vsnprintf($0,$1,$2,$3) {
  22531. $0 = $0|0;
  22532. $1 = $1|0;
  22533. $2 = $2|0;
  22534. $3 = $3|0;
  22535. var $$$015 = 0, $$0 = 0, $$014 = 0, $$015 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0;
  22536. var $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  22537. sp = STACKTOP;
  22538. STACKTOP = STACKTOP + 128|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(128|0);
  22539. $4 = sp + 124|0;
  22540. $5 = sp;
  22541. dest=$5; src=3124; stop=dest+124|0; do { HEAP32[dest>>2]=HEAP32[src>>2]|0; dest=dest+4|0; src=src+4|0; } while ((dest|0) < (stop|0));
  22542. $6 = (($1) + -1)|0;
  22543. $7 = ($6>>>0)>(2147483646);
  22544. if ($7) {
  22545. $8 = ($1|0)==(0);
  22546. if ($8) {
  22547. $$014 = $4;$$015 = 1;
  22548. label = 4;
  22549. } else {
  22550. $9 = (___errno_location()|0);
  22551. HEAP32[$9>>2] = 75;
  22552. $$0 = -1;
  22553. }
  22554. } else {
  22555. $$014 = $0;$$015 = $1;
  22556. label = 4;
  22557. }
  22558. if ((label|0) == 4) {
  22559. $10 = $$014;
  22560. $11 = (-2 - ($10))|0;
  22561. $12 = ($$015>>>0)>($11>>>0);
  22562. $$$015 = $12 ? $11 : $$015;
  22563. $13 = ((($5)) + 48|0);
  22564. HEAP32[$13>>2] = $$$015;
  22565. $14 = ((($5)) + 20|0);
  22566. HEAP32[$14>>2] = $$014;
  22567. $15 = ((($5)) + 44|0);
  22568. HEAP32[$15>>2] = $$014;
  22569. $16 = (($$014) + ($$$015)|0);
  22570. $17 = ((($5)) + 16|0);
  22571. HEAP32[$17>>2] = $16;
  22572. $18 = ((($5)) + 28|0);
  22573. HEAP32[$18>>2] = $16;
  22574. $19 = (_vfprintf($5,$2,$3)|0);
  22575. $20 = ($$$015|0)==(0);
  22576. if ($20) {
  22577. $$0 = $19;
  22578. } else {
  22579. $21 = HEAP32[$14>>2]|0;
  22580. $22 = HEAP32[$17>>2]|0;
  22581. $23 = ($21|0)==($22|0);
  22582. $24 = $23 << 31 >> 31;
  22583. $25 = (($21) + ($24)|0);
  22584. HEAP8[$25>>0] = 0;
  22585. $$0 = $19;
  22586. }
  22587. }
  22588. STACKTOP = sp;return ($$0|0);
  22589. }
  22590. function _vfprintf($0,$1,$2) {
  22591. $0 = $0|0;
  22592. $1 = $1|0;
  22593. $2 = $2|0;
  22594. var $$ = 0, $$0 = 0, $$1 = 0, $$1$ = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0;
  22595. var $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $5 = 0, $6 = 0, $7 = 0;
  22596. var $8 = 0, $9 = 0, $vacopy_currentptr = 0, dest = 0, label = 0, sp = 0, stop = 0;
  22597. sp = STACKTOP;
  22598. STACKTOP = STACKTOP + 224|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(224|0);
  22599. $3 = sp + 120|0;
  22600. $4 = sp + 80|0;
  22601. $5 = sp;
  22602. $6 = sp + 136|0;
  22603. dest=$4; stop=dest+40|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  22604. $vacopy_currentptr = HEAP32[$2>>2]|0;
  22605. HEAP32[$3>>2] = $vacopy_currentptr;
  22606. $7 = (_printf_core(0,$1,$3,$5,$4)|0);
  22607. $8 = ($7|0)<(0);
  22608. if ($8) {
  22609. $$0 = -1;
  22610. } else {
  22611. $9 = ((($0)) + 76|0);
  22612. $10 = (Atomics_load(HEAP32,$9>>2)|0);
  22613. $11 = ($10|0)>(-1);
  22614. if ($11) {
  22615. $12 = (___lockfile($0)|0);
  22616. $40 = $12;
  22617. } else {
  22618. $40 = 0;
  22619. }
  22620. $13 = HEAP32[$0>>2]|0;
  22621. $14 = $13 & 32;
  22622. $15 = ((($0)) + 74|0);
  22623. $16 = HEAP8[$15>>0]|0;
  22624. $17 = ($16<<24>>24)<(1);
  22625. if ($17) {
  22626. $18 = $13 & -33;
  22627. HEAP32[$0>>2] = $18;
  22628. }
  22629. $19 = ((($0)) + 48|0);
  22630. $20 = HEAP32[$19>>2]|0;
  22631. $21 = ($20|0)==(0);
  22632. if ($21) {
  22633. $23 = ((($0)) + 44|0);
  22634. $24 = HEAP32[$23>>2]|0;
  22635. HEAP32[$23>>2] = $6;
  22636. $25 = ((($0)) + 28|0);
  22637. HEAP32[$25>>2] = $6;
  22638. $26 = ((($0)) + 20|0);
  22639. HEAP32[$26>>2] = $6;
  22640. HEAP32[$19>>2] = 80;
  22641. $27 = ((($6)) + 80|0);
  22642. $28 = ((($0)) + 16|0);
  22643. HEAP32[$28>>2] = $27;
  22644. $29 = (_printf_core($0,$1,$3,$5,$4)|0);
  22645. $30 = ($24|0)==(0|0);
  22646. if ($30) {
  22647. $$1 = $29;
  22648. } else {
  22649. $31 = ((($0)) + 36|0);
  22650. $32 = HEAP32[$31>>2]|0;
  22651. (FUNCTION_TABLE_iiii[$32 & 15]($0,0,0)|0);
  22652. $33 = HEAP32[$26>>2]|0;
  22653. $34 = ($33|0)==(0|0);
  22654. $$ = $34 ? -1 : $29;
  22655. HEAP32[$23>>2] = $24;
  22656. HEAP32[$19>>2] = 0;
  22657. HEAP32[$28>>2] = 0;
  22658. HEAP32[$25>>2] = 0;
  22659. HEAP32[$26>>2] = 0;
  22660. $$1 = $$;
  22661. }
  22662. } else {
  22663. $22 = (_printf_core($0,$1,$3,$5,$4)|0);
  22664. $$1 = $22;
  22665. }
  22666. $35 = HEAP32[$0>>2]|0;
  22667. $36 = $35 & 32;
  22668. $37 = ($36|0)==(0);
  22669. $$1$ = $37 ? $$1 : -1;
  22670. $38 = $35 | $14;
  22671. HEAP32[$0>>2] = $38;
  22672. $39 = ($40|0)==(0);
  22673. if (!($39)) {
  22674. ___unlockfile($0);
  22675. }
  22676. $$0 = $$1$;
  22677. }
  22678. STACKTOP = sp;return ($$0|0);
  22679. }
  22680. function _printf_core($0,$1,$2,$3,$4) {
  22681. $0 = $0|0;
  22682. $1 = $1|0;
  22683. $2 = $2|0;
  22684. $3 = $3|0;
  22685. $4 = $4|0;
  22686. var $$ = 0, $$$ = 0, $$$0259 = 0, $$$0262 = 0, $$$0269 = 0, $$$4266 = 0, $$$5 = 0, $$0 = 0, $$0228 = 0, $$0228$ = 0, $$0229322 = 0, $$0232 = 0, $$0235 = 0, $$0237 = 0, $$0240$lcssa = 0, $$0240$lcssa357 = 0, $$0240321 = 0, $$0243 = 0, $$0247 = 0, $$0249$lcssa = 0;
  22687. var $$0249306 = 0, $$0252 = 0, $$0253 = 0, $$0254 = 0, $$0254$$0254$ = 0, $$0259 = 0, $$0262$lcssa = 0, $$0262311 = 0, $$0269 = 0, $$0269$phi = 0, $$1 = 0, $$1230333 = 0, $$1233 = 0, $$1236 = 0, $$1238 = 0, $$1241332 = 0, $$1244320 = 0, $$1248 = 0, $$1250 = 0, $$1255 = 0;
  22688. var $$1260 = 0, $$1263 = 0, $$1263$ = 0, $$1270 = 0, $$2 = 0, $$2234 = 0, $$2239 = 0, $$2242305 = 0, $$2245 = 0, $$2251 = 0, $$2256 = 0, $$2256$ = 0, $$2256$$$2256 = 0, $$2261 = 0, $$2271 = 0, $$284$ = 0, $$289 = 0, $$290 = 0, $$3257 = 0, $$3265 = 0;
  22689. var $$3272 = 0, $$3303 = 0, $$377 = 0, $$4258355 = 0, $$4266 = 0, $$5 = 0, $$6268 = 0, $$lcssa295 = 0, $$pre = 0, $$pre346 = 0, $$pre347 = 0, $$pre347$pre = 0, $$pre349 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0;
  22690. var $106 = 0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0, $116 = 0, $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0;
  22691. var $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0, $133 = 0, $134 = 0, $135 = 0, $136 = 0, $137 = 0, $138 = 0, $139 = 0, $14 = 0, $140 = 0, $141 = 0;
  22692. var $142 = 0, $143 = 0, $144 = 0, $145 = 0, $146 = 0, $147 = 0, $148 = 0, $149 = 0, $15 = 0, $150 = 0, $151 = 0, $152 = 0, $153 = 0, $154 = 0, $155 = 0, $156 = 0, $157 = 0, $158 = 0, $159 = 0, $16 = 0;
  22693. var $160 = 0, $161 = 0, $162 = 0, $163 = 0, $164 = 0, $165 = 0, $166 = 0, $167 = 0, $168 = 0, $169 = 0, $17 = 0, $170 = 0, $171 = 0, $172 = 0, $173 = 0, $174 = 0, $175 = 0, $176 = 0, $177 = 0, $178 = 0;
  22694. var $179 = 0, $18 = 0, $180 = 0, $181 = 0, $182 = 0, $183 = 0, $184 = 0, $185 = 0, $186 = 0, $187 = 0, $188 = 0, $189 = 0, $19 = 0, $190 = 0, $191 = 0, $192 = 0, $193 = 0, $194 = 0, $195 = 0, $196 = 0;
  22695. var $197 = 0, $198 = 0, $199 = 0, $20 = 0, $200 = 0, $201 = 0, $202 = 0, $203 = 0, $204 = 0, $205 = 0, $206 = 0, $207 = 0, $208 = 0, $209 = 0, $21 = 0, $210 = 0, $211 = 0, $212 = 0, $213 = 0, $214 = 0;
  22696. var $215 = 0, $216 = 0, $217 = 0, $218 = 0, $219 = 0, $22 = 0, $220 = 0, $221 = 0, $222 = 0, $223 = 0, $224 = 0, $225 = 0, $226 = 0, $227 = 0, $228 = 0, $229 = 0, $23 = 0, $230 = 0, $231 = 0, $232 = 0;
  22697. var $233 = 0, $234 = 0, $235 = 0, $236 = 0, $237 = 0, $238 = 0, $239 = 0, $24 = 0, $240 = 0, $241 = 0, $242 = 0, $243 = 0, $244 = 0, $245 = 0, $246 = 0, $247 = 0, $248 = 0, $249 = 0, $25 = 0, $250 = 0;
  22698. var $251 = 0, $252 = 0, $253 = 0, $254 = 0, $255 = 0, $256 = 0, $257 = 0, $258 = 0, $259 = 0, $26 = 0, $260 = 0, $261 = 0, $262 = 0, $263 = 0, $264 = 0, $265 = 0, $266 = 0, $267 = 0, $268 = 0, $269 = 0;
  22699. var $27 = 0, $270 = 0, $271 = 0, $272 = 0, $273 = 0, $274 = 0, $275 = 0, $276 = 0, $277 = 0, $278 = 0, $279 = 0, $28 = 0, $280 = 0, $281 = 0, $282 = 0, $283 = 0, $284 = 0, $285 = 0, $286 = 0, $287 = 0;
  22700. var $288 = 0, $289 = 0, $29 = 0, $290 = 0, $291 = 0, $292 = 0, $293 = 0, $294 = 0, $295 = 0, $296 = 0, $297 = 0, $298 = 0, $299 = 0, $30 = 0, $300 = 0, $301 = 0, $302 = 0, $303 = 0, $304 = 0, $305 = 0;
  22701. var $306 = 0.0, $307 = 0, $308 = 0, $309 = 0, $31 = 0, $310 = 0, $311 = 0, $312 = 0, $313 = 0, $314 = 0, $315 = 0, $316 = 0, $317 = 0, $318 = 0, $319 = 0, $32 = 0, $320 = 0, $321 = 0, $322 = 0, $323 = 0;
  22702. var $324 = 0, $325 = 0, $326 = 0, $327 = 0, $328 = 0, $329 = 0, $33 = 0, $330 = 0, $331 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
  22703. var $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0;
  22704. var $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0;
  22705. var $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0;
  22706. var $arglist_current = 0, $arglist_current2 = 0, $arglist_next = 0, $arglist_next3 = 0, $expanded = 0, $expanded10 = 0, $expanded11 = 0, $expanded13 = 0, $expanded14 = 0, $expanded15 = 0, $expanded4 = 0, $expanded6 = 0, $expanded7 = 0, $expanded8 = 0, $isdigit = 0, $isdigit275 = 0, $isdigit277 = 0, $isdigittmp = 0, $isdigittmp$ = 0, $isdigittmp274 = 0;
  22707. var $isdigittmp276 = 0, $narrow = 0, $or$cond = 0, $or$cond281 = 0, $or$cond283 = 0, $or$cond286 = 0, $storemerge = 0, $storemerge273310 = 0, $storemerge278 = 0, $trunc = 0, label = 0, sp = 0;
  22708. sp = STACKTOP;
  22709. STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
  22710. $5 = sp + 16|0;
  22711. $6 = sp;
  22712. $7 = sp + 24|0;
  22713. $8 = sp + 8|0;
  22714. $9 = sp + 20|0;
  22715. HEAP32[$5>>2] = $1;
  22716. $10 = ($0|0)!=(0|0);
  22717. $11 = ((($7)) + 40|0);
  22718. $12 = $11;
  22719. $13 = ((($7)) + 39|0);
  22720. $14 = ((($8)) + 4|0);
  22721. $$0243 = 0;$$0247 = 0;$$0269 = 0;$21 = $1;
  22722. L1: while(1) {
  22723. $15 = ($$0247|0)>(-1);
  22724. do {
  22725. if ($15) {
  22726. $16 = (2147483647 - ($$0247))|0;
  22727. $17 = ($$0243|0)>($16|0);
  22728. if ($17) {
  22729. $18 = (___errno_location()|0);
  22730. HEAP32[$18>>2] = 75;
  22731. $$1248 = -1;
  22732. break;
  22733. } else {
  22734. $19 = (($$0243) + ($$0247))|0;
  22735. $$1248 = $19;
  22736. break;
  22737. }
  22738. } else {
  22739. $$1248 = $$0247;
  22740. }
  22741. } while(0);
  22742. $20 = HEAP8[$21>>0]|0;
  22743. $22 = ($20<<24>>24)==(0);
  22744. if ($22) {
  22745. label = 87;
  22746. break;
  22747. } else {
  22748. $23 = $20;$25 = $21;
  22749. }
  22750. L9: while(1) {
  22751. switch ($23<<24>>24) {
  22752. case 37: {
  22753. $$0249306 = $25;$27 = $25;
  22754. label = 9;
  22755. break L9;
  22756. break;
  22757. }
  22758. case 0: {
  22759. $$0249$lcssa = $25;$39 = $25;
  22760. break L9;
  22761. break;
  22762. }
  22763. default: {
  22764. }
  22765. }
  22766. $24 = ((($25)) + 1|0);
  22767. HEAP32[$5>>2] = $24;
  22768. $$pre = HEAP8[$24>>0]|0;
  22769. $23 = $$pre;$25 = $24;
  22770. }
  22771. L12: do {
  22772. if ((label|0) == 9) {
  22773. while(1) {
  22774. label = 0;
  22775. $26 = ((($27)) + 1|0);
  22776. $28 = HEAP8[$26>>0]|0;
  22777. $29 = ($28<<24>>24)==(37);
  22778. if (!($29)) {
  22779. $$0249$lcssa = $$0249306;$39 = $27;
  22780. break L12;
  22781. }
  22782. $30 = ((($$0249306)) + 1|0);
  22783. $31 = ((($27)) + 2|0);
  22784. HEAP32[$5>>2] = $31;
  22785. $32 = HEAP8[$31>>0]|0;
  22786. $33 = ($32<<24>>24)==(37);
  22787. if ($33) {
  22788. $$0249306 = $30;$27 = $31;
  22789. label = 9;
  22790. } else {
  22791. $$0249$lcssa = $30;$39 = $31;
  22792. break;
  22793. }
  22794. }
  22795. }
  22796. } while(0);
  22797. $34 = $$0249$lcssa;
  22798. $35 = $21;
  22799. $36 = (($34) - ($35))|0;
  22800. if ($10) {
  22801. _out($0,$21,$36);
  22802. }
  22803. $37 = ($36|0)==(0);
  22804. if (!($37)) {
  22805. $$0269$phi = $$0269;$$0243 = $36;$$0247 = $$1248;$21 = $39;$$0269 = $$0269$phi;
  22806. continue;
  22807. }
  22808. $38 = ((($39)) + 1|0);
  22809. $40 = HEAP8[$38>>0]|0;
  22810. $41 = $40 << 24 >> 24;
  22811. $isdigittmp = (($41) + -48)|0;
  22812. $isdigit = ($isdigittmp>>>0)<(10);
  22813. if ($isdigit) {
  22814. $42 = ((($39)) + 2|0);
  22815. $43 = HEAP8[$42>>0]|0;
  22816. $44 = ($43<<24>>24)==(36);
  22817. $45 = ((($39)) + 3|0);
  22818. $$377 = $44 ? $45 : $38;
  22819. $$$0269 = $44 ? 1 : $$0269;
  22820. $isdigittmp$ = $44 ? $isdigittmp : -1;
  22821. $$0253 = $isdigittmp$;$$1270 = $$$0269;$storemerge = $$377;
  22822. } else {
  22823. $$0253 = -1;$$1270 = $$0269;$storemerge = $38;
  22824. }
  22825. HEAP32[$5>>2] = $storemerge;
  22826. $46 = HEAP8[$storemerge>>0]|0;
  22827. $47 = $46 << 24 >> 24;
  22828. $48 = (($47) + -32)|0;
  22829. $49 = ($48>>>0)<(32);
  22830. L24: do {
  22831. if ($49) {
  22832. $$0262311 = 0;$329 = $46;$51 = $48;$storemerge273310 = $storemerge;
  22833. while(1) {
  22834. $50 = 1 << $51;
  22835. $52 = $50 & 75913;
  22836. $53 = ($52|0)==(0);
  22837. if ($53) {
  22838. $$0262$lcssa = $$0262311;$$lcssa295 = $329;$62 = $storemerge273310;
  22839. break L24;
  22840. }
  22841. $54 = $50 | $$0262311;
  22842. $55 = ((($storemerge273310)) + 1|0);
  22843. HEAP32[$5>>2] = $55;
  22844. $56 = HEAP8[$55>>0]|0;
  22845. $57 = $56 << 24 >> 24;
  22846. $58 = (($57) + -32)|0;
  22847. $59 = ($58>>>0)<(32);
  22848. if ($59) {
  22849. $$0262311 = $54;$329 = $56;$51 = $58;$storemerge273310 = $55;
  22850. } else {
  22851. $$0262$lcssa = $54;$$lcssa295 = $56;$62 = $55;
  22852. break;
  22853. }
  22854. }
  22855. } else {
  22856. $$0262$lcssa = 0;$$lcssa295 = $46;$62 = $storemerge;
  22857. }
  22858. } while(0);
  22859. $60 = ($$lcssa295<<24>>24)==(42);
  22860. if ($60) {
  22861. $61 = ((($62)) + 1|0);
  22862. $63 = HEAP8[$61>>0]|0;
  22863. $64 = $63 << 24 >> 24;
  22864. $isdigittmp276 = (($64) + -48)|0;
  22865. $isdigit277 = ($isdigittmp276>>>0)<(10);
  22866. if ($isdigit277) {
  22867. $65 = ((($62)) + 2|0);
  22868. $66 = HEAP8[$65>>0]|0;
  22869. $67 = ($66<<24>>24)==(36);
  22870. if ($67) {
  22871. $68 = (($4) + ($isdigittmp276<<2)|0);
  22872. HEAP32[$68>>2] = 10;
  22873. $69 = HEAP8[$61>>0]|0;
  22874. $70 = $69 << 24 >> 24;
  22875. $71 = (($70) + -48)|0;
  22876. $72 = (($3) + ($71<<3)|0);
  22877. $73 = $72;
  22878. $74 = $73;
  22879. $75 = HEAP32[$74>>2]|0;
  22880. $76 = (($73) + 4)|0;
  22881. $77 = $76;
  22882. $78 = HEAP32[$77>>2]|0;
  22883. $79 = ((($62)) + 3|0);
  22884. $$0259 = $75;$$2271 = 1;$storemerge278 = $79;
  22885. } else {
  22886. label = 23;
  22887. }
  22888. } else {
  22889. label = 23;
  22890. }
  22891. if ((label|0) == 23) {
  22892. label = 0;
  22893. $80 = ($$1270|0)==(0);
  22894. if (!($80)) {
  22895. $$0 = -1;
  22896. break;
  22897. }
  22898. if ($10) {
  22899. $arglist_current = HEAP32[$2>>2]|0;
  22900. $81 = $arglist_current;
  22901. $82 = ((0) + 4|0);
  22902. $expanded4 = $82;
  22903. $expanded = (($expanded4) - 1)|0;
  22904. $83 = (($81) + ($expanded))|0;
  22905. $84 = ((0) + 4|0);
  22906. $expanded8 = $84;
  22907. $expanded7 = (($expanded8) - 1)|0;
  22908. $expanded6 = $expanded7 ^ -1;
  22909. $85 = $83 & $expanded6;
  22910. $86 = $85;
  22911. $87 = HEAP32[$86>>2]|0;
  22912. $arglist_next = ((($86)) + 4|0);
  22913. HEAP32[$2>>2] = $arglist_next;
  22914. $$0259 = $87;$$2271 = 0;$storemerge278 = $61;
  22915. } else {
  22916. $$0259 = 0;$$2271 = 0;$storemerge278 = $61;
  22917. }
  22918. }
  22919. HEAP32[$5>>2] = $storemerge278;
  22920. $88 = ($$0259|0)<(0);
  22921. $89 = $$0262$lcssa | 8192;
  22922. $90 = (0 - ($$0259))|0;
  22923. $$$0262 = $88 ? $89 : $$0262$lcssa;
  22924. $$$0259 = $88 ? $90 : $$0259;
  22925. $$1260 = $$$0259;$$1263 = $$$0262;$$3272 = $$2271;$94 = $storemerge278;
  22926. } else {
  22927. $91 = (_getint($5)|0);
  22928. $92 = ($91|0)<(0);
  22929. if ($92) {
  22930. $$0 = -1;
  22931. break;
  22932. }
  22933. $$pre346 = HEAP32[$5>>2]|0;
  22934. $$1260 = $91;$$1263 = $$0262$lcssa;$$3272 = $$1270;$94 = $$pre346;
  22935. }
  22936. $93 = HEAP8[$94>>0]|0;
  22937. $95 = ($93<<24>>24)==(46);
  22938. do {
  22939. if ($95) {
  22940. $96 = ((($94)) + 1|0);
  22941. $97 = HEAP8[$96>>0]|0;
  22942. $98 = ($97<<24>>24)==(42);
  22943. if (!($98)) {
  22944. $125 = ((($94)) + 1|0);
  22945. HEAP32[$5>>2] = $125;
  22946. $126 = (_getint($5)|0);
  22947. $$pre347$pre = HEAP32[$5>>2]|0;
  22948. $$0254 = $126;$$pre347 = $$pre347$pre;
  22949. break;
  22950. }
  22951. $99 = ((($94)) + 2|0);
  22952. $100 = HEAP8[$99>>0]|0;
  22953. $101 = $100 << 24 >> 24;
  22954. $isdigittmp274 = (($101) + -48)|0;
  22955. $isdigit275 = ($isdigittmp274>>>0)<(10);
  22956. if ($isdigit275) {
  22957. $102 = ((($94)) + 3|0);
  22958. $103 = HEAP8[$102>>0]|0;
  22959. $104 = ($103<<24>>24)==(36);
  22960. if ($104) {
  22961. $105 = (($4) + ($isdigittmp274<<2)|0);
  22962. HEAP32[$105>>2] = 10;
  22963. $106 = HEAP8[$99>>0]|0;
  22964. $107 = $106 << 24 >> 24;
  22965. $108 = (($107) + -48)|0;
  22966. $109 = (($3) + ($108<<3)|0);
  22967. $110 = $109;
  22968. $111 = $110;
  22969. $112 = HEAP32[$111>>2]|0;
  22970. $113 = (($110) + 4)|0;
  22971. $114 = $113;
  22972. $115 = HEAP32[$114>>2]|0;
  22973. $116 = ((($94)) + 4|0);
  22974. HEAP32[$5>>2] = $116;
  22975. $$0254 = $112;$$pre347 = $116;
  22976. break;
  22977. }
  22978. }
  22979. $117 = ($$3272|0)==(0);
  22980. if (!($117)) {
  22981. $$0 = -1;
  22982. break L1;
  22983. }
  22984. if ($10) {
  22985. $arglist_current2 = HEAP32[$2>>2]|0;
  22986. $118 = $arglist_current2;
  22987. $119 = ((0) + 4|0);
  22988. $expanded11 = $119;
  22989. $expanded10 = (($expanded11) - 1)|0;
  22990. $120 = (($118) + ($expanded10))|0;
  22991. $121 = ((0) + 4|0);
  22992. $expanded15 = $121;
  22993. $expanded14 = (($expanded15) - 1)|0;
  22994. $expanded13 = $expanded14 ^ -1;
  22995. $122 = $120 & $expanded13;
  22996. $123 = $122;
  22997. $124 = HEAP32[$123>>2]|0;
  22998. $arglist_next3 = ((($123)) + 4|0);
  22999. HEAP32[$2>>2] = $arglist_next3;
  23000. $330 = $124;
  23001. } else {
  23002. $330 = 0;
  23003. }
  23004. HEAP32[$5>>2] = $99;
  23005. $$0254 = $330;$$pre347 = $99;
  23006. } else {
  23007. $$0254 = -1;$$pre347 = $94;
  23008. }
  23009. } while(0);
  23010. $$0252 = 0;$128 = $$pre347;
  23011. while(1) {
  23012. $127 = HEAP8[$128>>0]|0;
  23013. $129 = $127 << 24 >> 24;
  23014. $130 = (($129) + -65)|0;
  23015. $131 = ($130>>>0)>(57);
  23016. if ($131) {
  23017. $$0 = -1;
  23018. break L1;
  23019. }
  23020. $132 = ((($128)) + 1|0);
  23021. HEAP32[$5>>2] = $132;
  23022. $133 = HEAP8[$128>>0]|0;
  23023. $134 = $133 << 24 >> 24;
  23024. $135 = (($134) + -65)|0;
  23025. $136 = ((11156 + (($$0252*58)|0)|0) + ($135)|0);
  23026. $137 = HEAP8[$136>>0]|0;
  23027. $138 = $137&255;
  23028. $139 = (($138) + -1)|0;
  23029. $140 = ($139>>>0)<(8);
  23030. if ($140) {
  23031. $$0252 = $138;$128 = $132;
  23032. } else {
  23033. break;
  23034. }
  23035. }
  23036. $141 = ($137<<24>>24)==(0);
  23037. if ($141) {
  23038. $$0 = -1;
  23039. break;
  23040. }
  23041. $142 = ($137<<24>>24)==(19);
  23042. $143 = ($$0253|0)>(-1);
  23043. do {
  23044. if ($142) {
  23045. if ($143) {
  23046. $$0 = -1;
  23047. break L1;
  23048. } else {
  23049. label = 49;
  23050. }
  23051. } else {
  23052. if ($143) {
  23053. $144 = (($4) + ($$0253<<2)|0);
  23054. HEAP32[$144>>2] = $138;
  23055. $145 = (($3) + ($$0253<<3)|0);
  23056. $146 = $145;
  23057. $147 = $146;
  23058. $148 = HEAP32[$147>>2]|0;
  23059. $149 = (($146) + 4)|0;
  23060. $150 = $149;
  23061. $151 = HEAP32[$150>>2]|0;
  23062. $152 = $6;
  23063. $153 = $152;
  23064. HEAP32[$153>>2] = $148;
  23065. $154 = (($152) + 4)|0;
  23066. $155 = $154;
  23067. HEAP32[$155>>2] = $151;
  23068. label = 49;
  23069. break;
  23070. }
  23071. if (!($10)) {
  23072. $$0 = 0;
  23073. break L1;
  23074. }
  23075. _pop_arg($6,$138,$2);
  23076. }
  23077. } while(0);
  23078. if ((label|0) == 49) {
  23079. label = 0;
  23080. if (!($10)) {
  23081. $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23082. continue;
  23083. }
  23084. }
  23085. $156 = HEAP8[$128>>0]|0;
  23086. $157 = $156 << 24 >> 24;
  23087. $158 = ($$0252|0)!=(0);
  23088. $159 = $157 & 15;
  23089. $160 = ($159|0)==(3);
  23090. $or$cond281 = $158 & $160;
  23091. $161 = $157 & -33;
  23092. $$0235 = $or$cond281 ? $161 : $157;
  23093. $162 = $$1263 & 8192;
  23094. $163 = ($162|0)==(0);
  23095. $164 = $$1263 & -65537;
  23096. $$1263$ = $163 ? $$1263 : $164;
  23097. L71: do {
  23098. switch ($$0235|0) {
  23099. case 110: {
  23100. $trunc = $$0252&255;
  23101. switch ($trunc<<24>>24) {
  23102. case 0: {
  23103. $171 = HEAP32[$6>>2]|0;
  23104. HEAP32[$171>>2] = $$1248;
  23105. $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23106. continue L1;
  23107. break;
  23108. }
  23109. case 1: {
  23110. $172 = HEAP32[$6>>2]|0;
  23111. HEAP32[$172>>2] = $$1248;
  23112. $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23113. continue L1;
  23114. break;
  23115. }
  23116. case 2: {
  23117. $173 = ($$1248|0)<(0);
  23118. $174 = $173 << 31 >> 31;
  23119. $175 = HEAP32[$6>>2]|0;
  23120. $176 = $175;
  23121. $177 = $176;
  23122. HEAP32[$177>>2] = $$1248;
  23123. $178 = (($176) + 4)|0;
  23124. $179 = $178;
  23125. HEAP32[$179>>2] = $174;
  23126. $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23127. continue L1;
  23128. break;
  23129. }
  23130. case 3: {
  23131. $180 = $$1248&65535;
  23132. $181 = HEAP32[$6>>2]|0;
  23133. HEAP16[$181>>1] = $180;
  23134. $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23135. continue L1;
  23136. break;
  23137. }
  23138. case 4: {
  23139. $182 = $$1248&255;
  23140. $183 = HEAP32[$6>>2]|0;
  23141. HEAP8[$183>>0] = $182;
  23142. $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23143. continue L1;
  23144. break;
  23145. }
  23146. case 6: {
  23147. $184 = HEAP32[$6>>2]|0;
  23148. HEAP32[$184>>2] = $$1248;
  23149. $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23150. continue L1;
  23151. break;
  23152. }
  23153. case 7: {
  23154. $185 = ($$1248|0)<(0);
  23155. $186 = $185 << 31 >> 31;
  23156. $187 = HEAP32[$6>>2]|0;
  23157. $188 = $187;
  23158. $189 = $188;
  23159. HEAP32[$189>>2] = $$1248;
  23160. $190 = (($188) + 4)|0;
  23161. $191 = $190;
  23162. HEAP32[$191>>2] = $186;
  23163. $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23164. continue L1;
  23165. break;
  23166. }
  23167. default: {
  23168. $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23169. continue L1;
  23170. }
  23171. }
  23172. break;
  23173. }
  23174. case 112: {
  23175. $192 = ($$0254>>>0)>(8);
  23176. $193 = $192 ? $$0254 : 8;
  23177. $194 = $$1263$ | 8;
  23178. $$1236 = 120;$$1255 = $193;$$3265 = $194;
  23179. label = 61;
  23180. break;
  23181. }
  23182. case 88: case 120: {
  23183. $$1236 = $$0235;$$1255 = $$0254;$$3265 = $$1263$;
  23184. label = 61;
  23185. break;
  23186. }
  23187. case 111: {
  23188. $210 = $6;
  23189. $211 = $210;
  23190. $212 = HEAP32[$211>>2]|0;
  23191. $213 = (($210) + 4)|0;
  23192. $214 = $213;
  23193. $215 = HEAP32[$214>>2]|0;
  23194. $216 = (_fmt_o($212,$215,$11)|0);
  23195. $217 = $$1263$ & 8;
  23196. $218 = ($217|0)==(0);
  23197. $219 = $216;
  23198. $220 = (($12) - ($219))|0;
  23199. $221 = ($$0254|0)>($220|0);
  23200. $222 = (($220) + 1)|0;
  23201. $223 = $218 | $221;
  23202. $$0254$$0254$ = $223 ? $$0254 : $222;
  23203. $$0228 = $216;$$1233 = 0;$$1238 = 11620;$$2256 = $$0254$$0254$;$$4266 = $$1263$;$248 = $212;$250 = $215;
  23204. label = 67;
  23205. break;
  23206. }
  23207. case 105: case 100: {
  23208. $224 = $6;
  23209. $225 = $224;
  23210. $226 = HEAP32[$225>>2]|0;
  23211. $227 = (($224) + 4)|0;
  23212. $228 = $227;
  23213. $229 = HEAP32[$228>>2]|0;
  23214. $230 = ($229|0)<(0);
  23215. if ($230) {
  23216. $231 = (_i64Subtract(0,0,($226|0),($229|0))|0);
  23217. $232 = tempRet0;
  23218. $233 = $6;
  23219. $234 = $233;
  23220. HEAP32[$234>>2] = $231;
  23221. $235 = (($233) + 4)|0;
  23222. $236 = $235;
  23223. HEAP32[$236>>2] = $232;
  23224. $$0232 = 1;$$0237 = 11620;$242 = $231;$243 = $232;
  23225. label = 66;
  23226. break L71;
  23227. } else {
  23228. $237 = $$1263$ & 2048;
  23229. $238 = ($237|0)==(0);
  23230. $239 = $$1263$ & 1;
  23231. $240 = ($239|0)==(0);
  23232. $$ = $240 ? 11620 : (11622);
  23233. $$$ = $238 ? $$ : (11621);
  23234. $241 = $$1263$ & 2049;
  23235. $narrow = ($241|0)!=(0);
  23236. $$284$ = $narrow&1;
  23237. $$0232 = $$284$;$$0237 = $$$;$242 = $226;$243 = $229;
  23238. label = 66;
  23239. break L71;
  23240. }
  23241. break;
  23242. }
  23243. case 117: {
  23244. $165 = $6;
  23245. $166 = $165;
  23246. $167 = HEAP32[$166>>2]|0;
  23247. $168 = (($165) + 4)|0;
  23248. $169 = $168;
  23249. $170 = HEAP32[$169>>2]|0;
  23250. $$0232 = 0;$$0237 = 11620;$242 = $167;$243 = $170;
  23251. label = 66;
  23252. break;
  23253. }
  23254. case 99: {
  23255. $259 = $6;
  23256. $260 = $259;
  23257. $261 = HEAP32[$260>>2]|0;
  23258. $262 = (($259) + 4)|0;
  23259. $263 = $262;
  23260. $264 = HEAP32[$263>>2]|0;
  23261. $265 = $261&255;
  23262. HEAP8[$13>>0] = $265;
  23263. $$2 = $13;$$2234 = 0;$$2239 = 11620;$$2251 = $11;$$5 = 1;$$6268 = $164;
  23264. break;
  23265. }
  23266. case 109: {
  23267. $266 = (___errno_location()|0);
  23268. $267 = HEAP32[$266>>2]|0;
  23269. $268 = (_strerror($267)|0);
  23270. $$1 = $268;
  23271. label = 71;
  23272. break;
  23273. }
  23274. case 115: {
  23275. $269 = HEAP32[$6>>2]|0;
  23276. $270 = ($269|0)!=(0|0);
  23277. $271 = $270 ? $269 : 11630;
  23278. $$1 = $271;
  23279. label = 71;
  23280. break;
  23281. }
  23282. case 67: {
  23283. $278 = $6;
  23284. $279 = $278;
  23285. $280 = HEAP32[$279>>2]|0;
  23286. $281 = (($278) + 4)|0;
  23287. $282 = $281;
  23288. $283 = HEAP32[$282>>2]|0;
  23289. HEAP32[$8>>2] = $280;
  23290. HEAP32[$14>>2] = 0;
  23291. HEAP32[$6>>2] = $8;
  23292. $$4258355 = -1;$331 = $8;
  23293. label = 75;
  23294. break;
  23295. }
  23296. case 83: {
  23297. $$pre349 = HEAP32[$6>>2]|0;
  23298. $284 = ($$0254|0)==(0);
  23299. if ($284) {
  23300. _pad_672($0,32,$$1260,0,$$1263$);
  23301. $$0240$lcssa357 = 0;
  23302. label = 84;
  23303. } else {
  23304. $$4258355 = $$0254;$331 = $$pre349;
  23305. label = 75;
  23306. }
  23307. break;
  23308. }
  23309. case 65: case 71: case 70: case 69: case 97: case 103: case 102: case 101: {
  23310. $306 = +HEAPF64[$6>>3];
  23311. $307 = (_fmt_fp($0,$306,$$1260,$$0254,$$1263$,$$0235)|0);
  23312. $$0243 = $307;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23313. continue L1;
  23314. break;
  23315. }
  23316. default: {
  23317. $$2 = $21;$$2234 = 0;$$2239 = 11620;$$2251 = $11;$$5 = $$0254;$$6268 = $$1263$;
  23318. }
  23319. }
  23320. } while(0);
  23321. L95: do {
  23322. if ((label|0) == 61) {
  23323. label = 0;
  23324. $195 = $6;
  23325. $196 = $195;
  23326. $197 = HEAP32[$196>>2]|0;
  23327. $198 = (($195) + 4)|0;
  23328. $199 = $198;
  23329. $200 = HEAP32[$199>>2]|0;
  23330. $201 = $$1236 & 32;
  23331. $202 = (_fmt_x($197,$200,$11,$201)|0);
  23332. $203 = ($197|0)==(0);
  23333. $204 = ($200|0)==(0);
  23334. $205 = $203 & $204;
  23335. $206 = $$3265 & 8;
  23336. $207 = ($206|0)==(0);
  23337. $or$cond283 = $207 | $205;
  23338. $208 = $$1236 >> 4;
  23339. $209 = (11620 + ($208)|0);
  23340. $$289 = $or$cond283 ? 11620 : $209;
  23341. $$290 = $or$cond283 ? 0 : 2;
  23342. $$0228 = $202;$$1233 = $$290;$$1238 = $$289;$$2256 = $$1255;$$4266 = $$3265;$248 = $197;$250 = $200;
  23343. label = 67;
  23344. }
  23345. else if ((label|0) == 66) {
  23346. label = 0;
  23347. $244 = (_fmt_u($242,$243,$11)|0);
  23348. $$0228 = $244;$$1233 = $$0232;$$1238 = $$0237;$$2256 = $$0254;$$4266 = $$1263$;$248 = $242;$250 = $243;
  23349. label = 67;
  23350. }
  23351. else if ((label|0) == 71) {
  23352. label = 0;
  23353. $272 = (_memchr($$1,0,$$0254)|0);
  23354. $273 = ($272|0)==(0|0);
  23355. $274 = $272;
  23356. $275 = $$1;
  23357. $276 = (($274) - ($275))|0;
  23358. $277 = (($$1) + ($$0254)|0);
  23359. $$3257 = $273 ? $$0254 : $276;
  23360. $$1250 = $273 ? $277 : $272;
  23361. $$2 = $$1;$$2234 = 0;$$2239 = 11620;$$2251 = $$1250;$$5 = $$3257;$$6268 = $164;
  23362. }
  23363. else if ((label|0) == 75) {
  23364. label = 0;
  23365. $$0229322 = $331;$$0240321 = 0;$$1244320 = 0;
  23366. while(1) {
  23367. $285 = HEAP32[$$0229322>>2]|0;
  23368. $286 = ($285|0)==(0);
  23369. if ($286) {
  23370. $$0240$lcssa = $$0240321;$$2245 = $$1244320;
  23371. break;
  23372. }
  23373. $287 = (_wctomb($9,$285)|0);
  23374. $288 = ($287|0)<(0);
  23375. $289 = (($$4258355) - ($$0240321))|0;
  23376. $290 = ($287>>>0)>($289>>>0);
  23377. $or$cond286 = $288 | $290;
  23378. if ($or$cond286) {
  23379. $$0240$lcssa = $$0240321;$$2245 = $287;
  23380. break;
  23381. }
  23382. $291 = ((($$0229322)) + 4|0);
  23383. $292 = (($287) + ($$0240321))|0;
  23384. $293 = ($$4258355>>>0)>($292>>>0);
  23385. if ($293) {
  23386. $$0229322 = $291;$$0240321 = $292;$$1244320 = $287;
  23387. } else {
  23388. $$0240$lcssa = $292;$$2245 = $287;
  23389. break;
  23390. }
  23391. }
  23392. $294 = ($$2245|0)<(0);
  23393. if ($294) {
  23394. $$0 = -1;
  23395. break L1;
  23396. }
  23397. _pad_672($0,32,$$1260,$$0240$lcssa,$$1263$);
  23398. $295 = ($$0240$lcssa|0)==(0);
  23399. if ($295) {
  23400. $$0240$lcssa357 = 0;
  23401. label = 84;
  23402. } else {
  23403. $$1230333 = $331;$$1241332 = 0;
  23404. while(1) {
  23405. $296 = HEAP32[$$1230333>>2]|0;
  23406. $297 = ($296|0)==(0);
  23407. if ($297) {
  23408. $$0240$lcssa357 = $$0240$lcssa;
  23409. label = 84;
  23410. break L95;
  23411. }
  23412. $298 = (_wctomb($9,$296)|0);
  23413. $299 = (($298) + ($$1241332))|0;
  23414. $300 = ($299|0)>($$0240$lcssa|0);
  23415. if ($300) {
  23416. $$0240$lcssa357 = $$0240$lcssa;
  23417. label = 84;
  23418. break L95;
  23419. }
  23420. $301 = ((($$1230333)) + 4|0);
  23421. _out($0,$9,$298);
  23422. $302 = ($299>>>0)<($$0240$lcssa>>>0);
  23423. if ($302) {
  23424. $$1230333 = $301;$$1241332 = $299;
  23425. } else {
  23426. $$0240$lcssa357 = $$0240$lcssa;
  23427. label = 84;
  23428. break;
  23429. }
  23430. }
  23431. }
  23432. }
  23433. } while(0);
  23434. if ((label|0) == 67) {
  23435. label = 0;
  23436. $245 = ($$2256|0)>(-1);
  23437. $246 = $$4266 & -65537;
  23438. $$$4266 = $245 ? $246 : $$4266;
  23439. $247 = ($248|0)!=(0);
  23440. $249 = ($250|0)!=(0);
  23441. $251 = $247 | $249;
  23442. $252 = ($$2256|0)!=(0);
  23443. $or$cond = $252 | $251;
  23444. $253 = $$0228;
  23445. $254 = (($12) - ($253))|0;
  23446. $255 = $251 ^ 1;
  23447. $256 = $255&1;
  23448. $257 = (($256) + ($254))|0;
  23449. $258 = ($$2256|0)>($257|0);
  23450. $$2256$ = $258 ? $$2256 : $257;
  23451. $$2256$$$2256 = $or$cond ? $$2256$ : $$2256;
  23452. $$0228$ = $or$cond ? $$0228 : $11;
  23453. $$2 = $$0228$;$$2234 = $$1233;$$2239 = $$1238;$$2251 = $11;$$5 = $$2256$$$2256;$$6268 = $$$4266;
  23454. }
  23455. else if ((label|0) == 84) {
  23456. label = 0;
  23457. $303 = $$1263$ ^ 8192;
  23458. _pad_672($0,32,$$1260,$$0240$lcssa357,$303);
  23459. $304 = ($$1260|0)>($$0240$lcssa357|0);
  23460. $305 = $304 ? $$1260 : $$0240$lcssa357;
  23461. $$0243 = $305;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23462. continue;
  23463. }
  23464. $308 = $$2251;
  23465. $309 = $$2;
  23466. $310 = (($308) - ($309))|0;
  23467. $311 = ($$5|0)<($310|0);
  23468. $$$5 = $311 ? $310 : $$5;
  23469. $312 = (($$$5) + ($$2234))|0;
  23470. $313 = ($$1260|0)<($312|0);
  23471. $$2261 = $313 ? $312 : $$1260;
  23472. _pad_672($0,32,$$2261,$312,$$6268);
  23473. _out($0,$$2239,$$2234);
  23474. $314 = $$6268 ^ 65536;
  23475. _pad_672($0,48,$$2261,$312,$314);
  23476. _pad_672($0,48,$$$5,$310,0);
  23477. _out($0,$$2,$310);
  23478. $315 = $$6268 ^ 8192;
  23479. _pad_672($0,32,$$2261,$312,$315);
  23480. $$0243 = $$2261;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23481. }
  23482. L114: do {
  23483. if ((label|0) == 87) {
  23484. $316 = ($0|0)==(0|0);
  23485. if ($316) {
  23486. $317 = ($$0269|0)==(0);
  23487. if ($317) {
  23488. $$0 = 0;
  23489. } else {
  23490. $$2242305 = 1;
  23491. while(1) {
  23492. $318 = (($4) + ($$2242305<<2)|0);
  23493. $319 = HEAP32[$318>>2]|0;
  23494. $320 = ($319|0)==(0);
  23495. if ($320) {
  23496. $$3303 = $$2242305;
  23497. break;
  23498. }
  23499. $321 = (($3) + ($$2242305<<3)|0);
  23500. _pop_arg($321,$319,$2);
  23501. $322 = (($$2242305) + 1)|0;
  23502. $323 = ($322|0)<(10);
  23503. if ($323) {
  23504. $$2242305 = $322;
  23505. } else {
  23506. $$0 = 1;
  23507. break L114;
  23508. }
  23509. }
  23510. while(1) {
  23511. $326 = (($4) + ($$3303<<2)|0);
  23512. $327 = HEAP32[$326>>2]|0;
  23513. $328 = ($327|0)==(0);
  23514. $325 = (($$3303) + 1)|0;
  23515. if (!($328)) {
  23516. $$0 = -1;
  23517. break L114;
  23518. }
  23519. $324 = ($325|0)<(10);
  23520. if ($324) {
  23521. $$3303 = $325;
  23522. } else {
  23523. $$0 = 1;
  23524. break;
  23525. }
  23526. }
  23527. }
  23528. } else {
  23529. $$0 = $$1248;
  23530. }
  23531. }
  23532. } while(0);
  23533. STACKTOP = sp;return ($$0|0);
  23534. }
  23535. function ___lockfile($0) {
  23536. $0 = $0|0;
  23537. var label = 0, sp = 0;
  23538. sp = STACKTOP;
  23539. return 0;
  23540. }
  23541. function ___unlockfile($0) {
  23542. $0 = $0|0;
  23543. var label = 0, sp = 0;
  23544. sp = STACKTOP;
  23545. return;
  23546. }
  23547. function _out($0,$1,$2) {
  23548. $0 = $0|0;
  23549. $1 = $1|0;
  23550. $2 = $2|0;
  23551. var $3 = 0, $4 = 0, $5 = 0, label = 0, sp = 0;
  23552. sp = STACKTOP;
  23553. $3 = HEAP32[$0>>2]|0;
  23554. $4 = $3 & 32;
  23555. $5 = ($4|0)==(0);
  23556. if ($5) {
  23557. (___fwritex($1,$2,$0)|0);
  23558. }
  23559. return;
  23560. }
  23561. function _getint($0) {
  23562. $0 = $0|0;
  23563. var $$0$lcssa = 0, $$06 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $isdigit = 0, $isdigit5 = 0, $isdigittmp = 0, $isdigittmp4 = 0, $isdigittmp7 = 0, label = 0, sp = 0;
  23564. sp = STACKTOP;
  23565. $1 = HEAP32[$0>>2]|0;
  23566. $2 = HEAP8[$1>>0]|0;
  23567. $3 = $2 << 24 >> 24;
  23568. $isdigittmp4 = (($3) + -48)|0;
  23569. $isdigit5 = ($isdigittmp4>>>0)<(10);
  23570. if ($isdigit5) {
  23571. $$06 = 0;$7 = $1;$isdigittmp7 = $isdigittmp4;
  23572. while(1) {
  23573. $4 = ($$06*10)|0;
  23574. $5 = (($isdigittmp7) + ($4))|0;
  23575. $6 = ((($7)) + 1|0);
  23576. HEAP32[$0>>2] = $6;
  23577. $8 = HEAP8[$6>>0]|0;
  23578. $9 = $8 << 24 >> 24;
  23579. $isdigittmp = (($9) + -48)|0;
  23580. $isdigit = ($isdigittmp>>>0)<(10);
  23581. if ($isdigit) {
  23582. $$06 = $5;$7 = $6;$isdigittmp7 = $isdigittmp;
  23583. } else {
  23584. $$0$lcssa = $5;
  23585. break;
  23586. }
  23587. }
  23588. } else {
  23589. $$0$lcssa = 0;
  23590. }
  23591. return ($$0$lcssa|0);
  23592. }
  23593. function _pop_arg($0,$1,$2) {
  23594. $0 = $0|0;
  23595. $1 = $1|0;
  23596. $2 = $2|0;
  23597. var $$mask = 0, $$mask31 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0.0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0;
  23598. var $116 = 0.0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0;
  23599. var $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0;
  23600. var $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0;
  23601. var $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0;
  23602. var $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $arglist_current = 0, $arglist_current11 = 0, $arglist_current14 = 0, $arglist_current17 = 0;
  23603. var $arglist_current2 = 0, $arglist_current20 = 0, $arglist_current23 = 0, $arglist_current26 = 0, $arglist_current5 = 0, $arglist_current8 = 0, $arglist_next = 0, $arglist_next12 = 0, $arglist_next15 = 0, $arglist_next18 = 0, $arglist_next21 = 0, $arglist_next24 = 0, $arglist_next27 = 0, $arglist_next3 = 0, $arglist_next6 = 0, $arglist_next9 = 0, $expanded = 0, $expanded28 = 0, $expanded30 = 0, $expanded31 = 0;
  23604. var $expanded32 = 0, $expanded34 = 0, $expanded35 = 0, $expanded37 = 0, $expanded38 = 0, $expanded39 = 0, $expanded41 = 0, $expanded42 = 0, $expanded44 = 0, $expanded45 = 0, $expanded46 = 0, $expanded48 = 0, $expanded49 = 0, $expanded51 = 0, $expanded52 = 0, $expanded53 = 0, $expanded55 = 0, $expanded56 = 0, $expanded58 = 0, $expanded59 = 0;
  23605. var $expanded60 = 0, $expanded62 = 0, $expanded63 = 0, $expanded65 = 0, $expanded66 = 0, $expanded67 = 0, $expanded69 = 0, $expanded70 = 0, $expanded72 = 0, $expanded73 = 0, $expanded74 = 0, $expanded76 = 0, $expanded77 = 0, $expanded79 = 0, $expanded80 = 0, $expanded81 = 0, $expanded83 = 0, $expanded84 = 0, $expanded86 = 0, $expanded87 = 0;
  23606. var $expanded88 = 0, $expanded90 = 0, $expanded91 = 0, $expanded93 = 0, $expanded94 = 0, $expanded95 = 0, label = 0, sp = 0;
  23607. sp = STACKTOP;
  23608. $3 = ($1>>>0)>(20);
  23609. L1: do {
  23610. if (!($3)) {
  23611. do {
  23612. switch ($1|0) {
  23613. case 9: {
  23614. $arglist_current = HEAP32[$2>>2]|0;
  23615. $4 = $arglist_current;
  23616. $5 = ((0) + 4|0);
  23617. $expanded28 = $5;
  23618. $expanded = (($expanded28) - 1)|0;
  23619. $6 = (($4) + ($expanded))|0;
  23620. $7 = ((0) + 4|0);
  23621. $expanded32 = $7;
  23622. $expanded31 = (($expanded32) - 1)|0;
  23623. $expanded30 = $expanded31 ^ -1;
  23624. $8 = $6 & $expanded30;
  23625. $9 = $8;
  23626. $10 = HEAP32[$9>>2]|0;
  23627. $arglist_next = ((($9)) + 4|0);
  23628. HEAP32[$2>>2] = $arglist_next;
  23629. HEAP32[$0>>2] = $10;
  23630. break L1;
  23631. break;
  23632. }
  23633. case 10: {
  23634. $arglist_current2 = HEAP32[$2>>2]|0;
  23635. $11 = $arglist_current2;
  23636. $12 = ((0) + 4|0);
  23637. $expanded35 = $12;
  23638. $expanded34 = (($expanded35) - 1)|0;
  23639. $13 = (($11) + ($expanded34))|0;
  23640. $14 = ((0) + 4|0);
  23641. $expanded39 = $14;
  23642. $expanded38 = (($expanded39) - 1)|0;
  23643. $expanded37 = $expanded38 ^ -1;
  23644. $15 = $13 & $expanded37;
  23645. $16 = $15;
  23646. $17 = HEAP32[$16>>2]|0;
  23647. $arglist_next3 = ((($16)) + 4|0);
  23648. HEAP32[$2>>2] = $arglist_next3;
  23649. $18 = ($17|0)<(0);
  23650. $19 = $18 << 31 >> 31;
  23651. $20 = $0;
  23652. $21 = $20;
  23653. HEAP32[$21>>2] = $17;
  23654. $22 = (($20) + 4)|0;
  23655. $23 = $22;
  23656. HEAP32[$23>>2] = $19;
  23657. break L1;
  23658. break;
  23659. }
  23660. case 11: {
  23661. $arglist_current5 = HEAP32[$2>>2]|0;
  23662. $24 = $arglist_current5;
  23663. $25 = ((0) + 4|0);
  23664. $expanded42 = $25;
  23665. $expanded41 = (($expanded42) - 1)|0;
  23666. $26 = (($24) + ($expanded41))|0;
  23667. $27 = ((0) + 4|0);
  23668. $expanded46 = $27;
  23669. $expanded45 = (($expanded46) - 1)|0;
  23670. $expanded44 = $expanded45 ^ -1;
  23671. $28 = $26 & $expanded44;
  23672. $29 = $28;
  23673. $30 = HEAP32[$29>>2]|0;
  23674. $arglist_next6 = ((($29)) + 4|0);
  23675. HEAP32[$2>>2] = $arglist_next6;
  23676. $31 = $0;
  23677. $32 = $31;
  23678. HEAP32[$32>>2] = $30;
  23679. $33 = (($31) + 4)|0;
  23680. $34 = $33;
  23681. HEAP32[$34>>2] = 0;
  23682. break L1;
  23683. break;
  23684. }
  23685. case 12: {
  23686. $arglist_current8 = HEAP32[$2>>2]|0;
  23687. $35 = $arglist_current8;
  23688. $36 = ((0) + 8|0);
  23689. $expanded49 = $36;
  23690. $expanded48 = (($expanded49) - 1)|0;
  23691. $37 = (($35) + ($expanded48))|0;
  23692. $38 = ((0) + 8|0);
  23693. $expanded53 = $38;
  23694. $expanded52 = (($expanded53) - 1)|0;
  23695. $expanded51 = $expanded52 ^ -1;
  23696. $39 = $37 & $expanded51;
  23697. $40 = $39;
  23698. $41 = $40;
  23699. $42 = $41;
  23700. $43 = HEAP32[$42>>2]|0;
  23701. $44 = (($41) + 4)|0;
  23702. $45 = $44;
  23703. $46 = HEAP32[$45>>2]|0;
  23704. $arglist_next9 = ((($40)) + 8|0);
  23705. HEAP32[$2>>2] = $arglist_next9;
  23706. $47 = $0;
  23707. $48 = $47;
  23708. HEAP32[$48>>2] = $43;
  23709. $49 = (($47) + 4)|0;
  23710. $50 = $49;
  23711. HEAP32[$50>>2] = $46;
  23712. break L1;
  23713. break;
  23714. }
  23715. case 13: {
  23716. $arglist_current11 = HEAP32[$2>>2]|0;
  23717. $51 = $arglist_current11;
  23718. $52 = ((0) + 4|0);
  23719. $expanded56 = $52;
  23720. $expanded55 = (($expanded56) - 1)|0;
  23721. $53 = (($51) + ($expanded55))|0;
  23722. $54 = ((0) + 4|0);
  23723. $expanded60 = $54;
  23724. $expanded59 = (($expanded60) - 1)|0;
  23725. $expanded58 = $expanded59 ^ -1;
  23726. $55 = $53 & $expanded58;
  23727. $56 = $55;
  23728. $57 = HEAP32[$56>>2]|0;
  23729. $arglist_next12 = ((($56)) + 4|0);
  23730. HEAP32[$2>>2] = $arglist_next12;
  23731. $58 = $57&65535;
  23732. $59 = $58 << 16 >> 16;
  23733. $60 = ($59|0)<(0);
  23734. $61 = $60 << 31 >> 31;
  23735. $62 = $0;
  23736. $63 = $62;
  23737. HEAP32[$63>>2] = $59;
  23738. $64 = (($62) + 4)|0;
  23739. $65 = $64;
  23740. HEAP32[$65>>2] = $61;
  23741. break L1;
  23742. break;
  23743. }
  23744. case 14: {
  23745. $arglist_current14 = HEAP32[$2>>2]|0;
  23746. $66 = $arglist_current14;
  23747. $67 = ((0) + 4|0);
  23748. $expanded63 = $67;
  23749. $expanded62 = (($expanded63) - 1)|0;
  23750. $68 = (($66) + ($expanded62))|0;
  23751. $69 = ((0) + 4|0);
  23752. $expanded67 = $69;
  23753. $expanded66 = (($expanded67) - 1)|0;
  23754. $expanded65 = $expanded66 ^ -1;
  23755. $70 = $68 & $expanded65;
  23756. $71 = $70;
  23757. $72 = HEAP32[$71>>2]|0;
  23758. $arglist_next15 = ((($71)) + 4|0);
  23759. HEAP32[$2>>2] = $arglist_next15;
  23760. $$mask31 = $72 & 65535;
  23761. $73 = $0;
  23762. $74 = $73;
  23763. HEAP32[$74>>2] = $$mask31;
  23764. $75 = (($73) + 4)|0;
  23765. $76 = $75;
  23766. HEAP32[$76>>2] = 0;
  23767. break L1;
  23768. break;
  23769. }
  23770. case 15: {
  23771. $arglist_current17 = HEAP32[$2>>2]|0;
  23772. $77 = $arglist_current17;
  23773. $78 = ((0) + 4|0);
  23774. $expanded70 = $78;
  23775. $expanded69 = (($expanded70) - 1)|0;
  23776. $79 = (($77) + ($expanded69))|0;
  23777. $80 = ((0) + 4|0);
  23778. $expanded74 = $80;
  23779. $expanded73 = (($expanded74) - 1)|0;
  23780. $expanded72 = $expanded73 ^ -1;
  23781. $81 = $79 & $expanded72;
  23782. $82 = $81;
  23783. $83 = HEAP32[$82>>2]|0;
  23784. $arglist_next18 = ((($82)) + 4|0);
  23785. HEAP32[$2>>2] = $arglist_next18;
  23786. $84 = $83&255;
  23787. $85 = $84 << 24 >> 24;
  23788. $86 = ($85|0)<(0);
  23789. $87 = $86 << 31 >> 31;
  23790. $88 = $0;
  23791. $89 = $88;
  23792. HEAP32[$89>>2] = $85;
  23793. $90 = (($88) + 4)|0;
  23794. $91 = $90;
  23795. HEAP32[$91>>2] = $87;
  23796. break L1;
  23797. break;
  23798. }
  23799. case 16: {
  23800. $arglist_current20 = HEAP32[$2>>2]|0;
  23801. $92 = $arglist_current20;
  23802. $93 = ((0) + 4|0);
  23803. $expanded77 = $93;
  23804. $expanded76 = (($expanded77) - 1)|0;
  23805. $94 = (($92) + ($expanded76))|0;
  23806. $95 = ((0) + 4|0);
  23807. $expanded81 = $95;
  23808. $expanded80 = (($expanded81) - 1)|0;
  23809. $expanded79 = $expanded80 ^ -1;
  23810. $96 = $94 & $expanded79;
  23811. $97 = $96;
  23812. $98 = HEAP32[$97>>2]|0;
  23813. $arglist_next21 = ((($97)) + 4|0);
  23814. HEAP32[$2>>2] = $arglist_next21;
  23815. $$mask = $98 & 255;
  23816. $99 = $0;
  23817. $100 = $99;
  23818. HEAP32[$100>>2] = $$mask;
  23819. $101 = (($99) + 4)|0;
  23820. $102 = $101;
  23821. HEAP32[$102>>2] = 0;
  23822. break L1;
  23823. break;
  23824. }
  23825. case 17: {
  23826. $arglist_current23 = HEAP32[$2>>2]|0;
  23827. $103 = $arglist_current23;
  23828. $104 = ((0) + 8|0);
  23829. $expanded84 = $104;
  23830. $expanded83 = (($expanded84) - 1)|0;
  23831. $105 = (($103) + ($expanded83))|0;
  23832. $106 = ((0) + 8|0);
  23833. $expanded88 = $106;
  23834. $expanded87 = (($expanded88) - 1)|0;
  23835. $expanded86 = $expanded87 ^ -1;
  23836. $107 = $105 & $expanded86;
  23837. $108 = $107;
  23838. $109 = +HEAPF64[$108>>3];
  23839. $arglist_next24 = ((($108)) + 8|0);
  23840. HEAP32[$2>>2] = $arglist_next24;
  23841. HEAPF64[$0>>3] = $109;
  23842. break L1;
  23843. break;
  23844. }
  23845. case 18: {
  23846. $arglist_current26 = HEAP32[$2>>2]|0;
  23847. $110 = $arglist_current26;
  23848. $111 = ((0) + 8|0);
  23849. $expanded91 = $111;
  23850. $expanded90 = (($expanded91) - 1)|0;
  23851. $112 = (($110) + ($expanded90))|0;
  23852. $113 = ((0) + 8|0);
  23853. $expanded95 = $113;
  23854. $expanded94 = (($expanded95) - 1)|0;
  23855. $expanded93 = $expanded94 ^ -1;
  23856. $114 = $112 & $expanded93;
  23857. $115 = $114;
  23858. $116 = +HEAPF64[$115>>3];
  23859. $arglist_next27 = ((($115)) + 8|0);
  23860. HEAP32[$2>>2] = $arglist_next27;
  23861. HEAPF64[$0>>3] = $116;
  23862. break L1;
  23863. break;
  23864. }
  23865. default: {
  23866. break L1;
  23867. }
  23868. }
  23869. } while(0);
  23870. }
  23871. } while(0);
  23872. return;
  23873. }
  23874. function _fmt_x($0,$1,$2,$3) {
  23875. $0 = $0|0;
  23876. $1 = $1|0;
  23877. $2 = $2|0;
  23878. $3 = $3|0;
  23879. var $$05$lcssa = 0, $$056 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0;
  23880. var sp = 0;
  23881. sp = STACKTOP;
  23882. $4 = ($0|0)==(0);
  23883. $5 = ($1|0)==(0);
  23884. $6 = $4 & $5;
  23885. if ($6) {
  23886. $$05$lcssa = $2;
  23887. } else {
  23888. $$056 = $2;$15 = $1;$8 = $0;
  23889. while(1) {
  23890. $7 = $8 & 15;
  23891. $9 = (11672 + ($7)|0);
  23892. $10 = HEAP8[$9>>0]|0;
  23893. $11 = $10&255;
  23894. $12 = $11 | $3;
  23895. $13 = $12&255;
  23896. $14 = ((($$056)) + -1|0);
  23897. HEAP8[$14>>0] = $13;
  23898. $16 = (_bitshift64Lshr(($8|0),($15|0),4)|0);
  23899. $17 = tempRet0;
  23900. $18 = ($16|0)==(0);
  23901. $19 = ($17|0)==(0);
  23902. $20 = $18 & $19;
  23903. if ($20) {
  23904. $$05$lcssa = $14;
  23905. break;
  23906. } else {
  23907. $$056 = $14;$15 = $17;$8 = $16;
  23908. }
  23909. }
  23910. }
  23911. return ($$05$lcssa|0);
  23912. }
  23913. function _fmt_o($0,$1,$2) {
  23914. $0 = $0|0;
  23915. $1 = $1|0;
  23916. $2 = $2|0;
  23917. var $$0$lcssa = 0, $$06 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  23918. sp = STACKTOP;
  23919. $3 = ($0|0)==(0);
  23920. $4 = ($1|0)==(0);
  23921. $5 = $3 & $4;
  23922. if ($5) {
  23923. $$0$lcssa = $2;
  23924. } else {
  23925. $$06 = $2;$11 = $1;$7 = $0;
  23926. while(1) {
  23927. $6 = $7&255;
  23928. $8 = $6 & 7;
  23929. $9 = $8 | 48;
  23930. $10 = ((($$06)) + -1|0);
  23931. HEAP8[$10>>0] = $9;
  23932. $12 = (_bitshift64Lshr(($7|0),($11|0),3)|0);
  23933. $13 = tempRet0;
  23934. $14 = ($12|0)==(0);
  23935. $15 = ($13|0)==(0);
  23936. $16 = $14 & $15;
  23937. if ($16) {
  23938. $$0$lcssa = $10;
  23939. break;
  23940. } else {
  23941. $$06 = $10;$11 = $13;$7 = $12;
  23942. }
  23943. }
  23944. }
  23945. return ($$0$lcssa|0);
  23946. }
  23947. function _fmt_u($0,$1,$2) {
  23948. $0 = $0|0;
  23949. $1 = $1|0;
  23950. $2 = $2|0;
  23951. var $$010$lcssa$off0 = 0, $$012 = 0, $$09$lcssa = 0, $$0914 = 0, $$1$lcssa = 0, $$111 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0;
  23952. var $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  23953. sp = STACKTOP;
  23954. $3 = ($1>>>0)>(0);
  23955. $4 = ($0>>>0)>(4294967295);
  23956. $5 = ($1|0)==(0);
  23957. $6 = $5 & $4;
  23958. $7 = $3 | $6;
  23959. if ($7) {
  23960. $$0914 = $2;$8 = $0;$9 = $1;
  23961. while(1) {
  23962. $10 = (___uremdi3(($8|0),($9|0),10,0)|0);
  23963. $11 = tempRet0;
  23964. $12 = $10&255;
  23965. $13 = $12 | 48;
  23966. $14 = ((($$0914)) + -1|0);
  23967. HEAP8[$14>>0] = $13;
  23968. $15 = (___udivdi3(($8|0),($9|0),10,0)|0);
  23969. $16 = tempRet0;
  23970. $17 = ($9>>>0)>(9);
  23971. $18 = ($8>>>0)>(4294967295);
  23972. $19 = ($9|0)==(9);
  23973. $20 = $19 & $18;
  23974. $21 = $17 | $20;
  23975. if ($21) {
  23976. $$0914 = $14;$8 = $15;$9 = $16;
  23977. } else {
  23978. break;
  23979. }
  23980. }
  23981. $$010$lcssa$off0 = $15;$$09$lcssa = $14;
  23982. } else {
  23983. $$010$lcssa$off0 = $0;$$09$lcssa = $2;
  23984. }
  23985. $22 = ($$010$lcssa$off0|0)==(0);
  23986. if ($22) {
  23987. $$1$lcssa = $$09$lcssa;
  23988. } else {
  23989. $$012 = $$010$lcssa$off0;$$111 = $$09$lcssa;
  23990. while(1) {
  23991. $23 = (($$012>>>0) % 10)&-1;
  23992. $24 = $23 | 48;
  23993. $25 = $24&255;
  23994. $26 = ((($$111)) + -1|0);
  23995. HEAP8[$26>>0] = $25;
  23996. $27 = (($$012>>>0) / 10)&-1;
  23997. $28 = ($$012>>>0)<(10);
  23998. if ($28) {
  23999. $$1$lcssa = $26;
  24000. break;
  24001. } else {
  24002. $$012 = $27;$$111 = $26;
  24003. }
  24004. }
  24005. }
  24006. return ($$1$lcssa|0);
  24007. }
  24008. function _strerror($0) {
  24009. $0 = $0|0;
  24010. var $1 = 0, $2 = 0, $3 = 0, $4 = 0, label = 0, sp = 0;
  24011. sp = STACKTOP;
  24012. $1 = (___pthread_self_105()|0);
  24013. $2 = ((($1)) + 188|0);
  24014. $3 = HEAP32[$2>>2]|0;
  24015. $4 = (___strerror_l($0,$3)|0);
  24016. return ($4|0);
  24017. }
  24018. function _memchr($0,$1,$2) {
  24019. $0 = $0|0;
  24020. $1 = $1|0;
  24021. $2 = $2|0;
  24022. var $$0$lcssa = 0, $$035$lcssa = 0, $$035$lcssa65 = 0, $$03555 = 0, $$036$lcssa = 0, $$036$lcssa64 = 0, $$03654 = 0, $$046 = 0, $$137$lcssa = 0, $$13745 = 0, $$140 = 0, $$2 = 0, $$23839 = 0, $$3 = 0, $$lcssa = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0;
  24023. var $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0;
  24024. var $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, $or$cond53 = 0, label = 0, sp = 0;
  24025. sp = STACKTOP;
  24026. $3 = $1 & 255;
  24027. $4 = $0;
  24028. $5 = $4 & 3;
  24029. $6 = ($5|0)!=(0);
  24030. $7 = ($2|0)!=(0);
  24031. $or$cond53 = $7 & $6;
  24032. L1: do {
  24033. if ($or$cond53) {
  24034. $8 = $1&255;
  24035. $$03555 = $0;$$03654 = $2;
  24036. while(1) {
  24037. $9 = HEAP8[$$03555>>0]|0;
  24038. $10 = ($9<<24>>24)==($8<<24>>24);
  24039. if ($10) {
  24040. $$035$lcssa65 = $$03555;$$036$lcssa64 = $$03654;
  24041. label = 6;
  24042. break L1;
  24043. }
  24044. $11 = ((($$03555)) + 1|0);
  24045. $12 = (($$03654) + -1)|0;
  24046. $13 = $11;
  24047. $14 = $13 & 3;
  24048. $15 = ($14|0)!=(0);
  24049. $16 = ($12|0)!=(0);
  24050. $or$cond = $16 & $15;
  24051. if ($or$cond) {
  24052. $$03555 = $11;$$03654 = $12;
  24053. } else {
  24054. $$035$lcssa = $11;$$036$lcssa = $12;$$lcssa = $16;
  24055. label = 5;
  24056. break;
  24057. }
  24058. }
  24059. } else {
  24060. $$035$lcssa = $0;$$036$lcssa = $2;$$lcssa = $7;
  24061. label = 5;
  24062. }
  24063. } while(0);
  24064. if ((label|0) == 5) {
  24065. if ($$lcssa) {
  24066. $$035$lcssa65 = $$035$lcssa;$$036$lcssa64 = $$036$lcssa;
  24067. label = 6;
  24068. } else {
  24069. $$2 = $$035$lcssa;$$3 = 0;
  24070. }
  24071. }
  24072. L8: do {
  24073. if ((label|0) == 6) {
  24074. $17 = HEAP8[$$035$lcssa65>>0]|0;
  24075. $18 = $1&255;
  24076. $19 = ($17<<24>>24)==($18<<24>>24);
  24077. if ($19) {
  24078. $$2 = $$035$lcssa65;$$3 = $$036$lcssa64;
  24079. } else {
  24080. $20 = Math_imul($3, 16843009)|0;
  24081. $21 = ($$036$lcssa64>>>0)>(3);
  24082. L11: do {
  24083. if ($21) {
  24084. $$046 = $$035$lcssa65;$$13745 = $$036$lcssa64;
  24085. while(1) {
  24086. $22 = HEAP32[$$046>>2]|0;
  24087. $23 = $22 ^ $20;
  24088. $24 = (($23) + -16843009)|0;
  24089. $25 = $23 & -2139062144;
  24090. $26 = $25 ^ -2139062144;
  24091. $27 = $26 & $24;
  24092. $28 = ($27|0)==(0);
  24093. if (!($28)) {
  24094. break;
  24095. }
  24096. $29 = ((($$046)) + 4|0);
  24097. $30 = (($$13745) + -4)|0;
  24098. $31 = ($30>>>0)>(3);
  24099. if ($31) {
  24100. $$046 = $29;$$13745 = $30;
  24101. } else {
  24102. $$0$lcssa = $29;$$137$lcssa = $30;
  24103. label = 11;
  24104. break L11;
  24105. }
  24106. }
  24107. $$140 = $$046;$$23839 = $$13745;
  24108. } else {
  24109. $$0$lcssa = $$035$lcssa65;$$137$lcssa = $$036$lcssa64;
  24110. label = 11;
  24111. }
  24112. } while(0);
  24113. if ((label|0) == 11) {
  24114. $32 = ($$137$lcssa|0)==(0);
  24115. if ($32) {
  24116. $$2 = $$0$lcssa;$$3 = 0;
  24117. break;
  24118. } else {
  24119. $$140 = $$0$lcssa;$$23839 = $$137$lcssa;
  24120. }
  24121. }
  24122. while(1) {
  24123. $33 = HEAP8[$$140>>0]|0;
  24124. $34 = ($33<<24>>24)==($18<<24>>24);
  24125. if ($34) {
  24126. $$2 = $$140;$$3 = $$23839;
  24127. break L8;
  24128. }
  24129. $35 = ((($$140)) + 1|0);
  24130. $36 = (($$23839) + -1)|0;
  24131. $37 = ($36|0)==(0);
  24132. if ($37) {
  24133. $$2 = $35;$$3 = 0;
  24134. break;
  24135. } else {
  24136. $$140 = $35;$$23839 = $36;
  24137. }
  24138. }
  24139. }
  24140. }
  24141. } while(0);
  24142. $38 = ($$3|0)!=(0);
  24143. $39 = $38 ? $$2 : 0;
  24144. return ($39|0);
  24145. }
  24146. function _pad_672($0,$1,$2,$3,$4) {
  24147. $0 = $0|0;
  24148. $1 = $1|0;
  24149. $2 = $2|0;
  24150. $3 = $3|0;
  24151. $4 = $4|0;
  24152. var $$0$lcssa = 0, $$011 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, label = 0, sp = 0;
  24153. sp = STACKTOP;
  24154. STACKTOP = STACKTOP + 256|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(256|0);
  24155. $5 = sp;
  24156. $6 = $4 & 73728;
  24157. $7 = ($6|0)==(0);
  24158. $8 = ($2|0)>($3|0);
  24159. $or$cond = $8 & $7;
  24160. if ($or$cond) {
  24161. $9 = (($2) - ($3))|0;
  24162. $10 = ($9>>>0)<(256);
  24163. $11 = $10 ? $9 : 256;
  24164. _memset(($5|0),($1|0),($11|0))|0;
  24165. $12 = ($9>>>0)>(255);
  24166. if ($12) {
  24167. $13 = (($2) - ($3))|0;
  24168. $$011 = $9;
  24169. while(1) {
  24170. _out($0,$5,256);
  24171. $14 = (($$011) + -256)|0;
  24172. $15 = ($14>>>0)>(255);
  24173. if ($15) {
  24174. $$011 = $14;
  24175. } else {
  24176. break;
  24177. }
  24178. }
  24179. $16 = $13 & 255;
  24180. $$0$lcssa = $16;
  24181. } else {
  24182. $$0$lcssa = $9;
  24183. }
  24184. _out($0,$5,$$0$lcssa);
  24185. }
  24186. STACKTOP = sp;return;
  24187. }
  24188. function _wctomb($0,$1) {
  24189. $0 = $0|0;
  24190. $1 = $1|0;
  24191. var $$0 = 0, $2 = 0, $3 = 0, label = 0, sp = 0;
  24192. sp = STACKTOP;
  24193. $2 = ($0|0)==(0|0);
  24194. if ($2) {
  24195. $$0 = 0;
  24196. } else {
  24197. $3 = (_wcrtomb($0,$1,0)|0);
  24198. $$0 = $3;
  24199. }
  24200. return ($$0|0);
  24201. }
  24202. function _fmt_fp($0,$1,$2,$3,$4,$5) {
  24203. $0 = $0|0;
  24204. $1 = +$1;
  24205. $2 = $2|0;
  24206. $3 = $3|0;
  24207. $4 = $4|0;
  24208. $5 = $5|0;
  24209. var $$ = 0, $$$ = 0, $$$$559 = 0.0, $$$3484 = 0, $$$3484691 = 0, $$$3484692 = 0, $$$3501 = 0, $$$4502 = 0, $$$542 = 0.0, $$$559 = 0.0, $$0 = 0, $$0463$lcssa = 0, $$0463584 = 0, $$0464594 = 0, $$0471 = 0.0, $$0479 = 0, $$0487642 = 0, $$0488 = 0, $$0488653 = 0, $$0488655 = 0;
  24210. var $$0496$$9 = 0, $$0497654 = 0, $$0498 = 0, $$0509582 = 0.0, $$0510 = 0, $$0511 = 0, $$0514637 = 0, $$0520 = 0, $$0521 = 0, $$0521$ = 0, $$0523 = 0, $$0525 = 0, $$0527 = 0, $$0527629 = 0, $$0527631 = 0, $$0530636 = 0, $$1465 = 0, $$1467 = 0.0, $$1469 = 0.0, $$1472 = 0.0;
  24211. var $$1480 = 0, $$1482$lcssa = 0, $$1482661 = 0, $$1489641 = 0, $$1499$lcssa = 0, $$1499660 = 0, $$1508583 = 0, $$1512$lcssa = 0, $$1512607 = 0, $$1515 = 0, $$1524 = 0, $$1526 = 0, $$1528614 = 0, $$1531$lcssa = 0, $$1531630 = 0, $$1598 = 0, $$2 = 0, $$2473 = 0.0, $$2476 = 0, $$2476$$547 = 0;
  24212. var $$2476$$549 = 0, $$2483$ph = 0, $$2500 = 0, $$2513 = 0, $$2516618 = 0, $$2529 = 0, $$2532617 = 0, $$3 = 0.0, $$3477 = 0, $$3484$lcssa = 0, $$3484648 = 0, $$3501$lcssa = 0, $$3501647 = 0, $$3533613 = 0, $$4 = 0.0, $$4478$lcssa = 0, $$4478590 = 0, $$4492 = 0, $$4502 = 0, $$4518 = 0;
  24213. var $$5$lcssa = 0, $$534$ = 0, $$539 = 0, $$539$ = 0, $$542 = 0.0, $$546 = 0, $$548 = 0, $$5486$lcssa = 0, $$5486623 = 0, $$5493597 = 0, $$5519$ph = 0, $$555 = 0, $$556 = 0, $$559 = 0.0, $$5602 = 0, $$6 = 0, $$6494589 = 0, $$7495601 = 0, $$7505 = 0, $$7505$ = 0;
  24214. var $$7505$ph = 0, $$8 = 0, $$9$ph = 0, $$lcssa673 = 0, $$neg = 0, $$neg567 = 0, $$pn = 0, $$pn566 = 0, $$pr = 0, $$pr564 = 0, $$pre = 0, $$pre$phi690Z2D = 0, $$pre689 = 0, $$sink545$lcssa = 0, $$sink545622 = 0, $$sink562 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0;
  24215. var $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0.0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0, $116 = 0.0, $117 = 0.0, $118 = 0.0, $119 = 0, $12 = 0, $120 = 0;
  24216. var $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0, $133 = 0, $134 = 0, $135 = 0, $136 = 0, $137 = 0, $138 = 0, $139 = 0;
  24217. var $14 = 0.0, $140 = 0, $141 = 0, $142 = 0, $143 = 0, $144 = 0, $145 = 0, $146 = 0, $147 = 0, $148 = 0, $149 = 0, $15 = 0, $150 = 0, $151 = 0, $152 = 0, $153 = 0, $154 = 0, $155 = 0, $156 = 0, $157 = 0;
  24218. var $158 = 0, $159 = 0, $16 = 0, $160 = 0, $161 = 0, $162 = 0, $163 = 0, $164 = 0, $165 = 0, $166 = 0, $167 = 0, $168 = 0, $169 = 0, $17 = 0, $170 = 0, $171 = 0, $172 = 0, $173 = 0, $174 = 0, $175 = 0;
  24219. var $176 = 0, $177 = 0, $178 = 0, $179 = 0, $18 = 0, $180 = 0, $181 = 0, $182 = 0, $183 = 0, $184 = 0, $185 = 0, $186 = 0, $187 = 0, $188 = 0, $189 = 0, $19 = 0, $190 = 0, $191 = 0, $192 = 0, $193 = 0;
  24220. var $194 = 0, $195 = 0, $196 = 0, $197 = 0, $198 = 0, $199 = 0, $20 = 0, $200 = 0, $201 = 0, $202 = 0, $203 = 0, $204 = 0, $205 = 0, $206 = 0, $207 = 0, $208 = 0, $209 = 0, $21 = 0, $210 = 0, $211 = 0;
  24221. var $212 = 0, $213 = 0, $214 = 0, $215 = 0, $216 = 0, $217 = 0, $218 = 0, $219 = 0, $22 = 0, $220 = 0, $221 = 0, $222 = 0, $223 = 0, $224 = 0, $225 = 0, $226 = 0, $227 = 0, $228 = 0.0, $229 = 0.0, $23 = 0;
  24222. var $230 = 0, $231 = 0.0, $232 = 0, $233 = 0, $234 = 0, $235 = 0, $236 = 0, $237 = 0, $238 = 0, $239 = 0, $24 = 0, $240 = 0, $241 = 0, $242 = 0, $243 = 0, $244 = 0, $245 = 0, $246 = 0, $247 = 0, $248 = 0;
  24223. var $249 = 0, $25 = 0, $250 = 0, $251 = 0, $252 = 0, $253 = 0, $254 = 0, $255 = 0, $256 = 0, $257 = 0, $258 = 0, $259 = 0, $26 = 0, $260 = 0, $261 = 0, $262 = 0, $263 = 0, $264 = 0, $265 = 0, $266 = 0;
  24224. var $267 = 0, $268 = 0, $269 = 0, $27 = 0, $270 = 0, $271 = 0, $272 = 0, $273 = 0, $274 = 0, $275 = 0, $276 = 0, $277 = 0, $278 = 0, $279 = 0, $28 = 0, $280 = 0, $281 = 0, $282 = 0, $283 = 0, $284 = 0;
  24225. var $285 = 0, $286 = 0, $287 = 0, $288 = 0, $289 = 0, $29 = 0, $290 = 0, $291 = 0, $292 = 0, $293 = 0, $294 = 0, $295 = 0, $296 = 0, $297 = 0, $298 = 0, $299 = 0, $30 = 0, $300 = 0, $301 = 0, $302 = 0;
  24226. var $303 = 0, $304 = 0, $305 = 0, $306 = 0, $307 = 0, $308 = 0, $309 = 0, $31 = 0, $310 = 0, $311 = 0, $312 = 0, $313 = 0, $314 = 0, $315 = 0, $316 = 0, $317 = 0, $318 = 0, $319 = 0, $32 = 0, $320 = 0;
  24227. var $321 = 0, $322 = 0, $323 = 0, $324 = 0, $325 = 0, $326 = 0, $327 = 0, $328 = 0, $329 = 0, $33 = 0, $330 = 0, $331 = 0, $332 = 0, $333 = 0, $334 = 0, $335 = 0, $336 = 0, $337 = 0, $338 = 0, $339 = 0;
  24228. var $34 = 0, $340 = 0, $341 = 0, $342 = 0, $343 = 0, $344 = 0, $345 = 0, $346 = 0, $347 = 0, $348 = 0, $349 = 0, $35 = 0.0, $350 = 0, $351 = 0, $352 = 0, $353 = 0, $354 = 0, $355 = 0, $356 = 0, $357 = 0;
  24229. var $358 = 0, $359 = 0, $36 = 0.0, $360 = 0, $361 = 0, $362 = 0, $363 = 0, $364 = 0, $365 = 0, $366 = 0, $367 = 0, $368 = 0, $369 = 0, $37 = 0, $370 = 0, $371 = 0, $372 = 0, $373 = 0, $374 = 0, $375 = 0;
  24230. var $376 = 0, $377 = 0, $378 = 0, $379 = 0, $38 = 0, $380 = 0, $381 = 0, $382 = 0, $383 = 0, $384 = 0, $385 = 0, $386 = 0, $387 = 0, $388 = 0, $39 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0;
  24231. var $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $50 = 0, $51 = 0.0, $52 = 0, $53 = 0, $54 = 0, $55 = 0.0, $56 = 0.0, $57 = 0.0, $58 = 0.0, $59 = 0.0, $6 = 0, $60 = 0.0, $61 = 0, $62 = 0, $63 = 0;
  24232. var $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0;
  24233. var $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0.0, $88 = 0.0, $89 = 0.0, $9 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $exitcond = 0;
  24234. var $narrow = 0, $not$ = 0, $notlhs = 0, $notrhs = 0, $or$cond = 0, $or$cond3$not = 0, $or$cond537 = 0, $or$cond541 = 0, $or$cond544 = 0, $or$cond554 = 0, $or$cond6 = 0, $scevgep684 = 0, $scevgep684685 = 0, label = 0, sp = 0;
  24235. sp = STACKTOP;
  24236. STACKTOP = STACKTOP + 560|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(560|0);
  24237. $6 = sp + 8|0;
  24238. $7 = sp;
  24239. $8 = sp + 524|0;
  24240. $9 = $8;
  24241. $10 = sp + 512|0;
  24242. HEAP32[$7>>2] = 0;
  24243. $11 = ((($10)) + 12|0);
  24244. (___DOUBLE_BITS_673($1)|0);
  24245. $12 = tempRet0;
  24246. $13 = ($12|0)<(0);
  24247. if ($13) {
  24248. $14 = -$1;
  24249. $$0471 = $14;$$0520 = 1;$$0521 = 11637;
  24250. } else {
  24251. $15 = $4 & 2048;
  24252. $16 = ($15|0)==(0);
  24253. $17 = $4 & 1;
  24254. $18 = ($17|0)==(0);
  24255. $$ = $18 ? (11638) : (11643);
  24256. $$$ = $16 ? $$ : (11640);
  24257. $19 = $4 & 2049;
  24258. $narrow = ($19|0)!=(0);
  24259. $$534$ = $narrow&1;
  24260. $$0471 = $1;$$0520 = $$534$;$$0521 = $$$;
  24261. }
  24262. (___DOUBLE_BITS_673($$0471)|0);
  24263. $20 = tempRet0;
  24264. $21 = $20 & 2146435072;
  24265. $22 = ($21>>>0)<(2146435072);
  24266. $23 = (0)<(0);
  24267. $24 = ($21|0)==(2146435072);
  24268. $25 = $24 & $23;
  24269. $26 = $22 | $25;
  24270. do {
  24271. if ($26) {
  24272. $35 = (+_frexpl($$0471,$7));
  24273. $36 = $35 * 2.0;
  24274. $37 = $36 != 0.0;
  24275. if ($37) {
  24276. $38 = HEAP32[$7>>2]|0;
  24277. $39 = (($38) + -1)|0;
  24278. HEAP32[$7>>2] = $39;
  24279. }
  24280. $40 = $5 | 32;
  24281. $41 = ($40|0)==(97);
  24282. if ($41) {
  24283. $42 = $5 & 32;
  24284. $43 = ($42|0)==(0);
  24285. $44 = ((($$0521)) + 9|0);
  24286. $$0521$ = $43 ? $$0521 : $44;
  24287. $45 = $$0520 | 2;
  24288. $46 = ($3>>>0)>(11);
  24289. $47 = (12 - ($3))|0;
  24290. $48 = ($47|0)==(0);
  24291. $49 = $46 | $48;
  24292. do {
  24293. if ($49) {
  24294. $$1472 = $36;
  24295. } else {
  24296. $$0509582 = 8.0;$$1508583 = $47;
  24297. while(1) {
  24298. $50 = (($$1508583) + -1)|0;
  24299. $51 = $$0509582 * 16.0;
  24300. $52 = ($50|0)==(0);
  24301. if ($52) {
  24302. break;
  24303. } else {
  24304. $$0509582 = $51;$$1508583 = $50;
  24305. }
  24306. }
  24307. $53 = HEAP8[$$0521$>>0]|0;
  24308. $54 = ($53<<24>>24)==(45);
  24309. if ($54) {
  24310. $55 = -$36;
  24311. $56 = $55 - $51;
  24312. $57 = $51 + $56;
  24313. $58 = -$57;
  24314. $$1472 = $58;
  24315. break;
  24316. } else {
  24317. $59 = $36 + $51;
  24318. $60 = $59 - $51;
  24319. $$1472 = $60;
  24320. break;
  24321. }
  24322. }
  24323. } while(0);
  24324. $61 = HEAP32[$7>>2]|0;
  24325. $62 = ($61|0)<(0);
  24326. $63 = (0 - ($61))|0;
  24327. $64 = $62 ? $63 : $61;
  24328. $65 = ($64|0)<(0);
  24329. $66 = $65 << 31 >> 31;
  24330. $67 = (_fmt_u($64,$66,$11)|0);
  24331. $68 = ($67|0)==($11|0);
  24332. if ($68) {
  24333. $69 = ((($10)) + 11|0);
  24334. HEAP8[$69>>0] = 48;
  24335. $$0511 = $69;
  24336. } else {
  24337. $$0511 = $67;
  24338. }
  24339. $70 = $61 >> 31;
  24340. $71 = $70 & 2;
  24341. $72 = (($71) + 43)|0;
  24342. $73 = $72&255;
  24343. $74 = ((($$0511)) + -1|0);
  24344. HEAP8[$74>>0] = $73;
  24345. $75 = (($5) + 15)|0;
  24346. $76 = $75&255;
  24347. $77 = ((($$0511)) + -2|0);
  24348. HEAP8[$77>>0] = $76;
  24349. $notrhs = ($3|0)<(1);
  24350. $78 = $4 & 8;
  24351. $79 = ($78|0)==(0);
  24352. $$0523 = $8;$$2473 = $$1472;
  24353. while(1) {
  24354. $80 = (~~(($$2473)));
  24355. $81 = (11672 + ($80)|0);
  24356. $82 = HEAP8[$81>>0]|0;
  24357. $83 = $82&255;
  24358. $84 = $83 | $42;
  24359. $85 = $84&255;
  24360. $86 = ((($$0523)) + 1|0);
  24361. HEAP8[$$0523>>0] = $85;
  24362. $87 = (+($80|0));
  24363. $88 = $$2473 - $87;
  24364. $89 = $88 * 16.0;
  24365. $90 = $86;
  24366. $91 = (($90) - ($9))|0;
  24367. $92 = ($91|0)==(1);
  24368. if ($92) {
  24369. $notlhs = $89 == 0.0;
  24370. $or$cond3$not = $notrhs & $notlhs;
  24371. $or$cond = $79 & $or$cond3$not;
  24372. if ($or$cond) {
  24373. $$1524 = $86;
  24374. } else {
  24375. $93 = ((($$0523)) + 2|0);
  24376. HEAP8[$86>>0] = 46;
  24377. $$1524 = $93;
  24378. }
  24379. } else {
  24380. $$1524 = $86;
  24381. }
  24382. $94 = $89 != 0.0;
  24383. if ($94) {
  24384. $$0523 = $$1524;$$2473 = $89;
  24385. } else {
  24386. break;
  24387. }
  24388. }
  24389. $95 = ($3|0)!=(0);
  24390. $96 = $77;
  24391. $97 = $11;
  24392. $98 = $$1524;
  24393. $99 = (($98) - ($9))|0;
  24394. $100 = (($97) - ($96))|0;
  24395. $101 = (($99) + -2)|0;
  24396. $102 = ($101|0)<($3|0);
  24397. $or$cond537 = $95 & $102;
  24398. $103 = (($3) + 2)|0;
  24399. $$pn = $or$cond537 ? $103 : $99;
  24400. $$0525 = (($100) + ($45))|0;
  24401. $104 = (($$0525) + ($$pn))|0;
  24402. _pad_672($0,32,$2,$104,$4);
  24403. _out($0,$$0521$,$45);
  24404. $105 = $4 ^ 65536;
  24405. _pad_672($0,48,$2,$104,$105);
  24406. _out($0,$8,$99);
  24407. $106 = (($$pn) - ($99))|0;
  24408. _pad_672($0,48,$106,0,0);
  24409. _out($0,$77,$100);
  24410. $107 = $4 ^ 8192;
  24411. _pad_672($0,32,$2,$104,$107);
  24412. $$sink562 = $104;
  24413. break;
  24414. }
  24415. $108 = ($3|0)<(0);
  24416. $$539 = $108 ? 6 : $3;
  24417. if ($37) {
  24418. $109 = $36 * 268435456.0;
  24419. $110 = HEAP32[$7>>2]|0;
  24420. $111 = (($110) + -28)|0;
  24421. HEAP32[$7>>2] = $111;
  24422. $$3 = $109;$$pr = $111;
  24423. } else {
  24424. $$pre = HEAP32[$7>>2]|0;
  24425. $$3 = $36;$$pr = $$pre;
  24426. }
  24427. $112 = ($$pr|0)<(0);
  24428. $113 = ((($6)) + 288|0);
  24429. $$556 = $112 ? $6 : $113;
  24430. $$0498 = $$556;$$4 = $$3;
  24431. while(1) {
  24432. $114 = (~~(($$4))>>>0);
  24433. HEAP32[$$0498>>2] = $114;
  24434. $115 = ((($$0498)) + 4|0);
  24435. $116 = (+($114>>>0));
  24436. $117 = $$4 - $116;
  24437. $118 = $117 * 1.0E+9;
  24438. $119 = $118 != 0.0;
  24439. if ($119) {
  24440. $$0498 = $115;$$4 = $118;
  24441. } else {
  24442. break;
  24443. }
  24444. }
  24445. $120 = ($$pr|0)>(0);
  24446. if ($120) {
  24447. $$1482661 = $$556;$$1499660 = $115;$122 = $$pr;
  24448. while(1) {
  24449. $121 = ($122|0)<(29);
  24450. $123 = $121 ? $122 : 29;
  24451. $$0488653 = ((($$1499660)) + -4|0);
  24452. $124 = ($$0488653>>>0)<($$1482661>>>0);
  24453. if ($124) {
  24454. $$2483$ph = $$1482661;
  24455. } else {
  24456. $$0488655 = $$0488653;$$0497654 = 0;
  24457. while(1) {
  24458. $125 = HEAP32[$$0488655>>2]|0;
  24459. $126 = (_bitshift64Shl(($125|0),0,($123|0))|0);
  24460. $127 = tempRet0;
  24461. $128 = (_i64Add(($126|0),($127|0),($$0497654|0),0)|0);
  24462. $129 = tempRet0;
  24463. $130 = (___uremdi3(($128|0),($129|0),1000000000,0)|0);
  24464. $131 = tempRet0;
  24465. HEAP32[$$0488655>>2] = $130;
  24466. $132 = (___udivdi3(($128|0),($129|0),1000000000,0)|0);
  24467. $133 = tempRet0;
  24468. $$0488 = ((($$0488655)) + -4|0);
  24469. $134 = ($$0488>>>0)<($$1482661>>>0);
  24470. if ($134) {
  24471. break;
  24472. } else {
  24473. $$0488655 = $$0488;$$0497654 = $132;
  24474. }
  24475. }
  24476. $135 = ($132|0)==(0);
  24477. if ($135) {
  24478. $$2483$ph = $$1482661;
  24479. } else {
  24480. $136 = ((($$1482661)) + -4|0);
  24481. HEAP32[$136>>2] = $132;
  24482. $$2483$ph = $136;
  24483. }
  24484. }
  24485. $$2500 = $$1499660;
  24486. while(1) {
  24487. $137 = ($$2500>>>0)>($$2483$ph>>>0);
  24488. if (!($137)) {
  24489. break;
  24490. }
  24491. $138 = ((($$2500)) + -4|0);
  24492. $139 = HEAP32[$138>>2]|0;
  24493. $140 = ($139|0)==(0);
  24494. if ($140) {
  24495. $$2500 = $138;
  24496. } else {
  24497. break;
  24498. }
  24499. }
  24500. $141 = HEAP32[$7>>2]|0;
  24501. $142 = (($141) - ($123))|0;
  24502. HEAP32[$7>>2] = $142;
  24503. $143 = ($142|0)>(0);
  24504. if ($143) {
  24505. $$1482661 = $$2483$ph;$$1499660 = $$2500;$122 = $142;
  24506. } else {
  24507. $$1482$lcssa = $$2483$ph;$$1499$lcssa = $$2500;$$pr564 = $142;
  24508. break;
  24509. }
  24510. }
  24511. } else {
  24512. $$1482$lcssa = $$556;$$1499$lcssa = $115;$$pr564 = $$pr;
  24513. }
  24514. $144 = ($$pr564|0)<(0);
  24515. if ($144) {
  24516. $145 = (($$539) + 25)|0;
  24517. $146 = (($145|0) / 9)&-1;
  24518. $147 = (($146) + 1)|0;
  24519. $148 = ($40|0)==(102);
  24520. $$3484648 = $$1482$lcssa;$$3501647 = $$1499$lcssa;$150 = $$pr564;
  24521. while(1) {
  24522. $149 = (0 - ($150))|0;
  24523. $151 = ($149|0)<(9);
  24524. $152 = $151 ? $149 : 9;
  24525. $153 = ($$3484648>>>0)<($$3501647>>>0);
  24526. if ($153) {
  24527. $157 = 1 << $152;
  24528. $158 = (($157) + -1)|0;
  24529. $159 = 1000000000 >>> $152;
  24530. $$0487642 = 0;$$1489641 = $$3484648;
  24531. while(1) {
  24532. $160 = HEAP32[$$1489641>>2]|0;
  24533. $161 = $160 & $158;
  24534. $162 = $160 >>> $152;
  24535. $163 = (($162) + ($$0487642))|0;
  24536. HEAP32[$$1489641>>2] = $163;
  24537. $164 = Math_imul($161, $159)|0;
  24538. $165 = ((($$1489641)) + 4|0);
  24539. $166 = ($165>>>0)<($$3501647>>>0);
  24540. if ($166) {
  24541. $$0487642 = $164;$$1489641 = $165;
  24542. } else {
  24543. break;
  24544. }
  24545. }
  24546. $167 = HEAP32[$$3484648>>2]|0;
  24547. $168 = ($167|0)==(0);
  24548. $169 = ((($$3484648)) + 4|0);
  24549. $$$3484 = $168 ? $169 : $$3484648;
  24550. $170 = ($164|0)==(0);
  24551. if ($170) {
  24552. $$$3484692 = $$$3484;$$4502 = $$3501647;
  24553. } else {
  24554. $171 = ((($$3501647)) + 4|0);
  24555. HEAP32[$$3501647>>2] = $164;
  24556. $$$3484692 = $$$3484;$$4502 = $171;
  24557. }
  24558. } else {
  24559. $154 = HEAP32[$$3484648>>2]|0;
  24560. $155 = ($154|0)==(0);
  24561. $156 = ((($$3484648)) + 4|0);
  24562. $$$3484691 = $155 ? $156 : $$3484648;
  24563. $$$3484692 = $$$3484691;$$4502 = $$3501647;
  24564. }
  24565. $172 = $148 ? $$556 : $$$3484692;
  24566. $173 = $$4502;
  24567. $174 = $172;
  24568. $175 = (($173) - ($174))|0;
  24569. $176 = $175 >> 2;
  24570. $177 = ($176|0)>($147|0);
  24571. $178 = (($172) + ($147<<2)|0);
  24572. $$$4502 = $177 ? $178 : $$4502;
  24573. $179 = HEAP32[$7>>2]|0;
  24574. $180 = (($179) + ($152))|0;
  24575. HEAP32[$7>>2] = $180;
  24576. $181 = ($180|0)<(0);
  24577. if ($181) {
  24578. $$3484648 = $$$3484692;$$3501647 = $$$4502;$150 = $180;
  24579. } else {
  24580. $$3484$lcssa = $$$3484692;$$3501$lcssa = $$$4502;
  24581. break;
  24582. }
  24583. }
  24584. } else {
  24585. $$3484$lcssa = $$1482$lcssa;$$3501$lcssa = $$1499$lcssa;
  24586. }
  24587. $182 = ($$3484$lcssa>>>0)<($$3501$lcssa>>>0);
  24588. $183 = $$556;
  24589. if ($182) {
  24590. $184 = $$3484$lcssa;
  24591. $185 = (($183) - ($184))|0;
  24592. $186 = $185 >> 2;
  24593. $187 = ($186*9)|0;
  24594. $188 = HEAP32[$$3484$lcssa>>2]|0;
  24595. $189 = ($188>>>0)<(10);
  24596. if ($189) {
  24597. $$1515 = $187;
  24598. } else {
  24599. $$0514637 = $187;$$0530636 = 10;
  24600. while(1) {
  24601. $190 = ($$0530636*10)|0;
  24602. $191 = (($$0514637) + 1)|0;
  24603. $192 = ($188>>>0)<($190>>>0);
  24604. if ($192) {
  24605. $$1515 = $191;
  24606. break;
  24607. } else {
  24608. $$0514637 = $191;$$0530636 = $190;
  24609. }
  24610. }
  24611. }
  24612. } else {
  24613. $$1515 = 0;
  24614. }
  24615. $193 = ($40|0)!=(102);
  24616. $194 = $193 ? $$1515 : 0;
  24617. $195 = (($$539) - ($194))|0;
  24618. $196 = ($40|0)==(103);
  24619. $197 = ($$539|0)!=(0);
  24620. $198 = $197 & $196;
  24621. $$neg = $198 << 31 >> 31;
  24622. $199 = (($195) + ($$neg))|0;
  24623. $200 = $$3501$lcssa;
  24624. $201 = (($200) - ($183))|0;
  24625. $202 = $201 >> 2;
  24626. $203 = ($202*9)|0;
  24627. $204 = (($203) + -9)|0;
  24628. $205 = ($199|0)<($204|0);
  24629. if ($205) {
  24630. $206 = ((($$556)) + 4|0);
  24631. $207 = (($199) + 9216)|0;
  24632. $208 = (($207|0) / 9)&-1;
  24633. $209 = (($208) + -1024)|0;
  24634. $210 = (($206) + ($209<<2)|0);
  24635. $211 = (($207|0) % 9)&-1;
  24636. $$0527629 = (($211) + 1)|0;
  24637. $212 = ($$0527629|0)<(9);
  24638. if ($212) {
  24639. $$0527631 = $$0527629;$$1531630 = 10;
  24640. while(1) {
  24641. $213 = ($$1531630*10)|0;
  24642. $$0527 = (($$0527631) + 1)|0;
  24643. $exitcond = ($$0527|0)==(9);
  24644. if ($exitcond) {
  24645. $$1531$lcssa = $213;
  24646. break;
  24647. } else {
  24648. $$0527631 = $$0527;$$1531630 = $213;
  24649. }
  24650. }
  24651. } else {
  24652. $$1531$lcssa = 10;
  24653. }
  24654. $214 = HEAP32[$210>>2]|0;
  24655. $215 = (($214>>>0) % ($$1531$lcssa>>>0))&-1;
  24656. $216 = ($215|0)==(0);
  24657. $217 = ((($210)) + 4|0);
  24658. $218 = ($217|0)==($$3501$lcssa|0);
  24659. $or$cond541 = $218 & $216;
  24660. if ($or$cond541) {
  24661. $$4492 = $210;$$4518 = $$1515;$$8 = $$3484$lcssa;
  24662. } else {
  24663. $219 = (($214>>>0) / ($$1531$lcssa>>>0))&-1;
  24664. $220 = $219 & 1;
  24665. $221 = ($220|0)==(0);
  24666. $$542 = $221 ? 9007199254740992.0 : 9007199254740994.0;
  24667. $222 = (($$1531$lcssa|0) / 2)&-1;
  24668. $223 = ($215>>>0)<($222>>>0);
  24669. $224 = ($215|0)==($222|0);
  24670. $or$cond544 = $218 & $224;
  24671. $$559 = $or$cond544 ? 1.0 : 1.5;
  24672. $$$559 = $223 ? 0.5 : $$559;
  24673. $225 = ($$0520|0)==(0);
  24674. if ($225) {
  24675. $$1467 = $$$559;$$1469 = $$542;
  24676. } else {
  24677. $226 = HEAP8[$$0521>>0]|0;
  24678. $227 = ($226<<24>>24)==(45);
  24679. $228 = -$$542;
  24680. $229 = -$$$559;
  24681. $$$542 = $227 ? $228 : $$542;
  24682. $$$$559 = $227 ? $229 : $$$559;
  24683. $$1467 = $$$$559;$$1469 = $$$542;
  24684. }
  24685. $230 = (($214) - ($215))|0;
  24686. HEAP32[$210>>2] = $230;
  24687. $231 = $$1469 + $$1467;
  24688. $232 = $231 != $$1469;
  24689. if ($232) {
  24690. $233 = (($230) + ($$1531$lcssa))|0;
  24691. HEAP32[$210>>2] = $233;
  24692. $234 = ($233>>>0)>(999999999);
  24693. if ($234) {
  24694. $$5486623 = $$3484$lcssa;$$sink545622 = $210;
  24695. while(1) {
  24696. $235 = ((($$sink545622)) + -4|0);
  24697. HEAP32[$$sink545622>>2] = 0;
  24698. $236 = ($235>>>0)<($$5486623>>>0);
  24699. if ($236) {
  24700. $237 = ((($$5486623)) + -4|0);
  24701. HEAP32[$237>>2] = 0;
  24702. $$6 = $237;
  24703. } else {
  24704. $$6 = $$5486623;
  24705. }
  24706. $238 = HEAP32[$235>>2]|0;
  24707. $239 = (($238) + 1)|0;
  24708. HEAP32[$235>>2] = $239;
  24709. $240 = ($239>>>0)>(999999999);
  24710. if ($240) {
  24711. $$5486623 = $$6;$$sink545622 = $235;
  24712. } else {
  24713. $$5486$lcssa = $$6;$$sink545$lcssa = $235;
  24714. break;
  24715. }
  24716. }
  24717. } else {
  24718. $$5486$lcssa = $$3484$lcssa;$$sink545$lcssa = $210;
  24719. }
  24720. $241 = $$5486$lcssa;
  24721. $242 = (($183) - ($241))|0;
  24722. $243 = $242 >> 2;
  24723. $244 = ($243*9)|0;
  24724. $245 = HEAP32[$$5486$lcssa>>2]|0;
  24725. $246 = ($245>>>0)<(10);
  24726. if ($246) {
  24727. $$4492 = $$sink545$lcssa;$$4518 = $244;$$8 = $$5486$lcssa;
  24728. } else {
  24729. $$2516618 = $244;$$2532617 = 10;
  24730. while(1) {
  24731. $247 = ($$2532617*10)|0;
  24732. $248 = (($$2516618) + 1)|0;
  24733. $249 = ($245>>>0)<($247>>>0);
  24734. if ($249) {
  24735. $$4492 = $$sink545$lcssa;$$4518 = $248;$$8 = $$5486$lcssa;
  24736. break;
  24737. } else {
  24738. $$2516618 = $248;$$2532617 = $247;
  24739. }
  24740. }
  24741. }
  24742. } else {
  24743. $$4492 = $210;$$4518 = $$1515;$$8 = $$3484$lcssa;
  24744. }
  24745. }
  24746. $250 = ((($$4492)) + 4|0);
  24747. $251 = ($$3501$lcssa>>>0)>($250>>>0);
  24748. $$$3501 = $251 ? $250 : $$3501$lcssa;
  24749. $$5519$ph = $$4518;$$7505$ph = $$$3501;$$9$ph = $$8;
  24750. } else {
  24751. $$5519$ph = $$1515;$$7505$ph = $$3501$lcssa;$$9$ph = $$3484$lcssa;
  24752. }
  24753. $$7505 = $$7505$ph;
  24754. while(1) {
  24755. $252 = ($$7505>>>0)>($$9$ph>>>0);
  24756. if (!($252)) {
  24757. $$lcssa673 = 0;
  24758. break;
  24759. }
  24760. $253 = ((($$7505)) + -4|0);
  24761. $254 = HEAP32[$253>>2]|0;
  24762. $255 = ($254|0)==(0);
  24763. if ($255) {
  24764. $$7505 = $253;
  24765. } else {
  24766. $$lcssa673 = 1;
  24767. break;
  24768. }
  24769. }
  24770. $256 = (0 - ($$5519$ph))|0;
  24771. do {
  24772. if ($196) {
  24773. $not$ = $197 ^ 1;
  24774. $257 = $not$&1;
  24775. $$539$ = (($257) + ($$539))|0;
  24776. $258 = ($$539$|0)>($$5519$ph|0);
  24777. $259 = ($$5519$ph|0)>(-5);
  24778. $or$cond6 = $258 & $259;
  24779. if ($or$cond6) {
  24780. $260 = (($5) + -1)|0;
  24781. $$neg567 = (($$539$) + -1)|0;
  24782. $261 = (($$neg567) - ($$5519$ph))|0;
  24783. $$0479 = $260;$$2476 = $261;
  24784. } else {
  24785. $262 = (($5) + -2)|0;
  24786. $263 = (($$539$) + -1)|0;
  24787. $$0479 = $262;$$2476 = $263;
  24788. }
  24789. $264 = $4 & 8;
  24790. $265 = ($264|0)==(0);
  24791. if ($265) {
  24792. if ($$lcssa673) {
  24793. $266 = ((($$7505)) + -4|0);
  24794. $267 = HEAP32[$266>>2]|0;
  24795. $268 = ($267|0)==(0);
  24796. if ($268) {
  24797. $$2529 = 9;
  24798. } else {
  24799. $269 = (($267>>>0) % 10)&-1;
  24800. $270 = ($269|0)==(0);
  24801. if ($270) {
  24802. $$1528614 = 0;$$3533613 = 10;
  24803. while(1) {
  24804. $271 = ($$3533613*10)|0;
  24805. $272 = (($$1528614) + 1)|0;
  24806. $273 = (($267>>>0) % ($271>>>0))&-1;
  24807. $274 = ($273|0)==(0);
  24808. if ($274) {
  24809. $$1528614 = $272;$$3533613 = $271;
  24810. } else {
  24811. $$2529 = $272;
  24812. break;
  24813. }
  24814. }
  24815. } else {
  24816. $$2529 = 0;
  24817. }
  24818. }
  24819. } else {
  24820. $$2529 = 9;
  24821. }
  24822. $275 = $$0479 | 32;
  24823. $276 = ($275|0)==(102);
  24824. $277 = $$7505;
  24825. $278 = (($277) - ($183))|0;
  24826. $279 = $278 >> 2;
  24827. $280 = ($279*9)|0;
  24828. $281 = (($280) + -9)|0;
  24829. if ($276) {
  24830. $282 = (($281) - ($$2529))|0;
  24831. $283 = ($282|0)>(0);
  24832. $$546 = $283 ? $282 : 0;
  24833. $284 = ($$2476|0)<($$546|0);
  24834. $$2476$$547 = $284 ? $$2476 : $$546;
  24835. $$1480 = $$0479;$$3477 = $$2476$$547;$$pre$phi690Z2D = 0;
  24836. break;
  24837. } else {
  24838. $285 = (($281) + ($$5519$ph))|0;
  24839. $286 = (($285) - ($$2529))|0;
  24840. $287 = ($286|0)>(0);
  24841. $$548 = $287 ? $286 : 0;
  24842. $288 = ($$2476|0)<($$548|0);
  24843. $$2476$$549 = $288 ? $$2476 : $$548;
  24844. $$1480 = $$0479;$$3477 = $$2476$$549;$$pre$phi690Z2D = 0;
  24845. break;
  24846. }
  24847. } else {
  24848. $$1480 = $$0479;$$3477 = $$2476;$$pre$phi690Z2D = $264;
  24849. }
  24850. } else {
  24851. $$pre689 = $4 & 8;
  24852. $$1480 = $5;$$3477 = $$539;$$pre$phi690Z2D = $$pre689;
  24853. }
  24854. } while(0);
  24855. $289 = $$3477 | $$pre$phi690Z2D;
  24856. $290 = ($289|0)!=(0);
  24857. $291 = $290&1;
  24858. $292 = $$1480 | 32;
  24859. $293 = ($292|0)==(102);
  24860. if ($293) {
  24861. $294 = ($$5519$ph|0)>(0);
  24862. $295 = $294 ? $$5519$ph : 0;
  24863. $$2513 = 0;$$pn566 = $295;
  24864. } else {
  24865. $296 = ($$5519$ph|0)<(0);
  24866. $297 = $296 ? $256 : $$5519$ph;
  24867. $298 = ($297|0)<(0);
  24868. $299 = $298 << 31 >> 31;
  24869. $300 = (_fmt_u($297,$299,$11)|0);
  24870. $301 = $11;
  24871. $302 = $300;
  24872. $303 = (($301) - ($302))|0;
  24873. $304 = ($303|0)<(2);
  24874. if ($304) {
  24875. $$1512607 = $300;
  24876. while(1) {
  24877. $305 = ((($$1512607)) + -1|0);
  24878. HEAP8[$305>>0] = 48;
  24879. $306 = $305;
  24880. $307 = (($301) - ($306))|0;
  24881. $308 = ($307|0)<(2);
  24882. if ($308) {
  24883. $$1512607 = $305;
  24884. } else {
  24885. $$1512$lcssa = $305;
  24886. break;
  24887. }
  24888. }
  24889. } else {
  24890. $$1512$lcssa = $300;
  24891. }
  24892. $309 = $$5519$ph >> 31;
  24893. $310 = $309 & 2;
  24894. $311 = (($310) + 43)|0;
  24895. $312 = $311&255;
  24896. $313 = ((($$1512$lcssa)) + -1|0);
  24897. HEAP8[$313>>0] = $312;
  24898. $314 = $$1480&255;
  24899. $315 = ((($$1512$lcssa)) + -2|0);
  24900. HEAP8[$315>>0] = $314;
  24901. $316 = $315;
  24902. $317 = (($301) - ($316))|0;
  24903. $$2513 = $315;$$pn566 = $317;
  24904. }
  24905. $318 = (($$0520) + 1)|0;
  24906. $319 = (($318) + ($$3477))|0;
  24907. $$1526 = (($319) + ($291))|0;
  24908. $320 = (($$1526) + ($$pn566))|0;
  24909. _pad_672($0,32,$2,$320,$4);
  24910. _out($0,$$0521,$$0520);
  24911. $321 = $4 ^ 65536;
  24912. _pad_672($0,48,$2,$320,$321);
  24913. if ($293) {
  24914. $322 = ($$9$ph>>>0)>($$556>>>0);
  24915. $$0496$$9 = $322 ? $$556 : $$9$ph;
  24916. $323 = ((($8)) + 9|0);
  24917. $324 = $323;
  24918. $325 = ((($8)) + 8|0);
  24919. $$5493597 = $$0496$$9;
  24920. while(1) {
  24921. $326 = HEAP32[$$5493597>>2]|0;
  24922. $327 = (_fmt_u($326,0,$323)|0);
  24923. $328 = ($$5493597|0)==($$0496$$9|0);
  24924. if ($328) {
  24925. $334 = ($327|0)==($323|0);
  24926. if ($334) {
  24927. HEAP8[$325>>0] = 48;
  24928. $$1465 = $325;
  24929. } else {
  24930. $$1465 = $327;
  24931. }
  24932. } else {
  24933. $329 = ($327>>>0)>($8>>>0);
  24934. if ($329) {
  24935. $330 = $327;
  24936. $331 = (($330) - ($9))|0;
  24937. _memset(($8|0),48,($331|0))|0;
  24938. $$0464594 = $327;
  24939. while(1) {
  24940. $332 = ((($$0464594)) + -1|0);
  24941. $333 = ($332>>>0)>($8>>>0);
  24942. if ($333) {
  24943. $$0464594 = $332;
  24944. } else {
  24945. $$1465 = $332;
  24946. break;
  24947. }
  24948. }
  24949. } else {
  24950. $$1465 = $327;
  24951. }
  24952. }
  24953. $335 = $$1465;
  24954. $336 = (($324) - ($335))|0;
  24955. _out($0,$$1465,$336);
  24956. $337 = ((($$5493597)) + 4|0);
  24957. $338 = ($337>>>0)>($$556>>>0);
  24958. if ($338) {
  24959. break;
  24960. } else {
  24961. $$5493597 = $337;
  24962. }
  24963. }
  24964. $339 = ($289|0)==(0);
  24965. if (!($339)) {
  24966. _out($0,11688,1);
  24967. }
  24968. $340 = ($337>>>0)<($$7505>>>0);
  24969. $341 = ($$3477|0)>(0);
  24970. $342 = $340 & $341;
  24971. if ($342) {
  24972. $$4478590 = $$3477;$$6494589 = $337;
  24973. while(1) {
  24974. $343 = HEAP32[$$6494589>>2]|0;
  24975. $344 = (_fmt_u($343,0,$323)|0);
  24976. $345 = ($344>>>0)>($8>>>0);
  24977. if ($345) {
  24978. $346 = $344;
  24979. $347 = (($346) - ($9))|0;
  24980. _memset(($8|0),48,($347|0))|0;
  24981. $$0463584 = $344;
  24982. while(1) {
  24983. $348 = ((($$0463584)) + -1|0);
  24984. $349 = ($348>>>0)>($8>>>0);
  24985. if ($349) {
  24986. $$0463584 = $348;
  24987. } else {
  24988. $$0463$lcssa = $348;
  24989. break;
  24990. }
  24991. }
  24992. } else {
  24993. $$0463$lcssa = $344;
  24994. }
  24995. $350 = ($$4478590|0)<(9);
  24996. $351 = $350 ? $$4478590 : 9;
  24997. _out($0,$$0463$lcssa,$351);
  24998. $352 = ((($$6494589)) + 4|0);
  24999. $353 = (($$4478590) + -9)|0;
  25000. $354 = ($352>>>0)<($$7505>>>0);
  25001. $355 = ($$4478590|0)>(9);
  25002. $356 = $354 & $355;
  25003. if ($356) {
  25004. $$4478590 = $353;$$6494589 = $352;
  25005. } else {
  25006. $$4478$lcssa = $353;
  25007. break;
  25008. }
  25009. }
  25010. } else {
  25011. $$4478$lcssa = $$3477;
  25012. }
  25013. $357 = (($$4478$lcssa) + 9)|0;
  25014. _pad_672($0,48,$357,9,0);
  25015. } else {
  25016. $358 = ((($$9$ph)) + 4|0);
  25017. $$7505$ = $$lcssa673 ? $$7505 : $358;
  25018. $359 = ($$3477|0)>(-1);
  25019. if ($359) {
  25020. $360 = ((($8)) + 9|0);
  25021. $361 = ($$pre$phi690Z2D|0)==(0);
  25022. $362 = $360;
  25023. $363 = (0 - ($9))|0;
  25024. $364 = ((($8)) + 8|0);
  25025. $$5602 = $$3477;$$7495601 = $$9$ph;
  25026. while(1) {
  25027. $365 = HEAP32[$$7495601>>2]|0;
  25028. $366 = (_fmt_u($365,0,$360)|0);
  25029. $367 = ($366|0)==($360|0);
  25030. if ($367) {
  25031. HEAP8[$364>>0] = 48;
  25032. $$0 = $364;
  25033. } else {
  25034. $$0 = $366;
  25035. }
  25036. $368 = ($$7495601|0)==($$9$ph|0);
  25037. do {
  25038. if ($368) {
  25039. $372 = ((($$0)) + 1|0);
  25040. _out($0,$$0,1);
  25041. $373 = ($$5602|0)<(1);
  25042. $or$cond554 = $361 & $373;
  25043. if ($or$cond554) {
  25044. $$2 = $372;
  25045. break;
  25046. }
  25047. _out($0,11688,1);
  25048. $$2 = $372;
  25049. } else {
  25050. $369 = ($$0>>>0)>($8>>>0);
  25051. if (!($369)) {
  25052. $$2 = $$0;
  25053. break;
  25054. }
  25055. $scevgep684 = (($$0) + ($363)|0);
  25056. $scevgep684685 = $scevgep684;
  25057. _memset(($8|0),48,($scevgep684685|0))|0;
  25058. $$1598 = $$0;
  25059. while(1) {
  25060. $370 = ((($$1598)) + -1|0);
  25061. $371 = ($370>>>0)>($8>>>0);
  25062. if ($371) {
  25063. $$1598 = $370;
  25064. } else {
  25065. $$2 = $370;
  25066. break;
  25067. }
  25068. }
  25069. }
  25070. } while(0);
  25071. $374 = $$2;
  25072. $375 = (($362) - ($374))|0;
  25073. $376 = ($$5602|0)>($375|0);
  25074. $377 = $376 ? $375 : $$5602;
  25075. _out($0,$$2,$377);
  25076. $378 = (($$5602) - ($375))|0;
  25077. $379 = ((($$7495601)) + 4|0);
  25078. $380 = ($379>>>0)<($$7505$>>>0);
  25079. $381 = ($378|0)>(-1);
  25080. $382 = $380 & $381;
  25081. if ($382) {
  25082. $$5602 = $378;$$7495601 = $379;
  25083. } else {
  25084. $$5$lcssa = $378;
  25085. break;
  25086. }
  25087. }
  25088. } else {
  25089. $$5$lcssa = $$3477;
  25090. }
  25091. $383 = (($$5$lcssa) + 18)|0;
  25092. _pad_672($0,48,$383,18,0);
  25093. $384 = $11;
  25094. $385 = $$2513;
  25095. $386 = (($384) - ($385))|0;
  25096. _out($0,$$2513,$386);
  25097. }
  25098. $387 = $4 ^ 8192;
  25099. _pad_672($0,32,$2,$320,$387);
  25100. $$sink562 = $320;
  25101. } else {
  25102. $27 = $5 & 32;
  25103. $28 = ($27|0)!=(0);
  25104. $29 = $28 ? 11656 : 11660;
  25105. $30 = ($$0471 != $$0471) | (0.0 != 0.0);
  25106. $31 = $28 ? 11664 : 11668;
  25107. $$0510 = $30 ? $31 : $29;
  25108. $32 = (($$0520) + 3)|0;
  25109. $33 = $4 & -65537;
  25110. _pad_672($0,32,$2,$32,$33);
  25111. _out($0,$$0521,$$0520);
  25112. _out($0,$$0510,3);
  25113. $34 = $4 ^ 8192;
  25114. _pad_672($0,32,$2,$32,$34);
  25115. $$sink562 = $32;
  25116. }
  25117. } while(0);
  25118. $388 = ($$sink562|0)<($2|0);
  25119. $$555 = $388 ? $2 : $$sink562;
  25120. STACKTOP = sp;return ($$555|0);
  25121. }
  25122. function ___DOUBLE_BITS_673($0) {
  25123. $0 = +$0;
  25124. var $1 = 0, $2 = 0, label = 0, sp = 0;
  25125. sp = STACKTOP;
  25126. HEAPF64[tempDoublePtr>>3] = $0;$1 = HEAP32[tempDoublePtr>>2]|0;
  25127. $2 = HEAP32[tempDoublePtr+4>>2]|0;
  25128. tempRet0 = ($2);
  25129. return ($1|0);
  25130. }
  25131. function _frexpl($0,$1) {
  25132. $0 = +$0;
  25133. $1 = $1|0;
  25134. var $2 = 0.0, label = 0, sp = 0;
  25135. sp = STACKTOP;
  25136. $2 = (+_frexp($0,$1));
  25137. return (+$2);
  25138. }
  25139. function _frexp($0,$1) {
  25140. $0 = +$0;
  25141. $1 = $1|0;
  25142. var $$0 = 0.0, $$016 = 0.0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0.0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0.0, $9 = 0.0, $storemerge = 0, $trunc$clear = 0, label = 0;
  25143. var sp = 0;
  25144. sp = STACKTOP;
  25145. HEAPF64[tempDoublePtr>>3] = $0;$2 = HEAP32[tempDoublePtr>>2]|0;
  25146. $3 = HEAP32[tempDoublePtr+4>>2]|0;
  25147. $4 = (_bitshift64Lshr(($2|0),($3|0),52)|0);
  25148. $5 = tempRet0;
  25149. $6 = $4&65535;
  25150. $trunc$clear = $6 & 2047;
  25151. switch ($trunc$clear<<16>>16) {
  25152. case 0: {
  25153. $7 = $0 != 0.0;
  25154. if ($7) {
  25155. $8 = $0 * 1.8446744073709552E+19;
  25156. $9 = (+_frexp($8,$1));
  25157. $10 = HEAP32[$1>>2]|0;
  25158. $11 = (($10) + -64)|0;
  25159. $$016 = $9;$storemerge = $11;
  25160. } else {
  25161. $$016 = $0;$storemerge = 0;
  25162. }
  25163. HEAP32[$1>>2] = $storemerge;
  25164. $$0 = $$016;
  25165. break;
  25166. }
  25167. case 2047: {
  25168. $$0 = $0;
  25169. break;
  25170. }
  25171. default: {
  25172. $12 = $4 & 2047;
  25173. $13 = (($12) + -1022)|0;
  25174. HEAP32[$1>>2] = $13;
  25175. $14 = $3 & -2146435073;
  25176. $15 = $14 | 1071644672;
  25177. HEAP32[tempDoublePtr>>2] = $2;HEAP32[tempDoublePtr+4>>2] = $15;$16 = +HEAPF64[tempDoublePtr>>3];
  25178. $$0 = $16;
  25179. }
  25180. }
  25181. return (+$$0);
  25182. }
  25183. function _wcrtomb($0,$1,$2) {
  25184. $0 = $0|0;
  25185. $1 = $1|0;
  25186. $2 = $2|0;
  25187. var $$0 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0;
  25188. var $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0;
  25189. var $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $not$ = 0, $or$cond = 0, label = 0, sp = 0;
  25190. sp = STACKTOP;
  25191. $3 = ($0|0)==(0|0);
  25192. do {
  25193. if ($3) {
  25194. $$0 = 1;
  25195. } else {
  25196. $4 = ($1>>>0)<(128);
  25197. if ($4) {
  25198. $5 = $1&255;
  25199. HEAP8[$0>>0] = $5;
  25200. $$0 = 1;
  25201. break;
  25202. }
  25203. $6 = (___pthread_self_446()|0);
  25204. $7 = ((($6)) + 188|0);
  25205. $8 = HEAP32[$7>>2]|0;
  25206. $9 = (Atomics_load(HEAP32,$8>>2)|0);
  25207. $not$ = ($9|0)==(0|0);
  25208. if ($not$) {
  25209. $10 = $1 & -128;
  25210. $11 = ($10|0)==(57216);
  25211. if ($11) {
  25212. $13 = $1&255;
  25213. HEAP8[$0>>0] = $13;
  25214. $$0 = 1;
  25215. break;
  25216. } else {
  25217. $12 = (___errno_location()|0);
  25218. HEAP32[$12>>2] = 84;
  25219. $$0 = -1;
  25220. break;
  25221. }
  25222. }
  25223. $14 = ($1>>>0)<(2048);
  25224. if ($14) {
  25225. $15 = $1 >>> 6;
  25226. $16 = $15 | 192;
  25227. $17 = $16&255;
  25228. $18 = ((($0)) + 1|0);
  25229. HEAP8[$0>>0] = $17;
  25230. $19 = $1 & 63;
  25231. $20 = $19 | 128;
  25232. $21 = $20&255;
  25233. HEAP8[$18>>0] = $21;
  25234. $$0 = 2;
  25235. break;
  25236. }
  25237. $22 = ($1>>>0)<(55296);
  25238. $23 = $1 & -8192;
  25239. $24 = ($23|0)==(57344);
  25240. $or$cond = $22 | $24;
  25241. if ($or$cond) {
  25242. $25 = $1 >>> 12;
  25243. $26 = $25 | 224;
  25244. $27 = $26&255;
  25245. $28 = ((($0)) + 1|0);
  25246. HEAP8[$0>>0] = $27;
  25247. $29 = $1 >>> 6;
  25248. $30 = $29 & 63;
  25249. $31 = $30 | 128;
  25250. $32 = $31&255;
  25251. $33 = ((($0)) + 2|0);
  25252. HEAP8[$28>>0] = $32;
  25253. $34 = $1 & 63;
  25254. $35 = $34 | 128;
  25255. $36 = $35&255;
  25256. HEAP8[$33>>0] = $36;
  25257. $$0 = 3;
  25258. break;
  25259. }
  25260. $37 = (($1) + -65536)|0;
  25261. $38 = ($37>>>0)<(1048576);
  25262. if ($38) {
  25263. $39 = $1 >>> 18;
  25264. $40 = $39 | 240;
  25265. $41 = $40&255;
  25266. $42 = ((($0)) + 1|0);
  25267. HEAP8[$0>>0] = $41;
  25268. $43 = $1 >>> 12;
  25269. $44 = $43 & 63;
  25270. $45 = $44 | 128;
  25271. $46 = $45&255;
  25272. $47 = ((($0)) + 2|0);
  25273. HEAP8[$42>>0] = $46;
  25274. $48 = $1 >>> 6;
  25275. $49 = $48 & 63;
  25276. $50 = $49 | 128;
  25277. $51 = $50&255;
  25278. $52 = ((($0)) + 3|0);
  25279. HEAP8[$47>>0] = $51;
  25280. $53 = $1 & 63;
  25281. $54 = $53 | 128;
  25282. $55 = $54&255;
  25283. HEAP8[$52>>0] = $55;
  25284. $$0 = 4;
  25285. break;
  25286. } else {
  25287. $56 = (___errno_location()|0);
  25288. HEAP32[$56>>2] = 84;
  25289. $$0 = -1;
  25290. break;
  25291. }
  25292. }
  25293. } while(0);
  25294. return ($$0|0);
  25295. }
  25296. function ___pthread_self_446() {
  25297. var $0 = 0, label = 0, sp = 0;
  25298. sp = STACKTOP;
  25299. $0 = (_pthread_self()|0);
  25300. return ($0|0);
  25301. }
  25302. function ___pthread_self_105() {
  25303. var $0 = 0, label = 0, sp = 0;
  25304. sp = STACKTOP;
  25305. $0 = (_pthread_self()|0);
  25306. return ($0|0);
  25307. }
  25308. function ___strerror_l($0,$1) {
  25309. $0 = $0|0;
  25310. $1 = $1|0;
  25311. var $$012$lcssa = 0, $$01214 = 0, $$016 = 0, $$113 = 0, $$115 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0;
  25312. var label = 0, sp = 0;
  25313. sp = STACKTOP;
  25314. $$016 = 0;
  25315. while(1) {
  25316. $3 = (11690 + ($$016)|0);
  25317. $4 = HEAP8[$3>>0]|0;
  25318. $5 = $4&255;
  25319. $6 = ($5|0)==($0|0);
  25320. if ($6) {
  25321. label = 2;
  25322. break;
  25323. }
  25324. $7 = (($$016) + 1)|0;
  25325. $8 = ($7|0)==(87);
  25326. if ($8) {
  25327. $$01214 = 11778;$$115 = 87;
  25328. label = 5;
  25329. break;
  25330. } else {
  25331. $$016 = $7;
  25332. }
  25333. }
  25334. if ((label|0) == 2) {
  25335. $2 = ($$016|0)==(0);
  25336. if ($2) {
  25337. $$012$lcssa = 11778;
  25338. } else {
  25339. $$01214 = 11778;$$115 = $$016;
  25340. label = 5;
  25341. }
  25342. }
  25343. if ((label|0) == 5) {
  25344. while(1) {
  25345. label = 0;
  25346. $$113 = $$01214;
  25347. while(1) {
  25348. $9 = HEAP8[$$113>>0]|0;
  25349. $10 = ($9<<24>>24)==(0);
  25350. $11 = ((($$113)) + 1|0);
  25351. if ($10) {
  25352. break;
  25353. } else {
  25354. $$113 = $11;
  25355. }
  25356. }
  25357. $12 = (($$115) + -1)|0;
  25358. $13 = ($12|0)==(0);
  25359. if ($13) {
  25360. $$012$lcssa = $11;
  25361. break;
  25362. } else {
  25363. $$01214 = $11;$$115 = $12;
  25364. label = 5;
  25365. }
  25366. }
  25367. }
  25368. $14 = ((($1)) + 20|0);
  25369. $15 = (Atomics_load(HEAP32,$14>>2)|0);
  25370. $16 = (___lctrans($$012$lcssa,$15)|0);
  25371. return ($16|0);
  25372. }
  25373. function ___lctrans($0,$1) {
  25374. $0 = $0|0;
  25375. $1 = $1|0;
  25376. var $2 = 0, label = 0, sp = 0;
  25377. sp = STACKTOP;
  25378. $2 = (___lctrans_impl($0,$1)|0);
  25379. return ($2|0);
  25380. }
  25381. function ___lctrans_impl($0,$1) {
  25382. $0 = $0|0;
  25383. $1 = $1|0;
  25384. var $$0 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, label = 0, sp = 0;
  25385. sp = STACKTOP;
  25386. $2 = ($1|0)==(0|0);
  25387. if ($2) {
  25388. $$0 = 0;
  25389. } else {
  25390. $3 = HEAP32[$1>>2]|0;
  25391. $4 = ((($1)) + 4|0);
  25392. $5 = HEAP32[$4>>2]|0;
  25393. $6 = (___mo_lookup($3,$5,$0)|0);
  25394. $$0 = $6;
  25395. }
  25396. $7 = ($$0|0)!=(0|0);
  25397. $8 = $7 ? $$0 : $0;
  25398. return ($8|0);
  25399. }
  25400. function ___mo_lookup($0,$1,$2) {
  25401. $0 = $0|0;
  25402. $1 = $1|0;
  25403. $2 = $2|0;
  25404. var $$ = 0, $$090 = 0, $$094 = 0, $$191 = 0, $$195 = 0, $$4 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0;
  25405. var $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0;
  25406. var $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0;
  25407. var $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, $or$cond102 = 0, $or$cond104 = 0, label = 0, sp = 0;
  25408. sp = STACKTOP;
  25409. $3 = HEAP32[$0>>2]|0;
  25410. $4 = (($3) + 1794895138)|0;
  25411. $5 = ((($0)) + 8|0);
  25412. $6 = HEAP32[$5>>2]|0;
  25413. $7 = (_swapc($6,$4)|0);
  25414. $8 = ((($0)) + 12|0);
  25415. $9 = HEAP32[$8>>2]|0;
  25416. $10 = (_swapc($9,$4)|0);
  25417. $11 = ((($0)) + 16|0);
  25418. $12 = HEAP32[$11>>2]|0;
  25419. $13 = (_swapc($12,$4)|0);
  25420. $14 = $1 >>> 2;
  25421. $15 = ($7>>>0)<($14>>>0);
  25422. L1: do {
  25423. if ($15) {
  25424. $16 = $7 << 2;
  25425. $17 = (($1) - ($16))|0;
  25426. $18 = ($10>>>0)<($17>>>0);
  25427. $19 = ($13>>>0)<($17>>>0);
  25428. $or$cond = $18 & $19;
  25429. if ($or$cond) {
  25430. $20 = $13 | $10;
  25431. $21 = $20 & 3;
  25432. $22 = ($21|0)==(0);
  25433. if ($22) {
  25434. $23 = $10 >>> 2;
  25435. $24 = $13 >>> 2;
  25436. $$090 = 0;$$094 = $7;
  25437. while(1) {
  25438. $25 = $$094 >>> 1;
  25439. $26 = (($$090) + ($25))|0;
  25440. $27 = $26 << 1;
  25441. $28 = (($27) + ($23))|0;
  25442. $29 = (($0) + ($28<<2)|0);
  25443. $30 = HEAP32[$29>>2]|0;
  25444. $31 = (_swapc($30,$4)|0);
  25445. $32 = (($28) + 1)|0;
  25446. $33 = (($0) + ($32<<2)|0);
  25447. $34 = HEAP32[$33>>2]|0;
  25448. $35 = (_swapc($34,$4)|0);
  25449. $36 = ($35>>>0)<($1>>>0);
  25450. $37 = (($1) - ($35))|0;
  25451. $38 = ($31>>>0)<($37>>>0);
  25452. $or$cond102 = $36 & $38;
  25453. if (!($or$cond102)) {
  25454. $$4 = 0;
  25455. break L1;
  25456. }
  25457. $39 = (($35) + ($31))|0;
  25458. $40 = (($0) + ($39)|0);
  25459. $41 = HEAP8[$40>>0]|0;
  25460. $42 = ($41<<24>>24)==(0);
  25461. if (!($42)) {
  25462. $$4 = 0;
  25463. break L1;
  25464. }
  25465. $43 = (($0) + ($35)|0);
  25466. $44 = (_strcmp($2,$43)|0);
  25467. $45 = ($44|0)==(0);
  25468. if ($45) {
  25469. break;
  25470. }
  25471. $62 = ($$094|0)==(1);
  25472. $63 = ($44|0)<(0);
  25473. $64 = (($$094) - ($25))|0;
  25474. $$195 = $63 ? $25 : $64;
  25475. $$191 = $63 ? $$090 : $26;
  25476. if ($62) {
  25477. $$4 = 0;
  25478. break L1;
  25479. } else {
  25480. $$090 = $$191;$$094 = $$195;
  25481. }
  25482. }
  25483. $46 = (($27) + ($24))|0;
  25484. $47 = (($0) + ($46<<2)|0);
  25485. $48 = HEAP32[$47>>2]|0;
  25486. $49 = (_swapc($48,$4)|0);
  25487. $50 = (($46) + 1)|0;
  25488. $51 = (($0) + ($50<<2)|0);
  25489. $52 = HEAP32[$51>>2]|0;
  25490. $53 = (_swapc($52,$4)|0);
  25491. $54 = ($53>>>0)<($1>>>0);
  25492. $55 = (($1) - ($53))|0;
  25493. $56 = ($49>>>0)<($55>>>0);
  25494. $or$cond104 = $54 & $56;
  25495. if ($or$cond104) {
  25496. $57 = (($0) + ($53)|0);
  25497. $58 = (($53) + ($49))|0;
  25498. $59 = (($0) + ($58)|0);
  25499. $60 = HEAP8[$59>>0]|0;
  25500. $61 = ($60<<24>>24)==(0);
  25501. $$ = $61 ? $57 : 0;
  25502. $$4 = $$;
  25503. } else {
  25504. $$4 = 0;
  25505. }
  25506. } else {
  25507. $$4 = 0;
  25508. }
  25509. } else {
  25510. $$4 = 0;
  25511. }
  25512. } else {
  25513. $$4 = 0;
  25514. }
  25515. } while(0);
  25516. return ($$4|0);
  25517. }
  25518. function _swapc($0,$1) {
  25519. $0 = $0|0;
  25520. $1 = $1|0;
  25521. var $$ = 0, $2 = 0, $3 = 0, label = 0, sp = 0;
  25522. sp = STACKTOP;
  25523. $2 = ($1|0)==(0);
  25524. $3 = (_llvm_bswap_i32(($0|0))|0);
  25525. $$ = $2 ? $0 : $3;
  25526. return ($$|0);
  25527. }
  25528. function ___fwritex($0,$1,$2) {
  25529. $0 = $0|0;
  25530. $1 = $1|0;
  25531. $2 = $2|0;
  25532. var $$038 = 0, $$042 = 0, $$1 = 0, $$139 = 0, $$141 = 0, $$143 = 0, $$pre = 0, $$pre47 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0;
  25533. var $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0;
  25534. var label = 0, sp = 0;
  25535. sp = STACKTOP;
  25536. $3 = ((($2)) + 16|0);
  25537. $4 = HEAP32[$3>>2]|0;
  25538. $5 = ($4|0)==(0|0);
  25539. if ($5) {
  25540. $7 = (___towrite($2)|0);
  25541. $8 = ($7|0)==(0);
  25542. if ($8) {
  25543. $$pre = HEAP32[$3>>2]|0;
  25544. $12 = $$pre;
  25545. label = 5;
  25546. } else {
  25547. $$1 = 0;
  25548. }
  25549. } else {
  25550. $6 = $4;
  25551. $12 = $6;
  25552. label = 5;
  25553. }
  25554. L5: do {
  25555. if ((label|0) == 5) {
  25556. $9 = ((($2)) + 20|0);
  25557. $10 = HEAP32[$9>>2]|0;
  25558. $11 = (($12) - ($10))|0;
  25559. $13 = ($11>>>0)<($1>>>0);
  25560. $14 = $10;
  25561. if ($13) {
  25562. $15 = ((($2)) + 36|0);
  25563. $16 = HEAP32[$15>>2]|0;
  25564. $17 = (FUNCTION_TABLE_iiii[$16 & 15]($2,$0,$1)|0);
  25565. $$1 = $17;
  25566. break;
  25567. }
  25568. $18 = ((($2)) + 75|0);
  25569. $19 = HEAP8[$18>>0]|0;
  25570. $20 = ($19<<24>>24)>(-1);
  25571. L10: do {
  25572. if ($20) {
  25573. $$038 = $1;
  25574. while(1) {
  25575. $21 = ($$038|0)==(0);
  25576. if ($21) {
  25577. $$139 = 0;$$141 = $0;$$143 = $1;$31 = $14;
  25578. break L10;
  25579. }
  25580. $22 = (($$038) + -1)|0;
  25581. $23 = (($0) + ($22)|0);
  25582. $24 = HEAP8[$23>>0]|0;
  25583. $25 = ($24<<24>>24)==(10);
  25584. if ($25) {
  25585. break;
  25586. } else {
  25587. $$038 = $22;
  25588. }
  25589. }
  25590. $26 = ((($2)) + 36|0);
  25591. $27 = HEAP32[$26>>2]|0;
  25592. $28 = (FUNCTION_TABLE_iiii[$27 & 15]($2,$0,$$038)|0);
  25593. $29 = ($28>>>0)<($$038>>>0);
  25594. if ($29) {
  25595. $$1 = $28;
  25596. break L5;
  25597. }
  25598. $30 = (($0) + ($$038)|0);
  25599. $$042 = (($1) - ($$038))|0;
  25600. $$pre47 = HEAP32[$9>>2]|0;
  25601. $$139 = $$038;$$141 = $30;$$143 = $$042;$31 = $$pre47;
  25602. } else {
  25603. $$139 = 0;$$141 = $0;$$143 = $1;$31 = $14;
  25604. }
  25605. } while(0);
  25606. _memcpy(($31|0),($$141|0),($$143|0))|0;
  25607. $32 = HEAP32[$9>>2]|0;
  25608. $33 = (($32) + ($$143)|0);
  25609. HEAP32[$9>>2] = $33;
  25610. $34 = (($$139) + ($$143))|0;
  25611. $$1 = $34;
  25612. }
  25613. } while(0);
  25614. return ($$1|0);
  25615. }
  25616. function ___towrite($0) {
  25617. $0 = $0|0;
  25618. var $$0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0;
  25619. var $9 = 0, label = 0, sp = 0;
  25620. sp = STACKTOP;
  25621. $1 = ((($0)) + 74|0);
  25622. $2 = HEAP8[$1>>0]|0;
  25623. $3 = $2 << 24 >> 24;
  25624. $4 = (($3) + 255)|0;
  25625. $5 = $4 | $3;
  25626. $6 = $5&255;
  25627. HEAP8[$1>>0] = $6;
  25628. $7 = HEAP32[$0>>2]|0;
  25629. $8 = $7 & 8;
  25630. $9 = ($8|0)==(0);
  25631. if ($9) {
  25632. $11 = ((($0)) + 8|0);
  25633. HEAP32[$11>>2] = 0;
  25634. $12 = ((($0)) + 4|0);
  25635. HEAP32[$12>>2] = 0;
  25636. $13 = ((($0)) + 44|0);
  25637. $14 = HEAP32[$13>>2]|0;
  25638. $15 = ((($0)) + 28|0);
  25639. HEAP32[$15>>2] = $14;
  25640. $16 = ((($0)) + 20|0);
  25641. HEAP32[$16>>2] = $14;
  25642. $17 = ((($0)) + 48|0);
  25643. $18 = HEAP32[$17>>2]|0;
  25644. $19 = (($14) + ($18)|0);
  25645. $20 = ((($0)) + 16|0);
  25646. HEAP32[$20>>2] = $19;
  25647. $$0 = 0;
  25648. } else {
  25649. $10 = $7 | 32;
  25650. HEAP32[$0>>2] = $10;
  25651. $$0 = -1;
  25652. }
  25653. return ($$0|0);
  25654. }
  25655. function _sn_write($0,$1,$2) {
  25656. $0 = $0|0;
  25657. $1 = $1|0;
  25658. $2 = $2|0;
  25659. var $$ = 0, $10 = 0, $11 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  25660. sp = STACKTOP;
  25661. $3 = ((($0)) + 16|0);
  25662. $4 = HEAP32[$3>>2]|0;
  25663. $5 = ((($0)) + 20|0);
  25664. $6 = HEAP32[$5>>2]|0;
  25665. $7 = $6;
  25666. $8 = (($4) - ($7))|0;
  25667. $9 = ($8>>>0)>($2>>>0);
  25668. $$ = $9 ? $2 : $8;
  25669. _memcpy(($6|0),($1|0),($$|0))|0;
  25670. $10 = HEAP32[$5>>2]|0;
  25671. $11 = (($10) + ($$)|0);
  25672. HEAP32[$5>>2] = $11;
  25673. return ($2|0);
  25674. }
  25675. function _strlen($0) {
  25676. $0 = $0|0;
  25677. var $$0 = 0, $$015$lcssa = 0, $$01519 = 0, $$1$lcssa = 0, $$pn = 0, $$pre = 0, $$sink = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0;
  25678. var $21 = 0, $22 = 0, $23 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  25679. sp = STACKTOP;
  25680. $1 = $0;
  25681. $2 = $1 & 3;
  25682. $3 = ($2|0)==(0);
  25683. L1: do {
  25684. if ($3) {
  25685. $$015$lcssa = $0;
  25686. label = 4;
  25687. } else {
  25688. $$01519 = $0;$23 = $1;
  25689. while(1) {
  25690. $4 = HEAP8[$$01519>>0]|0;
  25691. $5 = ($4<<24>>24)==(0);
  25692. if ($5) {
  25693. $$sink = $23;
  25694. break L1;
  25695. }
  25696. $6 = ((($$01519)) + 1|0);
  25697. $7 = $6;
  25698. $8 = $7 & 3;
  25699. $9 = ($8|0)==(0);
  25700. if ($9) {
  25701. $$015$lcssa = $6;
  25702. label = 4;
  25703. break;
  25704. } else {
  25705. $$01519 = $6;$23 = $7;
  25706. }
  25707. }
  25708. }
  25709. } while(0);
  25710. if ((label|0) == 4) {
  25711. $$0 = $$015$lcssa;
  25712. while(1) {
  25713. $10 = HEAP32[$$0>>2]|0;
  25714. $11 = (($10) + -16843009)|0;
  25715. $12 = $10 & -2139062144;
  25716. $13 = $12 ^ -2139062144;
  25717. $14 = $13 & $11;
  25718. $15 = ($14|0)==(0);
  25719. $16 = ((($$0)) + 4|0);
  25720. if ($15) {
  25721. $$0 = $16;
  25722. } else {
  25723. break;
  25724. }
  25725. }
  25726. $17 = $10&255;
  25727. $18 = ($17<<24>>24)==(0);
  25728. if ($18) {
  25729. $$1$lcssa = $$0;
  25730. } else {
  25731. $$pn = $$0;
  25732. while(1) {
  25733. $19 = ((($$pn)) + 1|0);
  25734. $$pre = HEAP8[$19>>0]|0;
  25735. $20 = ($$pre<<24>>24)==(0);
  25736. if ($20) {
  25737. $$1$lcssa = $19;
  25738. break;
  25739. } else {
  25740. $$pn = $19;
  25741. }
  25742. }
  25743. }
  25744. $21 = $$1$lcssa;
  25745. $$sink = $21;
  25746. }
  25747. $22 = (($$sink) - ($1))|0;
  25748. return ($22|0);
  25749. }
  25750. function _strchr($0,$1) {
  25751. $0 = $0|0;
  25752. $1 = $1|0;
  25753. var $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, label = 0, sp = 0;
  25754. sp = STACKTOP;
  25755. $2 = (___strchrnul($0,$1)|0);
  25756. $3 = HEAP8[$2>>0]|0;
  25757. $4 = $1&255;
  25758. $5 = ($3<<24>>24)==($4<<24>>24);
  25759. $6 = $5 ? $2 : 0;
  25760. return ($6|0);
  25761. }
  25762. function ___strchrnul($0,$1) {
  25763. $0 = $0|0;
  25764. $1 = $1|0;
  25765. var $$0 = 0, $$029$lcssa = 0, $$02936 = 0, $$030$lcssa = 0, $$03039 = 0, $$1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0;
  25766. var $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0;
  25767. var $41 = 0, $42 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, $or$cond33 = 0, label = 0, sp = 0;
  25768. sp = STACKTOP;
  25769. $2 = $1 & 255;
  25770. $3 = ($2|0)==(0);
  25771. L1: do {
  25772. if ($3) {
  25773. $8 = (_strlen($0)|0);
  25774. $9 = (($0) + ($8)|0);
  25775. $$0 = $9;
  25776. } else {
  25777. $4 = $0;
  25778. $5 = $4 & 3;
  25779. $6 = ($5|0)==(0);
  25780. if ($6) {
  25781. $$030$lcssa = $0;
  25782. } else {
  25783. $7 = $1&255;
  25784. $$03039 = $0;
  25785. while(1) {
  25786. $10 = HEAP8[$$03039>>0]|0;
  25787. $11 = ($10<<24>>24)==(0);
  25788. $12 = ($10<<24>>24)==($7<<24>>24);
  25789. $or$cond = $11 | $12;
  25790. if ($or$cond) {
  25791. $$0 = $$03039;
  25792. break L1;
  25793. }
  25794. $13 = ((($$03039)) + 1|0);
  25795. $14 = $13;
  25796. $15 = $14 & 3;
  25797. $16 = ($15|0)==(0);
  25798. if ($16) {
  25799. $$030$lcssa = $13;
  25800. break;
  25801. } else {
  25802. $$03039 = $13;
  25803. }
  25804. }
  25805. }
  25806. $17 = Math_imul($2, 16843009)|0;
  25807. $18 = HEAP32[$$030$lcssa>>2]|0;
  25808. $19 = (($18) + -16843009)|0;
  25809. $20 = $18 & -2139062144;
  25810. $21 = $20 ^ -2139062144;
  25811. $22 = $21 & $19;
  25812. $23 = ($22|0)==(0);
  25813. L10: do {
  25814. if ($23) {
  25815. $$02936 = $$030$lcssa;$25 = $18;
  25816. while(1) {
  25817. $24 = $25 ^ $17;
  25818. $26 = (($24) + -16843009)|0;
  25819. $27 = $24 & -2139062144;
  25820. $28 = $27 ^ -2139062144;
  25821. $29 = $28 & $26;
  25822. $30 = ($29|0)==(0);
  25823. if (!($30)) {
  25824. $$029$lcssa = $$02936;
  25825. break L10;
  25826. }
  25827. $31 = ((($$02936)) + 4|0);
  25828. $32 = HEAP32[$31>>2]|0;
  25829. $33 = (($32) + -16843009)|0;
  25830. $34 = $32 & -2139062144;
  25831. $35 = $34 ^ -2139062144;
  25832. $36 = $35 & $33;
  25833. $37 = ($36|0)==(0);
  25834. if ($37) {
  25835. $$02936 = $31;$25 = $32;
  25836. } else {
  25837. $$029$lcssa = $31;
  25838. break;
  25839. }
  25840. }
  25841. } else {
  25842. $$029$lcssa = $$030$lcssa;
  25843. }
  25844. } while(0);
  25845. $38 = $1&255;
  25846. $$1 = $$029$lcssa;
  25847. while(1) {
  25848. $39 = HEAP8[$$1>>0]|0;
  25849. $40 = ($39<<24>>24)==(0);
  25850. $41 = ($39<<24>>24)==($38<<24>>24);
  25851. $or$cond33 = $40 | $41;
  25852. $42 = ((($$1)) + 1|0);
  25853. if ($or$cond33) {
  25854. $$0 = $$1;
  25855. break;
  25856. } else {
  25857. $$1 = $42;
  25858. }
  25859. }
  25860. }
  25861. } while(0);
  25862. return ($$0|0);
  25863. }
  25864. function _strcpy($0,$1) {
  25865. $0 = $0|0;
  25866. $1 = $1|0;
  25867. var label = 0, sp = 0;
  25868. sp = STACKTOP;
  25869. (___stpcpy($0,$1)|0);
  25870. return ($0|0);
  25871. }
  25872. function ___stpcpy($0,$1) {
  25873. $0 = $0|0;
  25874. $1 = $1|0;
  25875. var $$0$lcssa = 0, $$025$lcssa = 0, $$02536 = 0, $$026$lcssa = 0, $$02642 = 0, $$027$lcssa = 0, $$02741 = 0, $$029 = 0, $$037 = 0, $$1$ph = 0, $$128$ph = 0, $$12834 = 0, $$135 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0;
  25876. var $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0;
  25877. var $35 = 0, $36 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  25878. sp = STACKTOP;
  25879. $2 = $1;
  25880. $3 = $0;
  25881. $4 = $2 ^ $3;
  25882. $5 = $4 & 3;
  25883. $6 = ($5|0)==(0);
  25884. L1: do {
  25885. if ($6) {
  25886. $7 = $2 & 3;
  25887. $8 = ($7|0)==(0);
  25888. if ($8) {
  25889. $$026$lcssa = $1;$$027$lcssa = $0;
  25890. } else {
  25891. $$02642 = $1;$$02741 = $0;
  25892. while(1) {
  25893. $9 = HEAP8[$$02642>>0]|0;
  25894. HEAP8[$$02741>>0] = $9;
  25895. $10 = ($9<<24>>24)==(0);
  25896. if ($10) {
  25897. $$029 = $$02741;
  25898. break L1;
  25899. }
  25900. $11 = ((($$02642)) + 1|0);
  25901. $12 = ((($$02741)) + 1|0);
  25902. $13 = $11;
  25903. $14 = $13 & 3;
  25904. $15 = ($14|0)==(0);
  25905. if ($15) {
  25906. $$026$lcssa = $11;$$027$lcssa = $12;
  25907. break;
  25908. } else {
  25909. $$02642 = $11;$$02741 = $12;
  25910. }
  25911. }
  25912. }
  25913. $16 = HEAP32[$$026$lcssa>>2]|0;
  25914. $17 = (($16) + -16843009)|0;
  25915. $18 = $16 & -2139062144;
  25916. $19 = $18 ^ -2139062144;
  25917. $20 = $19 & $17;
  25918. $21 = ($20|0)==(0);
  25919. if ($21) {
  25920. $$02536 = $$027$lcssa;$$037 = $$026$lcssa;$24 = $16;
  25921. while(1) {
  25922. $22 = ((($$037)) + 4|0);
  25923. $23 = ((($$02536)) + 4|0);
  25924. HEAP32[$$02536>>2] = $24;
  25925. $25 = HEAP32[$22>>2]|0;
  25926. $26 = (($25) + -16843009)|0;
  25927. $27 = $25 & -2139062144;
  25928. $28 = $27 ^ -2139062144;
  25929. $29 = $28 & $26;
  25930. $30 = ($29|0)==(0);
  25931. if ($30) {
  25932. $$02536 = $23;$$037 = $22;$24 = $25;
  25933. } else {
  25934. $$0$lcssa = $22;$$025$lcssa = $23;
  25935. break;
  25936. }
  25937. }
  25938. } else {
  25939. $$0$lcssa = $$026$lcssa;$$025$lcssa = $$027$lcssa;
  25940. }
  25941. $$1$ph = $$0$lcssa;$$128$ph = $$025$lcssa;
  25942. label = 8;
  25943. } else {
  25944. $$1$ph = $1;$$128$ph = $0;
  25945. label = 8;
  25946. }
  25947. } while(0);
  25948. if ((label|0) == 8) {
  25949. $31 = HEAP8[$$1$ph>>0]|0;
  25950. HEAP8[$$128$ph>>0] = $31;
  25951. $32 = ($31<<24>>24)==(0);
  25952. if ($32) {
  25953. $$029 = $$128$ph;
  25954. } else {
  25955. $$12834 = $$128$ph;$$135 = $$1$ph;
  25956. while(1) {
  25957. $33 = ((($$135)) + 1|0);
  25958. $34 = ((($$12834)) + 1|0);
  25959. $35 = HEAP8[$33>>0]|0;
  25960. HEAP8[$34>>0] = $35;
  25961. $36 = ($35<<24>>24)==(0);
  25962. if ($36) {
  25963. $$029 = $34;
  25964. break;
  25965. } else {
  25966. $$12834 = $34;$$135 = $33;
  25967. }
  25968. }
  25969. }
  25970. }
  25971. return ($$029|0);
  25972. }
  25973. function ___ofl_lock() {
  25974. var label = 0, sp = 0;
  25975. sp = STACKTOP;
  25976. ___lock((33296|0));
  25977. return (33304|0);
  25978. }
  25979. function ___ofl_unlock() {
  25980. var label = 0, sp = 0;
  25981. sp = STACKTOP;
  25982. ___unlock((33296|0));
  25983. return;
  25984. }
  25985. function _fflush($0) {
  25986. $0 = $0|0;
  25987. var $$0 = 0, $$023 = 0, $$02325 = 0, $$02327 = 0, $$024$lcssa = 0, $$02426 = 0, $$1 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0;
  25988. var $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $phitmp = 0, label = 0, sp = 0;
  25989. sp = STACKTOP;
  25990. $1 = ($0|0)==(0|0);
  25991. do {
  25992. if ($1) {
  25993. $8 = (Atomics_load(HEAP32,780)|0);
  25994. $9 = ($8|0)==(0|0);
  25995. if ($9) {
  25996. $29 = 0;
  25997. } else {
  25998. $10 = (Atomics_load(HEAP32,780)|0);
  25999. $11 = (_fflush($10)|0);
  26000. $29 = $11;
  26001. }
  26002. $12 = (___ofl_lock()|0);
  26003. $$02325 = HEAP32[$12>>2]|0;
  26004. $13 = ($$02325|0)==(0|0);
  26005. if ($13) {
  26006. $$024$lcssa = $29;
  26007. } else {
  26008. $$02327 = $$02325;$$02426 = $29;
  26009. while(1) {
  26010. $14 = ((($$02327)) + 76|0);
  26011. $15 = (Atomics_load(HEAP32,$14>>2)|0);
  26012. $16 = ($15|0)>(-1);
  26013. if ($16) {
  26014. $17 = (___lockfile($$02327)|0);
  26015. $26 = $17;
  26016. } else {
  26017. $26 = 0;
  26018. }
  26019. $18 = ((($$02327)) + 20|0);
  26020. $19 = HEAP32[$18>>2]|0;
  26021. $20 = ((($$02327)) + 28|0);
  26022. $21 = HEAP32[$20>>2]|0;
  26023. $22 = ($19>>>0)>($21>>>0);
  26024. if ($22) {
  26025. $23 = (___fflush_unlocked($$02327)|0);
  26026. $24 = $23 | $$02426;
  26027. $$1 = $24;
  26028. } else {
  26029. $$1 = $$02426;
  26030. }
  26031. $25 = ($26|0)==(0);
  26032. if (!($25)) {
  26033. ___unlockfile($$02327);
  26034. }
  26035. $27 = ((($$02327)) + 56|0);
  26036. $$023 = HEAP32[$27>>2]|0;
  26037. $28 = ($$023|0)==(0|0);
  26038. if ($28) {
  26039. $$024$lcssa = $$1;
  26040. break;
  26041. } else {
  26042. $$02327 = $$023;$$02426 = $$1;
  26043. }
  26044. }
  26045. }
  26046. ___ofl_unlock();
  26047. $$0 = $$024$lcssa;
  26048. } else {
  26049. $2 = ((($0)) + 76|0);
  26050. $3 = (Atomics_load(HEAP32,$2>>2)|0);
  26051. $4 = ($3|0)>(-1);
  26052. if (!($4)) {
  26053. $5 = (___fflush_unlocked($0)|0);
  26054. $$0 = $5;
  26055. break;
  26056. }
  26057. $6 = (___lockfile($0)|0);
  26058. $phitmp = ($6|0)==(0);
  26059. $7 = (___fflush_unlocked($0)|0);
  26060. if ($phitmp) {
  26061. $$0 = $7;
  26062. } else {
  26063. ___unlockfile($0);
  26064. $$0 = $7;
  26065. }
  26066. }
  26067. } while(0);
  26068. return ($$0|0);
  26069. }
  26070. function ___fflush_unlocked($0) {
  26071. $0 = $0|0;
  26072. var $$0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0;
  26073. var $9 = 0, label = 0, sp = 0;
  26074. sp = STACKTOP;
  26075. $1 = ((($0)) + 20|0);
  26076. $2 = HEAP32[$1>>2]|0;
  26077. $3 = ((($0)) + 28|0);
  26078. $4 = HEAP32[$3>>2]|0;
  26079. $5 = ($2>>>0)>($4>>>0);
  26080. if ($5) {
  26081. $6 = ((($0)) + 36|0);
  26082. $7 = HEAP32[$6>>2]|0;
  26083. (FUNCTION_TABLE_iiii[$7 & 15]($0,0,0)|0);
  26084. $8 = HEAP32[$1>>2]|0;
  26085. $9 = ($8|0)==(0|0);
  26086. if ($9) {
  26087. $$0 = -1;
  26088. } else {
  26089. label = 3;
  26090. }
  26091. } else {
  26092. label = 3;
  26093. }
  26094. if ((label|0) == 3) {
  26095. $10 = ((($0)) + 4|0);
  26096. $11 = HEAP32[$10>>2]|0;
  26097. $12 = ((($0)) + 8|0);
  26098. $13 = HEAP32[$12>>2]|0;
  26099. $14 = ($11>>>0)<($13>>>0);
  26100. if ($14) {
  26101. $15 = $11;
  26102. $16 = $13;
  26103. $17 = (($15) - ($16))|0;
  26104. $18 = ((($0)) + 40|0);
  26105. $19 = HEAP32[$18>>2]|0;
  26106. (FUNCTION_TABLE_iiii[$19 & 15]($0,$17,1)|0);
  26107. }
  26108. $20 = ((($0)) + 16|0);
  26109. HEAP32[$20>>2] = 0;
  26110. HEAP32[$3>>2] = 0;
  26111. HEAP32[$1>>2] = 0;
  26112. HEAP32[$12>>2] = 0;
  26113. HEAP32[$10>>2] = 0;
  26114. $$0 = 0;
  26115. }
  26116. return ($$0|0);
  26117. }
  26118. function _strstr($0,$1) {
  26119. $0 = $0|0;
  26120. $1 = $1|0;
  26121. var $$0 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0;
  26122. var $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  26123. sp = STACKTOP;
  26124. $2 = HEAP8[$1>>0]|0;
  26125. $3 = ($2<<24>>24)==(0);
  26126. do {
  26127. if ($3) {
  26128. $$0 = $0;
  26129. } else {
  26130. $4 = $2 << 24 >> 24;
  26131. $5 = (_strchr($0,$4)|0);
  26132. $6 = ($5|0)==(0|0);
  26133. if ($6) {
  26134. $$0 = 0;
  26135. } else {
  26136. $7 = ((($1)) + 1|0);
  26137. $8 = HEAP8[$7>>0]|0;
  26138. $9 = ($8<<24>>24)==(0);
  26139. if ($9) {
  26140. $$0 = $5;
  26141. } else {
  26142. $10 = ((($5)) + 1|0);
  26143. $11 = HEAP8[$10>>0]|0;
  26144. $12 = ($11<<24>>24)==(0);
  26145. if ($12) {
  26146. $$0 = 0;
  26147. } else {
  26148. $13 = ((($1)) + 2|0);
  26149. $14 = HEAP8[$13>>0]|0;
  26150. $15 = ($14<<24>>24)==(0);
  26151. if ($15) {
  26152. $16 = (_twobyte_strstr($5,$1)|0);
  26153. $$0 = $16;
  26154. break;
  26155. }
  26156. $17 = ((($5)) + 2|0);
  26157. $18 = HEAP8[$17>>0]|0;
  26158. $19 = ($18<<24>>24)==(0);
  26159. if ($19) {
  26160. $$0 = 0;
  26161. } else {
  26162. $20 = ((($1)) + 3|0);
  26163. $21 = HEAP8[$20>>0]|0;
  26164. $22 = ($21<<24>>24)==(0);
  26165. if ($22) {
  26166. $23 = (_threebyte_strstr($5,$1)|0);
  26167. $$0 = $23;
  26168. break;
  26169. }
  26170. $24 = ((($5)) + 3|0);
  26171. $25 = HEAP8[$24>>0]|0;
  26172. $26 = ($25<<24>>24)==(0);
  26173. if ($26) {
  26174. $$0 = 0;
  26175. } else {
  26176. $27 = ((($1)) + 4|0);
  26177. $28 = HEAP8[$27>>0]|0;
  26178. $29 = ($28<<24>>24)==(0);
  26179. if ($29) {
  26180. $30 = (_fourbyte_strstr($5,$1)|0);
  26181. $$0 = $30;
  26182. break;
  26183. } else {
  26184. $31 = (_twoway_strstr($5,$1)|0);
  26185. $$0 = $31;
  26186. break;
  26187. }
  26188. }
  26189. }
  26190. }
  26191. }
  26192. }
  26193. }
  26194. } while(0);
  26195. return ($$0|0);
  26196. }
  26197. function _twobyte_strstr($0,$1) {
  26198. $0 = $0|0;
  26199. $1 = $1|0;
  26200. var $$lcssa = 0, $$sink = 0, $$sink$in = 0, $$sink$masked = 0, $$sink17$sink = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0;
  26201. var label = 0, sp = 0;
  26202. sp = STACKTOP;
  26203. $2 = HEAP8[$1>>0]|0;
  26204. $3 = $2&255;
  26205. $4 = $3 << 8;
  26206. $5 = ((($1)) + 1|0);
  26207. $6 = HEAP8[$5>>0]|0;
  26208. $7 = $6&255;
  26209. $8 = $4 | $7;
  26210. $9 = HEAP8[$0>>0]|0;
  26211. $10 = $9&255;
  26212. $$sink$in = $10;$$sink17$sink = $0;
  26213. while(1) {
  26214. $11 = ((($$sink17$sink)) + 1|0);
  26215. $12 = HEAP8[$11>>0]|0;
  26216. $13 = ($12<<24>>24)==(0);
  26217. if ($13) {
  26218. $$lcssa = 0;
  26219. break;
  26220. }
  26221. $$sink = $$sink$in << 8;
  26222. $14 = $12&255;
  26223. $$sink$masked = $$sink & 65280;
  26224. $15 = $14 | $$sink$masked;
  26225. $16 = ($15|0)==($8|0);
  26226. if ($16) {
  26227. $$lcssa = $$sink17$sink;
  26228. break;
  26229. } else {
  26230. $$sink$in = $15;$$sink17$sink = $11;
  26231. }
  26232. }
  26233. return ($$lcssa|0);
  26234. }
  26235. function _threebyte_strstr($0,$1) {
  26236. $0 = $0|0;
  26237. $1 = $1|0;
  26238. var $$016$lcssa = 0, $$01619 = 0, $$020 = 0, $$lcssa = 0, $$not = 0, $$not17 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0;
  26239. var $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $4 = 0, $5 = 0, $6 = 0;
  26240. var $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, $or$cond18 = 0, label = 0, sp = 0;
  26241. sp = STACKTOP;
  26242. $2 = HEAP8[$1>>0]|0;
  26243. $3 = $2&255;
  26244. $4 = $3 << 24;
  26245. $5 = ((($1)) + 1|0);
  26246. $6 = HEAP8[$5>>0]|0;
  26247. $7 = $6&255;
  26248. $8 = $7 << 16;
  26249. $9 = $8 | $4;
  26250. $10 = ((($1)) + 2|0);
  26251. $11 = HEAP8[$10>>0]|0;
  26252. $12 = $11&255;
  26253. $13 = $12 << 8;
  26254. $14 = $9 | $13;
  26255. $15 = HEAP8[$0>>0]|0;
  26256. $16 = $15&255;
  26257. $17 = $16 << 24;
  26258. $18 = ((($0)) + 1|0);
  26259. $19 = HEAP8[$18>>0]|0;
  26260. $20 = $19&255;
  26261. $21 = $20 << 16;
  26262. $22 = $21 | $17;
  26263. $23 = ((($0)) + 2|0);
  26264. $24 = HEAP8[$23>>0]|0;
  26265. $25 = $24&255;
  26266. $26 = $25 << 8;
  26267. $27 = $22 | $26;
  26268. $28 = ($24<<24>>24)!=(0);
  26269. $$not17 = $28 ^ 1;
  26270. $29 = ($27|0)==($14|0);
  26271. $or$cond18 = $29 | $$not17;
  26272. if ($or$cond18) {
  26273. $$016$lcssa = $23;$$lcssa = $28;
  26274. } else {
  26275. $$01619 = $23;$$020 = $27;
  26276. while(1) {
  26277. $30 = ((($$01619)) + 1|0);
  26278. $31 = HEAP8[$30>>0]|0;
  26279. $32 = $31&255;
  26280. $33 = $32 | $$020;
  26281. $34 = $33 << 8;
  26282. $35 = ($31<<24>>24)!=(0);
  26283. $$not = $35 ^ 1;
  26284. $36 = ($34|0)==($14|0);
  26285. $or$cond = $36 | $$not;
  26286. if ($or$cond) {
  26287. $$016$lcssa = $30;$$lcssa = $35;
  26288. break;
  26289. } else {
  26290. $$01619 = $30;$$020 = $34;
  26291. }
  26292. }
  26293. }
  26294. $37 = ((($$016$lcssa)) + -2|0);
  26295. $38 = $$lcssa ? $37 : 0;
  26296. return ($38|0);
  26297. }
  26298. function _fourbyte_strstr($0,$1) {
  26299. $0 = $0|0;
  26300. $1 = $1|0;
  26301. var $$lcssa = 0, $$not = 0, $$not22 = 0, $$sink21$lcssa = 0, $$sink2124 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0;
  26302. var $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0;
  26303. var $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, $or$cond23 = 0, label = 0, sp = 0;
  26304. sp = STACKTOP;
  26305. $2 = HEAP8[$1>>0]|0;
  26306. $3 = $2&255;
  26307. $4 = $3 << 24;
  26308. $5 = ((($1)) + 1|0);
  26309. $6 = HEAP8[$5>>0]|0;
  26310. $7 = $6&255;
  26311. $8 = $7 << 16;
  26312. $9 = $8 | $4;
  26313. $10 = ((($1)) + 2|0);
  26314. $11 = HEAP8[$10>>0]|0;
  26315. $12 = $11&255;
  26316. $13 = $12 << 8;
  26317. $14 = $9 | $13;
  26318. $15 = ((($1)) + 3|0);
  26319. $16 = HEAP8[$15>>0]|0;
  26320. $17 = $16&255;
  26321. $18 = $14 | $17;
  26322. $19 = HEAP8[$0>>0]|0;
  26323. $20 = $19&255;
  26324. $21 = $20 << 24;
  26325. $22 = ((($0)) + 1|0);
  26326. $23 = HEAP8[$22>>0]|0;
  26327. $24 = $23&255;
  26328. $25 = $24 << 16;
  26329. $26 = $25 | $21;
  26330. $27 = ((($0)) + 2|0);
  26331. $28 = HEAP8[$27>>0]|0;
  26332. $29 = $28&255;
  26333. $30 = $29 << 8;
  26334. $31 = $26 | $30;
  26335. $32 = ((($0)) + 3|0);
  26336. $33 = HEAP8[$32>>0]|0;
  26337. $34 = $33&255;
  26338. $35 = $34 | $31;
  26339. $36 = ($33<<24>>24)!=(0);
  26340. $$not22 = $36 ^ 1;
  26341. $37 = ($35|0)==($18|0);
  26342. $or$cond23 = $37 | $$not22;
  26343. if ($or$cond23) {
  26344. $$lcssa = $36;$$sink21$lcssa = $32;
  26345. } else {
  26346. $$sink2124 = $32;$39 = $35;
  26347. while(1) {
  26348. $38 = $39 << 8;
  26349. $40 = ((($$sink2124)) + 1|0);
  26350. $41 = HEAP8[$40>>0]|0;
  26351. $42 = $41&255;
  26352. $43 = $42 | $38;
  26353. $44 = ($41<<24>>24)!=(0);
  26354. $$not = $44 ^ 1;
  26355. $45 = ($43|0)==($18|0);
  26356. $or$cond = $45 | $$not;
  26357. if ($or$cond) {
  26358. $$lcssa = $44;$$sink21$lcssa = $40;
  26359. break;
  26360. } else {
  26361. $$sink2124 = $40;$39 = $43;
  26362. }
  26363. }
  26364. }
  26365. $46 = ((($$sink21$lcssa)) + -3|0);
  26366. $47 = $$lcssa ? $46 : 0;
  26367. return ($47|0);
  26368. }
  26369. function _twoway_strstr($0,$1) {
  26370. $0 = $0|0;
  26371. $1 = $1|0;
  26372. var $$0166 = 0, $$0168 = 0, $$0169 = 0, $$0169$be = 0, $$0170 = 0, $$0175$ph$ph$lcssa220 = 0, $$0175$ph$ph$lcssa220323 = 0, $$0175$ph$ph256 = 0, $$0179244 = 0, $$0183$ph200$ph255 = 0, $$0183$ph200250 = 0, $$0183$ph262 = 0, $$0185$ph$lcssa = 0, $$0185$ph$lcssa322 = 0, $$0185$ph261 = 0, $$0187$lcssa320321 = 0, $$0187266 = 0, $$1176$$0175 = 0, $$1176$ph$ph$lcssa211 = 0, $$1176$ph$ph235 = 0;
  26373. var $$1180224 = 0, $$1184$ph196$ph234 = 0, $$1184$ph196229 = 0, $$1184$ph241 = 0, $$1186$$0185 = 0, $$1186$$0185$ = 0, $$1186$ph$lcssa = 0, $$1186$ph240 = 0, $$2181 = 0, $$2181$sink = 0, $$3 = 0, $$3173 = 0, $$3178 = 0, $$3182223 = 0, $$4 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0;
  26374. var $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0, $116 = 0, $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0;
  26375. var $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0, $133 = 0, $134 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0;
  26376. var $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0;
  26377. var $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0, $55 = 0;
  26378. var $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0;
  26379. var $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0, $91 = 0;
  26380. var $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $cond = 0, $cond191 = 0, $cond191222 = 0, $cond265 = 0, $div = 0, $div188 = 0, $or$cond = 0, $or$cond190 = 0, label = 0, sp = 0;
  26381. sp = STACKTOP;
  26382. STACKTOP = STACKTOP + 1056|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(1056|0);
  26383. $2 = sp + 1024|0;
  26384. $3 = sp;
  26385. ;HEAP32[$2>>2]=0|0;HEAP32[$2+4>>2]=0|0;HEAP32[$2+8>>2]=0|0;HEAP32[$2+12>>2]=0|0;HEAP32[$2+16>>2]=0|0;HEAP32[$2+20>>2]=0|0;HEAP32[$2+24>>2]=0|0;HEAP32[$2+28>>2]=0|0;
  26386. $4 = HEAP8[$1>>0]|0;
  26387. $cond265 = ($4<<24>>24)==(0);
  26388. L1: do {
  26389. if ($cond265) {
  26390. $$0175$ph$ph$lcssa220323 = 1;$$0185$ph$lcssa322 = -1;$$0187$lcssa320321 = 0;$$1176$ph$ph$lcssa211 = 1;$$1186$ph$lcssa = -1;
  26391. label = 27;
  26392. } else {
  26393. $5 = $4&255;
  26394. $$0187266 = 0;$12 = $4;$20 = $5;
  26395. while(1) {
  26396. $8 = (($0) + ($$0187266)|0);
  26397. $9 = HEAP8[$8>>0]|0;
  26398. $10 = ($9<<24>>24)==(0);
  26399. if ($10) {
  26400. $$3 = 0;
  26401. break L1;
  26402. }
  26403. $11 = $12 & 31;
  26404. $13 = $11&255;
  26405. $14 = 1 << $13;
  26406. $div188 = ($12&255) >>> 5;
  26407. $15 = $div188&255;
  26408. $16 = (($2) + ($15<<2)|0);
  26409. $17 = HEAP32[$16>>2]|0;
  26410. $18 = $17 | $14;
  26411. HEAP32[$16>>2] = $18;
  26412. $7 = (($$0187266) + 1)|0;
  26413. $19 = (($3) + ($20<<2)|0);
  26414. HEAP32[$19>>2] = $7;
  26415. $21 = (($1) + ($7)|0);
  26416. $22 = HEAP8[$21>>0]|0;
  26417. $23 = $22&255;
  26418. $cond = ($22<<24>>24)==(0);
  26419. if ($cond) {
  26420. break;
  26421. } else {
  26422. $$0187266 = $7;$12 = $22;$20 = $23;
  26423. }
  26424. }
  26425. $6 = ($7>>>0)>(1);
  26426. if ($6) {
  26427. $$0183$ph262 = 0;$$0185$ph261 = -1;$129 = 1;
  26428. L7: while(1) {
  26429. $$0175$ph$ph256 = 1;$$0183$ph200$ph255 = $$0183$ph262;$132 = $129;
  26430. while(1) {
  26431. $$0183$ph200250 = $$0183$ph200$ph255;$131 = $132;
  26432. L11: while(1) {
  26433. $$0179244 = 1;$31 = $131;
  26434. while(1) {
  26435. $27 = (($$0179244) + ($$0185$ph261))|0;
  26436. $28 = (($1) + ($27)|0);
  26437. $29 = HEAP8[$28>>0]|0;
  26438. $30 = (($1) + ($31)|0);
  26439. $32 = HEAP8[$30>>0]|0;
  26440. $33 = ($29<<24>>24)==($32<<24>>24);
  26441. if (!($33)) {
  26442. break L11;
  26443. }
  26444. $34 = ($$0179244|0)==($$0175$ph$ph256|0);
  26445. $25 = (($$0179244) + 1)|0;
  26446. if ($34) {
  26447. break;
  26448. }
  26449. $24 = (($25) + ($$0183$ph200250))|0;
  26450. $26 = ($24>>>0)<($7>>>0);
  26451. if ($26) {
  26452. $$0179244 = $25;$31 = $24;
  26453. } else {
  26454. $$0175$ph$ph$lcssa220 = $$0175$ph$ph256;$$0185$ph$lcssa = $$0185$ph261;
  26455. break L7;
  26456. }
  26457. }
  26458. $35 = (($$0175$ph$ph256) + ($$0183$ph200250))|0;
  26459. $36 = (($35) + 1)|0;
  26460. $37 = ($36>>>0)<($7>>>0);
  26461. if ($37) {
  26462. $$0183$ph200250 = $35;$131 = $36;
  26463. } else {
  26464. $$0175$ph$ph$lcssa220 = $$0175$ph$ph256;$$0185$ph$lcssa = $$0185$ph261;
  26465. break L7;
  26466. }
  26467. }
  26468. $38 = ($29&255)>($32&255);
  26469. $39 = (($31) - ($$0185$ph261))|0;
  26470. if (!($38)) {
  26471. break;
  26472. }
  26473. $43 = (($31) + 1)|0;
  26474. $44 = ($43>>>0)<($7>>>0);
  26475. if ($44) {
  26476. $$0175$ph$ph256 = $39;$$0183$ph200$ph255 = $31;$132 = $43;
  26477. } else {
  26478. $$0175$ph$ph$lcssa220 = $39;$$0185$ph$lcssa = $$0185$ph261;
  26479. break L7;
  26480. }
  26481. }
  26482. $40 = (($$0183$ph200250) + 1)|0;
  26483. $41 = (($$0183$ph200250) + 2)|0;
  26484. $42 = ($41>>>0)<($7>>>0);
  26485. if ($42) {
  26486. $$0183$ph262 = $40;$$0185$ph261 = $$0183$ph200250;$129 = $41;
  26487. } else {
  26488. $$0175$ph$ph$lcssa220 = 1;$$0185$ph$lcssa = $$0183$ph200250;
  26489. break;
  26490. }
  26491. }
  26492. if ($6) {
  26493. $$1184$ph241 = 0;$$1186$ph240 = -1;$130 = 1;
  26494. while(1) {
  26495. $$1176$ph$ph235 = 1;$$1184$ph196$ph234 = $$1184$ph241;$134 = $130;
  26496. while(1) {
  26497. $$1184$ph196229 = $$1184$ph196$ph234;$133 = $134;
  26498. L26: while(1) {
  26499. $$1180224 = 1;$52 = $133;
  26500. while(1) {
  26501. $48 = (($$1180224) + ($$1186$ph240))|0;
  26502. $49 = (($1) + ($48)|0);
  26503. $50 = HEAP8[$49>>0]|0;
  26504. $51 = (($1) + ($52)|0);
  26505. $53 = HEAP8[$51>>0]|0;
  26506. $54 = ($50<<24>>24)==($53<<24>>24);
  26507. if (!($54)) {
  26508. break L26;
  26509. }
  26510. $55 = ($$1180224|0)==($$1176$ph$ph235|0);
  26511. $46 = (($$1180224) + 1)|0;
  26512. if ($55) {
  26513. break;
  26514. }
  26515. $45 = (($46) + ($$1184$ph196229))|0;
  26516. $47 = ($45>>>0)<($7>>>0);
  26517. if ($47) {
  26518. $$1180224 = $46;$52 = $45;
  26519. } else {
  26520. $$0175$ph$ph$lcssa220323 = $$0175$ph$ph$lcssa220;$$0185$ph$lcssa322 = $$0185$ph$lcssa;$$0187$lcssa320321 = $7;$$1176$ph$ph$lcssa211 = $$1176$ph$ph235;$$1186$ph$lcssa = $$1186$ph240;
  26521. label = 27;
  26522. break L1;
  26523. }
  26524. }
  26525. $56 = (($$1176$ph$ph235) + ($$1184$ph196229))|0;
  26526. $57 = (($56) + 1)|0;
  26527. $58 = ($57>>>0)<($7>>>0);
  26528. if ($58) {
  26529. $$1184$ph196229 = $56;$133 = $57;
  26530. } else {
  26531. $$0175$ph$ph$lcssa220323 = $$0175$ph$ph$lcssa220;$$0185$ph$lcssa322 = $$0185$ph$lcssa;$$0187$lcssa320321 = $7;$$1176$ph$ph$lcssa211 = $$1176$ph$ph235;$$1186$ph$lcssa = $$1186$ph240;
  26532. label = 27;
  26533. break L1;
  26534. }
  26535. }
  26536. $59 = ($50&255)<($53&255);
  26537. $60 = (($52) - ($$1186$ph240))|0;
  26538. if (!($59)) {
  26539. break;
  26540. }
  26541. $64 = (($52) + 1)|0;
  26542. $65 = ($64>>>0)<($7>>>0);
  26543. if ($65) {
  26544. $$1176$ph$ph235 = $60;$$1184$ph196$ph234 = $52;$134 = $64;
  26545. } else {
  26546. $$0175$ph$ph$lcssa220323 = $$0175$ph$ph$lcssa220;$$0185$ph$lcssa322 = $$0185$ph$lcssa;$$0187$lcssa320321 = $7;$$1176$ph$ph$lcssa211 = $60;$$1186$ph$lcssa = $$1186$ph240;
  26547. label = 27;
  26548. break L1;
  26549. }
  26550. }
  26551. $61 = (($$1184$ph196229) + 1)|0;
  26552. $62 = (($$1184$ph196229) + 2)|0;
  26553. $63 = ($62>>>0)<($7>>>0);
  26554. if ($63) {
  26555. $$1184$ph241 = $61;$$1186$ph240 = $$1184$ph196229;$130 = $62;
  26556. } else {
  26557. $$0175$ph$ph$lcssa220323 = $$0175$ph$ph$lcssa220;$$0185$ph$lcssa322 = $$0185$ph$lcssa;$$0187$lcssa320321 = $7;$$1176$ph$ph$lcssa211 = 1;$$1186$ph$lcssa = $$1184$ph196229;
  26558. label = 27;
  26559. break;
  26560. }
  26561. }
  26562. } else {
  26563. $$0175$ph$ph$lcssa220323 = $$0175$ph$ph$lcssa220;$$0185$ph$lcssa322 = $$0185$ph$lcssa;$$0187$lcssa320321 = $7;$$1176$ph$ph$lcssa211 = 1;$$1186$ph$lcssa = -1;
  26564. label = 27;
  26565. }
  26566. } else {
  26567. $$0175$ph$ph$lcssa220323 = 1;$$0185$ph$lcssa322 = -1;$$0187$lcssa320321 = $7;$$1176$ph$ph$lcssa211 = 1;$$1186$ph$lcssa = -1;
  26568. label = 27;
  26569. }
  26570. }
  26571. } while(0);
  26572. L36: do {
  26573. if ((label|0) == 27) {
  26574. $66 = (($$1186$ph$lcssa) + 1)|0;
  26575. $67 = (($$0185$ph$lcssa322) + 1)|0;
  26576. $68 = ($66>>>0)>($67>>>0);
  26577. $$1176$$0175 = $68 ? $$1176$ph$ph$lcssa211 : $$0175$ph$ph$lcssa220323;
  26578. $$1186$$0185 = $68 ? $$1186$ph$lcssa : $$0185$ph$lcssa322;
  26579. $69 = (($1) + ($$1176$$0175)|0);
  26580. $70 = (($$1186$$0185) + 1)|0;
  26581. $71 = (_memcmp($1,$69,$70)|0);
  26582. $72 = ($71|0)==(0);
  26583. if ($72) {
  26584. $77 = (($$0187$lcssa320321) - ($$1176$$0175))|0;
  26585. $$0168 = $77;$$3178 = $$1176$$0175;
  26586. } else {
  26587. $73 = (($$0187$lcssa320321) - ($$1186$$0185))|0;
  26588. $74 = (($73) + -1)|0;
  26589. $75 = ($$1186$$0185>>>0)>($74>>>0);
  26590. $$1186$$0185$ = $75 ? $$1186$$0185 : $74;
  26591. $76 = (($$1186$$0185$) + 1)|0;
  26592. $$0168 = 0;$$3178 = $76;
  26593. }
  26594. $78 = $$0187$lcssa320321 | 63;
  26595. $79 = (($$0187$lcssa320321) + -1)|0;
  26596. $80 = ($$0168|0)!=(0);
  26597. $81 = (($$0187$lcssa320321) - ($$3178))|0;
  26598. $$0166 = $0;$$0169 = 0;$$0170 = $0;
  26599. while(1) {
  26600. $82 = $$0170;
  26601. $83 = $$0166;
  26602. $84 = (($82) - ($83))|0;
  26603. $85 = ($84>>>0)<($$0187$lcssa320321>>>0);
  26604. do {
  26605. if ($85) {
  26606. $86 = (_memchr($$0170,0,$78)|0);
  26607. $87 = ($86|0)==(0|0);
  26608. if ($87) {
  26609. $91 = (($$0170) + ($78)|0);
  26610. $$3173 = $91;
  26611. break;
  26612. } else {
  26613. $88 = $86;
  26614. $89 = (($88) - ($83))|0;
  26615. $90 = ($89>>>0)<($$0187$lcssa320321>>>0);
  26616. if ($90) {
  26617. $$3 = 0;
  26618. break L36;
  26619. } else {
  26620. $$3173 = $86;
  26621. break;
  26622. }
  26623. }
  26624. } else {
  26625. $$3173 = $$0170;
  26626. }
  26627. } while(0);
  26628. $92 = (($$0166) + ($79)|0);
  26629. $93 = HEAP8[$92>>0]|0;
  26630. $div = ($93&255) >>> 5;
  26631. $94 = $div&255;
  26632. $95 = (($2) + ($94<<2)|0);
  26633. $96 = HEAP32[$95>>2]|0;
  26634. $97 = $93 & 31;
  26635. $98 = $97&255;
  26636. $99 = 1 << $98;
  26637. $100 = $99 & $96;
  26638. $101 = ($100|0)==(0);
  26639. L50: do {
  26640. if ($101) {
  26641. $$0169$be = 0;$$2181$sink = $$0187$lcssa320321;
  26642. } else {
  26643. $102 = $93&255;
  26644. $103 = (($3) + ($102<<2)|0);
  26645. $104 = HEAP32[$103>>2]|0;
  26646. $105 = (($$0187$lcssa320321) - ($104))|0;
  26647. $106 = ($105|0)==(0);
  26648. if (!($106)) {
  26649. $107 = ($$0169|0)!=(0);
  26650. $or$cond = $80 & $107;
  26651. $108 = ($105>>>0)<($$3178>>>0);
  26652. $or$cond190 = $or$cond & $108;
  26653. $$2181 = $or$cond190 ? $81 : $105;
  26654. $$0169$be = 0;$$2181$sink = $$2181;
  26655. break;
  26656. }
  26657. $110 = ($70>>>0)>($$0169>>>0);
  26658. $111 = $110 ? $70 : $$0169;
  26659. $112 = (($1) + ($111)|0);
  26660. $113 = HEAP8[$112>>0]|0;
  26661. $cond191222 = ($113<<24>>24)==(0);
  26662. L55: do {
  26663. if ($cond191222) {
  26664. $$4 = $70;
  26665. } else {
  26666. $$3182223 = $111;$117 = $113;
  26667. while(1) {
  26668. $114 = (($$0166) + ($$3182223)|0);
  26669. $115 = HEAP8[$114>>0]|0;
  26670. $116 = ($117<<24>>24)==($115<<24>>24);
  26671. if (!($116)) {
  26672. break;
  26673. }
  26674. $118 = (($$3182223) + 1)|0;
  26675. $119 = (($1) + ($118)|0);
  26676. $120 = HEAP8[$119>>0]|0;
  26677. $cond191 = ($120<<24>>24)==(0);
  26678. if ($cond191) {
  26679. $$4 = $70;
  26680. break L55;
  26681. } else {
  26682. $$3182223 = $118;$117 = $120;
  26683. }
  26684. }
  26685. $121 = (($$3182223) - ($$1186$$0185))|0;
  26686. $$0169$be = 0;$$2181$sink = $121;
  26687. break L50;
  26688. }
  26689. } while(0);
  26690. while(1) {
  26691. $122 = ($$4>>>0)>($$0169>>>0);
  26692. if (!($122)) {
  26693. $$3 = $$0166;
  26694. break L36;
  26695. }
  26696. $123 = (($$4) + -1)|0;
  26697. $124 = (($1) + ($123)|0);
  26698. $125 = HEAP8[$124>>0]|0;
  26699. $126 = (($$0166) + ($123)|0);
  26700. $127 = HEAP8[$126>>0]|0;
  26701. $128 = ($125<<24>>24)==($127<<24>>24);
  26702. if ($128) {
  26703. $$4 = $123;
  26704. } else {
  26705. $$0169$be = $$0168;$$2181$sink = $$3178;
  26706. break;
  26707. }
  26708. }
  26709. }
  26710. } while(0);
  26711. $109 = (($$0166) + ($$2181$sink)|0);
  26712. $$0166 = $109;$$0169 = $$0169$be;$$0170 = $$3173;
  26713. }
  26714. }
  26715. } while(0);
  26716. STACKTOP = sp;return ($$3|0);
  26717. }
  26718. function _strspn($0,$1) {
  26719. $0 = $0|0;
  26720. $1 = $1|0;
  26721. var $$0 = 0, $$01925 = 0, $$020 = 0, $$1$lcssa = 0, $$123 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0;
  26722. var $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0;
  26723. var $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $div = 0, $div21 = 0, label = 0, sp = 0;
  26724. sp = STACKTOP;
  26725. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  26726. $2 = sp;
  26727. ;HEAP32[$2>>2]=0|0;HEAP32[$2+4>>2]=0|0;HEAP32[$2+8>>2]=0|0;HEAP32[$2+12>>2]=0|0;HEAP32[$2+16>>2]=0|0;HEAP32[$2+20>>2]=0|0;HEAP32[$2+24>>2]=0|0;HEAP32[$2+28>>2]=0|0;
  26728. $3 = HEAP8[$1>>0]|0;
  26729. $4 = ($3<<24>>24)==(0);
  26730. do {
  26731. if ($4) {
  26732. $$0 = 0;
  26733. } else {
  26734. $5 = ((($1)) + 1|0);
  26735. $6 = HEAP8[$5>>0]|0;
  26736. $7 = ($6<<24>>24)==(0);
  26737. if ($7) {
  26738. $$020 = $0;
  26739. while(1) {
  26740. $8 = HEAP8[$$020>>0]|0;
  26741. $9 = ($8<<24>>24)==($3<<24>>24);
  26742. $10 = ((($$020)) + 1|0);
  26743. if ($9) {
  26744. $$020 = $10;
  26745. } else {
  26746. break;
  26747. }
  26748. }
  26749. $11 = $$020;
  26750. $12 = $0;
  26751. $13 = (($11) - ($12))|0;
  26752. $$0 = $13;
  26753. break;
  26754. } else {
  26755. $$01925 = $1;$17 = $3;
  26756. }
  26757. while(1) {
  26758. $16 = $17 & 31;
  26759. $18 = $16&255;
  26760. $19 = 1 << $18;
  26761. $div21 = ($17&255) >>> 5;
  26762. $20 = $div21&255;
  26763. $21 = (($2) + ($20<<2)|0);
  26764. $22 = HEAP32[$21>>2]|0;
  26765. $23 = $22 | $19;
  26766. HEAP32[$21>>2] = $23;
  26767. $24 = ((($$01925)) + 1|0);
  26768. $25 = HEAP8[$24>>0]|0;
  26769. $26 = ($25<<24>>24)==(0);
  26770. if ($26) {
  26771. break;
  26772. } else {
  26773. $$01925 = $24;$17 = $25;
  26774. }
  26775. }
  26776. $14 = HEAP8[$0>>0]|0;
  26777. $15 = ($14<<24>>24)==(0);
  26778. L10: do {
  26779. if ($15) {
  26780. $$1$lcssa = $0;
  26781. } else {
  26782. $$123 = $0;$27 = $14;
  26783. while(1) {
  26784. $div = ($27&255) >>> 5;
  26785. $28 = $div&255;
  26786. $29 = (($2) + ($28<<2)|0);
  26787. $30 = HEAP32[$29>>2]|0;
  26788. $31 = $27 & 31;
  26789. $32 = $31&255;
  26790. $33 = 1 << $32;
  26791. $34 = $30 & $33;
  26792. $35 = ($34|0)==(0);
  26793. if ($35) {
  26794. $$1$lcssa = $$123;
  26795. break L10;
  26796. }
  26797. $36 = ((($$123)) + 1|0);
  26798. $37 = HEAP8[$36>>0]|0;
  26799. $38 = ($37<<24>>24)==(0);
  26800. if ($38) {
  26801. $$1$lcssa = $36;
  26802. break;
  26803. } else {
  26804. $$123 = $36;$27 = $37;
  26805. }
  26806. }
  26807. }
  26808. } while(0);
  26809. $39 = $$1$lcssa;
  26810. $40 = $0;
  26811. $41 = (($39) - ($40))|0;
  26812. $$0 = $41;
  26813. }
  26814. } while(0);
  26815. STACKTOP = sp;return ($$0|0);
  26816. }
  26817. function _srand($0) {
  26818. $0 = $0|0;
  26819. var $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, label = 0, sp = 0;
  26820. sp = STACKTOP;
  26821. $1 = (($0) + -1)|0;
  26822. $2 = 14264;
  26823. $3 = $2;
  26824. HEAP32[$3>>2] = $1;
  26825. $4 = (($2) + 4)|0;
  26826. $5 = $4;
  26827. HEAP32[$5>>2] = 0;
  26828. return;
  26829. }
  26830. function _rand() {
  26831. var $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  26832. sp = STACKTOP;
  26833. $0 = 14264;
  26834. $1 = $0;
  26835. $2 = HEAP32[$1>>2]|0;
  26836. $3 = (($0) + 4)|0;
  26837. $4 = $3;
  26838. $5 = HEAP32[$4>>2]|0;
  26839. $6 = (___muldi3(($2|0),($5|0),1284865837,1481765933)|0);
  26840. $7 = tempRet0;
  26841. $8 = (_i64Add(($6|0),($7|0),1,0)|0);
  26842. $9 = tempRet0;
  26843. $10 = 14264;
  26844. $11 = $10;
  26845. HEAP32[$11>>2] = $8;
  26846. $12 = (($10) + 4)|0;
  26847. $13 = $12;
  26848. HEAP32[$13>>2] = $9;
  26849. $14 = (_bitshift64Lshr(($8|0),($9|0),33)|0);
  26850. $15 = tempRet0;
  26851. return ($14|0);
  26852. }
  26853. function _vprintf($0,$1) {
  26854. $0 = $0|0;
  26855. $1 = $1|0;
  26856. var $2 = 0, $3 = 0, label = 0, sp = 0;
  26857. sp = STACKTOP;
  26858. $2 = HEAP32[748]|0;
  26859. $3 = (_vfprintf($2,$0,$1)|0);
  26860. return ($3|0);
  26861. }
  26862. function _strcspn($0,$1) {
  26863. $0 = $0|0;
  26864. $1 = $1|0;
  26865. var $$01824 = 0, $$019$sink = 0, $$01922 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0;
  26866. var $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $div = 0;
  26867. var $div20 = 0, label = 0, sp = 0;
  26868. sp = STACKTOP;
  26869. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  26870. $2 = sp;
  26871. $3 = HEAP8[$1>>0]|0;
  26872. $4 = ($3<<24>>24)==(0);
  26873. L1: do {
  26874. if ($4) {
  26875. label = 3;
  26876. } else {
  26877. $5 = ((($1)) + 1|0);
  26878. $6 = HEAP8[$5>>0]|0;
  26879. $7 = ($6<<24>>24)==(0);
  26880. if ($7) {
  26881. label = 3;
  26882. } else {
  26883. ;HEAP32[$2>>2]=0|0;HEAP32[$2+4>>2]=0|0;HEAP32[$2+8>>2]=0|0;HEAP32[$2+12>>2]=0|0;HEAP32[$2+16>>2]=0|0;HEAP32[$2+20>>2]=0|0;HEAP32[$2+24>>2]=0|0;HEAP32[$2+28>>2]=0|0;
  26884. $$01824 = $1;$13 = $3;
  26885. while(1) {
  26886. $12 = $13 & 31;
  26887. $14 = $12&255;
  26888. $15 = 1 << $14;
  26889. $div20 = ($13&255) >>> 5;
  26890. $16 = $div20&255;
  26891. $17 = (($2) + ($16<<2)|0);
  26892. $18 = HEAP32[$17>>2]|0;
  26893. $19 = $18 | $15;
  26894. HEAP32[$17>>2] = $19;
  26895. $20 = ((($$01824)) + 1|0);
  26896. $21 = HEAP8[$20>>0]|0;
  26897. $22 = ($21<<24>>24)==(0);
  26898. if ($22) {
  26899. break;
  26900. } else {
  26901. $$01824 = $20;$13 = $21;
  26902. }
  26903. }
  26904. $10 = HEAP8[$0>>0]|0;
  26905. $11 = ($10<<24>>24)==(0);
  26906. if ($11) {
  26907. $$019$sink = $0;
  26908. } else {
  26909. $$01922 = $0;$23 = $10;
  26910. while(1) {
  26911. $div = ($23&255) >>> 5;
  26912. $24 = $div&255;
  26913. $25 = (($2) + ($24<<2)|0);
  26914. $26 = HEAP32[$25>>2]|0;
  26915. $27 = $23 & 31;
  26916. $28 = $27&255;
  26917. $29 = 1 << $28;
  26918. $30 = $26 & $29;
  26919. $31 = ($30|0)==(0);
  26920. if (!($31)) {
  26921. $$019$sink = $$01922;
  26922. break L1;
  26923. }
  26924. $32 = ((($$01922)) + 1|0);
  26925. $33 = HEAP8[$32>>0]|0;
  26926. $34 = ($33<<24>>24)==(0);
  26927. if ($34) {
  26928. $$019$sink = $32;
  26929. break;
  26930. } else {
  26931. $$01922 = $32;$23 = $33;
  26932. }
  26933. }
  26934. }
  26935. }
  26936. }
  26937. } while(0);
  26938. if ((label|0) == 3) {
  26939. $8 = $3 << 24 >> 24;
  26940. $9 = (___strchrnul($0,$8)|0);
  26941. $$019$sink = $9;
  26942. }
  26943. $35 = $$019$sink;
  26944. $36 = $0;
  26945. $37 = (($35) - ($36))|0;
  26946. STACKTOP = sp;return ($37|0);
  26947. }
  26948. function _strcat($0,$1) {
  26949. $0 = $0|0;
  26950. $1 = $1|0;
  26951. var $2 = 0, $3 = 0, label = 0, sp = 0;
  26952. sp = STACKTOP;
  26953. $2 = (_strlen($0)|0);
  26954. $3 = (($0) + ($2)|0);
  26955. (_strcpy($3,$1)|0);
  26956. return ($0|0);
  26957. }
  26958. function _strtok($0,$1) {
  26959. $0 = $0|0;
  26960. $1 = $1|0;
  26961. var $$0 = 0, $$010 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  26962. sp = STACKTOP;
  26963. $2 = ($0|0)==(0|0);
  26964. if ($2) {
  26965. $3 = HEAP32[8327]|0;
  26966. $4 = ($3|0)==(0|0);
  26967. if ($4) {
  26968. $$0 = 0;
  26969. } else {
  26970. $$010 = $3;
  26971. label = 3;
  26972. }
  26973. } else {
  26974. $$010 = $0;
  26975. label = 3;
  26976. }
  26977. do {
  26978. if ((label|0) == 3) {
  26979. $5 = (_strspn($$010,$1)|0);
  26980. $6 = (($$010) + ($5)|0);
  26981. $7 = HEAP8[$6>>0]|0;
  26982. $8 = ($7<<24>>24)==(0);
  26983. if ($8) {
  26984. HEAP32[8327] = 0;
  26985. $$0 = 0;
  26986. break;
  26987. }
  26988. $9 = (_strcspn($6,$1)|0);
  26989. $10 = (($6) + ($9)|0);
  26990. HEAP32[8327] = $10;
  26991. $11 = HEAP8[$10>>0]|0;
  26992. $12 = ($11<<24>>24)==(0);
  26993. if ($12) {
  26994. HEAP32[8327] = 0;
  26995. $$0 = $6;
  26996. break;
  26997. } else {
  26998. $13 = ((($10)) + 1|0);
  26999. HEAP32[8327] = $13;
  27000. HEAP8[$10>>0] = 0;
  27001. $$0 = $6;
  27002. break;
  27003. }
  27004. }
  27005. } while(0);
  27006. return ($$0|0);
  27007. }
  27008. function __emscripten_atomic_fetch_and_add_u64($0,$1,$2) {
  27009. $0 = $0|0;
  27010. $1 = $1|0;
  27011. $2 = $2|0;
  27012. var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0;
  27013. var $9 = 0, label = 0, sp = 0;
  27014. sp = STACKTOP;
  27015. $3 = $0;
  27016. $4 = $3 >>> 3;
  27017. $5 = $4 & 255;
  27018. $6 = (34384 + ($5<<2)|0);
  27019. while(1) {
  27020. while(1) {
  27021. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  27022. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  27023. $9 = ($7|0)==($8|0);
  27024. if ($9) {
  27025. break;
  27026. }
  27027. }
  27028. $10 = ($7|0)==(0);
  27029. if ($10) {
  27030. break;
  27031. }
  27032. }
  27033. $11 = $0;
  27034. $12 = $11;
  27035. $13 = HEAP32[$12>>2]|0;
  27036. $14 = (($11) + 4)|0;
  27037. $15 = $14;
  27038. $16 = HEAP32[$15>>2]|0;
  27039. $17 = (_i64Add(($13|0),($16|0),($1|0),($2|0))|0);
  27040. $18 = tempRet0;
  27041. $19 = $0;
  27042. $20 = $19;
  27043. HEAP32[$20>>2] = $17;
  27044. $21 = (($19) + 4)|0;
  27045. $22 = $21;
  27046. HEAP32[$22>>2] = $18;
  27047. $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  27048. tempRet0 = ($16);
  27049. return ($13|0);
  27050. }
  27051. function __emscripten_atomic_fetch_and_and_u64($0,$1,$2) {
  27052. $0 = $0|0;
  27053. $1 = $1|0;
  27054. $2 = $2|0;
  27055. var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0;
  27056. var $9 = 0, label = 0, sp = 0;
  27057. sp = STACKTOP;
  27058. $3 = $0;
  27059. $4 = $3 >>> 3;
  27060. $5 = $4 & 255;
  27061. $6 = (34384 + ($5<<2)|0);
  27062. while(1) {
  27063. while(1) {
  27064. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  27065. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  27066. $9 = ($7|0)==($8|0);
  27067. if ($9) {
  27068. break;
  27069. }
  27070. }
  27071. $10 = ($7|0)==(0);
  27072. if ($10) {
  27073. break;
  27074. }
  27075. }
  27076. $11 = $0;
  27077. $12 = $11;
  27078. $13 = HEAP32[$12>>2]|0;
  27079. $14 = (($11) + 4)|0;
  27080. $15 = $14;
  27081. $16 = HEAP32[$15>>2]|0;
  27082. $17 = $13 & $1;
  27083. $18 = $16 & $2;
  27084. $19 = $0;
  27085. $20 = $19;
  27086. HEAP32[$20>>2] = $17;
  27087. $21 = (($19) + 4)|0;
  27088. $22 = $21;
  27089. HEAP32[$22>>2] = $18;
  27090. $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  27091. tempRet0 = ($16);
  27092. return ($13|0);
  27093. }
  27094. function __emscripten_atomic_fetch_and_or_u64($0,$1,$2) {
  27095. $0 = $0|0;
  27096. $1 = $1|0;
  27097. $2 = $2|0;
  27098. var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0;
  27099. var $9 = 0, label = 0, sp = 0;
  27100. sp = STACKTOP;
  27101. $3 = $0;
  27102. $4 = $3 >>> 3;
  27103. $5 = $4 & 255;
  27104. $6 = (34384 + ($5<<2)|0);
  27105. while(1) {
  27106. while(1) {
  27107. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  27108. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  27109. $9 = ($7|0)==($8|0);
  27110. if ($9) {
  27111. break;
  27112. }
  27113. }
  27114. $10 = ($7|0)==(0);
  27115. if ($10) {
  27116. break;
  27117. }
  27118. }
  27119. $11 = $0;
  27120. $12 = $11;
  27121. $13 = HEAP32[$12>>2]|0;
  27122. $14 = (($11) + 4)|0;
  27123. $15 = $14;
  27124. $16 = HEAP32[$15>>2]|0;
  27125. $17 = $13 | $1;
  27126. $18 = $16 | $2;
  27127. $19 = $0;
  27128. $20 = $19;
  27129. HEAP32[$20>>2] = $17;
  27130. $21 = (($19) + 4)|0;
  27131. $22 = $21;
  27132. HEAP32[$22>>2] = $18;
  27133. $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  27134. tempRet0 = ($16);
  27135. return ($13|0);
  27136. }
  27137. function __emscripten_atomic_fetch_and_sub_u64($0,$1,$2) {
  27138. $0 = $0|0;
  27139. $1 = $1|0;
  27140. $2 = $2|0;
  27141. var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0;
  27142. var $9 = 0, label = 0, sp = 0;
  27143. sp = STACKTOP;
  27144. $3 = $0;
  27145. $4 = $3 >>> 3;
  27146. $5 = $4 & 255;
  27147. $6 = (34384 + ($5<<2)|0);
  27148. while(1) {
  27149. while(1) {
  27150. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  27151. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  27152. $9 = ($7|0)==($8|0);
  27153. if ($9) {
  27154. break;
  27155. }
  27156. }
  27157. $10 = ($7|0)==(0);
  27158. if ($10) {
  27159. break;
  27160. }
  27161. }
  27162. $11 = $0;
  27163. $12 = $11;
  27164. $13 = HEAP32[$12>>2]|0;
  27165. $14 = (($11) + 4)|0;
  27166. $15 = $14;
  27167. $16 = HEAP32[$15>>2]|0;
  27168. $17 = (_i64Subtract(($13|0),($16|0),($1|0),($2|0))|0);
  27169. $18 = tempRet0;
  27170. $19 = $0;
  27171. $20 = $19;
  27172. HEAP32[$20>>2] = $17;
  27173. $21 = (($19) + 4)|0;
  27174. $22 = $21;
  27175. HEAP32[$22>>2] = $18;
  27176. $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  27177. tempRet0 = ($16);
  27178. return ($13|0);
  27179. }
  27180. function __emscripten_atomic_fetch_and_xor_u64($0,$1,$2) {
  27181. $0 = $0|0;
  27182. $1 = $1|0;
  27183. $2 = $2|0;
  27184. var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0;
  27185. var $9 = 0, label = 0, sp = 0;
  27186. sp = STACKTOP;
  27187. $3 = $0;
  27188. $4 = $3 >>> 3;
  27189. $5 = $4 & 255;
  27190. $6 = (34384 + ($5<<2)|0);
  27191. while(1) {
  27192. while(1) {
  27193. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  27194. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  27195. $9 = ($7|0)==($8|0);
  27196. if ($9) {
  27197. break;
  27198. }
  27199. }
  27200. $10 = ($7|0)==(0);
  27201. if ($10) {
  27202. break;
  27203. }
  27204. }
  27205. $11 = $0;
  27206. $12 = $11;
  27207. $13 = HEAP32[$12>>2]|0;
  27208. $14 = (($11) + 4)|0;
  27209. $15 = $14;
  27210. $16 = HEAP32[$15>>2]|0;
  27211. $17 = $13 ^ $1;
  27212. $18 = $16 ^ $2;
  27213. $19 = $0;
  27214. $20 = $19;
  27215. HEAP32[$20>>2] = $17;
  27216. $21 = (($19) + 4)|0;
  27217. $22 = $21;
  27218. HEAP32[$22>>2] = $18;
  27219. $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  27220. tempRet0 = ($16);
  27221. return ($13|0);
  27222. }
  27223. function _emscripten_async_run_in_main_thread($0) {
  27224. $0 = $0|0;
  27225. var $$0 = 0, $$0$in = 0, $$0$in19 = 0, $$0$lcssa = 0, $$020 = 0, $$expand_i1_val = 0, $$lcssa = 0, $$lcssa18 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0;
  27226. var $9 = 0, $call_queue$init$val = 0, $call_queue$init$val$pre_trunc = 0, label = 0, sp = 0;
  27227. sp = STACKTOP;
  27228. $1 = ($0|0)==(0|0);
  27229. if ($1) {
  27230. ___assert_fail((13872|0),(13704|0),260,(13877|0));
  27231. // unreachable;
  27232. }
  27233. $2 = (_emscripten_is_main_runtime_thread()|0);
  27234. $3 = ($2|0)==(0);
  27235. if (!($3)) {
  27236. __do_call($0);
  27237. return;
  27238. }
  27239. (___pthread_mutex_lock(33828)|0);
  27240. $call_queue$init$val$pre_trunc = HEAP8[38343]|0;
  27241. $call_queue$init$val = $call_queue$init$val$pre_trunc&1;
  27242. if (!($call_queue$init$val)) {
  27243. $$expand_i1_val = 1;
  27244. HEAP8[38343] = $$expand_i1_val;
  27245. }
  27246. $4 = (Atomics_load(HEAP32, 8464)|0);
  27247. $5 = (Atomics_load(HEAP32, 8465)|0);
  27248. $$0$in19 = (($5) + 1)|0;
  27249. $$020 = (($$0$in19|0) % 128)&-1;
  27250. $6 = ($$020|0)==($4|0);
  27251. if ($6) {
  27252. $7 = $4;
  27253. while(1) {
  27254. (___pthread_mutex_unlock(33828)|0);
  27255. (_emscripten_futex_wait((33856|0),($7|0),inf)|0);
  27256. (___pthread_mutex_lock(33828)|0);
  27257. $8 = (Atomics_load(HEAP32, 8464)|0);
  27258. $9 = (Atomics_load(HEAP32, 8465)|0);
  27259. $$0$in = (($9) + 1)|0;
  27260. $$0 = (($$0$in|0) % 128)&-1;
  27261. $10 = ($$0|0)==($8|0);
  27262. if ($10) {
  27263. $7 = $8;
  27264. } else {
  27265. $$0$lcssa = $$0;$$lcssa = $9;$$lcssa18 = $8;
  27266. break;
  27267. }
  27268. }
  27269. } else {
  27270. $$0$lcssa = $$020;$$lcssa = $5;$$lcssa18 = $4;
  27271. }
  27272. $11 = (33864 + ($$lcssa<<2)|0);
  27273. HEAP32[$11>>2] = $0;
  27274. $12 = ($$lcssa18|0)==($$lcssa|0);
  27275. if ($12) {
  27276. _emscripten_asm_const_v(1);
  27277. }
  27278. $13 = (Atomics_store(HEAP32, 8465, $$0$lcssa)|0);
  27279. (___pthread_mutex_unlock(33828)|0);
  27280. return;
  27281. }
  27282. function _emscripten_atomic_add_u64($0,$1,$2) {
  27283. $0 = $0|0;
  27284. $1 = $1|0;
  27285. $2 = $2|0;
  27286. var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0;
  27287. var $9 = 0, label = 0, sp = 0;
  27288. sp = STACKTOP;
  27289. $3 = $0;
  27290. $4 = $3 >>> 3;
  27291. $5 = $4 & 255;
  27292. $6 = (34384 + ($5<<2)|0);
  27293. while(1) {
  27294. while(1) {
  27295. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  27296. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  27297. $9 = ($7|0)==($8|0);
  27298. if ($9) {
  27299. break;
  27300. }
  27301. }
  27302. $10 = ($7|0)==(0);
  27303. if ($10) {
  27304. break;
  27305. }
  27306. }
  27307. $11 = $0;
  27308. $12 = $11;
  27309. $13 = HEAP32[$12>>2]|0;
  27310. $14 = (($11) + 4)|0;
  27311. $15 = $14;
  27312. $16 = HEAP32[$15>>2]|0;
  27313. $17 = (_i64Add(($13|0),($16|0),($1|0),($2|0))|0);
  27314. $18 = tempRet0;
  27315. $19 = $0;
  27316. $20 = $19;
  27317. HEAP32[$20>>2] = $17;
  27318. $21 = (($19) + 4)|0;
  27319. $22 = $21;
  27320. HEAP32[$22>>2] = $18;
  27321. $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  27322. tempRet0 = ($18);
  27323. return ($17|0);
  27324. }
  27325. function _emscripten_atomic_and_u64($0,$1,$2) {
  27326. $0 = $0|0;
  27327. $1 = $1|0;
  27328. $2 = $2|0;
  27329. var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0;
  27330. var $9 = 0, label = 0, sp = 0;
  27331. sp = STACKTOP;
  27332. $3 = $0;
  27333. $4 = $3 >>> 3;
  27334. $5 = $4 & 255;
  27335. $6 = (34384 + ($5<<2)|0);
  27336. while(1) {
  27337. while(1) {
  27338. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  27339. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  27340. $9 = ($7|0)==($8|0);
  27341. if ($9) {
  27342. break;
  27343. }
  27344. }
  27345. $10 = ($7|0)==(0);
  27346. if ($10) {
  27347. break;
  27348. }
  27349. }
  27350. $11 = $0;
  27351. $12 = $11;
  27352. $13 = HEAP32[$12>>2]|0;
  27353. $14 = (($11) + 4)|0;
  27354. $15 = $14;
  27355. $16 = HEAP32[$15>>2]|0;
  27356. $17 = $13 & $1;
  27357. $18 = $16 & $2;
  27358. $19 = $0;
  27359. $20 = $19;
  27360. HEAP32[$20>>2] = $17;
  27361. $21 = (($19) + 4)|0;
  27362. $22 = $21;
  27363. HEAP32[$22>>2] = $18;
  27364. $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  27365. tempRet0 = ($18);
  27366. return ($17|0);
  27367. }
  27368. function _emscripten_atomic_cas_u64($0,$1,$2,$3,$4) {
  27369. $0 = $0|0;
  27370. $1 = $1|0;
  27371. $2 = $2|0;
  27372. $3 = $3|0;
  27373. $4 = $4|0;
  27374. var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $5 = 0, $6 = 0, $7 = 0;
  27375. var $8 = 0, $9 = 0, label = 0, sp = 0;
  27376. sp = STACKTOP;
  27377. $5 = $0;
  27378. $6 = $5 >>> 3;
  27379. $7 = $6 & 255;
  27380. $8 = (34384 + ($7<<2)|0);
  27381. while(1) {
  27382. while(1) {
  27383. $9 = (Atomics_load(HEAP32, $8>>2)|0);
  27384. $10 = (Atomics_compareExchange(HEAP32, $8>>2, $9, 1)|0);
  27385. $11 = ($9|0)==($10|0);
  27386. if ($11) {
  27387. break;
  27388. }
  27389. }
  27390. $12 = ($9|0)==(0);
  27391. if ($12) {
  27392. break;
  27393. }
  27394. }
  27395. $13 = $0;
  27396. $14 = $13;
  27397. $15 = HEAP32[$14>>2]|0;
  27398. $16 = (($13) + 4)|0;
  27399. $17 = $16;
  27400. $18 = HEAP32[$17>>2]|0;
  27401. $19 = ($15|0)==($1|0);
  27402. $20 = ($18|0)==($2|0);
  27403. $21 = $19 & $20;
  27404. if (!($21)) {
  27405. $26 = (Atomics_store(HEAP32, $8>>2, 0)|0);
  27406. tempRet0 = ($18);
  27407. return ($15|0);
  27408. }
  27409. $22 = $0;
  27410. $23 = $22;
  27411. HEAP32[$23>>2] = $3;
  27412. $24 = (($22) + 4)|0;
  27413. $25 = $24;
  27414. HEAP32[$25>>2] = $4;
  27415. $26 = (Atomics_store(HEAP32, $8>>2, 0)|0);
  27416. tempRet0 = ($18);
  27417. return ($15|0);
  27418. }
  27419. function _emscripten_atomic_exchange_u32($0,$1) {
  27420. $0 = $0|0;
  27421. $1 = $1|0;
  27422. var $2 = 0, $3 = 0, $4 = 0, label = 0, sp = 0;
  27423. sp = STACKTOP;
  27424. while(1) {
  27425. $2 = (Atomics_load(HEAP32, $0>>2)|0);
  27426. $3 = (Atomics_compareExchange(HEAP32, $0>>2, $2, $1)|0);
  27427. $4 = ($2|0)==($3|0);
  27428. if ($4) {
  27429. break;
  27430. }
  27431. }
  27432. return ($2|0);
  27433. }
  27434. function _emscripten_atomic_exchange_u64($0,$1,$2) {
  27435. $0 = $0|0;
  27436. $1 = $1|0;
  27437. $2 = $2|0;
  27438. var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0;
  27439. var sp = 0;
  27440. sp = STACKTOP;
  27441. $3 = $0;
  27442. $4 = $3 >>> 3;
  27443. $5 = $4 & 255;
  27444. $6 = (34384 + ($5<<2)|0);
  27445. while(1) {
  27446. while(1) {
  27447. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  27448. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  27449. $9 = ($7|0)==($8|0);
  27450. if ($9) {
  27451. break;
  27452. }
  27453. }
  27454. $10 = ($7|0)==(0);
  27455. if ($10) {
  27456. break;
  27457. }
  27458. }
  27459. $11 = $0;
  27460. $12 = $11;
  27461. $13 = HEAP32[$12>>2]|0;
  27462. $14 = (($11) + 4)|0;
  27463. $15 = $14;
  27464. $16 = HEAP32[$15>>2]|0;
  27465. $17 = $0;
  27466. $18 = $17;
  27467. HEAP32[$18>>2] = $1;
  27468. $19 = (($17) + 4)|0;
  27469. $20 = $19;
  27470. HEAP32[$20>>2] = $2;
  27471. $21 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  27472. tempRet0 = ($16);
  27473. return ($13|0);
  27474. }
  27475. function _emscripten_atomic_load_f32($0) {
  27476. $0 = $0|0;
  27477. var $1 = 0, $2 = 0.0, label = 0, sp = 0;
  27478. sp = STACKTOP;
  27479. $1 = (Atomics_load(HEAP32, $0>>2)|0);
  27480. $2 = (HEAP32[tempDoublePtr>>2]=$1,+HEAPF32[tempDoublePtr>>2]);
  27481. return (+$2);
  27482. }
  27483. function _emscripten_atomic_load_f64($0) {
  27484. $0 = $0|0;
  27485. var $1 = 0, $10 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0.0, label = 0, sp = 0;
  27486. sp = STACKTOP;
  27487. $1 = $0;
  27488. $2 = $1 >>> 3;
  27489. $3 = $2 & 255;
  27490. $4 = (34384 + ($3<<2)|0);
  27491. while(1) {
  27492. while(1) {
  27493. $5 = (Atomics_load(HEAP32, $4>>2)|0);
  27494. $6 = (Atomics_compareExchange(HEAP32, $4>>2, $5, 1)|0);
  27495. $7 = ($5|0)==($6|0);
  27496. if ($7) {
  27497. break;
  27498. }
  27499. }
  27500. $8 = ($5|0)==(0);
  27501. if ($8) {
  27502. break;
  27503. }
  27504. }
  27505. $9 = +HEAPF64[$0>>3];
  27506. $10 = (Atomics_store(HEAP32, $4>>2, 0)|0);
  27507. return (+$9);
  27508. }
  27509. function _emscripten_atomic_load_u64($0) {
  27510. $0 = $0|0;
  27511. var $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  27512. sp = STACKTOP;
  27513. $1 = $0;
  27514. $2 = $1 >>> 3;
  27515. $3 = $2 & 255;
  27516. $4 = (34384 + ($3<<2)|0);
  27517. while(1) {
  27518. while(1) {
  27519. $5 = (Atomics_load(HEAP32, $4>>2)|0);
  27520. $6 = (Atomics_compareExchange(HEAP32, $4>>2, $5, 1)|0);
  27521. $7 = ($5|0)==($6|0);
  27522. if ($7) {
  27523. break;
  27524. }
  27525. }
  27526. $8 = ($5|0)==(0);
  27527. if ($8) {
  27528. break;
  27529. }
  27530. }
  27531. $9 = $0;
  27532. $10 = $9;
  27533. $11 = HEAP32[$10>>2]|0;
  27534. $12 = (($9) + 4)|0;
  27535. $13 = $12;
  27536. $14 = HEAP32[$13>>2]|0;
  27537. $15 = (Atomics_store(HEAP32, $4>>2, 0)|0);
  27538. tempRet0 = ($14);
  27539. return ($11|0);
  27540. }
  27541. function _emscripten_atomic_or_u64($0,$1,$2) {
  27542. $0 = $0|0;
  27543. $1 = $1|0;
  27544. $2 = $2|0;
  27545. var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0;
  27546. var $9 = 0, label = 0, sp = 0;
  27547. sp = STACKTOP;
  27548. $3 = $0;
  27549. $4 = $3 >>> 3;
  27550. $5 = $4 & 255;
  27551. $6 = (34384 + ($5<<2)|0);
  27552. while(1) {
  27553. while(1) {
  27554. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  27555. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  27556. $9 = ($7|0)==($8|0);
  27557. if ($9) {
  27558. break;
  27559. }
  27560. }
  27561. $10 = ($7|0)==(0);
  27562. if ($10) {
  27563. break;
  27564. }
  27565. }
  27566. $11 = $0;
  27567. $12 = $11;
  27568. $13 = HEAP32[$12>>2]|0;
  27569. $14 = (($11) + 4)|0;
  27570. $15 = $14;
  27571. $16 = HEAP32[$15>>2]|0;
  27572. $17 = $13 | $1;
  27573. $18 = $16 | $2;
  27574. $19 = $0;
  27575. $20 = $19;
  27576. HEAP32[$20>>2] = $17;
  27577. $21 = (($19) + 4)|0;
  27578. $22 = $21;
  27579. HEAP32[$22>>2] = $18;
  27580. $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  27581. tempRet0 = ($18);
  27582. return ($17|0);
  27583. }
  27584. function _emscripten_atomic_store_f32($0,$1) {
  27585. $0 = $0|0;
  27586. $1 = +$1;
  27587. var $2 = 0, $3 = 0, $4 = 0.0, label = 0, sp = 0;
  27588. sp = STACKTOP;
  27589. $2 = (HEAPF32[tempDoublePtr>>2]=$1,HEAP32[tempDoublePtr>>2]|0);
  27590. $3 = (Atomics_store(HEAP32, $0>>2, $2)|0);
  27591. $4 = (+($3>>>0));
  27592. return (+$4);
  27593. }
  27594. function _emscripten_atomic_store_f64($0,$1) {
  27595. $0 = $0|0;
  27596. $1 = +$1;
  27597. var $10 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  27598. sp = STACKTOP;
  27599. $2 = $0;
  27600. $3 = $2 >>> 3;
  27601. $4 = $3 & 255;
  27602. $5 = (34384 + ($4<<2)|0);
  27603. while(1) {
  27604. while(1) {
  27605. $6 = (Atomics_load(HEAP32, $5>>2)|0);
  27606. $7 = (Atomics_compareExchange(HEAP32, $5>>2, $6, 1)|0);
  27607. $8 = ($6|0)==($7|0);
  27608. if ($8) {
  27609. break;
  27610. }
  27611. }
  27612. $9 = ($6|0)==(0);
  27613. if ($9) {
  27614. break;
  27615. }
  27616. }
  27617. HEAPF64[$0>>3] = $1;
  27618. $10 = (Atomics_store(HEAP32, $5>>2, 0)|0);
  27619. return (+$1);
  27620. }
  27621. function _emscripten_atomic_store_u64($0,$1,$2) {
  27622. $0 = $0|0;
  27623. $1 = $1|0;
  27624. $2 = $2|0;
  27625. var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  27626. sp = STACKTOP;
  27627. $3 = $0;
  27628. $4 = $3 >>> 3;
  27629. $5 = $4 & 255;
  27630. $6 = (34384 + ($5<<2)|0);
  27631. while(1) {
  27632. while(1) {
  27633. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  27634. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  27635. $9 = ($7|0)==($8|0);
  27636. if ($9) {
  27637. break;
  27638. }
  27639. }
  27640. $10 = ($7|0)==(0);
  27641. if ($10) {
  27642. break;
  27643. }
  27644. }
  27645. $11 = $0;
  27646. $12 = $11;
  27647. HEAP32[$12>>2] = $1;
  27648. $13 = (($11) + 4)|0;
  27649. $14 = $13;
  27650. HEAP32[$14>>2] = $2;
  27651. $15 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  27652. tempRet0 = ($2);
  27653. return ($1|0);
  27654. }
  27655. function _emscripten_atomic_sub_u64($0,$1,$2) {
  27656. $0 = $0|0;
  27657. $1 = $1|0;
  27658. $2 = $2|0;
  27659. var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0;
  27660. var $9 = 0, label = 0, sp = 0;
  27661. sp = STACKTOP;
  27662. $3 = $0;
  27663. $4 = $3 >>> 3;
  27664. $5 = $4 & 255;
  27665. $6 = (34384 + ($5<<2)|0);
  27666. while(1) {
  27667. while(1) {
  27668. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  27669. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  27670. $9 = ($7|0)==($8|0);
  27671. if ($9) {
  27672. break;
  27673. }
  27674. }
  27675. $10 = ($7|0)==(0);
  27676. if ($10) {
  27677. break;
  27678. }
  27679. }
  27680. $11 = $0;
  27681. $12 = $11;
  27682. $13 = HEAP32[$12>>2]|0;
  27683. $14 = (($11) + 4)|0;
  27684. $15 = $14;
  27685. $16 = HEAP32[$15>>2]|0;
  27686. $17 = (_i64Subtract(($13|0),($16|0),($1|0),($2|0))|0);
  27687. $18 = tempRet0;
  27688. $19 = $0;
  27689. $20 = $19;
  27690. HEAP32[$20>>2] = $17;
  27691. $21 = (($19) + 4)|0;
  27692. $22 = $21;
  27693. HEAP32[$22>>2] = $18;
  27694. $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  27695. tempRet0 = ($18);
  27696. return ($17|0);
  27697. }
  27698. function _emscripten_atomic_xor_u64($0,$1,$2) {
  27699. $0 = $0|0;
  27700. $1 = $1|0;
  27701. $2 = $2|0;
  27702. var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0;
  27703. var $9 = 0, label = 0, sp = 0;
  27704. sp = STACKTOP;
  27705. $3 = $0;
  27706. $4 = $3 >>> 3;
  27707. $5 = $4 & 255;
  27708. $6 = (34384 + ($5<<2)|0);
  27709. while(1) {
  27710. while(1) {
  27711. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  27712. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  27713. $9 = ($7|0)==($8|0);
  27714. if ($9) {
  27715. break;
  27716. }
  27717. }
  27718. $10 = ($7|0)==(0);
  27719. if ($10) {
  27720. break;
  27721. }
  27722. }
  27723. $11 = $0;
  27724. $12 = $11;
  27725. $13 = HEAP32[$12>>2]|0;
  27726. $14 = (($11) + 4)|0;
  27727. $15 = $14;
  27728. $16 = HEAP32[$15>>2]|0;
  27729. $17 = $13 ^ $1;
  27730. $18 = $16 ^ $2;
  27731. $19 = $0;
  27732. $20 = $19;
  27733. HEAP32[$20>>2] = $17;
  27734. $21 = (($19) + 4)|0;
  27735. $22 = $21;
  27736. HEAP32[$22>>2] = $18;
  27737. $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  27738. tempRet0 = ($18);
  27739. return ($17|0);
  27740. }
  27741. function _emscripten_main_thread_process_queued_calls() {
  27742. var $$0910 = 0, $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, label = 0, sp = 0;
  27743. sp = STACKTOP;
  27744. $0 = (_emscripten_is_main_runtime_thread()|0);
  27745. $1 = ($0|0)==(0);
  27746. if ($1) {
  27747. ___assert_fail((13582|0),(13704|0),424,(13768|0));
  27748. // unreachable;
  27749. }
  27750. $2 = (_emscripten_is_main_runtime_thread()|0);
  27751. $3 = ($2|0)==(0);
  27752. $4 = HEAP32[8456]|0;
  27753. $5 = ($4|0)!=(0);
  27754. $or$cond = $3 | $5;
  27755. if ($or$cond) {
  27756. return;
  27757. }
  27758. HEAP32[8456] = 1;
  27759. (___pthread_mutex_lock(33828)|0);
  27760. $6 = (Atomics_load(HEAP32, 8464)|0);
  27761. $7 = (Atomics_load(HEAP32, 8465)|0);
  27762. $8 = ($6|0)==($7|0);
  27763. (___pthread_mutex_unlock(33828)|0);
  27764. if (!($8)) {
  27765. $$0910 = $6;
  27766. while(1) {
  27767. $9 = (33864 + ($$0910<<2)|0);
  27768. $10 = HEAP32[$9>>2]|0;
  27769. __do_call($10);
  27770. (___pthread_mutex_lock(33828)|0);
  27771. $11 = (($$0910) + 1)|0;
  27772. $12 = (($11|0) % 128)&-1;
  27773. $13 = (Atomics_store(HEAP32, 8464, $12)|0);
  27774. $14 = (Atomics_load(HEAP32, 8465)|0);
  27775. $15 = ($12|0)==($14|0);
  27776. (___pthread_mutex_unlock(33828)|0);
  27777. if ($15) {
  27778. break;
  27779. } else {
  27780. $$0910 = $12;
  27781. }
  27782. }
  27783. }
  27784. (_emscripten_futex_wake((33856|0),2147483647)|0);
  27785. HEAP32[8456] = 0;
  27786. return;
  27787. }
  27788. function _emscripten_sync_run_in_main_thread($0) {
  27789. $0 = $0|0;
  27790. var label = 0, sp = 0;
  27791. sp = STACKTOP;
  27792. _emscripten_async_run_in_main_thread($0);
  27793. (_emscripten_wait_for_call_v($0,inf)|0);
  27794. return;
  27795. }
  27796. function _emscripten_sync_run_in_main_thread_0($0) {
  27797. $0 = $0|0;
  27798. var $1 = 0, $2 = 0, $3 = 0, dest = 0, label = 0, sp = 0, stop = 0;
  27799. sp = STACKTOP;
  27800. STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
  27801. $1 = sp;
  27802. dest=$1; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  27803. HEAP32[$1>>2] = $0;
  27804. $2 = ((($1)) + 80|0);
  27805. HEAP32[$2>>2] = 0;
  27806. _emscripten_async_run_in_main_thread($1);
  27807. (_emscripten_wait_for_call_v($1,inf)|0);
  27808. $3 = HEAP32[$2>>2]|0;
  27809. STACKTOP = sp;return ($3|0);
  27810. }
  27811. function _emscripten_sync_run_in_main_thread_1($0,$1) {
  27812. $0 = $0|0;
  27813. $1 = $1|0;
  27814. var $2 = 0, $3 = 0, $4 = 0, $5 = 0, dest = 0, label = 0, sp = 0, stop = 0;
  27815. sp = STACKTOP;
  27816. STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
  27817. $2 = sp;
  27818. dest=$2; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  27819. HEAP32[$2>>2] = $0;
  27820. $3 = ((($2)) + 16|0);
  27821. HEAP32[$3>>2] = $1;
  27822. $4 = ((($2)) + 80|0);
  27823. HEAP32[$4>>2] = 0;
  27824. _emscripten_async_run_in_main_thread($2);
  27825. (_emscripten_wait_for_call_v($2,inf)|0);
  27826. $5 = HEAP32[$4>>2]|0;
  27827. STACKTOP = sp;return ($5|0);
  27828. }
  27829. function _emscripten_sync_run_in_main_thread_2($0,$1,$2) {
  27830. $0 = $0|0;
  27831. $1 = $1|0;
  27832. $2 = $2|0;
  27833. var $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, dest = 0, label = 0, sp = 0, stop = 0;
  27834. sp = STACKTOP;
  27835. STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
  27836. $3 = sp;
  27837. dest=$3; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  27838. HEAP32[$3>>2] = $0;
  27839. $4 = ((($3)) + 16|0);
  27840. HEAP32[$4>>2] = $1;
  27841. $5 = ((($3)) + 24|0);
  27842. HEAP32[$5>>2] = $2;
  27843. $6 = ((($3)) + 80|0);
  27844. HEAP32[$6>>2] = 0;
  27845. _emscripten_async_run_in_main_thread($3);
  27846. (_emscripten_wait_for_call_v($3,inf)|0);
  27847. $7 = HEAP32[$6>>2]|0;
  27848. STACKTOP = sp;return ($7|0);
  27849. }
  27850. function _emscripten_sync_run_in_main_thread_3($0,$1,$2,$3) {
  27851. $0 = $0|0;
  27852. $1 = $1|0;
  27853. $2 = $2|0;
  27854. $3 = $3|0;
  27855. var $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, stop = 0;
  27856. sp = STACKTOP;
  27857. STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
  27858. $4 = sp;
  27859. dest=$4; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  27860. HEAP32[$4>>2] = $0;
  27861. $5 = ((($4)) + 16|0);
  27862. HEAP32[$5>>2] = $1;
  27863. $6 = ((($4)) + 24|0);
  27864. HEAP32[$6>>2] = $2;
  27865. $7 = ((($4)) + 32|0);
  27866. HEAP32[$7>>2] = $3;
  27867. $8 = ((($4)) + 80|0);
  27868. HEAP32[$8>>2] = 0;
  27869. _emscripten_async_run_in_main_thread($4);
  27870. (_emscripten_wait_for_call_v($4,inf)|0);
  27871. $9 = HEAP32[$8>>2]|0;
  27872. STACKTOP = sp;return ($9|0);
  27873. }
  27874. function _emscripten_sync_run_in_main_thread_4($0,$1,$2,$3,$4) {
  27875. $0 = $0|0;
  27876. $1 = $1|0;
  27877. $2 = $2|0;
  27878. $3 = $3|0;
  27879. $4 = $4|0;
  27880. var $10 = 0, $11 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, stop = 0;
  27881. sp = STACKTOP;
  27882. STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
  27883. $5 = sp;
  27884. dest=$5; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  27885. HEAP32[$5>>2] = $0;
  27886. $6 = ((($5)) + 16|0);
  27887. HEAP32[$6>>2] = $1;
  27888. $7 = ((($5)) + 24|0);
  27889. HEAP32[$7>>2] = $2;
  27890. $8 = ((($5)) + 32|0);
  27891. HEAP32[$8>>2] = $3;
  27892. $9 = ((($5)) + 40|0);
  27893. HEAP32[$9>>2] = $4;
  27894. $10 = ((($5)) + 80|0);
  27895. HEAP32[$10>>2] = 0;
  27896. _emscripten_async_run_in_main_thread($5);
  27897. (_emscripten_wait_for_call_v($5,inf)|0);
  27898. $11 = HEAP32[$10>>2]|0;
  27899. STACKTOP = sp;return ($11|0);
  27900. }
  27901. function _emscripten_sync_run_in_main_thread_5($0,$1,$2,$3,$4,$5) {
  27902. $0 = $0|0;
  27903. $1 = $1|0;
  27904. $2 = $2|0;
  27905. $3 = $3|0;
  27906. $4 = $4|0;
  27907. $5 = $5|0;
  27908. var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, stop = 0;
  27909. sp = STACKTOP;
  27910. STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
  27911. $6 = sp;
  27912. dest=$6; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  27913. HEAP32[$6>>2] = $0;
  27914. $7 = ((($6)) + 16|0);
  27915. HEAP32[$7>>2] = $1;
  27916. $8 = ((($6)) + 24|0);
  27917. HEAP32[$8>>2] = $2;
  27918. $9 = ((($6)) + 32|0);
  27919. HEAP32[$9>>2] = $3;
  27920. $10 = ((($6)) + 40|0);
  27921. HEAP32[$10>>2] = $4;
  27922. $11 = ((($6)) + 48|0);
  27923. HEAP32[$11>>2] = $5;
  27924. $12 = ((($6)) + 80|0);
  27925. HEAP32[$12>>2] = 0;
  27926. _emscripten_async_run_in_main_thread($6);
  27927. (_emscripten_wait_for_call_v($6,inf)|0);
  27928. $13 = HEAP32[$12>>2]|0;
  27929. STACKTOP = sp;return ($13|0);
  27930. }
  27931. function _emscripten_sync_run_in_main_thread_6($0,$1,$2,$3,$4,$5,$6) {
  27932. $0 = $0|0;
  27933. $1 = $1|0;
  27934. $2 = $2|0;
  27935. $3 = $3|0;
  27936. $4 = $4|0;
  27937. $5 = $5|0;
  27938. $6 = $6|0;
  27939. var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, stop = 0;
  27940. sp = STACKTOP;
  27941. STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
  27942. $7 = sp;
  27943. dest=$7; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  27944. HEAP32[$7>>2] = $0;
  27945. $8 = ((($7)) + 16|0);
  27946. HEAP32[$8>>2] = $1;
  27947. $9 = ((($7)) + 24|0);
  27948. HEAP32[$9>>2] = $2;
  27949. $10 = ((($7)) + 32|0);
  27950. HEAP32[$10>>2] = $3;
  27951. $11 = ((($7)) + 40|0);
  27952. HEAP32[$11>>2] = $4;
  27953. $12 = ((($7)) + 48|0);
  27954. HEAP32[$12>>2] = $5;
  27955. $13 = ((($7)) + 56|0);
  27956. HEAP32[$13>>2] = $6;
  27957. $14 = ((($7)) + 80|0);
  27958. HEAP32[$14>>2] = 0;
  27959. _emscripten_async_run_in_main_thread($7);
  27960. (_emscripten_wait_for_call_v($7,inf)|0);
  27961. $15 = HEAP32[$14>>2]|0;
  27962. STACKTOP = sp;return ($15|0);
  27963. }
  27964. function _emscripten_sync_run_in_main_thread_7($0,$1,$2,$3,$4,$5,$6,$7) {
  27965. $0 = $0|0;
  27966. $1 = $1|0;
  27967. $2 = $2|0;
  27968. $3 = $3|0;
  27969. $4 = $4|0;
  27970. $5 = $5|0;
  27971. $6 = $6|0;
  27972. $7 = $7|0;
  27973. var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, stop = 0;
  27974. sp = STACKTOP;
  27975. STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
  27976. $8 = sp;
  27977. dest=$8; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  27978. HEAP32[$8>>2] = $0;
  27979. $9 = ((($8)) + 16|0);
  27980. HEAP32[$9>>2] = $1;
  27981. $10 = ((($8)) + 24|0);
  27982. HEAP32[$10>>2] = $2;
  27983. $11 = ((($8)) + 32|0);
  27984. HEAP32[$11>>2] = $3;
  27985. $12 = ((($8)) + 40|0);
  27986. HEAP32[$12>>2] = $4;
  27987. $13 = ((($8)) + 48|0);
  27988. HEAP32[$13>>2] = $5;
  27989. $14 = ((($8)) + 56|0);
  27990. HEAP32[$14>>2] = $6;
  27991. $15 = ((($8)) + 64|0);
  27992. HEAP32[$15>>2] = $7;
  27993. $16 = ((($8)) + 80|0);
  27994. HEAP32[$16>>2] = 0;
  27995. _emscripten_async_run_in_main_thread($8);
  27996. (_emscripten_wait_for_call_v($8,inf)|0);
  27997. $17 = HEAP32[$16>>2]|0;
  27998. STACKTOP = sp;return ($17|0);
  27999. }
  28000. function _emscripten_sync_run_in_main_thread_xprintf_varargs($0,$1,$2,$varargs) {
  28001. $0 = $0|0;
  28002. $1 = $1|0;
  28003. $2 = $2|0;
  28004. $varargs = $varargs|0;
  28005. var $$0 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, stop = 0;
  28006. sp = STACKTOP;
  28007. STACKTOP = STACKTOP + 240|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(240|0);
  28008. $3 = sp + 96|0;
  28009. $4 = sp + 112|0;
  28010. $5 = sp;
  28011. HEAP32[$3>>2] = $varargs;
  28012. $6 = (_vsnprintf($4,128,$2,$3)|0);
  28013. $7 = ($6|0)>(127);
  28014. $8 = (($6) + 1)|0;
  28015. if ($7) {
  28016. $9 = (_malloc($8)|0);
  28017. HEAP32[$3>>2] = $varargs;
  28018. (_vsnprintf($9,$8,$2,$3)|0);
  28019. $$0 = $9;
  28020. } else {
  28021. $$0 = $4;
  28022. }
  28023. dest=$5; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  28024. HEAP32[$5>>2] = $0;
  28025. $10 = $1;
  28026. $11 = ((($5)) + 16|0);
  28027. HEAP32[$11>>2] = $10;
  28028. $12 = ((($5)) + 24|0);
  28029. HEAP32[$12>>2] = $$0;
  28030. $13 = ((($5)) + 80|0);
  28031. HEAP32[$13>>2] = 0;
  28032. _emscripten_async_run_in_main_thread($5);
  28033. (_emscripten_wait_for_call_v($5,inf)|0);
  28034. $14 = ($$0|0)==($4|0);
  28035. if ($14) {
  28036. $15 = HEAP32[$13>>2]|0;
  28037. STACKTOP = sp;return ($15|0);
  28038. }
  28039. _free($$0);
  28040. $15 = HEAP32[$13>>2]|0;
  28041. STACKTOP = sp;return ($15|0);
  28042. }
  28043. function ___pthread_tsd_run_dtors() {
  28044. var $$02427 = 0, $$026 = 0, $$125 = 0, $$2 = 0, $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0;
  28045. var $8 = 0, $9 = 0, $exitcond = 0, label = 0, sp = 0;
  28046. sp = STACKTOP;
  28047. $0 = (_pthread_self()|0);
  28048. $1 = ((($0)) + 60|0);
  28049. $2 = HEAP32[$1>>2]|0;
  28050. $3 = ($2|0)==(0);
  28051. if ($3) {
  28052. return;
  28053. }
  28054. $4 = ((($0)) + 116|0);
  28055. $$02427 = 0;
  28056. while(1) {
  28057. $$026 = 0;$$125 = 0;
  28058. while(1) {
  28059. $5 = HEAP32[$4>>2]|0;
  28060. $6 = (($5) + ($$026<<2)|0);
  28061. $7 = HEAP32[$6>>2]|0;
  28062. $8 = ($7|0)==(0|0);
  28063. if ($8) {
  28064. $$2 = $$125;
  28065. } else {
  28066. $9 = (33312 + ($$026<<2)|0);
  28067. $10 = (Atomics_load(HEAP32,$9>>2)|0);
  28068. $11 = ($10|0)==(0|0);
  28069. if ($11) {
  28070. $$2 = $$125;
  28071. } else {
  28072. HEAP32[$6>>2] = 0;
  28073. $12 = (Atomics_load(HEAP32,$9>>2)|0);
  28074. FUNCTION_TABLE_vi[$12 & 31]($7);
  28075. $$2 = 1;
  28076. }
  28077. }
  28078. $13 = (($$026) + 1)|0;
  28079. $exitcond = ($13|0)==(128);
  28080. if ($exitcond) {
  28081. break;
  28082. } else {
  28083. $$026 = $13;$$125 = $$2;
  28084. }
  28085. }
  28086. $14 = (($$02427) + 1)|0;
  28087. $15 = ($$2|0)!=(0);
  28088. $16 = ($14|0)<(4);
  28089. $17 = $16 & $15;
  28090. if ($17) {
  28091. $$02427 = $14;
  28092. } else {
  28093. break;
  28094. }
  28095. }
  28096. return;
  28097. }
  28098. function _emscripten_wait_for_call_v($0,$1) {
  28099. $0 = $0|0;
  28100. $1 = +$1;
  28101. var $$ = 0, $$01921 = 0.0, $$020$lcssa = 0, $$1 = 0, $10 = 0.0, $11 = 0, $12 = 0, $13 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0.0, $6 = 0.0, $7 = 0, $8 = 0.0, $9 = 0, $or$cond = 0, label = 0, sp = 0;
  28102. sp = STACKTOP;
  28103. $2 = ((($0)) + 8|0);
  28104. $3 = (Atomics_load(HEAP32, $2>>2)|0);
  28105. $4 = ($3|0)==(0);
  28106. if (!($4)) {
  28107. $$1 = $3;
  28108. $13 = ($$1|0)==(0);
  28109. $$ = $13 ? -8 : 0;
  28110. return ($$|0);
  28111. }
  28112. $5 = (+_emscripten_get_now());
  28113. $6 = $5 + $1;
  28114. _emscripten_set_current_thread_status(5);
  28115. $7 = $5 < $6;
  28116. if ($7) {
  28117. $$01921 = $5;
  28118. while(1) {
  28119. $8 = $6 - $$01921;
  28120. (_emscripten_futex_wait(($2|0),0,(+$8))|0);
  28121. $9 = (Atomics_load(HEAP32, $2>>2)|0);
  28122. $10 = (+_emscripten_get_now());
  28123. $11 = ($9|0)==(0);
  28124. $12 = $10 < $6;
  28125. $or$cond = $11 & $12;
  28126. if ($or$cond) {
  28127. $$01921 = $10;
  28128. } else {
  28129. $$020$lcssa = $9;
  28130. break;
  28131. }
  28132. }
  28133. } else {
  28134. $$020$lcssa = 0;
  28135. }
  28136. _emscripten_set_current_thread_status(1);
  28137. $$1 = $$020$lcssa;
  28138. $13 = ($$1|0)==(0);
  28139. $$ = $13 ? -8 : 0;
  28140. return ($$|0);
  28141. }
  28142. function __do_call($0) {
  28143. $0 = $0|0;
  28144. var $1 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0, $116 = 0;
  28145. var $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0;
  28146. var $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0;
  28147. var $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0;
  28148. var $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0;
  28149. var $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0;
  28150. var $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, label = 0, sp = 0;
  28151. sp = STACKTOP;
  28152. $1 = HEAP32[$0>>2]|0;
  28153. do {
  28154. switch ($1|0) {
  28155. case 12: {
  28156. $2 = ((($0)) + 16|0);
  28157. $3 = HEAP32[$2>>2]|0;
  28158. $4 = ((($0)) + 24|0);
  28159. $5 = HEAP32[$4>>2]|0;
  28160. $6 = (_utime(($3|0),($5|0))|0);
  28161. $7 = ((($0)) + 80|0);
  28162. HEAP32[$7>>2] = $6;
  28163. break;
  28164. }
  28165. case 13: {
  28166. $8 = ((($0)) + 16|0);
  28167. $9 = HEAP32[$8>>2]|0;
  28168. $10 = ((($0)) + 24|0);
  28169. $11 = HEAP32[$10>>2]|0;
  28170. $12 = (_utimes(($9|0),($11|0))|0);
  28171. $13 = ((($0)) + 80|0);
  28172. HEAP32[$13>>2] = $12;
  28173. break;
  28174. }
  28175. case 37: {
  28176. $14 = ((($0)) + 16|0);
  28177. $15 = HEAP32[$14>>2]|0;
  28178. $16 = (_chroot(($15|0))|0);
  28179. $17 = ((($0)) + 80|0);
  28180. HEAP32[$17>>2] = $16;
  28181. break;
  28182. }
  28183. case 46: {
  28184. $18 = ((($0)) + 16|0);
  28185. $19 = HEAP32[$18>>2]|0;
  28186. $20 = ((($0)) + 24|0);
  28187. $21 = HEAP32[$20>>2]|0;
  28188. $22 = (_fpathconf(($19|0),($21|0))|0);
  28189. $23 = ((($0)) + 80|0);
  28190. HEAP32[$23>>2] = $22;
  28191. break;
  28192. }
  28193. case 68: {
  28194. $24 = ((($0)) + 16|0);
  28195. $25 = HEAP32[$24>>2]|0;
  28196. $26 = ((($0)) + 24|0);
  28197. $27 = HEAP32[$26>>2]|0;
  28198. $28 = ((($0)) + 32|0);
  28199. $29 = HEAP32[$28>>2]|0;
  28200. $30 = (_confstr(($25|0),($27|0),($29|0))|0);
  28201. $31 = ((($0)) + 80|0);
  28202. HEAP32[$31>>2] = $30;
  28203. break;
  28204. }
  28205. case 72: {
  28206. $32 = ((($0)) + 16|0);
  28207. $33 = HEAP32[$32>>2]|0;
  28208. $34 = (_sysconf(($33|0))|0);
  28209. $35 = ((($0)) + 80|0);
  28210. HEAP32[$35>>2] = $34;
  28211. break;
  28212. }
  28213. case 110: {
  28214. $36 = ((($0)) + 16|0);
  28215. $37 = HEAP32[$36>>2]|0;
  28216. $38 = (_atexit(($37|0))|0);
  28217. $39 = ((($0)) + 80|0);
  28218. HEAP32[$39>>2] = $38;
  28219. break;
  28220. }
  28221. case 111: {
  28222. $40 = ((($0)) + 16|0);
  28223. $41 = HEAP32[$40>>2]|0;
  28224. $42 = (_getenv(($41|0))|0);
  28225. $43 = ((($0)) + 80|0);
  28226. HEAP32[$43>>2] = $42;
  28227. break;
  28228. }
  28229. case 112: {
  28230. $44 = (_clearenv()|0);
  28231. $45 = ((($0)) + 80|0);
  28232. HEAP32[$45>>2] = $44;
  28233. break;
  28234. }
  28235. case 113: {
  28236. $46 = ((($0)) + 16|0);
  28237. $47 = HEAP32[$46>>2]|0;
  28238. $48 = ((($0)) + 24|0);
  28239. $49 = HEAP32[$48>>2]|0;
  28240. $50 = ((($0)) + 32|0);
  28241. $51 = HEAP32[$50>>2]|0;
  28242. $52 = (_setenv(($47|0),($49|0),($51|0))|0);
  28243. $53 = ((($0)) + 80|0);
  28244. HEAP32[$53>>2] = $52;
  28245. break;
  28246. }
  28247. case 114: {
  28248. $54 = ((($0)) + 16|0);
  28249. $55 = HEAP32[$54>>2]|0;
  28250. $56 = (_unsetenv(($55|0))|0);
  28251. $57 = ((($0)) + 80|0);
  28252. HEAP32[$57>>2] = $56;
  28253. break;
  28254. }
  28255. case 115: {
  28256. $58 = ((($0)) + 16|0);
  28257. $59 = HEAP32[$58>>2]|0;
  28258. $60 = (_putenv(($59|0))|0);
  28259. $61 = ((($0)) + 80|0);
  28260. HEAP32[$61>>2] = $60;
  28261. break;
  28262. }
  28263. case 119: {
  28264. _tzset();
  28265. break;
  28266. }
  28267. case 137: {
  28268. $62 = ((($0)) + 16|0);
  28269. $63 = HEAP32[$62>>2]|0;
  28270. $64 = ((($0)) + 24|0);
  28271. $65 = HEAP32[$64>>2]|0;
  28272. $66 = ((($0)) + 32|0);
  28273. $67 = HEAP32[$66>>2]|0;
  28274. $68 = ((($0)) + 40|0);
  28275. $69 = HEAP32[$68>>2]|0;
  28276. $70 = (_pthread_create(($63|0),($65|0),($67|0),($69|0))|0);
  28277. $71 = ((($0)) + 80|0);
  28278. HEAP32[$71>>2] = $70;
  28279. break;
  28280. }
  28281. case 138: {
  28282. $72 = ((($0)) + 16|0);
  28283. $73 = HEAP32[$72>>2]|0;
  28284. $74 = ((($0)) + 24|0);
  28285. $75 = HEAP32[$74>>2]|0;
  28286. $76 = (_emscripten_syscall(($73|0),($75|0))|0);
  28287. $77 = ((($0)) + 80|0);
  28288. HEAP32[$77>>2] = $76;
  28289. break;
  28290. }
  28291. case 1024: {
  28292. $78 = ((($0)) + 4|0);
  28293. $79 = HEAP32[$78>>2]|0;
  28294. FUNCTION_TABLE_v[$79 & 7]();
  28295. break;
  28296. }
  28297. case 1025: {
  28298. $80 = ((($0)) + 4|0);
  28299. $81 = HEAP32[$80>>2]|0;
  28300. $82 = ((($0)) + 16|0);
  28301. $83 = HEAP32[$82>>2]|0;
  28302. FUNCTION_TABLE_vi[$81 & 31]($83);
  28303. break;
  28304. }
  28305. case 1026: {
  28306. $84 = ((($0)) + 4|0);
  28307. $85 = HEAP32[$84>>2]|0;
  28308. $86 = ((($0)) + 16|0);
  28309. $87 = HEAP32[$86>>2]|0;
  28310. $88 = ((($0)) + 24|0);
  28311. $89 = HEAP32[$88>>2]|0;
  28312. FUNCTION_TABLE_vii[$85 & 63]($87,$89);
  28313. break;
  28314. }
  28315. case 1027: {
  28316. $90 = ((($0)) + 4|0);
  28317. $91 = HEAP32[$90>>2]|0;
  28318. $92 = ((($0)) + 16|0);
  28319. $93 = HEAP32[$92>>2]|0;
  28320. $94 = ((($0)) + 24|0);
  28321. $95 = HEAP32[$94>>2]|0;
  28322. $96 = ((($0)) + 32|0);
  28323. $97 = HEAP32[$96>>2]|0;
  28324. FUNCTION_TABLE_viii[$91 & 31]($93,$95,$97);
  28325. break;
  28326. }
  28327. case 2048: {
  28328. $98 = ((($0)) + 4|0);
  28329. $99 = HEAP32[$98>>2]|0;
  28330. $100 = (FUNCTION_TABLE_i[$99 & 3]()|0);
  28331. $101 = ((($0)) + 80|0);
  28332. HEAP32[$101>>2] = $100;
  28333. break;
  28334. }
  28335. case 2049: {
  28336. $102 = ((($0)) + 4|0);
  28337. $103 = HEAP32[$102>>2]|0;
  28338. $104 = ((($0)) + 16|0);
  28339. $105 = HEAP32[$104>>2]|0;
  28340. $106 = (FUNCTION_TABLE_ii[$103 & 15]($105)|0);
  28341. $107 = ((($0)) + 80|0);
  28342. HEAP32[$107>>2] = $106;
  28343. break;
  28344. }
  28345. case 2050: {
  28346. $108 = ((($0)) + 4|0);
  28347. $109 = HEAP32[$108>>2]|0;
  28348. $110 = ((($0)) + 16|0);
  28349. $111 = HEAP32[$110>>2]|0;
  28350. $112 = ((($0)) + 24|0);
  28351. $113 = HEAP32[$112>>2]|0;
  28352. $114 = (FUNCTION_TABLE_iii[$109 & 3]($111,$113)|0);
  28353. $115 = ((($0)) + 80|0);
  28354. HEAP32[$115>>2] = $114;
  28355. break;
  28356. }
  28357. case 2051: {
  28358. $116 = ((($0)) + 4|0);
  28359. $117 = HEAP32[$116>>2]|0;
  28360. $118 = ((($0)) + 16|0);
  28361. $119 = HEAP32[$118>>2]|0;
  28362. $120 = ((($0)) + 24|0);
  28363. $121 = HEAP32[$120>>2]|0;
  28364. $122 = ((($0)) + 32|0);
  28365. $123 = HEAP32[$122>>2]|0;
  28366. $124 = (FUNCTION_TABLE_iiii[$117 & 15]($119,$121,$123)|0);
  28367. $125 = ((($0)) + 80|0);
  28368. HEAP32[$125>>2] = $124;
  28369. break;
  28370. }
  28371. default: {
  28372. ___assert_fail((13812|0),(13704|0),211,(13863|0));
  28373. // unreachable;
  28374. }
  28375. }
  28376. } while(0);
  28377. $126 = ((($0)) + 88|0);
  28378. $127 = HEAP32[$126>>2]|0;
  28379. $128 = ($127|0)==(0);
  28380. if ($128) {
  28381. $129 = ((($0)) + 8|0);
  28382. HEAP32[$129>>2] = 1;
  28383. (_emscripten_futex_wake(($129|0),2147483647)|0);
  28384. return;
  28385. } else {
  28386. _free($0);
  28387. return;
  28388. }
  28389. }
  28390. function ___pthread_mutex_unlock($0) {
  28391. $0 = $0|0;
  28392. var $$0 = 0, $$045 = 0, $$pre = 0, $$pre$phiZ2D = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0;
  28393. var $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $5 = 0, $6 = 0;
  28394. var $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, $or$cond3 = 0, label = 0, sp = 0;
  28395. sp = STACKTOP;
  28396. $1 = ((($0)) + 8|0);
  28397. $2 = (Atomics_load(HEAP32,$1>>2)|0);
  28398. $3 = HEAP32[$0>>2]|0;
  28399. $4 = $3 & 15;
  28400. $5 = $3 & 128;
  28401. $6 = $5 ^ 128;
  28402. $7 = ($4|0)==(0);
  28403. if ($7) {
  28404. $$pre = ((($0)) + 4|0);
  28405. $$045 = 0;$$pre$phiZ2D = $$pre;
  28406. } else {
  28407. $8 = (_pthread_self()|0);
  28408. $9 = ((($0)) + 4|0);
  28409. $10 = (Atomics_load(HEAP32,$9>>2)|0);
  28410. $11 = $10 & 2147483647;
  28411. $12 = ((($8)) + 52|0);
  28412. $13 = HEAP32[$12>>2]|0;
  28413. $14 = ($11|0)==($13|0);
  28414. if (!($14)) {
  28415. $$0 = 1;
  28416. return ($$0|0);
  28417. }
  28418. $15 = $3 & 3;
  28419. $16 = ($15|0)==(1);
  28420. if ($16) {
  28421. $17 = ((($0)) + 20|0);
  28422. $18 = HEAP32[$17>>2]|0;
  28423. $19 = ($18|0)==(0);
  28424. if (!($19)) {
  28425. $20 = (($18) + -1)|0;
  28426. HEAP32[$17>>2] = $20;
  28427. $$0 = 0;
  28428. return ($$0|0);
  28429. }
  28430. }
  28431. $21 = ($6|0)==(0);
  28432. $22 = ((($0)) + 16|0);
  28433. if ($21) {
  28434. $23 = ((($8)) + 176|0);
  28435. Atomics_store(HEAP32,$23>>2,$22)|0;
  28436. ___vm_lock();
  28437. }
  28438. $24 = ((($0)) + 12|0);
  28439. $25 = HEAP32[$24>>2]|0;
  28440. $26 = HEAP32[$22>>2]|0;
  28441. Atomics_store(HEAP32,$25>>2,$26)|0;
  28442. $27 = ((($8)) + 168|0);
  28443. $28 = ($26|0)==($27|0);
  28444. if ($28) {
  28445. $$045 = $8;$$pre$phiZ2D = $9;
  28446. } else {
  28447. $29 = ((($26)) + -4|0);
  28448. Atomics_store(HEAP32,$29>>2,$25)|0;
  28449. $$045 = $8;$$pre$phiZ2D = $9;
  28450. }
  28451. }
  28452. $30 = $3 & 8;
  28453. $31 = ($30|0)!=(0);
  28454. $32 = $31 ? 2147483647 : 0;
  28455. while(1) {
  28456. $33 = (Atomics_load(HEAP32, $$pre$phiZ2D>>2)|0);
  28457. $34 = (Atomics_compareExchange(HEAP32, $$pre$phiZ2D>>2, $33, $32)|0);
  28458. $35 = ($34|0)==($33|0);
  28459. if ($35) {
  28460. break;
  28461. }
  28462. }
  28463. $36 = ($6|0)!=(0);
  28464. $or$cond = $7 | $36;
  28465. if (!($or$cond)) {
  28466. $37 = ((($$045)) + 176|0);
  28467. Atomics_store(HEAP32,$37>>2,0)|0;
  28468. ___vm_unlock();
  28469. }
  28470. $38 = ($2|0)!=(0);
  28471. $39 = ($33|0)<(0);
  28472. $or$cond3 = $38 | $39;
  28473. if (!($or$cond3)) {
  28474. $$0 = 0;
  28475. return ($$0|0);
  28476. }
  28477. (_emscripten_futex_wake(($$pre$phiZ2D|0),1)|0);
  28478. $$0 = 0;
  28479. return ($$0|0);
  28480. }
  28481. function ___vm_lock() {
  28482. var $0 = 0, label = 0, sp = 0;
  28483. sp = STACKTOP;
  28484. $0 = (Atomics_add(HEAP32, 8594, 1)|0);
  28485. return;
  28486. }
  28487. function ___vm_unlock() {
  28488. var $0 = 0, $1 = 0, $2 = 0, $3 = 0, label = 0, sp = 0;
  28489. sp = STACKTOP;
  28490. $0 = (Atomics_add(HEAP32, 8594, -1)|0);
  28491. $1 = ($0|0)==(1);
  28492. if (!($1)) {
  28493. return;
  28494. }
  28495. $2 = (Atomics_load(HEAP32,(34380)>>2)|0);
  28496. $3 = ($2|0)==(0);
  28497. if ($3) {
  28498. return;
  28499. }
  28500. (_emscripten_futex_wake((34376|0),2147483647)|0);
  28501. return;
  28502. }
  28503. function ___pthread_mutex_lock($0) {
  28504. $0 = $0|0;
  28505. var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0;
  28506. sp = STACKTOP;
  28507. $1 = HEAP32[$0>>2]|0;
  28508. $2 = $1 & 15;
  28509. $3 = ($2|0)==(0);
  28510. if ($3) {
  28511. $4 = ((($0)) + 4|0);
  28512. $5 = (Atomics_compareExchange(HEAP32, $4>>2, 0, 16)|0);
  28513. $6 = ($5|0)==(0);
  28514. if ($6) {
  28515. $$0 = 0;
  28516. return ($$0|0);
  28517. }
  28518. }
  28519. $7 = (___pthread_mutex_timedlock($0,0)|0);
  28520. $$0 = $7;
  28521. return ($$0|0);
  28522. }
  28523. function ___pthread_mutex_timedlock($0,$1) {
  28524. $0 = $0|0;
  28525. $1 = $1|0;
  28526. var $$0 = 0, $$2 = 0, $$pre = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0;
  28527. var $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0;
  28528. var $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $or$cond40 = 0, label = 0, sp = 0;
  28529. sp = STACKTOP;
  28530. $2 = HEAP32[$0>>2]|0;
  28531. $3 = $2 & 15;
  28532. $4 = ($3|0)==(0);
  28533. do {
  28534. if ($4) {
  28535. $5 = ((($0)) + 4|0);
  28536. $6 = (Atomics_compareExchange(HEAP32, $5>>2, 0, 16)|0);
  28537. $7 = ($6|0)==(0);
  28538. if ($7) {
  28539. $$2 = 0;
  28540. return ($$2|0);
  28541. } else {
  28542. $$pre = HEAP32[$0>>2]|0;
  28543. $9 = $$pre;
  28544. break;
  28545. }
  28546. } else {
  28547. $9 = $2;
  28548. }
  28549. } while(0);
  28550. $8 = $9 & 128;
  28551. $10 = $8 ^ 128;
  28552. $11 = (___pthread_mutex_trylock($0)|0);
  28553. $12 = ($11|0)==(16);
  28554. if (!($12)) {
  28555. $$2 = $11;
  28556. return ($$2|0);
  28557. }
  28558. $13 = ((($0)) + 4|0);
  28559. $14 = ((($0)) + 8|0);
  28560. $$0 = 100;
  28561. while(1) {
  28562. $15 = (($$0) + -1)|0;
  28563. $16 = ($$0|0)==(0);
  28564. if ($16) {
  28565. break;
  28566. }
  28567. $17 = (Atomics_load(HEAP32,$13>>2)|0);
  28568. $18 = ($17|0)==(0);
  28569. if ($18) {
  28570. break;
  28571. }
  28572. $19 = (Atomics_load(HEAP32,$14>>2)|0);
  28573. $20 = ($19|0)==(0);
  28574. if ($20) {
  28575. $$0 = $15;
  28576. } else {
  28577. break;
  28578. }
  28579. }
  28580. $21 = (___pthread_mutex_trylock($0)|0);
  28581. $22 = ($21|0)==(16);
  28582. if (!($22)) {
  28583. $$2 = $21;
  28584. return ($$2|0);
  28585. }
  28586. L18: while(1) {
  28587. $23 = (Atomics_load(HEAP32,$13>>2)|0);
  28588. $24 = ($23|0)==(0);
  28589. if (!($24)) {
  28590. $27 = $23 & 1073741824;
  28591. $28 = ($27|0)==(0);
  28592. $29 = HEAP32[$0>>2]|0;
  28593. $30 = $29 & 4;
  28594. $31 = ($30|0)==(0);
  28595. $or$cond40 = $28 | $31;
  28596. if ($or$cond40) {
  28597. $32 = $29 & 3;
  28598. $33 = ($32|0)==(2);
  28599. if ($33) {
  28600. $34 = $23 & 2147483647;
  28601. $35 = (_pthread_self()|0);
  28602. $36 = ((($35)) + 52|0);
  28603. $37 = HEAP32[$36>>2]|0;
  28604. $38 = ($34|0)==($37|0);
  28605. if ($38) {
  28606. $$2 = 35;
  28607. label = 17;
  28608. break;
  28609. }
  28610. }
  28611. $39 = (Atomics_add(HEAP32, $14>>2, 1)|0);
  28612. $40 = $23 | -2147483648;
  28613. $41 = (Atomics_compareExchange(HEAP32, $13>>2, $23, $40)|0);
  28614. $42 = (___timedwait($13,$40,0,$1,$10)|0);
  28615. $43 = (Atomics_sub(HEAP32, $14>>2, 1)|0);
  28616. switch ($42|0) {
  28617. case 0: case 4: {
  28618. break;
  28619. }
  28620. default: {
  28621. $$2 = $42;
  28622. label = 17;
  28623. break L18;
  28624. }
  28625. }
  28626. }
  28627. }
  28628. $25 = (___pthread_mutex_trylock($0)|0);
  28629. $26 = ($25|0)==(16);
  28630. if (!($26)) {
  28631. $$2 = $25;
  28632. label = 17;
  28633. break;
  28634. }
  28635. }
  28636. if ((label|0) == 17) {
  28637. return ($$2|0);
  28638. }
  28639. return (0)|0;
  28640. }
  28641. function ___timedwait($0,$1,$2,$3,$4) {
  28642. $0 = $0|0;
  28643. $1 = $1|0;
  28644. $2 = $2|0;
  28645. $3 = $3|0;
  28646. $4 = $4|0;
  28647. var $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0;
  28648. sp = STACKTOP;
  28649. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  28650. $5 = sp;
  28651. (___pthread_setcancelstate(1,($5|0))|0);
  28652. _emscripten_conditional_set_current_thread_status(1,4);
  28653. $6 = (___timedwait_cp($0,$1,$2,$3,$4)|0);
  28654. _emscripten_conditional_set_current_thread_status(4,1);
  28655. $7 = HEAP32[$5>>2]|0;
  28656. (___pthread_setcancelstate(($7|0),(0|0))|0);
  28657. STACKTOP = sp;return ($6|0);
  28658. }
  28659. function ___timedwait_cp($0,$1,$2,$3,$4) {
  28660. $0 = $0|0;
  28661. $1 = $1|0;
  28662. $2 = $2|0;
  28663. $3 = $3|0;
  28664. $4 = $4|0;
  28665. var $$$0$us = 0.0, $$$045 = 0.0, $$$046$us = 0.0, $$0$us = 0.0, $$0$us53 = 0.0, $$138 = 0, $$138$ph = 0, $$138$ph70 = 0, $$138$ph72 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0;
  28666. var $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0.0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0.0, $39 = 0, $40 = 0;
  28667. var $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  28668. sp = STACKTOP;
  28669. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  28670. $5 = sp;
  28671. $6 = ($3|0)!=(0|0);
  28672. if ($6) {
  28673. $7 = ((($3)) + 4|0);
  28674. $8 = HEAP32[$7>>2]|0;
  28675. $9 = ($8>>>0)>(999999999);
  28676. if ($9) {
  28677. $$138 = 22;
  28678. STACKTOP = sp;return ($$138|0);
  28679. }
  28680. $10 = (___clock_gettime(($2|0),($5|0))|0);
  28681. $11 = ($10|0)==(0);
  28682. if (!($11)) {
  28683. $$138 = 22;
  28684. STACKTOP = sp;return ($$138|0);
  28685. }
  28686. $12 = HEAP32[$3>>2]|0;
  28687. $13 = HEAP32[$5>>2]|0;
  28688. $14 = (($12) - ($13))|0;
  28689. HEAP32[$5>>2] = $14;
  28690. $15 = HEAP32[$7>>2]|0;
  28691. $16 = ((($5)) + 4|0);
  28692. $17 = HEAP32[$16>>2]|0;
  28693. $18 = (($15) - ($17))|0;
  28694. HEAP32[$16>>2] = $18;
  28695. $19 = ($18|0)<(0);
  28696. if ($19) {
  28697. $20 = (($14) + -1)|0;
  28698. HEAP32[$5>>2] = $20;
  28699. $21 = (($18) + 1000000000)|0;
  28700. HEAP32[$16>>2] = $21;
  28701. $23 = $20;
  28702. } else {
  28703. $23 = $14;
  28704. }
  28705. $22 = ($23|0)<(0);
  28706. if ($22) {
  28707. $$138 = 110;
  28708. STACKTOP = sp;return ($$138|0);
  28709. }
  28710. }
  28711. $24 = (_emscripten_is_main_runtime_thread()|0);
  28712. $25 = ($24|0)!=(0);
  28713. $$$045 = $25 ? 1.0 : 100.0;
  28714. if ($25) {
  28715. L15: while(1) {
  28716. $26 = (_pthread_self()|0);
  28717. $27 = (__pthread_isduecanceled($26)|0);
  28718. $28 = ($27|0)==(0);
  28719. if (!($28)) {
  28720. $$138$ph = 125;
  28721. break;
  28722. }
  28723. _emscripten_main_thread_process_queued_calls();
  28724. if ($6) {
  28725. $29 = (+__pthread_msecs_until($3));
  28726. $30 = !($29 <= 0.0);
  28727. $31 = $29 > 100.0;
  28728. $$0$us = $31 ? 100.0 : $29;
  28729. $32 = $$0$us > 1.0;
  28730. $$$0$us = $32 ? 1.0 : $$0$us;
  28731. if ($30) {
  28732. $$$046$us = $$$0$us;
  28733. } else {
  28734. $$138$ph = 110;
  28735. break;
  28736. }
  28737. } else {
  28738. $$$046$us = $$$045;
  28739. }
  28740. $33 = (_emscripten_futex_wait(($0|0),($1|0),(+$$$046$us))|0);
  28741. $34 = (0 - ($33))|0;
  28742. switch ($34|0) {
  28743. case 110: {
  28744. break;
  28745. }
  28746. case 4: case 125: {
  28747. $$138$ph = $34;
  28748. break L15;
  28749. break;
  28750. }
  28751. default: {
  28752. $$138 = 0;
  28753. label = 21;
  28754. break L15;
  28755. }
  28756. }
  28757. }
  28758. if ((label|0) == 21) {
  28759. STACKTOP = sp;return ($$138|0);
  28760. }
  28761. $$138 = $$138$ph;
  28762. STACKTOP = sp;return ($$138|0);
  28763. }
  28764. if (!($6)) {
  28765. L27: while(1) {
  28766. $43 = (_pthread_self()|0);
  28767. $44 = (__pthread_isduecanceled($43)|0);
  28768. $45 = ($44|0)==(0);
  28769. if (!($45)) {
  28770. $$138$ph72 = 125;
  28771. break;
  28772. }
  28773. $46 = (_emscripten_futex_wait(($0|0),($1|0),(+$$$045))|0);
  28774. $47 = (0 - ($46))|0;
  28775. switch ($47|0) {
  28776. case 110: {
  28777. break;
  28778. }
  28779. case 4: case 125: {
  28780. $$138$ph72 = $47;
  28781. break L27;
  28782. break;
  28783. }
  28784. default: {
  28785. $$138 = 0;
  28786. label = 21;
  28787. break L27;
  28788. }
  28789. }
  28790. }
  28791. if ((label|0) == 21) {
  28792. STACKTOP = sp;return ($$138|0);
  28793. }
  28794. $$138 = $$138$ph72;
  28795. STACKTOP = sp;return ($$138|0);
  28796. }
  28797. L34: while(1) {
  28798. $35 = (_pthread_self()|0);
  28799. $36 = (__pthread_isduecanceled($35)|0);
  28800. $37 = ($36|0)==(0);
  28801. if (!($37)) {
  28802. $$138$ph70 = 125;
  28803. break;
  28804. }
  28805. $38 = (+__pthread_msecs_until($3));
  28806. $39 = !($38 <= 0.0);
  28807. if (!($39)) {
  28808. $$138$ph70 = 110;
  28809. break;
  28810. }
  28811. $40 = $38 > 100.0;
  28812. $$0$us53 = $40 ? 100.0 : $38;
  28813. $41 = (_emscripten_futex_wait(($0|0),($1|0),(+$$0$us53))|0);
  28814. $42 = (0 - ($41))|0;
  28815. switch ($42|0) {
  28816. case 110: {
  28817. break;
  28818. }
  28819. case 4: case 125: {
  28820. $$138$ph70 = $42;
  28821. break L34;
  28822. break;
  28823. }
  28824. default: {
  28825. $$138 = 0;
  28826. label = 21;
  28827. break L34;
  28828. }
  28829. }
  28830. }
  28831. if ((label|0) == 21) {
  28832. STACKTOP = sp;return ($$138|0);
  28833. }
  28834. $$138 = $$138$ph70;
  28835. STACKTOP = sp;return ($$138|0);
  28836. }
  28837. function __pthread_isduecanceled($0) {
  28838. $0 = $0|0;
  28839. var $1 = 0, $2 = 0, $3 = 0, label = 0, sp = 0;
  28840. sp = STACKTOP;
  28841. $1 = HEAP32[$0>>2]|0;
  28842. $2 = ($1|0)==(2);
  28843. $3 = $2&1;
  28844. return ($3|0);
  28845. }
  28846. function __pthread_msecs_until($0) {
  28847. $0 = $0|0;
  28848. var $1 = 0, $10 = 0, $11 = 0.0, $12 = 0.0, $13 = 0, $14 = 0, $15 = 0.0, $16 = 0.0, $17 = 0.0, $18 = 0.0, $2 = 0, $3 = 0.0, $4 = 0.0, $5 = 0, $6 = 0, $7 = 0.0, $8 = 0.0, $9 = 0.0, label = 0, sp = 0;
  28849. sp = STACKTOP;
  28850. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  28851. $1 = sp;
  28852. (_gettimeofday(($1|0),(0|0))|0);
  28853. $2 = HEAP32[$1>>2]|0;
  28854. $3 = (+($2|0));
  28855. $4 = $3 * 1000.0;
  28856. $5 = ((($1)) + 4|0);
  28857. $6 = HEAP32[$5>>2]|0;
  28858. $7 = (+($6|0));
  28859. $8 = $7 * 0.001;
  28860. $9 = $4 + $8;
  28861. $10 = HEAP32[$0>>2]|0;
  28862. $11 = (+($10|0));
  28863. $12 = $11 * 1000.0;
  28864. $13 = ((($0)) + 4|0);
  28865. $14 = HEAP32[$13>>2]|0;
  28866. $15 = (+($14|0));
  28867. $16 = $15 * 9.9999999999999995E-7;
  28868. $17 = $12 + $16;
  28869. $18 = $17 - $9;
  28870. STACKTOP = sp;return (+$18);
  28871. }
  28872. function ___pthread_mutex_trylock($0) {
  28873. $0 = $0|0;
  28874. var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0;
  28875. sp = STACKTOP;
  28876. $1 = HEAP32[$0>>2]|0;
  28877. $2 = $1 & 15;
  28878. $3 = ($2|0)==(0);
  28879. if ($3) {
  28880. $4 = ((($0)) + 4|0);
  28881. $5 = (Atomics_compareExchange(HEAP32, $4>>2, 0, 16)|0);
  28882. $6 = $5 & 16;
  28883. $$0 = $6;
  28884. return ($$0|0);
  28885. } else {
  28886. $7 = (___pthread_mutex_trylock_owner($0)|0);
  28887. $$0 = $7;
  28888. return ($$0|0);
  28889. }
  28890. return (0)|0;
  28891. }
  28892. function ___pthread_mutex_trylock_owner($0) {
  28893. $0 = $0|0;
  28894. var $$ = 0, $$1 = 0, $$154 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0;
  28895. var $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0;
  28896. var $43 = 0, $44 = 0, $45 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, $or$cond57 = 0, label = 0, sp = 0;
  28897. sp = STACKTOP;
  28898. $1 = HEAP32[$0>>2]|0;
  28899. $2 = (_pthread_self()|0);
  28900. $3 = ((($2)) + 52|0);
  28901. $4 = HEAP32[$3>>2]|0;
  28902. $5 = ((($0)) + 4|0);
  28903. $6 = (Atomics_load(HEAP32,$5>>2)|0);
  28904. $7 = $6 & 2147483647;
  28905. $8 = ($7|0)==($4|0);
  28906. $9 = $1 & 3;
  28907. $10 = ($9|0)==(1);
  28908. $or$cond = $10 & $8;
  28909. if ($or$cond) {
  28910. $11 = ((($0)) + 20|0);
  28911. $12 = HEAP32[$11>>2]|0;
  28912. $13 = ($12>>>0)>(2147483646);
  28913. if ($13) {
  28914. $$1 = 11;
  28915. return ($$1|0);
  28916. }
  28917. $14 = (($12) + 1)|0;
  28918. HEAP32[$11>>2] = $14;
  28919. $$1 = 0;
  28920. return ($$1|0);
  28921. }
  28922. $15 = ($7|0)==(2147483647);
  28923. if ($15) {
  28924. $$1 = 131;
  28925. return ($$1|0);
  28926. }
  28927. $16 = HEAP32[$0>>2]|0;
  28928. $17 = $16 & 128;
  28929. $18 = ($17|0)==(0);
  28930. if ($18) {
  28931. $$154 = $4;
  28932. } else {
  28933. $19 = ((($2)) + 172|0);
  28934. $20 = HEAP32[$19>>2]|0;
  28935. $21 = ($20|0)==(0);
  28936. if ($21) {
  28937. HEAP32[$19>>2] = -12;
  28938. }
  28939. $22 = ((($0)) + 8|0);
  28940. $23 = (Atomics_load(HEAP32,$22>>2)|0);
  28941. $24 = ($23|0)==(0);
  28942. $25 = $4 | -2147483648;
  28943. $$ = $24 ? $4 : $25;
  28944. $26 = ((($0)) + 16|0);
  28945. $27 = ((($2)) + 176|0);
  28946. Atomics_store(HEAP32,$27>>2,$26)|0;
  28947. $$154 = $$;
  28948. }
  28949. $28 = ($7|0)!=(0);
  28950. if ($28) {
  28951. $29 = $6 & 1073741824;
  28952. $30 = ($29|0)==(0);
  28953. $31 = $1 & 4;
  28954. $32 = ($31|0)==(0);
  28955. $or$cond57 = $32 | $30;
  28956. if (!($or$cond57)) {
  28957. label = 11;
  28958. }
  28959. } else {
  28960. label = 11;
  28961. }
  28962. if ((label|0) == 11) {
  28963. $33 = (Atomics_compareExchange(HEAP32, $5>>2, $6, $$154)|0);
  28964. $34 = ($33|0)==($6|0);
  28965. if ($34) {
  28966. $36 = ((($2)) + 168|0);
  28967. $37 = (Atomics_load(HEAP32,$36>>2)|0);
  28968. $38 = ((($0)) + 16|0);
  28969. HEAP32[$38>>2] = $37;
  28970. $39 = ((($0)) + 12|0);
  28971. HEAP32[$39>>2] = $36;
  28972. $40 = ($37|0)==($36|0);
  28973. if (!($40)) {
  28974. $41 = ((($37)) + -4|0);
  28975. Atomics_store(HEAP32,$41>>2,$38)|0;
  28976. }
  28977. Atomics_store(HEAP32,$36>>2,$38)|0;
  28978. $42 = ((($2)) + 176|0);
  28979. Atomics_store(HEAP32,$42>>2,0)|0;
  28980. if (!($28)) {
  28981. $$1 = 0;
  28982. return ($$1|0);
  28983. }
  28984. $43 = ((($0)) + 20|0);
  28985. HEAP32[$43>>2] = 0;
  28986. $44 = HEAP32[$0>>2]|0;
  28987. $45 = $44 | 8;
  28988. HEAP32[$0>>2] = $45;
  28989. $$1 = 130;
  28990. return ($$1|0);
  28991. }
  28992. }
  28993. $35 = ((($2)) + 176|0);
  28994. Atomics_store(HEAP32,$35>>2,0)|0;
  28995. $$1 = 16;
  28996. return ($$1|0);
  28997. }
  28998. function _pthread_mutexattr_destroy($0) {
  28999. $0 = $0|0;
  29000. var label = 0, sp = 0;
  29001. sp = STACKTOP;
  29002. return 0;
  29003. }
  29004. function _pthread_mutexattr_init($0) {
  29005. $0 = $0|0;
  29006. var label = 0, sp = 0;
  29007. sp = STACKTOP;
  29008. HEAP32[$0>>2] = 0;
  29009. return 0;
  29010. }
  29011. function _pthread_mutex_init($0,$1) {
  29012. $0 = $0|0;
  29013. $1 = $1|0;
  29014. var $$sroa$0 = 0, $2 = 0, $3 = 0, label = 0, sp = 0;
  29015. sp = STACKTOP;
  29016. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  29017. $$sroa$0 = sp;
  29018. ;HEAP32[$$sroa$0>>2]=0|0;HEAP32[$$sroa$0+4>>2]=0|0;HEAP32[$$sroa$0+8>>2]=0|0;HEAP32[$$sroa$0+12>>2]=0|0;HEAP32[$$sroa$0+16>>2]=0|0;HEAP32[$$sroa$0+20>>2]=0|0;HEAP32[$$sroa$0+24>>2]=0|0;
  29019. ;HEAP32[$0>>2]=HEAP32[$$sroa$0>>2]|0;HEAP32[$0+4>>2]=HEAP32[$$sroa$0+4>>2]|0;HEAP32[$0+8>>2]=HEAP32[$$sroa$0+8>>2]|0;HEAP32[$0+12>>2]=HEAP32[$$sroa$0+12>>2]|0;HEAP32[$0+16>>2]=HEAP32[$$sroa$0+16>>2]|0;HEAP32[$0+20>>2]=HEAP32[$$sroa$0+20>>2]|0;HEAP32[$0+24>>2]=HEAP32[$$sroa$0+24>>2]|0;
  29020. $2 = ($1|0)==(0|0);
  29021. if ($2) {
  29022. STACKTOP = sp;return 0;
  29023. }
  29024. $3 = HEAP32[$1>>2]|0;
  29025. HEAP32[$0>>2] = $3;
  29026. STACKTOP = sp;return 0;
  29027. }
  29028. function _malloc($0) {
  29029. $0 = $0|0;
  29030. var $$$0192$i = 0, $$$0193$i = 0, $$$4230$i = 0, $$$4236$i = 0, $$$4351$i = 0, $$$i = 0, $$0$i$i = 0, $$0$i$i$i = 0, $$0$i17$i = 0, $$01$i$i = 0, $$0189$i = 0, $$0192$lcssa$i = 0, $$01928$i = 0, $$0193$lcssa$i = 0, $$01937$i = 0, $$0198 = 0, $$0200 = 0, $$0206$i$i = 0, $$0207$i$i = 0, $$0211$i$i = 0;
  29031. var $$0212$i$i = 0, $$024363$i = 0, $$0287$i$i = 0, $$0288$i$i = 0, $$0289$i$i = 0, $$0295$i$i = 0, $$0296$i$i = 0, $$0342$i = 0, $$0344$i = 0, $$0345$i = 0, $$0347$i = 0, $$0353$i = 0, $$0358$i = 0, $$0359$$i = 0, $$0359$i = 0, $$0361$i = 0, $$0362$i = 0, $$0368$i = 0, $$1 = 0, $$1196$i = 0;
  29032. var $$1198$i = 0, $$124462$i = 0, $$1291$i$i = 0, $$1293$i$i = 0, $$1343$i = 0, $$1348$i = 0, $$1363$i = 0, $$1370$i = 0, $$1374$i = 0, $$2 = 0, $$2234253237$i = 0, $$2247$ph$i = 0, $$2253$ph$i = 0, $$2355$i = 0, $$3$i = 0, $$3$i$i = 0, $$3$i202 = 0, $$3229$i = 0, $$3235$i = 0, $$3350$i = 0;
  29033. var $$3372$i = 0, $$4$lcssa$i = 0, $$4$ph$i = 0, $$415$i = 0, $$4230$i = 0, $$4236$i = 0, $$4351$lcssa$i = 0, $$435114$i = 0, $$4357$$4$i = 0, $$4357$ph$i = 0, $$435713$i = 0, $$7$i = 0, $$7239$i = 0, $$pre = 0, $$pre$i = 0, $$pre$i$i = 0, $$pre$i18$i = 0, $$pre$i211 = 0, $$pre$phi$i$iZ2D = 0, $$pre$phi$i19$iZ2D = 0;
  29034. var $$pre$phi$i212Z2D = 0, $$pre$phi$iZ2D = 0, $$pre$phi11$i$iZ2D = 0, $$pre$phiZ2D = 0, $$pre10$i$i = 0, $$sink1$i = 0, $$sink1$i$i = 0, $$sink16$i = 0, $$sink2$i = 0, $$sink2$i205 = 0, $$sink3$i = 0, $1 = 0, $10 = 0, $100 = 0, $1000 = 0, $1001 = 0, $1002 = 0, $1003 = 0, $1004 = 0, $1005 = 0;
  29035. var $1006 = 0, $1007 = 0, $1008 = 0, $1009 = 0, $101 = 0, $1010 = 0, $1011 = 0, $1012 = 0, $1013 = 0, $1014 = 0, $1015 = 0, $1016 = 0, $1017 = 0, $1018 = 0, $1019 = 0, $102 = 0, $1020 = 0, $1021 = 0, $1022 = 0, $1023 = 0;
  29036. var $1024 = 0, $1025 = 0, $1026 = 0, $1027 = 0, $1028 = 0, $1029 = 0, $103 = 0, $1030 = 0, $1031 = 0, $1032 = 0, $1033 = 0, $1034 = 0, $1035 = 0, $1036 = 0, $1037 = 0, $1038 = 0, $1039 = 0, $104 = 0, $1040 = 0, $1041 = 0;
  29037. var $1042 = 0, $1043 = 0, $1044 = 0, $1045 = 0, $1046 = 0, $1047 = 0, $1048 = 0, $1049 = 0, $105 = 0, $1050 = 0, $1051 = 0, $1052 = 0, $1053 = 0, $1054 = 0, $1055 = 0, $1056 = 0, $1057 = 0, $1058 = 0, $1059 = 0, $106 = 0;
  29038. var $1060 = 0, $1061 = 0, $1062 = 0, $1063 = 0, $1064 = 0, $1065 = 0, $1066 = 0, $1067 = 0, $1068 = 0, $1069 = 0, $107 = 0, $1070 = 0, $1071 = 0, $1072 = 0, $1073 = 0, $1074 = 0, $1075 = 0, $1076 = 0, $1077 = 0, $1078 = 0;
  29039. var $1079 = 0, $108 = 0, $1080 = 0, $1081 = 0, $1082 = 0, $1083 = 0, $1084 = 0, $1085 = 0, $1086 = 0, $1087 = 0, $1088 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0, $116 = 0;
  29040. var $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $131 = 0, $132 = 0, $133 = 0, $134 = 0;
  29041. var $135 = 0, $136 = 0, $137 = 0, $138 = 0, $139 = 0, $14 = 0, $140 = 0, $141 = 0, $142 = 0, $143 = 0, $144 = 0, $145 = 0, $146 = 0, $147 = 0, $148 = 0, $149 = 0, $15 = 0, $150 = 0, $151 = 0, $152 = 0;
  29042. var $153 = 0, $154 = 0, $155 = 0, $156 = 0, $157 = 0, $158 = 0, $159 = 0, $16 = 0, $160 = 0, $161 = 0, $162 = 0, $163 = 0, $164 = 0, $165 = 0, $166 = 0, $167 = 0, $168 = 0, $169 = 0, $17 = 0, $170 = 0;
  29043. var $171 = 0, $172 = 0, $173 = 0, $174 = 0, $175 = 0, $176 = 0, $177 = 0, $178 = 0, $179 = 0, $18 = 0, $180 = 0, $181 = 0, $182 = 0, $183 = 0, $184 = 0, $185 = 0, $186 = 0, $187 = 0, $188 = 0, $189 = 0;
  29044. var $19 = 0, $190 = 0, $191 = 0, $192 = 0, $193 = 0, $194 = 0, $195 = 0, $196 = 0, $197 = 0, $198 = 0, $199 = 0, $2 = 0, $20 = 0, $200 = 0, $201 = 0, $202 = 0, $203 = 0, $204 = 0, $205 = 0, $206 = 0;
  29045. var $207 = 0, $208 = 0, $209 = 0, $21 = 0, $210 = 0, $211 = 0, $212 = 0, $213 = 0, $214 = 0, $215 = 0, $216 = 0, $217 = 0, $218 = 0, $219 = 0, $22 = 0, $220 = 0, $221 = 0, $222 = 0, $223 = 0, $224 = 0;
  29046. var $225 = 0, $226 = 0, $227 = 0, $228 = 0, $229 = 0, $23 = 0, $230 = 0, $231 = 0, $232 = 0, $233 = 0, $234 = 0, $235 = 0, $236 = 0, $237 = 0, $238 = 0, $239 = 0, $24 = 0, $240 = 0, $241 = 0, $242 = 0;
  29047. var $243 = 0, $244 = 0, $245 = 0, $246 = 0, $247 = 0, $248 = 0, $249 = 0, $25 = 0, $250 = 0, $251 = 0, $252 = 0, $253 = 0, $254 = 0, $255 = 0, $256 = 0, $257 = 0, $258 = 0, $259 = 0, $26 = 0, $260 = 0;
  29048. var $261 = 0, $262 = 0, $263 = 0, $264 = 0, $265 = 0, $266 = 0, $267 = 0, $268 = 0, $269 = 0, $27 = 0, $270 = 0, $271 = 0, $272 = 0, $273 = 0, $274 = 0, $275 = 0, $276 = 0, $277 = 0, $278 = 0, $279 = 0;
  29049. var $28 = 0, $280 = 0, $281 = 0, $282 = 0, $283 = 0, $284 = 0, $285 = 0, $286 = 0, $287 = 0, $288 = 0, $289 = 0, $29 = 0, $290 = 0, $291 = 0, $292 = 0, $293 = 0, $294 = 0, $295 = 0, $296 = 0, $297 = 0;
  29050. var $298 = 0, $299 = 0, $3 = 0, $30 = 0, $300 = 0, $301 = 0, $302 = 0, $303 = 0, $304 = 0, $305 = 0, $306 = 0, $307 = 0, $308 = 0, $309 = 0, $31 = 0, $310 = 0, $311 = 0, $312 = 0, $313 = 0, $314 = 0;
  29051. var $315 = 0, $316 = 0, $317 = 0, $318 = 0, $319 = 0, $32 = 0, $320 = 0, $321 = 0, $322 = 0, $323 = 0, $324 = 0, $325 = 0, $326 = 0, $327 = 0, $328 = 0, $329 = 0, $33 = 0, $330 = 0, $331 = 0, $332 = 0;
  29052. var $333 = 0, $334 = 0, $335 = 0, $336 = 0, $337 = 0, $338 = 0, $339 = 0, $34 = 0, $340 = 0, $341 = 0, $342 = 0, $343 = 0, $344 = 0, $345 = 0, $346 = 0, $347 = 0, $348 = 0, $349 = 0, $35 = 0, $350 = 0;
  29053. var $351 = 0, $352 = 0, $353 = 0, $354 = 0, $355 = 0, $356 = 0, $357 = 0, $358 = 0, $359 = 0, $36 = 0, $360 = 0, $361 = 0, $362 = 0, $363 = 0, $364 = 0, $365 = 0, $366 = 0, $367 = 0, $368 = 0, $369 = 0;
  29054. var $37 = 0, $370 = 0, $371 = 0, $372 = 0, $373 = 0, $374 = 0, $375 = 0, $376 = 0, $377 = 0, $378 = 0, $379 = 0, $38 = 0, $380 = 0, $381 = 0, $382 = 0, $383 = 0, $384 = 0, $385 = 0, $386 = 0, $387 = 0;
  29055. var $388 = 0, $389 = 0, $39 = 0, $390 = 0, $391 = 0, $392 = 0, $393 = 0, $394 = 0, $395 = 0, $396 = 0, $397 = 0, $398 = 0, $399 = 0, $4 = 0, $40 = 0, $400 = 0, $401 = 0, $402 = 0, $403 = 0, $404 = 0;
  29056. var $405 = 0, $406 = 0, $407 = 0, $408 = 0, $409 = 0, $41 = 0, $410 = 0, $411 = 0, $412 = 0, $413 = 0, $414 = 0, $415 = 0, $416 = 0, $417 = 0, $418 = 0, $419 = 0, $42 = 0, $420 = 0, $421 = 0, $422 = 0;
  29057. var $423 = 0, $424 = 0, $425 = 0, $426 = 0, $427 = 0, $428 = 0, $429 = 0, $43 = 0, $430 = 0, $431 = 0, $432 = 0, $433 = 0, $434 = 0, $435 = 0, $436 = 0, $437 = 0, $438 = 0, $439 = 0, $44 = 0, $440 = 0;
  29058. var $441 = 0, $442 = 0, $443 = 0, $444 = 0, $445 = 0, $446 = 0, $447 = 0, $448 = 0, $449 = 0, $45 = 0, $450 = 0, $451 = 0, $452 = 0, $453 = 0, $454 = 0, $455 = 0, $456 = 0, $457 = 0, $458 = 0, $459 = 0;
  29059. var $46 = 0, $460 = 0, $461 = 0, $462 = 0, $463 = 0, $464 = 0, $465 = 0, $466 = 0, $467 = 0, $468 = 0, $469 = 0, $47 = 0, $470 = 0, $471 = 0, $472 = 0, $473 = 0, $474 = 0, $475 = 0, $476 = 0, $477 = 0;
  29060. var $478 = 0, $479 = 0, $48 = 0, $480 = 0, $481 = 0, $482 = 0, $483 = 0, $484 = 0, $485 = 0, $486 = 0, $487 = 0, $488 = 0, $489 = 0, $49 = 0, $490 = 0, $491 = 0, $492 = 0, $493 = 0, $494 = 0, $495 = 0;
  29061. var $496 = 0, $497 = 0, $498 = 0, $499 = 0, $5 = 0, $50 = 0, $500 = 0, $501 = 0, $502 = 0, $503 = 0, $504 = 0, $505 = 0, $506 = 0, $507 = 0, $508 = 0, $509 = 0, $51 = 0, $510 = 0, $511 = 0, $512 = 0;
  29062. var $513 = 0, $514 = 0, $515 = 0, $516 = 0, $517 = 0, $518 = 0, $519 = 0, $52 = 0, $520 = 0, $521 = 0, $522 = 0, $523 = 0, $524 = 0, $525 = 0, $526 = 0, $527 = 0, $528 = 0, $529 = 0, $53 = 0, $530 = 0;
  29063. var $531 = 0, $532 = 0, $533 = 0, $534 = 0, $535 = 0, $536 = 0, $537 = 0, $538 = 0, $539 = 0, $54 = 0, $540 = 0, $541 = 0, $542 = 0, $543 = 0, $544 = 0, $545 = 0, $546 = 0, $547 = 0, $548 = 0, $549 = 0;
  29064. var $55 = 0, $550 = 0, $551 = 0, $552 = 0, $553 = 0, $554 = 0, $555 = 0, $556 = 0, $557 = 0, $558 = 0, $559 = 0, $56 = 0, $560 = 0, $561 = 0, $562 = 0, $563 = 0, $564 = 0, $565 = 0, $566 = 0, $567 = 0;
  29065. var $568 = 0, $569 = 0, $57 = 0, $570 = 0, $571 = 0, $572 = 0, $573 = 0, $574 = 0, $575 = 0, $576 = 0, $577 = 0, $578 = 0, $579 = 0, $58 = 0, $580 = 0, $581 = 0, $582 = 0, $583 = 0, $584 = 0, $585 = 0;
  29066. var $586 = 0, $587 = 0, $588 = 0, $589 = 0, $59 = 0, $590 = 0, $591 = 0, $592 = 0, $593 = 0, $594 = 0, $595 = 0, $596 = 0, $597 = 0, $598 = 0, $599 = 0, $6 = 0, $60 = 0, $600 = 0, $601 = 0, $602 = 0;
  29067. var $603 = 0, $604 = 0, $605 = 0, $606 = 0, $607 = 0, $608 = 0, $609 = 0, $61 = 0, $610 = 0, $611 = 0, $612 = 0, $613 = 0, $614 = 0, $615 = 0, $616 = 0, $617 = 0, $618 = 0, $619 = 0, $62 = 0, $620 = 0;
  29068. var $621 = 0, $622 = 0, $623 = 0, $624 = 0, $625 = 0, $626 = 0, $627 = 0, $628 = 0, $629 = 0, $63 = 0, $630 = 0, $631 = 0, $632 = 0, $633 = 0, $634 = 0, $635 = 0, $636 = 0, $637 = 0, $638 = 0, $639 = 0;
  29069. var $64 = 0, $640 = 0, $641 = 0, $642 = 0, $643 = 0, $644 = 0, $645 = 0, $646 = 0, $647 = 0, $648 = 0, $649 = 0, $65 = 0, $650 = 0, $651 = 0, $652 = 0, $653 = 0, $654 = 0, $655 = 0, $656 = 0, $657 = 0;
  29070. var $658 = 0, $659 = 0, $66 = 0, $660 = 0, $661 = 0, $662 = 0, $663 = 0, $664 = 0, $665 = 0, $666 = 0, $667 = 0, $668 = 0, $669 = 0, $67 = 0, $670 = 0, $671 = 0, $672 = 0, $673 = 0, $674 = 0, $675 = 0;
  29071. var $676 = 0, $677 = 0, $678 = 0, $679 = 0, $68 = 0, $680 = 0, $681 = 0, $682 = 0, $683 = 0, $684 = 0, $685 = 0, $686 = 0, $687 = 0, $688 = 0, $689 = 0, $69 = 0, $690 = 0, $691 = 0, $692 = 0, $693 = 0;
  29072. var $694 = 0, $695 = 0, $696 = 0, $697 = 0, $698 = 0, $699 = 0, $7 = 0, $70 = 0, $700 = 0, $701 = 0, $702 = 0, $703 = 0, $704 = 0, $705 = 0, $706 = 0, $707 = 0, $708 = 0, $709 = 0, $71 = 0, $710 = 0;
  29073. var $711 = 0, $712 = 0, $713 = 0, $714 = 0, $715 = 0, $716 = 0, $717 = 0, $718 = 0, $719 = 0, $72 = 0, $720 = 0, $721 = 0, $722 = 0, $723 = 0, $724 = 0, $725 = 0, $726 = 0, $727 = 0, $728 = 0, $729 = 0;
  29074. var $73 = 0, $730 = 0, $731 = 0, $732 = 0, $733 = 0, $734 = 0, $735 = 0, $736 = 0, $737 = 0, $738 = 0, $739 = 0, $74 = 0, $740 = 0, $741 = 0, $742 = 0, $743 = 0, $744 = 0, $745 = 0, $746 = 0, $747 = 0;
  29075. var $748 = 0, $749 = 0, $75 = 0, $750 = 0, $751 = 0, $752 = 0, $753 = 0, $754 = 0, $755 = 0, $756 = 0, $757 = 0, $758 = 0, $759 = 0, $76 = 0, $760 = 0, $761 = 0, $762 = 0, $763 = 0, $764 = 0, $765 = 0;
  29076. var $766 = 0, $767 = 0, $768 = 0, $769 = 0, $77 = 0, $770 = 0, $771 = 0, $772 = 0, $773 = 0, $774 = 0, $775 = 0, $776 = 0, $777 = 0, $778 = 0, $779 = 0, $78 = 0, $780 = 0, $781 = 0, $782 = 0, $783 = 0;
  29077. var $784 = 0, $785 = 0, $786 = 0, $787 = 0, $788 = 0, $789 = 0, $79 = 0, $790 = 0, $791 = 0, $792 = 0, $793 = 0, $794 = 0, $795 = 0, $796 = 0, $797 = 0, $798 = 0, $799 = 0, $8 = 0, $80 = 0, $800 = 0;
  29078. var $801 = 0, $802 = 0, $803 = 0, $804 = 0, $805 = 0, $806 = 0, $807 = 0, $808 = 0, $809 = 0, $81 = 0, $810 = 0, $811 = 0, $812 = 0, $813 = 0, $814 = 0, $815 = 0, $816 = 0, $817 = 0, $818 = 0, $819 = 0;
  29079. var $82 = 0, $820 = 0, $821 = 0, $822 = 0, $823 = 0, $824 = 0, $825 = 0, $826 = 0, $827 = 0, $828 = 0, $829 = 0, $83 = 0, $830 = 0, $831 = 0, $832 = 0, $833 = 0, $834 = 0, $835 = 0, $836 = 0, $837 = 0;
  29080. var $838 = 0, $839 = 0, $84 = 0, $840 = 0, $841 = 0, $842 = 0, $843 = 0, $844 = 0, $845 = 0, $846 = 0, $847 = 0, $848 = 0, $849 = 0, $85 = 0, $850 = 0, $851 = 0, $852 = 0, $853 = 0, $854 = 0, $855 = 0;
  29081. var $856 = 0, $857 = 0, $858 = 0, $859 = 0, $86 = 0, $860 = 0, $861 = 0, $862 = 0, $863 = 0, $864 = 0, $865 = 0, $866 = 0, $867 = 0, $868 = 0, $869 = 0, $87 = 0, $870 = 0, $871 = 0, $872 = 0, $873 = 0;
  29082. var $874 = 0, $875 = 0, $876 = 0, $877 = 0, $878 = 0, $879 = 0, $88 = 0, $880 = 0, $881 = 0, $882 = 0, $883 = 0, $884 = 0, $885 = 0, $886 = 0, $887 = 0, $888 = 0, $889 = 0, $89 = 0, $890 = 0, $891 = 0;
  29083. var $892 = 0, $893 = 0, $894 = 0, $895 = 0, $896 = 0, $897 = 0, $898 = 0, $899 = 0, $9 = 0, $90 = 0, $900 = 0, $901 = 0, $902 = 0, $903 = 0, $904 = 0, $905 = 0, $906 = 0, $907 = 0, $908 = 0, $909 = 0;
  29084. var $91 = 0, $910 = 0, $911 = 0, $912 = 0, $913 = 0, $914 = 0, $915 = 0, $916 = 0, $917 = 0, $918 = 0, $919 = 0, $92 = 0, $920 = 0, $921 = 0, $922 = 0, $923 = 0, $924 = 0, $925 = 0, $926 = 0, $927 = 0;
  29085. var $928 = 0, $929 = 0, $93 = 0, $930 = 0, $931 = 0, $932 = 0, $933 = 0, $934 = 0, $935 = 0, $936 = 0, $937 = 0, $938 = 0, $939 = 0, $94 = 0, $940 = 0, $941 = 0, $942 = 0, $943 = 0, $944 = 0, $945 = 0;
  29086. var $946 = 0, $947 = 0, $948 = 0, $949 = 0, $95 = 0, $950 = 0, $951 = 0, $952 = 0, $953 = 0, $954 = 0, $955 = 0, $956 = 0, $957 = 0, $958 = 0, $959 = 0, $96 = 0, $960 = 0, $961 = 0, $962 = 0, $963 = 0;
  29087. var $964 = 0, $965 = 0, $966 = 0, $967 = 0, $968 = 0, $969 = 0, $97 = 0, $970 = 0, $971 = 0, $972 = 0, $973 = 0, $974 = 0, $975 = 0, $976 = 0, $977 = 0, $978 = 0, $979 = 0, $98 = 0, $980 = 0, $981 = 0;
  29088. var $982 = 0, $983 = 0, $984 = 0, $985 = 0, $986 = 0, $987 = 0, $988 = 0, $989 = 0, $99 = 0, $990 = 0, $991 = 0, $992 = 0, $993 = 0, $994 = 0, $995 = 0, $996 = 0, $997 = 0, $998 = 0, $999 = 0, $cond$i = 0;
  29089. var $cond$i$i = 0, $cond$i209 = 0, $exitcond$i$i = 0, $not$$i = 0, $not$$i$i = 0, $not$$i21$i = 0, $not$$i210 = 0, $not$1$i = 0, $not$1$i204 = 0, $not$5$i = 0, $not$7$i$i = 0, $not$8$i = 0, $not$9$i = 0, $or$cond$i = 0, $or$cond$i213 = 0, $or$cond1$i = 0, $or$cond10$i = 0, $or$cond11$i = 0, $or$cond12$i = 0, $or$cond2$i = 0;
  29090. var $or$cond2$i214 = 0, $or$cond43$i = 0, $or$cond5$i = 0, $or$cond7$i = 0, $or$cond9$i = 0, label = 0, sp = 0;
  29091. sp = STACKTOP;
  29092. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  29093. $1 = sp + 4|0;
  29094. $2 = sp;
  29095. $3 = HEAP32[8852]|0;
  29096. $4 = ($3|0)==(0);
  29097. if ($4) {
  29098. (___pthread_mutex_lock(35432)|0);
  29099. $5 = HEAP32[8852]|0;
  29100. $6 = ($5|0)==(0);
  29101. if ($6) {
  29102. HEAP32[(35416)>>2] = 4096;
  29103. HEAP32[(35412)>>2] = 4096;
  29104. HEAP32[(35420)>>2] = -1;
  29105. HEAP32[(35424)>>2] = -1;
  29106. HEAP32[(35428)>>2] = 2;
  29107. HEAP32[(35904)>>2] = 2;
  29108. $7 = (_pthread_mutexattr_init($1)|0);
  29109. $8 = ($7|0)==(0);
  29110. if ($8) {
  29111. $9 = (_pthread_mutex_init((35908),$1)|0);
  29112. $10 = ($9|0)==(0);
  29113. if ($10) {
  29114. }
  29115. }
  29116. $11 = $2;
  29117. $12 = $11 & -16;
  29118. $13 = $12 ^ 1431655768;
  29119. HEAP32[$2>>2] = $13;
  29120. Atomics_store(HEAP32,8852,$13)|0;
  29121. }
  29122. (___pthread_mutex_unlock(35432)|0);
  29123. }
  29124. $14 = HEAP32[(35904)>>2]|0;
  29125. $15 = $14 & 2;
  29126. $16 = ($15|0)==(0);
  29127. if (!($16)) {
  29128. $17 = (___pthread_mutex_lock((35908))|0);
  29129. $18 = ($17|0)==(0);
  29130. if (!($18)) {
  29131. $$1 = 0;
  29132. STACKTOP = sp;return ($$1|0);
  29133. }
  29134. }
  29135. $19 = ($0>>>0)<(245);
  29136. do {
  29137. if ($19) {
  29138. $20 = ($0>>>0)<(11);
  29139. $21 = (($0) + 11)|0;
  29140. $22 = $21 & -8;
  29141. $23 = $20 ? 16 : $22;
  29142. $24 = $23 >>> 3;
  29143. $25 = HEAP32[8865]|0;
  29144. $26 = $25 >>> $24;
  29145. $27 = $26 & 3;
  29146. $28 = ($27|0)==(0);
  29147. if (!($28)) {
  29148. $29 = $26 & 1;
  29149. $30 = $29 ^ 1;
  29150. $31 = (($30) + ($24))|0;
  29151. $32 = $31 << 1;
  29152. $33 = (35500 + ($32<<2)|0);
  29153. $34 = ((($33)) + 8|0);
  29154. $35 = HEAP32[$34>>2]|0;
  29155. $36 = ((($35)) + 8|0);
  29156. $37 = HEAP32[$36>>2]|0;
  29157. $38 = ($33|0)==($37|0);
  29158. do {
  29159. if ($38) {
  29160. $39 = 1 << $31;
  29161. $40 = $39 ^ -1;
  29162. $41 = $25 & $40;
  29163. HEAP32[8865] = $41;
  29164. } else {
  29165. $42 = HEAP32[(35476)>>2]|0;
  29166. $43 = ($37>>>0)<($42>>>0);
  29167. if ($43) {
  29168. _abort();
  29169. // unreachable;
  29170. }
  29171. $44 = ((($37)) + 12|0);
  29172. $45 = HEAP32[$44>>2]|0;
  29173. $46 = ($45|0)==($35|0);
  29174. if ($46) {
  29175. HEAP32[$44>>2] = $33;
  29176. HEAP32[$34>>2] = $37;
  29177. break;
  29178. } else {
  29179. _abort();
  29180. // unreachable;
  29181. }
  29182. }
  29183. } while(0);
  29184. $47 = $31 << 3;
  29185. $48 = $47 | 3;
  29186. $49 = ((($35)) + 4|0);
  29187. HEAP32[$49>>2] = $48;
  29188. $50 = (($35) + ($47)|0);
  29189. $51 = ((($50)) + 4|0);
  29190. $52 = HEAP32[$51>>2]|0;
  29191. $53 = $52 | 1;
  29192. HEAP32[$51>>2] = $53;
  29193. $$2 = $36;
  29194. break;
  29195. }
  29196. $54 = HEAP32[(35468)>>2]|0;
  29197. $55 = ($23>>>0)>($54>>>0);
  29198. if ($55) {
  29199. $56 = ($26|0)==(0);
  29200. if (!($56)) {
  29201. $57 = $26 << $24;
  29202. $58 = 2 << $24;
  29203. $59 = (0 - ($58))|0;
  29204. $60 = $58 | $59;
  29205. $61 = $57 & $60;
  29206. $62 = (0 - ($61))|0;
  29207. $63 = $61 & $62;
  29208. $64 = (($63) + -1)|0;
  29209. $65 = $64 >>> 12;
  29210. $66 = $65 & 16;
  29211. $67 = $64 >>> $66;
  29212. $68 = $67 >>> 5;
  29213. $69 = $68 & 8;
  29214. $70 = $69 | $66;
  29215. $71 = $67 >>> $69;
  29216. $72 = $71 >>> 2;
  29217. $73 = $72 & 4;
  29218. $74 = $70 | $73;
  29219. $75 = $71 >>> $73;
  29220. $76 = $75 >>> 1;
  29221. $77 = $76 & 2;
  29222. $78 = $74 | $77;
  29223. $79 = $75 >>> $77;
  29224. $80 = $79 >>> 1;
  29225. $81 = $80 & 1;
  29226. $82 = $78 | $81;
  29227. $83 = $79 >>> $81;
  29228. $84 = (($82) + ($83))|0;
  29229. $85 = $84 << 1;
  29230. $86 = (35500 + ($85<<2)|0);
  29231. $87 = ((($86)) + 8|0);
  29232. $88 = HEAP32[$87>>2]|0;
  29233. $89 = ((($88)) + 8|0);
  29234. $90 = HEAP32[$89>>2]|0;
  29235. $91 = ($86|0)==($90|0);
  29236. do {
  29237. if ($91) {
  29238. $92 = 1 << $84;
  29239. $93 = $92 ^ -1;
  29240. $94 = $25 & $93;
  29241. HEAP32[8865] = $94;
  29242. $115 = $94;
  29243. } else {
  29244. $95 = HEAP32[(35476)>>2]|0;
  29245. $96 = ($90>>>0)<($95>>>0);
  29246. if ($96) {
  29247. _abort();
  29248. // unreachable;
  29249. }
  29250. $97 = ((($90)) + 12|0);
  29251. $98 = HEAP32[$97>>2]|0;
  29252. $99 = ($98|0)==($88|0);
  29253. if ($99) {
  29254. HEAP32[$97>>2] = $86;
  29255. HEAP32[$87>>2] = $90;
  29256. $115 = $25;
  29257. break;
  29258. } else {
  29259. _abort();
  29260. // unreachable;
  29261. }
  29262. }
  29263. } while(0);
  29264. $100 = $84 << 3;
  29265. $101 = (($100) - ($23))|0;
  29266. $102 = $23 | 3;
  29267. $103 = ((($88)) + 4|0);
  29268. HEAP32[$103>>2] = $102;
  29269. $104 = (($88) + ($23)|0);
  29270. $105 = $101 | 1;
  29271. $106 = ((($104)) + 4|0);
  29272. HEAP32[$106>>2] = $105;
  29273. $107 = (($104) + ($101)|0);
  29274. HEAP32[$107>>2] = $101;
  29275. $108 = ($54|0)==(0);
  29276. if (!($108)) {
  29277. $109 = HEAP32[(35480)>>2]|0;
  29278. $110 = $54 >>> 3;
  29279. $111 = $110 << 1;
  29280. $112 = (35500 + ($111<<2)|0);
  29281. $113 = 1 << $110;
  29282. $114 = $115 & $113;
  29283. $116 = ($114|0)==(0);
  29284. if ($116) {
  29285. $117 = $115 | $113;
  29286. HEAP32[8865] = $117;
  29287. $$pre = ((($112)) + 8|0);
  29288. $$0200 = $112;$$pre$phiZ2D = $$pre;
  29289. } else {
  29290. $118 = ((($112)) + 8|0);
  29291. $119 = HEAP32[$118>>2]|0;
  29292. $120 = HEAP32[(35476)>>2]|0;
  29293. $121 = ($119>>>0)<($120>>>0);
  29294. if ($121) {
  29295. _abort();
  29296. // unreachable;
  29297. } else {
  29298. $$0200 = $119;$$pre$phiZ2D = $118;
  29299. }
  29300. }
  29301. HEAP32[$$pre$phiZ2D>>2] = $109;
  29302. $122 = ((($$0200)) + 12|0);
  29303. HEAP32[$122>>2] = $109;
  29304. $123 = ((($109)) + 8|0);
  29305. HEAP32[$123>>2] = $$0200;
  29306. $124 = ((($109)) + 12|0);
  29307. HEAP32[$124>>2] = $112;
  29308. }
  29309. HEAP32[(35468)>>2] = $101;
  29310. HEAP32[(35480)>>2] = $104;
  29311. $$2 = $89;
  29312. break;
  29313. }
  29314. $125 = HEAP32[(35464)>>2]|0;
  29315. $126 = ($125|0)==(0);
  29316. if ($126) {
  29317. $$0198 = $23;
  29318. label = 153;
  29319. } else {
  29320. $127 = (0 - ($125))|0;
  29321. $128 = $125 & $127;
  29322. $129 = (($128) + -1)|0;
  29323. $130 = $129 >>> 12;
  29324. $131 = $130 & 16;
  29325. $132 = $129 >>> $131;
  29326. $133 = $132 >>> 5;
  29327. $134 = $133 & 8;
  29328. $135 = $134 | $131;
  29329. $136 = $132 >>> $134;
  29330. $137 = $136 >>> 2;
  29331. $138 = $137 & 4;
  29332. $139 = $135 | $138;
  29333. $140 = $136 >>> $138;
  29334. $141 = $140 >>> 1;
  29335. $142 = $141 & 2;
  29336. $143 = $139 | $142;
  29337. $144 = $140 >>> $142;
  29338. $145 = $144 >>> 1;
  29339. $146 = $145 & 1;
  29340. $147 = $143 | $146;
  29341. $148 = $144 >>> $146;
  29342. $149 = (($147) + ($148))|0;
  29343. $150 = (35764 + ($149<<2)|0);
  29344. $151 = HEAP32[$150>>2]|0;
  29345. $152 = ((($151)) + 4|0);
  29346. $153 = HEAP32[$152>>2]|0;
  29347. $154 = $153 & -8;
  29348. $155 = (($154) - ($23))|0;
  29349. $156 = ((($151)) + 16|0);
  29350. $157 = HEAP32[$156>>2]|0;
  29351. $not$5$i = ($157|0)==(0|0);
  29352. $$sink16$i = $not$5$i&1;
  29353. $158 = (((($151)) + 16|0) + ($$sink16$i<<2)|0);
  29354. $159 = HEAP32[$158>>2]|0;
  29355. $160 = ($159|0)==(0|0);
  29356. if ($160) {
  29357. $$0192$lcssa$i = $151;$$0193$lcssa$i = $155;
  29358. } else {
  29359. $$01928$i = $151;$$01937$i = $155;$162 = $159;
  29360. while(1) {
  29361. $161 = ((($162)) + 4|0);
  29362. $163 = HEAP32[$161>>2]|0;
  29363. $164 = $163 & -8;
  29364. $165 = (($164) - ($23))|0;
  29365. $166 = ($165>>>0)<($$01937$i>>>0);
  29366. $$$0193$i = $166 ? $165 : $$01937$i;
  29367. $$$0192$i = $166 ? $162 : $$01928$i;
  29368. $167 = ((($162)) + 16|0);
  29369. $168 = HEAP32[$167>>2]|0;
  29370. $not$$i = ($168|0)==(0|0);
  29371. $$sink1$i = $not$$i&1;
  29372. $169 = (((($162)) + 16|0) + ($$sink1$i<<2)|0);
  29373. $170 = HEAP32[$169>>2]|0;
  29374. $171 = ($170|0)==(0|0);
  29375. if ($171) {
  29376. $$0192$lcssa$i = $$$0192$i;$$0193$lcssa$i = $$$0193$i;
  29377. break;
  29378. } else {
  29379. $$01928$i = $$$0192$i;$$01937$i = $$$0193$i;$162 = $170;
  29380. }
  29381. }
  29382. }
  29383. $172 = HEAP32[(35476)>>2]|0;
  29384. $173 = ($$0192$lcssa$i>>>0)<($172>>>0);
  29385. if ($173) {
  29386. _abort();
  29387. // unreachable;
  29388. }
  29389. $174 = (($$0192$lcssa$i) + ($23)|0);
  29390. $175 = ($$0192$lcssa$i>>>0)<($174>>>0);
  29391. if (!($175)) {
  29392. _abort();
  29393. // unreachable;
  29394. }
  29395. $176 = ((($$0192$lcssa$i)) + 24|0);
  29396. $177 = HEAP32[$176>>2]|0;
  29397. $178 = ((($$0192$lcssa$i)) + 12|0);
  29398. $179 = HEAP32[$178>>2]|0;
  29399. $180 = ($179|0)==($$0192$lcssa$i|0);
  29400. do {
  29401. if ($180) {
  29402. $190 = ((($$0192$lcssa$i)) + 20|0);
  29403. $191 = HEAP32[$190>>2]|0;
  29404. $192 = ($191|0)==(0|0);
  29405. if ($192) {
  29406. $193 = ((($$0192$lcssa$i)) + 16|0);
  29407. $194 = HEAP32[$193>>2]|0;
  29408. $195 = ($194|0)==(0|0);
  29409. if ($195) {
  29410. $$3$i = 0;
  29411. break;
  29412. } else {
  29413. $$1196$i = $194;$$1198$i = $193;
  29414. }
  29415. } else {
  29416. $$1196$i = $191;$$1198$i = $190;
  29417. }
  29418. while(1) {
  29419. $196 = ((($$1196$i)) + 20|0);
  29420. $197 = HEAP32[$196>>2]|0;
  29421. $198 = ($197|0)==(0|0);
  29422. if (!($198)) {
  29423. $$1196$i = $197;$$1198$i = $196;
  29424. continue;
  29425. }
  29426. $199 = ((($$1196$i)) + 16|0);
  29427. $200 = HEAP32[$199>>2]|0;
  29428. $201 = ($200|0)==(0|0);
  29429. if ($201) {
  29430. break;
  29431. } else {
  29432. $$1196$i = $200;$$1198$i = $199;
  29433. }
  29434. }
  29435. $202 = ($$1198$i>>>0)<($172>>>0);
  29436. if ($202) {
  29437. _abort();
  29438. // unreachable;
  29439. } else {
  29440. HEAP32[$$1198$i>>2] = 0;
  29441. $$3$i = $$1196$i;
  29442. break;
  29443. }
  29444. } else {
  29445. $181 = ((($$0192$lcssa$i)) + 8|0);
  29446. $182 = HEAP32[$181>>2]|0;
  29447. $183 = ($182>>>0)<($172>>>0);
  29448. if ($183) {
  29449. _abort();
  29450. // unreachable;
  29451. }
  29452. $184 = ((($182)) + 12|0);
  29453. $185 = HEAP32[$184>>2]|0;
  29454. $186 = ($185|0)==($$0192$lcssa$i|0);
  29455. if (!($186)) {
  29456. _abort();
  29457. // unreachable;
  29458. }
  29459. $187 = ((($179)) + 8|0);
  29460. $188 = HEAP32[$187>>2]|0;
  29461. $189 = ($188|0)==($$0192$lcssa$i|0);
  29462. if ($189) {
  29463. HEAP32[$184>>2] = $179;
  29464. HEAP32[$187>>2] = $182;
  29465. $$3$i = $179;
  29466. break;
  29467. } else {
  29468. _abort();
  29469. // unreachable;
  29470. }
  29471. }
  29472. } while(0);
  29473. $203 = ($177|0)==(0|0);
  29474. L85: do {
  29475. if (!($203)) {
  29476. $204 = ((($$0192$lcssa$i)) + 28|0);
  29477. $205 = HEAP32[$204>>2]|0;
  29478. $206 = (35764 + ($205<<2)|0);
  29479. $207 = HEAP32[$206>>2]|0;
  29480. $208 = ($$0192$lcssa$i|0)==($207|0);
  29481. do {
  29482. if ($208) {
  29483. HEAP32[$206>>2] = $$3$i;
  29484. $cond$i = ($$3$i|0)==(0|0);
  29485. if ($cond$i) {
  29486. $209 = 1 << $205;
  29487. $210 = $209 ^ -1;
  29488. $211 = $125 & $210;
  29489. HEAP32[(35464)>>2] = $211;
  29490. break L85;
  29491. }
  29492. } else {
  29493. $212 = HEAP32[(35476)>>2]|0;
  29494. $213 = ($177>>>0)<($212>>>0);
  29495. if ($213) {
  29496. _abort();
  29497. // unreachable;
  29498. } else {
  29499. $214 = ((($177)) + 16|0);
  29500. $215 = HEAP32[$214>>2]|0;
  29501. $not$1$i = ($215|0)!=($$0192$lcssa$i|0);
  29502. $$sink2$i = $not$1$i&1;
  29503. $216 = (((($177)) + 16|0) + ($$sink2$i<<2)|0);
  29504. HEAP32[$216>>2] = $$3$i;
  29505. $217 = ($$3$i|0)==(0|0);
  29506. if ($217) {
  29507. break L85;
  29508. } else {
  29509. break;
  29510. }
  29511. }
  29512. }
  29513. } while(0);
  29514. $218 = HEAP32[(35476)>>2]|0;
  29515. $219 = ($$3$i>>>0)<($218>>>0);
  29516. if ($219) {
  29517. _abort();
  29518. // unreachable;
  29519. }
  29520. $220 = ((($$3$i)) + 24|0);
  29521. HEAP32[$220>>2] = $177;
  29522. $221 = ((($$0192$lcssa$i)) + 16|0);
  29523. $222 = HEAP32[$221>>2]|0;
  29524. $223 = ($222|0)==(0|0);
  29525. do {
  29526. if (!($223)) {
  29527. $224 = ($222>>>0)<($218>>>0);
  29528. if ($224) {
  29529. _abort();
  29530. // unreachable;
  29531. } else {
  29532. $225 = ((($$3$i)) + 16|0);
  29533. HEAP32[$225>>2] = $222;
  29534. $226 = ((($222)) + 24|0);
  29535. HEAP32[$226>>2] = $$3$i;
  29536. break;
  29537. }
  29538. }
  29539. } while(0);
  29540. $227 = ((($$0192$lcssa$i)) + 20|0);
  29541. $228 = HEAP32[$227>>2]|0;
  29542. $229 = ($228|0)==(0|0);
  29543. if (!($229)) {
  29544. $230 = HEAP32[(35476)>>2]|0;
  29545. $231 = ($228>>>0)<($230>>>0);
  29546. if ($231) {
  29547. _abort();
  29548. // unreachable;
  29549. } else {
  29550. $232 = ((($$3$i)) + 20|0);
  29551. HEAP32[$232>>2] = $228;
  29552. $233 = ((($228)) + 24|0);
  29553. HEAP32[$233>>2] = $$3$i;
  29554. break;
  29555. }
  29556. }
  29557. }
  29558. } while(0);
  29559. $234 = ($$0193$lcssa$i>>>0)<(16);
  29560. if ($234) {
  29561. $235 = (($$0193$lcssa$i) + ($23))|0;
  29562. $236 = $235 | 3;
  29563. $237 = ((($$0192$lcssa$i)) + 4|0);
  29564. HEAP32[$237>>2] = $236;
  29565. $238 = (($$0192$lcssa$i) + ($235)|0);
  29566. $239 = ((($238)) + 4|0);
  29567. $240 = HEAP32[$239>>2]|0;
  29568. $241 = $240 | 1;
  29569. HEAP32[$239>>2] = $241;
  29570. } else {
  29571. $242 = $23 | 3;
  29572. $243 = ((($$0192$lcssa$i)) + 4|0);
  29573. HEAP32[$243>>2] = $242;
  29574. $244 = $$0193$lcssa$i | 1;
  29575. $245 = ((($174)) + 4|0);
  29576. HEAP32[$245>>2] = $244;
  29577. $246 = (($174) + ($$0193$lcssa$i)|0);
  29578. HEAP32[$246>>2] = $$0193$lcssa$i;
  29579. $247 = ($54|0)==(0);
  29580. if (!($247)) {
  29581. $248 = HEAP32[(35480)>>2]|0;
  29582. $249 = $54 >>> 3;
  29583. $250 = $249 << 1;
  29584. $251 = (35500 + ($250<<2)|0);
  29585. $252 = 1 << $249;
  29586. $253 = $25 & $252;
  29587. $254 = ($253|0)==(0);
  29588. if ($254) {
  29589. $255 = $25 | $252;
  29590. HEAP32[8865] = $255;
  29591. $$pre$i = ((($251)) + 8|0);
  29592. $$0189$i = $251;$$pre$phi$iZ2D = $$pre$i;
  29593. } else {
  29594. $256 = ((($251)) + 8|0);
  29595. $257 = HEAP32[$256>>2]|0;
  29596. $258 = HEAP32[(35476)>>2]|0;
  29597. $259 = ($257>>>0)<($258>>>0);
  29598. if ($259) {
  29599. _abort();
  29600. // unreachable;
  29601. } else {
  29602. $$0189$i = $257;$$pre$phi$iZ2D = $256;
  29603. }
  29604. }
  29605. HEAP32[$$pre$phi$iZ2D>>2] = $248;
  29606. $260 = ((($$0189$i)) + 12|0);
  29607. HEAP32[$260>>2] = $248;
  29608. $261 = ((($248)) + 8|0);
  29609. HEAP32[$261>>2] = $$0189$i;
  29610. $262 = ((($248)) + 12|0);
  29611. HEAP32[$262>>2] = $251;
  29612. }
  29613. HEAP32[(35468)>>2] = $$0193$lcssa$i;
  29614. HEAP32[(35480)>>2] = $174;
  29615. }
  29616. $263 = ((($$0192$lcssa$i)) + 8|0);
  29617. $$2 = $263;
  29618. }
  29619. } else {
  29620. $$0198 = $23;
  29621. label = 153;
  29622. }
  29623. } else {
  29624. $264 = ($0>>>0)>(4294967231);
  29625. if ($264) {
  29626. $$0198 = -1;
  29627. label = 153;
  29628. } else {
  29629. $265 = (($0) + 11)|0;
  29630. $266 = $265 & -8;
  29631. $267 = HEAP32[(35464)>>2]|0;
  29632. $268 = ($267|0)==(0);
  29633. if ($268) {
  29634. $$0198 = $266;
  29635. label = 153;
  29636. } else {
  29637. $269 = (0 - ($266))|0;
  29638. $270 = $265 >>> 8;
  29639. $271 = ($270|0)==(0);
  29640. if ($271) {
  29641. $$0358$i = 0;
  29642. } else {
  29643. $272 = ($266>>>0)>(16777215);
  29644. if ($272) {
  29645. $$0358$i = 31;
  29646. } else {
  29647. $273 = (($270) + 1048320)|0;
  29648. $274 = $273 >>> 16;
  29649. $275 = $274 & 8;
  29650. $276 = $270 << $275;
  29651. $277 = (($276) + 520192)|0;
  29652. $278 = $277 >>> 16;
  29653. $279 = $278 & 4;
  29654. $280 = $279 | $275;
  29655. $281 = $276 << $279;
  29656. $282 = (($281) + 245760)|0;
  29657. $283 = $282 >>> 16;
  29658. $284 = $283 & 2;
  29659. $285 = $280 | $284;
  29660. $286 = (14 - ($285))|0;
  29661. $287 = $281 << $284;
  29662. $288 = $287 >>> 15;
  29663. $289 = (($286) + ($288))|0;
  29664. $290 = $289 << 1;
  29665. $291 = (($289) + 7)|0;
  29666. $292 = $266 >>> $291;
  29667. $293 = $292 & 1;
  29668. $294 = $293 | $290;
  29669. $$0358$i = $294;
  29670. }
  29671. }
  29672. $295 = (35764 + ($$0358$i<<2)|0);
  29673. $296 = HEAP32[$295>>2]|0;
  29674. $297 = ($296|0)==(0|0);
  29675. L128: do {
  29676. if ($297) {
  29677. $$2355$i = 0;$$3$i202 = 0;$$3350$i = $269;
  29678. label = 90;
  29679. } else {
  29680. $298 = ($$0358$i|0)==(31);
  29681. $299 = $$0358$i >>> 1;
  29682. $300 = (25 - ($299))|0;
  29683. $301 = $298 ? 0 : $300;
  29684. $302 = $266 << $301;
  29685. $$0342$i = 0;$$0347$i = $269;$$0353$i = $296;$$0359$i = $302;$$0362$i = 0;
  29686. while(1) {
  29687. $303 = ((($$0353$i)) + 4|0);
  29688. $304 = HEAP32[$303>>2]|0;
  29689. $305 = $304 & -8;
  29690. $306 = (($305) - ($266))|0;
  29691. $307 = ($306>>>0)<($$0347$i>>>0);
  29692. if ($307) {
  29693. $308 = ($306|0)==(0);
  29694. if ($308) {
  29695. $$415$i = $$0353$i;$$435114$i = 0;$$435713$i = $$0353$i;
  29696. label = 94;
  29697. break L128;
  29698. } else {
  29699. $$1343$i = $$0353$i;$$1348$i = $306;
  29700. }
  29701. } else {
  29702. $$1343$i = $$0342$i;$$1348$i = $$0347$i;
  29703. }
  29704. $309 = ((($$0353$i)) + 20|0);
  29705. $310 = HEAP32[$309>>2]|0;
  29706. $311 = $$0359$i >>> 31;
  29707. $312 = (((($$0353$i)) + 16|0) + ($311<<2)|0);
  29708. $313 = HEAP32[$312>>2]|0;
  29709. $314 = ($310|0)==(0|0);
  29710. $315 = ($310|0)==($313|0);
  29711. $or$cond2$i = $314 | $315;
  29712. $$1363$i = $or$cond2$i ? $$0362$i : $310;
  29713. $316 = ($313|0)==(0|0);
  29714. $not$8$i = $316 ^ 1;
  29715. $317 = $not$8$i&1;
  29716. $$0359$$i = $$0359$i << $317;
  29717. if ($316) {
  29718. $$2355$i = $$1363$i;$$3$i202 = $$1343$i;$$3350$i = $$1348$i;
  29719. label = 90;
  29720. break;
  29721. } else {
  29722. $$0342$i = $$1343$i;$$0347$i = $$1348$i;$$0353$i = $313;$$0359$i = $$0359$$i;$$0362$i = $$1363$i;
  29723. }
  29724. }
  29725. }
  29726. } while(0);
  29727. if ((label|0) == 90) {
  29728. $318 = ($$2355$i|0)==(0|0);
  29729. $319 = ($$3$i202|0)==(0|0);
  29730. $or$cond$i = $318 & $319;
  29731. if ($or$cond$i) {
  29732. $320 = 2 << $$0358$i;
  29733. $321 = (0 - ($320))|0;
  29734. $322 = $320 | $321;
  29735. $323 = $267 & $322;
  29736. $324 = ($323|0)==(0);
  29737. if ($324) {
  29738. $$0198 = $266;
  29739. label = 153;
  29740. break;
  29741. }
  29742. $325 = (0 - ($323))|0;
  29743. $326 = $323 & $325;
  29744. $327 = (($326) + -1)|0;
  29745. $328 = $327 >>> 12;
  29746. $329 = $328 & 16;
  29747. $330 = $327 >>> $329;
  29748. $331 = $330 >>> 5;
  29749. $332 = $331 & 8;
  29750. $333 = $332 | $329;
  29751. $334 = $330 >>> $332;
  29752. $335 = $334 >>> 2;
  29753. $336 = $335 & 4;
  29754. $337 = $333 | $336;
  29755. $338 = $334 >>> $336;
  29756. $339 = $338 >>> 1;
  29757. $340 = $339 & 2;
  29758. $341 = $337 | $340;
  29759. $342 = $338 >>> $340;
  29760. $343 = $342 >>> 1;
  29761. $344 = $343 & 1;
  29762. $345 = $341 | $344;
  29763. $346 = $342 >>> $344;
  29764. $347 = (($345) + ($346))|0;
  29765. $348 = (35764 + ($347<<2)|0);
  29766. $349 = HEAP32[$348>>2]|0;
  29767. $$4$ph$i = 0;$$4357$ph$i = $349;
  29768. } else {
  29769. $$4$ph$i = $$3$i202;$$4357$ph$i = $$2355$i;
  29770. }
  29771. $350 = ($$4357$ph$i|0)==(0|0);
  29772. if ($350) {
  29773. $$4$lcssa$i = $$4$ph$i;$$4351$lcssa$i = $$3350$i;
  29774. } else {
  29775. $$415$i = $$4$ph$i;$$435114$i = $$3350$i;$$435713$i = $$4357$ph$i;
  29776. label = 94;
  29777. }
  29778. }
  29779. if ((label|0) == 94) {
  29780. while(1) {
  29781. label = 0;
  29782. $351 = ((($$435713$i)) + 4|0);
  29783. $352 = HEAP32[$351>>2]|0;
  29784. $353 = $352 & -8;
  29785. $354 = (($353) - ($266))|0;
  29786. $355 = ($354>>>0)<($$435114$i>>>0);
  29787. $$$4351$i = $355 ? $354 : $$435114$i;
  29788. $$4357$$4$i = $355 ? $$435713$i : $$415$i;
  29789. $356 = ((($$435713$i)) + 16|0);
  29790. $357 = HEAP32[$356>>2]|0;
  29791. $not$1$i204 = ($357|0)==(0|0);
  29792. $$sink2$i205 = $not$1$i204&1;
  29793. $358 = (((($$435713$i)) + 16|0) + ($$sink2$i205<<2)|0);
  29794. $359 = HEAP32[$358>>2]|0;
  29795. $360 = ($359|0)==(0|0);
  29796. if ($360) {
  29797. $$4$lcssa$i = $$4357$$4$i;$$4351$lcssa$i = $$$4351$i;
  29798. break;
  29799. } else {
  29800. $$415$i = $$4357$$4$i;$$435114$i = $$$4351$i;$$435713$i = $359;
  29801. label = 94;
  29802. }
  29803. }
  29804. }
  29805. $361 = ($$4$lcssa$i|0)==(0|0);
  29806. if ($361) {
  29807. $$0198 = $266;
  29808. label = 153;
  29809. } else {
  29810. $362 = HEAP32[(35468)>>2]|0;
  29811. $363 = (($362) - ($266))|0;
  29812. $364 = ($$4351$lcssa$i>>>0)<($363>>>0);
  29813. if ($364) {
  29814. $365 = HEAP32[(35476)>>2]|0;
  29815. $366 = ($$4$lcssa$i>>>0)<($365>>>0);
  29816. if ($366) {
  29817. _abort();
  29818. // unreachable;
  29819. }
  29820. $367 = (($$4$lcssa$i) + ($266)|0);
  29821. $368 = ($$4$lcssa$i>>>0)<($367>>>0);
  29822. if (!($368)) {
  29823. _abort();
  29824. // unreachable;
  29825. }
  29826. $369 = ((($$4$lcssa$i)) + 24|0);
  29827. $370 = HEAP32[$369>>2]|0;
  29828. $371 = ((($$4$lcssa$i)) + 12|0);
  29829. $372 = HEAP32[$371>>2]|0;
  29830. $373 = ($372|0)==($$4$lcssa$i|0);
  29831. do {
  29832. if ($373) {
  29833. $383 = ((($$4$lcssa$i)) + 20|0);
  29834. $384 = HEAP32[$383>>2]|0;
  29835. $385 = ($384|0)==(0|0);
  29836. if ($385) {
  29837. $386 = ((($$4$lcssa$i)) + 16|0);
  29838. $387 = HEAP32[$386>>2]|0;
  29839. $388 = ($387|0)==(0|0);
  29840. if ($388) {
  29841. $$3372$i = 0;
  29842. break;
  29843. } else {
  29844. $$1370$i = $387;$$1374$i = $386;
  29845. }
  29846. } else {
  29847. $$1370$i = $384;$$1374$i = $383;
  29848. }
  29849. while(1) {
  29850. $389 = ((($$1370$i)) + 20|0);
  29851. $390 = HEAP32[$389>>2]|0;
  29852. $391 = ($390|0)==(0|0);
  29853. if (!($391)) {
  29854. $$1370$i = $390;$$1374$i = $389;
  29855. continue;
  29856. }
  29857. $392 = ((($$1370$i)) + 16|0);
  29858. $393 = HEAP32[$392>>2]|0;
  29859. $394 = ($393|0)==(0|0);
  29860. if ($394) {
  29861. break;
  29862. } else {
  29863. $$1370$i = $393;$$1374$i = $392;
  29864. }
  29865. }
  29866. $395 = ($$1374$i>>>0)<($365>>>0);
  29867. if ($395) {
  29868. _abort();
  29869. // unreachable;
  29870. } else {
  29871. HEAP32[$$1374$i>>2] = 0;
  29872. $$3372$i = $$1370$i;
  29873. break;
  29874. }
  29875. } else {
  29876. $374 = ((($$4$lcssa$i)) + 8|0);
  29877. $375 = HEAP32[$374>>2]|0;
  29878. $376 = ($375>>>0)<($365>>>0);
  29879. if ($376) {
  29880. _abort();
  29881. // unreachable;
  29882. }
  29883. $377 = ((($375)) + 12|0);
  29884. $378 = HEAP32[$377>>2]|0;
  29885. $379 = ($378|0)==($$4$lcssa$i|0);
  29886. if (!($379)) {
  29887. _abort();
  29888. // unreachable;
  29889. }
  29890. $380 = ((($372)) + 8|0);
  29891. $381 = HEAP32[$380>>2]|0;
  29892. $382 = ($381|0)==($$4$lcssa$i|0);
  29893. if ($382) {
  29894. HEAP32[$377>>2] = $372;
  29895. HEAP32[$380>>2] = $375;
  29896. $$3372$i = $372;
  29897. break;
  29898. } else {
  29899. _abort();
  29900. // unreachable;
  29901. }
  29902. }
  29903. } while(0);
  29904. $396 = ($370|0)==(0|0);
  29905. L175: do {
  29906. if ($396) {
  29907. $487 = $267;
  29908. } else {
  29909. $397 = ((($$4$lcssa$i)) + 28|0);
  29910. $398 = HEAP32[$397>>2]|0;
  29911. $399 = (35764 + ($398<<2)|0);
  29912. $400 = HEAP32[$399>>2]|0;
  29913. $401 = ($$4$lcssa$i|0)==($400|0);
  29914. do {
  29915. if ($401) {
  29916. HEAP32[$399>>2] = $$3372$i;
  29917. $cond$i209 = ($$3372$i|0)==(0|0);
  29918. if ($cond$i209) {
  29919. $402 = 1 << $398;
  29920. $403 = $402 ^ -1;
  29921. $404 = $267 & $403;
  29922. HEAP32[(35464)>>2] = $404;
  29923. $487 = $404;
  29924. break L175;
  29925. }
  29926. } else {
  29927. $405 = HEAP32[(35476)>>2]|0;
  29928. $406 = ($370>>>0)<($405>>>0);
  29929. if ($406) {
  29930. _abort();
  29931. // unreachable;
  29932. } else {
  29933. $407 = ((($370)) + 16|0);
  29934. $408 = HEAP32[$407>>2]|0;
  29935. $not$$i210 = ($408|0)!=($$4$lcssa$i|0);
  29936. $$sink3$i = $not$$i210&1;
  29937. $409 = (((($370)) + 16|0) + ($$sink3$i<<2)|0);
  29938. HEAP32[$409>>2] = $$3372$i;
  29939. $410 = ($$3372$i|0)==(0|0);
  29940. if ($410) {
  29941. $487 = $267;
  29942. break L175;
  29943. } else {
  29944. break;
  29945. }
  29946. }
  29947. }
  29948. } while(0);
  29949. $411 = HEAP32[(35476)>>2]|0;
  29950. $412 = ($$3372$i>>>0)<($411>>>0);
  29951. if ($412) {
  29952. _abort();
  29953. // unreachable;
  29954. }
  29955. $413 = ((($$3372$i)) + 24|0);
  29956. HEAP32[$413>>2] = $370;
  29957. $414 = ((($$4$lcssa$i)) + 16|0);
  29958. $415 = HEAP32[$414>>2]|0;
  29959. $416 = ($415|0)==(0|0);
  29960. do {
  29961. if (!($416)) {
  29962. $417 = ($415>>>0)<($411>>>0);
  29963. if ($417) {
  29964. _abort();
  29965. // unreachable;
  29966. } else {
  29967. $418 = ((($$3372$i)) + 16|0);
  29968. HEAP32[$418>>2] = $415;
  29969. $419 = ((($415)) + 24|0);
  29970. HEAP32[$419>>2] = $$3372$i;
  29971. break;
  29972. }
  29973. }
  29974. } while(0);
  29975. $420 = ((($$4$lcssa$i)) + 20|0);
  29976. $421 = HEAP32[$420>>2]|0;
  29977. $422 = ($421|0)==(0|0);
  29978. if ($422) {
  29979. $487 = $267;
  29980. } else {
  29981. $423 = HEAP32[(35476)>>2]|0;
  29982. $424 = ($421>>>0)<($423>>>0);
  29983. if ($424) {
  29984. _abort();
  29985. // unreachable;
  29986. } else {
  29987. $425 = ((($$3372$i)) + 20|0);
  29988. HEAP32[$425>>2] = $421;
  29989. $426 = ((($421)) + 24|0);
  29990. HEAP32[$426>>2] = $$3372$i;
  29991. $487 = $267;
  29992. break;
  29993. }
  29994. }
  29995. }
  29996. } while(0);
  29997. $427 = ($$4351$lcssa$i>>>0)<(16);
  29998. do {
  29999. if ($427) {
  30000. $428 = (($$4351$lcssa$i) + ($266))|0;
  30001. $429 = $428 | 3;
  30002. $430 = ((($$4$lcssa$i)) + 4|0);
  30003. HEAP32[$430>>2] = $429;
  30004. $431 = (($$4$lcssa$i) + ($428)|0);
  30005. $432 = ((($431)) + 4|0);
  30006. $433 = HEAP32[$432>>2]|0;
  30007. $434 = $433 | 1;
  30008. HEAP32[$432>>2] = $434;
  30009. } else {
  30010. $435 = $266 | 3;
  30011. $436 = ((($$4$lcssa$i)) + 4|0);
  30012. HEAP32[$436>>2] = $435;
  30013. $437 = $$4351$lcssa$i | 1;
  30014. $438 = ((($367)) + 4|0);
  30015. HEAP32[$438>>2] = $437;
  30016. $439 = (($367) + ($$4351$lcssa$i)|0);
  30017. HEAP32[$439>>2] = $$4351$lcssa$i;
  30018. $440 = $$4351$lcssa$i >>> 3;
  30019. $441 = ($$4351$lcssa$i>>>0)<(256);
  30020. if ($441) {
  30021. $442 = $440 << 1;
  30022. $443 = (35500 + ($442<<2)|0);
  30023. $444 = HEAP32[8865]|0;
  30024. $445 = 1 << $440;
  30025. $446 = $444 & $445;
  30026. $447 = ($446|0)==(0);
  30027. do {
  30028. if ($447) {
  30029. $448 = $444 | $445;
  30030. HEAP32[8865] = $448;
  30031. $$pre$i211 = ((($443)) + 8|0);
  30032. $$0368$i = $443;$$pre$phi$i212Z2D = $$pre$i211;
  30033. } else {
  30034. $449 = ((($443)) + 8|0);
  30035. $450 = HEAP32[$449>>2]|0;
  30036. $451 = HEAP32[(35476)>>2]|0;
  30037. $452 = ($450>>>0)<($451>>>0);
  30038. if (!($452)) {
  30039. $$0368$i = $450;$$pre$phi$i212Z2D = $449;
  30040. break;
  30041. }
  30042. _abort();
  30043. // unreachable;
  30044. }
  30045. } while(0);
  30046. HEAP32[$$pre$phi$i212Z2D>>2] = $367;
  30047. $453 = ((($$0368$i)) + 12|0);
  30048. HEAP32[$453>>2] = $367;
  30049. $454 = ((($367)) + 8|0);
  30050. HEAP32[$454>>2] = $$0368$i;
  30051. $455 = ((($367)) + 12|0);
  30052. HEAP32[$455>>2] = $443;
  30053. break;
  30054. }
  30055. $456 = $$4351$lcssa$i >>> 8;
  30056. $457 = ($456|0)==(0);
  30057. if ($457) {
  30058. $$0361$i = 0;
  30059. } else {
  30060. $458 = ($$4351$lcssa$i>>>0)>(16777215);
  30061. if ($458) {
  30062. $$0361$i = 31;
  30063. } else {
  30064. $459 = (($456) + 1048320)|0;
  30065. $460 = $459 >>> 16;
  30066. $461 = $460 & 8;
  30067. $462 = $456 << $461;
  30068. $463 = (($462) + 520192)|0;
  30069. $464 = $463 >>> 16;
  30070. $465 = $464 & 4;
  30071. $466 = $465 | $461;
  30072. $467 = $462 << $465;
  30073. $468 = (($467) + 245760)|0;
  30074. $469 = $468 >>> 16;
  30075. $470 = $469 & 2;
  30076. $471 = $466 | $470;
  30077. $472 = (14 - ($471))|0;
  30078. $473 = $467 << $470;
  30079. $474 = $473 >>> 15;
  30080. $475 = (($472) + ($474))|0;
  30081. $476 = $475 << 1;
  30082. $477 = (($475) + 7)|0;
  30083. $478 = $$4351$lcssa$i >>> $477;
  30084. $479 = $478 & 1;
  30085. $480 = $479 | $476;
  30086. $$0361$i = $480;
  30087. }
  30088. }
  30089. $481 = (35764 + ($$0361$i<<2)|0);
  30090. $482 = ((($367)) + 28|0);
  30091. HEAP32[$482>>2] = $$0361$i;
  30092. $483 = ((($367)) + 16|0);
  30093. $484 = ((($483)) + 4|0);
  30094. HEAP32[$484>>2] = 0;
  30095. HEAP32[$483>>2] = 0;
  30096. $485 = 1 << $$0361$i;
  30097. $486 = $487 & $485;
  30098. $488 = ($486|0)==(0);
  30099. if ($488) {
  30100. $489 = $487 | $485;
  30101. HEAP32[(35464)>>2] = $489;
  30102. HEAP32[$481>>2] = $367;
  30103. $490 = ((($367)) + 24|0);
  30104. HEAP32[$490>>2] = $481;
  30105. $491 = ((($367)) + 12|0);
  30106. HEAP32[$491>>2] = $367;
  30107. $492 = ((($367)) + 8|0);
  30108. HEAP32[$492>>2] = $367;
  30109. break;
  30110. }
  30111. $493 = HEAP32[$481>>2]|0;
  30112. $494 = ($$0361$i|0)==(31);
  30113. $495 = $$0361$i >>> 1;
  30114. $496 = (25 - ($495))|0;
  30115. $497 = $494 ? 0 : $496;
  30116. $498 = $$4351$lcssa$i << $497;
  30117. $$0344$i = $498;$$0345$i = $493;
  30118. while(1) {
  30119. $499 = ((($$0345$i)) + 4|0);
  30120. $500 = HEAP32[$499>>2]|0;
  30121. $501 = $500 & -8;
  30122. $502 = ($501|0)==($$4351$lcssa$i|0);
  30123. if ($502) {
  30124. label = 148;
  30125. break;
  30126. }
  30127. $503 = $$0344$i >>> 31;
  30128. $504 = (((($$0345$i)) + 16|0) + ($503<<2)|0);
  30129. $505 = $$0344$i << 1;
  30130. $506 = HEAP32[$504>>2]|0;
  30131. $507 = ($506|0)==(0|0);
  30132. if ($507) {
  30133. label = 145;
  30134. break;
  30135. } else {
  30136. $$0344$i = $505;$$0345$i = $506;
  30137. }
  30138. }
  30139. if ((label|0) == 145) {
  30140. $508 = HEAP32[(35476)>>2]|0;
  30141. $509 = ($504>>>0)<($508>>>0);
  30142. if ($509) {
  30143. _abort();
  30144. // unreachable;
  30145. } else {
  30146. HEAP32[$504>>2] = $367;
  30147. $510 = ((($367)) + 24|0);
  30148. HEAP32[$510>>2] = $$0345$i;
  30149. $511 = ((($367)) + 12|0);
  30150. HEAP32[$511>>2] = $367;
  30151. $512 = ((($367)) + 8|0);
  30152. HEAP32[$512>>2] = $367;
  30153. break;
  30154. }
  30155. }
  30156. else if ((label|0) == 148) {
  30157. $513 = ((($$0345$i)) + 8|0);
  30158. $514 = HEAP32[$513>>2]|0;
  30159. $515 = HEAP32[(35476)>>2]|0;
  30160. $516 = ($514>>>0)>=($515>>>0);
  30161. $not$9$i = ($$0345$i>>>0)>=($515>>>0);
  30162. $517 = $516 & $not$9$i;
  30163. if ($517) {
  30164. $518 = ((($514)) + 12|0);
  30165. HEAP32[$518>>2] = $367;
  30166. HEAP32[$513>>2] = $367;
  30167. $519 = ((($367)) + 8|0);
  30168. HEAP32[$519>>2] = $514;
  30169. $520 = ((($367)) + 12|0);
  30170. HEAP32[$520>>2] = $$0345$i;
  30171. $521 = ((($367)) + 24|0);
  30172. HEAP32[$521>>2] = 0;
  30173. break;
  30174. } else {
  30175. _abort();
  30176. // unreachable;
  30177. }
  30178. }
  30179. }
  30180. } while(0);
  30181. $522 = ((($$4$lcssa$i)) + 8|0);
  30182. $$2 = $522;
  30183. } else {
  30184. $$0198 = $266;
  30185. label = 153;
  30186. }
  30187. }
  30188. }
  30189. }
  30190. }
  30191. } while(0);
  30192. L230: do {
  30193. if ((label|0) == 153) {
  30194. $523 = HEAP32[(35468)>>2]|0;
  30195. $524 = ($523>>>0)<($$0198>>>0);
  30196. if (!($524)) {
  30197. $525 = (($523) - ($$0198))|0;
  30198. $526 = HEAP32[(35480)>>2]|0;
  30199. $527 = ($525>>>0)>(15);
  30200. if ($527) {
  30201. $528 = (($526) + ($$0198)|0);
  30202. HEAP32[(35480)>>2] = $528;
  30203. HEAP32[(35468)>>2] = $525;
  30204. $529 = $525 | 1;
  30205. $530 = ((($528)) + 4|0);
  30206. HEAP32[$530>>2] = $529;
  30207. $531 = (($528) + ($525)|0);
  30208. HEAP32[$531>>2] = $525;
  30209. $532 = $$0198 | 3;
  30210. $533 = ((($526)) + 4|0);
  30211. HEAP32[$533>>2] = $532;
  30212. } else {
  30213. HEAP32[(35468)>>2] = 0;
  30214. HEAP32[(35480)>>2] = 0;
  30215. $534 = $523 | 3;
  30216. $535 = ((($526)) + 4|0);
  30217. HEAP32[$535>>2] = $534;
  30218. $536 = (($526) + ($523)|0);
  30219. $537 = ((($536)) + 4|0);
  30220. $538 = HEAP32[$537>>2]|0;
  30221. $539 = $538 | 1;
  30222. HEAP32[$537>>2] = $539;
  30223. }
  30224. $540 = ((($526)) + 8|0);
  30225. $$2 = $540;
  30226. break;
  30227. }
  30228. $541 = HEAP32[(35472)>>2]|0;
  30229. $542 = ($541>>>0)>($$0198>>>0);
  30230. if ($542) {
  30231. $543 = (($541) - ($$0198))|0;
  30232. HEAP32[(35472)>>2] = $543;
  30233. $544 = HEAP32[(35484)>>2]|0;
  30234. $545 = (($544) + ($$0198)|0);
  30235. HEAP32[(35484)>>2] = $545;
  30236. $546 = $543 | 1;
  30237. $547 = ((($545)) + 4|0);
  30238. HEAP32[$547>>2] = $546;
  30239. $548 = $$0198 | 3;
  30240. $549 = ((($544)) + 4|0);
  30241. HEAP32[$549>>2] = $548;
  30242. $550 = ((($544)) + 8|0);
  30243. $$2 = $550;
  30244. break;
  30245. }
  30246. $551 = HEAP32[8852]|0;
  30247. $552 = ($551|0)==(0);
  30248. if ($552) {
  30249. (___pthread_mutex_lock(35432)|0);
  30250. $553 = HEAP32[8852]|0;
  30251. $554 = ($553|0)==(0);
  30252. if ($554) {
  30253. HEAP32[(35416)>>2] = 4096;
  30254. HEAP32[(35412)>>2] = 4096;
  30255. HEAP32[(35420)>>2] = -1;
  30256. HEAP32[(35424)>>2] = -1;
  30257. HEAP32[(35428)>>2] = 2;
  30258. HEAP32[(35904)>>2] = 2;
  30259. $555 = (_pthread_mutexattr_init($1)|0);
  30260. $556 = ($555|0)==(0);
  30261. if ($556) {
  30262. $557 = (_pthread_mutex_init((35908),$1)|0);
  30263. $558 = ($557|0)==(0);
  30264. if ($558) {
  30265. }
  30266. }
  30267. $559 = $2;
  30268. $560 = $559 & -16;
  30269. $561 = $560 ^ 1431655768;
  30270. HEAP32[$2>>2] = $561;
  30271. Atomics_store(HEAP32,8852,$561)|0;
  30272. }
  30273. (___pthread_mutex_unlock(35432)|0);
  30274. }
  30275. $562 = (($$0198) + 48)|0;
  30276. $563 = HEAP32[(35416)>>2]|0;
  30277. $564 = (($$0198) + 47)|0;
  30278. $565 = (($563) + ($564))|0;
  30279. $566 = (0 - ($563))|0;
  30280. $567 = $565 & $566;
  30281. $568 = ($567>>>0)>($$0198>>>0);
  30282. if ($568) {
  30283. $569 = HEAP32[(35900)>>2]|0;
  30284. $570 = ($569|0)==(0);
  30285. if (!($570)) {
  30286. $571 = HEAP32[(35892)>>2]|0;
  30287. $572 = (($571) + ($567))|0;
  30288. $573 = ($572>>>0)<=($571>>>0);
  30289. $574 = ($572>>>0)>($569>>>0);
  30290. $or$cond1$i = $573 | $574;
  30291. if ($or$cond1$i) {
  30292. $$2 = 0;
  30293. break;
  30294. }
  30295. }
  30296. $575 = HEAP32[(35904)>>2]|0;
  30297. $576 = $575 & 4;
  30298. $577 = ($576|0)==(0);
  30299. if ($577) {
  30300. $578 = HEAP32[(35484)>>2]|0;
  30301. $579 = ($578|0)==(0|0);
  30302. L258: do {
  30303. if ($579) {
  30304. label = 176;
  30305. } else {
  30306. $$0$i$i = (35936);
  30307. while(1) {
  30308. $580 = HEAP32[$$0$i$i>>2]|0;
  30309. $581 = ($580>>>0)>($578>>>0);
  30310. if (!($581)) {
  30311. $582 = ((($$0$i$i)) + 4|0);
  30312. $583 = HEAP32[$582>>2]|0;
  30313. $584 = (($580) + ($583)|0);
  30314. $585 = ($584>>>0)>($578>>>0);
  30315. if ($585) {
  30316. break;
  30317. }
  30318. }
  30319. $586 = ((($$0$i$i)) + 8|0);
  30320. $587 = HEAP32[$586>>2]|0;
  30321. $588 = ($587|0)==(0|0);
  30322. if ($588) {
  30323. label = 176;
  30324. break L258;
  30325. } else {
  30326. $$0$i$i = $587;
  30327. }
  30328. }
  30329. (___pthread_mutex_lock(35432)|0);
  30330. $611 = HEAP32[(35472)>>2]|0;
  30331. $612 = HEAP32[(35416)>>2]|0;
  30332. $613 = (($564) - ($611))|0;
  30333. $614 = (($613) + ($612))|0;
  30334. $615 = (0 - ($612))|0;
  30335. $616 = $614 & $615;
  30336. $617 = ($616>>>0)<(2147483647);
  30337. if ($617) {
  30338. $618 = (_sbrk(($616|0))|0);
  30339. $619 = HEAP32[$$0$i$i>>2]|0;
  30340. $620 = HEAP32[$582>>2]|0;
  30341. $621 = (($619) + ($620)|0);
  30342. $622 = ($618|0)==($621|0);
  30343. if ($622) {
  30344. $623 = ($618|0)==((-1)|0);
  30345. if ($623) {
  30346. $$2234253237$i = $616;
  30347. label = 190;
  30348. } else {
  30349. $$3229$i = $618;$$3235$i = $616;
  30350. }
  30351. } else {
  30352. $$2247$ph$i = $618;$$2253$ph$i = $616;
  30353. label = 184;
  30354. }
  30355. } else {
  30356. $$2234253237$i = 0;
  30357. label = 190;
  30358. }
  30359. }
  30360. } while(0);
  30361. do {
  30362. if ((label|0) == 176) {
  30363. (___pthread_mutex_lock(35432)|0);
  30364. $589 = (_sbrk(0)|0);
  30365. $590 = ($589|0)==((-1)|0);
  30366. if ($590) {
  30367. $$2234253237$i = 0;
  30368. label = 190;
  30369. } else {
  30370. $591 = $589;
  30371. $592 = HEAP32[(35412)>>2]|0;
  30372. $593 = (($592) + -1)|0;
  30373. $594 = $593 & $591;
  30374. $595 = ($594|0)==(0);
  30375. $596 = (($593) + ($591))|0;
  30376. $597 = (0 - ($592))|0;
  30377. $598 = $596 & $597;
  30378. $599 = (($598) - ($591))|0;
  30379. $600 = $595 ? 0 : $599;
  30380. $$$i = (($600) + ($567))|0;
  30381. $601 = HEAP32[(35892)>>2]|0;
  30382. $602 = (($$$i) + ($601))|0;
  30383. $603 = ($$$i>>>0)>($$0198>>>0);
  30384. $604 = ($$$i>>>0)<(2147483647);
  30385. $or$cond$i213 = $603 & $604;
  30386. if ($or$cond$i213) {
  30387. $605 = HEAP32[(35900)>>2]|0;
  30388. $606 = ($605|0)==(0);
  30389. if (!($606)) {
  30390. $607 = ($602>>>0)<=($601>>>0);
  30391. $608 = ($602>>>0)>($605>>>0);
  30392. $or$cond2$i214 = $607 | $608;
  30393. if ($or$cond2$i214) {
  30394. $$2234253237$i = 0;
  30395. label = 190;
  30396. break;
  30397. }
  30398. }
  30399. $609 = (_sbrk(($$$i|0))|0);
  30400. $610 = ($609|0)==($589|0);
  30401. if ($610) {
  30402. $$3229$i = $589;$$3235$i = $$$i;
  30403. } else {
  30404. $$2247$ph$i = $609;$$2253$ph$i = $$$i;
  30405. label = 184;
  30406. }
  30407. } else {
  30408. $$2234253237$i = 0;
  30409. label = 190;
  30410. }
  30411. }
  30412. }
  30413. } while(0);
  30414. do {
  30415. if ((label|0) == 184) {
  30416. $624 = (0 - ($$2253$ph$i))|0;
  30417. $625 = ($$2247$ph$i|0)!=((-1)|0);
  30418. $626 = ($$2253$ph$i>>>0)<(2147483647);
  30419. $or$cond7$i = $626 & $625;
  30420. $627 = ($562>>>0)>($$2253$ph$i>>>0);
  30421. $or$cond10$i = $627 & $or$cond7$i;
  30422. if (!($or$cond10$i)) {
  30423. $637 = ($$2247$ph$i|0)==((-1)|0);
  30424. if ($637) {
  30425. $$2234253237$i = 0;
  30426. label = 190;
  30427. break;
  30428. } else {
  30429. $$3229$i = $$2247$ph$i;$$3235$i = $$2253$ph$i;
  30430. break;
  30431. }
  30432. }
  30433. $628 = HEAP32[(35416)>>2]|0;
  30434. $629 = (($564) - ($$2253$ph$i))|0;
  30435. $630 = (($629) + ($628))|0;
  30436. $631 = (0 - ($628))|0;
  30437. $632 = $630 & $631;
  30438. $633 = ($632>>>0)<(2147483647);
  30439. if ($633) {
  30440. $634 = (_sbrk(($632|0))|0);
  30441. $635 = ($634|0)==((-1)|0);
  30442. if ($635) {
  30443. (_sbrk(($624|0))|0);
  30444. $$2234253237$i = 0;
  30445. label = 190;
  30446. break;
  30447. } else {
  30448. $636 = (($632) + ($$2253$ph$i))|0;
  30449. $$3229$i = $$2247$ph$i;$$3235$i = $636;
  30450. break;
  30451. }
  30452. } else {
  30453. $$3229$i = $$2247$ph$i;$$3235$i = $$2253$ph$i;
  30454. }
  30455. }
  30456. } while(0);
  30457. if ((label|0) == 190) {
  30458. $638 = HEAP32[(35904)>>2]|0;
  30459. $639 = $638 | 4;
  30460. HEAP32[(35904)>>2] = $639;
  30461. $$3229$i = (-1);$$3235$i = $$2234253237$i;
  30462. }
  30463. (___pthread_mutex_unlock(35432)|0);
  30464. $$4230$i = $$3229$i;$$4236$i = $$3235$i;
  30465. } else {
  30466. $$4230$i = (-1);$$4236$i = 0;
  30467. }
  30468. $640 = ($$4230$i|0)==((-1)|0);
  30469. $641 = ($567>>>0)<(2147483647);
  30470. $or$cond9$i = $641 & $640;
  30471. if ($or$cond9$i) {
  30472. (___pthread_mutex_lock(35432)|0);
  30473. $642 = (_sbrk(($567|0))|0);
  30474. $643 = (_sbrk(0)|0);
  30475. (___pthread_mutex_unlock(35432)|0);
  30476. $644 = ($642|0)!=((-1)|0);
  30477. $645 = ($643|0)!=((-1)|0);
  30478. $or$cond5$i = $644 & $645;
  30479. $646 = ($642>>>0)<($643>>>0);
  30480. $or$cond11$i = $646 & $or$cond5$i;
  30481. $647 = $643;
  30482. $648 = $642;
  30483. $649 = (($647) - ($648))|0;
  30484. $650 = (($$0198) + 40)|0;
  30485. $651 = ($649>>>0)>($650>>>0);
  30486. $$$4236$i = $651 ? $649 : $$4236$i;
  30487. $$$4230$i = $651 ? $642 : (-1);
  30488. if ($or$cond11$i) {
  30489. $$7$i = $$$4230$i;$$7239$i = $$$4236$i;
  30490. label = 194;
  30491. }
  30492. } else {
  30493. $$7$i = $$4230$i;$$7239$i = $$4236$i;
  30494. label = 194;
  30495. }
  30496. if ((label|0) == 194) {
  30497. $652 = ($$7$i|0)==((-1)|0);
  30498. if (!($652)) {
  30499. $653 = HEAP32[(35892)>>2]|0;
  30500. $654 = (($653) + ($$7239$i))|0;
  30501. HEAP32[(35892)>>2] = $654;
  30502. $655 = HEAP32[(35896)>>2]|0;
  30503. $656 = ($654>>>0)>($655>>>0);
  30504. if ($656) {
  30505. HEAP32[(35896)>>2] = $654;
  30506. }
  30507. $657 = HEAP32[(35484)>>2]|0;
  30508. $658 = ($657|0)==(0|0);
  30509. do {
  30510. if ($658) {
  30511. $659 = HEAP32[(35476)>>2]|0;
  30512. $660 = ($659|0)==(0|0);
  30513. $661 = ($$7$i>>>0)<($659>>>0);
  30514. $or$cond12$i = $660 | $661;
  30515. if ($or$cond12$i) {
  30516. HEAP32[(35476)>>2] = $$7$i;
  30517. }
  30518. HEAP32[(35936)>>2] = $$7$i;
  30519. HEAP32[(35940)>>2] = $$7239$i;
  30520. HEAP32[(35948)>>2] = 0;
  30521. $662 = HEAP32[8852]|0;
  30522. HEAP32[(35496)>>2] = $662;
  30523. HEAP32[(35492)>>2] = -1;
  30524. $$01$i$i = 0;
  30525. while(1) {
  30526. $663 = $$01$i$i << 1;
  30527. $664 = (35500 + ($663<<2)|0);
  30528. $665 = ((($664)) + 12|0);
  30529. HEAP32[$665>>2] = $664;
  30530. $666 = ((($664)) + 8|0);
  30531. HEAP32[$666>>2] = $664;
  30532. $667 = (($$01$i$i) + 1)|0;
  30533. $exitcond$i$i = ($667|0)==(32);
  30534. if ($exitcond$i$i) {
  30535. break;
  30536. } else {
  30537. $$01$i$i = $667;
  30538. }
  30539. }
  30540. $668 = (($$7239$i) + -40)|0;
  30541. $669 = ((($$7$i)) + 8|0);
  30542. $670 = $669;
  30543. $671 = $670 & 7;
  30544. $672 = ($671|0)==(0);
  30545. $673 = (0 - ($670))|0;
  30546. $674 = $673 & 7;
  30547. $675 = $672 ? 0 : $674;
  30548. $676 = (($$7$i) + ($675)|0);
  30549. $677 = (($668) - ($675))|0;
  30550. HEAP32[(35484)>>2] = $676;
  30551. HEAP32[(35472)>>2] = $677;
  30552. $678 = $677 | 1;
  30553. $679 = ((($676)) + 4|0);
  30554. HEAP32[$679>>2] = $678;
  30555. $680 = (($676) + ($677)|0);
  30556. $681 = ((($680)) + 4|0);
  30557. HEAP32[$681>>2] = 40;
  30558. $682 = HEAP32[(35424)>>2]|0;
  30559. HEAP32[(35488)>>2] = $682;
  30560. } else {
  30561. $$024363$i = (35936);
  30562. while(1) {
  30563. $683 = HEAP32[$$024363$i>>2]|0;
  30564. $684 = ((($$024363$i)) + 4|0);
  30565. $685 = HEAP32[$684>>2]|0;
  30566. $686 = (($683) + ($685)|0);
  30567. $687 = ($$7$i|0)==($686|0);
  30568. if ($687) {
  30569. label = 205;
  30570. break;
  30571. }
  30572. $688 = ((($$024363$i)) + 8|0);
  30573. $689 = HEAP32[$688>>2]|0;
  30574. $690 = ($689|0)==(0|0);
  30575. if ($690) {
  30576. break;
  30577. } else {
  30578. $$024363$i = $689;
  30579. }
  30580. }
  30581. if ((label|0) == 205) {
  30582. $691 = ((($$024363$i)) + 12|0);
  30583. $692 = HEAP32[$691>>2]|0;
  30584. $693 = $692 & 8;
  30585. $694 = ($693|0)==(0);
  30586. if ($694) {
  30587. $695 = ($657>>>0)>=($683>>>0);
  30588. $696 = ($657>>>0)<($$7$i>>>0);
  30589. $or$cond43$i = $696 & $695;
  30590. if ($or$cond43$i) {
  30591. $697 = (($685) + ($$7239$i))|0;
  30592. HEAP32[$684>>2] = $697;
  30593. $698 = HEAP32[(35472)>>2]|0;
  30594. $699 = ((($657)) + 8|0);
  30595. $700 = $699;
  30596. $701 = $700 & 7;
  30597. $702 = ($701|0)==(0);
  30598. $703 = (0 - ($700))|0;
  30599. $704 = $703 & 7;
  30600. $705 = $702 ? 0 : $704;
  30601. $706 = (($657) + ($705)|0);
  30602. $707 = (($$7239$i) - ($705))|0;
  30603. $708 = (($698) + ($707))|0;
  30604. HEAP32[(35484)>>2] = $706;
  30605. HEAP32[(35472)>>2] = $708;
  30606. $709 = $708 | 1;
  30607. $710 = ((($706)) + 4|0);
  30608. HEAP32[$710>>2] = $709;
  30609. $711 = (($706) + ($708)|0);
  30610. $712 = ((($711)) + 4|0);
  30611. HEAP32[$712>>2] = 40;
  30612. $713 = HEAP32[(35424)>>2]|0;
  30613. HEAP32[(35488)>>2] = $713;
  30614. break;
  30615. }
  30616. }
  30617. }
  30618. $714 = HEAP32[(35476)>>2]|0;
  30619. $715 = ($$7$i>>>0)<($714>>>0);
  30620. if ($715) {
  30621. HEAP32[(35476)>>2] = $$7$i;
  30622. $779 = $$7$i;
  30623. } else {
  30624. $779 = $714;
  30625. }
  30626. $716 = (($$7$i) + ($$7239$i)|0);
  30627. $$124462$i = (35936);
  30628. while(1) {
  30629. $717 = HEAP32[$$124462$i>>2]|0;
  30630. $718 = ($717|0)==($716|0);
  30631. if ($718) {
  30632. label = 213;
  30633. break;
  30634. }
  30635. $719 = ((($$124462$i)) + 8|0);
  30636. $720 = HEAP32[$719>>2]|0;
  30637. $721 = ($720|0)==(0|0);
  30638. if ($721) {
  30639. break;
  30640. } else {
  30641. $$124462$i = $720;
  30642. }
  30643. }
  30644. if ((label|0) == 213) {
  30645. $722 = ((($$124462$i)) + 12|0);
  30646. $723 = HEAP32[$722>>2]|0;
  30647. $724 = $723 & 8;
  30648. $725 = ($724|0)==(0);
  30649. if ($725) {
  30650. HEAP32[$$124462$i>>2] = $$7$i;
  30651. $726 = ((($$124462$i)) + 4|0);
  30652. $727 = HEAP32[$726>>2]|0;
  30653. $728 = (($727) + ($$7239$i))|0;
  30654. HEAP32[$726>>2] = $728;
  30655. $729 = ((($$7$i)) + 8|0);
  30656. $730 = $729;
  30657. $731 = $730 & 7;
  30658. $732 = ($731|0)==(0);
  30659. $733 = (0 - ($730))|0;
  30660. $734 = $733 & 7;
  30661. $735 = $732 ? 0 : $734;
  30662. $736 = (($$7$i) + ($735)|0);
  30663. $737 = ((($716)) + 8|0);
  30664. $738 = $737;
  30665. $739 = $738 & 7;
  30666. $740 = ($739|0)==(0);
  30667. $741 = (0 - ($738))|0;
  30668. $742 = $741 & 7;
  30669. $743 = $740 ? 0 : $742;
  30670. $744 = (($716) + ($743)|0);
  30671. $745 = $744;
  30672. $746 = $736;
  30673. $747 = (($745) - ($746))|0;
  30674. $748 = (($736) + ($$0198)|0);
  30675. $749 = (($747) - ($$0198))|0;
  30676. $750 = $$0198 | 3;
  30677. $751 = ((($736)) + 4|0);
  30678. HEAP32[$751>>2] = $750;
  30679. $752 = ($744|0)==($657|0);
  30680. do {
  30681. if ($752) {
  30682. $753 = HEAP32[(35472)>>2]|0;
  30683. $754 = (($753) + ($749))|0;
  30684. HEAP32[(35472)>>2] = $754;
  30685. HEAP32[(35484)>>2] = $748;
  30686. $755 = $754 | 1;
  30687. $756 = ((($748)) + 4|0);
  30688. HEAP32[$756>>2] = $755;
  30689. } else {
  30690. $757 = HEAP32[(35480)>>2]|0;
  30691. $758 = ($744|0)==($757|0);
  30692. if ($758) {
  30693. $759 = HEAP32[(35468)>>2]|0;
  30694. $760 = (($759) + ($749))|0;
  30695. HEAP32[(35468)>>2] = $760;
  30696. HEAP32[(35480)>>2] = $748;
  30697. $761 = $760 | 1;
  30698. $762 = ((($748)) + 4|0);
  30699. HEAP32[$762>>2] = $761;
  30700. $763 = (($748) + ($760)|0);
  30701. HEAP32[$763>>2] = $760;
  30702. break;
  30703. }
  30704. $764 = ((($744)) + 4|0);
  30705. $765 = HEAP32[$764>>2]|0;
  30706. $766 = $765 & 3;
  30707. $767 = ($766|0)==(1);
  30708. if ($767) {
  30709. $768 = $765 & -8;
  30710. $769 = $765 >>> 3;
  30711. $770 = ($765>>>0)<(256);
  30712. L329: do {
  30713. if ($770) {
  30714. $771 = ((($744)) + 8|0);
  30715. $772 = HEAP32[$771>>2]|0;
  30716. $773 = ((($744)) + 12|0);
  30717. $774 = HEAP32[$773>>2]|0;
  30718. $775 = $769 << 1;
  30719. $776 = (35500 + ($775<<2)|0);
  30720. $777 = ($772|0)==($776|0);
  30721. do {
  30722. if (!($777)) {
  30723. $778 = ($772>>>0)<($779>>>0);
  30724. if ($778) {
  30725. _abort();
  30726. // unreachable;
  30727. }
  30728. $780 = ((($772)) + 12|0);
  30729. $781 = HEAP32[$780>>2]|0;
  30730. $782 = ($781|0)==($744|0);
  30731. if ($782) {
  30732. break;
  30733. }
  30734. _abort();
  30735. // unreachable;
  30736. }
  30737. } while(0);
  30738. $783 = ($774|0)==($772|0);
  30739. if ($783) {
  30740. $784 = 1 << $769;
  30741. $785 = $784 ^ -1;
  30742. $786 = HEAP32[8865]|0;
  30743. $787 = $786 & $785;
  30744. HEAP32[8865] = $787;
  30745. break;
  30746. }
  30747. $788 = ($774|0)==($776|0);
  30748. do {
  30749. if ($788) {
  30750. $$pre10$i$i = ((($774)) + 8|0);
  30751. $$pre$phi11$i$iZ2D = $$pre10$i$i;
  30752. } else {
  30753. $789 = ($774>>>0)<($779>>>0);
  30754. if ($789) {
  30755. _abort();
  30756. // unreachable;
  30757. }
  30758. $790 = ((($774)) + 8|0);
  30759. $791 = HEAP32[$790>>2]|0;
  30760. $792 = ($791|0)==($744|0);
  30761. if ($792) {
  30762. $$pre$phi11$i$iZ2D = $790;
  30763. break;
  30764. }
  30765. _abort();
  30766. // unreachable;
  30767. }
  30768. } while(0);
  30769. $793 = ((($772)) + 12|0);
  30770. HEAP32[$793>>2] = $774;
  30771. HEAP32[$$pre$phi11$i$iZ2D>>2] = $772;
  30772. } else {
  30773. $794 = ((($744)) + 24|0);
  30774. $795 = HEAP32[$794>>2]|0;
  30775. $796 = ((($744)) + 12|0);
  30776. $797 = HEAP32[$796>>2]|0;
  30777. $798 = ($797|0)==($744|0);
  30778. do {
  30779. if ($798) {
  30780. $808 = ((($744)) + 16|0);
  30781. $809 = ((($808)) + 4|0);
  30782. $810 = HEAP32[$809>>2]|0;
  30783. $811 = ($810|0)==(0|0);
  30784. if ($811) {
  30785. $812 = HEAP32[$808>>2]|0;
  30786. $813 = ($812|0)==(0|0);
  30787. if ($813) {
  30788. $$3$i$i = 0;
  30789. break;
  30790. } else {
  30791. $$1291$i$i = $812;$$1293$i$i = $808;
  30792. }
  30793. } else {
  30794. $$1291$i$i = $810;$$1293$i$i = $809;
  30795. }
  30796. while(1) {
  30797. $814 = ((($$1291$i$i)) + 20|0);
  30798. $815 = HEAP32[$814>>2]|0;
  30799. $816 = ($815|0)==(0|0);
  30800. if (!($816)) {
  30801. $$1291$i$i = $815;$$1293$i$i = $814;
  30802. continue;
  30803. }
  30804. $817 = ((($$1291$i$i)) + 16|0);
  30805. $818 = HEAP32[$817>>2]|0;
  30806. $819 = ($818|0)==(0|0);
  30807. if ($819) {
  30808. break;
  30809. } else {
  30810. $$1291$i$i = $818;$$1293$i$i = $817;
  30811. }
  30812. }
  30813. $820 = ($$1293$i$i>>>0)<($779>>>0);
  30814. if ($820) {
  30815. _abort();
  30816. // unreachable;
  30817. } else {
  30818. HEAP32[$$1293$i$i>>2] = 0;
  30819. $$3$i$i = $$1291$i$i;
  30820. break;
  30821. }
  30822. } else {
  30823. $799 = ((($744)) + 8|0);
  30824. $800 = HEAP32[$799>>2]|0;
  30825. $801 = ($800>>>0)<($779>>>0);
  30826. if ($801) {
  30827. _abort();
  30828. // unreachable;
  30829. }
  30830. $802 = ((($800)) + 12|0);
  30831. $803 = HEAP32[$802>>2]|0;
  30832. $804 = ($803|0)==($744|0);
  30833. if (!($804)) {
  30834. _abort();
  30835. // unreachable;
  30836. }
  30837. $805 = ((($797)) + 8|0);
  30838. $806 = HEAP32[$805>>2]|0;
  30839. $807 = ($806|0)==($744|0);
  30840. if ($807) {
  30841. HEAP32[$802>>2] = $797;
  30842. HEAP32[$805>>2] = $800;
  30843. $$3$i$i = $797;
  30844. break;
  30845. } else {
  30846. _abort();
  30847. // unreachable;
  30848. }
  30849. }
  30850. } while(0);
  30851. $821 = ($795|0)==(0|0);
  30852. if ($821) {
  30853. break;
  30854. }
  30855. $822 = ((($744)) + 28|0);
  30856. $823 = HEAP32[$822>>2]|0;
  30857. $824 = (35764 + ($823<<2)|0);
  30858. $825 = HEAP32[$824>>2]|0;
  30859. $826 = ($744|0)==($825|0);
  30860. do {
  30861. if ($826) {
  30862. HEAP32[$824>>2] = $$3$i$i;
  30863. $cond$i$i = ($$3$i$i|0)==(0|0);
  30864. if (!($cond$i$i)) {
  30865. break;
  30866. }
  30867. $827 = 1 << $823;
  30868. $828 = $827 ^ -1;
  30869. $829 = HEAP32[(35464)>>2]|0;
  30870. $830 = $829 & $828;
  30871. HEAP32[(35464)>>2] = $830;
  30872. break L329;
  30873. } else {
  30874. $831 = HEAP32[(35476)>>2]|0;
  30875. $832 = ($795>>>0)<($831>>>0);
  30876. if ($832) {
  30877. _abort();
  30878. // unreachable;
  30879. } else {
  30880. $833 = ((($795)) + 16|0);
  30881. $834 = HEAP32[$833>>2]|0;
  30882. $not$$i$i = ($834|0)!=($744|0);
  30883. $$sink1$i$i = $not$$i$i&1;
  30884. $835 = (((($795)) + 16|0) + ($$sink1$i$i<<2)|0);
  30885. HEAP32[$835>>2] = $$3$i$i;
  30886. $836 = ($$3$i$i|0)==(0|0);
  30887. if ($836) {
  30888. break L329;
  30889. } else {
  30890. break;
  30891. }
  30892. }
  30893. }
  30894. } while(0);
  30895. $837 = HEAP32[(35476)>>2]|0;
  30896. $838 = ($$3$i$i>>>0)<($837>>>0);
  30897. if ($838) {
  30898. _abort();
  30899. // unreachable;
  30900. }
  30901. $839 = ((($$3$i$i)) + 24|0);
  30902. HEAP32[$839>>2] = $795;
  30903. $840 = ((($744)) + 16|0);
  30904. $841 = HEAP32[$840>>2]|0;
  30905. $842 = ($841|0)==(0|0);
  30906. do {
  30907. if (!($842)) {
  30908. $843 = ($841>>>0)<($837>>>0);
  30909. if ($843) {
  30910. _abort();
  30911. // unreachable;
  30912. } else {
  30913. $844 = ((($$3$i$i)) + 16|0);
  30914. HEAP32[$844>>2] = $841;
  30915. $845 = ((($841)) + 24|0);
  30916. HEAP32[$845>>2] = $$3$i$i;
  30917. break;
  30918. }
  30919. }
  30920. } while(0);
  30921. $846 = ((($840)) + 4|0);
  30922. $847 = HEAP32[$846>>2]|0;
  30923. $848 = ($847|0)==(0|0);
  30924. if ($848) {
  30925. break;
  30926. }
  30927. $849 = HEAP32[(35476)>>2]|0;
  30928. $850 = ($847>>>0)<($849>>>0);
  30929. if ($850) {
  30930. _abort();
  30931. // unreachable;
  30932. } else {
  30933. $851 = ((($$3$i$i)) + 20|0);
  30934. HEAP32[$851>>2] = $847;
  30935. $852 = ((($847)) + 24|0);
  30936. HEAP32[$852>>2] = $$3$i$i;
  30937. break;
  30938. }
  30939. }
  30940. } while(0);
  30941. $853 = (($744) + ($768)|0);
  30942. $854 = (($768) + ($749))|0;
  30943. $$0$i17$i = $853;$$0287$i$i = $854;
  30944. } else {
  30945. $$0$i17$i = $744;$$0287$i$i = $749;
  30946. }
  30947. $855 = ((($$0$i17$i)) + 4|0);
  30948. $856 = HEAP32[$855>>2]|0;
  30949. $857 = $856 & -2;
  30950. HEAP32[$855>>2] = $857;
  30951. $858 = $$0287$i$i | 1;
  30952. $859 = ((($748)) + 4|0);
  30953. HEAP32[$859>>2] = $858;
  30954. $860 = (($748) + ($$0287$i$i)|0);
  30955. HEAP32[$860>>2] = $$0287$i$i;
  30956. $861 = $$0287$i$i >>> 3;
  30957. $862 = ($$0287$i$i>>>0)<(256);
  30958. if ($862) {
  30959. $863 = $861 << 1;
  30960. $864 = (35500 + ($863<<2)|0);
  30961. $865 = HEAP32[8865]|0;
  30962. $866 = 1 << $861;
  30963. $867 = $865 & $866;
  30964. $868 = ($867|0)==(0);
  30965. do {
  30966. if ($868) {
  30967. $869 = $865 | $866;
  30968. HEAP32[8865] = $869;
  30969. $$pre$i$i = ((($864)) + 8|0);
  30970. $$0295$i$i = $864;$$pre$phi$i$iZ2D = $$pre$i$i;
  30971. } else {
  30972. $870 = ((($864)) + 8|0);
  30973. $871 = HEAP32[$870>>2]|0;
  30974. $872 = HEAP32[(35476)>>2]|0;
  30975. $873 = ($871>>>0)<($872>>>0);
  30976. if (!($873)) {
  30977. $$0295$i$i = $871;$$pre$phi$i$iZ2D = $870;
  30978. break;
  30979. }
  30980. _abort();
  30981. // unreachable;
  30982. }
  30983. } while(0);
  30984. HEAP32[$$pre$phi$i$iZ2D>>2] = $748;
  30985. $874 = ((($$0295$i$i)) + 12|0);
  30986. HEAP32[$874>>2] = $748;
  30987. $875 = ((($748)) + 8|0);
  30988. HEAP32[$875>>2] = $$0295$i$i;
  30989. $876 = ((($748)) + 12|0);
  30990. HEAP32[$876>>2] = $864;
  30991. break;
  30992. }
  30993. $877 = $$0287$i$i >>> 8;
  30994. $878 = ($877|0)==(0);
  30995. do {
  30996. if ($878) {
  30997. $$0296$i$i = 0;
  30998. } else {
  30999. $879 = ($$0287$i$i>>>0)>(16777215);
  31000. if ($879) {
  31001. $$0296$i$i = 31;
  31002. break;
  31003. }
  31004. $880 = (($877) + 1048320)|0;
  31005. $881 = $880 >>> 16;
  31006. $882 = $881 & 8;
  31007. $883 = $877 << $882;
  31008. $884 = (($883) + 520192)|0;
  31009. $885 = $884 >>> 16;
  31010. $886 = $885 & 4;
  31011. $887 = $886 | $882;
  31012. $888 = $883 << $886;
  31013. $889 = (($888) + 245760)|0;
  31014. $890 = $889 >>> 16;
  31015. $891 = $890 & 2;
  31016. $892 = $887 | $891;
  31017. $893 = (14 - ($892))|0;
  31018. $894 = $888 << $891;
  31019. $895 = $894 >>> 15;
  31020. $896 = (($893) + ($895))|0;
  31021. $897 = $896 << 1;
  31022. $898 = (($896) + 7)|0;
  31023. $899 = $$0287$i$i >>> $898;
  31024. $900 = $899 & 1;
  31025. $901 = $900 | $897;
  31026. $$0296$i$i = $901;
  31027. }
  31028. } while(0);
  31029. $902 = (35764 + ($$0296$i$i<<2)|0);
  31030. $903 = ((($748)) + 28|0);
  31031. HEAP32[$903>>2] = $$0296$i$i;
  31032. $904 = ((($748)) + 16|0);
  31033. $905 = ((($904)) + 4|0);
  31034. HEAP32[$905>>2] = 0;
  31035. HEAP32[$904>>2] = 0;
  31036. $906 = HEAP32[(35464)>>2]|0;
  31037. $907 = 1 << $$0296$i$i;
  31038. $908 = $906 & $907;
  31039. $909 = ($908|0)==(0);
  31040. if ($909) {
  31041. $910 = $906 | $907;
  31042. HEAP32[(35464)>>2] = $910;
  31043. HEAP32[$902>>2] = $748;
  31044. $911 = ((($748)) + 24|0);
  31045. HEAP32[$911>>2] = $902;
  31046. $912 = ((($748)) + 12|0);
  31047. HEAP32[$912>>2] = $748;
  31048. $913 = ((($748)) + 8|0);
  31049. HEAP32[$913>>2] = $748;
  31050. break;
  31051. }
  31052. $914 = HEAP32[$902>>2]|0;
  31053. $915 = ($$0296$i$i|0)==(31);
  31054. $916 = $$0296$i$i >>> 1;
  31055. $917 = (25 - ($916))|0;
  31056. $918 = $915 ? 0 : $917;
  31057. $919 = $$0287$i$i << $918;
  31058. $$0288$i$i = $919;$$0289$i$i = $914;
  31059. while(1) {
  31060. $920 = ((($$0289$i$i)) + 4|0);
  31061. $921 = HEAP32[$920>>2]|0;
  31062. $922 = $921 & -8;
  31063. $923 = ($922|0)==($$0287$i$i|0);
  31064. if ($923) {
  31065. label = 280;
  31066. break;
  31067. }
  31068. $924 = $$0288$i$i >>> 31;
  31069. $925 = (((($$0289$i$i)) + 16|0) + ($924<<2)|0);
  31070. $926 = $$0288$i$i << 1;
  31071. $927 = HEAP32[$925>>2]|0;
  31072. $928 = ($927|0)==(0|0);
  31073. if ($928) {
  31074. label = 277;
  31075. break;
  31076. } else {
  31077. $$0288$i$i = $926;$$0289$i$i = $927;
  31078. }
  31079. }
  31080. if ((label|0) == 277) {
  31081. $929 = HEAP32[(35476)>>2]|0;
  31082. $930 = ($925>>>0)<($929>>>0);
  31083. if ($930) {
  31084. _abort();
  31085. // unreachable;
  31086. } else {
  31087. HEAP32[$925>>2] = $748;
  31088. $931 = ((($748)) + 24|0);
  31089. HEAP32[$931>>2] = $$0289$i$i;
  31090. $932 = ((($748)) + 12|0);
  31091. HEAP32[$932>>2] = $748;
  31092. $933 = ((($748)) + 8|0);
  31093. HEAP32[$933>>2] = $748;
  31094. break;
  31095. }
  31096. }
  31097. else if ((label|0) == 280) {
  31098. $934 = ((($$0289$i$i)) + 8|0);
  31099. $935 = HEAP32[$934>>2]|0;
  31100. $936 = HEAP32[(35476)>>2]|0;
  31101. $937 = ($935>>>0)>=($936>>>0);
  31102. $not$7$i$i = ($$0289$i$i>>>0)>=($936>>>0);
  31103. $938 = $937 & $not$7$i$i;
  31104. if ($938) {
  31105. $939 = ((($935)) + 12|0);
  31106. HEAP32[$939>>2] = $748;
  31107. HEAP32[$934>>2] = $748;
  31108. $940 = ((($748)) + 8|0);
  31109. HEAP32[$940>>2] = $935;
  31110. $941 = ((($748)) + 12|0);
  31111. HEAP32[$941>>2] = $$0289$i$i;
  31112. $942 = ((($748)) + 24|0);
  31113. HEAP32[$942>>2] = 0;
  31114. break;
  31115. } else {
  31116. _abort();
  31117. // unreachable;
  31118. }
  31119. }
  31120. }
  31121. } while(0);
  31122. $1074 = ((($736)) + 8|0);
  31123. $$2 = $1074;
  31124. break L230;
  31125. }
  31126. }
  31127. $$0$i$i$i = (35936);
  31128. while(1) {
  31129. $943 = HEAP32[$$0$i$i$i>>2]|0;
  31130. $944 = ($943>>>0)>($657>>>0);
  31131. if (!($944)) {
  31132. $945 = ((($$0$i$i$i)) + 4|0);
  31133. $946 = HEAP32[$945>>2]|0;
  31134. $947 = (($943) + ($946)|0);
  31135. $948 = ($947>>>0)>($657>>>0);
  31136. if ($948) {
  31137. break;
  31138. }
  31139. }
  31140. $949 = ((($$0$i$i$i)) + 8|0);
  31141. $950 = HEAP32[$949>>2]|0;
  31142. $$0$i$i$i = $950;
  31143. }
  31144. $951 = ((($947)) + -47|0);
  31145. $952 = ((($951)) + 8|0);
  31146. $953 = $952;
  31147. $954 = $953 & 7;
  31148. $955 = ($954|0)==(0);
  31149. $956 = (0 - ($953))|0;
  31150. $957 = $956 & 7;
  31151. $958 = $955 ? 0 : $957;
  31152. $959 = (($951) + ($958)|0);
  31153. $960 = ((($657)) + 16|0);
  31154. $961 = ($959>>>0)<($960>>>0);
  31155. $962 = $961 ? $657 : $959;
  31156. $963 = ((($962)) + 8|0);
  31157. $964 = ((($962)) + 24|0);
  31158. $965 = (($$7239$i) + -40)|0;
  31159. $966 = ((($$7$i)) + 8|0);
  31160. $967 = $966;
  31161. $968 = $967 & 7;
  31162. $969 = ($968|0)==(0);
  31163. $970 = (0 - ($967))|0;
  31164. $971 = $970 & 7;
  31165. $972 = $969 ? 0 : $971;
  31166. $973 = (($$7$i) + ($972)|0);
  31167. $974 = (($965) - ($972))|0;
  31168. HEAP32[(35484)>>2] = $973;
  31169. HEAP32[(35472)>>2] = $974;
  31170. $975 = $974 | 1;
  31171. $976 = ((($973)) + 4|0);
  31172. HEAP32[$976>>2] = $975;
  31173. $977 = (($973) + ($974)|0);
  31174. $978 = ((($977)) + 4|0);
  31175. HEAP32[$978>>2] = 40;
  31176. $979 = HEAP32[(35424)>>2]|0;
  31177. HEAP32[(35488)>>2] = $979;
  31178. $980 = ((($962)) + 4|0);
  31179. HEAP32[$980>>2] = 27;
  31180. ;HEAP32[$963>>2]=HEAP32[(35936)>>2]|0;HEAP32[$963+4>>2]=HEAP32[(35936)+4>>2]|0;HEAP32[$963+8>>2]=HEAP32[(35936)+8>>2]|0;HEAP32[$963+12>>2]=HEAP32[(35936)+12>>2]|0;
  31181. HEAP32[(35936)>>2] = $$7$i;
  31182. HEAP32[(35940)>>2] = $$7239$i;
  31183. HEAP32[(35948)>>2] = 0;
  31184. HEAP32[(35944)>>2] = $963;
  31185. $982 = $964;
  31186. while(1) {
  31187. $981 = ((($982)) + 4|0);
  31188. HEAP32[$981>>2] = 7;
  31189. $983 = ((($982)) + 8|0);
  31190. $984 = ($983>>>0)<($947>>>0);
  31191. if ($984) {
  31192. $982 = $981;
  31193. } else {
  31194. break;
  31195. }
  31196. }
  31197. $985 = ($962|0)==($657|0);
  31198. if (!($985)) {
  31199. $986 = $962;
  31200. $987 = $657;
  31201. $988 = (($986) - ($987))|0;
  31202. $989 = HEAP32[$980>>2]|0;
  31203. $990 = $989 & -2;
  31204. HEAP32[$980>>2] = $990;
  31205. $991 = $988 | 1;
  31206. $992 = ((($657)) + 4|0);
  31207. HEAP32[$992>>2] = $991;
  31208. HEAP32[$962>>2] = $988;
  31209. $993 = $988 >>> 3;
  31210. $994 = ($988>>>0)<(256);
  31211. if ($994) {
  31212. $995 = $993 << 1;
  31213. $996 = (35500 + ($995<<2)|0);
  31214. $997 = HEAP32[8865]|0;
  31215. $998 = 1 << $993;
  31216. $999 = $997 & $998;
  31217. $1000 = ($999|0)==(0);
  31218. do {
  31219. if ($1000) {
  31220. $1001 = $997 | $998;
  31221. HEAP32[8865] = $1001;
  31222. $$pre$i18$i = ((($996)) + 8|0);
  31223. $$0211$i$i = $996;$$pre$phi$i19$iZ2D = $$pre$i18$i;
  31224. } else {
  31225. $1002 = ((($996)) + 8|0);
  31226. $1003 = HEAP32[$1002>>2]|0;
  31227. $1004 = HEAP32[(35476)>>2]|0;
  31228. $1005 = ($1003>>>0)<($1004>>>0);
  31229. if (!($1005)) {
  31230. $$0211$i$i = $1003;$$pre$phi$i19$iZ2D = $1002;
  31231. break;
  31232. }
  31233. _abort();
  31234. // unreachable;
  31235. }
  31236. } while(0);
  31237. HEAP32[$$pre$phi$i19$iZ2D>>2] = $657;
  31238. $1006 = ((($$0211$i$i)) + 12|0);
  31239. HEAP32[$1006>>2] = $657;
  31240. $1007 = ((($657)) + 8|0);
  31241. HEAP32[$1007>>2] = $$0211$i$i;
  31242. $1008 = ((($657)) + 12|0);
  31243. HEAP32[$1008>>2] = $996;
  31244. break;
  31245. }
  31246. $1009 = $988 >>> 8;
  31247. $1010 = ($1009|0)==(0);
  31248. do {
  31249. if ($1010) {
  31250. $$0212$i$i = 0;
  31251. } else {
  31252. $1011 = ($988>>>0)>(16777215);
  31253. if ($1011) {
  31254. $$0212$i$i = 31;
  31255. break;
  31256. }
  31257. $1012 = (($1009) + 1048320)|0;
  31258. $1013 = $1012 >>> 16;
  31259. $1014 = $1013 & 8;
  31260. $1015 = $1009 << $1014;
  31261. $1016 = (($1015) + 520192)|0;
  31262. $1017 = $1016 >>> 16;
  31263. $1018 = $1017 & 4;
  31264. $1019 = $1018 | $1014;
  31265. $1020 = $1015 << $1018;
  31266. $1021 = (($1020) + 245760)|0;
  31267. $1022 = $1021 >>> 16;
  31268. $1023 = $1022 & 2;
  31269. $1024 = $1019 | $1023;
  31270. $1025 = (14 - ($1024))|0;
  31271. $1026 = $1020 << $1023;
  31272. $1027 = $1026 >>> 15;
  31273. $1028 = (($1025) + ($1027))|0;
  31274. $1029 = $1028 << 1;
  31275. $1030 = (($1028) + 7)|0;
  31276. $1031 = $988 >>> $1030;
  31277. $1032 = $1031 & 1;
  31278. $1033 = $1032 | $1029;
  31279. $$0212$i$i = $1033;
  31280. }
  31281. } while(0);
  31282. $1034 = (35764 + ($$0212$i$i<<2)|0);
  31283. $1035 = ((($657)) + 28|0);
  31284. HEAP32[$1035>>2] = $$0212$i$i;
  31285. $1036 = ((($657)) + 20|0);
  31286. HEAP32[$1036>>2] = 0;
  31287. HEAP32[$960>>2] = 0;
  31288. $1037 = HEAP32[(35464)>>2]|0;
  31289. $1038 = 1 << $$0212$i$i;
  31290. $1039 = $1037 & $1038;
  31291. $1040 = ($1039|0)==(0);
  31292. if ($1040) {
  31293. $1041 = $1037 | $1038;
  31294. HEAP32[(35464)>>2] = $1041;
  31295. HEAP32[$1034>>2] = $657;
  31296. $1042 = ((($657)) + 24|0);
  31297. HEAP32[$1042>>2] = $1034;
  31298. $1043 = ((($657)) + 12|0);
  31299. HEAP32[$1043>>2] = $657;
  31300. $1044 = ((($657)) + 8|0);
  31301. HEAP32[$1044>>2] = $657;
  31302. break;
  31303. }
  31304. $1045 = HEAP32[$1034>>2]|0;
  31305. $1046 = ($$0212$i$i|0)==(31);
  31306. $1047 = $$0212$i$i >>> 1;
  31307. $1048 = (25 - ($1047))|0;
  31308. $1049 = $1046 ? 0 : $1048;
  31309. $1050 = $988 << $1049;
  31310. $$0206$i$i = $1050;$$0207$i$i = $1045;
  31311. while(1) {
  31312. $1051 = ((($$0207$i$i)) + 4|0);
  31313. $1052 = HEAP32[$1051>>2]|0;
  31314. $1053 = $1052 & -8;
  31315. $1054 = ($1053|0)==($988|0);
  31316. if ($1054) {
  31317. label = 307;
  31318. break;
  31319. }
  31320. $1055 = $$0206$i$i >>> 31;
  31321. $1056 = (((($$0207$i$i)) + 16|0) + ($1055<<2)|0);
  31322. $1057 = $$0206$i$i << 1;
  31323. $1058 = HEAP32[$1056>>2]|0;
  31324. $1059 = ($1058|0)==(0|0);
  31325. if ($1059) {
  31326. label = 304;
  31327. break;
  31328. } else {
  31329. $$0206$i$i = $1057;$$0207$i$i = $1058;
  31330. }
  31331. }
  31332. if ((label|0) == 304) {
  31333. $1060 = HEAP32[(35476)>>2]|0;
  31334. $1061 = ($1056>>>0)<($1060>>>0);
  31335. if ($1061) {
  31336. _abort();
  31337. // unreachable;
  31338. } else {
  31339. HEAP32[$1056>>2] = $657;
  31340. $1062 = ((($657)) + 24|0);
  31341. HEAP32[$1062>>2] = $$0207$i$i;
  31342. $1063 = ((($657)) + 12|0);
  31343. HEAP32[$1063>>2] = $657;
  31344. $1064 = ((($657)) + 8|0);
  31345. HEAP32[$1064>>2] = $657;
  31346. break;
  31347. }
  31348. }
  31349. else if ((label|0) == 307) {
  31350. $1065 = ((($$0207$i$i)) + 8|0);
  31351. $1066 = HEAP32[$1065>>2]|0;
  31352. $1067 = HEAP32[(35476)>>2]|0;
  31353. $1068 = ($1066>>>0)>=($1067>>>0);
  31354. $not$$i21$i = ($$0207$i$i>>>0)>=($1067>>>0);
  31355. $1069 = $1068 & $not$$i21$i;
  31356. if ($1069) {
  31357. $1070 = ((($1066)) + 12|0);
  31358. HEAP32[$1070>>2] = $657;
  31359. HEAP32[$1065>>2] = $657;
  31360. $1071 = ((($657)) + 8|0);
  31361. HEAP32[$1071>>2] = $1066;
  31362. $1072 = ((($657)) + 12|0);
  31363. HEAP32[$1072>>2] = $$0207$i$i;
  31364. $1073 = ((($657)) + 24|0);
  31365. HEAP32[$1073>>2] = 0;
  31366. break;
  31367. } else {
  31368. _abort();
  31369. // unreachable;
  31370. }
  31371. }
  31372. }
  31373. }
  31374. } while(0);
  31375. $1075 = HEAP32[(35472)>>2]|0;
  31376. $1076 = ($1075>>>0)>($$0198>>>0);
  31377. if ($1076) {
  31378. $1077 = (($1075) - ($$0198))|0;
  31379. HEAP32[(35472)>>2] = $1077;
  31380. $1078 = HEAP32[(35484)>>2]|0;
  31381. $1079 = (($1078) + ($$0198)|0);
  31382. HEAP32[(35484)>>2] = $1079;
  31383. $1080 = $1077 | 1;
  31384. $1081 = ((($1079)) + 4|0);
  31385. HEAP32[$1081>>2] = $1080;
  31386. $1082 = $$0198 | 3;
  31387. $1083 = ((($1078)) + 4|0);
  31388. HEAP32[$1083>>2] = $1082;
  31389. $1084 = ((($1078)) + 8|0);
  31390. $$2 = $1084;
  31391. break;
  31392. }
  31393. }
  31394. }
  31395. $1085 = (___errno_location()|0);
  31396. HEAP32[$1085>>2] = 12;
  31397. $$2 = 0;
  31398. } else {
  31399. $$2 = 0;
  31400. }
  31401. }
  31402. } while(0);
  31403. $1086 = HEAP32[(35904)>>2]|0;
  31404. $1087 = $1086 & 2;
  31405. $1088 = ($1087|0)==(0);
  31406. if ($1088) {
  31407. $$1 = $$2;
  31408. STACKTOP = sp;return ($$1|0);
  31409. }
  31410. (___pthread_mutex_unlock((35908))|0);
  31411. $$1 = $$2;
  31412. STACKTOP = sp;return ($$1|0);
  31413. }
  31414. function _free($0) {
  31415. $0 = $0|0;
  31416. var $$0212$i = 0, $$0212$in$i = 0, $$0383 = 0, $$0384 = 0, $$0396 = 0, $$0403 = 0, $$1 = 0, $$1382 = 0, $$1387 = 0, $$1390 = 0, $$1398 = 0, $$1402 = 0, $$2 = 0, $$3 = 0, $$3400 = 0, $$pre = 0, $$pre$phi443Z2D = 0, $$pre$phi445Z2D = 0, $$pre$phiZ2D = 0, $$pre442 = 0;
  31417. var $$pre444 = 0, $$sink3 = 0, $$sink5 = 0, $1 = 0, $10 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0, $11 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0;
  31418. var $114 = 0, $115 = 0, $116 = 0, $117 = 0, $118 = 0, $119 = 0, $12 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0, $129 = 0, $13 = 0, $130 = 0, $131 = 0;
  31419. var $132 = 0, $133 = 0, $134 = 0, $135 = 0, $136 = 0, $137 = 0, $138 = 0, $139 = 0, $14 = 0, $140 = 0, $141 = 0, $142 = 0, $143 = 0, $144 = 0, $145 = 0, $146 = 0, $147 = 0, $148 = 0, $149 = 0, $15 = 0;
  31420. var $150 = 0, $151 = 0, $152 = 0, $153 = 0, $154 = 0, $155 = 0, $156 = 0, $157 = 0, $158 = 0, $159 = 0, $16 = 0, $160 = 0, $161 = 0, $162 = 0, $163 = 0, $164 = 0, $165 = 0, $166 = 0, $167 = 0, $168 = 0;
  31421. var $169 = 0, $17 = 0, $170 = 0, $171 = 0, $172 = 0, $173 = 0, $174 = 0, $175 = 0, $176 = 0, $177 = 0, $178 = 0, $179 = 0, $18 = 0, $180 = 0, $181 = 0, $182 = 0, $183 = 0, $184 = 0, $185 = 0, $186 = 0;
  31422. var $187 = 0, $188 = 0, $189 = 0, $19 = 0, $190 = 0, $191 = 0, $192 = 0, $193 = 0, $194 = 0, $195 = 0, $196 = 0, $197 = 0, $198 = 0, $199 = 0, $2 = 0, $20 = 0, $200 = 0, $201 = 0, $202 = 0, $203 = 0;
  31423. var $204 = 0, $205 = 0, $206 = 0, $207 = 0, $208 = 0, $209 = 0, $21 = 0, $210 = 0, $211 = 0, $212 = 0, $213 = 0, $214 = 0, $215 = 0, $216 = 0, $217 = 0, $218 = 0, $219 = 0, $22 = 0, $220 = 0, $221 = 0;
  31424. var $222 = 0, $223 = 0, $224 = 0, $225 = 0, $226 = 0, $227 = 0, $228 = 0, $229 = 0, $23 = 0, $230 = 0, $231 = 0, $232 = 0, $233 = 0, $234 = 0, $235 = 0, $236 = 0, $237 = 0, $238 = 0, $239 = 0, $24 = 0;
  31425. var $240 = 0, $241 = 0, $242 = 0, $243 = 0, $244 = 0, $245 = 0, $246 = 0, $247 = 0, $248 = 0, $249 = 0, $25 = 0, $250 = 0, $251 = 0, $252 = 0, $253 = 0, $254 = 0, $255 = 0, $256 = 0, $257 = 0, $258 = 0;
  31426. var $259 = 0, $26 = 0, $260 = 0, $261 = 0, $262 = 0, $263 = 0, $264 = 0, $265 = 0, $266 = 0, $267 = 0, $268 = 0, $269 = 0, $27 = 0, $270 = 0, $271 = 0, $272 = 0, $273 = 0, $274 = 0, $275 = 0, $276 = 0;
  31427. var $277 = 0, $278 = 0, $279 = 0, $28 = 0, $280 = 0, $281 = 0, $282 = 0, $283 = 0, $284 = 0, $285 = 0, $286 = 0, $287 = 0, $288 = 0, $289 = 0, $29 = 0, $290 = 0, $291 = 0, $292 = 0, $293 = 0, $294 = 0;
  31428. var $295 = 0, $296 = 0, $297 = 0, $298 = 0, $299 = 0, $3 = 0, $30 = 0, $300 = 0, $301 = 0, $302 = 0, $303 = 0, $304 = 0, $305 = 0, $306 = 0, $307 = 0, $308 = 0, $309 = 0, $31 = 0, $310 = 0, $311 = 0;
  31429. var $312 = 0, $313 = 0, $314 = 0, $315 = 0, $316 = 0, $317 = 0, $318 = 0, $319 = 0, $32 = 0, $320 = 0, $321 = 0, $322 = 0, $323 = 0, $324 = 0, $325 = 0, $326 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0;
  31430. var $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0, $52 = 0, $53 = 0, $54 = 0;
  31431. var $55 = 0, $56 = 0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0, $61 = 0, $62 = 0, $63 = 0, $64 = 0, $65 = 0, $66 = 0, $67 = 0, $68 = 0, $69 = 0, $7 = 0, $70 = 0, $71 = 0, $72 = 0;
  31432. var $73 = 0, $74 = 0, $75 = 0, $76 = 0, $77 = 0, $78 = 0, $79 = 0, $8 = 0, $80 = 0, $81 = 0, $82 = 0, $83 = 0, $84 = 0, $85 = 0, $86 = 0, $87 = 0, $88 = 0, $89 = 0, $9 = 0, $90 = 0;
  31433. var $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $cond421 = 0, $cond422 = 0, $not$ = 0, $not$405 = 0, $not$437 = 0, label = 0, sp = 0;
  31434. sp = STACKTOP;
  31435. $1 = ($0|0)==(0|0);
  31436. if ($1) {
  31437. return;
  31438. }
  31439. $2 = ((($0)) + -8|0);
  31440. $3 = HEAP32[(35904)>>2]|0;
  31441. $4 = $3 & 2;
  31442. $5 = ($4|0)==(0);
  31443. if (!($5)) {
  31444. $6 = (___pthread_mutex_lock((35908))|0);
  31445. $7 = ($6|0)==(0);
  31446. if (!($7)) {
  31447. return;
  31448. }
  31449. }
  31450. $8 = HEAP32[(35476)>>2]|0;
  31451. $9 = ($2>>>0)<($8>>>0);
  31452. if ($9) {
  31453. _abort();
  31454. // unreachable;
  31455. }
  31456. $10 = ((($0)) + -4|0);
  31457. $11 = HEAP32[$10>>2]|0;
  31458. $12 = $11 & 3;
  31459. $13 = ($12|0)==(1);
  31460. if ($13) {
  31461. _abort();
  31462. // unreachable;
  31463. }
  31464. $14 = $11 & -8;
  31465. $15 = (($2) + ($14)|0);
  31466. $16 = $11 & 1;
  31467. $17 = ($16|0)==(0);
  31468. L14: do {
  31469. if ($17) {
  31470. $18 = HEAP32[$2>>2]|0;
  31471. $19 = ($12|0)==(0);
  31472. if (!($19)) {
  31473. $20 = (0 - ($18))|0;
  31474. $21 = (($2) + ($20)|0);
  31475. $22 = (($18) + ($14))|0;
  31476. $23 = ($21>>>0)<($8>>>0);
  31477. if ($23) {
  31478. _abort();
  31479. // unreachable;
  31480. }
  31481. $24 = HEAP32[(35480)>>2]|0;
  31482. $25 = ($21|0)==($24|0);
  31483. if ($25) {
  31484. $109 = ((($15)) + 4|0);
  31485. $110 = HEAP32[$109>>2]|0;
  31486. $111 = $110 & 3;
  31487. $112 = ($111|0)==(3);
  31488. if (!($112)) {
  31489. $$1 = $21;$$1382 = $22;$118 = $21;
  31490. label = 55;
  31491. break;
  31492. }
  31493. $113 = (($21) + ($22)|0);
  31494. $114 = ((($21)) + 4|0);
  31495. $115 = $22 | 1;
  31496. $116 = $110 & -2;
  31497. HEAP32[(35468)>>2] = $22;
  31498. HEAP32[$109>>2] = $116;
  31499. HEAP32[$114>>2] = $115;
  31500. HEAP32[$113>>2] = $22;
  31501. break;
  31502. }
  31503. $26 = $18 >>> 3;
  31504. $27 = ($18>>>0)<(256);
  31505. if ($27) {
  31506. $28 = ((($21)) + 8|0);
  31507. $29 = HEAP32[$28>>2]|0;
  31508. $30 = ((($21)) + 12|0);
  31509. $31 = HEAP32[$30>>2]|0;
  31510. $32 = $26 << 1;
  31511. $33 = (35500 + ($32<<2)|0);
  31512. $34 = ($29|0)==($33|0);
  31513. if (!($34)) {
  31514. $35 = ($29>>>0)<($8>>>0);
  31515. if ($35) {
  31516. _abort();
  31517. // unreachable;
  31518. }
  31519. $36 = ((($29)) + 12|0);
  31520. $37 = HEAP32[$36>>2]|0;
  31521. $38 = ($37|0)==($21|0);
  31522. if (!($38)) {
  31523. _abort();
  31524. // unreachable;
  31525. }
  31526. }
  31527. $39 = ($31|0)==($29|0);
  31528. if ($39) {
  31529. $40 = 1 << $26;
  31530. $41 = $40 ^ -1;
  31531. $42 = HEAP32[8865]|0;
  31532. $43 = $42 & $41;
  31533. HEAP32[8865] = $43;
  31534. $$1 = $21;$$1382 = $22;$118 = $21;
  31535. label = 55;
  31536. break;
  31537. }
  31538. $44 = ($31|0)==($33|0);
  31539. if ($44) {
  31540. $$pre444 = ((($31)) + 8|0);
  31541. $$pre$phi445Z2D = $$pre444;
  31542. } else {
  31543. $45 = ($31>>>0)<($8>>>0);
  31544. if ($45) {
  31545. _abort();
  31546. // unreachable;
  31547. }
  31548. $46 = ((($31)) + 8|0);
  31549. $47 = HEAP32[$46>>2]|0;
  31550. $48 = ($47|0)==($21|0);
  31551. if ($48) {
  31552. $$pre$phi445Z2D = $46;
  31553. } else {
  31554. _abort();
  31555. // unreachable;
  31556. }
  31557. }
  31558. $49 = ((($29)) + 12|0);
  31559. HEAP32[$49>>2] = $31;
  31560. HEAP32[$$pre$phi445Z2D>>2] = $29;
  31561. $$1 = $21;$$1382 = $22;$118 = $21;
  31562. label = 55;
  31563. break;
  31564. }
  31565. $50 = ((($21)) + 24|0);
  31566. $51 = HEAP32[$50>>2]|0;
  31567. $52 = ((($21)) + 12|0);
  31568. $53 = HEAP32[$52>>2]|0;
  31569. $54 = ($53|0)==($21|0);
  31570. do {
  31571. if ($54) {
  31572. $64 = ((($21)) + 16|0);
  31573. $65 = ((($64)) + 4|0);
  31574. $66 = HEAP32[$65>>2]|0;
  31575. $67 = ($66|0)==(0|0);
  31576. if ($67) {
  31577. $68 = HEAP32[$64>>2]|0;
  31578. $69 = ($68|0)==(0|0);
  31579. if ($69) {
  31580. $$3 = 0;
  31581. break;
  31582. } else {
  31583. $$1387 = $68;$$1390 = $64;
  31584. }
  31585. } else {
  31586. $$1387 = $66;$$1390 = $65;
  31587. }
  31588. while(1) {
  31589. $70 = ((($$1387)) + 20|0);
  31590. $71 = HEAP32[$70>>2]|0;
  31591. $72 = ($71|0)==(0|0);
  31592. if (!($72)) {
  31593. $$1387 = $71;$$1390 = $70;
  31594. continue;
  31595. }
  31596. $73 = ((($$1387)) + 16|0);
  31597. $74 = HEAP32[$73>>2]|0;
  31598. $75 = ($74|0)==(0|0);
  31599. if ($75) {
  31600. break;
  31601. } else {
  31602. $$1387 = $74;$$1390 = $73;
  31603. }
  31604. }
  31605. $76 = ($$1390>>>0)<($8>>>0);
  31606. if ($76) {
  31607. _abort();
  31608. // unreachable;
  31609. } else {
  31610. HEAP32[$$1390>>2] = 0;
  31611. $$3 = $$1387;
  31612. break;
  31613. }
  31614. } else {
  31615. $55 = ((($21)) + 8|0);
  31616. $56 = HEAP32[$55>>2]|0;
  31617. $57 = ($56>>>0)<($8>>>0);
  31618. if ($57) {
  31619. _abort();
  31620. // unreachable;
  31621. }
  31622. $58 = ((($56)) + 12|0);
  31623. $59 = HEAP32[$58>>2]|0;
  31624. $60 = ($59|0)==($21|0);
  31625. if (!($60)) {
  31626. _abort();
  31627. // unreachable;
  31628. }
  31629. $61 = ((($53)) + 8|0);
  31630. $62 = HEAP32[$61>>2]|0;
  31631. $63 = ($62|0)==($21|0);
  31632. if ($63) {
  31633. HEAP32[$58>>2] = $53;
  31634. HEAP32[$61>>2] = $56;
  31635. $$3 = $53;
  31636. break;
  31637. } else {
  31638. _abort();
  31639. // unreachable;
  31640. }
  31641. }
  31642. } while(0);
  31643. $77 = ($51|0)==(0|0);
  31644. if ($77) {
  31645. $$1 = $21;$$1382 = $22;$118 = $21;
  31646. label = 55;
  31647. } else {
  31648. $78 = ((($21)) + 28|0);
  31649. $79 = HEAP32[$78>>2]|0;
  31650. $80 = (35764 + ($79<<2)|0);
  31651. $81 = HEAP32[$80>>2]|0;
  31652. $82 = ($21|0)==($81|0);
  31653. do {
  31654. if ($82) {
  31655. HEAP32[$80>>2] = $$3;
  31656. $cond421 = ($$3|0)==(0|0);
  31657. if ($cond421) {
  31658. $83 = 1 << $79;
  31659. $84 = $83 ^ -1;
  31660. $85 = HEAP32[(35464)>>2]|0;
  31661. $86 = $85 & $84;
  31662. HEAP32[(35464)>>2] = $86;
  31663. $$1 = $21;$$1382 = $22;$118 = $21;
  31664. label = 55;
  31665. break L14;
  31666. }
  31667. } else {
  31668. $87 = HEAP32[(35476)>>2]|0;
  31669. $88 = ($51>>>0)<($87>>>0);
  31670. if ($88) {
  31671. _abort();
  31672. // unreachable;
  31673. } else {
  31674. $89 = ((($51)) + 16|0);
  31675. $90 = HEAP32[$89>>2]|0;
  31676. $not$405 = ($90|0)!=($21|0);
  31677. $$sink3 = $not$405&1;
  31678. $91 = (((($51)) + 16|0) + ($$sink3<<2)|0);
  31679. HEAP32[$91>>2] = $$3;
  31680. $92 = ($$3|0)==(0|0);
  31681. if ($92) {
  31682. $$1 = $21;$$1382 = $22;$118 = $21;
  31683. label = 55;
  31684. break L14;
  31685. } else {
  31686. break;
  31687. }
  31688. }
  31689. }
  31690. } while(0);
  31691. $93 = HEAP32[(35476)>>2]|0;
  31692. $94 = ($$3>>>0)<($93>>>0);
  31693. if ($94) {
  31694. _abort();
  31695. // unreachable;
  31696. }
  31697. $95 = ((($$3)) + 24|0);
  31698. HEAP32[$95>>2] = $51;
  31699. $96 = ((($21)) + 16|0);
  31700. $97 = HEAP32[$96>>2]|0;
  31701. $98 = ($97|0)==(0|0);
  31702. do {
  31703. if (!($98)) {
  31704. $99 = ($97>>>0)<($93>>>0);
  31705. if ($99) {
  31706. _abort();
  31707. // unreachable;
  31708. } else {
  31709. $100 = ((($$3)) + 16|0);
  31710. HEAP32[$100>>2] = $97;
  31711. $101 = ((($97)) + 24|0);
  31712. HEAP32[$101>>2] = $$3;
  31713. break;
  31714. }
  31715. }
  31716. } while(0);
  31717. $102 = ((($96)) + 4|0);
  31718. $103 = HEAP32[$102>>2]|0;
  31719. $104 = ($103|0)==(0|0);
  31720. if ($104) {
  31721. $$1 = $21;$$1382 = $22;$118 = $21;
  31722. label = 55;
  31723. } else {
  31724. $105 = HEAP32[(35476)>>2]|0;
  31725. $106 = ($103>>>0)<($105>>>0);
  31726. if ($106) {
  31727. _abort();
  31728. // unreachable;
  31729. } else {
  31730. $107 = ((($$3)) + 20|0);
  31731. HEAP32[$107>>2] = $103;
  31732. $108 = ((($103)) + 24|0);
  31733. HEAP32[$108>>2] = $$3;
  31734. $$1 = $21;$$1382 = $22;$118 = $21;
  31735. label = 55;
  31736. break;
  31737. }
  31738. }
  31739. }
  31740. }
  31741. } else {
  31742. $$1 = $2;$$1382 = $14;$118 = $2;
  31743. label = 55;
  31744. }
  31745. } while(0);
  31746. do {
  31747. if ((label|0) == 55) {
  31748. $117 = ($118>>>0)<($15>>>0);
  31749. if (!($117)) {
  31750. _abort();
  31751. // unreachable;
  31752. }
  31753. $119 = ((($15)) + 4|0);
  31754. $120 = HEAP32[$119>>2]|0;
  31755. $121 = $120 & 1;
  31756. $122 = ($121|0)==(0);
  31757. if ($122) {
  31758. _abort();
  31759. // unreachable;
  31760. }
  31761. $123 = $120 & 2;
  31762. $124 = ($123|0)==(0);
  31763. if ($124) {
  31764. $125 = HEAP32[(35484)>>2]|0;
  31765. $126 = ($15|0)==($125|0);
  31766. $127 = HEAP32[(35480)>>2]|0;
  31767. if ($126) {
  31768. $128 = HEAP32[(35472)>>2]|0;
  31769. $129 = (($128) + ($$1382))|0;
  31770. HEAP32[(35472)>>2] = $129;
  31771. HEAP32[(35484)>>2] = $$1;
  31772. $130 = $129 | 1;
  31773. $131 = ((($$1)) + 4|0);
  31774. HEAP32[$131>>2] = $130;
  31775. $132 = ($$1|0)==($127|0);
  31776. if (!($132)) {
  31777. break;
  31778. }
  31779. HEAP32[(35480)>>2] = 0;
  31780. HEAP32[(35468)>>2] = 0;
  31781. break;
  31782. }
  31783. $133 = ($15|0)==($127|0);
  31784. if ($133) {
  31785. $134 = HEAP32[(35468)>>2]|0;
  31786. $135 = (($134) + ($$1382))|0;
  31787. HEAP32[(35468)>>2] = $135;
  31788. HEAP32[(35480)>>2] = $118;
  31789. $136 = $135 | 1;
  31790. $137 = ((($$1)) + 4|0);
  31791. HEAP32[$137>>2] = $136;
  31792. $138 = (($118) + ($135)|0);
  31793. HEAP32[$138>>2] = $135;
  31794. break;
  31795. }
  31796. $139 = $120 & -8;
  31797. $140 = (($139) + ($$1382))|0;
  31798. $141 = $120 >>> 3;
  31799. $142 = ($120>>>0)<(256);
  31800. L106: do {
  31801. if ($142) {
  31802. $143 = ((($15)) + 8|0);
  31803. $144 = HEAP32[$143>>2]|0;
  31804. $145 = ((($15)) + 12|0);
  31805. $146 = HEAP32[$145>>2]|0;
  31806. $147 = $141 << 1;
  31807. $148 = (35500 + ($147<<2)|0);
  31808. $149 = ($144|0)==($148|0);
  31809. if (!($149)) {
  31810. $150 = HEAP32[(35476)>>2]|0;
  31811. $151 = ($144>>>0)<($150>>>0);
  31812. if ($151) {
  31813. _abort();
  31814. // unreachable;
  31815. }
  31816. $152 = ((($144)) + 12|0);
  31817. $153 = HEAP32[$152>>2]|0;
  31818. $154 = ($153|0)==($15|0);
  31819. if (!($154)) {
  31820. _abort();
  31821. // unreachable;
  31822. }
  31823. }
  31824. $155 = ($146|0)==($144|0);
  31825. if ($155) {
  31826. $156 = 1 << $141;
  31827. $157 = $156 ^ -1;
  31828. $158 = HEAP32[8865]|0;
  31829. $159 = $158 & $157;
  31830. HEAP32[8865] = $159;
  31831. break;
  31832. }
  31833. $160 = ($146|0)==($148|0);
  31834. if ($160) {
  31835. $$pre442 = ((($146)) + 8|0);
  31836. $$pre$phi443Z2D = $$pre442;
  31837. } else {
  31838. $161 = HEAP32[(35476)>>2]|0;
  31839. $162 = ($146>>>0)<($161>>>0);
  31840. if ($162) {
  31841. _abort();
  31842. // unreachable;
  31843. }
  31844. $163 = ((($146)) + 8|0);
  31845. $164 = HEAP32[$163>>2]|0;
  31846. $165 = ($164|0)==($15|0);
  31847. if ($165) {
  31848. $$pre$phi443Z2D = $163;
  31849. } else {
  31850. _abort();
  31851. // unreachable;
  31852. }
  31853. }
  31854. $166 = ((($144)) + 12|0);
  31855. HEAP32[$166>>2] = $146;
  31856. HEAP32[$$pre$phi443Z2D>>2] = $144;
  31857. } else {
  31858. $167 = ((($15)) + 24|0);
  31859. $168 = HEAP32[$167>>2]|0;
  31860. $169 = ((($15)) + 12|0);
  31861. $170 = HEAP32[$169>>2]|0;
  31862. $171 = ($170|0)==($15|0);
  31863. do {
  31864. if ($171) {
  31865. $182 = ((($15)) + 16|0);
  31866. $183 = ((($182)) + 4|0);
  31867. $184 = HEAP32[$183>>2]|0;
  31868. $185 = ($184|0)==(0|0);
  31869. if ($185) {
  31870. $186 = HEAP32[$182>>2]|0;
  31871. $187 = ($186|0)==(0|0);
  31872. if ($187) {
  31873. $$3400 = 0;
  31874. break;
  31875. } else {
  31876. $$1398 = $186;$$1402 = $182;
  31877. }
  31878. } else {
  31879. $$1398 = $184;$$1402 = $183;
  31880. }
  31881. while(1) {
  31882. $188 = ((($$1398)) + 20|0);
  31883. $189 = HEAP32[$188>>2]|0;
  31884. $190 = ($189|0)==(0|0);
  31885. if (!($190)) {
  31886. $$1398 = $189;$$1402 = $188;
  31887. continue;
  31888. }
  31889. $191 = ((($$1398)) + 16|0);
  31890. $192 = HEAP32[$191>>2]|0;
  31891. $193 = ($192|0)==(0|0);
  31892. if ($193) {
  31893. break;
  31894. } else {
  31895. $$1398 = $192;$$1402 = $191;
  31896. }
  31897. }
  31898. $194 = HEAP32[(35476)>>2]|0;
  31899. $195 = ($$1402>>>0)<($194>>>0);
  31900. if ($195) {
  31901. _abort();
  31902. // unreachable;
  31903. } else {
  31904. HEAP32[$$1402>>2] = 0;
  31905. $$3400 = $$1398;
  31906. break;
  31907. }
  31908. } else {
  31909. $172 = ((($15)) + 8|0);
  31910. $173 = HEAP32[$172>>2]|0;
  31911. $174 = HEAP32[(35476)>>2]|0;
  31912. $175 = ($173>>>0)<($174>>>0);
  31913. if ($175) {
  31914. _abort();
  31915. // unreachable;
  31916. }
  31917. $176 = ((($173)) + 12|0);
  31918. $177 = HEAP32[$176>>2]|0;
  31919. $178 = ($177|0)==($15|0);
  31920. if (!($178)) {
  31921. _abort();
  31922. // unreachable;
  31923. }
  31924. $179 = ((($170)) + 8|0);
  31925. $180 = HEAP32[$179>>2]|0;
  31926. $181 = ($180|0)==($15|0);
  31927. if ($181) {
  31928. HEAP32[$176>>2] = $170;
  31929. HEAP32[$179>>2] = $173;
  31930. $$3400 = $170;
  31931. break;
  31932. } else {
  31933. _abort();
  31934. // unreachable;
  31935. }
  31936. }
  31937. } while(0);
  31938. $196 = ($168|0)==(0|0);
  31939. if (!($196)) {
  31940. $197 = ((($15)) + 28|0);
  31941. $198 = HEAP32[$197>>2]|0;
  31942. $199 = (35764 + ($198<<2)|0);
  31943. $200 = HEAP32[$199>>2]|0;
  31944. $201 = ($15|0)==($200|0);
  31945. do {
  31946. if ($201) {
  31947. HEAP32[$199>>2] = $$3400;
  31948. $cond422 = ($$3400|0)==(0|0);
  31949. if ($cond422) {
  31950. $202 = 1 << $198;
  31951. $203 = $202 ^ -1;
  31952. $204 = HEAP32[(35464)>>2]|0;
  31953. $205 = $204 & $203;
  31954. HEAP32[(35464)>>2] = $205;
  31955. break L106;
  31956. }
  31957. } else {
  31958. $206 = HEAP32[(35476)>>2]|0;
  31959. $207 = ($168>>>0)<($206>>>0);
  31960. if ($207) {
  31961. _abort();
  31962. // unreachable;
  31963. } else {
  31964. $208 = ((($168)) + 16|0);
  31965. $209 = HEAP32[$208>>2]|0;
  31966. $not$ = ($209|0)!=($15|0);
  31967. $$sink5 = $not$&1;
  31968. $210 = (((($168)) + 16|0) + ($$sink5<<2)|0);
  31969. HEAP32[$210>>2] = $$3400;
  31970. $211 = ($$3400|0)==(0|0);
  31971. if ($211) {
  31972. break L106;
  31973. } else {
  31974. break;
  31975. }
  31976. }
  31977. }
  31978. } while(0);
  31979. $212 = HEAP32[(35476)>>2]|0;
  31980. $213 = ($$3400>>>0)<($212>>>0);
  31981. if ($213) {
  31982. _abort();
  31983. // unreachable;
  31984. }
  31985. $214 = ((($$3400)) + 24|0);
  31986. HEAP32[$214>>2] = $168;
  31987. $215 = ((($15)) + 16|0);
  31988. $216 = HEAP32[$215>>2]|0;
  31989. $217 = ($216|0)==(0|0);
  31990. do {
  31991. if (!($217)) {
  31992. $218 = ($216>>>0)<($212>>>0);
  31993. if ($218) {
  31994. _abort();
  31995. // unreachable;
  31996. } else {
  31997. $219 = ((($$3400)) + 16|0);
  31998. HEAP32[$219>>2] = $216;
  31999. $220 = ((($216)) + 24|0);
  32000. HEAP32[$220>>2] = $$3400;
  32001. break;
  32002. }
  32003. }
  32004. } while(0);
  32005. $221 = ((($215)) + 4|0);
  32006. $222 = HEAP32[$221>>2]|0;
  32007. $223 = ($222|0)==(0|0);
  32008. if (!($223)) {
  32009. $224 = HEAP32[(35476)>>2]|0;
  32010. $225 = ($222>>>0)<($224>>>0);
  32011. if ($225) {
  32012. _abort();
  32013. // unreachable;
  32014. } else {
  32015. $226 = ((($$3400)) + 20|0);
  32016. HEAP32[$226>>2] = $222;
  32017. $227 = ((($222)) + 24|0);
  32018. HEAP32[$227>>2] = $$3400;
  32019. break;
  32020. }
  32021. }
  32022. }
  32023. }
  32024. } while(0);
  32025. $228 = $140 | 1;
  32026. $229 = ((($$1)) + 4|0);
  32027. HEAP32[$229>>2] = $228;
  32028. $230 = (($118) + ($140)|0);
  32029. HEAP32[$230>>2] = $140;
  32030. $231 = HEAP32[(35480)>>2]|0;
  32031. $232 = ($$1|0)==($231|0);
  32032. if ($232) {
  32033. HEAP32[(35468)>>2] = $140;
  32034. break;
  32035. } else {
  32036. $$2 = $140;
  32037. }
  32038. } else {
  32039. $233 = $120 & -2;
  32040. HEAP32[$119>>2] = $233;
  32041. $234 = $$1382 | 1;
  32042. $235 = ((($$1)) + 4|0);
  32043. HEAP32[$235>>2] = $234;
  32044. $236 = (($118) + ($$1382)|0);
  32045. HEAP32[$236>>2] = $$1382;
  32046. $$2 = $$1382;
  32047. }
  32048. $237 = $$2 >>> 3;
  32049. $238 = ($$2>>>0)<(256);
  32050. if ($238) {
  32051. $239 = $237 << 1;
  32052. $240 = (35500 + ($239<<2)|0);
  32053. $241 = HEAP32[8865]|0;
  32054. $242 = 1 << $237;
  32055. $243 = $241 & $242;
  32056. $244 = ($243|0)==(0);
  32057. if ($244) {
  32058. $245 = $241 | $242;
  32059. HEAP32[8865] = $245;
  32060. $$pre = ((($240)) + 8|0);
  32061. $$0403 = $240;$$pre$phiZ2D = $$pre;
  32062. } else {
  32063. $246 = ((($240)) + 8|0);
  32064. $247 = HEAP32[$246>>2]|0;
  32065. $248 = HEAP32[(35476)>>2]|0;
  32066. $249 = ($247>>>0)<($248>>>0);
  32067. if ($249) {
  32068. _abort();
  32069. // unreachable;
  32070. } else {
  32071. $$0403 = $247;$$pre$phiZ2D = $246;
  32072. }
  32073. }
  32074. HEAP32[$$pre$phiZ2D>>2] = $$1;
  32075. $250 = ((($$0403)) + 12|0);
  32076. HEAP32[$250>>2] = $$1;
  32077. $251 = ((($$1)) + 8|0);
  32078. HEAP32[$251>>2] = $$0403;
  32079. $252 = ((($$1)) + 12|0);
  32080. HEAP32[$252>>2] = $240;
  32081. break;
  32082. }
  32083. $253 = $$2 >>> 8;
  32084. $254 = ($253|0)==(0);
  32085. if ($254) {
  32086. $$0396 = 0;
  32087. } else {
  32088. $255 = ($$2>>>0)>(16777215);
  32089. if ($255) {
  32090. $$0396 = 31;
  32091. } else {
  32092. $256 = (($253) + 1048320)|0;
  32093. $257 = $256 >>> 16;
  32094. $258 = $257 & 8;
  32095. $259 = $253 << $258;
  32096. $260 = (($259) + 520192)|0;
  32097. $261 = $260 >>> 16;
  32098. $262 = $261 & 4;
  32099. $263 = $262 | $258;
  32100. $264 = $259 << $262;
  32101. $265 = (($264) + 245760)|0;
  32102. $266 = $265 >>> 16;
  32103. $267 = $266 & 2;
  32104. $268 = $263 | $267;
  32105. $269 = (14 - ($268))|0;
  32106. $270 = $264 << $267;
  32107. $271 = $270 >>> 15;
  32108. $272 = (($269) + ($271))|0;
  32109. $273 = $272 << 1;
  32110. $274 = (($272) + 7)|0;
  32111. $275 = $$2 >>> $274;
  32112. $276 = $275 & 1;
  32113. $277 = $276 | $273;
  32114. $$0396 = $277;
  32115. }
  32116. }
  32117. $278 = (35764 + ($$0396<<2)|0);
  32118. $279 = ((($$1)) + 28|0);
  32119. HEAP32[$279>>2] = $$0396;
  32120. $280 = ((($$1)) + 16|0);
  32121. $281 = ((($$1)) + 20|0);
  32122. HEAP32[$281>>2] = 0;
  32123. HEAP32[$280>>2] = 0;
  32124. $282 = HEAP32[(35464)>>2]|0;
  32125. $283 = 1 << $$0396;
  32126. $284 = $282 & $283;
  32127. $285 = ($284|0)==(0);
  32128. do {
  32129. if ($285) {
  32130. $286 = $282 | $283;
  32131. HEAP32[(35464)>>2] = $286;
  32132. HEAP32[$278>>2] = $$1;
  32133. $287 = ((($$1)) + 24|0);
  32134. HEAP32[$287>>2] = $278;
  32135. $288 = ((($$1)) + 12|0);
  32136. HEAP32[$288>>2] = $$1;
  32137. $289 = ((($$1)) + 8|0);
  32138. HEAP32[$289>>2] = $$1;
  32139. } else {
  32140. $290 = HEAP32[$278>>2]|0;
  32141. $291 = ($$0396|0)==(31);
  32142. $292 = $$0396 >>> 1;
  32143. $293 = (25 - ($292))|0;
  32144. $294 = $291 ? 0 : $293;
  32145. $295 = $$2 << $294;
  32146. $$0383 = $295;$$0384 = $290;
  32147. while(1) {
  32148. $296 = ((($$0384)) + 4|0);
  32149. $297 = HEAP32[$296>>2]|0;
  32150. $298 = $297 & -8;
  32151. $299 = ($298|0)==($$2|0);
  32152. if ($299) {
  32153. label = 126;
  32154. break;
  32155. }
  32156. $300 = $$0383 >>> 31;
  32157. $301 = (((($$0384)) + 16|0) + ($300<<2)|0);
  32158. $302 = $$0383 << 1;
  32159. $303 = HEAP32[$301>>2]|0;
  32160. $304 = ($303|0)==(0|0);
  32161. if ($304) {
  32162. label = 123;
  32163. break;
  32164. } else {
  32165. $$0383 = $302;$$0384 = $303;
  32166. }
  32167. }
  32168. if ((label|0) == 123) {
  32169. $305 = HEAP32[(35476)>>2]|0;
  32170. $306 = ($301>>>0)<($305>>>0);
  32171. if ($306) {
  32172. _abort();
  32173. // unreachable;
  32174. } else {
  32175. HEAP32[$301>>2] = $$1;
  32176. $307 = ((($$1)) + 24|0);
  32177. HEAP32[$307>>2] = $$0384;
  32178. $308 = ((($$1)) + 12|0);
  32179. HEAP32[$308>>2] = $$1;
  32180. $309 = ((($$1)) + 8|0);
  32181. HEAP32[$309>>2] = $$1;
  32182. break;
  32183. }
  32184. }
  32185. else if ((label|0) == 126) {
  32186. $310 = ((($$0384)) + 8|0);
  32187. $311 = HEAP32[$310>>2]|0;
  32188. $312 = HEAP32[(35476)>>2]|0;
  32189. $313 = ($311>>>0)>=($312>>>0);
  32190. $not$437 = ($$0384>>>0)>=($312>>>0);
  32191. $314 = $313 & $not$437;
  32192. if ($314) {
  32193. $315 = ((($311)) + 12|0);
  32194. HEAP32[$315>>2] = $$1;
  32195. HEAP32[$310>>2] = $$1;
  32196. $316 = ((($$1)) + 8|0);
  32197. HEAP32[$316>>2] = $311;
  32198. $317 = ((($$1)) + 12|0);
  32199. HEAP32[$317>>2] = $$0384;
  32200. $318 = ((($$1)) + 24|0);
  32201. HEAP32[$318>>2] = 0;
  32202. break;
  32203. } else {
  32204. _abort();
  32205. // unreachable;
  32206. }
  32207. }
  32208. }
  32209. } while(0);
  32210. $319 = HEAP32[(35492)>>2]|0;
  32211. $320 = (($319) + -1)|0;
  32212. HEAP32[(35492)>>2] = $320;
  32213. $321 = ($320|0)==(0);
  32214. if ($321) {
  32215. $$0212$in$i = (35944);
  32216. while(1) {
  32217. $$0212$i = HEAP32[$$0212$in$i>>2]|0;
  32218. $322 = ($$0212$i|0)==(0|0);
  32219. $323 = ((($$0212$i)) + 8|0);
  32220. if ($322) {
  32221. break;
  32222. } else {
  32223. $$0212$in$i = $323;
  32224. }
  32225. }
  32226. HEAP32[(35492)>>2] = -1;
  32227. }
  32228. }
  32229. } while(0);
  32230. $324 = HEAP32[(35904)>>2]|0;
  32231. $325 = $324 & 2;
  32232. $326 = ($325|0)==(0);
  32233. if ($326) {
  32234. return;
  32235. }
  32236. (___pthread_mutex_unlock((35908))|0);
  32237. return;
  32238. }
  32239. function runPostSets() {
  32240. }
  32241. function _memset(ptr, value, num) {
  32242. ptr = ptr|0; value = value|0; num = num|0;
  32243. var end = 0, aligned_end = 0, block_aligned_end = 0, value4 = 0;
  32244. end = (ptr + num)|0;
  32245. value = value & 0xff;
  32246. if ((num|0) >= 67 /* 64 bytes for an unrolled loop + 3 bytes for unaligned head*/) {
  32247. while ((ptr&3) != 0) {
  32248. HEAP8[((ptr)>>0)]=value;
  32249. ptr = (ptr+1)|0;
  32250. }
  32251. aligned_end = (end & -4)|0;
  32252. block_aligned_end = (aligned_end - 64)|0;
  32253. value4 = value | (value << 8) | (value << 16) | (value << 24);
  32254. while((ptr|0) <= (block_aligned_end|0)) {
  32255. HEAP32[((ptr)>>2)]=value4;
  32256. HEAP32[(((ptr)+(4))>>2)]=value4;
  32257. HEAP32[(((ptr)+(8))>>2)]=value4;
  32258. HEAP32[(((ptr)+(12))>>2)]=value4;
  32259. HEAP32[(((ptr)+(16))>>2)]=value4;
  32260. HEAP32[(((ptr)+(20))>>2)]=value4;
  32261. HEAP32[(((ptr)+(24))>>2)]=value4;
  32262. HEAP32[(((ptr)+(28))>>2)]=value4;
  32263. HEAP32[(((ptr)+(32))>>2)]=value4;
  32264. HEAP32[(((ptr)+(36))>>2)]=value4;
  32265. HEAP32[(((ptr)+(40))>>2)]=value4;
  32266. HEAP32[(((ptr)+(44))>>2)]=value4;
  32267. HEAP32[(((ptr)+(48))>>2)]=value4;
  32268. HEAP32[(((ptr)+(52))>>2)]=value4;
  32269. HEAP32[(((ptr)+(56))>>2)]=value4;
  32270. HEAP32[(((ptr)+(60))>>2)]=value4;
  32271. ptr = (ptr + 64)|0;
  32272. }
  32273. while ((ptr|0) < (aligned_end|0) ) {
  32274. HEAP32[((ptr)>>2)]=value4;
  32275. ptr = (ptr+4)|0;
  32276. }
  32277. }
  32278. // The remaining bytes.
  32279. while ((ptr|0) < (end|0)) {
  32280. HEAP8[((ptr)>>0)]=value;
  32281. ptr = (ptr+1)|0;
  32282. }
  32283. return (end-num)|0;
  32284. }
  32285. function _i64Subtract(a, b, c, d) {
  32286. a = a|0; b = b|0; c = c|0; d = d|0;
  32287. var l = 0, h = 0;
  32288. l = (a - c)>>>0;
  32289. h = (b - d)>>>0;
  32290. h = (b - d - (((c>>>0) > (a>>>0))|0))>>>0; // Borrow one from high word to low word on underflow.
  32291. return ((tempRet0 = h,l|0)|0);
  32292. }
  32293. function _i64Add(a, b, c, d) {
  32294. /*
  32295. x = a + b*2^32
  32296. y = c + d*2^32
  32297. result = l + h*2^32
  32298. */
  32299. a = a|0; b = b|0; c = c|0; d = d|0;
  32300. var l = 0, h = 0;
  32301. l = (a + c)>>>0;
  32302. h = (b + d + (((l>>>0) < (a>>>0))|0))>>>0; // Add carry from low word to high word on overflow.
  32303. return ((tempRet0 = h,l|0)|0);
  32304. }
  32305. function ___muldsi3($a, $b) {
  32306. $a = $a | 0;
  32307. $b = $b | 0;
  32308. var $1 = 0, $2 = 0, $3 = 0, $6 = 0, $8 = 0, $11 = 0, $12 = 0;
  32309. $1 = $a & 65535;
  32310. $2 = $b & 65535;
  32311. $3 = Math_imul($2, $1) | 0;
  32312. $6 = $a >>> 16;
  32313. $8 = ($3 >>> 16) + (Math_imul($2, $6) | 0) | 0;
  32314. $11 = $b >>> 16;
  32315. $12 = Math_imul($11, $1) | 0;
  32316. return (tempRet0 = (($8 >>> 16) + (Math_imul($11, $6) | 0) | 0) + ((($8 & 65535) + $12 | 0) >>> 16) | 0, 0 | ($8 + $12 << 16 | $3 & 65535)) | 0;
  32317. }
  32318. function ___muldi3($a$0, $a$1, $b$0, $b$1) {
  32319. $a$0 = $a$0 | 0;
  32320. $a$1 = $a$1 | 0;
  32321. $b$0 = $b$0 | 0;
  32322. $b$1 = $b$1 | 0;
  32323. var $x_sroa_0_0_extract_trunc = 0, $y_sroa_0_0_extract_trunc = 0, $1$0 = 0, $1$1 = 0, $2 = 0;
  32324. $x_sroa_0_0_extract_trunc = $a$0;
  32325. $y_sroa_0_0_extract_trunc = $b$0;
  32326. $1$0 = ___muldsi3($x_sroa_0_0_extract_trunc, $y_sroa_0_0_extract_trunc) | 0;
  32327. $1$1 = tempRet0;
  32328. $2 = Math_imul($a$1, $y_sroa_0_0_extract_trunc) | 0;
  32329. return (tempRet0 = ((Math_imul($b$1, $x_sroa_0_0_extract_trunc) | 0) + $2 | 0) + $1$1 | $1$1 & 0, 0 | $1$0 & -1) | 0;
  32330. }
  32331. function _memcpy(dest, src, num) {
  32332. dest = dest|0; src = src|0; num = num|0;
  32333. var ret = 0;
  32334. var aligned_dest_end = 0;
  32335. var block_aligned_dest_end = 0;
  32336. var dest_end = 0;
  32337. // Test against a benchmarked cutoff limit for when HEAPU8.set() becomes faster to use.
  32338. if ((num|0) >=
  32339. 8192
  32340. ) {
  32341. return _emscripten_memcpy_big(dest|0, src|0, num|0)|0;
  32342. }
  32343. ret = dest|0;
  32344. dest_end = (dest + num)|0;
  32345. if ((dest&3) == (src&3)) {
  32346. // The initial unaligned < 4-byte front.
  32347. while (dest & 3) {
  32348. if ((num|0) == 0) return ret|0;
  32349. HEAP8[((dest)>>0)]=((HEAP8[((src)>>0)])|0);
  32350. dest = (dest+1)|0;
  32351. src = (src+1)|0;
  32352. num = (num-1)|0;
  32353. }
  32354. aligned_dest_end = (dest_end & -4)|0;
  32355. block_aligned_dest_end = (aligned_dest_end - 64)|0;
  32356. while ((dest|0) <= (block_aligned_dest_end|0) ) {
  32357. HEAP32[((dest)>>2)]=((HEAP32[((src)>>2)])|0);
  32358. HEAP32[(((dest)+(4))>>2)]=((HEAP32[(((src)+(4))>>2)])|0);
  32359. HEAP32[(((dest)+(8))>>2)]=((HEAP32[(((src)+(8))>>2)])|0);
  32360. HEAP32[(((dest)+(12))>>2)]=((HEAP32[(((src)+(12))>>2)])|0);
  32361. HEAP32[(((dest)+(16))>>2)]=((HEAP32[(((src)+(16))>>2)])|0);
  32362. HEAP32[(((dest)+(20))>>2)]=((HEAP32[(((src)+(20))>>2)])|0);
  32363. HEAP32[(((dest)+(24))>>2)]=((HEAP32[(((src)+(24))>>2)])|0);
  32364. HEAP32[(((dest)+(28))>>2)]=((HEAP32[(((src)+(28))>>2)])|0);
  32365. HEAP32[(((dest)+(32))>>2)]=((HEAP32[(((src)+(32))>>2)])|0);
  32366. HEAP32[(((dest)+(36))>>2)]=((HEAP32[(((src)+(36))>>2)])|0);
  32367. HEAP32[(((dest)+(40))>>2)]=((HEAP32[(((src)+(40))>>2)])|0);
  32368. HEAP32[(((dest)+(44))>>2)]=((HEAP32[(((src)+(44))>>2)])|0);
  32369. HEAP32[(((dest)+(48))>>2)]=((HEAP32[(((src)+(48))>>2)])|0);
  32370. HEAP32[(((dest)+(52))>>2)]=((HEAP32[(((src)+(52))>>2)])|0);
  32371. HEAP32[(((dest)+(56))>>2)]=((HEAP32[(((src)+(56))>>2)])|0);
  32372. HEAP32[(((dest)+(60))>>2)]=((HEAP32[(((src)+(60))>>2)])|0);
  32373. dest = (dest+64)|0;
  32374. src = (src+64)|0;
  32375. }
  32376. while ((dest|0) < (aligned_dest_end|0) ) {
  32377. HEAP32[((dest)>>2)]=((HEAP32[((src)>>2)])|0);
  32378. dest = (dest+4)|0;
  32379. src = (src+4)|0;
  32380. }
  32381. } else {
  32382. // In the unaligned copy case, unroll a bit as well.
  32383. aligned_dest_end = (dest_end - 4)|0;
  32384. while ((dest|0) < (aligned_dest_end|0) ) {
  32385. HEAP8[((dest)>>0)]=((HEAP8[((src)>>0)])|0);
  32386. HEAP8[(((dest)+(1))>>0)]=((HEAP8[(((src)+(1))>>0)])|0);
  32387. HEAP8[(((dest)+(2))>>0)]=((HEAP8[(((src)+(2))>>0)])|0);
  32388. HEAP8[(((dest)+(3))>>0)]=((HEAP8[(((src)+(3))>>0)])|0);
  32389. dest = (dest+4)|0;
  32390. src = (src+4)|0;
  32391. }
  32392. }
  32393. // The remaining unaligned < 4 byte tail.
  32394. while ((dest|0) < (dest_end|0)) {
  32395. HEAP8[((dest)>>0)]=((HEAP8[((src)>>0)])|0);
  32396. dest = (dest+1)|0;
  32397. src = (src+1)|0;
  32398. }
  32399. return ret|0;
  32400. }
  32401. function _memmove(dest, src, num) {
  32402. dest = dest|0; src = src|0; num = num|0;
  32403. var ret = 0;
  32404. if (((src|0) < (dest|0)) & ((dest|0) < ((src + num)|0))) {
  32405. // Unlikely case: Copy backwards in a safe manner
  32406. ret = dest;
  32407. src = (src + num)|0;
  32408. dest = (dest + num)|0;
  32409. while ((num|0) > 0) {
  32410. dest = (dest - 1)|0;
  32411. src = (src - 1)|0;
  32412. num = (num - 1)|0;
  32413. HEAP8[((dest)>>0)]=((HEAP8[((src)>>0)])|0);
  32414. }
  32415. dest = ret;
  32416. } else {
  32417. _memcpy(dest, src, num) | 0;
  32418. }
  32419. return dest | 0;
  32420. }
  32421. function _llvm_cttz_i32(x) {
  32422. x = x|0;
  32423. var ret = 0;
  32424. ret = ((HEAP8[(((cttz_i8)+(x & 0xff))>>0)])|0);
  32425. if ((ret|0) < 8) return ret|0;
  32426. ret = ((HEAP8[(((cttz_i8)+((x >> 8)&0xff))>>0)])|0);
  32427. if ((ret|0) < 8) return (ret + 8)|0;
  32428. ret = ((HEAP8[(((cttz_i8)+((x >> 16)&0xff))>>0)])|0);
  32429. if ((ret|0) < 8) return (ret + 16)|0;
  32430. return (((HEAP8[(((cttz_i8)+(x >>> 24))>>0)])|0) + 24)|0;
  32431. }
  32432. function ___udivmoddi4($a$0, $a$1, $b$0, $b$1, $rem) {
  32433. $a$0 = $a$0 | 0;
  32434. $a$1 = $a$1 | 0;
  32435. $b$0 = $b$0 | 0;
  32436. $b$1 = $b$1 | 0;
  32437. $rem = $rem | 0;
  32438. var $n_sroa_0_0_extract_trunc = 0, $n_sroa_1_4_extract_shift$0 = 0, $n_sroa_1_4_extract_trunc = 0, $d_sroa_0_0_extract_trunc = 0, $d_sroa_1_4_extract_shift$0 = 0, $d_sroa_1_4_extract_trunc = 0, $4 = 0, $17 = 0, $37 = 0, $49 = 0, $51 = 0, $57 = 0, $58 = 0, $66 = 0, $78 = 0, $86 = 0, $88 = 0, $89 = 0, $91 = 0, $92 = 0, $95 = 0, $105 = 0, $117 = 0, $119 = 0, $125 = 0, $126 = 0, $130 = 0, $q_sroa_1_1_ph = 0, $q_sroa_0_1_ph = 0, $r_sroa_1_1_ph = 0, $r_sroa_0_1_ph = 0, $sr_1_ph = 0, $d_sroa_0_0_insert_insert99$0 = 0, $d_sroa_0_0_insert_insert99$1 = 0, $137$0 = 0, $137$1 = 0, $carry_0203 = 0, $sr_1202 = 0, $r_sroa_0_1201 = 0, $r_sroa_1_1200 = 0, $q_sroa_0_1199 = 0, $q_sroa_1_1198 = 0, $147 = 0, $149 = 0, $r_sroa_0_0_insert_insert42$0 = 0, $r_sroa_0_0_insert_insert42$1 = 0, $150$1 = 0, $151$0 = 0, $152 = 0, $154$0 = 0, $r_sroa_0_0_extract_trunc = 0, $r_sroa_1_4_extract_trunc = 0, $155 = 0, $carry_0_lcssa$0 = 0, $carry_0_lcssa$1 = 0, $r_sroa_0_1_lcssa = 0, $r_sroa_1_1_lcssa = 0, $q_sroa_0_1_lcssa = 0, $q_sroa_1_1_lcssa = 0, $q_sroa_0_0_insert_ext75$0 = 0, $q_sroa_0_0_insert_ext75$1 = 0, $q_sroa_0_0_insert_insert77$1 = 0, $_0$0 = 0, $_0$1 = 0;
  32439. $n_sroa_0_0_extract_trunc = $a$0;
  32440. $n_sroa_1_4_extract_shift$0 = $a$1;
  32441. $n_sroa_1_4_extract_trunc = $n_sroa_1_4_extract_shift$0;
  32442. $d_sroa_0_0_extract_trunc = $b$0;
  32443. $d_sroa_1_4_extract_shift$0 = $b$1;
  32444. $d_sroa_1_4_extract_trunc = $d_sroa_1_4_extract_shift$0;
  32445. if (($n_sroa_1_4_extract_trunc | 0) == 0) {
  32446. $4 = ($rem | 0) != 0;
  32447. if (($d_sroa_1_4_extract_trunc | 0) == 0) {
  32448. if ($4) {
  32449. HEAP32[$rem >> 2] = ($n_sroa_0_0_extract_trunc >>> 0) % ($d_sroa_0_0_extract_trunc >>> 0);
  32450. HEAP32[$rem + 4 >> 2] = 0;
  32451. }
  32452. $_0$1 = 0;
  32453. $_0$0 = ($n_sroa_0_0_extract_trunc >>> 0) / ($d_sroa_0_0_extract_trunc >>> 0) >>> 0;
  32454. return (tempRet0 = $_0$1, $_0$0) | 0;
  32455. } else {
  32456. if (!$4) {
  32457. $_0$1 = 0;
  32458. $_0$0 = 0;
  32459. return (tempRet0 = $_0$1, $_0$0) | 0;
  32460. }
  32461. HEAP32[$rem >> 2] = $a$0 & -1;
  32462. HEAP32[$rem + 4 >> 2] = $a$1 & 0;
  32463. $_0$1 = 0;
  32464. $_0$0 = 0;
  32465. return (tempRet0 = $_0$1, $_0$0) | 0;
  32466. }
  32467. }
  32468. $17 = ($d_sroa_1_4_extract_trunc | 0) == 0;
  32469. do {
  32470. if (($d_sroa_0_0_extract_trunc | 0) == 0) {
  32471. if ($17) {
  32472. if (($rem | 0) != 0) {
  32473. HEAP32[$rem >> 2] = ($n_sroa_1_4_extract_trunc >>> 0) % ($d_sroa_0_0_extract_trunc >>> 0);
  32474. HEAP32[$rem + 4 >> 2] = 0;
  32475. }
  32476. $_0$1 = 0;
  32477. $_0$0 = ($n_sroa_1_4_extract_trunc >>> 0) / ($d_sroa_0_0_extract_trunc >>> 0) >>> 0;
  32478. return (tempRet0 = $_0$1, $_0$0) | 0;
  32479. }
  32480. if (($n_sroa_0_0_extract_trunc | 0) == 0) {
  32481. if (($rem | 0) != 0) {
  32482. HEAP32[$rem >> 2] = 0;
  32483. HEAP32[$rem + 4 >> 2] = ($n_sroa_1_4_extract_trunc >>> 0) % ($d_sroa_1_4_extract_trunc >>> 0);
  32484. }
  32485. $_0$1 = 0;
  32486. $_0$0 = ($n_sroa_1_4_extract_trunc >>> 0) / ($d_sroa_1_4_extract_trunc >>> 0) >>> 0;
  32487. return (tempRet0 = $_0$1, $_0$0) | 0;
  32488. }
  32489. $37 = $d_sroa_1_4_extract_trunc - 1 | 0;
  32490. if (($37 & $d_sroa_1_4_extract_trunc | 0) == 0) {
  32491. if (($rem | 0) != 0) {
  32492. HEAP32[$rem >> 2] = 0 | $a$0 & -1;
  32493. HEAP32[$rem + 4 >> 2] = $37 & $n_sroa_1_4_extract_trunc | $a$1 & 0;
  32494. }
  32495. $_0$1 = 0;
  32496. $_0$0 = $n_sroa_1_4_extract_trunc >>> ((_llvm_cttz_i32($d_sroa_1_4_extract_trunc | 0) | 0) >>> 0);
  32497. return (tempRet0 = $_0$1, $_0$0) | 0;
  32498. }
  32499. $49 = Math_clz32($d_sroa_1_4_extract_trunc | 0) | 0;
  32500. $51 = $49 - (Math_clz32($n_sroa_1_4_extract_trunc | 0) | 0) | 0;
  32501. if ($51 >>> 0 <= 30) {
  32502. $57 = $51 + 1 | 0;
  32503. $58 = 31 - $51 | 0;
  32504. $sr_1_ph = $57;
  32505. $r_sroa_0_1_ph = $n_sroa_1_4_extract_trunc << $58 | $n_sroa_0_0_extract_trunc >>> ($57 >>> 0);
  32506. $r_sroa_1_1_ph = $n_sroa_1_4_extract_trunc >>> ($57 >>> 0);
  32507. $q_sroa_0_1_ph = 0;
  32508. $q_sroa_1_1_ph = $n_sroa_0_0_extract_trunc << $58;
  32509. break;
  32510. }
  32511. if (($rem | 0) == 0) {
  32512. $_0$1 = 0;
  32513. $_0$0 = 0;
  32514. return (tempRet0 = $_0$1, $_0$0) | 0;
  32515. }
  32516. HEAP32[$rem >> 2] = 0 | $a$0 & -1;
  32517. HEAP32[$rem + 4 >> 2] = $n_sroa_1_4_extract_shift$0 | $a$1 & 0;
  32518. $_0$1 = 0;
  32519. $_0$0 = 0;
  32520. return (tempRet0 = $_0$1, $_0$0) | 0;
  32521. } else {
  32522. if (!$17) {
  32523. $117 = Math_clz32($d_sroa_1_4_extract_trunc | 0) | 0;
  32524. $119 = $117 - (Math_clz32($n_sroa_1_4_extract_trunc | 0) | 0) | 0;
  32525. if ($119 >>> 0 <= 31) {
  32526. $125 = $119 + 1 | 0;
  32527. $126 = 31 - $119 | 0;
  32528. $130 = $119 - 31 >> 31;
  32529. $sr_1_ph = $125;
  32530. $r_sroa_0_1_ph = $n_sroa_0_0_extract_trunc >>> ($125 >>> 0) & $130 | $n_sroa_1_4_extract_trunc << $126;
  32531. $r_sroa_1_1_ph = $n_sroa_1_4_extract_trunc >>> ($125 >>> 0) & $130;
  32532. $q_sroa_0_1_ph = 0;
  32533. $q_sroa_1_1_ph = $n_sroa_0_0_extract_trunc << $126;
  32534. break;
  32535. }
  32536. if (($rem | 0) == 0) {
  32537. $_0$1 = 0;
  32538. $_0$0 = 0;
  32539. return (tempRet0 = $_0$1, $_0$0) | 0;
  32540. }
  32541. HEAP32[$rem >> 2] = 0 | $a$0 & -1;
  32542. HEAP32[$rem + 4 >> 2] = $n_sroa_1_4_extract_shift$0 | $a$1 & 0;
  32543. $_0$1 = 0;
  32544. $_0$0 = 0;
  32545. return (tempRet0 = $_0$1, $_0$0) | 0;
  32546. }
  32547. $66 = $d_sroa_0_0_extract_trunc - 1 | 0;
  32548. if (($66 & $d_sroa_0_0_extract_trunc | 0) != 0) {
  32549. $86 = (Math_clz32($d_sroa_0_0_extract_trunc | 0) | 0) + 33 | 0;
  32550. $88 = $86 - (Math_clz32($n_sroa_1_4_extract_trunc | 0) | 0) | 0;
  32551. $89 = 64 - $88 | 0;
  32552. $91 = 32 - $88 | 0;
  32553. $92 = $91 >> 31;
  32554. $95 = $88 - 32 | 0;
  32555. $105 = $95 >> 31;
  32556. $sr_1_ph = $88;
  32557. $r_sroa_0_1_ph = $91 - 1 >> 31 & $n_sroa_1_4_extract_trunc >>> ($95 >>> 0) | ($n_sroa_1_4_extract_trunc << $91 | $n_sroa_0_0_extract_trunc >>> ($88 >>> 0)) & $105;
  32558. $r_sroa_1_1_ph = $105 & $n_sroa_1_4_extract_trunc >>> ($88 >>> 0);
  32559. $q_sroa_0_1_ph = $n_sroa_0_0_extract_trunc << $89 & $92;
  32560. $q_sroa_1_1_ph = ($n_sroa_1_4_extract_trunc << $89 | $n_sroa_0_0_extract_trunc >>> ($95 >>> 0)) & $92 | $n_sroa_0_0_extract_trunc << $91 & $88 - 33 >> 31;
  32561. break;
  32562. }
  32563. if (($rem | 0) != 0) {
  32564. HEAP32[$rem >> 2] = $66 & $n_sroa_0_0_extract_trunc;
  32565. HEAP32[$rem + 4 >> 2] = 0;
  32566. }
  32567. if (($d_sroa_0_0_extract_trunc | 0) == 1) {
  32568. $_0$1 = $n_sroa_1_4_extract_shift$0 | $a$1 & 0;
  32569. $_0$0 = 0 | $a$0 & -1;
  32570. return (tempRet0 = $_0$1, $_0$0) | 0;
  32571. } else {
  32572. $78 = _llvm_cttz_i32($d_sroa_0_0_extract_trunc | 0) | 0;
  32573. $_0$1 = 0 | $n_sroa_1_4_extract_trunc >>> ($78 >>> 0);
  32574. $_0$0 = $n_sroa_1_4_extract_trunc << 32 - $78 | $n_sroa_0_0_extract_trunc >>> ($78 >>> 0) | 0;
  32575. return (tempRet0 = $_0$1, $_0$0) | 0;
  32576. }
  32577. }
  32578. } while (0);
  32579. if (($sr_1_ph | 0) == 0) {
  32580. $q_sroa_1_1_lcssa = $q_sroa_1_1_ph;
  32581. $q_sroa_0_1_lcssa = $q_sroa_0_1_ph;
  32582. $r_sroa_1_1_lcssa = $r_sroa_1_1_ph;
  32583. $r_sroa_0_1_lcssa = $r_sroa_0_1_ph;
  32584. $carry_0_lcssa$1 = 0;
  32585. $carry_0_lcssa$0 = 0;
  32586. } else {
  32587. $d_sroa_0_0_insert_insert99$0 = 0 | $b$0 & -1;
  32588. $d_sroa_0_0_insert_insert99$1 = $d_sroa_1_4_extract_shift$0 | $b$1 & 0;
  32589. $137$0 = _i64Add($d_sroa_0_0_insert_insert99$0 | 0, $d_sroa_0_0_insert_insert99$1 | 0, -1, -1) | 0;
  32590. $137$1 = tempRet0;
  32591. $q_sroa_1_1198 = $q_sroa_1_1_ph;
  32592. $q_sroa_0_1199 = $q_sroa_0_1_ph;
  32593. $r_sroa_1_1200 = $r_sroa_1_1_ph;
  32594. $r_sroa_0_1201 = $r_sroa_0_1_ph;
  32595. $sr_1202 = $sr_1_ph;
  32596. $carry_0203 = 0;
  32597. while (1) {
  32598. $147 = $q_sroa_0_1199 >>> 31 | $q_sroa_1_1198 << 1;
  32599. $149 = $carry_0203 | $q_sroa_0_1199 << 1;
  32600. $r_sroa_0_0_insert_insert42$0 = 0 | ($r_sroa_0_1201 << 1 | $q_sroa_1_1198 >>> 31);
  32601. $r_sroa_0_0_insert_insert42$1 = $r_sroa_0_1201 >>> 31 | $r_sroa_1_1200 << 1 | 0;
  32602. _i64Subtract($137$0 | 0, $137$1 | 0, $r_sroa_0_0_insert_insert42$0 | 0, $r_sroa_0_0_insert_insert42$1 | 0) | 0;
  32603. $150$1 = tempRet0;
  32604. $151$0 = $150$1 >> 31 | (($150$1 | 0) < 0 ? -1 : 0) << 1;
  32605. $152 = $151$0 & 1;
  32606. $154$0 = _i64Subtract($r_sroa_0_0_insert_insert42$0 | 0, $r_sroa_0_0_insert_insert42$1 | 0, $151$0 & $d_sroa_0_0_insert_insert99$0 | 0, ((($150$1 | 0) < 0 ? -1 : 0) >> 31 | (($150$1 | 0) < 0 ? -1 : 0) << 1) & $d_sroa_0_0_insert_insert99$1 | 0) | 0;
  32607. $r_sroa_0_0_extract_trunc = $154$0;
  32608. $r_sroa_1_4_extract_trunc = tempRet0;
  32609. $155 = $sr_1202 - 1 | 0;
  32610. if (($155 | 0) == 0) {
  32611. break;
  32612. } else {
  32613. $q_sroa_1_1198 = $147;
  32614. $q_sroa_0_1199 = $149;
  32615. $r_sroa_1_1200 = $r_sroa_1_4_extract_trunc;
  32616. $r_sroa_0_1201 = $r_sroa_0_0_extract_trunc;
  32617. $sr_1202 = $155;
  32618. $carry_0203 = $152;
  32619. }
  32620. }
  32621. $q_sroa_1_1_lcssa = $147;
  32622. $q_sroa_0_1_lcssa = $149;
  32623. $r_sroa_1_1_lcssa = $r_sroa_1_4_extract_trunc;
  32624. $r_sroa_0_1_lcssa = $r_sroa_0_0_extract_trunc;
  32625. $carry_0_lcssa$1 = 0;
  32626. $carry_0_lcssa$0 = $152;
  32627. }
  32628. $q_sroa_0_0_insert_ext75$0 = $q_sroa_0_1_lcssa;
  32629. $q_sroa_0_0_insert_ext75$1 = 0;
  32630. $q_sroa_0_0_insert_insert77$1 = $q_sroa_1_1_lcssa | $q_sroa_0_0_insert_ext75$1;
  32631. if (($rem | 0) != 0) {
  32632. HEAP32[$rem >> 2] = 0 | $r_sroa_0_1_lcssa;
  32633. HEAP32[$rem + 4 >> 2] = $r_sroa_1_1_lcssa | 0;
  32634. }
  32635. $_0$1 = (0 | $q_sroa_0_0_insert_ext75$0) >>> 31 | $q_sroa_0_0_insert_insert77$1 << 1 | ($q_sroa_0_0_insert_ext75$1 << 1 | $q_sroa_0_0_insert_ext75$0 >>> 31) & 0 | $carry_0_lcssa$1;
  32636. $_0$0 = ($q_sroa_0_0_insert_ext75$0 << 1 | 0 >>> 31) & -2 | $carry_0_lcssa$0;
  32637. return (tempRet0 = $_0$1, $_0$0) | 0;
  32638. }
  32639. function ___uremdi3($a$0, $a$1, $b$0, $b$1) {
  32640. $a$0 = $a$0 | 0;
  32641. $a$1 = $a$1 | 0;
  32642. $b$0 = $b$0 | 0;
  32643. $b$1 = $b$1 | 0;
  32644. var $rem = 0, __stackBase__ = 0;
  32645. __stackBase__ = STACKTOP;
  32646. STACKTOP = STACKTOP + 16 | 0;
  32647. $rem = __stackBase__ | 0;
  32648. ___udivmoddi4($a$0, $a$1, $b$0, $b$1, $rem) | 0;
  32649. STACKTOP = __stackBase__;
  32650. return (tempRet0 = HEAP32[$rem + 4 >> 2] | 0, HEAP32[$rem >> 2] | 0) | 0;
  32651. }
  32652. function ___udivdi3($a$0, $a$1, $b$0, $b$1) {
  32653. $a$0 = $a$0 | 0;
  32654. $a$1 = $a$1 | 0;
  32655. $b$0 = $b$0 | 0;
  32656. $b$1 = $b$1 | 0;
  32657. var $1$0 = 0;
  32658. $1$0 = ___udivmoddi4($a$0, $a$1, $b$0, $b$1, 0) | 0;
  32659. return $1$0 | 0;
  32660. }
  32661. function _roundf(f) {
  32662. f = +f;
  32663. return f >= +0 ? +Math_floor(f + +0.5) : +Math_ceil(f - +0.5); // TODO: use fround?
  32664. }
  32665. function _emscripten_set_current_thread_status(newStatus) {
  32666. newStatus = newStatus|0;
  32667. }
  32668. function _bitshift64Lshr(low, high, bits) {
  32669. low = low|0; high = high|0; bits = bits|0;
  32670. var ander = 0;
  32671. if ((bits|0) < 32) {
  32672. ander = ((1 << bits) - 1)|0;
  32673. tempRet0 = high >>> bits;
  32674. return (low >>> bits) | ((high&ander) << (32 - bits));
  32675. }
  32676. tempRet0 = 0;
  32677. return (high >>> (bits - 32))|0;
  32678. }
  32679. function _emscripten_conditional_set_current_thread_status(expectedStatus, newStatus) {
  32680. expectedStatus = expectedStatus|0;
  32681. newStatus = newStatus|0;
  32682. }
  32683. function _sbrk(increment) {
  32684. increment = increment|0;
  32685. var oldDynamicTop = 0;
  32686. var oldDynamicTopOnChange = 0;
  32687. var newDynamicTop = 0;
  32688. var totalMemory = 0;
  32689. increment = ((increment + 15) & -16)|0;
  32690. totalMemory = getTotalMemory()|0;
  32691. // Perform a compare-and-swap loop to update the new dynamic top value. This is because
  32692. // this function can becalled simultaneously in multiple threads.
  32693. do {
  32694. oldDynamicTop = Atomics_load(HEAP32, DYNAMICTOP_PTR>>2)|0;
  32695. newDynamicTop = oldDynamicTop + increment | 0;
  32696. // Asking to increase dynamic top to a too high value? In pthreads builds we cannot
  32697. // enlarge memory, so this needs to fail.
  32698. if (((increment|0) > 0 & (newDynamicTop|0) < (oldDynamicTop|0)) // Detect and fail if we would wrap around signed 32-bit int.
  32699. | (newDynamicTop|0) < 0 // Also underflow, sbrk() should be able to be used to subtract.
  32700. | (newDynamicTop|0) > (totalMemory|0)) {
  32701. abortOnCannotGrowMemory()|0;
  32702. }
  32703. // Attempt to update the dynamic top to new value. Another thread may have beat this thread to the update,
  32704. // in which case we will need to start over by iterating the loop body again.
  32705. oldDynamicTopOnChange = Atomics_compareExchange(HEAP32, DYNAMICTOP_PTR>>2, oldDynamicTop|0, newDynamicTop|0)|0;
  32706. } while((oldDynamicTopOnChange|0) != (oldDynamicTop|0));
  32707. return oldDynamicTop|0;
  32708. }
  32709. function _bitshift64Shl(low, high, bits) {
  32710. low = low|0; high = high|0; bits = bits|0;
  32711. var ander = 0;
  32712. if ((bits|0) < 32) {
  32713. ander = ((1 << bits) - 1)|0;
  32714. tempRet0 = (high << bits) | ((low&(ander << (32 - bits))) >>> (32 - bits));
  32715. return low << bits;
  32716. }
  32717. tempRet0 = low << (bits - 32);
  32718. return 0;
  32719. }
  32720. function _llvm_bswap_i32(x) {
  32721. x = x|0;
  32722. return (((x&0xff)<<24) | (((x>>8)&0xff)<<16) | (((x>>16)&0xff)<<8) | (x>>>24))|0;
  32723. }
  32724. function dynCall_viiiii(index,a1,a2,a3,a4,a5) {
  32725. index = index|0;
  32726. a1=a1|0; a2=a2|0; a3=a3|0; a4=a4|0; a5=a5|0;
  32727. FUNCTION_TABLE_viiiii[index&7](a1|0,a2|0,a3|0,a4|0,a5|0);
  32728. }
  32729. function dynCall_vd(index,a1) {
  32730. index = index|0;
  32731. a1=+a1;
  32732. FUNCTION_TABLE_vd[index&3](+a1);
  32733. }
  32734. function dynCall_vid(index,a1,a2) {
  32735. index = index|0;
  32736. a1=a1|0; a2=+a2;
  32737. FUNCTION_TABLE_vid[index&3](a1|0,+a2);
  32738. }
  32739. function dynCall_vi(index,a1) {
  32740. index = index|0;
  32741. a1=a1|0;
  32742. FUNCTION_TABLE_vi[index&31](a1|0);
  32743. }
  32744. function dynCall_vii(index,a1,a2) {
  32745. index = index|0;
  32746. a1=a1|0; a2=a2|0;
  32747. FUNCTION_TABLE_vii[index&63](a1|0,a2|0);
  32748. }
  32749. function dynCall_ii(index,a1) {
  32750. index = index|0;
  32751. a1=a1|0;
  32752. return FUNCTION_TABLE_ii[index&15](a1|0)|0;
  32753. }
  32754. function dynCall_viddd(index,a1,a2,a3,a4) {
  32755. index = index|0;
  32756. a1=a1|0; a2=+a2; a3=+a3; a4=+a4;
  32757. FUNCTION_TABLE_viddd[index&3](a1|0,+a2,+a3,+a4);
  32758. }
  32759. function dynCall_vidd(index,a1,a2,a3) {
  32760. index = index|0;
  32761. a1=a1|0; a2=+a2; a3=+a3;
  32762. FUNCTION_TABLE_vidd[index&7](a1|0,+a2,+a3);
  32763. }
  32764. function dynCall_iiii(index,a1,a2,a3) {
  32765. index = index|0;
  32766. a1=a1|0; a2=a2|0; a3=a3|0;
  32767. return FUNCTION_TABLE_iiii[index&15](a1|0,a2|0,a3|0)|0;
  32768. }
  32769. function dynCall_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8) {
  32770. index = index|0;
  32771. a1=a1|0; a2=a2|0; a3=a3|0; a4=a4|0; a5=a5|0; a6=a6|0; a7=a7|0; a8=a8|0;
  32772. FUNCTION_TABLE_viiiiiiii[index&3](a1|0,a2|0,a3|0,a4|0,a5|0,a6|0,a7|0,a8|0);
  32773. }
  32774. function dynCall_viiiiii(index,a1,a2,a3,a4,a5,a6) {
  32775. index = index|0;
  32776. a1=a1|0; a2=a2|0; a3=a3|0; a4=a4|0; a5=a5|0; a6=a6|0;
  32777. FUNCTION_TABLE_viiiiii[index&3](a1|0,a2|0,a3|0,a4|0,a5|0,a6|0);
  32778. }
  32779. function dynCall_viii(index,a1,a2,a3) {
  32780. index = index|0;
  32781. a1=a1|0; a2=a2|0; a3=a3|0;
  32782. FUNCTION_TABLE_viii[index&31](a1|0,a2|0,a3|0);
  32783. }
  32784. function dynCall_vidddd(index,a1,a2,a3,a4,a5) {
  32785. index = index|0;
  32786. a1=a1|0; a2=+a2; a3=+a3; a4=+a4; a5=+a5;
  32787. FUNCTION_TABLE_vidddd[index&3](a1|0,+a2,+a3,+a4,+a5);
  32788. }
  32789. function dynCall_vdi(index,a1,a2) {
  32790. index = index|0;
  32791. a1=+a1; a2=a2|0;
  32792. FUNCTION_TABLE_vdi[index&1](+a1,a2|0);
  32793. }
  32794. function dynCall_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7) {
  32795. index = index|0;
  32796. a1=a1|0; a2=a2|0; a3=a3|0; a4=a4|0; a5=a5|0; a6=a6|0; a7=a7|0;
  32797. FUNCTION_TABLE_viiiiiii[index&3](a1|0,a2|0,a3|0,a4|0,a5|0,a6|0,a7|0);
  32798. }
  32799. function dynCall_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9) {
  32800. index = index|0;
  32801. a1=a1|0; a2=a2|0; a3=a3|0; a4=a4|0; a5=a5|0; a6=a6|0; a7=a7|0; a8=a8|0; a9=a9|0;
  32802. FUNCTION_TABLE_viiiiiiiii[index&3](a1|0,a2|0,a3|0,a4|0,a5|0,a6|0,a7|0,a8|0,a9|0);
  32803. }
  32804. function dynCall_iii(index,a1,a2) {
  32805. index = index|0;
  32806. a1=a1|0; a2=a2|0;
  32807. return FUNCTION_TABLE_iii[index&3](a1|0,a2|0)|0;
  32808. }
  32809. function dynCall_i(index) {
  32810. index = index|0;
  32811. return FUNCTION_TABLE_i[index&3]()|0;
  32812. }
  32813. function dynCall_vdddddd(index,a1,a2,a3,a4,a5,a6) {
  32814. index = index|0;
  32815. a1=+a1; a2=+a2; a3=+a3; a4=+a4; a5=+a5; a6=+a6;
  32816. FUNCTION_TABLE_vdddddd[index&1](+a1,+a2,+a3,+a4,+a5,+a6);
  32817. }
  32818. function dynCall_vdddd(index,a1,a2,a3,a4) {
  32819. index = index|0;
  32820. a1=+a1; a2=+a2; a3=+a3; a4=+a4;
  32821. FUNCTION_TABLE_vdddd[index&3](+a1,+a2,+a3,+a4);
  32822. }
  32823. function dynCall_vdd(index,a1,a2) {
  32824. index = index|0;
  32825. a1=+a1; a2=+a2;
  32826. FUNCTION_TABLE_vdd[index&3](+a1,+a2);
  32827. }
  32828. function dynCall_v(index) {
  32829. index = index|0;
  32830. FUNCTION_TABLE_v[index&7]();
  32831. }
  32832. function dynCall_viid(index,a1,a2,a3) {
  32833. index = index|0;
  32834. a1=a1|0; a2=a2|0; a3=+a3;
  32835. FUNCTION_TABLE_viid[index&1](a1|0,a2|0,+a3);
  32836. }
  32837. function dynCall_viiii(index,a1,a2,a3,a4) {
  32838. index = index|0;
  32839. a1=a1|0; a2=a2|0; a3=a3|0; a4=a4|0;
  32840. FUNCTION_TABLE_viiii[index&31](a1|0,a2|0,a3|0,a4|0);
  32841. }
  32842. function b0(p0,p1,p2,p3,p4) {
  32843. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0; nullFunc_viiiii(0);
  32844. }
  32845. function _emscripten_glUniform4i__wrapper(p0,p1,p2,p3,p4) {
  32846. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0; _emscripten_glUniform4i(p0|0,p1|0,p2|0,p3|0,p4|0);
  32847. }
  32848. function _emscripten_glFramebufferTexture2D__wrapper(p0,p1,p2,p3,p4) {
  32849. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0; _emscripten_glFramebufferTexture2D(p0|0,p1|0,p2|0,p3|0,p4|0);
  32850. }
  32851. function _emscripten_glShaderBinary__wrapper(p0,p1,p2,p3,p4) {
  32852. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0; _emscripten_glShaderBinary(p0|0,p1|0,p2|0,p3|0,p4|0);
  32853. }
  32854. function _emscripten_glDrawElementsInstanced__wrapper(p0,p1,p2,p3,p4) {
  32855. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0; _emscripten_glDrawElementsInstanced(p0|0,p1|0,p2|0,p3|0,p4|0);
  32856. }
  32857. function b1(p0) {
  32858. p0 = +p0; nullFunc_vd(1);
  32859. }
  32860. function _emscripten_glClearDepth__wrapper(p0) {
  32861. p0 = +p0; _emscripten_glClearDepth(+p0);
  32862. }
  32863. function _emscripten_glClearDepthf__wrapper(p0) {
  32864. p0 = +p0; _emscripten_glClearDepthf(+p0);
  32865. }
  32866. function _emscripten_glLineWidth__wrapper(p0) {
  32867. p0 = +p0; _emscripten_glLineWidth(+p0);
  32868. }
  32869. function b2(p0,p1) {
  32870. p0 = p0|0;p1 = +p1; nullFunc_vid(2);
  32871. }
  32872. function _emscripten_glUniform1f__wrapper(p0,p1) {
  32873. p0 = p0|0;p1 = +p1; _emscripten_glUniform1f(p0|0,+p1);
  32874. }
  32875. function _emscripten_glVertexAttrib1f__wrapper(p0,p1) {
  32876. p0 = p0|0;p1 = +p1; _emscripten_glVertexAttrib1f(p0|0,+p1);
  32877. }
  32878. function b3(p0) {
  32879. p0 = p0|0; nullFunc_vi(3);
  32880. }
  32881. function _emscripten_glDeleteShader__wrapper(p0) {
  32882. p0 = p0|0; _emscripten_glDeleteShader(p0|0);
  32883. }
  32884. function _emscripten_glCompileShader__wrapper(p0) {
  32885. p0 = p0|0; _emscripten_glCompileShader(p0|0);
  32886. }
  32887. function _emscripten_glDeleteProgram__wrapper(p0) {
  32888. p0 = p0|0; _emscripten_glDeleteProgram(p0|0);
  32889. }
  32890. function _emscripten_glLinkProgram__wrapper(p0) {
  32891. p0 = p0|0; _emscripten_glLinkProgram(p0|0);
  32892. }
  32893. function _emscripten_glUseProgram__wrapper(p0) {
  32894. p0 = p0|0; _emscripten_glUseProgram(p0|0);
  32895. }
  32896. function _emscripten_glValidateProgram__wrapper(p0) {
  32897. p0 = p0|0; _emscripten_glValidateProgram(p0|0);
  32898. }
  32899. function _emscripten_glDeleteObjectARB__wrapper(p0) {
  32900. p0 = p0|0; _emscripten_glDeleteObjectARB(p0|0);
  32901. }
  32902. function _emscripten_glEnableClientState__wrapper(p0) {
  32903. p0 = p0|0; _emscripten_glEnableClientState(p0|0);
  32904. }
  32905. function _emscripten_glClientActiveTexture__wrapper(p0) {
  32906. p0 = p0|0; _emscripten_glClientActiveTexture(p0|0);
  32907. }
  32908. function _emscripten_glBindVertexArray__wrapper(p0) {
  32909. p0 = p0|0; _emscripten_glBindVertexArray(p0|0);
  32910. }
  32911. function _emscripten_glMatrixMode__wrapper(p0) {
  32912. p0 = p0|0; _emscripten_glMatrixMode(p0|0);
  32913. }
  32914. function _emscripten_glLoadMatrixf__wrapper(p0) {
  32915. p0 = p0|0; _emscripten_glLoadMatrixf(p0|0);
  32916. }
  32917. function _emscripten_glEnableVertexAttribArray__wrapper(p0) {
  32918. p0 = p0|0; _emscripten_glEnableVertexAttribArray(p0|0);
  32919. }
  32920. function _emscripten_glDisableVertexAttribArray__wrapper(p0) {
  32921. p0 = p0|0; _emscripten_glDisableVertexAttribArray(p0|0);
  32922. }
  32923. function _emscripten_glDepthFunc__wrapper(p0) {
  32924. p0 = p0|0; _emscripten_glDepthFunc(p0|0);
  32925. }
  32926. function _emscripten_glEnable__wrapper(p0) {
  32927. p0 = p0|0; _emscripten_glEnable(p0|0);
  32928. }
  32929. function _emscripten_glDisable__wrapper(p0) {
  32930. p0 = p0|0; _emscripten_glDisable(p0|0);
  32931. }
  32932. function _emscripten_glFrontFace__wrapper(p0) {
  32933. p0 = p0|0; _emscripten_glFrontFace(p0|0);
  32934. }
  32935. function _emscripten_glCullFace__wrapper(p0) {
  32936. p0 = p0|0; _emscripten_glCullFace(p0|0);
  32937. }
  32938. function _emscripten_glClear__wrapper(p0) {
  32939. p0 = p0|0; _emscripten_glClear(p0|0);
  32940. }
  32941. function _emscripten_glClearStencil__wrapper(p0) {
  32942. p0 = p0|0; _emscripten_glClearStencil(p0|0);
  32943. }
  32944. function _emscripten_glDepthMask__wrapper(p0) {
  32945. p0 = p0|0; _emscripten_glDepthMask(p0|0);
  32946. }
  32947. function _emscripten_glStencilMask__wrapper(p0) {
  32948. p0 = p0|0; _emscripten_glStencilMask(p0|0);
  32949. }
  32950. function _emscripten_glGenerateMipmap__wrapper(p0) {
  32951. p0 = p0|0; _emscripten_glGenerateMipmap(p0|0);
  32952. }
  32953. function _emscripten_glActiveTexture__wrapper(p0) {
  32954. p0 = p0|0; _emscripten_glActiveTexture(p0|0);
  32955. }
  32956. function _emscripten_glBlendEquation__wrapper(p0) {
  32957. p0 = p0|0; _emscripten_glBlendEquation(p0|0);
  32958. }
  32959. function b4(p0,p1) {
  32960. p0 = p0|0;p1 = p1|0; nullFunc_vii(4);
  32961. }
  32962. function _emscripten_glPixelStorei__wrapper(p0,p1) {
  32963. p0 = p0|0;p1 = p1|0; _emscripten_glPixelStorei(p0|0,p1|0);
  32964. }
  32965. function _emscripten_glGetIntegerv__wrapper(p0,p1) {
  32966. p0 = p0|0;p1 = p1|0; _emscripten_glGetIntegerv(p0|0,p1|0);
  32967. }
  32968. function _emscripten_glGetFloatv__wrapper(p0,p1) {
  32969. p0 = p0|0;p1 = p1|0; _emscripten_glGetFloatv(p0|0,p1|0);
  32970. }
  32971. function _emscripten_glGetBooleanv__wrapper(p0,p1) {
  32972. p0 = p0|0;p1 = p1|0; _emscripten_glGetBooleanv(p0|0,p1|0);
  32973. }
  32974. function _emscripten_glGenTextures__wrapper(p0,p1) {
  32975. p0 = p0|0;p1 = p1|0; _emscripten_glGenTextures(p0|0,p1|0);
  32976. }
  32977. function _emscripten_glDeleteTextures__wrapper(p0,p1) {
  32978. p0 = p0|0;p1 = p1|0; _emscripten_glDeleteTextures(p0|0,p1|0);
  32979. }
  32980. function _emscripten_glBindTexture__wrapper(p0,p1) {
  32981. p0 = p0|0;p1 = p1|0; _emscripten_glBindTexture(p0|0,p1|0);
  32982. }
  32983. function _emscripten_glGenBuffers__wrapper(p0,p1) {
  32984. p0 = p0|0;p1 = p1|0; _emscripten_glGenBuffers(p0|0,p1|0);
  32985. }
  32986. function _emscripten_glDeleteBuffers__wrapper(p0,p1) {
  32987. p0 = p0|0;p1 = p1|0; _emscripten_glDeleteBuffers(p0|0,p1|0);
  32988. }
  32989. function _emscripten_glGenRenderbuffers__wrapper(p0,p1) {
  32990. p0 = p0|0;p1 = p1|0; _emscripten_glGenRenderbuffers(p0|0,p1|0);
  32991. }
  32992. function _emscripten_glDeleteRenderbuffers__wrapper(p0,p1) {
  32993. p0 = p0|0;p1 = p1|0; _emscripten_glDeleteRenderbuffers(p0|0,p1|0);
  32994. }
  32995. function _emscripten_glBindRenderbuffer__wrapper(p0,p1) {
  32996. p0 = p0|0;p1 = p1|0; _emscripten_glBindRenderbuffer(p0|0,p1|0);
  32997. }
  32998. function _emscripten_glUniform1i__wrapper(p0,p1) {
  32999. p0 = p0|0;p1 = p1|0; _emscripten_glUniform1i(p0|0,p1|0);
  33000. }
  33001. function _emscripten_glBindBuffer__wrapper(p0,p1) {
  33002. p0 = p0|0;p1 = p1|0; _emscripten_glBindBuffer(p0|0,p1|0);
  33003. }
  33004. function _emscripten_glVertexAttrib1fv__wrapper(p0,p1) {
  33005. p0 = p0|0;p1 = p1|0; _emscripten_glVertexAttrib1fv(p0|0,p1|0);
  33006. }
  33007. function _emscripten_glVertexAttrib2fv__wrapper(p0,p1) {
  33008. p0 = p0|0;p1 = p1|0; _emscripten_glVertexAttrib2fv(p0|0,p1|0);
  33009. }
  33010. function _emscripten_glVertexAttrib3fv__wrapper(p0,p1) {
  33011. p0 = p0|0;p1 = p1|0; _emscripten_glVertexAttrib3fv(p0|0,p1|0);
  33012. }
  33013. function _emscripten_glVertexAttrib4fv__wrapper(p0,p1) {
  33014. p0 = p0|0;p1 = p1|0; _emscripten_glVertexAttrib4fv(p0|0,p1|0);
  33015. }
  33016. function _emscripten_glAttachShader__wrapper(p0,p1) {
  33017. p0 = p0|0;p1 = p1|0; _emscripten_glAttachShader(p0|0,p1|0);
  33018. }
  33019. function _emscripten_glDetachShader__wrapper(p0,p1) {
  33020. p0 = p0|0;p1 = p1|0; _emscripten_glDetachShader(p0|0,p1|0);
  33021. }
  33022. function _emscripten_glBindFramebuffer__wrapper(p0,p1) {
  33023. p0 = p0|0;p1 = p1|0; _emscripten_glBindFramebuffer(p0|0,p1|0);
  33024. }
  33025. function _emscripten_glGenFramebuffers__wrapper(p0,p1) {
  33026. p0 = p0|0;p1 = p1|0; _emscripten_glGenFramebuffers(p0|0,p1|0);
  33027. }
  33028. function _emscripten_glDeleteFramebuffers__wrapper(p0,p1) {
  33029. p0 = p0|0;p1 = p1|0; _emscripten_glDeleteFramebuffers(p0|0,p1|0);
  33030. }
  33031. function _emscripten_glBindProgramARB__wrapper(p0,p1) {
  33032. p0 = p0|0;p1 = p1|0; _emscripten_glBindProgramARB(p0|0,p1|0);
  33033. }
  33034. function _emscripten_glGetPointerv__wrapper(p0,p1) {
  33035. p0 = p0|0;p1 = p1|0; _emscripten_glGetPointerv(p0|0,p1|0);
  33036. }
  33037. function _emscripten_glGenVertexArrays__wrapper(p0,p1) {
  33038. p0 = p0|0;p1 = p1|0; _emscripten_glGenVertexArrays(p0|0,p1|0);
  33039. }
  33040. function _emscripten_glDeleteVertexArrays__wrapper(p0,p1) {
  33041. p0 = p0|0;p1 = p1|0; _emscripten_glDeleteVertexArrays(p0|0,p1|0);
  33042. }
  33043. function _emscripten_glVertexAttribDivisor__wrapper(p0,p1) {
  33044. p0 = p0|0;p1 = p1|0; _emscripten_glVertexAttribDivisor(p0|0,p1|0);
  33045. }
  33046. function _emscripten_glBlendFunc__wrapper(p0,p1) {
  33047. p0 = p0|0;p1 = p1|0; _emscripten_glBlendFunc(p0|0,p1|0);
  33048. }
  33049. function _emscripten_glBlendEquationSeparate__wrapper(p0,p1) {
  33050. p0 = p0|0;p1 = p1|0; _emscripten_glBlendEquationSeparate(p0|0,p1|0);
  33051. }
  33052. function _emscripten_glStencilMaskSeparate__wrapper(p0,p1) {
  33053. p0 = p0|0;p1 = p1|0; _emscripten_glStencilMaskSeparate(p0|0,p1|0);
  33054. }
  33055. function _emscripten_glHint__wrapper(p0,p1) {
  33056. p0 = p0|0;p1 = p1|0; _emscripten_glHint(p0|0,p1|0);
  33057. }
  33058. function _emscripten_glDrawBuffers__wrapper(p0,p1) {
  33059. p0 = p0|0;p1 = p1|0; _emscripten_glDrawBuffers(p0|0,p1|0);
  33060. }
  33061. function b5(p0) {
  33062. p0 = p0|0; nullFunc_ii(5);return 0;
  33063. }
  33064. function _emscripten_glGetString__wrapper(p0) {
  33065. p0 = p0|0; return _emscripten_glGetString(p0|0)|0;
  33066. }
  33067. function _emscripten_glIsTexture__wrapper(p0) {
  33068. p0 = p0|0; return _emscripten_glIsTexture(p0|0)|0;
  33069. }
  33070. function _emscripten_glIsBuffer__wrapper(p0) {
  33071. p0 = p0|0; return _emscripten_glIsBuffer(p0|0)|0;
  33072. }
  33073. function _emscripten_glIsRenderbuffer__wrapper(p0) {
  33074. p0 = p0|0; return _emscripten_glIsRenderbuffer(p0|0)|0;
  33075. }
  33076. function _emscripten_glCreateShader__wrapper(p0) {
  33077. p0 = p0|0; return _emscripten_glCreateShader(p0|0)|0;
  33078. }
  33079. function _emscripten_glIsShader__wrapper(p0) {
  33080. p0 = p0|0; return _emscripten_glIsShader(p0|0)|0;
  33081. }
  33082. function _emscripten_glIsProgram__wrapper(p0) {
  33083. p0 = p0|0; return _emscripten_glIsProgram(p0|0)|0;
  33084. }
  33085. function _emscripten_glIsFramebuffer__wrapper(p0) {
  33086. p0 = p0|0; return _emscripten_glIsFramebuffer(p0|0)|0;
  33087. }
  33088. function _emscripten_glCheckFramebufferStatus__wrapper(p0) {
  33089. p0 = p0|0; return _emscripten_glCheckFramebufferStatus(p0|0)|0;
  33090. }
  33091. function _emscripten_glIsEnabled__wrapper(p0) {
  33092. p0 = p0|0; return _emscripten_glIsEnabled(p0|0)|0;
  33093. }
  33094. function b6(p0,p1,p2,p3) {
  33095. p0 = p0|0;p1 = +p1;p2 = +p2;p3 = +p3; nullFunc_viddd(6);
  33096. }
  33097. function _emscripten_glUniform3f__wrapper(p0,p1,p2,p3) {
  33098. p0 = p0|0;p1 = +p1;p2 = +p2;p3 = +p3; _emscripten_glUniform3f(p0|0,+p1,+p2,+p3);
  33099. }
  33100. function _emscripten_glVertexAttrib3f__wrapper(p0,p1,p2,p3) {
  33101. p0 = p0|0;p1 = +p1;p2 = +p2;p3 = +p3; _emscripten_glVertexAttrib3f(p0|0,+p1,+p2,+p3);
  33102. }
  33103. function b7(p0,p1,p2) {
  33104. p0 = p0|0;p1 = +p1;p2 = +p2; nullFunc_vidd(7);
  33105. }
  33106. function _emscripten_glUniform2f__wrapper(p0,p1,p2) {
  33107. p0 = p0|0;p1 = +p1;p2 = +p2; _emscripten_glUniform2f(p0|0,+p1,+p2);
  33108. }
  33109. function _emscripten_glVertexAttrib2f__wrapper(p0,p1,p2) {
  33110. p0 = p0|0;p1 = +p1;p2 = +p2; _emscripten_glVertexAttrib2f(p0|0,+p1,+p2);
  33111. }
  33112. function b8(p0,p1,p2) {
  33113. p0 = p0|0;p1 = p1|0;p2 = p2|0; nullFunc_iiii(8);return 0;
  33114. }
  33115. function b9(p0,p1,p2,p3,p4,p5,p6,p7) {
  33116. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0;p5 = p5|0;p6 = p6|0;p7 = p7|0; nullFunc_viiiiiiii(9);
  33117. }
  33118. function _emscripten_glCompressedTexImage2D__wrapper(p0,p1,p2,p3,p4,p5,p6,p7) {
  33119. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0;p5 = p5|0;p6 = p6|0;p7 = p7|0; _emscripten_glCompressedTexImage2D(p0|0,p1|0,p2|0,p3|0,p4|0,p5|0,p6|0,p7|0);
  33120. }
  33121. function _emscripten_glCopyTexImage2D__wrapper(p0,p1,p2,p3,p4,p5,p6,p7) {
  33122. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0;p5 = p5|0;p6 = p6|0;p7 = p7|0; _emscripten_glCopyTexImage2D(p0|0,p1|0,p2|0,p3|0,p4|0,p5|0,p6|0,p7|0);
  33123. }
  33124. function _emscripten_glCopyTexSubImage2D__wrapper(p0,p1,p2,p3,p4,p5,p6,p7) {
  33125. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0;p5 = p5|0;p6 = p6|0;p7 = p7|0; _emscripten_glCopyTexSubImage2D(p0|0,p1|0,p2|0,p3|0,p4|0,p5|0,p6|0,p7|0);
  33126. }
  33127. function b10(p0,p1,p2,p3,p4,p5) {
  33128. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0;p5 = p5|0; nullFunc_viiiiii(10);
  33129. }
  33130. function _emscripten_glDrawRangeElements__wrapper(p0,p1,p2,p3,p4,p5) {
  33131. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0;p5 = p5|0; _emscripten_glDrawRangeElements(p0|0,p1|0,p2|0,p3|0,p4|0,p5|0);
  33132. }
  33133. function _emscripten_glVertexAttribPointer__wrapper(p0,p1,p2,p3,p4,p5) {
  33134. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0;p5 = p5|0; _emscripten_glVertexAttribPointer(p0|0,p1|0,p2|0,p3|0,p4|0,p5|0);
  33135. }
  33136. function b11(p0,p1,p2) {
  33137. p0 = p0|0;p1 = p1|0;p2 = p2|0; nullFunc_viii(11);
  33138. }
  33139. function _emscripten_glGetTexParameterfv__wrapper(p0,p1,p2) {
  33140. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetTexParameterfv(p0|0,p1|0,p2|0);
  33141. }
  33142. function _emscripten_glGetTexParameteriv__wrapper(p0,p1,p2) {
  33143. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetTexParameteriv(p0|0,p1|0,p2|0);
  33144. }
  33145. function _emscripten_glTexParameterfv__wrapper(p0,p1,p2) {
  33146. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glTexParameterfv(p0|0,p1|0,p2|0);
  33147. }
  33148. function _emscripten_glTexParameteriv__wrapper(p0,p1,p2) {
  33149. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glTexParameteriv(p0|0,p1|0,p2|0);
  33150. }
  33151. function _emscripten_glGetBufferParameteriv__wrapper(p0,p1,p2) {
  33152. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetBufferParameteriv(p0|0,p1|0,p2|0);
  33153. }
  33154. function _emscripten_glGetRenderbufferParameteriv__wrapper(p0,p1,p2) {
  33155. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetRenderbufferParameteriv(p0|0,p1|0,p2|0);
  33156. }
  33157. function _emscripten_glGetUniformfv__wrapper(p0,p1,p2) {
  33158. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetUniformfv(p0|0,p1|0,p2|0);
  33159. }
  33160. function _emscripten_glGetUniformiv__wrapper(p0,p1,p2) {
  33161. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetUniformiv(p0|0,p1|0,p2|0);
  33162. }
  33163. function _emscripten_glGetVertexAttribfv__wrapper(p0,p1,p2) {
  33164. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetVertexAttribfv(p0|0,p1|0,p2|0);
  33165. }
  33166. function _emscripten_glGetVertexAttribiv__wrapper(p0,p1,p2) {
  33167. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetVertexAttribiv(p0|0,p1|0,p2|0);
  33168. }
  33169. function _emscripten_glGetVertexAttribPointerv__wrapper(p0,p1,p2) {
  33170. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetVertexAttribPointerv(p0|0,p1|0,p2|0);
  33171. }
  33172. function _emscripten_glUniform2i__wrapper(p0,p1,p2) {
  33173. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform2i(p0|0,p1|0,p2|0);
  33174. }
  33175. function _emscripten_glUniform1iv__wrapper(p0,p1,p2) {
  33176. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform1iv(p0|0,p1|0,p2|0);
  33177. }
  33178. function _emscripten_glUniform2iv__wrapper(p0,p1,p2) {
  33179. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform2iv(p0|0,p1|0,p2|0);
  33180. }
  33181. function _emscripten_glUniform3iv__wrapper(p0,p1,p2) {
  33182. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform3iv(p0|0,p1|0,p2|0);
  33183. }
  33184. function _emscripten_glUniform4iv__wrapper(p0,p1,p2) {
  33185. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform4iv(p0|0,p1|0,p2|0);
  33186. }
  33187. function _emscripten_glUniform1fv__wrapper(p0,p1,p2) {
  33188. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform1fv(p0|0,p1|0,p2|0);
  33189. }
  33190. function _emscripten_glUniform2fv__wrapper(p0,p1,p2) {
  33191. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform2fv(p0|0,p1|0,p2|0);
  33192. }
  33193. function _emscripten_glUniform3fv__wrapper(p0,p1,p2) {
  33194. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform3fv(p0|0,p1|0,p2|0);
  33195. }
  33196. function _emscripten_glUniform4fv__wrapper(p0,p1,p2) {
  33197. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform4fv(p0|0,p1|0,p2|0);
  33198. }
  33199. function _emscripten_glGetShaderiv__wrapper(p0,p1,p2) {
  33200. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetShaderiv(p0|0,p1|0,p2|0);
  33201. }
  33202. function _emscripten_glGetProgramiv__wrapper(p0,p1,p2) {
  33203. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetProgramiv(p0|0,p1|0,p2|0);
  33204. }
  33205. function _emscripten_glBindAttribLocation__wrapper(p0,p1,p2) {
  33206. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glBindAttribLocation(p0|0,p1|0,p2|0);
  33207. }
  33208. function _emscripten_glGetObjectParameterivARB__wrapper(p0,p1,p2) {
  33209. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetObjectParameterivARB(p0|0,p1|0,p2|0);
  33210. }
  33211. function _emscripten_glNormalPointer__wrapper(p0,p1,p2) {
  33212. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glNormalPointer(p0|0,p1|0,p2|0);
  33213. }
  33214. function _emscripten_glDrawArrays__wrapper(p0,p1,p2) {
  33215. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glDrawArrays(p0|0,p1|0,p2|0);
  33216. }
  33217. function _emscripten_glTexParameteri__wrapper(p0,p1,p2) {
  33218. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glTexParameteri(p0|0,p1|0,p2|0);
  33219. }
  33220. function _emscripten_glStencilFunc__wrapper(p0,p1,p2) {
  33221. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glStencilFunc(p0|0,p1|0,p2|0);
  33222. }
  33223. function _emscripten_glStencilOp__wrapper(p0,p1,p2) {
  33224. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glStencilOp(p0|0,p1|0,p2|0);
  33225. }
  33226. function b12(p0,p1,p2,p3,p4) {
  33227. p0 = p0|0;p1 = +p1;p2 = +p2;p3 = +p3;p4 = +p4; nullFunc_vidddd(12);
  33228. }
  33229. function _emscripten_glUniform4f__wrapper(p0,p1,p2,p3,p4) {
  33230. p0 = p0|0;p1 = +p1;p2 = +p2;p3 = +p3;p4 = +p4; _emscripten_glUniform4f(p0|0,+p1,+p2,+p3,+p4);
  33231. }
  33232. function _emscripten_glVertexAttrib4f__wrapper(p0,p1,p2,p3,p4) {
  33233. p0 = p0|0;p1 = +p1;p2 = +p2;p3 = +p3;p4 = +p4; _emscripten_glVertexAttrib4f(p0|0,+p1,+p2,+p3,+p4);
  33234. }
  33235. function b13(p0,p1) {
  33236. p0 = +p0;p1 = p1|0; nullFunc_vdi(13);
  33237. }
  33238. function _emscripten_glSampleCoverage__wrapper(p0,p1) {
  33239. p0 = +p0;p1 = p1|0; _emscripten_glSampleCoverage(+p0,p1|0);
  33240. }
  33241. function b14(p0,p1,p2,p3,p4,p5,p6) {
  33242. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0;p5 = p5|0;p6 = p6|0; nullFunc_viiiiiii(14);
  33243. }
  33244. function _emscripten_glReadPixels__wrapper(p0,p1,p2,p3,p4,p5,p6) {
  33245. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0;p5 = p5|0;p6 = p6|0; _emscripten_glReadPixels(p0|0,p1|0,p2|0,p3|0,p4|0,p5|0,p6|0);
  33246. }
  33247. function _emscripten_glGetActiveUniform__wrapper(p0,p1,p2,p3,p4,p5,p6) {
  33248. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0;p5 = p5|0;p6 = p6|0; _emscripten_glGetActiveUniform(p0|0,p1|0,p2|0,p3|0,p4|0,p5|0,p6|0);
  33249. }
  33250. function _emscripten_glGetActiveAttrib__wrapper(p0,p1,p2,p3,p4,p5,p6) {
  33251. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0;p5 = p5|0;p6 = p6|0; _emscripten_glGetActiveAttrib(p0|0,p1|0,p2|0,p3|0,p4|0,p5|0,p6|0);
  33252. }
  33253. function b15(p0,p1,p2,p3,p4,p5,p6,p7,p8) {
  33254. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0;p5 = p5|0;p6 = p6|0;p7 = p7|0;p8 = p8|0; nullFunc_viiiiiiiii(15);
  33255. }
  33256. function _emscripten_glCompressedTexSubImage2D__wrapper(p0,p1,p2,p3,p4,p5,p6,p7,p8) {
  33257. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0;p5 = p5|0;p6 = p6|0;p7 = p7|0;p8 = p8|0; _emscripten_glCompressedTexSubImage2D(p0|0,p1|0,p2|0,p3|0,p4|0,p5|0,p6|0,p7|0,p8|0);
  33258. }
  33259. function _emscripten_glTexImage2D__wrapper(p0,p1,p2,p3,p4,p5,p6,p7,p8) {
  33260. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0;p5 = p5|0;p6 = p6|0;p7 = p7|0;p8 = p8|0; _emscripten_glTexImage2D(p0|0,p1|0,p2|0,p3|0,p4|0,p5|0,p6|0,p7|0,p8|0);
  33261. }
  33262. function _emscripten_glTexSubImage2D__wrapper(p0,p1,p2,p3,p4,p5,p6,p7,p8) {
  33263. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0;p5 = p5|0;p6 = p6|0;p7 = p7|0;p8 = p8|0; _emscripten_glTexSubImage2D(p0|0,p1|0,p2|0,p3|0,p4|0,p5|0,p6|0,p7|0,p8|0);
  33264. }
  33265. function b16(p0,p1) {
  33266. p0 = p0|0;p1 = p1|0; nullFunc_iii(16);return 0;
  33267. }
  33268. function _emscripten_glGetUniformLocation__wrapper(p0,p1) {
  33269. p0 = p0|0;p1 = p1|0; return _emscripten_glGetUniformLocation(p0|0,p1|0)|0;
  33270. }
  33271. function _emscripten_glGetAttribLocation__wrapper(p0,p1) {
  33272. p0 = p0|0;p1 = p1|0; return _emscripten_glGetAttribLocation(p0|0,p1|0)|0;
  33273. }
  33274. function b17() {
  33275. ; nullFunc_i(17);return 0;
  33276. }
  33277. function _emscripten_glCreateProgram__wrapper() {
  33278. ; return _emscripten_glCreateProgram()|0;
  33279. }
  33280. function _emscripten_glGetError__wrapper() {
  33281. ; return _emscripten_glGetError()|0;
  33282. }
  33283. function b18(p0,p1,p2,p3,p4,p5) {
  33284. p0 = +p0;p1 = +p1;p2 = +p2;p3 = +p3;p4 = +p4;p5 = +p5; nullFunc_vdddddd(18);
  33285. }
  33286. function _emscripten_glFrustum__wrapper(p0,p1,p2,p3,p4,p5) {
  33287. p0 = +p0;p1 = +p1;p2 = +p2;p3 = +p3;p4 = +p4;p5 = +p5; _emscripten_glFrustum(+p0,+p1,+p2,+p3,+p4,+p5);
  33288. }
  33289. function b19(p0,p1,p2,p3) {
  33290. p0 = +p0;p1 = +p1;p2 = +p2;p3 = +p3; nullFunc_vdddd(19);
  33291. }
  33292. function _emscripten_glRotatef__wrapper(p0,p1,p2,p3) {
  33293. p0 = +p0;p1 = +p1;p2 = +p2;p3 = +p3; _emscripten_glRotatef(+p0,+p1,+p2,+p3);
  33294. }
  33295. function _emscripten_glClearColor__wrapper(p0,p1,p2,p3) {
  33296. p0 = +p0;p1 = +p1;p2 = +p2;p3 = +p3; _emscripten_glClearColor(+p0,+p1,+p2,+p3);
  33297. }
  33298. function _emscripten_glBlendColor__wrapper(p0,p1,p2,p3) {
  33299. p0 = +p0;p1 = +p1;p2 = +p2;p3 = +p3; _emscripten_glBlendColor(+p0,+p1,+p2,+p3);
  33300. }
  33301. function b20(p0,p1) {
  33302. p0 = +p0;p1 = +p1; nullFunc_vdd(20);
  33303. }
  33304. function _emscripten_glDepthRange__wrapper(p0,p1) {
  33305. p0 = +p0;p1 = +p1; _emscripten_glDepthRange(+p0,+p1);
  33306. }
  33307. function _emscripten_glDepthRangef__wrapper(p0,p1) {
  33308. p0 = +p0;p1 = +p1; _emscripten_glDepthRangef(+p0,+p1);
  33309. }
  33310. function _emscripten_glPolygonOffset__wrapper(p0,p1) {
  33311. p0 = +p0;p1 = +p1; _emscripten_glPolygonOffset(+p0,+p1);
  33312. }
  33313. function b21() {
  33314. ; nullFunc_v(21);
  33315. }
  33316. function _emscripten_glLoadIdentity__wrapper() {
  33317. ; _emscripten_glLoadIdentity();
  33318. }
  33319. function _emscripten_glReleaseShaderCompiler__wrapper() {
  33320. ; _emscripten_glReleaseShaderCompiler();
  33321. }
  33322. function _emscripten_glFinish__wrapper() {
  33323. ; _emscripten_glFinish();
  33324. }
  33325. function _emscripten_glFlush__wrapper() {
  33326. ; _emscripten_glFlush();
  33327. }
  33328. function b22(p0,p1,p2) {
  33329. p0 = p0|0;p1 = p1|0;p2 = +p2; nullFunc_viid(22);
  33330. }
  33331. function _emscripten_glTexParameterf__wrapper(p0,p1,p2) {
  33332. p0 = p0|0;p1 = p1|0;p2 = +p2; _emscripten_glTexParameterf(p0|0,p1|0,+p2);
  33333. }
  33334. function b23(p0,p1,p2,p3) {
  33335. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; nullFunc_viiii(23);
  33336. }
  33337. function _emscripten_glBufferData__wrapper(p0,p1,p2,p3) {
  33338. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glBufferData(p0|0,p1|0,p2|0,p3|0);
  33339. }
  33340. function _emscripten_glBufferSubData__wrapper(p0,p1,p2,p3) {
  33341. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glBufferSubData(p0|0,p1|0,p2|0,p3|0);
  33342. }
  33343. function _emscripten_glUniform3i__wrapper(p0,p1,p2,p3) {
  33344. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glUniform3i(p0|0,p1|0,p2|0,p3|0);
  33345. }
  33346. function _emscripten_glUniformMatrix2fv__wrapper(p0,p1,p2,p3) {
  33347. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glUniformMatrix2fv(p0|0,p1|0,p2|0,p3|0);
  33348. }
  33349. function _emscripten_glUniformMatrix3fv__wrapper(p0,p1,p2,p3) {
  33350. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glUniformMatrix3fv(p0|0,p1|0,p2|0,p3|0);
  33351. }
  33352. function _emscripten_glUniformMatrix4fv__wrapper(p0,p1,p2,p3) {
  33353. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glUniformMatrix4fv(p0|0,p1|0,p2|0,p3|0);
  33354. }
  33355. function _emscripten_glGetAttachedShaders__wrapper(p0,p1,p2,p3) {
  33356. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetAttachedShaders(p0|0,p1|0,p2|0,p3|0);
  33357. }
  33358. function _emscripten_glShaderSource__wrapper(p0,p1,p2,p3) {
  33359. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glShaderSource(p0|0,p1|0,p2|0,p3|0);
  33360. }
  33361. function _emscripten_glGetShaderSource__wrapper(p0,p1,p2,p3) {
  33362. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetShaderSource(p0|0,p1|0,p2|0,p3|0);
  33363. }
  33364. function _emscripten_glGetShaderInfoLog__wrapper(p0,p1,p2,p3) {
  33365. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetShaderInfoLog(p0|0,p1|0,p2|0,p3|0);
  33366. }
  33367. function _emscripten_glGetShaderPrecisionFormat__wrapper(p0,p1,p2,p3) {
  33368. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetShaderPrecisionFormat(p0|0,p1|0,p2|0,p3|0);
  33369. }
  33370. function _emscripten_glGetProgramInfoLog__wrapper(p0,p1,p2,p3) {
  33371. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetProgramInfoLog(p0|0,p1|0,p2|0,p3|0);
  33372. }
  33373. function _emscripten_glFramebufferRenderbuffer__wrapper(p0,p1,p2,p3) {
  33374. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glFramebufferRenderbuffer(p0|0,p1|0,p2|0,p3|0);
  33375. }
  33376. function _emscripten_glGetFramebufferAttachmentParameteriv__wrapper(p0,p1,p2,p3) {
  33377. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetFramebufferAttachmentParameteriv(p0|0,p1|0,p2|0,p3|0);
  33378. }
  33379. function _emscripten_glGetInfoLogARB__wrapper(p0,p1,p2,p3) {
  33380. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetInfoLogARB(p0|0,p1|0,p2|0,p3|0);
  33381. }
  33382. function _emscripten_glVertexPointer__wrapper(p0,p1,p2,p3) {
  33383. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glVertexPointer(p0|0,p1|0,p2|0,p3|0);
  33384. }
  33385. function _emscripten_glTexCoordPointer__wrapper(p0,p1,p2,p3) {
  33386. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glTexCoordPointer(p0|0,p1|0,p2|0,p3|0);
  33387. }
  33388. function _emscripten_glColorPointer__wrapper(p0,p1,p2,p3) {
  33389. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glColorPointer(p0|0,p1|0,p2|0,p3|0);
  33390. }
  33391. function _emscripten_glDrawElements__wrapper(p0,p1,p2,p3) {
  33392. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glDrawElements(p0|0,p1|0,p2|0,p3|0);
  33393. }
  33394. function _emscripten_glDrawArraysInstanced__wrapper(p0,p1,p2,p3) {
  33395. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glDrawArraysInstanced(p0|0,p1|0,p2|0,p3|0);
  33396. }
  33397. function _emscripten_glViewport__wrapper(p0,p1,p2,p3) {
  33398. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glViewport(p0|0,p1|0,p2|0,p3|0);
  33399. }
  33400. function _emscripten_glScissor__wrapper(p0,p1,p2,p3) {
  33401. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glScissor(p0|0,p1|0,p2|0,p3|0);
  33402. }
  33403. function _emscripten_glColorMask__wrapper(p0,p1,p2,p3) {
  33404. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glColorMask(p0|0,p1|0,p2|0,p3|0);
  33405. }
  33406. function _emscripten_glRenderbufferStorage__wrapper(p0,p1,p2,p3) {
  33407. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glRenderbufferStorage(p0|0,p1|0,p2|0,p3|0);
  33408. }
  33409. function _emscripten_glBlendFuncSeparate__wrapper(p0,p1,p2,p3) {
  33410. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glBlendFuncSeparate(p0|0,p1|0,p2|0,p3|0);
  33411. }
  33412. function _emscripten_glStencilFuncSeparate__wrapper(p0,p1,p2,p3) {
  33413. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glStencilFuncSeparate(p0|0,p1|0,p2|0,p3|0);
  33414. }
  33415. function _emscripten_glStencilOpSeparate__wrapper(p0,p1,p2,p3) {
  33416. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glStencilOpSeparate(p0|0,p1|0,p2|0,p3|0);
  33417. }
  33418. // EMSCRIPTEN_END_FUNCS
  33419. var FUNCTION_TABLE_viiiii = [b0,_KeyCallback,_emscripten_glUniform4i__wrapper,_emscripten_glFramebufferTexture2D__wrapper,_emscripten_glShaderBinary__wrapper,_emscripten_glDrawElementsInstanced__wrapper,b0,b0];
  33420. var FUNCTION_TABLE_vd = [b1,_emscripten_glClearDepth__wrapper,_emscripten_glClearDepthf__wrapper,_emscripten_glLineWidth__wrapper];
  33421. var FUNCTION_TABLE_vid = [b2,_emscripten_glUniform1f__wrapper,_emscripten_glVertexAttrib1f__wrapper,b2];
  33422. var FUNCTION_TABLE_vi = [b3,_emscripten_glDeleteShader__wrapper,_emscripten_glCompileShader__wrapper,_emscripten_glDeleteProgram__wrapper,_emscripten_glLinkProgram__wrapper,_emscripten_glUseProgram__wrapper,_emscripten_glValidateProgram__wrapper,_emscripten_glDeleteObjectARB__wrapper,_emscripten_glEnableClientState__wrapper,_emscripten_glClientActiveTexture__wrapper,_emscripten_glBindVertexArray__wrapper,_emscripten_glMatrixMode__wrapper,_emscripten_glLoadMatrixf__wrapper,_emscripten_glEnableVertexAttribArray__wrapper,_emscripten_glDisableVertexAttribArray__wrapper,_emscripten_glDepthFunc__wrapper,_emscripten_glEnable__wrapper,_emscripten_glDisable__wrapper,_emscripten_glFrontFace__wrapper,_emscripten_glCullFace__wrapper,_emscripten_glClear__wrapper,_emscripten_glClearStencil__wrapper,_emscripten_glDepthMask__wrapper,_emscripten_glStencilMask__wrapper,_emscripten_glGenerateMipmap__wrapper,_emscripten_glActiveTexture__wrapper,_emscripten_glBlendEquation__wrapper,b3,b3
  33423. ,b3,b3,b3];
  33424. var FUNCTION_TABLE_vii = [b4,_ErrorCallback,_CursorEnterCallback,_CharCallback,_WindowIconifyCallback,_emscripten_glPixelStorei__wrapper,_emscripten_glGetIntegerv__wrapper,_emscripten_glGetFloatv__wrapper,_emscripten_glGetBooleanv__wrapper,_emscripten_glGenTextures__wrapper,_emscripten_glDeleteTextures__wrapper,_emscripten_glBindTexture__wrapper,_emscripten_glGenBuffers__wrapper,_emscripten_glDeleteBuffers__wrapper,_emscripten_glGenRenderbuffers__wrapper,_emscripten_glDeleteRenderbuffers__wrapper,_emscripten_glBindRenderbuffer__wrapper,_emscripten_glUniform1i__wrapper,_emscripten_glBindBuffer__wrapper,_emscripten_glVertexAttrib1fv__wrapper,_emscripten_glVertexAttrib2fv__wrapper,_emscripten_glVertexAttrib3fv__wrapper,_emscripten_glVertexAttrib4fv__wrapper,_emscripten_glAttachShader__wrapper,_emscripten_glDetachShader__wrapper,_emscripten_glBindFramebuffer__wrapper,_emscripten_glGenFramebuffers__wrapper,_emscripten_glDeleteFramebuffers__wrapper,_emscripten_glBindProgramARB__wrapper,_emscripten_glGetPointerv__wrapper,_emscripten_glGenVertexArrays__wrapper,_emscripten_glDeleteVertexArrays__wrapper,_emscripten_glVertexAttribDivisor__wrapper,_emscripten_glBlendFunc__wrapper,_emscripten_glBlendEquationSeparate__wrapper,_emscripten_glStencilMaskSeparate__wrapper,_emscripten_glHint__wrapper,_emscripten_glDrawBuffers__wrapper,b4,b4,b4,b4,b4,b4,b4,b4,b4,b4,b4,b4,b4,b4,b4,b4,b4,b4,b4,b4,b4
  33425. ,b4,b4,b4,b4,b4];
  33426. var FUNCTION_TABLE_ii = [b5,___stdio_close,_PhysicsLoop,_emscripten_glGetString__wrapper,_emscripten_glIsTexture__wrapper,_emscripten_glIsBuffer__wrapper,_emscripten_glIsRenderbuffer__wrapper,_emscripten_glCreateShader__wrapper,_emscripten_glIsShader__wrapper,_emscripten_glIsProgram__wrapper,_emscripten_glIsFramebuffer__wrapper,_emscripten_glCheckFramebufferStatus__wrapper,_emscripten_glIsEnabled__wrapper,b5,b5,b5];
  33427. var FUNCTION_TABLE_viddd = [b6,_emscripten_glUniform3f__wrapper,_emscripten_glVertexAttrib3f__wrapper,b6];
  33428. var FUNCTION_TABLE_vidd = [b7,_MouseCursorPosCallback,_ScrollCallback,_emscripten_glUniform2f__wrapper,_emscripten_glVertexAttrib2f__wrapper,b7,b7,b7];
  33429. var FUNCTION_TABLE_iiii = [b8,___stdout_write,___stdio_seek,_sn_write,_EmscriptenFullscreenChangeCallback,_EmscriptenKeyboardCallback,_EmscriptenMouseCallback,_EmscriptenTouchCallback,_EmscriptenGamepadCallback,___stdio_write,b8,b8,b8,b8,b8,b8];
  33430. var FUNCTION_TABLE_viiiiiiii = [b9,_emscripten_glCompressedTexImage2D__wrapper,_emscripten_glCopyTexImage2D__wrapper,_emscripten_glCopyTexSubImage2D__wrapper];
  33431. var FUNCTION_TABLE_viiiiii = [b10,_emscripten_glDrawRangeElements__wrapper,_emscripten_glVertexAttribPointer__wrapper,b10];
  33432. var FUNCTION_TABLE_viii = [b11,_WindowSizeCallback,_emscripten_glGetTexParameterfv__wrapper,_emscripten_glGetTexParameteriv__wrapper,_emscripten_glTexParameterfv__wrapper,_emscripten_glTexParameteriv__wrapper,_emscripten_glGetBufferParameteriv__wrapper,_emscripten_glGetRenderbufferParameteriv__wrapper,_emscripten_glGetUniformfv__wrapper,_emscripten_glGetUniformiv__wrapper,_emscripten_glGetVertexAttribfv__wrapper,_emscripten_glGetVertexAttribiv__wrapper,_emscripten_glGetVertexAttribPointerv__wrapper,_emscripten_glUniform2i__wrapper,_emscripten_glUniform1iv__wrapper,_emscripten_glUniform2iv__wrapper,_emscripten_glUniform3iv__wrapper,_emscripten_glUniform4iv__wrapper,_emscripten_glUniform1fv__wrapper,_emscripten_glUniform2fv__wrapper,_emscripten_glUniform3fv__wrapper,_emscripten_glUniform4fv__wrapper,_emscripten_glGetShaderiv__wrapper,_emscripten_glGetProgramiv__wrapper,_emscripten_glBindAttribLocation__wrapper,_emscripten_glGetObjectParameterivARB__wrapper,_emscripten_glNormalPointer__wrapper,_emscripten_glDrawArrays__wrapper,_emscripten_glTexParameteri__wrapper,_emscripten_glStencilFunc__wrapper,_emscripten_glStencilOp__wrapper,b11];
  33433. var FUNCTION_TABLE_vidddd = [b12,_emscripten_glUniform4f__wrapper,_emscripten_glVertexAttrib4f__wrapper,b12];
  33434. var FUNCTION_TABLE_vdi = [b13,_emscripten_glSampleCoverage__wrapper];
  33435. var FUNCTION_TABLE_viiiiiii = [b14,_emscripten_glReadPixels__wrapper,_emscripten_glGetActiveUniform__wrapper,_emscripten_glGetActiveAttrib__wrapper];
  33436. var FUNCTION_TABLE_viiiiiiiii = [b15,_emscripten_glCompressedTexSubImage2D__wrapper,_emscripten_glTexImage2D__wrapper,_emscripten_glTexSubImage2D__wrapper];
  33437. var FUNCTION_TABLE_iii = [b16,_emscripten_glGetUniformLocation__wrapper,_emscripten_glGetAttribLocation__wrapper,b16];
  33438. var FUNCTION_TABLE_i = [b17,_emscripten_glCreateProgram__wrapper,_emscripten_glGetError__wrapper,b17];
  33439. var FUNCTION_TABLE_vdddddd = [b18,_emscripten_glFrustum__wrapper];
  33440. var FUNCTION_TABLE_vdddd = [b19,_emscripten_glRotatef__wrapper,_emscripten_glClearColor__wrapper,_emscripten_glBlendColor__wrapper];
  33441. var FUNCTION_TABLE_vdd = [b20,_emscripten_glDepthRange__wrapper,_emscripten_glDepthRangef__wrapper,_emscripten_glPolygonOffset__wrapper];
  33442. var FUNCTION_TABLE_v = [b21,_UpdateDrawFrame,_emscripten_glLoadIdentity__wrapper,_emscripten_glReleaseShaderCompiler__wrapper,_emscripten_glFinish__wrapper,_emscripten_glFlush__wrapper,b21,b21];
  33443. var FUNCTION_TABLE_viid = [b22,_emscripten_glTexParameterf__wrapper];
  33444. var FUNCTION_TABLE_viiii = [b23,_MouseButtonCallback,_emscripten_glBufferData__wrapper,_emscripten_glBufferSubData__wrapper,_emscripten_glUniform3i__wrapper,_emscripten_glUniformMatrix2fv__wrapper,_emscripten_glUniformMatrix3fv__wrapper,_emscripten_glUniformMatrix4fv__wrapper,_emscripten_glGetAttachedShaders__wrapper,_emscripten_glShaderSource__wrapper,_emscripten_glGetShaderSource__wrapper,_emscripten_glGetShaderInfoLog__wrapper,_emscripten_glGetShaderPrecisionFormat__wrapper,_emscripten_glGetProgramInfoLog__wrapper,_emscripten_glFramebufferRenderbuffer__wrapper,_emscripten_glGetFramebufferAttachmentParameteriv__wrapper,_emscripten_glGetInfoLogARB__wrapper,_emscripten_glVertexPointer__wrapper,_emscripten_glTexCoordPointer__wrapper,_emscripten_glColorPointer__wrapper,_emscripten_glDrawElements__wrapper,_emscripten_glDrawArraysInstanced__wrapper,_emscripten_glViewport__wrapper,_emscripten_glScissor__wrapper,_emscripten_glColorMask__wrapper,_emscripten_glRenderbufferStorage__wrapper,_emscripten_glBlendFuncSeparate__wrapper,_emscripten_glStencilFuncSeparate__wrapper,_emscripten_glStencilOpSeparate__wrapper,b23,b23,b23];
  33445. return { _emscripten_sync_run_in_main_thread_3: _emscripten_sync_run_in_main_thread_3, _roundf: _roundf, _bitshift64Shl: _bitshift64Shl, _emscripten_atomic_load_f32: _emscripten_atomic_load_f32, ___uremdi3: ___uremdi3, ___udivdi3: ___udivdi3, _emscripten_atomic_xor_u64: _emscripten_atomic_xor_u64, _llvm_cttz_i32: _llvm_cttz_i32, _bitshift64Lshr: _bitshift64Lshr, _emscripten_atomic_and_u64: _emscripten_atomic_and_u64, _emscripten_sync_run_in_main_thread: _emscripten_sync_run_in_main_thread, _emscripten_sync_run_in_main_thread_4: _emscripten_sync_run_in_main_thread_4, _emscripten_sync_run_in_main_thread_5: _emscripten_sync_run_in_main_thread_5, _emscripten_sync_run_in_main_thread_6: _emscripten_sync_run_in_main_thread_6, _emscripten_sync_run_in_main_thread_7: _emscripten_sync_run_in_main_thread_7, _emscripten_sync_run_in_main_thread_0: _emscripten_sync_run_in_main_thread_0, _emscripten_sync_run_in_main_thread_1: _emscripten_sync_run_in_main_thread_1, _emscripten_sync_run_in_main_thread_2: _emscripten_sync_run_in_main_thread_2, __emscripten_atomic_fetch_and_sub_u64: __emscripten_atomic_fetch_and_sub_u64, _emscripten_atomic_exchange_u32: _emscripten_atomic_exchange_u32, _fflush: _fflush, _emscripten_set_current_thread_status: _emscripten_set_current_thread_status, _emscripten_atomic_cas_u64: _emscripten_atomic_cas_u64, _memset: _memset, _emscripten_atomic_sub_u64: _emscripten_atomic_sub_u64, _emscripten_sync_run_in_main_thread_xprintf_varargs: _emscripten_sync_run_in_main_thread_xprintf_varargs, _i64Subtract: _i64Subtract, _llvm_bswap_i32: _llvm_bswap_i32, ___muldi3: ___muldi3, __emscripten_atomic_fetch_and_and_u64: __emscripten_atomic_fetch_and_and_u64, _emscripten_atomic_add_u64: _emscripten_atomic_add_u64, _emscripten_atomic_store_f64: _emscripten_atomic_store_f64, ___muldsi3: ___muldsi3, __emscripten_atomic_fetch_and_xor_u64: __emscripten_atomic_fetch_and_xor_u64, ___udivmoddi4: ___udivmoddi4, _i64Add: _i64Add, _emscripten_atomic_store_u64: _emscripten_atomic_store_u64, _emscripten_atomic_load_f64: _emscripten_atomic_load_f64, _emscripten_get_global_libc: _emscripten_get_global_libc, __emscripten_atomic_fetch_and_add_u64: __emscripten_atomic_fetch_and_add_u64, __emscripten_atomic_fetch_and_or_u64: __emscripten_atomic_fetch_and_or_u64, _emscripten_GetProcAddress: _emscripten_GetProcAddress, _emscripten_async_run_in_main_thread: _emscripten_async_run_in_main_thread, ___errno_location: ___errno_location, _main: _main, _emscripten_main_thread_process_queued_calls: _emscripten_main_thread_process_queued_calls, _emscripten_atomic_load_u64: _emscripten_atomic_load_u64, _free: _free, _emscripten_atomic_store_f32: _emscripten_atomic_store_f32, _emscripten_atomic_exchange_u64: _emscripten_atomic_exchange_u64, _memmove: _memmove, ___pthread_tsd_run_dtors: ___pthread_tsd_run_dtors, _malloc: _malloc, _memcpy: _memcpy, _emscripten_conditional_set_current_thread_status: _emscripten_conditional_set_current_thread_status, _sbrk: _sbrk, _emscripten_atomic_or_u64: _emscripten_atomic_or_u64, _strstr: _strstr, ___emscripten_pthread_data_constructor: ___emscripten_pthread_data_constructor, runPostSets: runPostSets, stackAlloc: stackAlloc, stackSave: stackSave, stackRestore: stackRestore, establishStackSpace: establishStackSpace, setTempRet0: setTempRet0, getTempRet0: getTempRet0, setThrew: setThrew, stackAlloc: stackAlloc, stackSave: stackSave, stackRestore: stackRestore, establishStackSpace: establishStackSpace, setThrew: setThrew, setTempRet0: setTempRet0, getTempRet0: getTempRet0, dynCall_viiiii: dynCall_viiiii, dynCall_vd: dynCall_vd, dynCall_vid: dynCall_vid, dynCall_vi: dynCall_vi, dynCall_vii: dynCall_vii, dynCall_ii: dynCall_ii, dynCall_viddd: dynCall_viddd, dynCall_vidd: dynCall_vidd, dynCall_iiii: dynCall_iiii, dynCall_viiiiiiii: dynCall_viiiiiiii, dynCall_viiiiii: dynCall_viiiiii, dynCall_viii: dynCall_viii, dynCall_vidddd: dynCall_vidddd, dynCall_vdi: dynCall_vdi, dynCall_viiiiiii: dynCall_viiiiiii, dynCall_viiiiiiiii: dynCall_viiiiiiiii, dynCall_iii: dynCall_iii, dynCall_i: dynCall_i, dynCall_vdddddd: dynCall_vdddddd, dynCall_vdddd: dynCall_vdddd, dynCall_vdd: dynCall_vdd, dynCall_v: dynCall_v, dynCall_viid: dynCall_viid, dynCall_viiii: dynCall_viiii };
  33446. })
  33447. // EMSCRIPTEN_END_ASM
  33448. (Module.asmGlobalArg, Module.asmLibraryArg, buffer);
  33449. var real___emscripten_atomic_fetch_and_xor_u64 = asm["__emscripten_atomic_fetch_and_xor_u64"]; asm["__emscripten_atomic_fetch_and_xor_u64"] = function() {
  33450. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33451. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33452. return real___emscripten_atomic_fetch_and_xor_u64.apply(null, arguments);
  33453. };
  33454. var real__roundf = asm["_roundf"]; asm["_roundf"] = function() {
  33455. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33456. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33457. return real__roundf.apply(null, arguments);
  33458. };
  33459. var real__bitshift64Shl = asm["_bitshift64Shl"]; asm["_bitshift64Shl"] = function() {
  33460. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33461. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33462. return real__bitshift64Shl.apply(null, arguments);
  33463. };
  33464. var real__emscripten_atomic_load_f32 = asm["_emscripten_atomic_load_f32"]; asm["_emscripten_atomic_load_f32"] = function() {
  33465. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33466. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33467. return real__emscripten_atomic_load_f32.apply(null, arguments);
  33468. };
  33469. var real____emscripten_pthread_data_constructor = asm["___emscripten_pthread_data_constructor"]; asm["___emscripten_pthread_data_constructor"] = function() {
  33470. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33471. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33472. return real____emscripten_pthread_data_constructor.apply(null, arguments);
  33473. };
  33474. var real_stackSave = asm["stackSave"]; asm["stackSave"] = function() {
  33475. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33476. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33477. return real_stackSave.apply(null, arguments);
  33478. };
  33479. var real__emscripten_atomic_xor_u64 = asm["_emscripten_atomic_xor_u64"]; asm["_emscripten_atomic_xor_u64"] = function() {
  33480. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33481. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33482. return real__emscripten_atomic_xor_u64.apply(null, arguments);
  33483. };
  33484. var real__emscripten_atomic_load_u64 = asm["_emscripten_atomic_load_u64"]; asm["_emscripten_atomic_load_u64"] = function() {
  33485. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33486. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33487. return real__emscripten_atomic_load_u64.apply(null, arguments);
  33488. };
  33489. var real____udivdi3 = asm["___udivdi3"]; asm["___udivdi3"] = function() {
  33490. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33491. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33492. return real____udivdi3.apply(null, arguments);
  33493. };
  33494. var real__bitshift64Lshr = asm["_bitshift64Lshr"]; asm["_bitshift64Lshr"] = function() {
  33495. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33496. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33497. return real__bitshift64Lshr.apply(null, arguments);
  33498. };
  33499. var real_getTempRet0 = asm["getTempRet0"]; asm["getTempRet0"] = function() {
  33500. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33501. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33502. return real_getTempRet0.apply(null, arguments);
  33503. };
  33504. var real__emscripten_atomic_and_u64 = asm["_emscripten_atomic_and_u64"]; asm["_emscripten_atomic_and_u64"] = function() {
  33505. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33506. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33507. return real__emscripten_atomic_and_u64.apply(null, arguments);
  33508. };
  33509. var real__emscripten_sync_run_in_main_thread = asm["_emscripten_sync_run_in_main_thread"]; asm["_emscripten_sync_run_in_main_thread"] = function() {
  33510. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33511. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33512. return real__emscripten_sync_run_in_main_thread.apply(null, arguments);
  33513. };
  33514. var real__emscripten_sync_run_in_main_thread_4 = asm["_emscripten_sync_run_in_main_thread_4"]; asm["_emscripten_sync_run_in_main_thread_4"] = function() {
  33515. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33516. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33517. return real__emscripten_sync_run_in_main_thread_4.apply(null, arguments);
  33518. };
  33519. var real__emscripten_sync_run_in_main_thread_5 = asm["_emscripten_sync_run_in_main_thread_5"]; asm["_emscripten_sync_run_in_main_thread_5"] = function() {
  33520. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33521. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33522. return real__emscripten_sync_run_in_main_thread_5.apply(null, arguments);
  33523. };
  33524. var real__emscripten_sync_run_in_main_thread_6 = asm["_emscripten_sync_run_in_main_thread_6"]; asm["_emscripten_sync_run_in_main_thread_6"] = function() {
  33525. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33526. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33527. return real__emscripten_sync_run_in_main_thread_6.apply(null, arguments);
  33528. };
  33529. var real__emscripten_sync_run_in_main_thread_7 = asm["_emscripten_sync_run_in_main_thread_7"]; asm["_emscripten_sync_run_in_main_thread_7"] = function() {
  33530. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33531. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33532. return real__emscripten_sync_run_in_main_thread_7.apply(null, arguments);
  33533. };
  33534. var real__emscripten_sync_run_in_main_thread_0 = asm["_emscripten_sync_run_in_main_thread_0"]; asm["_emscripten_sync_run_in_main_thread_0"] = function() {
  33535. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33536. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33537. return real__emscripten_sync_run_in_main_thread_0.apply(null, arguments);
  33538. };
  33539. var real__emscripten_sync_run_in_main_thread_1 = asm["_emscripten_sync_run_in_main_thread_1"]; asm["_emscripten_sync_run_in_main_thread_1"] = function() {
  33540. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33541. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33542. return real__emscripten_sync_run_in_main_thread_1.apply(null, arguments);
  33543. };
  33544. var real__emscripten_sync_run_in_main_thread_2 = asm["_emscripten_sync_run_in_main_thread_2"]; asm["_emscripten_sync_run_in_main_thread_2"] = function() {
  33545. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33546. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33547. return real__emscripten_sync_run_in_main_thread_2.apply(null, arguments);
  33548. };
  33549. var real___emscripten_atomic_fetch_and_sub_u64 = asm["__emscripten_atomic_fetch_and_sub_u64"]; asm["__emscripten_atomic_fetch_and_sub_u64"] = function() {
  33550. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33551. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33552. return real___emscripten_atomic_fetch_and_sub_u64.apply(null, arguments);
  33553. };
  33554. var real__emscripten_atomic_exchange_u32 = asm["_emscripten_atomic_exchange_u32"]; asm["_emscripten_atomic_exchange_u32"] = function() {
  33555. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33556. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33557. return real__emscripten_atomic_exchange_u32.apply(null, arguments);
  33558. };
  33559. var real__fflush = asm["_fflush"]; asm["_fflush"] = function() {
  33560. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33561. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33562. return real__fflush.apply(null, arguments);
  33563. };
  33564. var real__emscripten_set_current_thread_status = asm["_emscripten_set_current_thread_status"]; asm["_emscripten_set_current_thread_status"] = function() {
  33565. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33566. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33567. return real__emscripten_set_current_thread_status.apply(null, arguments);
  33568. };
  33569. var real__emscripten_atomic_cas_u64 = asm["_emscripten_atomic_cas_u64"]; asm["_emscripten_atomic_cas_u64"] = function() {
  33570. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33571. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33572. return real__emscripten_atomic_cas_u64.apply(null, arguments);
  33573. };
  33574. var real__llvm_cttz_i32 = asm["_llvm_cttz_i32"]; asm["_llvm_cttz_i32"] = function() {
  33575. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33576. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33577. return real__llvm_cttz_i32.apply(null, arguments);
  33578. };
  33579. var real__emscripten_atomic_sub_u64 = asm["_emscripten_atomic_sub_u64"]; asm["_emscripten_atomic_sub_u64"] = function() {
  33580. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33581. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33582. return real__emscripten_atomic_sub_u64.apply(null, arguments);
  33583. };
  33584. var real__main = asm["_main"]; asm["_main"] = function() {
  33585. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33586. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33587. return real__main.apply(null, arguments);
  33588. };
  33589. var real__emscripten_sync_run_in_main_thread_xprintf_varargs = asm["_emscripten_sync_run_in_main_thread_xprintf_varargs"]; asm["_emscripten_sync_run_in_main_thread_xprintf_varargs"] = function() {
  33590. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33591. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33592. return real__emscripten_sync_run_in_main_thread_xprintf_varargs.apply(null, arguments);
  33593. };
  33594. var real____errno_location = asm["___errno_location"]; asm["___errno_location"] = function() {
  33595. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33596. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33597. return real____errno_location.apply(null, arguments);
  33598. };
  33599. var real____muldi3 = asm["___muldi3"]; asm["___muldi3"] = function() {
  33600. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33601. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33602. return real____muldi3.apply(null, arguments);
  33603. };
  33604. var real___emscripten_atomic_fetch_and_and_u64 = asm["__emscripten_atomic_fetch_and_and_u64"]; asm["__emscripten_atomic_fetch_and_and_u64"] = function() {
  33605. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33606. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33607. return real___emscripten_atomic_fetch_and_and_u64.apply(null, arguments);
  33608. };
  33609. var real__emscripten_sync_run_in_main_thread_3 = asm["_emscripten_sync_run_in_main_thread_3"]; asm["_emscripten_sync_run_in_main_thread_3"] = function() {
  33610. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33611. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33612. return real__emscripten_sync_run_in_main_thread_3.apply(null, arguments);
  33613. };
  33614. var real____uremdi3 = asm["___uremdi3"]; asm["___uremdi3"] = function() {
  33615. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33616. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33617. return real____uremdi3.apply(null, arguments);
  33618. };
  33619. var real_stackAlloc = asm["stackAlloc"]; asm["stackAlloc"] = function() {
  33620. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33621. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33622. return real_stackAlloc.apply(null, arguments);
  33623. };
  33624. var real__i64Subtract = asm["_i64Subtract"]; asm["_i64Subtract"] = function() {
  33625. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33626. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33627. return real__i64Subtract.apply(null, arguments);
  33628. };
  33629. var real_setTempRet0 = asm["setTempRet0"]; asm["setTempRet0"] = function() {
  33630. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33631. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33632. return real_setTempRet0.apply(null, arguments);
  33633. };
  33634. var real__i64Add = asm["_i64Add"]; asm["_i64Add"] = function() {
  33635. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33636. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33637. return real__i64Add.apply(null, arguments);
  33638. };
  33639. var real__emscripten_atomic_store_u64 = asm["_emscripten_atomic_store_u64"]; asm["_emscripten_atomic_store_u64"] = function() {
  33640. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33641. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33642. return real__emscripten_atomic_store_u64.apply(null, arguments);
  33643. };
  33644. var real__emscripten_atomic_load_f64 = asm["_emscripten_atomic_load_f64"]; asm["_emscripten_atomic_load_f64"] = function() {
  33645. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33646. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33647. return real__emscripten_atomic_load_f64.apply(null, arguments);
  33648. };
  33649. var real__emscripten_get_global_libc = asm["_emscripten_get_global_libc"]; asm["_emscripten_get_global_libc"] = function() {
  33650. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33651. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33652. return real__emscripten_get_global_libc.apply(null, arguments);
  33653. };
  33654. var real___emscripten_atomic_fetch_and_add_u64 = asm["__emscripten_atomic_fetch_and_add_u64"]; asm["__emscripten_atomic_fetch_and_add_u64"] = function() {
  33655. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33656. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33657. return real___emscripten_atomic_fetch_and_add_u64.apply(null, arguments);
  33658. };
  33659. var real___emscripten_atomic_fetch_and_or_u64 = asm["__emscripten_atomic_fetch_and_or_u64"]; asm["__emscripten_atomic_fetch_and_or_u64"] = function() {
  33660. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33661. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33662. return real___emscripten_atomic_fetch_and_or_u64.apply(null, arguments);
  33663. };
  33664. var real__emscripten_GetProcAddress = asm["_emscripten_GetProcAddress"]; asm["_emscripten_GetProcAddress"] = function() {
  33665. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33666. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33667. return real__emscripten_GetProcAddress.apply(null, arguments);
  33668. };
  33669. var real__emscripten_async_run_in_main_thread = asm["_emscripten_async_run_in_main_thread"]; asm["_emscripten_async_run_in_main_thread"] = function() {
  33670. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33671. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33672. return real__emscripten_async_run_in_main_thread.apply(null, arguments);
  33673. };
  33674. var real__llvm_bswap_i32 = asm["_llvm_bswap_i32"]; asm["_llvm_bswap_i32"] = function() {
  33675. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33676. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33677. return real__llvm_bswap_i32.apply(null, arguments);
  33678. };
  33679. var real____muldsi3 = asm["___muldsi3"]; asm["___muldsi3"] = function() {
  33680. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33681. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33682. return real____muldsi3.apply(null, arguments);
  33683. };
  33684. var real__emscripten_main_thread_process_queued_calls = asm["_emscripten_main_thread_process_queued_calls"]; asm["_emscripten_main_thread_process_queued_calls"] = function() {
  33685. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33686. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33687. return real__emscripten_main_thread_process_queued_calls.apply(null, arguments);
  33688. };
  33689. var real__emscripten_atomic_add_u64 = asm["_emscripten_atomic_add_u64"]; asm["_emscripten_atomic_add_u64"] = function() {
  33690. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33691. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33692. return real__emscripten_atomic_add_u64.apply(null, arguments);
  33693. };
  33694. var real__free = asm["_free"]; asm["_free"] = function() {
  33695. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33696. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33697. return real__free.apply(null, arguments);
  33698. };
  33699. var real__emscripten_atomic_store_f32 = asm["_emscripten_atomic_store_f32"]; asm["_emscripten_atomic_store_f32"] = function() {
  33700. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33701. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33702. return real__emscripten_atomic_store_f32.apply(null, arguments);
  33703. };
  33704. var real_setThrew = asm["setThrew"]; asm["setThrew"] = function() {
  33705. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33706. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33707. return real_setThrew.apply(null, arguments);
  33708. };
  33709. var real__emscripten_atomic_exchange_u64 = asm["_emscripten_atomic_exchange_u64"]; asm["_emscripten_atomic_exchange_u64"] = function() {
  33710. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33711. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33712. return real__emscripten_atomic_exchange_u64.apply(null, arguments);
  33713. };
  33714. var real__emscripten_atomic_store_f64 = asm["_emscripten_atomic_store_f64"]; asm["_emscripten_atomic_store_f64"] = function() {
  33715. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33716. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33717. return real__emscripten_atomic_store_f64.apply(null, arguments);
  33718. };
  33719. var real____pthread_tsd_run_dtors = asm["___pthread_tsd_run_dtors"]; asm["___pthread_tsd_run_dtors"] = function() {
  33720. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33721. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33722. return real____pthread_tsd_run_dtors.apply(null, arguments);
  33723. };
  33724. var real_stackRestore = asm["stackRestore"]; asm["stackRestore"] = function() {
  33725. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33726. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33727. return real_stackRestore.apply(null, arguments);
  33728. };
  33729. var real____udivmoddi4 = asm["___udivmoddi4"]; asm["___udivmoddi4"] = function() {
  33730. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33731. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33732. return real____udivmoddi4.apply(null, arguments);
  33733. };
  33734. var real__malloc = asm["_malloc"]; asm["_malloc"] = function() {
  33735. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33736. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33737. return real__malloc.apply(null, arguments);
  33738. };
  33739. var real_establishStackSpace = asm["establishStackSpace"]; asm["establishStackSpace"] = function() {
  33740. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33741. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33742. return real_establishStackSpace.apply(null, arguments);
  33743. };
  33744. var real__emscripten_conditional_set_current_thread_status = asm["_emscripten_conditional_set_current_thread_status"]; asm["_emscripten_conditional_set_current_thread_status"] = function() {
  33745. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33746. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33747. return real__emscripten_conditional_set_current_thread_status.apply(null, arguments);
  33748. };
  33749. var real__sbrk = asm["_sbrk"]; asm["_sbrk"] = function() {
  33750. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33751. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33752. return real__sbrk.apply(null, arguments);
  33753. };
  33754. var real__memmove = asm["_memmove"]; asm["_memmove"] = function() {
  33755. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33756. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33757. return real__memmove.apply(null, arguments);
  33758. };
  33759. var real__emscripten_atomic_or_u64 = asm["_emscripten_atomic_or_u64"]; asm["_emscripten_atomic_or_u64"] = function() {
  33760. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33761. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33762. return real__emscripten_atomic_or_u64.apply(null, arguments);
  33763. };
  33764. var real__strstr = asm["_strstr"]; asm["_strstr"] = function() {
  33765. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33766. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33767. return real__strstr.apply(null, arguments);
  33768. };
  33769. var __emscripten_atomic_fetch_and_xor_u64 = Module["__emscripten_atomic_fetch_and_xor_u64"] = asm["__emscripten_atomic_fetch_and_xor_u64"];
  33770. var _roundf = Module["_roundf"] = asm["_roundf"];
  33771. var _bitshift64Shl = Module["_bitshift64Shl"] = asm["_bitshift64Shl"];
  33772. var _emscripten_atomic_load_f32 = Module["_emscripten_atomic_load_f32"] = asm["_emscripten_atomic_load_f32"];
  33773. var ___emscripten_pthread_data_constructor = Module["___emscripten_pthread_data_constructor"] = asm["___emscripten_pthread_data_constructor"];
  33774. var stackSave = Module["stackSave"] = asm["stackSave"];
  33775. var _emscripten_atomic_xor_u64 = Module["_emscripten_atomic_xor_u64"] = asm["_emscripten_atomic_xor_u64"];
  33776. var _emscripten_atomic_load_u64 = Module["_emscripten_atomic_load_u64"] = asm["_emscripten_atomic_load_u64"];
  33777. var ___udivdi3 = Module["___udivdi3"] = asm["___udivdi3"];
  33778. var _bitshift64Lshr = Module["_bitshift64Lshr"] = asm["_bitshift64Lshr"];
  33779. var getTempRet0 = Module["getTempRet0"] = asm["getTempRet0"];
  33780. var _emscripten_atomic_and_u64 = Module["_emscripten_atomic_and_u64"] = asm["_emscripten_atomic_and_u64"];
  33781. var _emscripten_sync_run_in_main_thread = Module["_emscripten_sync_run_in_main_thread"] = asm["_emscripten_sync_run_in_main_thread"];
  33782. var _emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = asm["_emscripten_sync_run_in_main_thread_4"];
  33783. var _emscripten_sync_run_in_main_thread_5 = Module["_emscripten_sync_run_in_main_thread_5"] = asm["_emscripten_sync_run_in_main_thread_5"];
  33784. var _emscripten_sync_run_in_main_thread_6 = Module["_emscripten_sync_run_in_main_thread_6"] = asm["_emscripten_sync_run_in_main_thread_6"];
  33785. var _emscripten_sync_run_in_main_thread_7 = Module["_emscripten_sync_run_in_main_thread_7"] = asm["_emscripten_sync_run_in_main_thread_7"];
  33786. var _emscripten_sync_run_in_main_thread_0 = Module["_emscripten_sync_run_in_main_thread_0"] = asm["_emscripten_sync_run_in_main_thread_0"];
  33787. var _emscripten_sync_run_in_main_thread_1 = Module["_emscripten_sync_run_in_main_thread_1"] = asm["_emscripten_sync_run_in_main_thread_1"];
  33788. var _emscripten_sync_run_in_main_thread_2 = Module["_emscripten_sync_run_in_main_thread_2"] = asm["_emscripten_sync_run_in_main_thread_2"];
  33789. var __emscripten_atomic_fetch_and_sub_u64 = Module["__emscripten_atomic_fetch_and_sub_u64"] = asm["__emscripten_atomic_fetch_and_sub_u64"];
  33790. var _emscripten_atomic_exchange_u32 = Module["_emscripten_atomic_exchange_u32"] = asm["_emscripten_atomic_exchange_u32"];
  33791. var _fflush = Module["_fflush"] = asm["_fflush"];
  33792. var _emscripten_set_current_thread_status = Module["_emscripten_set_current_thread_status"] = asm["_emscripten_set_current_thread_status"];
  33793. var _emscripten_atomic_cas_u64 = Module["_emscripten_atomic_cas_u64"] = asm["_emscripten_atomic_cas_u64"];
  33794. var _llvm_cttz_i32 = Module["_llvm_cttz_i32"] = asm["_llvm_cttz_i32"];
  33795. var _emscripten_atomic_sub_u64 = Module["_emscripten_atomic_sub_u64"] = asm["_emscripten_atomic_sub_u64"];
  33796. var _main = Module["_main"] = asm["_main"];
  33797. var _emscripten_sync_run_in_main_thread_xprintf_varargs = Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"] = asm["_emscripten_sync_run_in_main_thread_xprintf_varargs"];
  33798. var _memcpy = Module["_memcpy"] = asm["_memcpy"];
  33799. var ___errno_location = Module["___errno_location"] = asm["___errno_location"];
  33800. var ___muldi3 = Module["___muldi3"] = asm["___muldi3"];
  33801. var __emscripten_atomic_fetch_and_and_u64 = Module["__emscripten_atomic_fetch_and_and_u64"] = asm["__emscripten_atomic_fetch_and_and_u64"];
  33802. var _emscripten_sync_run_in_main_thread_3 = Module["_emscripten_sync_run_in_main_thread_3"] = asm["_emscripten_sync_run_in_main_thread_3"];
  33803. var ___uremdi3 = Module["___uremdi3"] = asm["___uremdi3"];
  33804. var stackAlloc = Module["stackAlloc"] = asm["stackAlloc"];
  33805. var _i64Subtract = Module["_i64Subtract"] = asm["_i64Subtract"];
  33806. var _memset = Module["_memset"] = asm["_memset"];
  33807. var setTempRet0 = Module["setTempRet0"] = asm["setTempRet0"];
  33808. var _i64Add = Module["_i64Add"] = asm["_i64Add"];
  33809. var _emscripten_atomic_store_u64 = Module["_emscripten_atomic_store_u64"] = asm["_emscripten_atomic_store_u64"];
  33810. var _emscripten_atomic_load_f64 = Module["_emscripten_atomic_load_f64"] = asm["_emscripten_atomic_load_f64"];
  33811. var _emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = asm["_emscripten_get_global_libc"];
  33812. var __emscripten_atomic_fetch_and_add_u64 = Module["__emscripten_atomic_fetch_and_add_u64"] = asm["__emscripten_atomic_fetch_and_add_u64"];
  33813. var __emscripten_atomic_fetch_and_or_u64 = Module["__emscripten_atomic_fetch_and_or_u64"] = asm["__emscripten_atomic_fetch_and_or_u64"];
  33814. var _emscripten_GetProcAddress = Module["_emscripten_GetProcAddress"] = asm["_emscripten_GetProcAddress"];
  33815. var _emscripten_async_run_in_main_thread = Module["_emscripten_async_run_in_main_thread"] = asm["_emscripten_async_run_in_main_thread"];
  33816. var _llvm_bswap_i32 = Module["_llvm_bswap_i32"] = asm["_llvm_bswap_i32"];
  33817. var runPostSets = Module["runPostSets"] = asm["runPostSets"];
  33818. var ___muldsi3 = Module["___muldsi3"] = asm["___muldsi3"];
  33819. var _emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = asm["_emscripten_main_thread_process_queued_calls"];
  33820. var _emscripten_atomic_add_u64 = Module["_emscripten_atomic_add_u64"] = asm["_emscripten_atomic_add_u64"];
  33821. var _free = Module["_free"] = asm["_free"];
  33822. var _emscripten_atomic_store_f32 = Module["_emscripten_atomic_store_f32"] = asm["_emscripten_atomic_store_f32"];
  33823. var setThrew = Module["setThrew"] = asm["setThrew"];
  33824. var _emscripten_atomic_exchange_u64 = Module["_emscripten_atomic_exchange_u64"] = asm["_emscripten_atomic_exchange_u64"];
  33825. var _emscripten_atomic_store_f64 = Module["_emscripten_atomic_store_f64"] = asm["_emscripten_atomic_store_f64"];
  33826. var ___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = asm["___pthread_tsd_run_dtors"];
  33827. var stackRestore = Module["stackRestore"] = asm["stackRestore"];
  33828. var ___udivmoddi4 = Module["___udivmoddi4"] = asm["___udivmoddi4"];
  33829. var _malloc = Module["_malloc"] = asm["_malloc"];
  33830. var establishStackSpace = Module["establishStackSpace"] = asm["establishStackSpace"];
  33831. var _emscripten_conditional_set_current_thread_status = Module["_emscripten_conditional_set_current_thread_status"] = asm["_emscripten_conditional_set_current_thread_status"];
  33832. var _sbrk = Module["_sbrk"] = asm["_sbrk"];
  33833. var _memmove = Module["_memmove"] = asm["_memmove"];
  33834. var _emscripten_atomic_or_u64 = Module["_emscripten_atomic_or_u64"] = asm["_emscripten_atomic_or_u64"];
  33835. var _strstr = Module["_strstr"] = asm["_strstr"];
  33836. var dynCall_viiiii = Module["dynCall_viiiii"] = asm["dynCall_viiiii"];
  33837. var dynCall_vd = Module["dynCall_vd"] = asm["dynCall_vd"];
  33838. var dynCall_vid = Module["dynCall_vid"] = asm["dynCall_vid"];
  33839. var dynCall_vi = Module["dynCall_vi"] = asm["dynCall_vi"];
  33840. var dynCall_vii = Module["dynCall_vii"] = asm["dynCall_vii"];
  33841. var dynCall_ii = Module["dynCall_ii"] = asm["dynCall_ii"];
  33842. var dynCall_viddd = Module["dynCall_viddd"] = asm["dynCall_viddd"];
  33843. var dynCall_vidd = Module["dynCall_vidd"] = asm["dynCall_vidd"];
  33844. var dynCall_iiii = Module["dynCall_iiii"] = asm["dynCall_iiii"];
  33845. var dynCall_viiiiiiii = Module["dynCall_viiiiiiii"] = asm["dynCall_viiiiiiii"];
  33846. var dynCall_viiiiii = Module["dynCall_viiiiii"] = asm["dynCall_viiiiii"];
  33847. var dynCall_viii = Module["dynCall_viii"] = asm["dynCall_viii"];
  33848. var dynCall_vidddd = Module["dynCall_vidddd"] = asm["dynCall_vidddd"];
  33849. var dynCall_vdi = Module["dynCall_vdi"] = asm["dynCall_vdi"];
  33850. var dynCall_viiiiiii = Module["dynCall_viiiiiii"] = asm["dynCall_viiiiiii"];
  33851. var dynCall_viiiiiiiii = Module["dynCall_viiiiiiiii"] = asm["dynCall_viiiiiiiii"];
  33852. var dynCall_iii = Module["dynCall_iii"] = asm["dynCall_iii"];
  33853. var dynCall_i = Module["dynCall_i"] = asm["dynCall_i"];
  33854. var dynCall_vdddddd = Module["dynCall_vdddddd"] = asm["dynCall_vdddddd"];
  33855. var dynCall_vdddd = Module["dynCall_vdddd"] = asm["dynCall_vdddd"];
  33856. var dynCall_vdd = Module["dynCall_vdd"] = asm["dynCall_vdd"];
  33857. var dynCall_v = Module["dynCall_v"] = asm["dynCall_v"];
  33858. var dynCall_viid = Module["dynCall_viid"] = asm["dynCall_viid"];
  33859. var dynCall_viiii = Module["dynCall_viiii"] = asm["dynCall_viiii"];
  33860. ;
  33861. Runtime.stackAlloc = Module['stackAlloc'];
  33862. Runtime.stackSave = Module['stackSave'];
  33863. Runtime.stackRestore = Module['stackRestore'];
  33864. Runtime.establishStackSpace = Module['establishStackSpace'];
  33865. Runtime.setTempRet0 = Module['setTempRet0'];
  33866. Runtime.getTempRet0 = Module['getTempRet0'];
  33867. // === Auto-generated postamble setup entry stuff ===
  33868. Module['asm'] = asm;
  33869. function ExitStatus(status) {
  33870. this.name = "ExitStatus";
  33871. this.message = "Program terminated with exit(" + status + ")";
  33872. this.status = status;
  33873. };
  33874. ExitStatus.prototype = new Error();
  33875. ExitStatus.prototype.constructor = ExitStatus;
  33876. var initialStackTop;
  33877. var preloadStartTime = null;
  33878. var calledMain = false;
  33879. dependenciesFulfilled = function runCaller() {
  33880. // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)
  33881. if (!Module['calledRun']) run();
  33882. if (!Module['calledRun']) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled
  33883. }
  33884. Module['callMain'] = Module.callMain = function callMain(args) {
  33885. assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on __ATMAIN__)');
  33886. assert(__ATPRERUN__.length == 0, 'cannot call main when preRun functions remain to be called');
  33887. args = args || [];
  33888. ensureInitRuntime();
  33889. var argc = args.length+1;
  33890. function pad() {
  33891. for (var i = 0; i < 4-1; i++) {
  33892. argv.push(0);
  33893. }
  33894. }
  33895. var argv = [allocate(intArrayFromString(Module['thisProgram']), 'i8', ALLOC_NORMAL) ];
  33896. pad();
  33897. for (var i = 0; i < argc-1; i = i + 1) {
  33898. argv.push(allocate(intArrayFromString(args[i]), 'i8', ALLOC_NORMAL));
  33899. pad();
  33900. }
  33901. argv.push(0);
  33902. argv = allocate(argv, 'i32', ALLOC_NORMAL);
  33903. try {
  33904. var ret = Module['_main'](argc, argv, 0);
  33905. // if we're not running an evented main loop, it's time to exit
  33906. exit(ret, /* implicit = */ true);
  33907. }
  33908. catch(e) {
  33909. if (e instanceof ExitStatus) {
  33910. // exit() throws this once it's done to make sure execution
  33911. // has been stopped completely
  33912. return;
  33913. } else if (e == 'SimulateInfiniteLoop') {
  33914. // running an evented main loop, don't immediately exit
  33915. Module['noExitRuntime'] = true;
  33916. return;
  33917. } else {
  33918. var toLog = e;
  33919. if (e && typeof e === 'object' && e.stack) {
  33920. toLog = [e, e.stack];
  33921. }
  33922. Module.printErr('exception thrown: ' + toLog);
  33923. Module['quit'](1, e);
  33924. }
  33925. } finally {
  33926. calledMain = true;
  33927. }
  33928. }
  33929. function run(args) {
  33930. args = args || Module['arguments'];
  33931. if (preloadStartTime === null) preloadStartTime = Date.now();
  33932. if (runDependencies > 0) {
  33933. Module.printErr('run() called, but dependencies remain, so not running');
  33934. return;
  33935. }
  33936. writeStackCookie();
  33937. preRun();
  33938. if (runDependencies > 0) return; // a preRun added a dependency, run will be called later
  33939. if (Module['calledRun']) return; // run may have just been called through dependencies being fulfilled just in this very frame
  33940. function doRun() {
  33941. if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening
  33942. Module['calledRun'] = true;
  33943. if (ABORT) return;
  33944. ensureInitRuntime();
  33945. preMain();
  33946. if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {
  33947. Module.printErr('pre-main prep time: ' + (Date.now() - preloadStartTime) + ' ms');
  33948. }
  33949. if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();
  33950. if (Module['_main'] && shouldRunNow) Module['callMain'](args);
  33951. postRun();
  33952. }
  33953. if (Module['setStatus']) {
  33954. Module['setStatus']('Running...');
  33955. setTimeout(function() {
  33956. setTimeout(function() {
  33957. Module['setStatus']('');
  33958. }, 1);
  33959. doRun();
  33960. }, 1);
  33961. } else {
  33962. doRun();
  33963. }
  33964. checkStackCookie();
  33965. }
  33966. Module['run'] = Module.run = run;
  33967. function exit(status, implicit) {
  33968. if (implicit && Module['noExitRuntime']) {
  33969. Module.printErr('exit(' + status + ') implicitly called by end of main(), but noExitRuntime, so not exiting the runtime (you can use emscripten_force_exit, if you want to force a true shutdown)');
  33970. return;
  33971. }
  33972. if (Module['noExitRuntime']) {
  33973. Module.printErr('exit(' + status + ') called, but noExitRuntime, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)');
  33974. } else {
  33975. PThread.terminateAllThreads();
  33976. ABORT = true;
  33977. EXITSTATUS = status;
  33978. STACKTOP = initialStackTop;
  33979. exitRuntime();
  33980. if (Module['onExit']) Module['onExit'](status);
  33981. }
  33982. if (ENVIRONMENT_IS_NODE) {
  33983. process['exit'](status);
  33984. }
  33985. Module['quit'](status, new ExitStatus(status));
  33986. }
  33987. Module['exit'] = Module.exit = exit;
  33988. var abortDecorators = [];
  33989. function abort(what) {
  33990. if (ENVIRONMENT_IS_PTHREAD) console.error('Pthread aborting at ' + new Error().stack);
  33991. if (what !== undefined) {
  33992. Module.print(what);
  33993. Module.printErr(what);
  33994. what = JSON.stringify(what)
  33995. } else {
  33996. what = '';
  33997. }
  33998. ABORT = true;
  33999. EXITSTATUS = 1;
  34000. var extra = '';
  34001. var output = 'abort(' + what + ') at ' + stackTrace() + extra;
  34002. if (abortDecorators) {
  34003. abortDecorators.forEach(function(decorator) {
  34004. output = decorator(output, what);
  34005. });
  34006. }
  34007. throw output;
  34008. }
  34009. Module['abort'] = Module.abort = abort;
  34010. // {{PRE_RUN_ADDITIONS}}
  34011. if (Module['preInit']) {
  34012. if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']];
  34013. while (Module['preInit'].length > 0) {
  34014. Module['preInit'].pop()();
  34015. }
  34016. }
  34017. // shouldRunNow refers to calling main(), not run().
  34018. var shouldRunNow = true;
  34019. if (Module['noInitialRun']) {
  34020. shouldRunNow = false;
  34021. }
  34022. if (!ENVIRONMENT_IS_PTHREAD) run();
  34023. // {{POST_RUN_ADDITIONS}}
  34024. // {{MODULE_ADDITIONS}}