physics_friction.js 1.2 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201
  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 + 38336;
  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,187,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,102,114,105,99,116,105,111,110,0,80,104,121,115,97,99,0,70,114,105,99,116,105,111,110,32,97,109,111,117,110,116,0,48,46,49,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,83,104,97,100,101,114,66,105], "i8", ALLOC_NONE, Runtime.GLOBAL_BASE);
  1481. /* memory initializer */ allocate([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((14264|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[3567] = 1;
  10268. HEAPF64[1745] = 0.0;
  10269. _InitTimer();
  10270. $1 = HEAP32[3567]|0;
  10271. $2 = ($1|0)==(0);
  10272. if (!($2)) {
  10273. while(1) {
  10274. $3 = (+_GetCurrentTime());
  10275. HEAPF64[1746] = $3;
  10276. $4 = +HEAPF64[1747];
  10277. $5 = $3 - $4;
  10278. HEAPF64[1748] = $5;
  10279. $6 = +HEAPF64[1745];
  10280. $7 = $5 + $6;
  10281. HEAPF64[1745] = $7;
  10282. _MathClamp();
  10283. $$pr = +HEAPF64[1745];
  10284. $8 = !($$pr >= 0.016666666666666666);
  10285. if (!($8)) {
  10286. while(1) {
  10287. _PhysicsStep();
  10288. $9 = +HEAPF64[1748];
  10289. $10 = +HEAPF64[1745];
  10290. $11 = $10 - $9;
  10291. HEAPF64[1745] = $11;
  10292. $12 = !($11 >= 0.016666666666666666);
  10293. if ($12) {
  10294. break;
  10295. }
  10296. }
  10297. }
  10298. $13 = +HEAPF64[1746];
  10299. HEAPF64[1747] = $13;
  10300. $14 = HEAP32[3567]|0;
  10301. $15 = ($14|0)==(0);
  10302. if ($15) {
  10303. break;
  10304. }
  10305. }
  10306. }
  10307. $16 = HEAP32[3634]|0;
  10308. $$0912 = (($16) + -1)|0;
  10309. $17 = ($$0912|0)>(-1);
  10310. if ($17) {
  10311. $$0913 = $$0912;
  10312. while(1) {
  10313. $20 = (14540 + ($$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[3569]|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 = (14280 + ($$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 _CreatePhysicsBodyRectangle($0,$1,$2,$3) {
  10348. $0 = $0|0;
  10349. $1 = +$1;
  10350. $2 = +$2;
  10351. $3 = +$3;
  10352. 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;
  10353. 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;
  10354. 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;
  10355. 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;
  10356. 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;
  10357. 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;
  10358. 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;
  10359. var $exitcond = 0, $tmpcast$byval_copy = 0, $tmpcast123$byval_copy = 0, label = 0, sp = 0;
  10360. sp = STACKTOP;
  10361. STACKTOP = STACKTOP + 448|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(448|0);
  10362. $tmpcast123$byval_copy = sp + 440|0;
  10363. $tmpcast$byval_copy = sp + 432|0;
  10364. $4 = sp + 424|0;
  10365. $5 = sp + 16|0;
  10366. $6 = sp + 8|0;
  10367. $7 = sp;
  10368. $8 = (_malloc(500)|0);
  10369. $9 = HEAP32[3568]|0;
  10370. $10 = (($9) + 500)|0;
  10371. HEAP32[3568] = $10;
  10372. $11 = HEAP32[3569]|0;
  10373. $12 = ($11|0)==(0);
  10374. $$0116149 = 0;
  10375. L1: while(1) {
  10376. if ($12) {
  10377. $$0116149158159 = 0;
  10378. break;
  10379. } else {
  10380. $$0119144 = 0;
  10381. }
  10382. while(1) {
  10383. $15 = (14280 + ($$0119144<<2)|0);
  10384. $16 = HEAP32[$15>>2]|0;
  10385. $17 = HEAP32[$16>>2]|0;
  10386. $18 = ($17|0)==($$0116149|0);
  10387. $14 = (($$0119144) + 1)|0;
  10388. if ($18) {
  10389. break;
  10390. }
  10391. $13 = ($14>>>0)<($11>>>0);
  10392. if ($13) {
  10393. $$0119144 = $14;
  10394. } else {
  10395. label = 6;
  10396. break L1;
  10397. }
  10398. }
  10399. $19 = (($$0116149) + 1)|0;
  10400. $20 = ($19|0)<(64);
  10401. if ($20) {
  10402. $$0116149 = $19;
  10403. } else {
  10404. label = 14;
  10405. break;
  10406. }
  10407. }
  10408. if ((label|0) == 14) {
  10409. STACKTOP = sp;return ($8|0);
  10410. }
  10411. if ((label|0) == 6) {
  10412. $21 = ($$0116149|0)==(-1);
  10413. if ($21) {
  10414. STACKTOP = sp;return ($8|0);
  10415. } else {
  10416. $$0116149158159 = $$0116149;
  10417. }
  10418. }
  10419. HEAP32[$8>>2] = $$0116149158159;
  10420. $22 = ((($8)) + 4|0);
  10421. HEAP32[$22>>2] = 1;
  10422. $23 = ((($8)) + 8|0);
  10423. $24 = $0;
  10424. $25 = $24;
  10425. $26 = HEAP32[$25>>2]|0;
  10426. $27 = (($24) + 4)|0;
  10427. $28 = $27;
  10428. $29 = HEAP32[$28>>2]|0;
  10429. $30 = $23;
  10430. $31 = $30;
  10431. HEAP32[$31>>2] = $26;
  10432. $32 = (($30) + 4)|0;
  10433. $33 = $32;
  10434. HEAP32[$33>>2] = $29;
  10435. $$sroa$049$0$$sroa_idx = ((($8)) + 16|0);
  10436. $34 = ((($8)) + 84|0);
  10437. ;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;
  10438. HEAP32[$34>>2] = 1;
  10439. $35 = ((($8)) + 88|0);
  10440. HEAP32[$35>>2] = $8;
  10441. $36 = ((($8)) + 96|0);
  10442. HEAPF32[$4>>2] = $1;
  10443. $37 = ((($4)) + 4|0);
  10444. HEAPF32[$37>>2] = $2;
  10445. ;HEAP32[$tmpcast$byval_copy>>2]=HEAP32[$0>>2]|0;HEAP32[$tmpcast$byval_copy+4>>2]=HEAP32[$0+4>>2]|0;
  10446. ;HEAP32[$tmpcast123$byval_copy>>2]=HEAP32[$4>>2]|0;HEAP32[$tmpcast123$byval_copy+4>>2]=HEAP32[$4+4>>2]|0;
  10447. _CreateRectanglePolygon($5,$tmpcast$byval_copy,$tmpcast123$byval_copy);
  10448. _memcpy(($36|0),($5|0),404)|0;
  10449. $38 = HEAP32[$36>>2]|0;
  10450. $39 = ($38|0)==(0);
  10451. if ($39) {
  10452. $$0121$lcssa161 = 0.0;$$0122$lcssa160 = 0.0;
  10453. } else {
  10454. $40 = ((($8)) + 100|0);
  10455. $41 = ((($6)) + 4|0);
  10456. $42 = ((($7)) + 4|0);
  10457. $$0120136 = 0;$$0121134 = 0.0;$$0122133 = 0.0;$$sroa$0$0132 = 0.0;$$sroa$8$0135 = 0.0;
  10458. while(1) {
  10459. $52 = (($40) + ($$0120136<<3)|0);
  10460. $53 = $52;
  10461. $54 = $53;
  10462. $55 = HEAP32[$54>>2]|0;
  10463. $56 = (($53) + 4)|0;
  10464. $57 = $56;
  10465. $58 = HEAP32[$57>>2]|0;
  10466. $59 = $6;
  10467. $60 = $59;
  10468. HEAP32[$60>>2] = $55;
  10469. $61 = (($59) + 4)|0;
  10470. $62 = $61;
  10471. HEAP32[$62>>2] = $58;
  10472. $63 = (($$0120136) + 1)|0;
  10473. $64 = HEAP32[$36>>2]|0;
  10474. $65 = ($63>>>0)<($64>>>0);
  10475. $66 = $65 ? $63 : 0;
  10476. $67 = (($40) + ($66<<3)|0);
  10477. $68 = $67;
  10478. $69 = $68;
  10479. $70 = HEAP32[$69>>2]|0;
  10480. $71 = (($68) + 4)|0;
  10481. $72 = $71;
  10482. $73 = HEAP32[$72>>2]|0;
  10483. $74 = $7;
  10484. $75 = $74;
  10485. HEAP32[$75>>2] = $70;
  10486. $76 = (($74) + 4)|0;
  10487. $77 = $76;
  10488. HEAP32[$77>>2] = $73;
  10489. ;HEAP32[$tmpcast$byval_copy>>2]=HEAP32[$6>>2]|0;HEAP32[$tmpcast$byval_copy+4>>2]=HEAP32[$6+4>>2]|0;
  10490. ;HEAP32[$tmpcast123$byval_copy>>2]=HEAP32[$7>>2]|0;HEAP32[$tmpcast123$byval_copy+4>>2]=HEAP32[$7+4>>2]|0;
  10491. $78 = (+_MathCrossVector2($tmpcast$byval_copy,$tmpcast123$byval_copy));
  10492. $79 = $78 * 0.5;
  10493. $44 = $$0122133 + $79;
  10494. $80 = $79 * 0.3333333432674408;
  10495. $81 = +HEAPF32[$6>>2];
  10496. $82 = +HEAPF32[$7>>2];
  10497. $83 = $81 + $82;
  10498. $84 = $80 * $83;
  10499. $46 = $$sroa$0$0132 + $84;
  10500. $85 = +HEAPF32[$41>>2];
  10501. $86 = +HEAPF32[$42>>2];
  10502. $87 = $85 + $86;
  10503. $88 = $80 * $87;
  10504. $48 = $$sroa$8$0135 + $88;
  10505. $89 = $81 * $81;
  10506. $90 = $81 * $82;
  10507. $91 = $89 + $90;
  10508. $92 = $82 * $82;
  10509. $93 = $92 + $91;
  10510. $94 = $85 * $85;
  10511. $95 = $85 * $86;
  10512. $96 = $94 + $95;
  10513. $97 = $86 * $86;
  10514. $98 = $97 + $96;
  10515. $99 = $78 * 0.083333335816860198;
  10516. $100 = $93 + $98;
  10517. $101 = $99 * $100;
  10518. $102 = $$0121134 + $101;
  10519. $50 = HEAP32[$36>>2]|0;
  10520. $103 = ($63>>>0)<($50>>>0);
  10521. if ($103) {
  10522. $$0120136 = $63;$$0121134 = $102;$$0122133 = $44;$$sroa$0$0132 = $46;$$sroa$8$0135 = $48;
  10523. } else {
  10524. break;
  10525. }
  10526. }
  10527. $43 = 1.0 / $44;
  10528. $45 = $46 * $43;
  10529. $47 = $43 * $48;
  10530. $49 = ($50|0)==(0);
  10531. if ($49) {
  10532. $$0121$lcssa161 = $102;$$0122$lcssa160 = $44;
  10533. } else {
  10534. $51 = ((($8)) + 100|0);
  10535. $$0131 = 0;
  10536. while(1) {
  10537. $125 = (($51) + ($$0131<<3)|0);
  10538. $126 = +HEAPF32[$125>>2];
  10539. $127 = $126 - $45;
  10540. HEAPF32[$125>>2] = $127;
  10541. $128 = (((($51) + ($$0131<<3)|0)) + 4|0);
  10542. $129 = +HEAPF32[$128>>2];
  10543. $130 = $129 - $47;
  10544. HEAPF32[$128>>2] = $130;
  10545. $131 = (($$0131) + 1)|0;
  10546. $exitcond = ($131|0)==($50|0);
  10547. if ($exitcond) {
  10548. $$0121$lcssa161 = $102;$$0122$lcssa160 = $44;
  10549. break;
  10550. } else {
  10551. $$0131 = $131;
  10552. }
  10553. }
  10554. }
  10555. }
  10556. $104 = $$0122$lcssa160 * $3;
  10557. $105 = ((($8)) + 52|0);
  10558. HEAPF32[$105>>2] = $104;
  10559. $106 = $104 != 0.0;
  10560. $107 = 1.0 / $104;
  10561. $108 = $106 ? $107 : 0.0;
  10562. $109 = ((($8)) + 56|0);
  10563. HEAPF32[$109>>2] = $108;
  10564. $110 = $$0121$lcssa161 * $3;
  10565. $111 = ((($8)) + 44|0);
  10566. HEAPF32[$111>>2] = $110;
  10567. $112 = $110 != 0.0;
  10568. $113 = 1.0 / $110;
  10569. $114 = $112 ? $113 : 0.0;
  10570. $115 = ((($8)) + 48|0);
  10571. HEAPF32[$115>>2] = $114;
  10572. $116 = ((($8)) + 60|0);
  10573. HEAPF32[$116>>2] = 0.40000000596046448;
  10574. $117 = ((($8)) + 64|0);
  10575. HEAPF32[$117>>2] = 0.20000000298023224;
  10576. $118 = ((($8)) + 68|0);
  10577. HEAPF32[$118>>2] = 0.0;
  10578. $119 = ((($8)) + 72|0);
  10579. HEAP32[$119>>2] = 1;
  10580. $120 = ((($8)) + 76|0);
  10581. HEAP32[$120>>2] = 0;
  10582. $121 = ((($8)) + 80|0);
  10583. HEAP32[$121>>2] = 0;
  10584. $122 = HEAP32[3569]|0;
  10585. $123 = (14280 + ($122<<2)|0);
  10586. HEAP32[$123>>2] = $8;
  10587. $124 = (($122) + 1)|0;
  10588. HEAP32[3569] = $124;
  10589. STACKTOP = sp;return ($8|0);
  10590. }
  10591. function _CreateRectanglePolygon($0,$1,$2) {
  10592. $0 = $0|0;
  10593. $1 = $1|0;
  10594. $2 = $2|0;
  10595. 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;
  10596. 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;
  10597. 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;
  10598. var $55 = 0, $56 = 0, $6 = 0, $7 = 0, $8 = 0.0, $9 = 0.0, label = 0, sp = 0;
  10599. sp = STACKTOP;
  10600. STACKTOP = STACKTOP + 448|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(448|0);
  10601. $$byval_copy1 = sp + 440|0;
  10602. $$byval_copy = sp + 432|0;
  10603. $3 = sp + 24|0;
  10604. $4 = sp;
  10605. $5 = sp + 16|0;
  10606. $6 = ((($3)) + 36|0);
  10607. _memset(($6|0),0,368)|0;
  10608. HEAP32[$3>>2] = 4;
  10609. $7 = ((($3)) + 388|0);
  10610. _Mat2Radians($4,0.0);
  10611. ;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;
  10612. $8 = +HEAPF32[$1>>2];
  10613. $9 = +HEAPF32[$2>>2];
  10614. $10 = $9 * 0.5;
  10615. $11 = $8 + $10;
  10616. $12 = ((($1)) + 4|0);
  10617. $13 = +HEAPF32[$12>>2];
  10618. $14 = ((($2)) + 4|0);
  10619. $15 = +HEAPF32[$14>>2];
  10620. $16 = $15 * 0.5;
  10621. $17 = $13 - $16;
  10622. $$sroa$021$0$$sroa_idx = ((($3)) + 4|0);
  10623. HEAPF32[$$sroa$021$0$$sroa_idx>>2] = $11;
  10624. $$sroa$222$0$$sroa_idx23 = ((($3)) + 8|0);
  10625. HEAPF32[$$sroa$222$0$$sroa_idx23>>2] = $17;
  10626. $18 = +HEAPF32[$1>>2];
  10627. $19 = +HEAPF32[$2>>2];
  10628. $20 = $19 * 0.5;
  10629. $21 = $18 + $20;
  10630. $22 = +HEAPF32[$12>>2];
  10631. $23 = +HEAPF32[$14>>2];
  10632. $24 = $23 * 0.5;
  10633. $25 = $22 + $24;
  10634. $$sroa$018$0$$sroa_idx = ((($3)) + 12|0);
  10635. HEAPF32[$$sroa$018$0$$sroa_idx>>2] = $21;
  10636. $$sroa$219$0$$sroa_idx20 = ((($3)) + 16|0);
  10637. HEAPF32[$$sroa$219$0$$sroa_idx20>>2] = $25;
  10638. $26 = +HEAPF32[$1>>2];
  10639. $27 = +HEAPF32[$2>>2];
  10640. $28 = $27 * 0.5;
  10641. $29 = $26 - $28;
  10642. $30 = +HEAPF32[$12>>2];
  10643. $31 = +HEAPF32[$14>>2];
  10644. $32 = $31 * 0.5;
  10645. $33 = $30 + $32;
  10646. $$sroa$015$0$$sroa_idx = ((($3)) + 20|0);
  10647. HEAPF32[$$sroa$015$0$$sroa_idx>>2] = $29;
  10648. $$sroa$216$0$$sroa_idx17 = ((($3)) + 24|0);
  10649. HEAPF32[$$sroa$216$0$$sroa_idx17>>2] = $33;
  10650. $34 = +HEAPF32[$1>>2];
  10651. $35 = +HEAPF32[$2>>2];
  10652. $36 = $35 * 0.5;
  10653. $37 = $34 - $36;
  10654. $38 = +HEAPF32[$12>>2];
  10655. $39 = +HEAPF32[$14>>2];
  10656. $40 = $39 * 0.5;
  10657. $41 = $38 - $40;
  10658. $$sroa$012$0$$sroa_idx = ((($3)) + 28|0);
  10659. HEAPF32[$$sroa$012$0$$sroa_idx>>2] = $37;
  10660. $$sroa$213$0$$sroa_idx14 = ((($3)) + 32|0);
  10661. HEAPF32[$$sroa$213$0$$sroa_idx14>>2] = $41;
  10662. $42 = HEAP32[$3>>2]|0;
  10663. $43 = ($42|0)==(0);
  10664. if ($43) {
  10665. _memcpy(($0|0),($3|0),404)|0;
  10666. STACKTOP = sp;return;
  10667. }
  10668. $44 = ((($5)) + 4|0);
  10669. $$024 = 0;$47 = $42;
  10670. while(1) {
  10671. $45 = (($$024) + 1)|0;
  10672. $46 = ($45>>>0)<($47>>>0);
  10673. $48 = $46 ? $45 : 0;
  10674. $49 = (((($3)) + 4|0) + ($48<<3)|0);
  10675. $50 = (((($3)) + 4|0) + ($$024<<3)|0);
  10676. ;HEAP32[$$byval_copy>>2]=HEAP32[$49>>2]|0;HEAP32[$$byval_copy+4>>2]=HEAP32[$49+4>>2]|0;
  10677. ;HEAP32[$$byval_copy1>>2]=HEAP32[$50>>2]|0;HEAP32[$$byval_copy1+4>>2]=HEAP32[$50+4>>2]|0;
  10678. _Vector2Subtract_4($5,$$byval_copy,$$byval_copy1);
  10679. $51 = (((($3)) + 196|0) + ($$024<<3)|0);
  10680. $52 = HEAP32[$44>>2]|0;
  10681. $53 = +HEAPF32[$5>>2];
  10682. $54 = -$53;
  10683. HEAP32[$51>>2] = $52;
  10684. $$sroa$2$0$$sroa_idx1 = (((((($3)) + 196|0) + ($$024<<3)|0)) + 4|0);
  10685. HEAPF32[$$sroa$2$0$$sroa_idx1>>2] = $54;
  10686. _MathNormalize($51);
  10687. $55 = HEAP32[$3>>2]|0;
  10688. $56 = ($45>>>0)<($55>>>0);
  10689. if ($56) {
  10690. $$024 = $45;$47 = $55;
  10691. } else {
  10692. break;
  10693. }
  10694. }
  10695. _memcpy(($0|0),($3|0),404)|0;
  10696. STACKTOP = sp;return;
  10697. }
  10698. function _MathCrossVector2($0,$1) {
  10699. $0 = $0|0;
  10700. $1 = $1|0;
  10701. 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;
  10702. sp = STACKTOP;
  10703. $2 = +HEAPF32[$0>>2];
  10704. $3 = ((($1)) + 4|0);
  10705. $4 = +HEAPF32[$3>>2];
  10706. $5 = $2 * $4;
  10707. $6 = ((($0)) + 4|0);
  10708. $7 = +HEAPF32[$6>>2];
  10709. $8 = +HEAPF32[$1>>2];
  10710. $9 = $7 * $8;
  10711. $10 = $5 - $9;
  10712. return (+$10);
  10713. }
  10714. function _Vector2Add_2($0,$1,$2) {
  10715. $0 = $0|0;
  10716. $1 = $1|0;
  10717. $2 = $2|0;
  10718. 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;
  10719. sp = STACKTOP;
  10720. $3 = +HEAPF32[$1>>2];
  10721. $4 = +HEAPF32[$2>>2];
  10722. $5 = $3 + $4;
  10723. HEAPF32[$0>>2] = $5;
  10724. $6 = ((($0)) + 4|0);
  10725. $7 = ((($1)) + 4|0);
  10726. $8 = +HEAPF32[$7>>2];
  10727. $9 = ((($2)) + 4|0);
  10728. $10 = +HEAPF32[$9>>2];
  10729. $11 = $8 + $10;
  10730. HEAPF32[$6>>2] = $11;
  10731. return;
  10732. }
  10733. function _Mat2MultiplyVector2($0,$1,$2) {
  10734. $0 = $0|0;
  10735. $1 = $1|0;
  10736. $2 = $2|0;
  10737. 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;
  10738. sp = STACKTOP;
  10739. $3 = +HEAPF32[$1>>2];
  10740. $4 = +HEAPF32[$2>>2];
  10741. $5 = $3 * $4;
  10742. $6 = ((($1)) + 4|0);
  10743. $7 = +HEAPF32[$6>>2];
  10744. $8 = ((($2)) + 4|0);
  10745. $9 = +HEAPF32[$8>>2];
  10746. $10 = $7 * $9;
  10747. $11 = $5 + $10;
  10748. HEAPF32[$0>>2] = $11;
  10749. $12 = ((($0)) + 4|0);
  10750. $13 = ((($1)) + 8|0);
  10751. $14 = +HEAPF32[$13>>2];
  10752. $15 = $4 * $14;
  10753. $16 = ((($1)) + 12|0);
  10754. $17 = +HEAPF32[$16>>2];
  10755. $18 = $9 * $17;
  10756. $19 = $15 + $18;
  10757. HEAPF32[$12>>2] = $19;
  10758. return;
  10759. }
  10760. function _DestroyPhysicsBody($0) {
  10761. $0 = $0|0;
  10762. 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;
  10763. 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;
  10764. sp = STACKTOP;
  10765. $1 = ($0|0)==(0|0);
  10766. if ($1) {
  10767. return;
  10768. }
  10769. $2 = HEAP32[$0>>2]|0;
  10770. $3 = HEAP32[3569]|0;
  10771. $4 = ($3|0)==(0);
  10772. L4: do {
  10773. if ($4) {
  10774. $$021 = -1;
  10775. } else {
  10776. $5 = HEAP32[3569]|0;
  10777. $$02023 = 0;
  10778. while(1) {
  10779. $6 = (14280 + ($$02023<<2)|0);
  10780. $7 = HEAP32[$6>>2]|0;
  10781. $8 = HEAP32[$7>>2]|0;
  10782. $9 = ($8|0)==($2|0);
  10783. if ($9) {
  10784. $$021 = $$02023;
  10785. break L4;
  10786. }
  10787. $10 = (($$02023) + 1)|0;
  10788. $11 = ($10>>>0)<($5>>>0);
  10789. if ($11) {
  10790. $$02023 = $10;
  10791. } else {
  10792. $$021 = -1;
  10793. break;
  10794. }
  10795. }
  10796. }
  10797. } while(0);
  10798. $12 = (14280 + ($$021<<2)|0);
  10799. $13 = HEAP32[$12>>2]|0;
  10800. _free($13);
  10801. $14 = HEAP32[3568]|0;
  10802. $15 = (($14) + -500)|0;
  10803. HEAP32[3568] = $15;
  10804. HEAP32[$12>>2] = 0;
  10805. $16 = HEAP32[3569]|0;
  10806. $17 = ($$021>>>0)<($16>>>0);
  10807. if ($17) {
  10808. $18 = HEAP32[3569]|0;
  10809. $$022 = $$021;$22 = $16;
  10810. while(1) {
  10811. $20 = (($$022) + 1)|0;
  10812. $21 = ($20>>>0)<($22>>>0);
  10813. if ($21) {
  10814. $24 = (14280 + ($$022<<2)|0);
  10815. $25 = (14280 + ($20<<2)|0);
  10816. $26 = HEAP32[$25>>2]|0;
  10817. HEAP32[$24>>2] = $26;
  10818. }
  10819. $23 = ($20>>>0)<($18>>>0);
  10820. if ($23) {
  10821. $$022 = $20;$22 = $18;
  10822. } else {
  10823. $$lcssa = $18;
  10824. break;
  10825. }
  10826. }
  10827. } else {
  10828. $$lcssa = $16;
  10829. }
  10830. $19 = (($$lcssa) + -1)|0;
  10831. HEAP32[3569] = $19;
  10832. return;
  10833. }
  10834. function _Vector2Subtract_4($0,$1,$2) {
  10835. $0 = $0|0;
  10836. $1 = $1|0;
  10837. $2 = $2|0;
  10838. 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;
  10839. sp = STACKTOP;
  10840. $3 = +HEAPF32[$1>>2];
  10841. $4 = +HEAPF32[$2>>2];
  10842. $5 = $3 - $4;
  10843. HEAPF32[$0>>2] = $5;
  10844. $6 = ((($0)) + 4|0);
  10845. $7 = ((($1)) + 4|0);
  10846. $8 = +HEAPF32[$7>>2];
  10847. $9 = ((($2)) + 4|0);
  10848. $10 = +HEAPF32[$9>>2];
  10849. $11 = $8 - $10;
  10850. HEAPF32[$6>>2] = $11;
  10851. return;
  10852. }
  10853. function _MathNormalize($0) {
  10854. $0 = $0|0;
  10855. 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;
  10856. sp = STACKTOP;
  10857. $$sroa$0$0$copyload = +HEAPF32[$0>>2];
  10858. $$sroa$5$0$$sroa_idx3 = ((($0)) + 4|0);
  10859. $$sroa$5$0$copyload = +HEAPF32[$$sroa$5$0$$sroa_idx3>>2];
  10860. $1 = $$sroa$0$0$copyload * $$sroa$0$0$copyload;
  10861. $2 = $$sroa$5$0$copyload * $$sroa$5$0$copyload;
  10862. $3 = $1 + $2;
  10863. $4 = (+Math_sqrt((+$3)));
  10864. $5 = $4 == 0.0;
  10865. $$op = 1.0 / $4;
  10866. $6 = $5 ? 1.0 : $$op;
  10867. $7 = $$sroa$0$0$copyload * $6;
  10868. HEAPF32[$0>>2] = $7;
  10869. $8 = $$sroa$5$0$copyload * $6;
  10870. HEAPF32[$$sroa$5$0$$sroa_idx3>>2] = $8;
  10871. return;
  10872. }
  10873. function _GetPhysicsBodiesCount() {
  10874. var $0 = 0, label = 0, sp = 0;
  10875. sp = STACKTOP;
  10876. $0 = HEAP32[3569]|0;
  10877. return ($0|0);
  10878. }
  10879. function _GetPhysicsBody($0) {
  10880. $0 = $0|0;
  10881. var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, label = 0, sp = 0;
  10882. sp = STACKTOP;
  10883. $1 = HEAP32[3569]|0;
  10884. $2 = ($1>>>0)>($0>>>0);
  10885. if (!($2)) {
  10886. $$0 = 0;
  10887. return ($$0|0);
  10888. }
  10889. $3 = (14280 + ($0<<2)|0);
  10890. $4 = HEAP32[$3>>2]|0;
  10891. $$0 = $4;
  10892. return ($$0|0);
  10893. }
  10894. function _GetPhysicsShapeVerticesCount($0) {
  10895. $0 = $0|0;
  10896. 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;
  10897. sp = STACKTOP;
  10898. $1 = HEAP32[3569]|0;
  10899. $2 = ($1>>>0)>($0>>>0);
  10900. L1: do {
  10901. if ($2) {
  10902. $3 = (14280 + ($0<<2)|0);
  10903. $4 = HEAP32[$3>>2]|0;
  10904. $5 = ($4|0)==(0|0);
  10905. if ($5) {
  10906. $$1 = 0;
  10907. } else {
  10908. $6 = ((($4)) + 84|0);
  10909. $7 = HEAP32[$6>>2]|0;
  10910. switch ($7|0) {
  10911. case 0: {
  10912. $$1 = 24;
  10913. break L1;
  10914. break;
  10915. }
  10916. case 1: {
  10917. $8 = ((($4)) + 96|0);
  10918. $9 = HEAP32[$8>>2]|0;
  10919. $$1 = $9;
  10920. break L1;
  10921. break;
  10922. }
  10923. default: {
  10924. $$1 = 0;
  10925. break L1;
  10926. }
  10927. }
  10928. }
  10929. } else {
  10930. $$1 = 0;
  10931. }
  10932. } while(0);
  10933. return ($$1|0);
  10934. }
  10935. function _GetPhysicsShapeVertex($0,$1,$2) {
  10936. $0 = $0|0;
  10937. $1 = $1|0;
  10938. $2 = $2|0;
  10939. 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;
  10940. 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;
  10941. sp = STACKTOP;
  10942. STACKTOP = STACKTOP + 448|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(448|0);
  10943. $$byval_copy3 = sp + 440|0;
  10944. $$byval_copy2 = sp + 424|0;
  10945. $3 = sp;
  10946. $4 = sp + 416|0;
  10947. $5 = sp + 408|0;
  10948. $6 = ($1|0)==(0|0);
  10949. L1: do {
  10950. if ($6) {
  10951. $$sroa$0$0 = 0.0;$$sroa$6$0 = 0.0;
  10952. } else {
  10953. $7 = ((($1)) + 84|0);
  10954. $8 = HEAP32[$7>>2]|0;
  10955. switch ($8|0) {
  10956. case 0: {
  10957. $9 = ((($1)) + 8|0);
  10958. $10 = +HEAPF32[$9>>2];
  10959. $11 = ($2*15)|0;
  10960. $12 = (+($11|0));
  10961. $13 = $12 * 0.017453292519943295;
  10962. $14 = $13;
  10963. $15 = (+Math_cos((+$14)));
  10964. $16 = ((($1)) + 92|0);
  10965. $17 = +HEAPF32[$16>>2];
  10966. $18 = $15 * $17;
  10967. $19 = $10 + $18;
  10968. $20 = ((($1)) + 12|0);
  10969. $21 = +HEAPF32[$20>>2];
  10970. $22 = (+Math_sin((+$14)));
  10971. $23 = $17 * $22;
  10972. $24 = $21 + $23;
  10973. $$sroa$0$0 = $19;$$sroa$6$0 = $24;
  10974. break L1;
  10975. break;
  10976. }
  10977. case 1: {
  10978. $25 = ((($1)) + 96|0);
  10979. _memcpy(($3|0),($25|0),404)|0;
  10980. $26 = ((($1)) + 8|0);
  10981. $27 = ((($3)) + 388|0);
  10982. $28 = (((($3)) + 4|0) + ($2<<3)|0);
  10983. ;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;
  10984. ;HEAP32[$$byval_copy3>>2]=HEAP32[$28>>2]|0;HEAP32[$$byval_copy3+4>>2]=HEAP32[$28+4>>2]|0;
  10985. _Mat2MultiplyVector2($4,$$byval_copy2,$$byval_copy3);
  10986. ;HEAP32[$$byval_copy2>>2]=HEAP32[$26>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$26+4>>2]|0;
  10987. ;HEAP32[$$byval_copy3>>2]=HEAP32[$4>>2]|0;HEAP32[$$byval_copy3+4>>2]=HEAP32[$4+4>>2]|0;
  10988. _Vector2Add_2($5,$$byval_copy2,$$byval_copy3);
  10989. $$sroa$0$0$copyload = +HEAPF32[$5>>2];
  10990. $$sroa$6$0$$sroa_idx4 = ((($5)) + 4|0);
  10991. $$sroa$6$0$copyload = +HEAPF32[$$sroa$6$0$$sroa_idx4>>2];
  10992. $$sroa$0$0 = $$sroa$0$0$copyload;$$sroa$6$0 = $$sroa$6$0$copyload;
  10993. break L1;
  10994. break;
  10995. }
  10996. default: {
  10997. $$sroa$0$0 = 0.0;$$sroa$6$0 = 0.0;
  10998. break L1;
  10999. }
  11000. }
  11001. }
  11002. } while(0);
  11003. HEAPF32[$0>>2] = $$sroa$0$0;
  11004. $$sroa$6$0$$sroa_idx5 = ((($0)) + 4|0);
  11005. HEAPF32[$$sroa$6$0$$sroa_idx5>>2] = $$sroa$6$0;
  11006. STACKTOP = sp;return;
  11007. }
  11008. function _SetPhysicsBodyRotation($0,$1) {
  11009. $0 = $0|0;
  11010. $1 = +$1;
  11011. var $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, label = 0, sp = 0;
  11012. sp = STACKTOP;
  11013. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  11014. $2 = sp;
  11015. $3 = ($0|0)==(0|0);
  11016. if ($3) {
  11017. STACKTOP = sp;return;
  11018. }
  11019. $4 = ((($0)) + 40|0);
  11020. HEAPF32[$4>>2] = $1;
  11021. $5 = ((($0)) + 84|0);
  11022. $6 = HEAP32[$5>>2]|0;
  11023. $7 = ($6|0)==(1);
  11024. if (!($7)) {
  11025. STACKTOP = sp;return;
  11026. }
  11027. $8 = ((($0)) + 484|0);
  11028. _Mat2Radians($2,$1);
  11029. ;HEAP32[$8>>2]=HEAP32[$2>>2]|0;HEAP32[$8+4>>2]=HEAP32[$2+4>>2]|0;HEAP32[$8+8>>2]=HEAP32[$2+8>>2]|0;HEAP32[$8+12>>2]=HEAP32[$2+12>>2]|0;
  11030. STACKTOP = sp;return;
  11031. }
  11032. function _Mat2Radians($0,$1) {
  11033. $0 = $0|0;
  11034. $1 = +$1;
  11035. var $2 = 0.0, $3 = 0.0, $4 = 0, $5 = 0.0, $6 = 0, $7 = 0, label = 0, sp = 0;
  11036. sp = STACKTOP;
  11037. $2 = (+Math_cos((+$1)));
  11038. $3 = (+Math_sin((+$1)));
  11039. HEAPF32[$0>>2] = $2;
  11040. $4 = ((($0)) + 4|0);
  11041. $5 = -$3;
  11042. HEAPF32[$4>>2] = $5;
  11043. $6 = ((($0)) + 8|0);
  11044. HEAPF32[$6>>2] = $3;
  11045. $7 = ((($0)) + 12|0);
  11046. HEAPF32[$7>>2] = $2;
  11047. return;
  11048. }
  11049. function _ClosePhysics() {
  11050. var $0 = 0, label = 0, sp = 0;
  11051. sp = STACKTOP;
  11052. HEAP32[3567] = 0;
  11053. $0 = HEAP32[3566]|0;
  11054. (_pthread_join(($0|0),(0|0))|0);
  11055. return;
  11056. }
  11057. function _main() {
  11058. var $$byval_copy5 = 0, $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0.0, $15 = 0, $16 = 0, $17 = 0.0, $18 = 0, $19 = 0.0, $2 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0.0, $25 = 0;
  11059. var $26 = 0, $27 = 0.0, $28 = 0.0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0.0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0.0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0.0;
  11060. var $44 = 0, $45 = 0, $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, $57 = 0, $58 = 0.0, $59 = 0.0, $6 = 0, $60 = 0, $61 = 0;
  11061. var $62 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  11062. sp = STACKTOP;
  11063. STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
  11064. $$byval_copy5 = sp + 48|0;
  11065. $0 = sp + 40|0;
  11066. $1 = sp + 32|0;
  11067. $2 = sp + 24|0;
  11068. $3 = sp + 16|0;
  11069. $4 = sp + 8|0;
  11070. $5 = sp;
  11071. _SetConfigFlags(32);
  11072. $6 = HEAP32[2]|0;
  11073. $7 = HEAP32[3]|0;
  11074. _InitWindow($6,$7,3248);
  11075. $8 = HEAP32[2]|0;
  11076. $9 = (_MeasureText(3283,30)|0);
  11077. $10 = (($8) + -10)|0;
  11078. $11 = (($10) - ($9))|0;
  11079. HEAP32[7731] = $11;
  11080. _InitPhysics();
  11081. $12 = HEAP32[2]|0;
  11082. $13 = (($12|0) / 2)&-1;
  11083. $14 = (+($13|0));
  11084. HEAPF32[$0>>2] = $14;
  11085. $15 = ((($0)) + 4|0);
  11086. $16 = HEAP32[3]|0;
  11087. $17 = (+($16|0));
  11088. HEAPF32[$15>>2] = $17;
  11089. $18 = HEAP32[2]|0;
  11090. $19 = (+($18|0));
  11091. ;HEAP32[$$byval_copy5>>2]=HEAP32[$0>>2]|0;HEAP32[$$byval_copy5+4>>2]=HEAP32[$0+4>>2]|0;
  11092. $20 = (_CreatePhysicsBodyRectangle($$byval_copy5,$19,100.0,10.0)|0);
  11093. $21 = ((($20)) + 4|0);
  11094. HEAP32[$21>>2] = 0;
  11095. $22 = HEAP32[2]|0;
  11096. $23 = (($22|0) / 2)&-1;
  11097. $24 = (+($23|0));
  11098. HEAPF32[$1>>2] = $24;
  11099. $25 = ((($1)) + 4|0);
  11100. $26 = HEAP32[3]|0;
  11101. $27 = (+($26|0));
  11102. $28 = $27 * 0.80000001192092896;
  11103. HEAPF32[$25>>2] = $28;
  11104. ;HEAP32[$$byval_copy5>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy5+4>>2]=HEAP32[$1+4>>2]|0;
  11105. $29 = (_CreatePhysicsBodyRectangle($$byval_copy5,10.0,80.0,10.0)|0);
  11106. $30 = ((($29)) + 4|0);
  11107. HEAP32[$30>>2] = 0;
  11108. HEAPF32[$2>>2] = 25.0;
  11109. $31 = ((($2)) + 4|0);
  11110. $32 = HEAP32[3]|0;
  11111. $33 = (($32) + -5)|0;
  11112. $34 = (+($33|0));
  11113. HEAPF32[$31>>2] = $34;
  11114. ;HEAP32[$$byval_copy5>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy5+4>>2]=HEAP32[$2+4>>2]|0;
  11115. $35 = (_CreatePhysicsBodyRectangle($$byval_copy5,250.0,250.0,10.0)|0);
  11116. $36 = ((($35)) + 4|0);
  11117. HEAP32[$36>>2] = 0;
  11118. _SetPhysicsBodyRotation($35,0.52359879016876221);
  11119. $37 = HEAP32[2]|0;
  11120. $38 = (($37) + -25)|0;
  11121. $39 = (+($38|0));
  11122. HEAPF32[$3>>2] = $39;
  11123. $40 = ((($3)) + 4|0);
  11124. $41 = HEAP32[3]|0;
  11125. $42 = (($41) + -5)|0;
  11126. $43 = (+($42|0));
  11127. HEAPF32[$40>>2] = $43;
  11128. ;HEAP32[$$byval_copy5>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy5+4>>2]=HEAP32[$3+4>>2]|0;
  11129. $44 = (_CreatePhysicsBodyRectangle($$byval_copy5,250.0,250.0,10.0)|0);
  11130. $45 = ((($44)) + 4|0);
  11131. HEAP32[$45>>2] = 0;
  11132. _SetPhysicsBodyRotation($44,5.7595863342285156);
  11133. HEAPF32[$4>>2] = 35.0;
  11134. $46 = ((($4)) + 4|0);
  11135. $47 = HEAP32[3]|0;
  11136. $48 = (+($47|0));
  11137. $49 = $48 * 0.60000002384185791;
  11138. HEAPF32[$46>>2] = $49;
  11139. ;HEAP32[$$byval_copy5>>2]=HEAP32[$4>>2]|0;HEAP32[$$byval_copy5+4>>2]=HEAP32[$4+4>>2]|0;
  11140. $50 = (_CreatePhysicsBodyRectangle($$byval_copy5,40.0,40.0,10.0)|0);
  11141. HEAP32[7732] = $50;
  11142. $51 = ((($50)) + 60|0);
  11143. HEAPF32[$51>>2] = 0.10000000149011612;
  11144. $52 = ((($50)) + 64|0);
  11145. HEAPF32[$52>>2] = 0.10000000149011612;
  11146. _SetPhysicsBodyRotation($50,0.52359879016876221);
  11147. $53 = HEAP32[2]|0;
  11148. $54 = (($53) + -35)|0;
  11149. $55 = (+($54|0));
  11150. HEAPF32[$5>>2] = $55;
  11151. $56 = ((($5)) + 4|0);
  11152. $57 = HEAP32[3]|0;
  11153. $58 = (+($57|0));
  11154. $59 = $58 * 0.60000002384185791;
  11155. HEAPF32[$56>>2] = $59;
  11156. ;HEAP32[$$byval_copy5>>2]=HEAP32[$5>>2]|0;HEAP32[$$byval_copy5+4>>2]=HEAP32[$5+4>>2]|0;
  11157. $60 = (_CreatePhysicsBodyRectangle($$byval_copy5,40.0,40.0,10.0)|0);
  11158. HEAP32[7733] = $60;
  11159. $61 = ((($60)) + 60|0);
  11160. HEAPF32[$61>>2] = 1.0;
  11161. $62 = ((($60)) + 64|0);
  11162. HEAPF32[$62>>2] = 1.0;
  11163. _SetPhysicsBodyRotation($60,5.7595863342285156);
  11164. _emscripten_set_main_loop((1|0),0,1);
  11165. _ClosePhysics();
  11166. _CloseWindow();
  11167. STACKTOP = sp;return 0;
  11168. }
  11169. function _UpdateDrawFrame() {
  11170. var $$03637 = 0, $$038 = 0, $$byval_copy2 = 0, $$byval_copy3 = 0, $$byval_copy4 = 0, $$sroa$0$0$$sroa_idx = 0, $$sroa$027$0$$sroa_idx = 0, $$sroa$030$0$$sroa_idx = 0, $$sroa$033$0$$sroa_idx = 0, $$sroa$2$0$$sroa_idx26 = 0, $$sroa$228$0$$sroa_idx29 = 0, $$sroa$231$0$$sroa_idx32 = 0, $$sroa$234$0$$sroa_idx35 = 0, $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0;
  11171. var $15 = 0.0, $16 = 0.0, $17 = 0, $18 = 0, $19 = 0, $2 = 0, $20 = 0, $21 = 0.0, $22 = 0, $23 = 0.0, $24 = 0.0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0, $3 = 0, $30 = 0, $31 = 0, $32 = 0;
  11172. var $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, $49 = 0, $5 = 0, $50 = 0;
  11173. var $51 = 0, $52 = 0.0, $53 = 0, $54 = 0, $55 = 0.0, $56 = 0.0, $57 = 0, $58 = 0, $59 = 0, $6 = 0, $60 = 0.0, $61 = 0.0, $62 = 0, $63 = 0, $64 = 0, $65 = 0.0, $66 = 0, $67 = 0, $68 = 0.0, $69 = 0.0;
  11174. var $7 = 0, $70 = 0, $71 = 0, $72 = 0, $73 = 0.0, $74 = 0.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;
  11175. var $88 = 0, $89 = 0, $9 = 0, $exitcond = 0, $exitcond40 = 0, label = 0, sp = 0;
  11176. sp = STACKTOP;
  11177. STACKTOP = STACKTOP + 80|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(80|0);
  11178. $$byval_copy4 = sp + 76|0;
  11179. $$byval_copy3 = sp + 56|0;
  11180. $$byval_copy2 = sp + 48|0;
  11181. $0 = sp + 72|0;
  11182. $1 = sp + 24|0;
  11183. $2 = sp + 8|0;
  11184. $3 = sp + 68|0;
  11185. $4 = sp + 64|0;
  11186. $5 = sp + 44|0;
  11187. $6 = sp + 40|0;
  11188. $7 = sp + 36|0;
  11189. $8 = sp + 32|0;
  11190. $9 = sp + 16|0;
  11191. $10 = sp;
  11192. $11 = (_IsKeyPressed(82)|0);
  11193. $12 = ($11|0)==(0);
  11194. if (!($12)) {
  11195. $13 = HEAP32[7732]|0;
  11196. $14 = HEAP32[3]|0;
  11197. $15 = (+($14|0));
  11198. $16 = $15 * 0.60000002384185791;
  11199. $$sroa$033$0$$sroa_idx = ((($13)) + 8|0);
  11200. HEAPF32[$$sroa$033$0$$sroa_idx>>2] = 35.0;
  11201. $$sroa$234$0$$sroa_idx35 = ((($13)) + 12|0);
  11202. HEAPF32[$$sroa$234$0$$sroa_idx35>>2] = $16;
  11203. $$sroa$030$0$$sroa_idx = ((($13)) + 16|0);
  11204. HEAPF32[$$sroa$030$0$$sroa_idx>>2] = 0.0;
  11205. $$sroa$231$0$$sroa_idx32 = ((($13)) + 20|0);
  11206. HEAPF32[$$sroa$231$0$$sroa_idx32>>2] = 0.0;
  11207. $17 = ((($13)) + 32|0);
  11208. HEAPF32[$17>>2] = 0.0;
  11209. _SetPhysicsBodyRotation($13,0.52359879016876221);
  11210. $18 = HEAP32[7733]|0;
  11211. $19 = HEAP32[2]|0;
  11212. $20 = (($19) + -35)|0;
  11213. $21 = (+($20|0));
  11214. $22 = HEAP32[3]|0;
  11215. $23 = (+($22|0));
  11216. $24 = $23 * 0.60000002384185791;
  11217. $$sroa$027$0$$sroa_idx = ((($18)) + 8|0);
  11218. HEAPF32[$$sroa$027$0$$sroa_idx>>2] = $21;
  11219. $$sroa$228$0$$sroa_idx29 = ((($18)) + 12|0);
  11220. HEAPF32[$$sroa$228$0$$sroa_idx29>>2] = $24;
  11221. $25 = HEAP32[7733]|0;
  11222. $$sroa$0$0$$sroa_idx = ((($25)) + 16|0);
  11223. HEAPF32[$$sroa$0$0$$sroa_idx>>2] = 0.0;
  11224. $$sroa$2$0$$sroa_idx26 = ((($25)) + 20|0);
  11225. HEAPF32[$$sroa$2$0$$sroa_idx26>>2] = 0.0;
  11226. $26 = ((($25)) + 32|0);
  11227. HEAPF32[$26>>2] = 0.0;
  11228. $27 = HEAP32[7733]|0;
  11229. _SetPhysicsBodyRotation($27,5.7595863342285156);
  11230. }
  11231. _BeginDrawing();
  11232. HEAP8[$0>>0] = 0;
  11233. $28 = ((($0)) + 1|0);
  11234. HEAP8[$28>>0] = 0;
  11235. $29 = ((($0)) + 2|0);
  11236. HEAP8[$29>>0] = 0;
  11237. $30 = ((($0)) + 3|0);
  11238. HEAP8[$30>>0] = -1;
  11239. ;HEAP8[$$byval_copy4>>0]=HEAP8[$0>>0]|0;HEAP8[$$byval_copy4+1>>0]=HEAP8[$0+1>>0]|0;HEAP8[$$byval_copy4+2>>0]=HEAP8[$0+2>>0]|0;HEAP8[$$byval_copy4+3>>0]=HEAP8[$0+3>>0]|0;
  11240. _ClearBackground($$byval_copy4);
  11241. $31 = HEAP32[2]|0;
  11242. $32 = (($31) + -90)|0;
  11243. $33 = HEAP32[3]|0;
  11244. $34 = (($33) + -30)|0;
  11245. _DrawFPS($32,$34);
  11246. $35 = (_GetPhysicsBodiesCount()|0);
  11247. $36 = ($35|0)>(0);
  11248. if ($36) {
  11249. $37 = ((($3)) + 1|0);
  11250. $38 = ((($3)) + 2|0);
  11251. $39 = ((($3)) + 3|0);
  11252. $$038 = 0;
  11253. while(1) {
  11254. $82 = (_GetPhysicsBody($$038)|0);
  11255. $83 = ($82|0)==(0|0);
  11256. if (!($83)) {
  11257. $84 = (_GetPhysicsShapeVerticesCount($$038)|0);
  11258. $85 = ($84|0)>(0);
  11259. if ($85) {
  11260. $$03637 = 0;
  11261. while(1) {
  11262. _GetPhysicsShapeVertex($1,$82,$$03637);
  11263. $86 = (($$03637) + 1)|0;
  11264. $87 = ($86|0)<($84|0);
  11265. $88 = $87 ? $86 : 0;
  11266. _GetPhysicsShapeVertex($2,$82,$88);
  11267. HEAP8[$3>>0] = 0;
  11268. HEAP8[$37>>0] = -28;
  11269. HEAP8[$38>>0] = 48;
  11270. HEAP8[$39>>0] = -1;
  11271. ;HEAP32[$$byval_copy2>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$1+4>>2]|0;
  11272. ;HEAP32[$$byval_copy3>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy3+4>>2]=HEAP32[$2+4>>2]|0;
  11273. ;HEAP8[$$byval_copy4>>0]=HEAP8[$3>>0]|0;HEAP8[$$byval_copy4+1>>0]=HEAP8[$3+1>>0]|0;HEAP8[$$byval_copy4+2>>0]=HEAP8[$3+2>>0]|0;HEAP8[$$byval_copy4+3>>0]=HEAP8[$3+3>>0]|0;
  11274. _DrawLineV($$byval_copy2,$$byval_copy3,$$byval_copy4);
  11275. $exitcond = ($86|0)==($84|0);
  11276. if ($exitcond) {
  11277. break;
  11278. } else {
  11279. $$03637 = $86;
  11280. }
  11281. }
  11282. }
  11283. }
  11284. $89 = (($$038) + 1)|0;
  11285. $exitcond40 = ($89|0)==($35|0);
  11286. if ($exitcond40) {
  11287. break;
  11288. } else {
  11289. $$038 = $89;
  11290. }
  11291. }
  11292. }
  11293. $40 = HEAP32[3]|0;
  11294. $41 = (($40) + -49)|0;
  11295. $42 = HEAP32[2]|0;
  11296. HEAP8[$4>>0] = 0;
  11297. $43 = ((($4)) + 1|0);
  11298. HEAP8[$43>>0] = 0;
  11299. $44 = ((($4)) + 2|0);
  11300. HEAP8[$44>>0] = 0;
  11301. $45 = ((($4)) + 3|0);
  11302. HEAP8[$45>>0] = -1;
  11303. ;HEAP8[$$byval_copy4>>0]=HEAP8[$4>>0]|0;HEAP8[$$byval_copy4+1>>0]=HEAP8[$4+1>>0]|0;HEAP8[$$byval_copy4+2>>0]=HEAP8[$4+2>>0]|0;HEAP8[$$byval_copy4+3>>0]=HEAP8[$4+3>>0]|0;
  11304. _DrawRectangle(0,$41,$42,49,$$byval_copy4);
  11305. $46 = HEAP32[2]|0;
  11306. $47 = (_MeasureText(3290,30)|0);
  11307. $48 = (($46) - ($47))|0;
  11308. $49 = (($48|0) / 2)&-1;
  11309. HEAP32[$5>>2] = -1;
  11310. ;HEAP8[$$byval_copy4>>0]=HEAP8[$5>>0]|0;HEAP8[$$byval_copy4+1>>0]=HEAP8[$5+1>>0]|0;HEAP8[$$byval_copy4+2>>0]=HEAP8[$5+2>>0]|0;HEAP8[$$byval_copy4+3>>0]=HEAP8[$5+3>>0]|0;
  11311. _DrawText(3290,$49,75,30,$$byval_copy4);
  11312. $50 = HEAP32[7732]|0;
  11313. $51 = ((($50)) + 8|0);
  11314. $52 = +HEAPF32[$51>>2];
  11315. $53 = (_MeasureText(3306,20)|0);
  11316. $54 = (($53|0) / 2)&-1;
  11317. $55 = (+($54|0));
  11318. $56 = $52 - $55;
  11319. $57 = (~~(($56)));
  11320. $58 = HEAP32[7732]|0;
  11321. $59 = ((($58)) + 12|0);
  11322. $60 = +HEAPF32[$59>>2];
  11323. $61 = $60 + -7.0;
  11324. $62 = (~~(($61)));
  11325. HEAP32[$6>>2] = -1;
  11326. ;HEAP8[$$byval_copy4>>0]=HEAP8[$6>>0]|0;HEAP8[$$byval_copy4+1>>0]=HEAP8[$6+1>>0]|0;HEAP8[$$byval_copy4+2>>0]=HEAP8[$6+2>>0]|0;HEAP8[$$byval_copy4+3>>0]=HEAP8[$6+3>>0]|0;
  11327. _DrawText(3306,$57,$62,20,$$byval_copy4);
  11328. $63 = HEAP32[7733]|0;
  11329. $64 = ((($63)) + 8|0);
  11330. $65 = +HEAPF32[$64>>2];
  11331. $66 = (_MeasureText(3310,20)|0);
  11332. $67 = (($66|0) / 2)&-1;
  11333. $68 = (+($67|0));
  11334. $69 = $65 - $68;
  11335. $70 = (~~(($69)));
  11336. $71 = HEAP32[7733]|0;
  11337. $72 = ((($71)) + 12|0);
  11338. $73 = +HEAPF32[$72>>2];
  11339. $74 = $73 + -7.0;
  11340. $75 = (~~(($74)));
  11341. HEAP32[$7>>2] = -1;
  11342. ;HEAP8[$$byval_copy4>>0]=HEAP8[$7>>0]|0;HEAP8[$$byval_copy4+1>>0]=HEAP8[$7+1>>0]|0;HEAP8[$$byval_copy4+2>>0]=HEAP8[$7+2>>0]|0;HEAP8[$$byval_copy4+3>>0]=HEAP8[$7+3>>0]|0;
  11343. _DrawText(3310,$70,$75,20,$$byval_copy4);
  11344. HEAP32[$8>>2] = -1;
  11345. ;HEAP8[$$byval_copy4>>0]=HEAP8[$8>>0]|0;HEAP8[$$byval_copy4+1>>0]=HEAP8[$8+1>>0]|0;HEAP8[$$byval_copy4+2>>0]=HEAP8[$8+2>>0]|0;HEAP8[$$byval_copy4+3>>0]=HEAP8[$8+3>>0]|0;
  11346. _DrawText(3312,10,10,10,$$byval_copy4);
  11347. $76 = HEAP32[7731]|0;
  11348. $77 = HEAP32[4]|0;
  11349. HEAP32[$9>>2] = -1;
  11350. ;HEAP8[$$byval_copy4>>0]=HEAP8[$9>>0]|0;HEAP8[$$byval_copy4+1>>0]=HEAP8[$9+1>>0]|0;HEAP8[$$byval_copy4+2>>0]=HEAP8[$9+2>>0]|0;HEAP8[$$byval_copy4+3>>0]=HEAP8[$9+3>>0]|0;
  11351. _DrawText(3283,$76,$77,30,$$byval_copy4);
  11352. $78 = HEAP32[7731]|0;
  11353. $79 = (($78) + 50)|0;
  11354. $80 = HEAP32[4]|0;
  11355. $81 = (($80) + -7)|0;
  11356. HEAP32[$10>>2] = -1;
  11357. ;HEAP8[$$byval_copy4>>0]=HEAP8[$10>>0]|0;HEAP8[$$byval_copy4+1>>0]=HEAP8[$10+1>>0]|0;HEAP8[$$byval_copy4+2>>0]=HEAP8[$10+2>>0]|0;HEAP8[$$byval_copy4+3>>0]=HEAP8[$10+3>>0]|0;
  11358. _DrawText(3339,$79,$81,10,$$byval_copy4);
  11359. _EndDrawing();
  11360. STACKTOP = sp;return;
  11361. }
  11362. function _InitTimer() {
  11363. var $0 = 0, $1 = 0.0, label = 0, sp = 0;
  11364. sp = STACKTOP;
  11365. $0 = (_time((0|0))|0);
  11366. _srand($0);
  11367. $1 = (+_GetCurrentTime());
  11368. HEAPF64[1747] = $1;
  11369. return;
  11370. }
  11371. function _GetCurrentTime() {
  11372. 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;
  11373. sp = STACKTOP;
  11374. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  11375. $0 = sp;
  11376. (_clock_gettime(1,($0|0))|0);
  11377. $1 = HEAP32[$0>>2]|0;
  11378. $2 = ($1|0)<(0);
  11379. $3 = $2 << 31 >> 31;
  11380. $4 = (___muldi3(($1|0),($3|0),1000000000,0)|0);
  11381. $5 = tempRet0;
  11382. $6 = ((($0)) + 4|0);
  11383. $7 = HEAP32[$6>>2]|0;
  11384. $8 = ($7|0)<(0);
  11385. $9 = $8 << 31 >> 31;
  11386. $10 = (_i64Add(($4|0),($5|0),($7|0),($9|0))|0);
  11387. $11 = tempRet0;
  11388. $12 = (+($10>>>0)) + (4294967296.0*(+($11>>>0)));
  11389. $13 = $12 * 9.9999999999999995E-7;
  11390. STACKTOP = sp;return (+$13);
  11391. }
  11392. function _MathClamp() {
  11393. var $$sink = 0.0, $0 = 0.0, $1 = 0, $2 = 0, label = 0, sp = 0;
  11394. sp = STACKTOP;
  11395. $0 = +HEAPF64[1745];
  11396. $1 = $0 < 0.0;
  11397. if ($1) {
  11398. $$sink = 0.0;
  11399. } else {
  11400. $2 = $0 > 0.02;
  11401. if ($2) {
  11402. $$sink = 0.02;
  11403. } else {
  11404. return;
  11405. }
  11406. }
  11407. HEAPF64[1745] = $$sink;
  11408. return;
  11409. }
  11410. function _PhysicsStep() {
  11411. 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;
  11412. 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;
  11413. 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;
  11414. 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;
  11415. 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;
  11416. 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;
  11417. 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;
  11418. 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;
  11419. var $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $exitcond = 0, label = 0, sp = 0;
  11420. sp = STACKTOP;
  11421. $0 = HEAP32[7734]|0;
  11422. $1 = (($0) + 1)|0;
  11423. HEAP32[7734] = $1;
  11424. $2 = HEAP32[3634]|0;
  11425. $$0167 = (($2) + -1)|0;
  11426. $3 = ($$0167|0)>(-1);
  11427. if ($3) {
  11428. $$0168 = $$0167;
  11429. while(1) {
  11430. $6 = (14540 + ($$0168<<2)|0);
  11431. $7 = HEAP32[$6>>2]|0;
  11432. $8 = ($7|0)==(0|0);
  11433. if (!($8)) {
  11434. _DestroyPhysicsManifold($7);
  11435. }
  11436. $$0 = (($$0168) + -1)|0;
  11437. $9 = ($$0|0)>(-1);
  11438. if ($9) {
  11439. $$0168 = $$0;
  11440. } else {
  11441. break;
  11442. }
  11443. }
  11444. }
  11445. $4 = HEAP32[3569]|0;
  11446. $5 = ($4|0)==(0);
  11447. if ($5) {
  11448. $17 = $4;
  11449. label = 8;
  11450. } else {
  11451. $$0125165 = 0;
  11452. while(1) {
  11453. $11 = (14280 + ($$0125165<<2)|0);
  11454. $12 = HEAP32[$11>>2]|0;
  11455. $13 = ((($12)) + 76|0);
  11456. HEAP32[$13>>2] = 0;
  11457. $14 = (($$0125165) + 1)|0;
  11458. $15 = ($14>>>0)<($4>>>0);
  11459. if ($15) {
  11460. $$0125165 = $14;
  11461. } else {
  11462. break;
  11463. }
  11464. }
  11465. $$pr = HEAP32[3569]|0;
  11466. $10 = ($$pr|0)==(0);
  11467. if (!($10)) {
  11468. $$0126163 = 0;
  11469. while(1) {
  11470. $19 = (14280 + ($$0126163<<2)|0);
  11471. $20 = HEAP32[$19>>2]|0;
  11472. $21 = ($20|0)==(0|0);
  11473. if (!($21)) {
  11474. $$0130160 = (($$0126163) + 1)|0;
  11475. $22 = HEAP32[3569]|0;
  11476. $23 = ($$0130160>>>0)<($22>>>0);
  11477. if ($23) {
  11478. $24 = ((($20)) + 56|0);
  11479. $25 = ((($20)) + 84|0);
  11480. $$0130161 = $$0130160;
  11481. while(1) {
  11482. $26 = (14280 + ($$0130161<<2)|0);
  11483. $27 = HEAP32[$26>>2]|0;
  11484. $28 = ($27|0)==(0|0);
  11485. do {
  11486. if (!($28)) {
  11487. $31 = +HEAPF32[$24>>2];
  11488. $32 = $31 == 0.0;
  11489. if ($32) {
  11490. $33 = ((($27)) + 56|0);
  11491. $34 = +HEAPF32[$33>>2];
  11492. $35 = $34 == 0.0;
  11493. if ($35) {
  11494. break;
  11495. }
  11496. }
  11497. $36 = HEAP32[$25>>2]|0;
  11498. $37 = ($36|0)==(1);
  11499. if ($37) {
  11500. $38 = ((($27)) + 84|0);
  11501. $39 = HEAP32[$38>>2]|0;
  11502. $40 = ($39|0)==(0);
  11503. if ($40) {
  11504. $41 = (_CreatePhysicsManifold($27,$20)|0);
  11505. $$0132 = $41;
  11506. } else {
  11507. label = 20;
  11508. }
  11509. } else {
  11510. label = 20;
  11511. }
  11512. if ((label|0) == 20) {
  11513. label = 0;
  11514. $42 = (_CreatePhysicsManifold($20,$27)|0);
  11515. $$0132 = $42;
  11516. }
  11517. _SolvePhysicsManifold($$0132);
  11518. $43 = ((($$0132)) + 40|0);
  11519. $44 = HEAP32[$43>>2]|0;
  11520. $45 = ($44|0)==(0);
  11521. if (!($45)) {
  11522. $46 = (_CreatePhysicsManifold($20,$27)|0);
  11523. $47 = ((($$0132)) + 12|0);
  11524. $48 = HEAP32[$47>>2]|0;
  11525. $49 = ((($46)) + 12|0);
  11526. HEAP32[$49>>2] = $48;
  11527. $50 = ((($46)) + 16|0);
  11528. $51 = ((($$0132)) + 16|0);
  11529. $52 = $51;
  11530. $53 = $52;
  11531. $54 = HEAP32[$53>>2]|0;
  11532. $55 = (($52) + 4)|0;
  11533. $56 = $55;
  11534. $57 = HEAP32[$56>>2]|0;
  11535. $58 = $50;
  11536. $59 = $58;
  11537. HEAP32[$59>>2] = $54;
  11538. $60 = (($58) + 4)|0;
  11539. $61 = $60;
  11540. HEAP32[$61>>2] = $57;
  11541. $62 = ((($46)) + 24|0);
  11542. $63 = ((($$0132)) + 24|0);
  11543. $64 = $63;
  11544. $65 = $64;
  11545. $66 = HEAP32[$65>>2]|0;
  11546. $67 = (($64) + 4)|0;
  11547. $68 = $67;
  11548. $69 = HEAP32[$68>>2]|0;
  11549. $70 = $62;
  11550. $71 = $70;
  11551. HEAP32[$71>>2] = $66;
  11552. $72 = (($70) + 4)|0;
  11553. $73 = $72;
  11554. HEAP32[$73>>2] = $69;
  11555. $74 = ((($46)) + 32|0);
  11556. $75 = ((($$0132)) + 32|0);
  11557. $76 = $75;
  11558. $77 = $76;
  11559. $78 = HEAP32[$77>>2]|0;
  11560. $79 = (($76) + 4)|0;
  11561. $80 = $79;
  11562. $81 = HEAP32[$80>>2]|0;
  11563. $82 = $74;
  11564. $83 = $82;
  11565. HEAP32[$83>>2] = $78;
  11566. $84 = (($82) + 4)|0;
  11567. $85 = $84;
  11568. HEAP32[$85>>2] = $81;
  11569. $86 = HEAP32[$43>>2]|0;
  11570. $87 = ((($46)) + 40|0);
  11571. HEAP32[$87>>2] = $86;
  11572. $88 = ((($$0132)) + 44|0);
  11573. $89 = HEAP32[$88>>2]|0;
  11574. $90 = ((($46)) + 44|0);
  11575. HEAP32[$90>>2] = $89;
  11576. $91 = ((($$0132)) + 48|0);
  11577. $92 = HEAP32[$91>>2]|0;
  11578. $93 = ((($46)) + 48|0);
  11579. HEAP32[$93>>2] = $92;
  11580. $94 = ((($$0132)) + 52|0);
  11581. $95 = HEAP32[$94>>2]|0;
  11582. $96 = ((($46)) + 52|0);
  11583. HEAP32[$96>>2] = $95;
  11584. }
  11585. }
  11586. } while(0);
  11587. $$0130 = (($$0130161) + 1)|0;
  11588. $29 = HEAP32[3569]|0;
  11589. $30 = ($$0130>>>0)<($29>>>0);
  11590. if ($30) {
  11591. $$0130161 = $$0130;
  11592. } else {
  11593. break;
  11594. }
  11595. }
  11596. }
  11597. }
  11598. $97 = (($$0126163) + 1)|0;
  11599. $98 = HEAP32[3569]|0;
  11600. $99 = ($97>>>0)<($98>>>0);
  11601. if ($99) {
  11602. $$0126163 = $97;
  11603. } else {
  11604. $17 = $98;
  11605. label = 8;
  11606. break;
  11607. }
  11608. }
  11609. }
  11610. }
  11611. if ((label|0) == 8) {
  11612. $16 = ($17|0)==(0);
  11613. if (!($16)) {
  11614. $18 = HEAP32[3569]|0;
  11615. $$0135158 = 0;
  11616. while(1) {
  11617. $103 = (14280 + ($$0135158<<2)|0);
  11618. $104 = HEAP32[$103>>2]|0;
  11619. $105 = ($104|0)==(0|0);
  11620. if (!($105)) {
  11621. _IntegratePhysicsForces($104);
  11622. }
  11623. $106 = (($$0135158) + 1)|0;
  11624. $107 = ($106>>>0)<($18>>>0);
  11625. if ($107) {
  11626. $$0135158 = $106;
  11627. } else {
  11628. break;
  11629. }
  11630. }
  11631. }
  11632. }
  11633. $100 = HEAP32[3634]|0;
  11634. $101 = ($100|0)==(0);
  11635. if ($101) {
  11636. $$0134155 = 0;$114 = 0;
  11637. } else {
  11638. $102 = HEAP32[3634]|0;
  11639. $$0136156 = 0;
  11640. while(1) {
  11641. $108 = (14540 + ($$0136156<<2)|0);
  11642. $109 = HEAP32[$108>>2]|0;
  11643. $110 = ($109|0)==(0|0);
  11644. if (!($110)) {
  11645. _InitializePhysicsManifolds($109);
  11646. }
  11647. $111 = (($$0136156) + 1)|0;
  11648. $112 = ($111>>>0)<($102>>>0);
  11649. if ($112) {
  11650. $$0136156 = $111;
  11651. } else {
  11652. $$0134155$ph = 0;
  11653. label = 32;
  11654. break;
  11655. }
  11656. }
  11657. }
  11658. while(1) {
  11659. if ((label|0) == 32) {
  11660. label = 0;
  11661. $$pr172 = HEAP32[3634]|0;
  11662. $$0134155 = $$0134155$ph;$114 = $$pr172;
  11663. }
  11664. $113 = ($114|0)==(0);
  11665. if (!($113)) {
  11666. $115 = (14540 + ($$0134155<<2)|0);
  11667. $$0133152 = 0;
  11668. while(1) {
  11669. $120 = HEAP32[$115>>2]|0;
  11670. $121 = ($120|0)==(0|0);
  11671. if (!($121)) {
  11672. _IntegratePhysicsImpulses($120);
  11673. }
  11674. $122 = (($$0133152) + 1)|0;
  11675. $123 = HEAP32[3634]|0;
  11676. $124 = ($122>>>0)<($123>>>0);
  11677. if ($124) {
  11678. $$0133152 = $122;
  11679. } else {
  11680. break;
  11681. }
  11682. }
  11683. }
  11684. $119 = (($$0134155) + 1)|0;
  11685. $exitcond = ($119|0)==(100);
  11686. if ($exitcond) {
  11687. break;
  11688. } else {
  11689. $$0134155$ph = $119;
  11690. label = 32;
  11691. }
  11692. }
  11693. $116 = HEAP32[3569]|0;
  11694. $117 = ($116|0)==(0);
  11695. if (!($117)) {
  11696. $118 = HEAP32[3569]|0;
  11697. $$0131150 = 0;
  11698. while(1) {
  11699. $128 = (14280 + ($$0131150<<2)|0);
  11700. $129 = HEAP32[$128>>2]|0;
  11701. $130 = ($129|0)==(0|0);
  11702. if (!($130)) {
  11703. _IntegratePhysicsVelocity($129);
  11704. }
  11705. $131 = (($$0131150) + 1)|0;
  11706. $132 = ($131>>>0)<($118>>>0);
  11707. if ($132) {
  11708. $$0131150 = $131;
  11709. } else {
  11710. break;
  11711. }
  11712. }
  11713. }
  11714. $125 = HEAP32[3634]|0;
  11715. $126 = ($125|0)==(0);
  11716. if (!($126)) {
  11717. $127 = HEAP32[3634]|0;
  11718. $$0129148 = 0;
  11719. while(1) {
  11720. $136 = (14540 + ($$0129148<<2)|0);
  11721. $137 = HEAP32[$136>>2]|0;
  11722. $138 = ($137|0)==(0|0);
  11723. if (!($138)) {
  11724. _CorrectPhysicsPositions($137);
  11725. }
  11726. $139 = (($$0129148) + 1)|0;
  11727. $140 = ($139>>>0)<($127>>>0);
  11728. if ($140) {
  11729. $$0129148 = $139;
  11730. } else {
  11731. break;
  11732. }
  11733. }
  11734. }
  11735. $133 = HEAP32[3569]|0;
  11736. $134 = ($133|0)==(0);
  11737. if ($134) {
  11738. return;
  11739. }
  11740. $135 = HEAP32[3569]|0;
  11741. $$0127147 = 0;
  11742. while(1) {
  11743. $141 = (14280 + ($$0127147<<2)|0);
  11744. $142 = HEAP32[$141>>2]|0;
  11745. $143 = ($142|0)==(0|0);
  11746. if (!($143)) {
  11747. $$sroa$0$0$$sroa_idx = ((($142)) + 24|0);
  11748. HEAPF32[$$sroa$0$0$$sroa_idx>>2] = 0.0;
  11749. $$sroa$2$0$$sroa_idx1 = ((($142)) + 28|0);
  11750. HEAPF32[$$sroa$2$0$$sroa_idx1>>2] = 0.0;
  11751. $144 = ((($142)) + 36|0);
  11752. HEAPF32[$144>>2] = 0.0;
  11753. }
  11754. $145 = (($$0127147) + 1)|0;
  11755. $146 = ($145>>>0)<($135>>>0);
  11756. if ($146) {
  11757. $$0127147 = $145;
  11758. } else {
  11759. break;
  11760. }
  11761. }
  11762. return;
  11763. }
  11764. function _DestroyPhysicsManifold($0) {
  11765. $0 = $0|0;
  11766. 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;
  11767. 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;
  11768. sp = STACKTOP;
  11769. $1 = ($0|0)==(0|0);
  11770. if ($1) {
  11771. return;
  11772. }
  11773. $2 = HEAP32[$0>>2]|0;
  11774. $3 = HEAP32[3634]|0;
  11775. $4 = ($3|0)==(0);
  11776. L4: do {
  11777. if ($4) {
  11778. $$021 = -1;
  11779. } else {
  11780. $5 = HEAP32[3634]|0;
  11781. $$02023 = 0;
  11782. while(1) {
  11783. $6 = (14540 + ($$02023<<2)|0);
  11784. $7 = HEAP32[$6>>2]|0;
  11785. $8 = HEAP32[$7>>2]|0;
  11786. $9 = ($8|0)==($2|0);
  11787. if ($9) {
  11788. $$021 = $$02023;
  11789. break L4;
  11790. }
  11791. $10 = (($$02023) + 1)|0;
  11792. $11 = ($10>>>0)<($5>>>0);
  11793. if ($11) {
  11794. $$02023 = $10;
  11795. } else {
  11796. $$021 = -1;
  11797. break;
  11798. }
  11799. }
  11800. }
  11801. } while(0);
  11802. $12 = (14540 + ($$021<<2)|0);
  11803. $13 = HEAP32[$12>>2]|0;
  11804. _free($13);
  11805. $14 = HEAP32[3568]|0;
  11806. $15 = (($14) + -56)|0;
  11807. HEAP32[3568] = $15;
  11808. HEAP32[$12>>2] = 0;
  11809. $16 = HEAP32[3634]|0;
  11810. $17 = ($$021>>>0)<($16>>>0);
  11811. if ($17) {
  11812. $18 = HEAP32[3634]|0;
  11813. $$022 = $$021;$22 = $16;
  11814. while(1) {
  11815. $20 = (($$022) + 1)|0;
  11816. $21 = ($20>>>0)<($22>>>0);
  11817. if ($21) {
  11818. $24 = (14540 + ($$022<<2)|0);
  11819. $25 = (14540 + ($20<<2)|0);
  11820. $26 = HEAP32[$25>>2]|0;
  11821. HEAP32[$24>>2] = $26;
  11822. }
  11823. $23 = ($20>>>0)<($18>>>0);
  11824. if ($23) {
  11825. $$022 = $20;$22 = $18;
  11826. } else {
  11827. $$lcssa = $18;
  11828. break;
  11829. }
  11830. }
  11831. } else {
  11832. $$lcssa = $16;
  11833. }
  11834. $19 = (($$lcssa) + -1)|0;
  11835. HEAP32[3634] = $19;
  11836. return;
  11837. }
  11838. function _CreatePhysicsManifold($0,$1) {
  11839. $0 = $0|0;
  11840. $1 = $1|0;
  11841. 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;
  11842. var $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, stop = 0;
  11843. sp = STACKTOP;
  11844. $2 = (_malloc(56)|0);
  11845. $3 = HEAP32[3568]|0;
  11846. $4 = (($3) + 56)|0;
  11847. HEAP32[3568] = $4;
  11848. $5 = HEAP32[3634]|0;
  11849. $6 = ($5|0)==(0);
  11850. $$04457 = 0;
  11851. L1: while(1) {
  11852. if ($6) {
  11853. $$044576162 = 0;
  11854. break;
  11855. } else {
  11856. $$04755 = 0;
  11857. }
  11858. while(1) {
  11859. $9 = (14540 + ($$04755<<2)|0);
  11860. $10 = HEAP32[$9>>2]|0;
  11861. $11 = HEAP32[$10>>2]|0;
  11862. $12 = ($11|0)==($$04457|0);
  11863. $8 = (($$04755) + 1)|0;
  11864. if ($12) {
  11865. break;
  11866. }
  11867. $7 = ($8>>>0)<($5>>>0);
  11868. if ($7) {
  11869. $$04755 = $8;
  11870. } else {
  11871. label = 6;
  11872. break L1;
  11873. }
  11874. }
  11875. $13 = (($$04457) + 1)|0;
  11876. $14 = ($13|0)<(4096);
  11877. if ($14) {
  11878. $$04457 = $13;
  11879. } else {
  11880. label = 8;
  11881. break;
  11882. }
  11883. }
  11884. if ((label|0) == 8) {
  11885. return ($2|0);
  11886. }
  11887. if ((label|0) == 6) {
  11888. $15 = ($$04457|0)==(-1);
  11889. if ($15) {
  11890. return ($2|0);
  11891. } else {
  11892. $$044576162 = $$04457;
  11893. }
  11894. }
  11895. HEAP32[$2>>2] = $$044576162;
  11896. $16 = ((($2)) + 4|0);
  11897. HEAP32[$16>>2] = $0;
  11898. $17 = ((($2)) + 8|0);
  11899. HEAP32[$17>>2] = $1;
  11900. $18 = ((($2)) + 12|0);
  11901. dest=$18; stop=dest+44|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  11902. $19 = HEAP32[3634]|0;
  11903. $20 = (14540 + ($19<<2)|0);
  11904. HEAP32[$20>>2] = $2;
  11905. $21 = (($19) + 1)|0;
  11906. HEAP32[3634] = $21;
  11907. return ($2|0);
  11908. }
  11909. function _SolvePhysicsManifold($0) {
  11910. $0 = $0|0;
  11911. 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;
  11912. var $9 = 0, label = 0, sp = 0;
  11913. sp = STACKTOP;
  11914. $1 = ((($0)) + 4|0);
  11915. $2 = HEAP32[$1>>2]|0;
  11916. $3 = ((($2)) + 84|0);
  11917. $4 = HEAP32[$3>>2]|0;
  11918. L1: do {
  11919. switch ($4|0) {
  11920. case 0: {
  11921. $5 = ((($0)) + 8|0);
  11922. $6 = HEAP32[$5>>2]|0;
  11923. $7 = ((($6)) + 84|0);
  11924. $8 = HEAP32[$7>>2]|0;
  11925. switch ($8|0) {
  11926. case 0: {
  11927. _SolveCircleToCircle($0);
  11928. break L1;
  11929. break;
  11930. }
  11931. case 1: {
  11932. _SolveCircleToPolygon($0);
  11933. break L1;
  11934. break;
  11935. }
  11936. default: {
  11937. break L1;
  11938. }
  11939. }
  11940. break;
  11941. }
  11942. case 1: {
  11943. $9 = ((($0)) + 8|0);
  11944. $10 = HEAP32[$9>>2]|0;
  11945. $11 = ((($10)) + 84|0);
  11946. $12 = HEAP32[$11>>2]|0;
  11947. switch ($12|0) {
  11948. case 0: {
  11949. _SolvePolygonToCircle($0);
  11950. break L1;
  11951. break;
  11952. }
  11953. case 1: {
  11954. _SolvePolygonToPolygon($0);
  11955. break L1;
  11956. break;
  11957. }
  11958. default: {
  11959. break L1;
  11960. }
  11961. }
  11962. break;
  11963. }
  11964. default: {
  11965. }
  11966. }
  11967. } while(0);
  11968. $13 = ((($0)) + 8|0);
  11969. $14 = HEAP32[$13>>2]|0;
  11970. $15 = ((($14)) + 76|0);
  11971. $16 = HEAP32[$15>>2]|0;
  11972. $17 = ($16|0)==(0);
  11973. if (!($17)) {
  11974. return;
  11975. }
  11976. $18 = ((($0)) + 20|0);
  11977. $19 = +HEAPF32[$18>>2];
  11978. $20 = $19 < 0.0;
  11979. $21 = $20&1;
  11980. HEAP32[$15>>2] = $21;
  11981. return;
  11982. }
  11983. function _IntegratePhysicsForces($0) {
  11984. $0 = $0|0;
  11985. 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;
  11986. 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;
  11987. 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;
  11988. var label = 0, sp = 0;
  11989. sp = STACKTOP;
  11990. $1 = ((($0)) + 56|0);
  11991. $2 = +HEAPF32[$1>>2];
  11992. $3 = $2 == 0.0;
  11993. if ($3) {
  11994. return;
  11995. }
  11996. $4 = ((($0)) + 4|0);
  11997. $5 = HEAP32[$4>>2]|0;
  11998. $6 = ($5|0)==(0);
  11999. if ($6) {
  12000. return;
  12001. }
  12002. $7 = ((($0)) + 24|0);
  12003. $8 = +HEAPF32[$7>>2];
  12004. $9 = $2 * $8;
  12005. $10 = $9;
  12006. $11 = +HEAPF64[1748];
  12007. $12 = $11 * 0.5;
  12008. $13 = $10 * $12;
  12009. $14 = ((($0)) + 16|0);
  12010. $15 = +HEAPF32[$14>>2];
  12011. $16 = $15;
  12012. $17 = $16 + $13;
  12013. $18 = $17;
  12014. HEAPF32[$14>>2] = $18;
  12015. $19 = ((($0)) + 28|0);
  12016. $20 = +HEAPF32[$19>>2];
  12017. $21 = $2 * $20;
  12018. $22 = $21;
  12019. $23 = $12 * $22;
  12020. $24 = ((($0)) + 20|0);
  12021. $25 = +HEAPF32[$24>>2];
  12022. $26 = $25;
  12023. $27 = $26 + $23;
  12024. $28 = $27;
  12025. HEAPF32[$24>>2] = $28;
  12026. $29 = ((($0)) + 72|0);
  12027. $30 = HEAP32[$29>>2]|0;
  12028. $31 = ($30|0)==(0);
  12029. if (!($31)) {
  12030. $32 = +HEAPF32[7735];
  12031. $33 = $32;
  12032. $34 = $12 * $33;
  12033. $35 = +HEAPF32[$14>>2];
  12034. $36 = $35;
  12035. $37 = $36 + $34;
  12036. $38 = $37;
  12037. HEAPF32[$14>>2] = $38;
  12038. $39 = +HEAPF32[5];
  12039. $40 = $39;
  12040. $41 = $12 * $40;
  12041. $42 = +HEAPF32[$24>>2];
  12042. $43 = $42;
  12043. $44 = $43 + $41;
  12044. $45 = $44;
  12045. HEAPF32[$24>>2] = $45;
  12046. }
  12047. $46 = ((($0)) + 80|0);
  12048. $47 = HEAP32[$46>>2]|0;
  12049. $48 = ($47|0)==(0);
  12050. if (!($48)) {
  12051. return;
  12052. }
  12053. $49 = ((($0)) + 36|0);
  12054. $50 = +HEAPF32[$49>>2];
  12055. $51 = ((($0)) + 48|0);
  12056. $52 = +HEAPF32[$51>>2];
  12057. $53 = $50 * $52;
  12058. $54 = $53;
  12059. $55 = $12 * $54;
  12060. $56 = ((($0)) + 32|0);
  12061. $57 = +HEAPF32[$56>>2];
  12062. $58 = $57;
  12063. $59 = $58 + $55;
  12064. $60 = $59;
  12065. HEAPF32[$56>>2] = $60;
  12066. return;
  12067. }
  12068. function _InitializePhysicsManifolds($0) {
  12069. $0 = $0|0;
  12070. 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;
  12071. 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;
  12072. 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;
  12073. 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;
  12074. 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;
  12075. sp = STACKTOP;
  12076. STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
  12077. $$byval_copy14 = sp + 48|0;
  12078. $$byval_copy9 = sp + 40|0;
  12079. $1 = sp + 24|0;
  12080. $2 = sp + 16|0;
  12081. $3 = sp + 8|0;
  12082. $4 = sp;
  12083. $5 = sp + 32|0;
  12084. $6 = ((($0)) + 4|0);
  12085. $7 = HEAP32[$6>>2]|0;
  12086. $8 = ((($0)) + 8|0);
  12087. $9 = HEAP32[$8>>2]|0;
  12088. $10 = ((($7)) + 68|0);
  12089. $11 = +HEAPF32[$10>>2];
  12090. $12 = ((($9)) + 68|0);
  12091. $13 = +HEAPF32[$12>>2];
  12092. $14 = $11 * $13;
  12093. $15 = (+Math_sqrt((+$14)));
  12094. $16 = ((($0)) + 44|0);
  12095. HEAPF32[$16>>2] = $15;
  12096. $17 = ((($7)) + 60|0);
  12097. $18 = +HEAPF32[$17>>2];
  12098. $19 = ((($9)) + 60|0);
  12099. $20 = +HEAPF32[$19>>2];
  12100. $21 = $18 * $20;
  12101. $22 = (+Math_sqrt((+$21)));
  12102. $23 = ((($0)) + 52|0);
  12103. HEAPF32[$23>>2] = $22;
  12104. $24 = ((($7)) + 64|0);
  12105. $25 = +HEAPF32[$24>>2];
  12106. $26 = ((($9)) + 64|0);
  12107. $27 = +HEAPF32[$26>>2];
  12108. $28 = $25 * $27;
  12109. $29 = (+Math_sqrt((+$28)));
  12110. $30 = ((($0)) + 48|0);
  12111. HEAPF32[$30>>2] = $29;
  12112. $31 = ((($7)) + 8|0);
  12113. $32 = ((($9)) + 8|0);
  12114. $33 = ((($7)) + 32|0);
  12115. $34 = ((($9)) + 32|0);
  12116. $35 = ((($9)) + 16|0);
  12117. $36 = ((($7)) + 16|0);
  12118. $37 = ((($9)) + 20|0);
  12119. $38 = ((($3)) + 4|0);
  12120. $39 = ((($7)) + 20|0);
  12121. $40 = ((($$byval_copy9)) + 4|0);
  12122. $41 = ((($4)) + 4|0);
  12123. $42 = +HEAPF32[7735];
  12124. $43 = $42;
  12125. $44 = +HEAPF64[1748];
  12126. $45 = $43 * $44;
  12127. $46 = $45;
  12128. $47 = ((($5)) + 4|0);
  12129. $48 = +HEAPF32[5];
  12130. $49 = $48;
  12131. $50 = $49 * $44;
  12132. $51 = $50;
  12133. $52 = ((($0)) + 24|0);
  12134. ;HEAP32[$$byval_copy9>>2]=HEAP32[$52>>2]|0;HEAP32[$$byval_copy9+4>>2]=HEAP32[$52+4>>2]|0;
  12135. ;HEAP32[$$byval_copy14>>2]=HEAP32[$31>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$31+4>>2]|0;
  12136. _Vector2Subtract_4($1,$$byval_copy9,$$byval_copy14);
  12137. ;HEAP32[$$byval_copy9>>2]=HEAP32[$52>>2]|0;HEAP32[$$byval_copy9+4>>2]=HEAP32[$52+4>>2]|0;
  12138. ;HEAP32[$$byval_copy14>>2]=HEAP32[$32>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$32+4>>2]|0;
  12139. _Vector2Subtract_4($2,$$byval_copy9,$$byval_copy14);
  12140. $53 = +HEAPF32[$33>>2];
  12141. ;HEAP32[$$byval_copy14>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$1+4>>2]|0;
  12142. _MathCross($$byval_copy9,$53,$$byval_copy14);
  12143. $54 = +HEAPF32[$34>>2];
  12144. ;HEAP32[$$byval_copy14>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$2+4>>2]|0;
  12145. _MathCross($3,$54,$$byval_copy14);
  12146. $55 = +HEAPF32[$35>>2];
  12147. $56 = +HEAPF32[$3>>2];
  12148. $57 = $55 + $56;
  12149. $58 = +HEAPF32[$36>>2];
  12150. $59 = $57 - $58;
  12151. $60 = +HEAPF32[$$byval_copy9>>2];
  12152. $61 = $59 - $60;
  12153. HEAPF32[$4>>2] = $61;
  12154. $62 = +HEAPF32[$37>>2];
  12155. $63 = +HEAPF32[$38>>2];
  12156. $64 = $62 + $63;
  12157. $65 = +HEAPF32[$39>>2];
  12158. $66 = $64 - $65;
  12159. $67 = +HEAPF32[$40>>2];
  12160. $68 = $66 - $67;
  12161. HEAPF32[$41>>2] = $68;
  12162. ;HEAP32[$$byval_copy14>>2]=HEAP32[$4>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$4+4>>2]|0;
  12163. $69 = (+_MathLenSqr($$byval_copy14));
  12164. HEAPF32[$5>>2] = $46;
  12165. HEAPF32[$47>>2] = $51;
  12166. ;HEAP32[$$byval_copy14>>2]=HEAP32[$5>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$5+4>>2]|0;
  12167. $70 = (+_MathLenSqr($$byval_copy14));
  12168. $71 = $70 + 9.9999999747524271E-7;
  12169. $72 = $69 < $71;
  12170. if ($72) {
  12171. HEAPF32[$16>>2] = 0.0;
  12172. }
  12173. $73 = ((($0)) + 32|0);
  12174. ;HEAP32[$$byval_copy9>>2]=HEAP32[$73>>2]|0;HEAP32[$$byval_copy9+4>>2]=HEAP32[$73+4>>2]|0;
  12175. ;HEAP32[$$byval_copy14>>2]=HEAP32[$31>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$31+4>>2]|0;
  12176. _Vector2Subtract_4($1,$$byval_copy9,$$byval_copy14);
  12177. ;HEAP32[$$byval_copy9>>2]=HEAP32[$73>>2]|0;HEAP32[$$byval_copy9+4>>2]=HEAP32[$73+4>>2]|0;
  12178. ;HEAP32[$$byval_copy14>>2]=HEAP32[$32>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$32+4>>2]|0;
  12179. _Vector2Subtract_4($2,$$byval_copy9,$$byval_copy14);
  12180. $74 = +HEAPF32[$33>>2];
  12181. ;HEAP32[$$byval_copy14>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$1+4>>2]|0;
  12182. _MathCross($$byval_copy9,$74,$$byval_copy14);
  12183. $75 = +HEAPF32[$34>>2];
  12184. ;HEAP32[$$byval_copy14>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$2+4>>2]|0;
  12185. _MathCross($3,$75,$$byval_copy14);
  12186. $76 = +HEAPF32[$35>>2];
  12187. $77 = +HEAPF32[$3>>2];
  12188. $78 = $76 + $77;
  12189. $79 = +HEAPF32[$36>>2];
  12190. $80 = $78 - $79;
  12191. $81 = +HEAPF32[$$byval_copy9>>2];
  12192. $82 = $80 - $81;
  12193. HEAPF32[$4>>2] = $82;
  12194. $83 = +HEAPF32[$37>>2];
  12195. $84 = +HEAPF32[$38>>2];
  12196. $85 = $83 + $84;
  12197. $86 = +HEAPF32[$39>>2];
  12198. $87 = $85 - $86;
  12199. $88 = +HEAPF32[$40>>2];
  12200. $89 = $87 - $88;
  12201. HEAPF32[$41>>2] = $89;
  12202. ;HEAP32[$$byval_copy14>>2]=HEAP32[$4>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$4+4>>2]|0;
  12203. $90 = (+_MathLenSqr($$byval_copy14));
  12204. HEAPF32[$5>>2] = $46;
  12205. HEAPF32[$47>>2] = $51;
  12206. ;HEAP32[$$byval_copy14>>2]=HEAP32[$5>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$5+4>>2]|0;
  12207. $91 = (+_MathLenSqr($$byval_copy14));
  12208. $92 = $91 + 9.9999999747524271E-7;
  12209. $93 = $90 < $92;
  12210. if (!($93)) {
  12211. STACKTOP = sp;return;
  12212. }
  12213. HEAPF32[$16>>2] = 0.0;
  12214. STACKTOP = sp;return;
  12215. }
  12216. function _IntegratePhysicsImpulses($0) {
  12217. $0 = $0|0;
  12218. 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;
  12219. 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;
  12220. 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;
  12221. 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;
  12222. 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;
  12223. 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;
  12224. 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;
  12225. 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;
  12226. 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;
  12227. 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;
  12228. 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;
  12229. 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;
  12230. 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;
  12231. sp = STACKTOP;
  12232. STACKTOP = STACKTOP + 144|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(144|0);
  12233. $tmpcast137$byval_copy = sp + 136|0;
  12234. $$byval_copy29 = sp + 128|0;
  12235. $1 = sp + 40|0;
  12236. $2 = sp + 32|0;
  12237. $3 = sp + 8|0;
  12238. $4 = sp + 120|0;
  12239. $5 = sp + 112|0;
  12240. $6 = sp + 104|0;
  12241. $7 = sp + 96|0;
  12242. $8 = sp + 24|0;
  12243. $9 = sp + 88|0;
  12244. $10 = sp + 80|0;
  12245. $11 = sp + 72|0;
  12246. $12 = sp + 64|0;
  12247. $13 = sp + 56|0;
  12248. $14 = sp + 16|0;
  12249. $15 = sp;
  12250. $16 = sp + 48|0;
  12251. $17 = ((($0)) + 4|0);
  12252. $18 = HEAP32[$17>>2]|0;
  12253. $19 = ((($0)) + 8|0);
  12254. $20 = HEAP32[$19>>2]|0;
  12255. $21 = ((($18)) + 56|0);
  12256. $22 = +HEAPF32[$21>>2];
  12257. $23 = ((($20)) + 56|0);
  12258. $24 = +HEAPF32[$23>>2];
  12259. $25 = $22 + $24;
  12260. $fabsf = (+Math_abs((+$25)));
  12261. $26 = !($fabsf <= 9.9999999747524271E-7);
  12262. if (!($26)) {
  12263. $$sroa$050$0$$sroa_idx = ((($18)) + 16|0);
  12264. HEAPF32[$$sroa$050$0$$sroa_idx>>2] = 0.0;
  12265. $$sroa$251$0$$sroa_idx52 = ((($18)) + 20|0);
  12266. HEAPF32[$$sroa$251$0$$sroa_idx52>>2] = 0.0;
  12267. $$sroa$047$0$$sroa_idx = ((($20)) + 16|0);
  12268. HEAPF32[$$sroa$047$0$$sroa_idx>>2] = 0.0;
  12269. $$sroa$248$0$$sroa_idx49 = ((($20)) + 20|0);
  12270. HEAPF32[$$sroa$248$0$$sroa_idx49>>2] = 0.0;
  12271. STACKTOP = sp;return;
  12272. }
  12273. $27 = ((($0)) + 40|0);
  12274. $28 = HEAP32[$27>>2]|0;
  12275. $29 = ($28|0)==(0);
  12276. if ($29) {
  12277. STACKTOP = sp;return;
  12278. }
  12279. $30 = ((($18)) + 8|0);
  12280. $31 = ((($20)) + 8|0);
  12281. $32 = ((($20)) + 16|0);
  12282. $33 = ((($20)) + 32|0);
  12283. $34 = ((($18)) + 16|0);
  12284. $35 = ((($18)) + 32|0);
  12285. $36 = ((($20)) + 20|0);
  12286. $37 = ((($6)) + 4|0);
  12287. $38 = ((($18)) + 20|0);
  12288. $39 = ((($7)) + 4|0);
  12289. $40 = ((($3)) + 4|0);
  12290. $41 = ((($0)) + 16|0);
  12291. $42 = ((($18)) + 48|0);
  12292. $43 = ((($20)) + 48|0);
  12293. $44 = ((($0)) + 44|0);
  12294. $45 = ((($8)) + 4|0);
  12295. $46 = ((($0)) + 20|0);
  12296. $47 = ((($18)) + 4|0);
  12297. $48 = ((($20)) + 4|0);
  12298. $49 = ((($12)) + 4|0);
  12299. $50 = ((($13)) + 4|0);
  12300. $51 = ((($14)) + 4|0);
  12301. $52 = ((($0)) + 52|0);
  12302. $$sroa$2$0$$sroa_idx2 = ((($15)) + 4|0);
  12303. $53 = ((($20)) + 80|0);
  12304. $54 = ((($18)) + 80|0);
  12305. $55 = ((($16)) + 4|0);
  12306. $56 = ((($0)) + 48|0);
  12307. $57 = ((($20)) + 80|0);
  12308. $58 = ((($18)) + 80|0);
  12309. $59 = ((($9)) + 4|0);
  12310. $$0135139 = 0;
  12311. while(1) {
  12312. $63 = (((($0)) + 24|0) + ($$0135139<<3)|0);
  12313. ;HEAP32[$$byval_copy29>>2]=HEAP32[$63>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$63+4>>2]|0;
  12314. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$30>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$30+4>>2]|0;
  12315. _Vector2Subtract_4($1,$$byval_copy29,$tmpcast137$byval_copy);
  12316. ;HEAP32[$$byval_copy29>>2]=HEAP32[$63>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$63+4>>2]|0;
  12317. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$31>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$31+4>>2]|0;
  12318. _Vector2Subtract_4($2,$$byval_copy29,$tmpcast137$byval_copy);
  12319. $64 = +HEAPF32[$32>>2];
  12320. $65 = +HEAPF32[$33>>2];
  12321. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$2>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$2+4>>2]|0;
  12322. _MathCross($4,$65,$tmpcast137$byval_copy);
  12323. $66 = +HEAPF32[$4>>2];
  12324. $67 = $64 + $66;
  12325. $68 = +HEAPF32[$34>>2];
  12326. $69 = $67 - $68;
  12327. $70 = +HEAPF32[$35>>2];
  12328. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$1+4>>2]|0;
  12329. _MathCross($5,$70,$tmpcast137$byval_copy);
  12330. $71 = +HEAPF32[$5>>2];
  12331. $72 = $69 - $71;
  12332. HEAPF32[$3>>2] = $72;
  12333. $73 = +HEAPF32[$36>>2];
  12334. $74 = +HEAPF32[$33>>2];
  12335. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$2>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$2+4>>2]|0;
  12336. _MathCross($6,$74,$tmpcast137$byval_copy);
  12337. $75 = +HEAPF32[$37>>2];
  12338. $76 = $73 + $75;
  12339. $77 = +HEAPF32[$38>>2];
  12340. $78 = $76 - $77;
  12341. $79 = +HEAPF32[$35>>2];
  12342. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$1+4>>2]|0;
  12343. _MathCross($7,$79,$tmpcast137$byval_copy);
  12344. $80 = +HEAPF32[$39>>2];
  12345. $81 = $78 - $80;
  12346. HEAPF32[$40>>2] = $81;
  12347. ;HEAP32[$$byval_copy29>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$3+4>>2]|0;
  12348. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$41>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$41+4>>2]|0;
  12349. $82 = (+_MathDot($$byval_copy29,$tmpcast137$byval_copy));
  12350. $83 = $82 > 0.0;
  12351. if ($83) {
  12352. $$1 = 1;
  12353. } else {
  12354. ;HEAP32[$$byval_copy29>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$1+4>>2]|0;
  12355. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$41>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$41+4>>2]|0;
  12356. $84 = (+_MathCrossVector2($$byval_copy29,$tmpcast137$byval_copy));
  12357. ;HEAP32[$$byval_copy29>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$2+4>>2]|0;
  12358. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$41>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$41+4>>2]|0;
  12359. $85 = (+_MathCrossVector2($$byval_copy29,$tmpcast137$byval_copy));
  12360. $86 = +HEAPF32[$21>>2];
  12361. $87 = +HEAPF32[$23>>2];
  12362. $88 = $86 + $87;
  12363. $89 = $84 * $84;
  12364. $90 = +HEAPF32[$42>>2];
  12365. $91 = $89 * $90;
  12366. $92 = $88 + $91;
  12367. $93 = $85 * $85;
  12368. $94 = +HEAPF32[$43>>2];
  12369. $95 = $93 * $94;
  12370. $96 = $92 + $95;
  12371. $97 = +HEAPF32[$44>>2];
  12372. $98 = $97 + 1.0;
  12373. $99 = $82 * $98;
  12374. $100 = -$99;
  12375. $101 = $100 / $96;
  12376. $102 = HEAP32[$27>>2]|0;
  12377. $103 = (+($102>>>0));
  12378. $104 = $101 / $103;
  12379. $105 = +HEAPF32[$41>>2];
  12380. $106 = $105 * $104;
  12381. HEAPF32[$8>>2] = $106;
  12382. $107 = +HEAPF32[$46>>2];
  12383. $108 = $104 * $107;
  12384. HEAPF32[$45>>2] = $108;
  12385. $109 = HEAP32[$47>>2]|0;
  12386. $110 = ($109|0)==(0);
  12387. if (!($110)) {
  12388. $111 = +HEAPF32[$21>>2];
  12389. $112 = +HEAPF32[$8>>2];
  12390. $113 = $111 * $112;
  12391. $114 = +HEAPF32[$34>>2];
  12392. $115 = $114 - $113;
  12393. HEAPF32[$34>>2] = $115;
  12394. $116 = +HEAPF32[$45>>2];
  12395. $117 = $111 * $116;
  12396. $118 = +HEAPF32[$38>>2];
  12397. $119 = $118 - $117;
  12398. HEAPF32[$38>>2] = $119;
  12399. $120 = HEAP32[$58>>2]|0;
  12400. $121 = ($120|0)==(0);
  12401. if ($121) {
  12402. $122 = +HEAPF32[$42>>2];
  12403. $123 = +HEAPF32[$8>>2];
  12404. $124 = -$123;
  12405. HEAPF32[$9>>2] = $124;
  12406. $125 = +HEAPF32[$45>>2];
  12407. $126 = -$125;
  12408. HEAPF32[$59>>2] = $126;
  12409. ;HEAP32[$$byval_copy29>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$1+4>>2]|0;
  12410. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$9>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$9+4>>2]|0;
  12411. $127 = (+_MathCrossVector2($$byval_copy29,$tmpcast137$byval_copy));
  12412. $128 = $122 * $127;
  12413. $129 = +HEAPF32[$35>>2];
  12414. $130 = $129 + $128;
  12415. HEAPF32[$35>>2] = $130;
  12416. }
  12417. }
  12418. $131 = HEAP32[$48>>2]|0;
  12419. $132 = ($131|0)==(0);
  12420. if (!($132)) {
  12421. $133 = +HEAPF32[$23>>2];
  12422. $134 = +HEAPF32[$8>>2];
  12423. $135 = $133 * $134;
  12424. $136 = +HEAPF32[$32>>2];
  12425. $137 = $136 + $135;
  12426. HEAPF32[$32>>2] = $137;
  12427. $138 = +HEAPF32[$45>>2];
  12428. $139 = $133 * $138;
  12429. $140 = +HEAPF32[$36>>2];
  12430. $141 = $140 + $139;
  12431. HEAPF32[$36>>2] = $141;
  12432. $142 = HEAP32[$57>>2]|0;
  12433. $143 = ($142|0)==(0);
  12434. if ($143) {
  12435. $144 = +HEAPF32[$43>>2];
  12436. ;HEAP32[$$byval_copy29>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$2+4>>2]|0;
  12437. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$8>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$8+4>>2]|0;
  12438. $145 = (+_MathCrossVector2($$byval_copy29,$tmpcast137$byval_copy));
  12439. $146 = $144 * $145;
  12440. $147 = +HEAPF32[$33>>2];
  12441. $148 = $147 + $146;
  12442. HEAPF32[$33>>2] = $148;
  12443. }
  12444. }
  12445. $149 = +HEAPF32[$32>>2];
  12446. $150 = +HEAPF32[$33>>2];
  12447. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$2>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$2+4>>2]|0;
  12448. _MathCross($10,$150,$tmpcast137$byval_copy);
  12449. $151 = +HEAPF32[$10>>2];
  12450. $152 = $149 + $151;
  12451. $153 = +HEAPF32[$34>>2];
  12452. $154 = $152 - $153;
  12453. $155 = +HEAPF32[$35>>2];
  12454. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$1+4>>2]|0;
  12455. _MathCross($11,$155,$tmpcast137$byval_copy);
  12456. $156 = +HEAPF32[$11>>2];
  12457. $157 = $154 - $156;
  12458. HEAPF32[$3>>2] = $157;
  12459. $158 = +HEAPF32[$36>>2];
  12460. $159 = +HEAPF32[$33>>2];
  12461. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$2>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$2+4>>2]|0;
  12462. _MathCross($12,$159,$tmpcast137$byval_copy);
  12463. $160 = +HEAPF32[$49>>2];
  12464. $161 = $158 + $160;
  12465. $162 = +HEAPF32[$38>>2];
  12466. $163 = $161 - $162;
  12467. $164 = +HEAPF32[$35>>2];
  12468. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$1+4>>2]|0;
  12469. _MathCross($13,$164,$tmpcast137$byval_copy);
  12470. $165 = +HEAPF32[$50>>2];
  12471. $166 = $163 - $165;
  12472. HEAPF32[$40>>2] = $166;
  12473. $167 = +HEAPF32[$3>>2];
  12474. $168 = +HEAPF32[$41>>2];
  12475. ;HEAP32[$$byval_copy29>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$3+4>>2]|0;
  12476. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$41>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$41+4>>2]|0;
  12477. $169 = (+_MathDot($$byval_copy29,$tmpcast137$byval_copy));
  12478. $170 = $168 * $169;
  12479. $171 = $167 - $170;
  12480. HEAPF32[$14>>2] = $171;
  12481. $172 = +HEAPF32[$40>>2];
  12482. $173 = +HEAPF32[$46>>2];
  12483. ;HEAP32[$$byval_copy29>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$3+4>>2]|0;
  12484. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$41>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$41+4>>2]|0;
  12485. $174 = (+_MathDot($$byval_copy29,$tmpcast137$byval_copy));
  12486. $175 = $173 * $174;
  12487. $176 = $172 - $175;
  12488. HEAPF32[$51>>2] = $176;
  12489. _MathNormalize($14);
  12490. ;HEAP32[$$byval_copy29>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$3+4>>2]|0;
  12491. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$14>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$14+4>>2]|0;
  12492. $177 = (+_MathDot($$byval_copy29,$tmpcast137$byval_copy));
  12493. $178 = -$177;
  12494. $179 = $178 / $96;
  12495. $180 = HEAP32[$27>>2]|0;
  12496. $181 = (+($180>>>0));
  12497. $182 = $179 / $181;
  12498. $fabsf136 = (+Math_abs((+$182)));
  12499. $183 = !($fabsf136 <= 9.9999999747524271E-7);
  12500. if ($183) {
  12501. $184 = $15;
  12502. $185 = $184;
  12503. HEAP32[$185>>2] = 0;
  12504. $186 = (($184) + 4)|0;
  12505. $187 = $186;
  12506. HEAP32[$187>>2] = 0;
  12507. $188 = +HEAPF32[$52>>2];
  12508. $189 = $104 * $188;
  12509. $190 = $fabsf136 < $189;
  12510. $191 = +HEAPF32[$14>>2];
  12511. $192 = +HEAPF32[$51>>2];
  12512. if ($190) {
  12513. $193 = $182 * $191;
  12514. $194 = $182 * $192;
  12515. $$sink = $194;$$sink138 = $193;
  12516. } else {
  12517. $195 = -$104;
  12518. $196 = $191 * $195;
  12519. $197 = +HEAPF32[$56>>2];
  12520. $198 = $196 * $197;
  12521. $199 = $192 * $195;
  12522. $200 = $199 * $197;
  12523. $$sink = $200;$$sink138 = $198;
  12524. }
  12525. HEAPF32[$15>>2] = $$sink138;
  12526. HEAPF32[$$sroa$2$0$$sroa_idx2>>2] = $$sink;
  12527. $201 = HEAP32[$47>>2]|0;
  12528. $202 = ($201|0)==(0);
  12529. if (!($202)) {
  12530. $203 = +HEAPF32[$21>>2];
  12531. $204 = +HEAPF32[$15>>2];
  12532. $205 = $203 * $204;
  12533. $206 = +HEAPF32[$34>>2];
  12534. $207 = $206 - $205;
  12535. HEAPF32[$34>>2] = $207;
  12536. $208 = +HEAPF32[$$sroa$2$0$$sroa_idx2>>2];
  12537. $209 = $203 * $208;
  12538. $210 = +HEAPF32[$38>>2];
  12539. $211 = $210 - $209;
  12540. HEAPF32[$38>>2] = $211;
  12541. $212 = HEAP32[$54>>2]|0;
  12542. $213 = ($212|0)==(0);
  12543. if ($213) {
  12544. $214 = +HEAPF32[$42>>2];
  12545. $215 = +HEAPF32[$15>>2];
  12546. $216 = -$215;
  12547. HEAPF32[$16>>2] = $216;
  12548. $217 = +HEAPF32[$$sroa$2$0$$sroa_idx2>>2];
  12549. $218 = -$217;
  12550. HEAPF32[$55>>2] = $218;
  12551. ;HEAP32[$$byval_copy29>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$1+4>>2]|0;
  12552. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$16>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$16+4>>2]|0;
  12553. $219 = (+_MathCrossVector2($$byval_copy29,$tmpcast137$byval_copy));
  12554. $220 = $214 * $219;
  12555. $221 = +HEAPF32[$35>>2];
  12556. $222 = $221 + $220;
  12557. HEAPF32[$35>>2] = $222;
  12558. }
  12559. }
  12560. $223 = HEAP32[$48>>2]|0;
  12561. $224 = ($223|0)==(0);
  12562. if (!($224)) {
  12563. $225 = +HEAPF32[$23>>2];
  12564. $226 = +HEAPF32[$15>>2];
  12565. $227 = $225 * $226;
  12566. $228 = +HEAPF32[$32>>2];
  12567. $229 = $228 + $227;
  12568. HEAPF32[$32>>2] = $229;
  12569. $230 = +HEAPF32[$$sroa$2$0$$sroa_idx2>>2];
  12570. $231 = $225 * $230;
  12571. $232 = +HEAPF32[$36>>2];
  12572. $233 = $232 + $231;
  12573. HEAPF32[$36>>2] = $233;
  12574. $234 = HEAP32[$53>>2]|0;
  12575. $235 = ($234|0)==(0);
  12576. if ($235) {
  12577. $236 = +HEAPF32[$43>>2];
  12578. ;HEAP32[$$byval_copy29>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$2+4>>2]|0;
  12579. ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$15>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$15+4>>2]|0;
  12580. $237 = (+_MathCrossVector2($$byval_copy29,$tmpcast137$byval_copy));
  12581. $238 = $236 * $237;
  12582. $239 = +HEAPF32[$33>>2];
  12583. $240 = $239 + $238;
  12584. HEAPF32[$33>>2] = $240;
  12585. }
  12586. }
  12587. $$0 = 0;
  12588. } else {
  12589. $$0 = 1;
  12590. }
  12591. $$1 = $$0;
  12592. }
  12593. $cond1 = ($$1|0)==(0);
  12594. $62 = (($$0135139) + 1)|0;
  12595. if (!($cond1)) {
  12596. label = 26;
  12597. break;
  12598. }
  12599. $60 = HEAP32[$27>>2]|0;
  12600. $61 = ($62>>>0)<($60>>>0);
  12601. if ($61) {
  12602. $$0135139 = $62;
  12603. } else {
  12604. label = 26;
  12605. break;
  12606. }
  12607. }
  12608. if ((label|0) == 26) {
  12609. STACKTOP = sp;return;
  12610. }
  12611. }
  12612. function _IntegratePhysicsVelocity($0) {
  12613. $0 = $0|0;
  12614. 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;
  12615. 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;
  12616. sp = STACKTOP;
  12617. $1 = ((($0)) + 4|0);
  12618. $2 = HEAP32[$1>>2]|0;
  12619. $3 = ($2|0)==(0);
  12620. if ($3) {
  12621. return;
  12622. }
  12623. $4 = ((($0)) + 16|0);
  12624. $5 = +HEAPF32[$4>>2];
  12625. $6 = $5;
  12626. $7 = +HEAPF64[1748];
  12627. $8 = $6 * $7;
  12628. $9 = ((($0)) + 8|0);
  12629. $10 = +HEAPF32[$9>>2];
  12630. $11 = $10;
  12631. $12 = $8 + $11;
  12632. $13 = $12;
  12633. HEAPF32[$9>>2] = $13;
  12634. $14 = ((($0)) + 20|0);
  12635. $15 = +HEAPF32[$14>>2];
  12636. $16 = $15;
  12637. $17 = $7 * $16;
  12638. $18 = ((($0)) + 12|0);
  12639. $19 = +HEAPF32[$18>>2];
  12640. $20 = $19;
  12641. $21 = $20 + $17;
  12642. $22 = $21;
  12643. HEAPF32[$18>>2] = $22;
  12644. $23 = ((($0)) + 80|0);
  12645. $24 = HEAP32[$23>>2]|0;
  12646. $25 = ($24|0)==(0);
  12647. if ($25) {
  12648. $26 = ((($0)) + 32|0);
  12649. $27 = +HEAPF32[$26>>2];
  12650. $28 = $27;
  12651. $29 = $7 * $28;
  12652. $30 = ((($0)) + 40|0);
  12653. $31 = +HEAPF32[$30>>2];
  12654. $32 = $31;
  12655. $33 = $32 + $29;
  12656. $34 = $33;
  12657. HEAPF32[$30>>2] = $34;
  12658. }
  12659. $35 = ((($0)) + 484|0);
  12660. $36 = ((($0)) + 40|0);
  12661. $37 = +HEAPF32[$36>>2];
  12662. _Mat2Set($35,$37);
  12663. _IntegratePhysicsForces($0);
  12664. return;
  12665. }
  12666. function _CorrectPhysicsPositions($0) {
  12667. $0 = $0|0;
  12668. 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;
  12669. 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;
  12670. var $46 = 0.0, $5 = 0, $6 = 0.0, $7 = 0.0, $8 = 0, $9 = 0.0, label = 0, sp = 0;
  12671. sp = STACKTOP;
  12672. $1 = ((($0)) + 4|0);
  12673. $2 = HEAP32[$1>>2]|0;
  12674. $3 = ((($0)) + 8|0);
  12675. $4 = HEAP32[$3>>2]|0;
  12676. $5 = ((($0)) + 12|0);
  12677. $6 = +HEAPF32[$5>>2];
  12678. $7 = $6 + -0.05000000074505806;
  12679. $8 = $7 > 0.0;
  12680. $9 = $8 ? $7 : 0.0;
  12681. $10 = ((($2)) + 56|0);
  12682. $11 = +HEAPF32[$10>>2];
  12683. $12 = ((($4)) + 56|0);
  12684. $13 = +HEAPF32[$12>>2];
  12685. $14 = $11 + $13;
  12686. $15 = $9 / $14;
  12687. $16 = ((($0)) + 16|0);
  12688. $17 = +HEAPF32[$16>>2];
  12689. $18 = $17 * $15;
  12690. $19 = $18 * 0.40000000596046448;
  12691. $20 = ((($0)) + 20|0);
  12692. $21 = +HEAPF32[$20>>2];
  12693. $22 = $15 * $21;
  12694. $23 = $22 * 0.40000000596046448;
  12695. $24 = ((($2)) + 4|0);
  12696. $25 = HEAP32[$24>>2]|0;
  12697. $26 = ($25|0)==(0);
  12698. if (!($26)) {
  12699. $27 = $11 * $19;
  12700. $28 = ((($2)) + 8|0);
  12701. $29 = +HEAPF32[$28>>2];
  12702. $30 = $29 - $27;
  12703. HEAPF32[$28>>2] = $30;
  12704. $31 = $11 * $23;
  12705. $32 = ((($2)) + 12|0);
  12706. $33 = +HEAPF32[$32>>2];
  12707. $34 = $33 - $31;
  12708. HEAPF32[$32>>2] = $34;
  12709. }
  12710. $35 = ((($4)) + 4|0);
  12711. $36 = HEAP32[$35>>2]|0;
  12712. $37 = ($36|0)==(0);
  12713. if ($37) {
  12714. return;
  12715. }
  12716. $38 = +HEAPF32[$12>>2];
  12717. $39 = $19 * $38;
  12718. $40 = ((($4)) + 8|0);
  12719. $41 = +HEAPF32[$40>>2];
  12720. $42 = $41 + $39;
  12721. HEAPF32[$40>>2] = $42;
  12722. $43 = $23 * $38;
  12723. $44 = ((($4)) + 12|0);
  12724. $45 = +HEAPF32[$44>>2];
  12725. $46 = $43 + $45;
  12726. HEAPF32[$44>>2] = $46;
  12727. return;
  12728. }
  12729. function _SolveCircleToCircle($0) {
  12730. $0 = $0|0;
  12731. 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;
  12732. 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;
  12733. 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;
  12734. var $8 = 0.0, $9 = 0, label = 0, sp = 0;
  12735. sp = STACKTOP;
  12736. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  12737. $$byval_copy2 = sp + 16|0;
  12738. $$byval_copy = sp + 8|0;
  12739. $1 = sp;
  12740. $2 = ((($0)) + 4|0);
  12741. $3 = HEAP32[$2>>2]|0;
  12742. $4 = ((($0)) + 8|0);
  12743. $5 = HEAP32[$4>>2]|0;
  12744. $6 = ((($5)) + 8|0);
  12745. $7 = ((($3)) + 8|0);
  12746. ;HEAP32[$$byval_copy>>2]=HEAP32[$6>>2]|0;HEAP32[$$byval_copy+4>>2]=HEAP32[$6+4>>2]|0;
  12747. ;HEAP32[$$byval_copy2>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$7+4>>2]|0;
  12748. _Vector2Subtract_4($1,$$byval_copy,$$byval_copy2);
  12749. ;HEAP32[$$byval_copy2>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$1+4>>2]|0;
  12750. $8 = (+_MathLenSqr($$byval_copy2));
  12751. $9 = ((($3)) + 92|0);
  12752. $10 = +HEAPF32[$9>>2];
  12753. $11 = ((($5)) + 92|0);
  12754. $12 = +HEAPF32[$11>>2];
  12755. $13 = $10 + $12;
  12756. $14 = $13 * $13;
  12757. $15 = !($8 >= $14);
  12758. if (!($15)) {
  12759. $16 = ((($0)) + 40|0);
  12760. HEAP32[$16>>2] = 0;
  12761. STACKTOP = sp;return;
  12762. }
  12763. $17 = (+Math_sqrt((+$8)));
  12764. $18 = ((($0)) + 40|0);
  12765. HEAP32[$18>>2] = 1;
  12766. $19 = $17 == 0.0;
  12767. if ($19) {
  12768. $20 = HEAP32[$9>>2]|0;
  12769. $21 = ((($0)) + 12|0);
  12770. HEAP32[$21>>2] = $20;
  12771. $$sroa$05$0$$sroa_idx = ((($0)) + 16|0);
  12772. HEAPF32[$$sroa$05$0$$sroa_idx>>2] = 1.0;
  12773. $$sroa$26$0$$sroa_idx7 = ((($0)) + 20|0);
  12774. HEAPF32[$$sroa$26$0$$sroa_idx7>>2] = 0.0;
  12775. $22 = ((($0)) + 24|0);
  12776. $23 = $7;
  12777. $24 = $23;
  12778. $25 = HEAP32[$24>>2]|0;
  12779. $26 = (($23) + 4)|0;
  12780. $27 = $26;
  12781. $28 = HEAP32[$27>>2]|0;
  12782. $29 = $22;
  12783. $30 = $29;
  12784. HEAP32[$30>>2] = $25;
  12785. $31 = (($29) + 4)|0;
  12786. $32 = $31;
  12787. HEAP32[$32>>2] = $28;
  12788. } else {
  12789. $33 = $13 - $17;
  12790. $34 = ((($0)) + 12|0);
  12791. HEAPF32[$34>>2] = $33;
  12792. $35 = +HEAPF32[$1>>2];
  12793. $36 = $35 / $17;
  12794. $37 = ((($1)) + 4|0);
  12795. $38 = +HEAPF32[$37>>2];
  12796. $39 = $38 / $17;
  12797. $$sroa$02$0$$sroa_idx = ((($0)) + 16|0);
  12798. HEAPF32[$$sroa$02$0$$sroa_idx>>2] = $36;
  12799. $$sroa$23$0$$sroa_idx4 = ((($0)) + 20|0);
  12800. HEAPF32[$$sroa$23$0$$sroa_idx4>>2] = $39;
  12801. $40 = +HEAPF32[$9>>2];
  12802. $41 = $36 * $40;
  12803. $42 = +HEAPF32[$7>>2];
  12804. $43 = $41 + $42;
  12805. $44 = $39 * $40;
  12806. $45 = ((($3)) + 12|0);
  12807. $46 = +HEAPF32[$45>>2];
  12808. $47 = $44 + $46;
  12809. $$sroa$0$0$$sroa_idx = ((($0)) + 24|0);
  12810. HEAPF32[$$sroa$0$0$$sroa_idx>>2] = $43;
  12811. $$sroa$2$0$$sroa_idx1 = ((($0)) + 28|0);
  12812. HEAPF32[$$sroa$2$0$$sroa_idx1>>2] = $47;
  12813. }
  12814. $48 = ((($3)) + 76|0);
  12815. $49 = HEAP32[$48>>2]|0;
  12816. $50 = ($49|0)==(0);
  12817. if (!($50)) {
  12818. STACKTOP = sp;return;
  12819. }
  12820. $51 = ((($0)) + 20|0);
  12821. $52 = +HEAPF32[$51>>2];
  12822. $53 = $52 < 0.0;
  12823. $54 = $53&1;
  12824. HEAP32[$48>>2] = $54;
  12825. STACKTOP = sp;return;
  12826. }
  12827. function _SolveCircleToPolygon($0) {
  12828. $0 = $0|0;
  12829. 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;
  12830. 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;
  12831. 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;
  12832. 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;
  12833. 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;
  12834. 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;
  12835. 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;
  12836. 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;
  12837. 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;
  12838. 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;
  12839. 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;
  12840. 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;
  12841. 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;
  12842. var $tmpcast104$byval_copy42 = 0, label = 0, sp = 0;
  12843. sp = STACKTOP;
  12844. STACKTOP = STACKTOP + 608|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(608|0);
  12845. $tmpcast104$byval_copy42 = sp + 584|0;
  12846. $$byval_copy41 = sp + 568|0;
  12847. $1 = sp + 24|0;
  12848. $2 = sp + 552|0;
  12849. $3 = sp + 544|0;
  12850. $4 = sp + 88|0;
  12851. $5 = sp + 536|0;
  12852. $6 = sp + 16|0;
  12853. $7 = sp + 8|0;
  12854. $8 = sp;
  12855. $9 = sp + 528|0;
  12856. $10 = sp + 520|0;
  12857. $11 = sp + 512|0;
  12858. $12 = sp + 504|0;
  12859. $13 = sp + 80|0;
  12860. $14 = sp + 72|0;
  12861. $15 = sp + 64|0;
  12862. $16 = sp + 56|0;
  12863. $17 = sp + 48|0;
  12864. $18 = sp + 40|0;
  12865. $19 = sp + 496|0;
  12866. $20 = sp + 32|0;
  12867. $21 = ((($0)) + 4|0);
  12868. $22 = HEAP32[$21>>2]|0;
  12869. $23 = ((($0)) + 8|0);
  12870. $24 = HEAP32[$23>>2]|0;
  12871. $25 = ((($0)) + 40|0);
  12872. HEAP32[$25>>2] = 0;
  12873. $26 = ((($22)) + 8|0);
  12874. $27 = $26;
  12875. $28 = $27;
  12876. $29 = HEAP32[$28>>2]|0;
  12877. $30 = (($27) + 4)|0;
  12878. $31 = $30;
  12879. $32 = HEAP32[$31>>2]|0;
  12880. $33 = $1;
  12881. $34 = $33;
  12882. HEAP32[$34>>2] = $29;
  12883. $35 = (($33) + 4)|0;
  12884. $36 = $35;
  12885. HEAP32[$36>>2] = $32;
  12886. $37 = ((($24)) + 96|0);
  12887. $38 = ((($24)) + 484|0);
  12888. ;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;
  12889. _Mat2Transpose($2,$tmpcast104$byval_copy42);
  12890. $39 = ((($24)) + 8|0);
  12891. ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
  12892. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$39>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$39+4>>2]|0;
  12893. _Vector2Subtract_4($3,$$byval_copy41,$tmpcast104$byval_copy42);
  12894. ;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;
  12895. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$3>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$3+4>>2]|0;
  12896. _Mat2MultiplyVector2($1,$$byval_copy41,$tmpcast104$byval_copy42);
  12897. _memcpy(($4|0),($37|0),404)|0;
  12898. $40 = HEAP32[$4>>2]|0;
  12899. $41 = ($40|0)==(0);
  12900. L1: do {
  12901. if ($41) {
  12902. $$0$lcssa = -3.4028234663852886E+38;$$093$lcssa = 0;
  12903. } else {
  12904. $42 = ((($22)) + 92|0);
  12905. $$0125 = -3.4028234663852886E+38;$$093124 = 0;$$097123 = 0;
  12906. while(1) {
  12907. $43 = (((($4)) + 196|0) + ($$097123<<3)|0);
  12908. $44 = (((($4)) + 4|0) + ($$097123<<3)|0);
  12909. ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
  12910. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$44>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$44+4>>2]|0;
  12911. _Vector2Subtract_4($5,$$byval_copy41,$tmpcast104$byval_copy42);
  12912. ;HEAP32[$$byval_copy41>>2]=HEAP32[$43>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$43+4>>2]|0;
  12913. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$5>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$5+4>>2]|0;
  12914. $45 = (+_MathDot($$byval_copy41,$tmpcast104$byval_copy42));
  12915. $46 = +HEAPF32[$42>>2];
  12916. $47 = $45 > $46;
  12917. $48 = $45 > $$0125;
  12918. if ($47) {
  12919. break;
  12920. }
  12921. $$1 = $48 ? $45 : $$0125;
  12922. $$194 = $48 ? $$097123 : $$093124;
  12923. $49 = (($$097123) + 1)|0;
  12924. $50 = HEAP32[$4>>2]|0;
  12925. $51 = ($49>>>0)<($50>>>0);
  12926. if ($51) {
  12927. $$0125 = $$1;$$093124 = $$194;$$097123 = $49;
  12928. } else {
  12929. $$0$lcssa = $$1;$$093$lcssa = $$194;
  12930. break L1;
  12931. }
  12932. }
  12933. STACKTOP = sp;return;
  12934. }
  12935. } while(0);
  12936. $52 = (((($4)) + 4|0) + ($$093$lcssa<<3)|0);
  12937. $53 = $52;
  12938. $54 = $53;
  12939. $55 = HEAP32[$54>>2]|0;
  12940. $56 = (($53) + 4)|0;
  12941. $57 = $56;
  12942. $58 = HEAP32[$57>>2]|0;
  12943. $59 = $6;
  12944. $60 = $59;
  12945. HEAP32[$60>>2] = $55;
  12946. $61 = (($59) + 4)|0;
  12947. $62 = $61;
  12948. HEAP32[$62>>2] = $58;
  12949. $63 = (($$093$lcssa) + 1)|0;
  12950. $64 = HEAP32[$4>>2]|0;
  12951. $65 = ($63>>>0)<($64>>>0);
  12952. $66 = $65 ? $63 : 0;
  12953. $67 = (((($4)) + 4|0) + ($66<<3)|0);
  12954. $68 = $67;
  12955. $69 = $68;
  12956. $70 = HEAP32[$69>>2]|0;
  12957. $71 = (($68) + 4)|0;
  12958. $72 = $71;
  12959. $73 = HEAP32[$72>>2]|0;
  12960. $74 = $7;
  12961. $75 = $74;
  12962. HEAP32[$75>>2] = $70;
  12963. $76 = (($74) + 4)|0;
  12964. $77 = $76;
  12965. HEAP32[$77>>2] = $73;
  12966. $78 = $$0$lcssa < 9.9999999747524271E-7;
  12967. do {
  12968. if ($78) {
  12969. HEAP32[$25>>2] = 1;
  12970. $79 = ((($4)) + 388|0);
  12971. $80 = (((($4)) + 196|0) + ($$093$lcssa<<3)|0);
  12972. ;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;
  12973. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$80>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$80+4>>2]|0;
  12974. _Mat2MultiplyVector2($8,$$byval_copy41,$tmpcast104$byval_copy42);
  12975. $81 = +HEAPF32[$8>>2];
  12976. $82 = -$81;
  12977. $83 = ((($8)) + 4|0);
  12978. $84 = +HEAPF32[$83>>2];
  12979. $85 = -$84;
  12980. $$sroa$014$0$$sroa_idx = ((($0)) + 16|0);
  12981. HEAPF32[$$sroa$014$0$$sroa_idx>>2] = $82;
  12982. $$sroa$215$0$$sroa_idx16 = ((($0)) + 20|0);
  12983. HEAPF32[$$sroa$215$0$$sroa_idx16>>2] = $85;
  12984. $86 = ((($22)) + 92|0);
  12985. $87 = +HEAPF32[$86>>2];
  12986. $88 = $87 * $82;
  12987. $89 = +HEAPF32[$26>>2];
  12988. $90 = $88 + $89;
  12989. $91 = $87 * $85;
  12990. $92 = ((($22)) + 12|0);
  12991. $93 = +HEAPF32[$92>>2];
  12992. $94 = $91 + $93;
  12993. $$sroa$011$0$$sroa_idx = ((($0)) + 24|0);
  12994. HEAPF32[$$sroa$011$0$$sroa_idx>>2] = $90;
  12995. $$sroa$212$0$$sroa_idx13 = ((($0)) + 28|0);
  12996. HEAPF32[$$sroa$212$0$$sroa_idx13>>2] = $94;
  12997. $95 = HEAP32[$86>>2]|0;
  12998. $96 = ((($0)) + 12|0);
  12999. HEAP32[$96>>2] = $95;
  13000. } else {
  13001. ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
  13002. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$6>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$6+4>>2]|0;
  13003. _Vector2Subtract_4($9,$$byval_copy41,$tmpcast104$byval_copy42);
  13004. ;HEAP32[$$byval_copy41>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$7+4>>2]|0;
  13005. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$6>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$6+4>>2]|0;
  13006. _Vector2Subtract_4($10,$$byval_copy41,$tmpcast104$byval_copy42);
  13007. ;HEAP32[$$byval_copy41>>2]=HEAP32[$9>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$9+4>>2]|0;
  13008. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$10>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$10+4>>2]|0;
  13009. $97 = (+_MathDot($$byval_copy41,$tmpcast104$byval_copy42));
  13010. ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
  13011. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$7>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$7+4>>2]|0;
  13012. _Vector2Subtract_4($11,$$byval_copy41,$tmpcast104$byval_copy42);
  13013. ;HEAP32[$$byval_copy41>>2]=HEAP32[$6>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$6+4>>2]|0;
  13014. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$7>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$7+4>>2]|0;
  13015. _Vector2Subtract_4($12,$$byval_copy41,$tmpcast104$byval_copy42);
  13016. ;HEAP32[$$byval_copy41>>2]=HEAP32[$11>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$11+4>>2]|0;
  13017. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$12>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$12+4>>2]|0;
  13018. $98 = (+_MathDot($$byval_copy41,$tmpcast104$byval_copy42));
  13019. $99 = ((($22)) + 92|0);
  13020. $100 = +HEAPF32[$99>>2];
  13021. $101 = $100 - $$0$lcssa;
  13022. $102 = ((($0)) + 12|0);
  13023. HEAPF32[$102>>2] = $101;
  13024. $103 = !($97 <= 0.0);
  13025. if (!($103)) {
  13026. ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
  13027. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$6>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$6+4>>2]|0;
  13028. $104 = (+_DistSqr($$byval_copy41,$tmpcast104$byval_copy42));
  13029. $105 = +HEAPF32[$99>>2];
  13030. $106 = $105 * $105;
  13031. $107 = $104 > $106;
  13032. if ($107) {
  13033. break;
  13034. }
  13035. HEAP32[$25>>2] = 1;
  13036. ;HEAP32[$$byval_copy41>>2]=HEAP32[$6>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$6+4>>2]|0;
  13037. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$1+4>>2]|0;
  13038. _Vector2Subtract_4($8,$$byval_copy41,$tmpcast104$byval_copy42);
  13039. $108 = ((($4)) + 388|0);
  13040. ;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;
  13041. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$8>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$8+4>>2]|0;
  13042. _Mat2MultiplyVector2($13,$$byval_copy41,$tmpcast104$byval_copy42);
  13043. $109 = $13;
  13044. $110 = $109;
  13045. $111 = HEAP32[$110>>2]|0;
  13046. $112 = (($109) + 4)|0;
  13047. $113 = $112;
  13048. $114 = HEAP32[$113>>2]|0;
  13049. $115 = $8;
  13050. $116 = $115;
  13051. HEAP32[$116>>2] = $111;
  13052. $117 = (($115) + 4)|0;
  13053. $118 = $117;
  13054. HEAP32[$118>>2] = $114;
  13055. _MathNormalize($8);
  13056. $119 = ((($0)) + 16|0);
  13057. $120 = $8;
  13058. $121 = $120;
  13059. $122 = HEAP32[$121>>2]|0;
  13060. $123 = (($120) + 4)|0;
  13061. $124 = $123;
  13062. $125 = HEAP32[$124>>2]|0;
  13063. $126 = $119;
  13064. $127 = $126;
  13065. HEAP32[$127>>2] = $122;
  13066. $128 = (($126) + 4)|0;
  13067. $129 = $128;
  13068. HEAP32[$129>>2] = $125;
  13069. ;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;
  13070. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$6>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$6+4>>2]|0;
  13071. _Mat2MultiplyVector2($14,$$byval_copy41,$tmpcast104$byval_copy42);
  13072. $130 = $14;
  13073. $131 = $130;
  13074. $132 = HEAP32[$131>>2]|0;
  13075. $133 = (($130) + 4)|0;
  13076. $134 = $133;
  13077. $135 = HEAP32[$134>>2]|0;
  13078. $136 = $6;
  13079. $137 = $136;
  13080. HEAP32[$137>>2] = $132;
  13081. $138 = (($136) + 4)|0;
  13082. $139 = $138;
  13083. HEAP32[$139>>2] = $135;
  13084. ;HEAP32[$$byval_copy41>>2]=HEAP32[$6>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$6+4>>2]|0;
  13085. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$39>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$39+4>>2]|0;
  13086. _Vector2Add_2($15,$$byval_copy41,$tmpcast104$byval_copy42);
  13087. $140 = $15;
  13088. $141 = $140;
  13089. $142 = HEAP32[$141>>2]|0;
  13090. $143 = (($140) + 4)|0;
  13091. $144 = $143;
  13092. $145 = HEAP32[$144>>2]|0;
  13093. $146 = $6;
  13094. $147 = $146;
  13095. HEAP32[$147>>2] = $142;
  13096. $148 = (($146) + 4)|0;
  13097. $149 = $148;
  13098. HEAP32[$149>>2] = $145;
  13099. $150 = ((($0)) + 24|0);
  13100. $151 = $150;
  13101. $152 = $151;
  13102. HEAP32[$152>>2] = $142;
  13103. $153 = (($151) + 4)|0;
  13104. $154 = $153;
  13105. HEAP32[$154>>2] = $145;
  13106. break;
  13107. }
  13108. $155 = !($98 <= 0.0);
  13109. if (!($155)) {
  13110. ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
  13111. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$7>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$7+4>>2]|0;
  13112. $156 = (+_DistSqr($$byval_copy41,$tmpcast104$byval_copy42));
  13113. $157 = +HEAPF32[$99>>2];
  13114. $158 = $157 * $157;
  13115. $159 = $156 > $158;
  13116. if ($159) {
  13117. break;
  13118. }
  13119. HEAP32[$25>>2] = 1;
  13120. ;HEAP32[$$byval_copy41>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$7+4>>2]|0;
  13121. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$1+4>>2]|0;
  13122. _Vector2Subtract_4($8,$$byval_copy41,$tmpcast104$byval_copy42);
  13123. $160 = ((($4)) + 388|0);
  13124. ;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;
  13125. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$7>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$7+4>>2]|0;
  13126. _Mat2MultiplyVector2($16,$$byval_copy41,$tmpcast104$byval_copy42);
  13127. $161 = $16;
  13128. $162 = $161;
  13129. $163 = HEAP32[$162>>2]|0;
  13130. $164 = (($161) + 4)|0;
  13131. $165 = $164;
  13132. $166 = HEAP32[$165>>2]|0;
  13133. $167 = $7;
  13134. $168 = $167;
  13135. HEAP32[$168>>2] = $163;
  13136. $169 = (($167) + 4)|0;
  13137. $170 = $169;
  13138. HEAP32[$170>>2] = $166;
  13139. ;HEAP32[$$byval_copy41>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$7+4>>2]|0;
  13140. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$39>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$39+4>>2]|0;
  13141. _Vector2Add_2($17,$$byval_copy41,$tmpcast104$byval_copy42);
  13142. $171 = $17;
  13143. $172 = $171;
  13144. $173 = HEAP32[$172>>2]|0;
  13145. $174 = (($171) + 4)|0;
  13146. $175 = $174;
  13147. $176 = HEAP32[$175>>2]|0;
  13148. $177 = $7;
  13149. $178 = $177;
  13150. HEAP32[$178>>2] = $173;
  13151. $179 = (($177) + 4)|0;
  13152. $180 = $179;
  13153. HEAP32[$180>>2] = $176;
  13154. $181 = ((($0)) + 24|0);
  13155. $182 = $181;
  13156. $183 = $182;
  13157. HEAP32[$183>>2] = $173;
  13158. $184 = (($182) + 4)|0;
  13159. $185 = $184;
  13160. HEAP32[$185>>2] = $176;
  13161. ;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;
  13162. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$8>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$8+4>>2]|0;
  13163. _Mat2MultiplyVector2($18,$$byval_copy41,$tmpcast104$byval_copy42);
  13164. $186 = $18;
  13165. $187 = $186;
  13166. $188 = HEAP32[$187>>2]|0;
  13167. $189 = (($186) + 4)|0;
  13168. $190 = $189;
  13169. $191 = HEAP32[$190>>2]|0;
  13170. $192 = $8;
  13171. $193 = $192;
  13172. HEAP32[$193>>2] = $188;
  13173. $194 = (($192) + 4)|0;
  13174. $195 = $194;
  13175. HEAP32[$195>>2] = $191;
  13176. _MathNormalize($8);
  13177. $196 = ((($0)) + 16|0);
  13178. $197 = $8;
  13179. $198 = $197;
  13180. $199 = HEAP32[$198>>2]|0;
  13181. $200 = (($197) + 4)|0;
  13182. $201 = $200;
  13183. $202 = HEAP32[$201>>2]|0;
  13184. $203 = $196;
  13185. $204 = $203;
  13186. HEAP32[$204>>2] = $199;
  13187. $205 = (($203) + 4)|0;
  13188. $206 = $205;
  13189. HEAP32[$206>>2] = $202;
  13190. break;
  13191. }
  13192. $207 = (((($4)) + 196|0) + ($$093$lcssa<<3)|0);
  13193. $208 = $207;
  13194. $209 = $208;
  13195. $210 = HEAP32[$209>>2]|0;
  13196. $211 = (($208) + 4)|0;
  13197. $212 = $211;
  13198. $213 = HEAP32[$212>>2]|0;
  13199. $214 = $8;
  13200. $215 = $214;
  13201. HEAP32[$215>>2] = $210;
  13202. $216 = (($214) + 4)|0;
  13203. $217 = $216;
  13204. HEAP32[$217>>2] = $213;
  13205. ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
  13206. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$6>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$6+4>>2]|0;
  13207. _Vector2Subtract_4($19,$$byval_copy41,$tmpcast104$byval_copy42);
  13208. ;HEAP32[$$byval_copy41>>2]=HEAP32[$19>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$19+4>>2]|0;
  13209. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$8>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$8+4>>2]|0;
  13210. $218 = (+_MathDot($$byval_copy41,$tmpcast104$byval_copy42));
  13211. $219 = +HEAPF32[$99>>2];
  13212. $220 = $218 > $219;
  13213. if ($220) {
  13214. break;
  13215. } else {
  13216. $221 = ((($4)) + 388|0);
  13217. ;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;
  13218. ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$8>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$8+4>>2]|0;
  13219. _Mat2MultiplyVector2($20,$$byval_copy41,$tmpcast104$byval_copy42);
  13220. $222 = $20;
  13221. $223 = $222;
  13222. $224 = HEAP32[$223>>2]|0;
  13223. $225 = (($222) + 4)|0;
  13224. $226 = $225;
  13225. $227 = HEAP32[$226>>2]|0;
  13226. $228 = $8;
  13227. $229 = $228;
  13228. HEAP32[$229>>2] = $224;
  13229. $230 = (($228) + 4)|0;
  13230. $231 = $230;
  13231. HEAP32[$231>>2] = $227;
  13232. $232 = +HEAPF32[$8>>2];
  13233. $233 = -$232;
  13234. $234 = ((($8)) + 4|0);
  13235. $235 = +HEAPF32[$234>>2];
  13236. $236 = -$235;
  13237. $$sroa$04$0$$sroa_idx = ((($0)) + 16|0);
  13238. HEAPF32[$$sroa$04$0$$sroa_idx>>2] = $233;
  13239. $$sroa$25$0$$sroa_idx6 = ((($0)) + 20|0);
  13240. HEAPF32[$$sroa$25$0$$sroa_idx6>>2] = $236;
  13241. $237 = +HEAPF32[$99>>2];
  13242. $238 = $237 * $233;
  13243. $239 = +HEAPF32[$26>>2];
  13244. $240 = $238 + $239;
  13245. $241 = $237 * $236;
  13246. $242 = ((($22)) + 12|0);
  13247. $243 = +HEAPF32[$242>>2];
  13248. $244 = $241 + $243;
  13249. $$sroa$0$0$$sroa_idx = ((($0)) + 24|0);
  13250. HEAPF32[$$sroa$0$0$$sroa_idx>>2] = $240;
  13251. $$sroa$2$0$$sroa_idx3 = ((($0)) + 28|0);
  13252. HEAPF32[$$sroa$2$0$$sroa_idx3>>2] = $244;
  13253. HEAP32[$25>>2] = 1;
  13254. break;
  13255. }
  13256. }
  13257. } while(0);
  13258. STACKTOP = sp;return;
  13259. }
  13260. function _SolvePolygonToCircle($0) {
  13261. $0 = $0|0;
  13262. 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;
  13263. sp = STACKTOP;
  13264. $1 = ((($0)) + 4|0);
  13265. $2 = HEAP32[$1>>2]|0;
  13266. $3 = ((($0)) + 8|0);
  13267. $4 = HEAP32[$3>>2]|0;
  13268. HEAP32[$1>>2] = $4;
  13269. HEAP32[$3>>2] = $2;
  13270. _SolveCircleToPolygon($0);
  13271. $5 = ((($0)) + 16|0);
  13272. $6 = +HEAPF32[$5>>2];
  13273. $7 = -$6;
  13274. HEAPF32[$5>>2] = $7;
  13275. $8 = ((($0)) + 20|0);
  13276. $9 = +HEAPF32[$8>>2];
  13277. $10 = -$9;
  13278. HEAPF32[$8>>2] = $10;
  13279. return;
  13280. }
  13281. function _SolvePolygonToPolygon($0) {
  13282. $0 = $0|0;
  13283. 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;
  13284. 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;
  13285. 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;
  13286. 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;
  13287. 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;
  13288. 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;
  13289. 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;
  13290. 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;
  13291. 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;
  13292. var $98 = 0, $99 = 0, $tmpcast58$byval_copy23 = 0, label = 0, sp = 0;
  13293. sp = STACKTOP;
  13294. STACKTOP = STACKTOP + 3008|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(3008|0);
  13295. $$byval_copy24 = sp + 2584|0;
  13296. $tmpcast58$byval_copy23 = sp + 2168|0;
  13297. $1 = sp + 1744|0;
  13298. $2 = sp + 1328|0;
  13299. $3 = sp + 1324|0;
  13300. $4 = sp + 1320|0;
  13301. $5 = sp + 904|0;
  13302. $6 = sp + 488|0;
  13303. $7 = sp + 24|0;
  13304. $8 = sp + 80|0;
  13305. $9 = sp + 16|0;
  13306. $10 = sp + 8|0;
  13307. $11 = sp + 64|0;
  13308. $12 = sp + 56|0;
  13309. $13 = sp + 48|0;
  13310. $14 = sp + 40|0;
  13311. $15 = sp + 72|0;
  13312. $16 = sp;
  13313. $17 = sp + 2160|0;
  13314. $18 = ((($0)) + 4|0);
  13315. $19 = HEAP32[$18>>2]|0;
  13316. $20 = ((($19)) + 84|0);
  13317. _memcpy(($1|0),($20|0),416)|0;
  13318. $21 = ((($0)) + 8|0);
  13319. $22 = HEAP32[$21>>2]|0;
  13320. $23 = ((($22)) + 84|0);
  13321. _memcpy(($2|0),($23|0),416)|0;
  13322. $24 = ((($0)) + 40|0);
  13323. HEAP32[$24>>2] = 0;
  13324. HEAP32[$3>>2] = 0;
  13325. _memcpy(($tmpcast58$byval_copy23|0),($1|0),416)|0;
  13326. _memcpy(($$byval_copy24|0),($2|0),416)|0;
  13327. $25 = (+_FindAxisLeastPenetration($3,$tmpcast58$byval_copy23,$$byval_copy24));
  13328. $26 = !($25 >= 0.0);
  13329. if (!($26)) {
  13330. STACKTOP = sp;return;
  13331. }
  13332. HEAP32[$4>>2] = 0;
  13333. _memcpy(($tmpcast58$byval_copy23|0),($2|0),416)|0;
  13334. _memcpy(($$byval_copy24|0),($1|0),416)|0;
  13335. $27 = (+_FindAxisLeastPenetration($4,$tmpcast58$byval_copy23,$$byval_copy24));
  13336. $28 = !($27 >= 0.0);
  13337. if ($28) {
  13338. $29 = (_BiasGreaterThan($25,$27)|0);
  13339. $30 = ($29|0)==(0);
  13340. if ($30) {
  13341. _memcpy(($5|0),($2|0),416)|0;
  13342. _memcpy(($6|0),($1|0),416)|0;
  13343. $$051$in = $4;$$052 = 1;
  13344. } else {
  13345. _memcpy(($5|0),($1|0),416)|0;
  13346. _memcpy(($6|0),($2|0),416)|0;
  13347. $$051$in = $3;$$052 = 0;
  13348. }
  13349. $$051 = HEAP32[$$051$in>>2]|0;
  13350. $31 = ((($7)) + 8|0);
  13351. _memcpy(($tmpcast58$byval_copy23|0),($5|0),416)|0;
  13352. _memcpy(($$byval_copy24|0),($6|0),416)|0;
  13353. _FindIncidentFace($7,$31,$tmpcast58$byval_copy23,$$byval_copy24,$$051);
  13354. $32 = ((($5)) + 12|0);
  13355. _memcpy(($8|0),($32|0),404)|0;
  13356. $33 = (((($8)) + 4|0) + ($$051<<3)|0);
  13357. $34 = $33;
  13358. $35 = $34;
  13359. $36 = HEAP32[$35>>2]|0;
  13360. $37 = (($34) + 4)|0;
  13361. $38 = $37;
  13362. $39 = HEAP32[$38>>2]|0;
  13363. $40 = $9;
  13364. $41 = $40;
  13365. HEAP32[$41>>2] = $36;
  13366. $42 = (($40) + 4)|0;
  13367. $43 = $42;
  13368. HEAP32[$43>>2] = $39;
  13369. $44 = (($$051) + 1)|0;
  13370. $45 = HEAP32[$8>>2]|0;
  13371. $46 = ($44>>>0)<($45>>>0);
  13372. $47 = $46 ? $44 : 0;
  13373. $48 = (((($8)) + 4|0) + ($47<<3)|0);
  13374. $49 = $48;
  13375. $50 = $49;
  13376. $51 = HEAP32[$50>>2]|0;
  13377. $52 = (($49) + 4)|0;
  13378. $53 = $52;
  13379. $54 = HEAP32[$53>>2]|0;
  13380. $55 = $10;
  13381. $56 = $55;
  13382. HEAP32[$56>>2] = $51;
  13383. $57 = (($55) + 4)|0;
  13384. $58 = $57;
  13385. HEAP32[$58>>2] = $54;
  13386. $59 = ((($8)) + 388|0);
  13387. ;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;
  13388. ;HEAP32[$$byval_copy24>>2]=HEAP32[$9>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$9+4>>2]|0;
  13389. _Mat2MultiplyVector2($11,$tmpcast58$byval_copy23,$$byval_copy24);
  13390. $60 = $11;
  13391. $61 = $60;
  13392. $62 = HEAP32[$61>>2]|0;
  13393. $63 = (($60) + 4)|0;
  13394. $64 = $63;
  13395. $65 = HEAP32[$64>>2]|0;
  13396. $66 = $9;
  13397. $67 = $66;
  13398. HEAP32[$67>>2] = $62;
  13399. $68 = (($66) + 4)|0;
  13400. $69 = $68;
  13401. HEAP32[$69>>2] = $65;
  13402. $70 = ((($5)) + 4|0);
  13403. $71 = HEAP32[$70>>2]|0;
  13404. $72 = ((($71)) + 8|0);
  13405. ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$9>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$9+4>>2]|0;
  13406. ;HEAP32[$$byval_copy24>>2]=HEAP32[$72>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$72+4>>2]|0;
  13407. _Vector2Add_2($12,$tmpcast58$byval_copy23,$$byval_copy24);
  13408. $73 = $12;
  13409. $74 = $73;
  13410. $75 = HEAP32[$74>>2]|0;
  13411. $76 = (($73) + 4)|0;
  13412. $77 = $76;
  13413. $78 = HEAP32[$77>>2]|0;
  13414. $79 = $9;
  13415. $80 = $79;
  13416. HEAP32[$80>>2] = $75;
  13417. $81 = (($79) + 4)|0;
  13418. $82 = $81;
  13419. HEAP32[$82>>2] = $78;
  13420. ;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;
  13421. ;HEAP32[$$byval_copy24>>2]=HEAP32[$10>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$10+4>>2]|0;
  13422. _Mat2MultiplyVector2($13,$tmpcast58$byval_copy23,$$byval_copy24);
  13423. $83 = $13;
  13424. $84 = $83;
  13425. $85 = HEAP32[$84>>2]|0;
  13426. $86 = (($83) + 4)|0;
  13427. $87 = $86;
  13428. $88 = HEAP32[$87>>2]|0;
  13429. $89 = $10;
  13430. $90 = $89;
  13431. HEAP32[$90>>2] = $85;
  13432. $91 = (($89) + 4)|0;
  13433. $92 = $91;
  13434. HEAP32[$92>>2] = $88;
  13435. $93 = HEAP32[$70>>2]|0;
  13436. $94 = ((($93)) + 8|0);
  13437. ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$10>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$10+4>>2]|0;
  13438. ;HEAP32[$$byval_copy24>>2]=HEAP32[$94>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$94+4>>2]|0;
  13439. _Vector2Add_2($14,$tmpcast58$byval_copy23,$$byval_copy24);
  13440. $95 = $14;
  13441. $96 = $95;
  13442. $97 = HEAP32[$96>>2]|0;
  13443. $98 = (($95) + 4)|0;
  13444. $99 = $98;
  13445. $100 = HEAP32[$99>>2]|0;
  13446. $101 = $10;
  13447. $102 = $101;
  13448. HEAP32[$102>>2] = $97;
  13449. $103 = (($101) + 4)|0;
  13450. $104 = $103;
  13451. HEAP32[$104>>2] = $100;
  13452. ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$10>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$10+4>>2]|0;
  13453. ;HEAP32[$$byval_copy24>>2]=HEAP32[$9>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$9+4>>2]|0;
  13454. _Vector2Subtract_4($15,$tmpcast58$byval_copy23,$$byval_copy24);
  13455. _MathNormalize($15);
  13456. $105 = ((($15)) + 4|0);
  13457. $106 = HEAP32[$105>>2]|0;
  13458. HEAP32[$16>>2] = $106;
  13459. $107 = ((($16)) + 4|0);
  13460. $108 = +HEAPF32[$15>>2];
  13461. $109 = -$108;
  13462. HEAPF32[$107>>2] = $109;
  13463. ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$16>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$16+4>>2]|0;
  13464. ;HEAP32[$$byval_copy24>>2]=HEAP32[$9>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$9+4>>2]|0;
  13465. $110 = (+_MathDot($tmpcast58$byval_copy23,$$byval_copy24));
  13466. ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$15>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$15+4>>2]|0;
  13467. ;HEAP32[$$byval_copy24>>2]=HEAP32[$9>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$9+4>>2]|0;
  13468. $111 = (+_MathDot($tmpcast58$byval_copy23,$$byval_copy24));
  13469. $112 = -$111;
  13470. ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$15>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$15+4>>2]|0;
  13471. ;HEAP32[$$byval_copy24>>2]=HEAP32[$10>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$10+4>>2]|0;
  13472. $113 = (+_MathDot($tmpcast58$byval_copy23,$$byval_copy24));
  13473. $114 = +HEAPF32[$15>>2];
  13474. $115 = -$114;
  13475. HEAPF32[$17>>2] = $115;
  13476. $116 = ((($17)) + 4|0);
  13477. $117 = +HEAPF32[$105>>2];
  13478. $118 = -$117;
  13479. HEAPF32[$116>>2] = $118;
  13480. ;HEAP32[$$byval_copy24>>2]=HEAP32[$17>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$17+4>>2]|0;
  13481. $119 = (_Clip($$byval_copy24,$112,$7,$31)|0);
  13482. $120 = ($119|0)<(2);
  13483. if (!($120)) {
  13484. ;HEAP32[$$byval_copy24>>2]=HEAP32[$15>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$15+4>>2]|0;
  13485. $121 = (_Clip($$byval_copy24,$113,$7,$31)|0);
  13486. $122 = ($121|0)<(2);
  13487. if (!($122)) {
  13488. $123 = ($$052|0)==(0);
  13489. if ($123) {
  13490. $128 = ((($0)) + 16|0);
  13491. $129 = $16;
  13492. $130 = $129;
  13493. $131 = HEAP32[$130>>2]|0;
  13494. $132 = (($129) + 4)|0;
  13495. $133 = $132;
  13496. $134 = HEAP32[$133>>2]|0;
  13497. $135 = $128;
  13498. $136 = $135;
  13499. HEAP32[$136>>2] = $131;
  13500. $137 = (($135) + 4)|0;
  13501. $138 = $137;
  13502. HEAP32[$138>>2] = $134;
  13503. } else {
  13504. $124 = +HEAPF32[$16>>2];
  13505. $125 = -$124;
  13506. $126 = +HEAPF32[$107>>2];
  13507. $127 = -$126;
  13508. $$sroa$0$0$$sroa_idx = ((($0)) + 16|0);
  13509. HEAPF32[$$sroa$0$0$$sroa_idx>>2] = $125;
  13510. $$sroa$2$0$$sroa_idx12 = ((($0)) + 20|0);
  13511. HEAPF32[$$sroa$2$0$$sroa_idx12>>2] = $127;
  13512. }
  13513. ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$16>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$16+4>>2]|0;
  13514. ;HEAP32[$$byval_copy24>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$7+4>>2]|0;
  13515. $139 = (+_MathDot($tmpcast58$byval_copy23,$$byval_copy24));
  13516. $140 = $139 - $110;
  13517. $141 = !($140 <= 0.0);
  13518. if ($141) {
  13519. $$0 = 0;$$sink = 0.0;
  13520. } else {
  13521. $142 = -$140;
  13522. $143 = ((($0)) + 24|0);
  13523. $144 = $7;
  13524. $145 = $144;
  13525. $146 = HEAP32[$145>>2]|0;
  13526. $147 = (($144) + 4)|0;
  13527. $148 = $147;
  13528. $149 = HEAP32[$148>>2]|0;
  13529. $150 = $143;
  13530. $151 = $150;
  13531. HEAP32[$151>>2] = $146;
  13532. $152 = (($150) + 4)|0;
  13533. $153 = $152;
  13534. HEAP32[$153>>2] = $149;
  13535. $$0 = 1;$$sink = $142;
  13536. }
  13537. $154 = ((($0)) + 12|0);
  13538. HEAPF32[$154>>2] = $$sink;
  13539. ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$16>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$16+4>>2]|0;
  13540. ;HEAP32[$$byval_copy24>>2]=HEAP32[$31>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$31+4>>2]|0;
  13541. $155 = (+_MathDot($tmpcast58$byval_copy23,$$byval_copy24));
  13542. $156 = $155 - $110;
  13543. $157 = !($156 <= 0.0);
  13544. if ($157) {
  13545. $$1 = $$0;
  13546. } else {
  13547. $158 = (((($0)) + 24|0) + ($$0<<3)|0);
  13548. $159 = $31;
  13549. $160 = $159;
  13550. $161 = HEAP32[$160>>2]|0;
  13551. $162 = (($159) + 4)|0;
  13552. $163 = $162;
  13553. $164 = HEAP32[$163>>2]|0;
  13554. $165 = $158;
  13555. $166 = $165;
  13556. HEAP32[$166>>2] = $161;
  13557. $167 = (($165) + 4)|0;
  13558. $168 = $167;
  13559. HEAP32[$168>>2] = $164;
  13560. $169 = +HEAPF32[$154>>2];
  13561. $170 = $169 - $156;
  13562. $171 = (($$0) + 1)|0;
  13563. $172 = (+($171|0));
  13564. $173 = $170 / $172;
  13565. HEAPF32[$154>>2] = $173;
  13566. $$1 = $171;
  13567. }
  13568. HEAP32[$24>>2] = $$1;
  13569. }
  13570. }
  13571. }
  13572. STACKTOP = sp;return;
  13573. }
  13574. function _MathLenSqr($0) {
  13575. $0 = $0|0;
  13576. var $1 = 0.0, $2 = 0.0, $3 = 0, $4 = 0.0, $5 = 0.0, $6 = 0.0, label = 0, sp = 0;
  13577. sp = STACKTOP;
  13578. $1 = +HEAPF32[$0>>2];
  13579. $2 = $1 * $1;
  13580. $3 = ((($0)) + 4|0);
  13581. $4 = +HEAPF32[$3>>2];
  13582. $5 = $4 * $4;
  13583. $6 = $2 + $5;
  13584. return (+$6);
  13585. }
  13586. function _Mat2Transpose($0,$1) {
  13587. $0 = $0|0;
  13588. $1 = $1|0;
  13589. 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;
  13590. sp = STACKTOP;
  13591. $2 = HEAP32[$1>>2]|0;
  13592. HEAP32[$0>>2] = $2;
  13593. $3 = ((($0)) + 4|0);
  13594. $4 = ((($1)) + 8|0);
  13595. $5 = HEAP32[$4>>2]|0;
  13596. HEAP32[$3>>2] = $5;
  13597. $6 = ((($0)) + 8|0);
  13598. $7 = ((($1)) + 4|0);
  13599. $8 = HEAP32[$7>>2]|0;
  13600. HEAP32[$6>>2] = $8;
  13601. $9 = ((($0)) + 12|0);
  13602. $10 = ((($1)) + 12|0);
  13603. $11 = HEAP32[$10>>2]|0;
  13604. HEAP32[$9>>2] = $11;
  13605. return;
  13606. }
  13607. function _MathDot($0,$1) {
  13608. $0 = $0|0;
  13609. $1 = $1|0;
  13610. 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;
  13611. sp = STACKTOP;
  13612. $2 = +HEAPF32[$0>>2];
  13613. $3 = +HEAPF32[$1>>2];
  13614. $4 = $2 * $3;
  13615. $5 = ((($0)) + 4|0);
  13616. $6 = +HEAPF32[$5>>2];
  13617. $7 = ((($1)) + 4|0);
  13618. $8 = +HEAPF32[$7>>2];
  13619. $9 = $6 * $8;
  13620. $10 = $4 + $9;
  13621. return (+$10);
  13622. }
  13623. function _DistSqr($0,$1) {
  13624. $0 = $0|0;
  13625. $1 = $1|0;
  13626. var $$byval_copy2 = 0, $$byval_copy3 = 0, $2 = 0, $3 = 0.0, label = 0, sp = 0;
  13627. sp = STACKTOP;
  13628. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  13629. $$byval_copy3 = sp + 16|0;
  13630. $$byval_copy2 = sp + 8|0;
  13631. $2 = sp;
  13632. ;HEAP32[$$byval_copy2>>2]=HEAP32[$0>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$0+4>>2]|0;
  13633. ;HEAP32[$$byval_copy3>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy3+4>>2]=HEAP32[$1+4>>2]|0;
  13634. _Vector2Subtract_4($2,$$byval_copy2,$$byval_copy3);
  13635. ;HEAP32[$$byval_copy2>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$2+4>>2]|0;
  13636. ;HEAP32[$$byval_copy3>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy3+4>>2]=HEAP32[$2+4>>2]|0;
  13637. $3 = (+_MathDot($$byval_copy2,$$byval_copy3));
  13638. STACKTOP = sp;return (+$3);
  13639. }
  13640. function _FindAxisLeastPenetration($0,$1,$2) {
  13641. $0 = $0|0;
  13642. $1 = $1|0;
  13643. $2 = $2|0;
  13644. 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;
  13645. 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;
  13646. 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;
  13647. 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;
  13648. 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;
  13649. var $94 = 0, $95 = 0, $96 = 0.0, $97 = 0, $98 = 0, $99 = 0, $tmpcast$byval_copy15 = 0, label = 0, sp = 0;
  13650. sp = STACKTOP;
  13651. STACKTOP = STACKTOP + 1344|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(1344|0);
  13652. $$byval_copy16 = sp + 1320|0;
  13653. $tmpcast$byval_copy15 = sp + 904|0;
  13654. $3 = sp + 484|0;
  13655. $4 = sp + 80|0;
  13656. $5 = sp + 8|0;
  13657. $6 = sp + 72|0;
  13658. $7 = sp + 56|0;
  13659. $8 = sp + 48|0;
  13660. $9 = sp + 896|0;
  13661. $10 = sp;
  13662. $11 = sp + 40|0;
  13663. $12 = sp + 32|0;
  13664. $13 = sp + 24|0;
  13665. $14 = sp + 16|0;
  13666. $15 = sp + 888|0;
  13667. $16 = ((($1)) + 12|0);
  13668. _memcpy(($3|0),($16|0),404)|0;
  13669. $17 = ((($2)) + 12|0);
  13670. _memcpy(($4|0),($17|0),404)|0;
  13671. $18 = HEAP32[$3>>2]|0;
  13672. $19 = ($18|0)==(0);
  13673. if ($19) {
  13674. $$0$lcssa = -3.4028234663852886E+38;$$018$lcssa = 0;
  13675. HEAP32[$0>>2] = $$018$lcssa;
  13676. STACKTOP = sp;return (+$$0$lcssa);
  13677. }
  13678. $20 = ((($3)) + 388|0);
  13679. $21 = ((($4)) + 388|0);
  13680. $22 = ((($9)) + 4|0);
  13681. $23 = ((($5)) + 4|0);
  13682. $24 = ((($1)) + 4|0);
  13683. $25 = ((($2)) + 4|0);
  13684. $$01727 = 0;$$01826 = 0;$$028 = -3.4028234663852886E+38;
  13685. while(1) {
  13686. $26 = (((($3)) + 196|0) + ($$01727<<3)|0);
  13687. $27 = $26;
  13688. $28 = $27;
  13689. $29 = HEAP32[$28>>2]|0;
  13690. $30 = (($27) + 4)|0;
  13691. $31 = $30;
  13692. $32 = HEAP32[$31>>2]|0;
  13693. $33 = $5;
  13694. $34 = $33;
  13695. HEAP32[$34>>2] = $29;
  13696. $35 = (($33) + 4)|0;
  13697. $36 = $35;
  13698. HEAP32[$36>>2] = $32;
  13699. ;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;
  13700. ;HEAP32[$$byval_copy16>>2]=HEAP32[$5>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$5+4>>2]|0;
  13701. _Mat2MultiplyVector2($6,$tmpcast$byval_copy15,$$byval_copy16);
  13702. ;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;
  13703. _Mat2Transpose($7,$$byval_copy16);
  13704. ;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;
  13705. ;HEAP32[$$byval_copy16>>2]=HEAP32[$6>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$6+4>>2]|0;
  13706. _Mat2MultiplyVector2($5,$tmpcast$byval_copy15,$$byval_copy16);
  13707. $37 = +HEAPF32[$5>>2];
  13708. $38 = -$37;
  13709. HEAPF32[$9>>2] = $38;
  13710. $39 = +HEAPF32[$23>>2];
  13711. $40 = -$39;
  13712. HEAPF32[$22>>2] = $40;
  13713. _memcpy(($tmpcast$byval_copy15|0),($2|0),416)|0;
  13714. ;HEAP32[$$byval_copy16>>2]=HEAP32[$9>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$9+4>>2]|0;
  13715. _GetSupport($8,$tmpcast$byval_copy15,$$byval_copy16);
  13716. $41 = (((($3)) + 4|0) + ($$01727<<3)|0);
  13717. $42 = $41;
  13718. $43 = $42;
  13719. $44 = HEAP32[$43>>2]|0;
  13720. $45 = (($42) + 4)|0;
  13721. $46 = $45;
  13722. $47 = HEAP32[$46>>2]|0;
  13723. $48 = $10;
  13724. $49 = $48;
  13725. HEAP32[$49>>2] = $44;
  13726. $50 = (($48) + 4)|0;
  13727. $51 = $50;
  13728. HEAP32[$51>>2] = $47;
  13729. ;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;
  13730. ;HEAP32[$$byval_copy16>>2]=HEAP32[$10>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$10+4>>2]|0;
  13731. _Mat2MultiplyVector2($11,$tmpcast$byval_copy15,$$byval_copy16);
  13732. $52 = $11;
  13733. $53 = $52;
  13734. $54 = HEAP32[$53>>2]|0;
  13735. $55 = (($52) + 4)|0;
  13736. $56 = $55;
  13737. $57 = HEAP32[$56>>2]|0;
  13738. $58 = $10;
  13739. $59 = $58;
  13740. HEAP32[$59>>2] = $54;
  13741. $60 = (($58) + 4)|0;
  13742. $61 = $60;
  13743. HEAP32[$61>>2] = $57;
  13744. $62 = HEAP32[$24>>2]|0;
  13745. $63 = ((($62)) + 8|0);
  13746. ;HEAP32[$tmpcast$byval_copy15>>2]=HEAP32[$10>>2]|0;HEAP32[$tmpcast$byval_copy15+4>>2]=HEAP32[$10+4>>2]|0;
  13747. ;HEAP32[$$byval_copy16>>2]=HEAP32[$63>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$63+4>>2]|0;
  13748. _Vector2Add_2($12,$tmpcast$byval_copy15,$$byval_copy16);
  13749. $64 = $12;
  13750. $65 = $64;
  13751. $66 = HEAP32[$65>>2]|0;
  13752. $67 = (($64) + 4)|0;
  13753. $68 = $67;
  13754. $69 = HEAP32[$68>>2]|0;
  13755. $70 = $10;
  13756. $71 = $70;
  13757. HEAP32[$71>>2] = $66;
  13758. $72 = (($70) + 4)|0;
  13759. $73 = $72;
  13760. HEAP32[$73>>2] = $69;
  13761. $74 = HEAP32[$25>>2]|0;
  13762. $75 = ((($74)) + 8|0);
  13763. ;HEAP32[$tmpcast$byval_copy15>>2]=HEAP32[$10>>2]|0;HEAP32[$tmpcast$byval_copy15+4>>2]=HEAP32[$10+4>>2]|0;
  13764. ;HEAP32[$$byval_copy16>>2]=HEAP32[$75>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$75+4>>2]|0;
  13765. _Vector2Subtract_4($13,$tmpcast$byval_copy15,$$byval_copy16);
  13766. $76 = $13;
  13767. $77 = $76;
  13768. $78 = HEAP32[$77>>2]|0;
  13769. $79 = (($76) + 4)|0;
  13770. $80 = $79;
  13771. $81 = HEAP32[$80>>2]|0;
  13772. $82 = $10;
  13773. $83 = $82;
  13774. HEAP32[$83>>2] = $78;
  13775. $84 = (($82) + 4)|0;
  13776. $85 = $84;
  13777. HEAP32[$85>>2] = $81;
  13778. ;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;
  13779. ;HEAP32[$$byval_copy16>>2]=HEAP32[$10>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$10+4>>2]|0;
  13780. _Mat2MultiplyVector2($14,$tmpcast$byval_copy15,$$byval_copy16);
  13781. $86 = $14;
  13782. $87 = $86;
  13783. $88 = HEAP32[$87>>2]|0;
  13784. $89 = (($86) + 4)|0;
  13785. $90 = $89;
  13786. $91 = HEAP32[$90>>2]|0;
  13787. $92 = $10;
  13788. $93 = $92;
  13789. HEAP32[$93>>2] = $88;
  13790. $94 = (($92) + 4)|0;
  13791. $95 = $94;
  13792. HEAP32[$95>>2] = $91;
  13793. ;HEAP32[$tmpcast$byval_copy15>>2]=HEAP32[$8>>2]|0;HEAP32[$tmpcast$byval_copy15+4>>2]=HEAP32[$8+4>>2]|0;
  13794. ;HEAP32[$$byval_copy16>>2]=HEAP32[$10>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$10+4>>2]|0;
  13795. _Vector2Subtract_4($15,$tmpcast$byval_copy15,$$byval_copy16);
  13796. ;HEAP32[$tmpcast$byval_copy15>>2]=HEAP32[$5>>2]|0;HEAP32[$tmpcast$byval_copy15+4>>2]=HEAP32[$5+4>>2]|0;
  13797. ;HEAP32[$$byval_copy16>>2]=HEAP32[$15>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$15+4>>2]|0;
  13798. $96 = (+_MathDot($tmpcast$byval_copy15,$$byval_copy16));
  13799. $97 = $96 > $$028;
  13800. $$119 = $97 ? $$01727 : $$01826;
  13801. $$1 = $97 ? $96 : $$028;
  13802. $98 = (($$01727) + 1)|0;
  13803. $99 = HEAP32[$3>>2]|0;
  13804. $100 = ($98>>>0)<($99>>>0);
  13805. if ($100) {
  13806. $$01727 = $98;$$01826 = $$119;$$028 = $$1;
  13807. } else {
  13808. $$0$lcssa = $$1;$$018$lcssa = $$119;
  13809. break;
  13810. }
  13811. }
  13812. HEAP32[$0>>2] = $$018$lcssa;
  13813. STACKTOP = sp;return (+$$0$lcssa);
  13814. }
  13815. function _BiasGreaterThan($0,$1) {
  13816. $0 = +$0;
  13817. $1 = +$1;
  13818. var $2 = 0.0, $3 = 0.0, $4 = 0.0, $5 = 0, $6 = 0, label = 0, sp = 0;
  13819. sp = STACKTOP;
  13820. $2 = $1 * 0.94999998807907104;
  13821. $3 = $0 * 0.0099999997764825821;
  13822. $4 = $3 + $2;
  13823. $5 = $4 <= $0;
  13824. $6 = $5&1;
  13825. return ($6|0);
  13826. }
  13827. function _FindIncidentFace($0,$1,$2,$3,$4) {
  13828. $0 = $0|0;
  13829. $1 = $1|0;
  13830. $2 = $2|0;
  13831. $3 = $3|0;
  13832. $4 = $4|0;
  13833. 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;
  13834. 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;
  13835. 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;
  13836. 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;
  13837. 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;
  13838. 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;
  13839. sp = STACKTOP;
  13840. STACKTOP = STACKTOP + 912|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(912|0);
  13841. $$byval_copy13 = sp + 896|0;
  13842. $tmpcast$byval_copy12 = sp + 880|0;
  13843. $5 = sp + 460|0;
  13844. $6 = sp + 56|0;
  13845. $7 = sp;
  13846. $8 = sp + 48|0;
  13847. $9 = sp + 864|0;
  13848. $10 = sp + 40|0;
  13849. $11 = sp + 32|0;
  13850. $12 = sp + 24|0;
  13851. $13 = sp + 16|0;
  13852. $14 = sp + 8|0;
  13853. $15 = ((($2)) + 12|0);
  13854. _memcpy(($5|0),($15|0),404)|0;
  13855. $16 = ((($3)) + 12|0);
  13856. _memcpy(($6|0),($16|0),404)|0;
  13857. $17 = (((($5)) + 196|0) + ($4<<3)|0);
  13858. $18 = $17;
  13859. $19 = $18;
  13860. $20 = HEAP32[$19>>2]|0;
  13861. $21 = (($18) + 4)|0;
  13862. $22 = $21;
  13863. $23 = HEAP32[$22>>2]|0;
  13864. $24 = $7;
  13865. $25 = $24;
  13866. HEAP32[$25>>2] = $20;
  13867. $26 = (($24) + 4)|0;
  13868. $27 = $26;
  13869. HEAP32[$27>>2] = $23;
  13870. $28 = ((($5)) + 388|0);
  13871. ;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;
  13872. ;HEAP32[$$byval_copy13>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$7+4>>2]|0;
  13873. _Mat2MultiplyVector2($8,$tmpcast$byval_copy12,$$byval_copy13);
  13874. $29 = $8;
  13875. $30 = $29;
  13876. $31 = HEAP32[$30>>2]|0;
  13877. $32 = (($29) + 4)|0;
  13878. $33 = $32;
  13879. $34 = HEAP32[$33>>2]|0;
  13880. $35 = $7;
  13881. $36 = $35;
  13882. HEAP32[$36>>2] = $31;
  13883. $37 = (($35) + 4)|0;
  13884. $38 = $37;
  13885. HEAP32[$38>>2] = $34;
  13886. $39 = ((($6)) + 388|0);
  13887. ;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;
  13888. _Mat2Transpose($9,$$byval_copy13);
  13889. ;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;
  13890. ;HEAP32[$$byval_copy13>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$7+4>>2]|0;
  13891. _Mat2MultiplyVector2($10,$tmpcast$byval_copy12,$$byval_copy13);
  13892. $40 = $10;
  13893. $41 = $40;
  13894. $42 = HEAP32[$41>>2]|0;
  13895. $43 = (($40) + 4)|0;
  13896. $44 = $43;
  13897. $45 = HEAP32[$44>>2]|0;
  13898. $46 = $7;
  13899. $47 = $46;
  13900. HEAP32[$47>>2] = $42;
  13901. $48 = (($46) + 4)|0;
  13902. $49 = $48;
  13903. HEAP32[$49>>2] = $45;
  13904. $50 = HEAP32[$6>>2]|0;
  13905. $51 = ($50|0)==(0);
  13906. if ($51) {
  13907. $$0$lcssa = 0;
  13908. } else {
  13909. $52 = HEAP32[$6>>2]|0;
  13910. $$02434 = 0;$$02533 = 3.4028234663852886E+38;$$035 = 0;
  13911. while(1) {
  13912. $104 = (((($6)) + 196|0) + ($$02434<<3)|0);
  13913. ;HEAP32[$tmpcast$byval_copy12>>2]=HEAP32[$7>>2]|0;HEAP32[$tmpcast$byval_copy12+4>>2]=HEAP32[$7+4>>2]|0;
  13914. ;HEAP32[$$byval_copy13>>2]=HEAP32[$104>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$104+4>>2]|0;
  13915. $105 = (+_MathDot($tmpcast$byval_copy12,$$byval_copy13));
  13916. $106 = $105 < $$02533;
  13917. $$126 = $106 ? $105 : $$02533;
  13918. $$1 = $106 ? $$02434 : $$035;
  13919. $107 = (($$02434) + 1)|0;
  13920. $108 = ($107>>>0)<($52>>>0);
  13921. if ($108) {
  13922. $$02434 = $107;$$02533 = $$126;$$035 = $$1;
  13923. } else {
  13924. $$0$lcssa = $$1;
  13925. break;
  13926. }
  13927. }
  13928. }
  13929. $53 = (((($6)) + 4|0) + ($$0$lcssa<<3)|0);
  13930. ;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;
  13931. ;HEAP32[$$byval_copy13>>2]=HEAP32[$53>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$53+4>>2]|0;
  13932. _Mat2MultiplyVector2($11,$tmpcast$byval_copy12,$$byval_copy13);
  13933. $54 = $11;
  13934. $55 = $54;
  13935. $56 = HEAP32[$55>>2]|0;
  13936. $57 = (($54) + 4)|0;
  13937. $58 = $57;
  13938. $59 = HEAP32[$58>>2]|0;
  13939. $60 = $0;
  13940. $61 = $60;
  13941. HEAP32[$61>>2] = $56;
  13942. $62 = (($60) + 4)|0;
  13943. $63 = $62;
  13944. HEAP32[$63>>2] = $59;
  13945. $64 = ((($3)) + 4|0);
  13946. $65 = HEAP32[$64>>2]|0;
  13947. $66 = ((($65)) + 8|0);
  13948. ;HEAP32[$tmpcast$byval_copy12>>2]=HEAP32[$0>>2]|0;HEAP32[$tmpcast$byval_copy12+4>>2]=HEAP32[$0+4>>2]|0;
  13949. ;HEAP32[$$byval_copy13>>2]=HEAP32[$66>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$66+4>>2]|0;
  13950. _Vector2Add_2($12,$tmpcast$byval_copy12,$$byval_copy13);
  13951. $67 = $12;
  13952. $68 = $67;
  13953. $69 = HEAP32[$68>>2]|0;
  13954. $70 = (($67) + 4)|0;
  13955. $71 = $70;
  13956. $72 = HEAP32[$71>>2]|0;
  13957. $73 = $0;
  13958. $74 = $73;
  13959. HEAP32[$74>>2] = $69;
  13960. $75 = (($73) + 4)|0;
  13961. $76 = $75;
  13962. HEAP32[$76>>2] = $72;
  13963. $77 = (($$0$lcssa) + 1)|0;
  13964. $78 = HEAP32[$6>>2]|0;
  13965. $79 = ($77>>>0)<($78>>>0);
  13966. $80 = $79 ? $77 : 0;
  13967. $81 = (((($6)) + 4|0) + ($80<<3)|0);
  13968. ;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;
  13969. ;HEAP32[$$byval_copy13>>2]=HEAP32[$81>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$81+4>>2]|0;
  13970. _Mat2MultiplyVector2($13,$tmpcast$byval_copy12,$$byval_copy13);
  13971. $82 = $13;
  13972. $83 = $82;
  13973. $84 = HEAP32[$83>>2]|0;
  13974. $85 = (($82) + 4)|0;
  13975. $86 = $85;
  13976. $87 = HEAP32[$86>>2]|0;
  13977. $88 = $1;
  13978. $89 = $88;
  13979. HEAP32[$89>>2] = $84;
  13980. $90 = (($88) + 4)|0;
  13981. $91 = $90;
  13982. HEAP32[$91>>2] = $87;
  13983. $92 = HEAP32[$64>>2]|0;
  13984. $93 = ((($92)) + 8|0);
  13985. ;HEAP32[$tmpcast$byval_copy12>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast$byval_copy12+4>>2]=HEAP32[$1+4>>2]|0;
  13986. ;HEAP32[$$byval_copy13>>2]=HEAP32[$93>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$93+4>>2]|0;
  13987. _Vector2Add_2($14,$tmpcast$byval_copy12,$$byval_copy13);
  13988. $94 = $14;
  13989. $95 = $94;
  13990. $96 = HEAP32[$95>>2]|0;
  13991. $97 = (($94) + 4)|0;
  13992. $98 = $97;
  13993. $99 = HEAP32[$98>>2]|0;
  13994. $100 = $1;
  13995. $101 = $100;
  13996. HEAP32[$101>>2] = $96;
  13997. $102 = (($100) + 4)|0;
  13998. $103 = $102;
  13999. HEAP32[$103>>2] = $99;
  14000. STACKTOP = sp;return;
  14001. }
  14002. function _Clip($0,$1,$2,$3) {
  14003. $0 = $0|0;
  14004. $1 = +$1;
  14005. $2 = $2|0;
  14006. $3 = $3|0;
  14007. 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;
  14008. 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;
  14009. 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;
  14010. 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;
  14011. 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;
  14012. var $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, label = 0, sp = 0;
  14013. sp = STACKTOP;
  14014. STACKTOP = STACKTOP + 48|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(48|0);
  14015. $$byval_copy7 = sp + 40|0;
  14016. $$byval_copy6 = sp + 32|0;
  14017. $4 = sp;
  14018. $5 = sp + 24|0;
  14019. $6 = sp + 16|0;
  14020. $7 = $2;
  14021. $8 = $7;
  14022. $9 = HEAP32[$8>>2]|0;
  14023. $10 = (($7) + 4)|0;
  14024. $11 = $10;
  14025. $12 = HEAP32[$11>>2]|0;
  14026. $13 = $4;
  14027. $14 = $13;
  14028. HEAP32[$14>>2] = $9;
  14029. $15 = (($13) + 4)|0;
  14030. $16 = $15;
  14031. HEAP32[$16>>2] = $12;
  14032. $17 = ((($4)) + 8|0);
  14033. $18 = $3;
  14034. $19 = $18;
  14035. $20 = HEAP32[$19>>2]|0;
  14036. $21 = (($18) + 4)|0;
  14037. $22 = $21;
  14038. $23 = HEAP32[$22>>2]|0;
  14039. $24 = $17;
  14040. $25 = $24;
  14041. HEAP32[$25>>2] = $20;
  14042. $26 = (($24) + 4)|0;
  14043. $27 = $26;
  14044. HEAP32[$27>>2] = $23;
  14045. ;HEAP32[$$byval_copy6>>2]=HEAP32[$0>>2]|0;HEAP32[$$byval_copy6+4>>2]=HEAP32[$0+4>>2]|0;
  14046. ;HEAP32[$$byval_copy7>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy7+4>>2]=HEAP32[$2+4>>2]|0;
  14047. $28 = (+_MathDot($$byval_copy6,$$byval_copy7));
  14048. $29 = $28 - $1;
  14049. ;HEAP32[$$byval_copy6>>2]=HEAP32[$0>>2]|0;HEAP32[$$byval_copy6+4>>2]=HEAP32[$0+4>>2]|0;
  14050. ;HEAP32[$$byval_copy7>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy7+4>>2]=HEAP32[$3+4>>2]|0;
  14051. $30 = (+_MathDot($$byval_copy6,$$byval_copy7));
  14052. $31 = $30 - $1;
  14053. $32 = !($29 <= 0.0);
  14054. if ($32) {
  14055. $$0 = 0;
  14056. } else {
  14057. $33 = $2;
  14058. $34 = $33;
  14059. $35 = HEAP32[$34>>2]|0;
  14060. $36 = (($33) + 4)|0;
  14061. $37 = $36;
  14062. $38 = HEAP32[$37>>2]|0;
  14063. $39 = $4;
  14064. $40 = $39;
  14065. HEAP32[$40>>2] = $35;
  14066. $41 = (($39) + 4)|0;
  14067. $42 = $41;
  14068. HEAP32[$42>>2] = $38;
  14069. $$0 = 1;
  14070. }
  14071. $43 = !($31 <= 0.0);
  14072. if ($43) {
  14073. $$1 = $$0;
  14074. } else {
  14075. $44 = (($4) + ($$0<<3)|0);
  14076. $45 = (($$0) + 1)|0;
  14077. $46 = $3;
  14078. $47 = $46;
  14079. $48 = HEAP32[$47>>2]|0;
  14080. $49 = (($46) + 4)|0;
  14081. $50 = $49;
  14082. $51 = HEAP32[$50>>2]|0;
  14083. $52 = $44;
  14084. $53 = $52;
  14085. HEAP32[$53>>2] = $48;
  14086. $54 = (($52) + 4)|0;
  14087. $55 = $54;
  14088. HEAP32[$55>>2] = $51;
  14089. $$1 = $45;
  14090. }
  14091. $56 = $29 * $31;
  14092. $57 = $56 < 0.0;
  14093. if (!($57)) {
  14094. $$2 = $$1;
  14095. $87 = $4;
  14096. $88 = $87;
  14097. $89 = HEAP32[$88>>2]|0;
  14098. $90 = (($87) + 4)|0;
  14099. $91 = $90;
  14100. $92 = HEAP32[$91>>2]|0;
  14101. $93 = $2;
  14102. $94 = $93;
  14103. HEAP32[$94>>2] = $89;
  14104. $95 = (($93) + 4)|0;
  14105. $96 = $95;
  14106. HEAP32[$96>>2] = $92;
  14107. $97 = $17;
  14108. $98 = $97;
  14109. $99 = HEAP32[$98>>2]|0;
  14110. $100 = (($97) + 4)|0;
  14111. $101 = $100;
  14112. $102 = HEAP32[$101>>2]|0;
  14113. $103 = $3;
  14114. $104 = $103;
  14115. HEAP32[$104>>2] = $99;
  14116. $105 = (($103) + 4)|0;
  14117. $106 = $105;
  14118. HEAP32[$106>>2] = $102;
  14119. STACKTOP = sp;return ($$2|0);
  14120. }
  14121. $58 = $29 - $31;
  14122. $59 = $29 / $58;
  14123. $60 = (($4) + ($$1<<3)|0);
  14124. $61 = $2;
  14125. $62 = $61;
  14126. $63 = HEAP32[$62>>2]|0;
  14127. $64 = (($61) + 4)|0;
  14128. $65 = $64;
  14129. $66 = HEAP32[$65>>2]|0;
  14130. $67 = $60;
  14131. $68 = $67;
  14132. HEAP32[$68>>2] = $63;
  14133. $69 = (($67) + 4)|0;
  14134. $70 = $69;
  14135. HEAP32[$70>>2] = $66;
  14136. ;HEAP32[$$byval_copy6>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy6+4>>2]=HEAP32[$3+4>>2]|0;
  14137. ;HEAP32[$$byval_copy7>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy7+4>>2]=HEAP32[$2+4>>2]|0;
  14138. _Vector2Subtract_4($5,$$byval_copy6,$$byval_copy7);
  14139. $71 = +HEAPF32[$5>>2];
  14140. $72 = $59 * $71;
  14141. HEAPF32[$5>>2] = $72;
  14142. $73 = ((($5)) + 4|0);
  14143. $74 = +HEAPF32[$73>>2];
  14144. $75 = $59 * $74;
  14145. HEAPF32[$73>>2] = $75;
  14146. ;HEAP32[$$byval_copy6>>2]=HEAP32[$60>>2]|0;HEAP32[$$byval_copy6+4>>2]=HEAP32[$60+4>>2]|0;
  14147. ;HEAP32[$$byval_copy7>>2]=HEAP32[$5>>2]|0;HEAP32[$$byval_copy7+4>>2]=HEAP32[$5+4>>2]|0;
  14148. _Vector2Add_2($6,$$byval_copy6,$$byval_copy7);
  14149. $76 = $6;
  14150. $77 = $76;
  14151. $78 = HEAP32[$77>>2]|0;
  14152. $79 = (($76) + 4)|0;
  14153. $80 = $79;
  14154. $81 = HEAP32[$80>>2]|0;
  14155. $82 = $60;
  14156. $83 = $82;
  14157. HEAP32[$83>>2] = $78;
  14158. $84 = (($82) + 4)|0;
  14159. $85 = $84;
  14160. HEAP32[$85>>2] = $81;
  14161. $86 = (($$1) + 1)|0;
  14162. $$2 = $86;
  14163. $87 = $4;
  14164. $88 = $87;
  14165. $89 = HEAP32[$88>>2]|0;
  14166. $90 = (($87) + 4)|0;
  14167. $91 = $90;
  14168. $92 = HEAP32[$91>>2]|0;
  14169. $93 = $2;
  14170. $94 = $93;
  14171. HEAP32[$94>>2] = $89;
  14172. $95 = (($93) + 4)|0;
  14173. $96 = $95;
  14174. HEAP32[$96>>2] = $92;
  14175. $97 = $17;
  14176. $98 = $97;
  14177. $99 = HEAP32[$98>>2]|0;
  14178. $100 = (($97) + 4)|0;
  14179. $101 = $100;
  14180. $102 = HEAP32[$101>>2]|0;
  14181. $103 = $3;
  14182. $104 = $103;
  14183. HEAP32[$104>>2] = $99;
  14184. $105 = (($103) + 4)|0;
  14185. $106 = $105;
  14186. HEAP32[$106>>2] = $102;
  14187. STACKTOP = sp;return ($$2|0);
  14188. }
  14189. function _GetSupport($0,$1,$2) {
  14190. $0 = $0|0;
  14191. $1 = $1|0;
  14192. $2 = $2|0;
  14193. 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;
  14194. 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;
  14195. sp = STACKTOP;
  14196. STACKTOP = STACKTOP + 432|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(432|0);
  14197. $$byval_copy = sp + 424|0;
  14198. $tmpcast$byval_copy = sp + 416|0;
  14199. $3 = sp + 8|0;
  14200. $4 = sp;
  14201. $5 = ((($1)) + 12|0);
  14202. _memcpy(($3|0),($5|0),404)|0;
  14203. $6 = HEAP32[$3>>2]|0;
  14204. $7 = ($6|0)==(0);
  14205. if ($7) {
  14206. $11 = 0;$14 = 0;
  14207. $9 = $0;
  14208. $10 = $9;
  14209. HEAP32[$10>>2] = $11;
  14210. $12 = (($9) + 4)|0;
  14211. $13 = $12;
  14212. HEAP32[$13>>2] = $14;
  14213. STACKTOP = sp;return;
  14214. }
  14215. $8 = HEAP32[$3>>2]|0;
  14216. $$01318 = 0;$$019 = -3.4028234663852886E+38;$29 = 0;$31 = 0;
  14217. while(1) {
  14218. $15 = (((($3)) + 4|0) + ($$01318<<3)|0);
  14219. $16 = $15;
  14220. $17 = $16;
  14221. $18 = HEAP32[$17>>2]|0;
  14222. $19 = (($16) + 4)|0;
  14223. $20 = $19;
  14224. $21 = HEAP32[$20>>2]|0;
  14225. $22 = $4;
  14226. $23 = $22;
  14227. HEAP32[$23>>2] = $18;
  14228. $24 = (($22) + 4)|0;
  14229. $25 = $24;
  14230. HEAP32[$25>>2] = $21;
  14231. ;HEAP32[$tmpcast$byval_copy>>2]=HEAP32[$4>>2]|0;HEAP32[$tmpcast$byval_copy+4>>2]=HEAP32[$4+4>>2]|0;
  14232. ;HEAP32[$$byval_copy>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy+4>>2]=HEAP32[$2+4>>2]|0;
  14233. $26 = (+_MathDot($tmpcast$byval_copy,$$byval_copy));
  14234. $27 = $26 > $$019;
  14235. $28 = $27 ? $18 : $29;
  14236. $30 = $27 ? $21 : $31;
  14237. $$1 = $27 ? $26 : $$019;
  14238. $32 = (($$01318) + 1)|0;
  14239. $33 = ($32>>>0)<($8>>>0);
  14240. if ($33) {
  14241. $$01318 = $32;$$019 = $$1;$29 = $28;$31 = $30;
  14242. } else {
  14243. $11 = $28;$14 = $30;
  14244. break;
  14245. }
  14246. }
  14247. $9 = $0;
  14248. $10 = $9;
  14249. HEAP32[$10>>2] = $11;
  14250. $12 = (($9) + 4)|0;
  14251. $13 = $12;
  14252. HEAP32[$13>>2] = $14;
  14253. STACKTOP = sp;return;
  14254. }
  14255. function _MathCross($0,$1,$2) {
  14256. $0 = $0|0;
  14257. $1 = +$1;
  14258. $2 = $2|0;
  14259. var $3 = 0, $4 = 0.0, $5 = 0.0, $6 = 0.0, $7 = 0, $8 = 0.0, $9 = 0.0, label = 0, sp = 0;
  14260. sp = STACKTOP;
  14261. $3 = ((($2)) + 4|0);
  14262. $4 = +HEAPF32[$3>>2];
  14263. $5 = $4 * $1;
  14264. $6 = -$5;
  14265. HEAPF32[$0>>2] = $6;
  14266. $7 = ((($0)) + 4|0);
  14267. $8 = +HEAPF32[$2>>2];
  14268. $9 = $8 * $1;
  14269. HEAPF32[$7>>2] = $9;
  14270. return;
  14271. }
  14272. function _Mat2Set($0,$1) {
  14273. $0 = $0|0;
  14274. $1 = +$1;
  14275. var $2 = 0.0, $3 = 0.0, $4 = 0.0, $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0;
  14276. sp = STACKTOP;
  14277. $2 = (+Math_cos((+$1)));
  14278. $3 = (+Math_sin((+$1)));
  14279. HEAPF32[$0>>2] = $2;
  14280. $4 = -$3;
  14281. $5 = ((($0)) + 4|0);
  14282. HEAPF32[$5>>2] = $4;
  14283. $6 = ((($0)) + 8|0);
  14284. HEAPF32[$6>>2] = $3;
  14285. $7 = ((($0)) + 12|0);
  14286. HEAPF32[$7>>2] = $2;
  14287. return;
  14288. }
  14289. function _Vector2Distance($0,$1) {
  14290. $0 = $0|0;
  14291. $1 = $1|0;
  14292. 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;
  14293. sp = STACKTOP;
  14294. $2 = +HEAPF32[$0>>2];
  14295. $3 = +HEAPF32[$1>>2];
  14296. $4 = $2 - $3;
  14297. $5 = $4 * $4;
  14298. $6 = ((($0)) + 4|0);
  14299. $7 = +HEAPF32[$6>>2];
  14300. $8 = ((($1)) + 4|0);
  14301. $9 = +HEAPF32[$8>>2];
  14302. $10 = $7 - $9;
  14303. $11 = $10 * $10;
  14304. $12 = $5 + $11;
  14305. $13 = (+Math_sqrt((+$12)));
  14306. return (+$13);
  14307. }
  14308. function _Vector2Angle($0,$1) {
  14309. $0 = $0|0;
  14310. $1 = $1|0;
  14311. 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;
  14312. sp = STACKTOP;
  14313. $2 = ((($1)) + 4|0);
  14314. $3 = +HEAPF32[$2>>2];
  14315. $4 = ((($0)) + 4|0);
  14316. $5 = +HEAPF32[$4>>2];
  14317. $6 = $3 - $5;
  14318. $7 = +HEAPF32[$1>>2];
  14319. $8 = +HEAPF32[$0>>2];
  14320. $9 = $7 - $8;
  14321. $10 = (+Math_atan2((+$6),(+$9)));
  14322. $11 = $10 * 57.2957763671875;
  14323. $12 = $11 < 0.0;
  14324. $13 = $11 + 360.0;
  14325. $$0 = $12 ? $13 : $11;
  14326. return (+$$0);
  14327. }
  14328. function _VectorZero($0) {
  14329. $0 = $0|0;
  14330. var $1 = 0, $2 = 0, label = 0, sp = 0;
  14331. sp = STACKTOP;
  14332. HEAPF32[$0>>2] = 0.0;
  14333. $1 = ((($0)) + 4|0);
  14334. HEAPF32[$1>>2] = 0.0;
  14335. $2 = ((($0)) + 8|0);
  14336. HEAPF32[$2>>2] = 0.0;
  14337. return;
  14338. }
  14339. function _VectorLength($0) {
  14340. $0 = $0|0;
  14341. 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;
  14342. sp = STACKTOP;
  14343. $1 = +HEAPF32[$0>>2];
  14344. $2 = $1 * $1;
  14345. $3 = ((($0)) + 4|0);
  14346. $4 = +HEAPF32[$3>>2];
  14347. $5 = $4 * $4;
  14348. $6 = $2 + $5;
  14349. $7 = ((($0)) + 8|0);
  14350. $8 = +HEAPF32[$7>>2];
  14351. $9 = $8 * $8;
  14352. $10 = $6 + $9;
  14353. $11 = (+Math_sqrt((+$10)));
  14354. return (+$11);
  14355. }
  14356. function _VectorNormalize($0) {
  14357. $0 = $0|0;
  14358. 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;
  14359. sp = STACKTOP;
  14360. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  14361. $$byval_copy = sp;
  14362. ;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;
  14363. $1 = (+_VectorLength($$byval_copy));
  14364. $2 = $1 == 0.0;
  14365. $$op = 1.0 / $1;
  14366. $3 = $2 ? 1.0 : $$op;
  14367. $4 = +HEAPF32[$0>>2];
  14368. $5 = $4 * $3;
  14369. HEAPF32[$0>>2] = $5;
  14370. $6 = ((($0)) + 4|0);
  14371. $7 = +HEAPF32[$6>>2];
  14372. $8 = $3 * $7;
  14373. HEAPF32[$6>>2] = $8;
  14374. $9 = ((($0)) + 8|0);
  14375. $10 = +HEAPF32[$9>>2];
  14376. $11 = $3 * $10;
  14377. HEAPF32[$9>>2] = $11;
  14378. STACKTOP = sp;return;
  14379. }
  14380. function _VectorTransform($0,$1) {
  14381. $0 = $0|0;
  14382. $1 = $1|0;
  14383. 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;
  14384. 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;
  14385. var $47 = 0.0, $5 = 0, $6 = 0.0, $7 = 0.0, $8 = 0.0, $9 = 0, label = 0, sp = 0;
  14386. sp = STACKTOP;
  14387. $2 = +HEAPF32[$0>>2];
  14388. $3 = ((($0)) + 4|0);
  14389. $4 = +HEAPF32[$3>>2];
  14390. $5 = ((($0)) + 8|0);
  14391. $6 = +HEAPF32[$5>>2];
  14392. $7 = +HEAPF32[$1>>2];
  14393. $8 = $2 * $7;
  14394. $9 = ((($1)) + 4|0);
  14395. $10 = +HEAPF32[$9>>2];
  14396. $11 = $4 * $10;
  14397. $12 = $8 + $11;
  14398. $13 = ((($1)) + 8|0);
  14399. $14 = +HEAPF32[$13>>2];
  14400. $15 = $6 * $14;
  14401. $16 = $12 + $15;
  14402. $17 = ((($1)) + 12|0);
  14403. $18 = +HEAPF32[$17>>2];
  14404. $19 = $18 + $16;
  14405. HEAPF32[$0>>2] = $19;
  14406. $20 = ((($1)) + 16|0);
  14407. $21 = +HEAPF32[$20>>2];
  14408. $22 = $2 * $21;
  14409. $23 = ((($1)) + 20|0);
  14410. $24 = +HEAPF32[$23>>2];
  14411. $25 = $4 * $24;
  14412. $26 = $22 + $25;
  14413. $27 = ((($1)) + 24|0);
  14414. $28 = +HEAPF32[$27>>2];
  14415. $29 = $6 * $28;
  14416. $30 = $26 + $29;
  14417. $31 = ((($1)) + 28|0);
  14418. $32 = +HEAPF32[$31>>2];
  14419. $33 = $32 + $30;
  14420. HEAPF32[$3>>2] = $33;
  14421. $34 = ((($1)) + 32|0);
  14422. $35 = +HEAPF32[$34>>2];
  14423. $36 = $2 * $35;
  14424. $37 = ((($1)) + 36|0);
  14425. $38 = +HEAPF32[$37>>2];
  14426. $39 = $4 * $38;
  14427. $40 = $36 + $39;
  14428. $41 = ((($1)) + 40|0);
  14429. $42 = +HEAPF32[$41>>2];
  14430. $43 = $6 * $42;
  14431. $44 = $40 + $43;
  14432. $45 = ((($1)) + 44|0);
  14433. $46 = +HEAPF32[$45>>2];
  14434. $47 = $46 + $44;
  14435. HEAPF32[$5>>2] = $47;
  14436. return;
  14437. }
  14438. function _MatrixTranspose($0) {
  14439. $0 = $0|0;
  14440. 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;
  14441. var $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  14442. sp = STACKTOP;
  14443. $1 = ((($0)) + 4|0);
  14444. $2 = HEAP32[$1>>2]|0;
  14445. $3 = ((($0)) + 8|0);
  14446. $4 = HEAP32[$3>>2]|0;
  14447. $5 = ((($0)) + 12|0);
  14448. $6 = HEAP32[$5>>2]|0;
  14449. $7 = ((($0)) + 16|0);
  14450. $8 = HEAP32[$7>>2]|0;
  14451. $9 = ((($0)) + 24|0);
  14452. $10 = HEAP32[$9>>2]|0;
  14453. $11 = ((($0)) + 28|0);
  14454. $12 = HEAP32[$11>>2]|0;
  14455. $13 = ((($0)) + 32|0);
  14456. $14 = HEAP32[$13>>2]|0;
  14457. $15 = ((($0)) + 36|0);
  14458. $16 = HEAP32[$15>>2]|0;
  14459. $17 = ((($0)) + 44|0);
  14460. $18 = HEAP32[$17>>2]|0;
  14461. $19 = ((($0)) + 48|0);
  14462. $20 = HEAP32[$19>>2]|0;
  14463. $21 = ((($0)) + 52|0);
  14464. $22 = HEAP32[$21>>2]|0;
  14465. $23 = ((($0)) + 56|0);
  14466. $24 = HEAP32[$23>>2]|0;
  14467. HEAP32[$1>>2] = $8;
  14468. HEAP32[$3>>2] = $14;
  14469. HEAP32[$5>>2] = $20;
  14470. HEAP32[$7>>2] = $2;
  14471. HEAP32[$9>>2] = $16;
  14472. HEAP32[$11>>2] = $22;
  14473. HEAP32[$13>>2] = $4;
  14474. HEAP32[$15>>2] = $10;
  14475. HEAP32[$17>>2] = $24;
  14476. HEAP32[$19>>2] = $6;
  14477. HEAP32[$21>>2] = $12;
  14478. HEAP32[$23>>2] = $18;
  14479. return;
  14480. }
  14481. function _MatrixIdentity($0) {
  14482. $0 = $0|0;
  14483. 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;
  14484. sp = STACKTOP;
  14485. HEAPF32[$0>>2] = 1.0;
  14486. $$sroa$5$0$$sroa_idx = ((($0)) + 4|0);
  14487. ;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;
  14488. $$sroa$55$0$$sroa_idx6 = ((($0)) + 20|0);
  14489. HEAPF32[$$sroa$55$0$$sroa_idx6>>2] = 1.0;
  14490. $$sroa$6$0$$sroa_idx = ((($0)) + 24|0);
  14491. ;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;
  14492. $$sroa$611$0$$sroa_idx12 = ((($0)) + 40|0);
  14493. HEAPF32[$$sroa$611$0$$sroa_idx12>>2] = 1.0;
  14494. $$sroa$7$0$$sroa_idx = ((($0)) + 44|0);
  14495. ;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;
  14496. $$sroa$717$0$$sroa_idx18 = ((($0)) + 60|0);
  14497. HEAPF32[$$sroa$717$0$$sroa_idx18>>2] = 1.0;
  14498. return;
  14499. }
  14500. function _MatrixTranslate($0,$1,$2,$3) {
  14501. $0 = $0|0;
  14502. $1 = +$1;
  14503. $2 = +$2;
  14504. $3 = +$3;
  14505. 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;
  14506. sp = STACKTOP;
  14507. HEAPF32[$0>>2] = 1.0;
  14508. $$sroa$4$0$$sroa_idx2 = ((($0)) + 4|0);
  14509. $$sroa$8$0$$sroa_idx10 = ((($0)) + 20|0);
  14510. ;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;
  14511. HEAPF32[$$sroa$8$0$$sroa_idx10>>2] = 1.0;
  14512. $$sroa$9$0$$sroa_idx12 = ((($0)) + 24|0);
  14513. $$sroa$13$0$$sroa_idx20 = ((($0)) + 40|0);
  14514. ;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;
  14515. HEAPF32[$$sroa$13$0$$sroa_idx20>>2] = 1.0;
  14516. $$sroa$14$0$$sroa_idx22 = ((($0)) + 44|0);
  14517. HEAPF32[$$sroa$14$0$$sroa_idx22>>2] = 0.0;
  14518. $$sroa$15$0$$sroa_idx24 = ((($0)) + 48|0);
  14519. HEAPF32[$$sroa$15$0$$sroa_idx24>>2] = $1;
  14520. $$sroa$16$0$$sroa_idx26 = ((($0)) + 52|0);
  14521. HEAPF32[$$sroa$16$0$$sroa_idx26>>2] = $2;
  14522. $$sroa$17$0$$sroa_idx28 = ((($0)) + 56|0);
  14523. HEAPF32[$$sroa$17$0$$sroa_idx28>>2] = $3;
  14524. $$sroa$18$0$$sroa_idx30 = ((($0)) + 60|0);
  14525. HEAPF32[$$sroa$18$0$$sroa_idx30>>2] = 1.0;
  14526. return;
  14527. }
  14528. function _MatrixRotate($0,$1,$2) {
  14529. $0 = $0|0;
  14530. $1 = $1|0;
  14531. $2 = +$2;
  14532. 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;
  14533. 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;
  14534. 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;
  14535. 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;
  14536. 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;
  14537. 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;
  14538. 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;
  14539. 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;
  14540. sp = STACKTOP;
  14541. STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
  14542. $3 = sp;
  14543. _MatrixIdentity($3);
  14544. $4 = +HEAPF32[$1>>2];
  14545. $5 = ((($1)) + 4|0);
  14546. $6 = +HEAPF32[$5>>2];
  14547. $7 = ((($1)) + 8|0);
  14548. $8 = +HEAPF32[$7>>2];
  14549. $9 = $4 * $4;
  14550. $10 = $6 * $6;
  14551. $11 = $9 + $10;
  14552. $12 = $8 * $8;
  14553. $13 = $11 + $12;
  14554. $14 = (+Math_sqrt((+$13)));
  14555. $15 = $14 != 1.0;
  14556. $16 = $14 != 0.0;
  14557. $or$cond = $15 & $16;
  14558. $17 = 1.0 / $14;
  14559. $18 = $4 * $17;
  14560. $19 = $6 * $17;
  14561. $20 = $8 * $17;
  14562. $$ = $or$cond ? $20 : $8;
  14563. $$221 = $or$cond ? $19 : $6;
  14564. $$222 = $or$cond ? $18 : $4;
  14565. $21 = (+Math_sin((+$2)));
  14566. $22 = (+Math_cos((+$2)));
  14567. $23 = 1.0 - $22;
  14568. $24 = +HEAPF32[$3>>2];
  14569. $25 = ((($3)) + 16|0);
  14570. $26 = +HEAPF32[$25>>2];
  14571. $27 = ((($3)) + 32|0);
  14572. $28 = +HEAPF32[$27>>2];
  14573. $29 = ((($3)) + 48|0);
  14574. $30 = +HEAPF32[$29>>2];
  14575. $31 = ((($3)) + 4|0);
  14576. $32 = +HEAPF32[$31>>2];
  14577. $33 = ((($3)) + 20|0);
  14578. $34 = +HEAPF32[$33>>2];
  14579. $35 = ((($3)) + 36|0);
  14580. $36 = +HEAPF32[$35>>2];
  14581. $37 = ((($3)) + 52|0);
  14582. $38 = +HEAPF32[$37>>2];
  14583. $39 = ((($3)) + 8|0);
  14584. $40 = +HEAPF32[$39>>2];
  14585. $41 = ((($3)) + 24|0);
  14586. $42 = +HEAPF32[$41>>2];
  14587. $43 = ((($3)) + 40|0);
  14588. $44 = +HEAPF32[$43>>2];
  14589. $45 = ((($3)) + 56|0);
  14590. $46 = +HEAPF32[$45>>2];
  14591. $47 = $$222 * $$222;
  14592. $48 = $23 * $47;
  14593. $49 = $22 + $48;
  14594. $50 = $$221 * $$222;
  14595. $51 = $23 * $50;
  14596. $52 = $21 * $$;
  14597. $53 = $52 + $51;
  14598. $54 = $$ * $$222;
  14599. $55 = $23 * $54;
  14600. $56 = $21 * $$221;
  14601. $57 = $55 - $56;
  14602. $58 = $51 - $52;
  14603. $59 = $$221 * $$221;
  14604. $60 = $23 * $59;
  14605. $61 = $22 + $60;
  14606. $62 = $$ * $$221;
  14607. $63 = $23 * $62;
  14608. $64 = $21 * $$222;
  14609. $65 = $64 + $63;
  14610. $66 = $56 + $55;
  14611. $67 = $63 - $64;
  14612. $68 = $$ * $$;
  14613. $69 = $23 * $68;
  14614. $70 = $22 + $69;
  14615. $71 = $24 * $49;
  14616. $72 = $53 * $32;
  14617. $73 = $71 + $72;
  14618. $74 = $57 * $40;
  14619. $75 = $73 + $74;
  14620. $76 = $26 * $49;
  14621. $77 = $53 * $34;
  14622. $78 = $76 + $77;
  14623. $79 = $57 * $42;
  14624. $80 = $78 + $79;
  14625. $81 = $28 * $49;
  14626. $82 = $53 * $36;
  14627. $83 = $81 + $82;
  14628. $84 = $57 * $44;
  14629. $85 = $83 + $84;
  14630. $86 = $30 * $49;
  14631. $87 = $53 * $38;
  14632. $88 = $86 + $87;
  14633. $89 = $57 * $46;
  14634. $90 = $88 + $89;
  14635. $91 = $24 * $58;
  14636. $92 = $61 * $32;
  14637. $93 = $91 + $92;
  14638. $94 = $65 * $40;
  14639. $95 = $93 + $94;
  14640. $96 = $26 * $58;
  14641. $97 = $61 * $34;
  14642. $98 = $96 + $97;
  14643. $99 = $65 * $42;
  14644. $100 = $98 + $99;
  14645. $101 = $28 * $58;
  14646. $102 = $61 * $36;
  14647. $103 = $101 + $102;
  14648. $104 = $65 * $44;
  14649. $105 = $103 + $104;
  14650. $106 = $30 * $58;
  14651. $107 = $61 * $38;
  14652. $108 = $106 + $107;
  14653. $109 = $65 * $46;
  14654. $110 = $108 + $109;
  14655. $111 = $24 * $66;
  14656. $112 = $67 * $32;
  14657. $113 = $111 + $112;
  14658. $114 = $70 * $40;
  14659. $115 = $113 + $114;
  14660. $116 = $26 * $66;
  14661. $117 = $67 * $34;
  14662. $118 = $116 + $117;
  14663. $119 = $70 * $42;
  14664. $120 = $118 + $119;
  14665. $121 = $28 * $66;
  14666. $122 = $67 * $36;
  14667. $123 = $121 + $122;
  14668. $124 = $70 * $44;
  14669. $125 = $123 + $124;
  14670. $126 = $30 * $66;
  14671. $127 = $67 * $38;
  14672. $128 = $126 + $127;
  14673. $129 = $70 * $46;
  14674. $130 = $128 + $129;
  14675. $131 = ((($3)) + 12|0);
  14676. $132 = HEAP32[$131>>2]|0;
  14677. $133 = ((($3)) + 28|0);
  14678. $134 = HEAP32[$133>>2]|0;
  14679. $135 = ((($3)) + 44|0);
  14680. $136 = HEAP32[$135>>2]|0;
  14681. $137 = ((($3)) + 60|0);
  14682. $138 = HEAP32[$137>>2]|0;
  14683. HEAPF32[$0>>2] = $75;
  14684. $$sroa$4$0$$sroa_idx187 = ((($0)) + 4|0);
  14685. HEAPF32[$$sroa$4$0$$sroa_idx187>>2] = $95;
  14686. $$sroa$5$0$$sroa_idx189 = ((($0)) + 8|0);
  14687. HEAPF32[$$sroa$5$0$$sroa_idx189>>2] = $115;
  14688. $$sroa$6$0$$sroa_idx191 = ((($0)) + 12|0);
  14689. HEAP32[$$sroa$6$0$$sroa_idx191>>2] = $132;
  14690. $$sroa$7$0$$sroa_idx193 = ((($0)) + 16|0);
  14691. HEAPF32[$$sroa$7$0$$sroa_idx193>>2] = $80;
  14692. $$sroa$8$0$$sroa_idx195 = ((($0)) + 20|0);
  14693. HEAPF32[$$sroa$8$0$$sroa_idx195>>2] = $100;
  14694. $$sroa$9$0$$sroa_idx197 = ((($0)) + 24|0);
  14695. HEAPF32[$$sroa$9$0$$sroa_idx197>>2] = $120;
  14696. $$sroa$10$0$$sroa_idx199 = ((($0)) + 28|0);
  14697. HEAP32[$$sroa$10$0$$sroa_idx199>>2] = $134;
  14698. $$sroa$11$0$$sroa_idx201 = ((($0)) + 32|0);
  14699. HEAPF32[$$sroa$11$0$$sroa_idx201>>2] = $85;
  14700. $$sroa$12$0$$sroa_idx203 = ((($0)) + 36|0);
  14701. HEAPF32[$$sroa$12$0$$sroa_idx203>>2] = $105;
  14702. $$sroa$13$0$$sroa_idx205 = ((($0)) + 40|0);
  14703. HEAPF32[$$sroa$13$0$$sroa_idx205>>2] = $125;
  14704. $$sroa$14$0$$sroa_idx207 = ((($0)) + 44|0);
  14705. HEAP32[$$sroa$14$0$$sroa_idx207>>2] = $136;
  14706. $$sroa$15$0$$sroa_idx209 = ((($0)) + 48|0);
  14707. HEAPF32[$$sroa$15$0$$sroa_idx209>>2] = $90;
  14708. $$sroa$16$0$$sroa_idx211 = ((($0)) + 52|0);
  14709. HEAPF32[$$sroa$16$0$$sroa_idx211>>2] = $110;
  14710. $$sroa$17$0$$sroa_idx213 = ((($0)) + 56|0);
  14711. HEAPF32[$$sroa$17$0$$sroa_idx213>>2] = $130;
  14712. $$sroa$18$0$$sroa_idx215 = ((($0)) + 60|0);
  14713. HEAP32[$$sroa$18$0$$sroa_idx215>>2] = $138;
  14714. STACKTOP = sp;return;
  14715. }
  14716. function _MatrixScale($0,$1,$2,$3) {
  14717. $0 = $0|0;
  14718. $1 = +$1;
  14719. $2 = +$2;
  14720. $3 = +$3;
  14721. 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;
  14722. sp = STACKTOP;
  14723. HEAPF32[$0>>2] = $1;
  14724. $$sroa$5$0$$sroa_idx = ((($0)) + 4|0);
  14725. ;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;
  14726. $$sroa$55$0$$sroa_idx6 = ((($0)) + 20|0);
  14727. HEAPF32[$$sroa$55$0$$sroa_idx6>>2] = $2;
  14728. $$sroa$6$0$$sroa_idx = ((($0)) + 24|0);
  14729. ;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;
  14730. $$sroa$611$0$$sroa_idx12 = ((($0)) + 40|0);
  14731. HEAPF32[$$sroa$611$0$$sroa_idx12>>2] = $3;
  14732. $$sroa$7$0$$sroa_idx = ((($0)) + 44|0);
  14733. ;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;
  14734. $$sroa$717$0$$sroa_idx18 = ((($0)) + 60|0);
  14735. HEAPF32[$$sroa$717$0$$sroa_idx18>>2] = 1.0;
  14736. return;
  14737. }
  14738. function _MatrixMultiply($0,$1,$2) {
  14739. $0 = $0|0;
  14740. $1 = $1|0;
  14741. $2 = $2|0;
  14742. 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;
  14743. 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;
  14744. 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;
  14745. 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;
  14746. 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;
  14747. 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;
  14748. 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;
  14749. 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;
  14750. 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;
  14751. 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;
  14752. sp = STACKTOP;
  14753. $3 = +HEAPF32[$2>>2];
  14754. $4 = +HEAPF32[$1>>2];
  14755. $5 = $3 * $4;
  14756. $6 = ((($2)) + 16|0);
  14757. $7 = +HEAPF32[$6>>2];
  14758. $8 = ((($1)) + 4|0);
  14759. $9 = +HEAPF32[$8>>2];
  14760. $10 = $7 * $9;
  14761. $11 = $5 + $10;
  14762. $12 = ((($2)) + 32|0);
  14763. $13 = +HEAPF32[$12>>2];
  14764. $14 = ((($1)) + 8|0);
  14765. $15 = +HEAPF32[$14>>2];
  14766. $16 = $13 * $15;
  14767. $17 = $11 + $16;
  14768. $18 = ((($2)) + 48|0);
  14769. $19 = +HEAPF32[$18>>2];
  14770. $20 = ((($1)) + 12|0);
  14771. $21 = +HEAPF32[$20>>2];
  14772. $22 = $19 * $21;
  14773. $23 = $17 + $22;
  14774. $24 = ((($1)) + 16|0);
  14775. $25 = +HEAPF32[$24>>2];
  14776. $26 = $3 * $25;
  14777. $27 = ((($1)) + 20|0);
  14778. $28 = +HEAPF32[$27>>2];
  14779. $29 = $7 * $28;
  14780. $30 = $26 + $29;
  14781. $31 = ((($1)) + 24|0);
  14782. $32 = +HEAPF32[$31>>2];
  14783. $33 = $13 * $32;
  14784. $34 = $30 + $33;
  14785. $35 = ((($1)) + 28|0);
  14786. $36 = +HEAPF32[$35>>2];
  14787. $37 = $19 * $36;
  14788. $38 = $34 + $37;
  14789. $39 = ((($1)) + 32|0);
  14790. $40 = +HEAPF32[$39>>2];
  14791. $41 = $3 * $40;
  14792. $42 = ((($1)) + 36|0);
  14793. $43 = +HEAPF32[$42>>2];
  14794. $44 = $7 * $43;
  14795. $45 = $41 + $44;
  14796. $46 = ((($1)) + 40|0);
  14797. $47 = +HEAPF32[$46>>2];
  14798. $48 = $13 * $47;
  14799. $49 = $45 + $48;
  14800. $50 = ((($1)) + 44|0);
  14801. $51 = +HEAPF32[$50>>2];
  14802. $52 = $19 * $51;
  14803. $53 = $49 + $52;
  14804. $54 = ((($1)) + 48|0);
  14805. $55 = +HEAPF32[$54>>2];
  14806. $56 = $3 * $55;
  14807. $57 = ((($1)) + 52|0);
  14808. $58 = +HEAPF32[$57>>2];
  14809. $59 = $7 * $58;
  14810. $60 = $56 + $59;
  14811. $61 = ((($1)) + 56|0);
  14812. $62 = +HEAPF32[$61>>2];
  14813. $63 = $13 * $62;
  14814. $64 = $60 + $63;
  14815. $65 = ((($1)) + 60|0);
  14816. $66 = +HEAPF32[$65>>2];
  14817. $67 = $19 * $66;
  14818. $68 = $64 + $67;
  14819. $69 = ((($2)) + 4|0);
  14820. $70 = +HEAPF32[$69>>2];
  14821. $71 = $4 * $70;
  14822. $72 = ((($2)) + 20|0);
  14823. $73 = +HEAPF32[$72>>2];
  14824. $74 = $9 * $73;
  14825. $75 = $71 + $74;
  14826. $76 = ((($2)) + 36|0);
  14827. $77 = +HEAPF32[$76>>2];
  14828. $78 = $15 * $77;
  14829. $79 = $75 + $78;
  14830. $80 = ((($2)) + 52|0);
  14831. $81 = +HEAPF32[$80>>2];
  14832. $82 = $21 * $81;
  14833. $83 = $79 + $82;
  14834. $84 = $25 * $70;
  14835. $85 = $28 * $73;
  14836. $86 = $84 + $85;
  14837. $87 = $32 * $77;
  14838. $88 = $86 + $87;
  14839. $89 = $36 * $81;
  14840. $90 = $88 + $89;
  14841. $91 = $40 * $70;
  14842. $92 = $43 * $73;
  14843. $93 = $91 + $92;
  14844. $94 = $47 * $77;
  14845. $95 = $93 + $94;
  14846. $96 = $51 * $81;
  14847. $97 = $95 + $96;
  14848. $98 = $55 * $70;
  14849. $99 = $58 * $73;
  14850. $100 = $98 + $99;
  14851. $101 = $62 * $77;
  14852. $102 = $100 + $101;
  14853. $103 = $66 * $81;
  14854. $104 = $102 + $103;
  14855. $105 = ((($2)) + 8|0);
  14856. $106 = +HEAPF32[$105>>2];
  14857. $107 = $4 * $106;
  14858. $108 = ((($2)) + 24|0);
  14859. $109 = +HEAPF32[$108>>2];
  14860. $110 = $9 * $109;
  14861. $111 = $107 + $110;
  14862. $112 = ((($2)) + 40|0);
  14863. $113 = +HEAPF32[$112>>2];
  14864. $114 = $15 * $113;
  14865. $115 = $111 + $114;
  14866. $116 = ((($2)) + 56|0);
  14867. $117 = +HEAPF32[$116>>2];
  14868. $118 = $21 * $117;
  14869. $119 = $115 + $118;
  14870. $120 = $25 * $106;
  14871. $121 = $28 * $109;
  14872. $122 = $120 + $121;
  14873. $123 = $32 * $113;
  14874. $124 = $122 + $123;
  14875. $125 = $36 * $117;
  14876. $126 = $124 + $125;
  14877. $127 = $40 * $106;
  14878. $128 = $43 * $109;
  14879. $129 = $127 + $128;
  14880. $130 = $47 * $113;
  14881. $131 = $129 + $130;
  14882. $132 = $51 * $117;
  14883. $133 = $131 + $132;
  14884. $134 = $55 * $106;
  14885. $135 = $58 * $109;
  14886. $136 = $134 + $135;
  14887. $137 = $62 * $113;
  14888. $138 = $136 + $137;
  14889. $139 = $66 * $117;
  14890. $140 = $138 + $139;
  14891. $141 = ((($2)) + 12|0);
  14892. $142 = +HEAPF32[$141>>2];
  14893. $143 = $4 * $142;
  14894. $144 = ((($2)) + 28|0);
  14895. $145 = +HEAPF32[$144>>2];
  14896. $146 = $9 * $145;
  14897. $147 = $143 + $146;
  14898. $148 = ((($2)) + 44|0);
  14899. $149 = +HEAPF32[$148>>2];
  14900. $150 = $15 * $149;
  14901. $151 = $147 + $150;
  14902. $152 = ((($2)) + 60|0);
  14903. $153 = +HEAPF32[$152>>2];
  14904. $154 = $21 * $153;
  14905. $155 = $151 + $154;
  14906. $156 = $25 * $142;
  14907. $157 = $28 * $145;
  14908. $158 = $156 + $157;
  14909. $159 = $32 * $149;
  14910. $160 = $158 + $159;
  14911. $161 = $36 * $153;
  14912. $162 = $160 + $161;
  14913. $163 = $40 * $142;
  14914. $164 = $43 * $145;
  14915. $165 = $163 + $164;
  14916. $166 = $47 * $149;
  14917. $167 = $165 + $166;
  14918. $168 = $51 * $153;
  14919. $169 = $167 + $168;
  14920. $170 = $55 * $142;
  14921. $171 = $58 * $145;
  14922. $172 = $170 + $171;
  14923. $173 = $62 * $149;
  14924. $174 = $172 + $173;
  14925. $175 = $66 * $153;
  14926. $176 = $174 + $175;
  14927. HEAPF32[$0>>2] = $23;
  14928. $$sroa$4$0$$sroa_idx2 = ((($0)) + 4|0);
  14929. HEAPF32[$$sroa$4$0$$sroa_idx2>>2] = $83;
  14930. $$sroa$5$0$$sroa_idx4 = ((($0)) + 8|0);
  14931. HEAPF32[$$sroa$5$0$$sroa_idx4>>2] = $119;
  14932. $$sroa$6$0$$sroa_idx6 = ((($0)) + 12|0);
  14933. HEAPF32[$$sroa$6$0$$sroa_idx6>>2] = $155;
  14934. $$sroa$7$0$$sroa_idx8 = ((($0)) + 16|0);
  14935. HEAPF32[$$sroa$7$0$$sroa_idx8>>2] = $38;
  14936. $$sroa$8$0$$sroa_idx10 = ((($0)) + 20|0);
  14937. HEAPF32[$$sroa$8$0$$sroa_idx10>>2] = $90;
  14938. $$sroa$9$0$$sroa_idx12 = ((($0)) + 24|0);
  14939. HEAPF32[$$sroa$9$0$$sroa_idx12>>2] = $126;
  14940. $$sroa$10$0$$sroa_idx14 = ((($0)) + 28|0);
  14941. HEAPF32[$$sroa$10$0$$sroa_idx14>>2] = $162;
  14942. $$sroa$11$0$$sroa_idx16 = ((($0)) + 32|0);
  14943. HEAPF32[$$sroa$11$0$$sroa_idx16>>2] = $53;
  14944. $$sroa$12$0$$sroa_idx18 = ((($0)) + 36|0);
  14945. HEAPF32[$$sroa$12$0$$sroa_idx18>>2] = $97;
  14946. $$sroa$13$0$$sroa_idx20 = ((($0)) + 40|0);
  14947. HEAPF32[$$sroa$13$0$$sroa_idx20>>2] = $133;
  14948. $$sroa$14$0$$sroa_idx22 = ((($0)) + 44|0);
  14949. HEAPF32[$$sroa$14$0$$sroa_idx22>>2] = $169;
  14950. $$sroa$15$0$$sroa_idx24 = ((($0)) + 48|0);
  14951. HEAPF32[$$sroa$15$0$$sroa_idx24>>2] = $68;
  14952. $$sroa$16$0$$sroa_idx26 = ((($0)) + 52|0);
  14953. HEAPF32[$$sroa$16$0$$sroa_idx26>>2] = $104;
  14954. $$sroa$17$0$$sroa_idx28 = ((($0)) + 56|0);
  14955. HEAPF32[$$sroa$17$0$$sroa_idx28>>2] = $140;
  14956. $$sroa$18$0$$sroa_idx30 = ((($0)) + 60|0);
  14957. HEAPF32[$$sroa$18$0$$sroa_idx30>>2] = $176;
  14958. return;
  14959. }
  14960. function _MatrixOrtho($0,$1,$2,$3,$4,$5,$6) {
  14961. $0 = $0|0;
  14962. $1 = +$1;
  14963. $2 = +$2;
  14964. $3 = +$3;
  14965. $4 = +$4;
  14966. $5 = +$5;
  14967. $6 = +$6;
  14968. 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;
  14969. 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;
  14970. var sp = 0;
  14971. sp = STACKTOP;
  14972. $7 = $2 - $1;
  14973. $8 = $7;
  14974. $9 = $4 - $3;
  14975. $10 = $9;
  14976. $11 = $6 - $5;
  14977. $12 = $11;
  14978. $13 = 2.0 / $8;
  14979. $14 = 2.0 / $10;
  14980. $15 = -2.0 / $12;
  14981. $16 = $1 + $2;
  14982. $17 = -$16;
  14983. $18 = $8;
  14984. $19 = $17 / $18;
  14985. $20 = $19;
  14986. $21 = $3 + $4;
  14987. $22 = -$21;
  14988. $23 = $10;
  14989. $24 = $22 / $23;
  14990. $25 = $24;
  14991. $26 = $5 + $6;
  14992. $27 = -$26;
  14993. $28 = $12;
  14994. $29 = $27 / $28;
  14995. $30 = $29;
  14996. HEAPF32[$0>>2] = $13;
  14997. $$sroa$4$0$$sroa_idx12 = ((($0)) + 4|0);
  14998. HEAPF32[$$sroa$4$0$$sroa_idx12>>2] = 0.0;
  14999. $$sroa$5$0$$sroa_idx14 = ((($0)) + 8|0);
  15000. HEAPF32[$$sroa$5$0$$sroa_idx14>>2] = 0.0;
  15001. $$sroa$6$0$$sroa_idx16 = ((($0)) + 12|0);
  15002. HEAPF32[$$sroa$6$0$$sroa_idx16>>2] = $20;
  15003. $$sroa$7$0$$sroa_idx18 = ((($0)) + 16|0);
  15004. HEAPF32[$$sroa$7$0$$sroa_idx18>>2] = 0.0;
  15005. $$sroa$8$0$$sroa_idx20 = ((($0)) + 20|0);
  15006. HEAPF32[$$sroa$8$0$$sroa_idx20>>2] = $14;
  15007. $$sroa$9$0$$sroa_idx22 = ((($0)) + 24|0);
  15008. HEAPF32[$$sroa$9$0$$sroa_idx22>>2] = 0.0;
  15009. $$sroa$10$0$$sroa_idx24 = ((($0)) + 28|0);
  15010. HEAPF32[$$sroa$10$0$$sroa_idx24>>2] = $25;
  15011. $$sroa$11$0$$sroa_idx26 = ((($0)) + 32|0);
  15012. HEAPF32[$$sroa$11$0$$sroa_idx26>>2] = 0.0;
  15013. $$sroa$12$0$$sroa_idx28 = ((($0)) + 36|0);
  15014. HEAPF32[$$sroa$12$0$$sroa_idx28>>2] = 0.0;
  15015. $$sroa$13$0$$sroa_idx30 = ((($0)) + 40|0);
  15016. HEAPF32[$$sroa$13$0$$sroa_idx30>>2] = $15;
  15017. $$sroa$14$0$$sroa_idx32 = ((($0)) + 44|0);
  15018. HEAPF32[$$sroa$14$0$$sroa_idx32>>2] = $30;
  15019. $$sroa$15$0$$sroa_idx34 = ((($0)) + 48|0);
  15020. HEAPF32[$$sroa$15$0$$sroa_idx34>>2] = 0.0;
  15021. $$sroa$16$0$$sroa_idx36 = ((($0)) + 52|0);
  15022. HEAPF32[$$sroa$16$0$$sroa_idx36>>2] = 0.0;
  15023. $$sroa$17$0$$sroa_idx38 = ((($0)) + 56|0);
  15024. HEAPF32[$$sroa$17$0$$sroa_idx38>>2] = 0.0;
  15025. $$sroa$18$0$$sroa_idx40 = ((($0)) + 60|0);
  15026. HEAPF32[$$sroa$18$0$$sroa_idx40>>2] = 1.0;
  15027. return;
  15028. }
  15029. function _ProcessGestureEvent($0) {
  15030. $0 = $0|0;
  15031. 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;
  15032. 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;
  15033. 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;
  15034. 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;
  15035. 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;
  15036. 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;
  15037. 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;
  15038. 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;
  15039. 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;
  15040. var $moveDownPosition2$byval_copy12 = 0, $or$cond = 0, $or$cond3 = 0, $or$cond5 = 0, $or$cond7 = 0, $or$cond9 = 0, label = 0, sp = 0;
  15041. sp = STACKTOP;
  15042. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  15043. $moveDownPosition2$byval_copy12 = sp + 8|0;
  15044. $moveDownPosition$byval_copy11 = sp;
  15045. $1 = ((($0)) + 4|0);
  15046. $2 = HEAP32[$1>>2]|0;
  15047. HEAP32[7737] = $2;
  15048. $3 = ($2|0)<(2);
  15049. $4 = HEAP32[$0>>2]|0;
  15050. $5 = ($4|0)==(1);
  15051. if (!($3)) {
  15052. if ($5) {
  15053. $88 = ((($0)) + 24|0);
  15054. $89 = $88;
  15055. $90 = $89;
  15056. $91 = HEAP32[$90>>2]|0;
  15057. $92 = (($89) + 4)|0;
  15058. $93 = $92;
  15059. $94 = HEAP32[$93>>2]|0;
  15060. $95 = 13992;
  15061. $96 = $95;
  15062. HEAP32[$96>>2] = $91;
  15063. $97 = (($95) + 4)|0;
  15064. $98 = $97;
  15065. HEAP32[$98>>2] = $94;
  15066. $99 = ((($0)) + 32|0);
  15067. $100 = $99;
  15068. $101 = $100;
  15069. $102 = HEAP32[$101>>2]|0;
  15070. $103 = (($100) + 4)|0;
  15071. $104 = $103;
  15072. $105 = HEAP32[$104>>2]|0;
  15073. $106 = 14032;
  15074. $107 = $106;
  15075. HEAP32[$107>>2] = $102;
  15076. $108 = (($106) + 4)|0;
  15077. $109 = $108;
  15078. HEAP32[$109>>2] = $105;
  15079. $110 = +HEAPF32[3508];
  15080. $111 = +HEAPF32[3498];
  15081. $112 = $110 - $111;
  15082. HEAPF32[3510] = $112;
  15083. $113 = +HEAPF32[(14036)>>2];
  15084. $114 = +HEAPF32[(13996)>>2];
  15085. $115 = $113 - $114;
  15086. HEAPF32[(14044)>>2] = $115;
  15087. HEAP32[7736] = 4;
  15088. STACKTOP = sp;return;
  15089. }
  15090. switch ($4|0) {
  15091. case 2: {
  15092. ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14024>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14024+4>>2]|0;
  15093. ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14048>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14048+4>>2]|0;
  15094. $116 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
  15095. HEAPF32[7742] = $116;
  15096. $117 = 14024;
  15097. $118 = $117;
  15098. $119 = HEAP32[$118>>2]|0;
  15099. $120 = (($117) + 4)|0;
  15100. $121 = $120;
  15101. $122 = HEAP32[$121>>2]|0;
  15102. $123 = 13992;
  15103. $124 = $123;
  15104. HEAP32[$124>>2] = $119;
  15105. $125 = (($123) + 4)|0;
  15106. $126 = $125;
  15107. HEAP32[$126>>2] = $122;
  15108. $127 = 14048;
  15109. $128 = $127;
  15110. $129 = HEAP32[$128>>2]|0;
  15111. $130 = (($127) + 4)|0;
  15112. $131 = $130;
  15113. $132 = HEAP32[$131>>2]|0;
  15114. $133 = 14032;
  15115. $134 = $133;
  15116. HEAP32[$134>>2] = $129;
  15117. $135 = (($133) + 4)|0;
  15118. $136 = $135;
  15119. HEAP32[$136>>2] = $132;
  15120. $137 = ((($0)) + 24|0);
  15121. $138 = $137;
  15122. $139 = $138;
  15123. $140 = HEAP32[$139>>2]|0;
  15124. $141 = (($138) + 4)|0;
  15125. $142 = $141;
  15126. $143 = HEAP32[$142>>2]|0;
  15127. $144 = 14024;
  15128. $145 = $144;
  15129. HEAP32[$145>>2] = $140;
  15130. $146 = (($144) + 4)|0;
  15131. $147 = $146;
  15132. HEAP32[$147>>2] = $143;
  15133. $148 = ((($0)) + 32|0);
  15134. $149 = $148;
  15135. $150 = $149;
  15136. $151 = HEAP32[$150>>2]|0;
  15137. $152 = (($149) + 4)|0;
  15138. $153 = $152;
  15139. $154 = HEAP32[$153>>2]|0;
  15140. $155 = 14048;
  15141. $156 = $155;
  15142. HEAP32[$156>>2] = $151;
  15143. $157 = (($155) + 4)|0;
  15144. $158 = $157;
  15145. HEAP32[$158>>2] = $154;
  15146. $159 = +HEAPF32[3512];
  15147. $160 = +HEAPF32[3506];
  15148. $161 = $159 - $160;
  15149. HEAPF32[3510] = $161;
  15150. $162 = +HEAPF32[(14052)>>2];
  15151. $163 = +HEAPF32[(14028)>>2];
  15152. $164 = $162 - $163;
  15153. HEAPF32[(14044)>>2] = $164;
  15154. ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[13992>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[13992+4>>2]|0;
  15155. ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14024>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14024+4>>2]|0;
  15156. $165 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
  15157. $166 = !($165 >= 0.004999999888241291);
  15158. if ($166) {
  15159. ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14032>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14032+4>>2]|0;
  15160. ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14048>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14048+4>>2]|0;
  15161. $167 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
  15162. $168 = !($167 >= 0.004999999888241291);
  15163. if ($168) {
  15164. $$sink16 = 4;
  15165. } else {
  15166. label = 29;
  15167. }
  15168. } else {
  15169. label = 29;
  15170. }
  15171. if ((label|0) == 29) {
  15172. ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14024>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14024+4>>2]|0;
  15173. ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14048>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14048+4>>2]|0;
  15174. $169 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
  15175. $170 = +HEAPF32[7742];
  15176. $171 = $169 - $170;
  15177. $172 = $171 < 0.0;
  15178. $$sink11 = $172 ? 256 : 512;
  15179. $$sink16 = $$sink11;
  15180. }
  15181. HEAP32[7736] = $$sink16;
  15182. ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14024>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14024+4>>2]|0;
  15183. ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14048>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14048+4>>2]|0;
  15184. $173 = (+_Vector2Angle($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
  15185. $174 = 360.0 - $173;
  15186. HEAPF32[7743] = $174;
  15187. STACKTOP = sp;return;
  15188. break;
  15189. }
  15190. case 0: {
  15191. HEAPF32[7742] = 0.0;
  15192. HEAPF32[7743] = 0.0;
  15193. HEAPF32[3510] = 0.0;
  15194. HEAPF32[(14044)>>2] = 0.0;
  15195. HEAP32[7737] = 0;
  15196. HEAP32[7736] = 0;
  15197. STACKTOP = sp;return;
  15198. break;
  15199. }
  15200. default: {
  15201. STACKTOP = sp;return;
  15202. }
  15203. }
  15204. }
  15205. if ($5) {
  15206. $6 = HEAP32[7738]|0;
  15207. $7 = (($6) + 1)|0;
  15208. HEAP32[7738] = $7;
  15209. $8 = HEAP32[7736]|0;
  15210. $9 = ($8|0)==(0);
  15211. $10 = ($6|0)>(0);
  15212. $or$cond = $10 & $9;
  15213. if ($or$cond) {
  15214. $11 = ((($0)) + 24|0);
  15215. ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[13992>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[13992+4>>2]|0;
  15216. ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[$11>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[$11+4>>2]|0;
  15217. $12 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
  15218. $13 = $12 < 0.029999999329447746;
  15219. if ($13) {
  15220. HEAP32[7736] = 2;
  15221. HEAP32[7738] = 0;
  15222. } else {
  15223. label = 6;
  15224. }
  15225. } else {
  15226. label = 6;
  15227. }
  15228. if ((label|0) == 6) {
  15229. HEAP32[7738] = 1;
  15230. HEAP32[7736] = 1;
  15231. }
  15232. $14 = ((($0)) + 24|0);
  15233. $15 = $14;
  15234. $16 = $15;
  15235. $17 = HEAP32[$16>>2]|0;
  15236. $18 = (($15) + 4)|0;
  15237. $19 = $18;
  15238. $20 = HEAP32[$19>>2]|0;
  15239. $21 = 13992;
  15240. $22 = $21;
  15241. HEAP32[$22>>2] = $17;
  15242. $23 = (($21) + 4)|0;
  15243. $24 = $23;
  15244. HEAP32[$24>>2] = $20;
  15245. $25 = 14000;
  15246. $26 = $25;
  15247. HEAP32[$26>>2] = $17;
  15248. $27 = (($25) + 4)|0;
  15249. $28 = $27;
  15250. HEAP32[$28>>2] = $20;
  15251. $29 = 14008;
  15252. $30 = $29;
  15253. HEAP32[$30>>2] = $17;
  15254. $31 = (($29) + 4)|0;
  15255. $32 = $31;
  15256. HEAP32[$32>>2] = $20;
  15257. $33 = ((($0)) + 8|0);
  15258. $34 = HEAP32[$33>>2]|0;
  15259. HEAP32[6] = $34;
  15260. HEAPF32[3504] = 0.0;
  15261. HEAPF32[(14020)>>2] = 0.0;
  15262. STACKTOP = sp;return;
  15263. }
  15264. switch ($4|0) {
  15265. case 0: {
  15266. $35 = HEAP32[7736]|0;
  15267. $36 = ($35|0)==(8);
  15268. if ($36) {
  15269. $37 = ((($0)) + 24|0);
  15270. $38 = $37;
  15271. $39 = $38;
  15272. $40 = HEAP32[$39>>2]|0;
  15273. $41 = (($38) + 4)|0;
  15274. $42 = $41;
  15275. $43 = HEAP32[$42>>2]|0;
  15276. $44 = 14008;
  15277. $45 = $44;
  15278. HEAP32[$45>>2] = $40;
  15279. $46 = (($44) + 4)|0;
  15280. $47 = $46;
  15281. HEAP32[$47>>2] = $43;
  15282. }
  15283. ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[13992>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[13992+4>>2]|0;
  15284. ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14008>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14008+4>>2]|0;
  15285. $48 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
  15286. $49 = $48 / 0.0;
  15287. HEAPF32[7739] = $49;
  15288. HEAP32[7740] = 0;
  15289. $50 = $49 > 5.0000002374872565E-4;
  15290. if ($50) {
  15291. $51 = HEAP32[6]|0;
  15292. $52 = ((($0)) + 8|0);
  15293. $53 = HEAP32[$52>>2]|0;
  15294. $54 = ($51|0)==($53|0);
  15295. if ($54) {
  15296. ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[13992>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[13992+4>>2]|0;
  15297. ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14008>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14008+4>>2]|0;
  15298. $55 = (+_Vector2Angle($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
  15299. $56 = 360.0 - $55;
  15300. HEAPF32[7741] = $56;
  15301. $57 = $56 < 30.0;
  15302. $58 = $56 > 330.0;
  15303. $or$cond3 = $57 | $58;
  15304. if ($or$cond3) {
  15305. $$sink10 = 16;
  15306. } else {
  15307. $59 = $56 > 30.0;
  15308. $60 = $56 < 120.0;
  15309. $or$cond5 = $59 & $60;
  15310. if ($or$cond5) {
  15311. $$sink10 = 64;
  15312. } else {
  15313. $61 = $56 > 120.0;
  15314. $62 = $56 < 210.0;
  15315. $or$cond7 = $61 & $62;
  15316. $63 = $56 > 210.0;
  15317. $64 = $56 < 300.0;
  15318. $or$cond9 = $63 & $64;
  15319. $$sink = $or$cond9 ? 128 : 0;
  15320. $$$sink = $or$cond7 ? 32 : $$sink;
  15321. $$sink10 = $$$sink;
  15322. }
  15323. }
  15324. } else {
  15325. label = 16;
  15326. }
  15327. } else {
  15328. label = 16;
  15329. }
  15330. if ((label|0) == 16) {
  15331. HEAPF32[7739] = 0.0;
  15332. HEAPF32[7741] = 0.0;
  15333. $$sink10 = 0;
  15334. }
  15335. HEAP32[7736] = $$sink10;
  15336. HEAPF32[3500] = 0.0;
  15337. HEAPF32[(14004)>>2] = 0.0;
  15338. HEAP32[7737] = 0;
  15339. STACKTOP = sp;return;
  15340. break;
  15341. }
  15342. case 2: {
  15343. $65 = HEAP32[7740]|0;
  15344. $66 = ($65|0)==(0);
  15345. if ($66) {
  15346. HEAP32[7740] = 1;
  15347. }
  15348. $67 = ((($0)) + 24|0);
  15349. $68 = $67;
  15350. $69 = $68;
  15351. $70 = HEAP32[$69>>2]|0;
  15352. $71 = (($68) + 4)|0;
  15353. $72 = $71;
  15354. $73 = HEAP32[$72>>2]|0;
  15355. $74 = 14024;
  15356. $75 = $74;
  15357. HEAP32[$75>>2] = $70;
  15358. $76 = (($74) + 4)|0;
  15359. $77 = $76;
  15360. HEAP32[$77>>2] = $73;
  15361. $78 = HEAP32[7736]|0;
  15362. $79 = ($78|0)==(4);
  15363. if ($79) {
  15364. ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[13992>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[13992+4>>2]|0;
  15365. ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14024>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14024+4>>2]|0;
  15366. $80 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
  15367. $81 = !($80 >= 0.014999999664723873);
  15368. if (!($81)) {
  15369. HEAP32[7736] = 8;
  15370. }
  15371. }
  15372. $82 = +HEAPF32[3506];
  15373. $83 = +HEAPF32[3500];
  15374. $84 = $82 - $83;
  15375. HEAPF32[3504] = $84;
  15376. $85 = +HEAPF32[(14028)>>2];
  15377. $86 = +HEAPF32[(14004)>>2];
  15378. $87 = $85 - $86;
  15379. HEAPF32[(14020)>>2] = $87;
  15380. STACKTOP = sp;return;
  15381. break;
  15382. }
  15383. default: {
  15384. STACKTOP = sp;return;
  15385. }
  15386. }
  15387. }
  15388. function _UpdateGestures() {
  15389. 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;
  15390. sp = STACKTOP;
  15391. $0 = HEAP32[7736]|0;
  15392. $$off = (($0) + -1)|0;
  15393. $1 = ($$off>>>0)<(2);
  15394. $2 = HEAP32[7737]|0;
  15395. $3 = ($2|0)<(2);
  15396. $or$cond3 = $1 & $3;
  15397. if ($or$cond3) {
  15398. HEAP32[7736] = 4;
  15399. }
  15400. $4 = HEAP32[7736]|0;
  15401. $5 = (($4) + -16)|0;
  15402. $6 = $5 >>> 4;
  15403. $7 = $5 << 28;
  15404. $8 = $6 | $7;
  15405. switch ($8|0) {
  15406. case 0: case 1: case 3: case 7: {
  15407. break;
  15408. }
  15409. default: {
  15410. return;
  15411. }
  15412. }
  15413. HEAP32[7736] = 0;
  15414. return;
  15415. }
  15416. function _GetMousePosition($0) {
  15417. $0 = $0|0;
  15418. 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;
  15419. sp = STACKTOP;
  15420. $1 = 14056;
  15421. $2 = $1;
  15422. $3 = HEAP32[$2>>2]|0;
  15423. $4 = (($1) + 4)|0;
  15424. $5 = $4;
  15425. $6 = HEAP32[$5>>2]|0;
  15426. $7 = $0;
  15427. $8 = $7;
  15428. HEAP32[$8>>2] = $3;
  15429. $9 = (($7) + 4)|0;
  15430. $10 = $9;
  15431. HEAP32[$10>>2] = $6;
  15432. return;
  15433. }
  15434. function _GetScreenWidth() {
  15435. var $0 = 0, label = 0, sp = 0;
  15436. sp = STACKTOP;
  15437. $0 = HEAP32[7746]|0;
  15438. return ($0|0);
  15439. }
  15440. function _GetScreenHeight() {
  15441. var $0 = 0, label = 0, sp = 0;
  15442. sp = STACKTOP;
  15443. $0 = HEAP32[7745]|0;
  15444. return ($0|0);
  15445. }
  15446. function _InitWindow($0,$1,$2) {
  15447. $0 = $0|0;
  15448. $1 = $1|0;
  15449. $2 = $2|0;
  15450. 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;
  15451. sp = STACKTOP;
  15452. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  15453. $vararg_buffer = sp;
  15454. _TraceLog(0,3350,$vararg_buffer);
  15455. HEAP32[7748] = $2;
  15456. _InitGraphicsDevice($0,$1);
  15457. _LoadDefaultFont();
  15458. _InitTimer_10();
  15459. (_emscripten_set_fullscreenchange_callback((0|0),(0|0),1,(4|0))|0);
  15460. (_emscripten_set_keypress_callback((3379|0),(0|0),1,(5|0))|0);
  15461. (_emscripten_set_click_callback((3379|0),(0|0),1,(6|0))|0);
  15462. (_emscripten_set_touchstart_callback((3379|0),(0|0),1,(7|0))|0);
  15463. (_emscripten_set_touchend_callback((3379|0),(0|0),1,(7|0))|0);
  15464. (_emscripten_set_touchmove_callback((3379|0),(0|0),1,(7|0))|0);
  15465. (_emscripten_set_touchcancel_callback((3379|0),(0|0),1,(7|0))|0);
  15466. (_emscripten_set_gamepadconnected_callback((0|0),1,(8|0))|0);
  15467. (_emscripten_set_gamepaddisconnected_callback((0|0),1,(8|0))|0);
  15468. $3 = HEAP32[7746]|0;
  15469. $4 = (+($3|0));
  15470. $5 = $4 * 0.5;
  15471. HEAPF32[3514] = $5;
  15472. $6 = HEAP32[7745]|0;
  15473. $7 = (+($6|0));
  15474. $8 = $7 * 0.5;
  15475. HEAPF32[(14060)>>2] = $8;
  15476. $9 = HEAP32[7749]|0;
  15477. $10 = ($9|0)==(0);
  15478. if ($10) {
  15479. STACKTOP = sp;return;
  15480. }
  15481. _SetTargetFPS(60);
  15482. _LogoAnimation();
  15483. STACKTOP = sp;return;
  15484. }
  15485. function _TraceLog($0,$1,$varargs) {
  15486. $0 = $0|0;
  15487. $1 = $1|0;
  15488. $varargs = $varargs|0;
  15489. 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;
  15490. sp = STACKTOP;
  15491. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  15492. $2 = sp;
  15493. switch ($0|0) {
  15494. case 0: {
  15495. ;HEAP8[14096>>0]=HEAP8[7908>>0]|0;HEAP8[14096+1>>0]=HEAP8[7908+1>>0]|0;HEAP8[14096+2>>0]=HEAP8[7908+2>>0]|0;HEAP8[14096+3>>0]=HEAP8[7908+3>>0]|0;HEAP8[14096+4>>0]=HEAP8[7908+4>>0]|0;HEAP8[14096+5>>0]=HEAP8[7908+5>>0]|0;HEAP8[14096+6>>0]=HEAP8[7908+6>>0]|0;
  15496. break;
  15497. }
  15498. case 1: {
  15499. $3 = 14096;
  15500. $4 = $3;
  15501. HEAP32[$4>>2] = 1330795077;
  15502. $5 = (($3) + 4)|0;
  15503. $6 = $5;
  15504. HEAP32[$6>>2] = 2112082;
  15505. break;
  15506. }
  15507. case 2: {
  15508. dest=14096; src=7915; 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));
  15509. break;
  15510. }
  15511. case 3: {
  15512. $7 = 14096;
  15513. $8 = $7;
  15514. HEAP32[$8>>2] = 1430406468;
  15515. $9 = (($7) + 4)|0;
  15516. $10 = $9;
  15517. HEAP32[$10>>2] = 2112071;
  15518. break;
  15519. }
  15520. default: {
  15521. }
  15522. }
  15523. (_strcat(14096,$1)|0);
  15524. $strlen = (_strlen(14096)|0);
  15525. $endptr = (14096 + ($strlen)|0);
  15526. HEAP8[$endptr>>0]=10&255;HEAP8[$endptr+1>>0]=10>>8;
  15527. HEAP32[$2>>2] = $varargs;
  15528. $11 = ($0|0)==(3);
  15529. if ($11) {
  15530. STACKTOP = sp;return;
  15531. }
  15532. (_vprintf(14096,$2)|0);
  15533. $12 = ($0|0)==(1);
  15534. if ($12) {
  15535. _exit(1);
  15536. // unreachable;
  15537. } else {
  15538. STACKTOP = sp;return;
  15539. }
  15540. }
  15541. function _InitGraphicsDevice($0,$1) {
  15542. $0 = $0|0;
  15543. $1 = $1|0;
  15544. 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;
  15545. 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;
  15546. 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;
  15547. 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;
  15548. 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;
  15549. var label = 0, sp = 0, src = 0, stop = 0;
  15550. sp = STACKTOP;
  15551. STACKTOP = STACKTOP + 144|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(144|0);
  15552. $$byval_copy = sp + 136|0;
  15553. $vararg_buffer22 = sp + 64|0;
  15554. $vararg_buffer18 = sp + 56|0;
  15555. $vararg_buffer14 = sp + 48|0;
  15556. $vararg_buffer10 = sp + 40|0;
  15557. $vararg_buffer8 = sp + 32|0;
  15558. $vararg_buffer6 = sp + 24|0;
  15559. $vararg_buffer3 = sp + 16|0;
  15560. $vararg_buffer1 = sp + 8|0;
  15561. $vararg_buffer = sp;
  15562. $2 = sp + 72|0;
  15563. $3 = sp + 140|0;
  15564. HEAP32[7746] = $0;
  15565. HEAP32[7745] = $1;
  15566. _MatrixIdentity($2);
  15567. dest=31072; 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));
  15568. (_glfwSetErrorCallback((1|0))|0);
  15569. $4 = (_glfwInit()|0);
  15570. $5 = ($4|0)==(0);
  15571. if ($5) {
  15572. _TraceLog(1,4050,$vararg_buffer);
  15573. }
  15574. $6 = HEAP32[7746]|0;
  15575. HEAP32[7784] = $6;
  15576. $7 = HEAP32[7745]|0;
  15577. HEAP32[7785] = $7;
  15578. _glfwDefaultWindowHints();
  15579. $8 = HEAP8[35948]|0;
  15580. $9 = $8 & 4;
  15581. $10 = ($9<<24>>24)==(0);
  15582. if ($10) {
  15583. _glfwWindowHint(131075,0);
  15584. } else {
  15585. _glfwWindowHint(131075,1);
  15586. }
  15587. $11 = HEAP8[35948]|0;
  15588. $12 = $11 & 8;
  15589. $13 = ($12<<24>>24)==(0);
  15590. if (!($13)) {
  15591. _glfwWindowHint(131077,1);
  15592. }
  15593. $14 = HEAP8[35948]|0;
  15594. $15 = $14 & 32;
  15595. $16 = ($15<<24>>24)==(0);
  15596. if (!($16)) {
  15597. _glfwWindowHint(135181,4);
  15598. _TraceLog(0,4076,$vararg_buffer1);
  15599. }
  15600. $17 = (_rlGetVersion()|0);
  15601. $18 = ($17|0)==(2);
  15602. if ($18) {
  15603. _glfwWindowHint(139266,2);
  15604. _glfwWindowHint(139267,1);
  15605. } else {
  15606. $19 = (_rlGetVersion()|0);
  15607. $20 = ($19|0)==(3);
  15608. if ($20) {
  15609. _glfwWindowHint(139266,3);
  15610. _glfwWindowHint(139267,3);
  15611. _glfwWindowHint(139272,204801);
  15612. _glfwWindowHint(139270,0);
  15613. }
  15614. }
  15615. $21 = HEAP32[7786]|0;
  15616. $22 = ($21|0)==(0);
  15617. if ($22) {
  15618. $47 = HEAP32[7746]|0;
  15619. $48 = HEAP32[7745]|0;
  15620. $49 = HEAP32[7748]|0;
  15621. $50 = (_glfwCreateWindow(($47|0),($48|0),($49|0),(0|0),(0|0))|0);
  15622. HEAP32[7744] = $50;
  15623. $51 = HEAP32[7746]|0;
  15624. HEAP32[7787] = $51;
  15625. $52 = HEAP32[7745]|0;
  15626. HEAP32[7788] = $52;
  15627. $54 = $50;
  15628. } else {
  15629. $23 = (_glfwGetPrimaryMonitor()|0);
  15630. $24 = (_glfwGetVideoModes(($23|0),($$byval_copy|0))|0);
  15631. $25 = HEAP32[$$byval_copy>>2]|0;
  15632. $26 = ($25|0)>(0);
  15633. L22: do {
  15634. if ($26) {
  15635. $27 = HEAP32[7746]|0;
  15636. $28 = HEAP32[$$byval_copy>>2]|0;
  15637. $29 = HEAP32[7745]|0;
  15638. $$015 = 0;
  15639. while(1) {
  15640. $30 = (($24) + (($$015*24)|0)|0);
  15641. $31 = HEAP32[$30>>2]|0;
  15642. $32 = ($31|0)<($27|0);
  15643. if (!($32)) {
  15644. $33 = (((($24) + (($$015*24)|0)|0)) + 4|0);
  15645. $34 = HEAP32[$33>>2]|0;
  15646. $35 = ($34|0)<($29|0);
  15647. if (!($35)) {
  15648. break;
  15649. }
  15650. }
  15651. $36 = (($$015) + 1)|0;
  15652. $37 = ($36|0)<($28|0);
  15653. if ($37) {
  15654. $$015 = $36;
  15655. } else {
  15656. break L22;
  15657. }
  15658. }
  15659. HEAP32[7784] = $31;
  15660. HEAP32[7785] = $34;
  15661. }
  15662. } while(0);
  15663. $38 = HEAP32[7784]|0;
  15664. $39 = HEAP32[7785]|0;
  15665. HEAP32[$vararg_buffer3>>2] = $38;
  15666. $vararg_ptr5 = ((($vararg_buffer3)) + 4|0);
  15667. HEAP32[$vararg_ptr5>>2] = $39;
  15668. _TraceLog(2,4101,$vararg_buffer3);
  15669. $40 = HEAP32[7784]|0;
  15670. $41 = HEAP32[7785]|0;
  15671. _SetupFramebufferSize($40,$41);
  15672. $42 = HEAP32[7784]|0;
  15673. $43 = HEAP32[7785]|0;
  15674. $44 = HEAP32[7748]|0;
  15675. $45 = (_glfwGetPrimaryMonitor()|0);
  15676. $46 = (_glfwCreateWindow(($42|0),($43|0),($44|0),($45|0),(0|0))|0);
  15677. HEAP32[7744] = $46;
  15678. $54 = $46;
  15679. }
  15680. $53 = ($54|0)==(0|0);
  15681. if ($53) {
  15682. _glfwTerminate();
  15683. _TraceLog(1,4139,$vararg_buffer6);
  15684. } else {
  15685. _TraceLog(0,4172,$vararg_buffer8);
  15686. $55 = HEAP32[7787]|0;
  15687. $56 = HEAP32[7788]|0;
  15688. HEAP32[$vararg_buffer10>>2] = $55;
  15689. $vararg_ptr13 = ((($vararg_buffer10)) + 4|0);
  15690. HEAP32[$vararg_ptr13>>2] = $56;
  15691. _TraceLog(0,4212,$vararg_buffer10);
  15692. $57 = HEAP32[7746]|0;
  15693. $58 = HEAP32[7745]|0;
  15694. HEAP32[$vararg_buffer14>>2] = $57;
  15695. $vararg_ptr17 = ((($vararg_buffer14)) + 4|0);
  15696. HEAP32[$vararg_ptr17>>2] = $58;
  15697. _TraceLog(0,4233,$vararg_buffer14);
  15698. $59 = HEAP32[7789]|0;
  15699. $60 = HEAP32[7790]|0;
  15700. HEAP32[$vararg_buffer18>>2] = $59;
  15701. $vararg_ptr21 = ((($vararg_buffer18)) + 4|0);
  15702. HEAP32[$vararg_ptr21>>2] = $60;
  15703. _TraceLog(0,4254,$vararg_buffer18);
  15704. }
  15705. $61 = HEAP32[7744]|0;
  15706. (_glfwSetWindowSizeCallback(($61|0),(1|0))|0);
  15707. $62 = HEAP32[7744]|0;
  15708. (_glfwSetCursorEnterCallback(($62|0),(2|0))|0);
  15709. $63 = HEAP32[7744]|0;
  15710. (_glfwSetKeyCallback(($63|0),(1|0))|0);
  15711. $64 = HEAP32[7744]|0;
  15712. (_glfwSetMouseButtonCallback(($64|0),(1|0))|0);
  15713. $65 = HEAP32[7744]|0;
  15714. (_glfwSetCursorPosCallback(($65|0),(1|0))|0);
  15715. $66 = HEAP32[7744]|0;
  15716. (_glfwSetCharCallback(($66|0),(3|0))|0);
  15717. $67 = HEAP32[7744]|0;
  15718. (_glfwSetScrollCallback(($67|0),(2|0))|0);
  15719. $68 = HEAP32[7744]|0;
  15720. (_glfwSetWindowIconifyCallback(($68|0),(4|0))|0);
  15721. $69 = HEAP32[7744]|0;
  15722. _glfwMakeContextCurrent(($69|0));
  15723. _glfwSwapInterval(0);
  15724. $70 = HEAP8[35948]|0;
  15725. $71 = $70 & 64;
  15726. $72 = ($71<<24>>24)==(0);
  15727. if ($72) {
  15728. $73 = HEAP32[7746]|0;
  15729. $74 = HEAP32[7745]|0;
  15730. _rlglInit($73,$74);
  15731. _SetupViewport();
  15732. _rlMatrixMode(5889);
  15733. _rlLoadIdentity();
  15734. $75 = HEAP32[7787]|0;
  15735. $76 = HEAP32[7789]|0;
  15736. $77 = (($75) - ($76))|0;
  15737. $78 = (+($77|0));
  15738. $79 = HEAP32[7788]|0;
  15739. $80 = HEAP32[7790]|0;
  15740. $81 = (($79) - ($80))|0;
  15741. $82 = (+($81|0));
  15742. _rlOrtho(0.0,$78,$82,0.0,0.0,1.0);
  15743. _rlMatrixMode(5888);
  15744. _rlLoadIdentity();
  15745. HEAP8[$3>>0] = -11;
  15746. $83 = ((($3)) + 1|0);
  15747. HEAP8[$83>>0] = -11;
  15748. $84 = ((($3)) + 2|0);
  15749. HEAP8[$84>>0] = -11;
  15750. $85 = ((($3)) + 3|0);
  15751. HEAP8[$85>>0] = -1;
  15752. ;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;
  15753. _ClearBackground($$byval_copy);
  15754. STACKTOP = sp;return;
  15755. }
  15756. _glfwSwapInterval(1);
  15757. _TraceLog(0,4279,$vararg_buffer22);
  15758. $73 = HEAP32[7746]|0;
  15759. $74 = HEAP32[7745]|0;
  15760. _rlglInit($73,$74);
  15761. _SetupViewport();
  15762. _rlMatrixMode(5889);
  15763. _rlLoadIdentity();
  15764. $75 = HEAP32[7787]|0;
  15765. $76 = HEAP32[7789]|0;
  15766. $77 = (($75) - ($76))|0;
  15767. $78 = (+($77|0));
  15768. $79 = HEAP32[7788]|0;
  15769. $80 = HEAP32[7790]|0;
  15770. $81 = (($79) - ($80))|0;
  15771. $82 = (+($81|0));
  15772. _rlOrtho(0.0,$78,$82,0.0,0.0,1.0);
  15773. _rlMatrixMode(5888);
  15774. _rlLoadIdentity();
  15775. HEAP8[$3>>0] = -11;
  15776. $83 = ((($3)) + 1|0);
  15777. HEAP8[$83>>0] = -11;
  15778. $84 = ((($3)) + 2|0);
  15779. HEAP8[$84>>0] = -11;
  15780. $85 = ((($3)) + 3|0);
  15781. HEAP8[$85>>0] = -1;
  15782. ;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;
  15783. _ClearBackground($$byval_copy);
  15784. STACKTOP = sp;return;
  15785. }
  15786. function _LoadDefaultFont() {
  15787. 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;
  15788. 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;
  15789. 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;
  15790. var $vararg_buffer = 0, label = 0, sp = 0;
  15791. sp = STACKTOP;
  15792. STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
  15793. $$byval_copy1 = sp + 44|0;
  15794. $vararg_buffer = sp;
  15795. $0 = sp + 4|0;
  15796. $1 = sp + 24|0;
  15797. HEAP32[(31040)>>2] = 224;
  15798. $2 = (_malloc(65536)|0);
  15799. _memset(($2|0),0,65536)|0;
  15800. $$095104 = 0;$$096103 = 0;
  15801. while(1) {
  15802. $3 = (28 + ($$095104<<2)|0);
  15803. $4 = HEAP32[$3>>2]|0;
  15804. $$097102 = 31;
  15805. while(1) {
  15806. $16 = 1 << $$097102;
  15807. $17 = $4 & $16;
  15808. $18 = ($17|0)==(0);
  15809. if (!($18)) {
  15810. $19 = (($$097102) + ($$096103))|0;
  15811. $$sroa$0$0$$sroa_idx = (($2) + ($19<<2)|0);
  15812. 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;
  15813. }
  15814. $20 = (($$097102) + -1)|0;
  15815. $21 = ($$097102|0)>(0);
  15816. if ($21) {
  15817. $$097102 = $20;
  15818. } else {
  15819. break;
  15820. }
  15821. }
  15822. $12 = (($$095104) + 1)|0;
  15823. $13 = ($$095104|0)>(511);
  15824. $$ = $13 ? 0 : $12;
  15825. $14 = (($$096103) + 32)|0;
  15826. $15 = ($14|0)<(16384);
  15827. if ($15) {
  15828. $$095104 = $$;$$096103 = $14;
  15829. } else {
  15830. break;
  15831. }
  15832. }
  15833. _LoadImageEx($0,$2,128,128);
  15834. _ImageFormat($0,2);
  15835. _free($2);
  15836. ;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;
  15837. _LoadTextureFromImage($1,$$byval_copy1);
  15838. ;HEAP32[31016>>2]=HEAP32[$1>>2]|0;HEAP32[31016+4>>2]=HEAP32[$1+4>>2]|0;HEAP32[31016+8>>2]=HEAP32[$1+8>>2]|0;HEAP32[31016+12>>2]=HEAP32[$1+12>>2]|0;HEAP32[31016+16>>2]=HEAP32[$1+16>>2]|0;
  15839. ;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;
  15840. _UnloadImage($$byval_copy1);
  15841. $5 = HEAP32[(31040)>>2]|0;
  15842. $6 = $5 << 5;
  15843. $7 = (_malloc($6)|0);
  15844. HEAP32[(31044)>>2] = $7;
  15845. $8 = ($5|0)>(0);
  15846. if (!($8)) {
  15847. $$lcssa = $7;
  15848. $22 = ((($$lcssa)) + 16|0);
  15849. $23 = HEAP32[$22>>2]|0;
  15850. HEAP32[(31036)>>2] = $23;
  15851. $24 = HEAP32[7754]|0;
  15852. HEAP32[$vararg_buffer>>2] = $24;
  15853. _TraceLog(0,3574,$vararg_buffer);
  15854. STACKTOP = sp;return;
  15855. }
  15856. $9 = HEAP32[(31020)>>2]|0;
  15857. $10 = HEAP32[(31040)>>2]|0;
  15858. $11 = HEAP32[(31044)>>2]|0;
  15859. $$0101 = 0;$$090100 = 1;$$09299 = 0;$27 = $7;
  15860. while(1) {
  15861. $25 = (($$0101) + 32)|0;
  15862. $26 = (($27) + ($$0101<<5)|0);
  15863. HEAP32[$26>>2] = $25;
  15864. $28 = (((($27) + ($$0101<<5)|0)) + 4|0);
  15865. HEAP32[$28>>2] = $$090100;
  15866. $29 = ($$09299*11)|0;
  15867. $30 = (($29) + 1)|0;
  15868. $31 = (((($27) + ($$0101<<5)|0)) + 8|0);
  15869. HEAP32[$31>>2] = $30;
  15870. $32 = (2076 + ($$0101<<2)|0);
  15871. $33 = HEAP32[$32>>2]|0;
  15872. $34 = (((($27) + ($$0101<<5)|0)) + 12|0);
  15873. HEAP32[$34>>2] = $33;
  15874. $35 = (((($27) + ($$0101<<5)|0)) + 16|0);
  15875. HEAP32[$35>>2] = 10;
  15876. $36 = (($$090100) + 1)|0;
  15877. $37 = (($36) + ($33))|0;
  15878. $38 = ($37|0)<($9|0);
  15879. $39 = (($$09299) + 1)|0;
  15880. if ($38) {
  15881. $$191 = $37;$$193 = $$09299;
  15882. } else {
  15883. $40 = ($39*11)|0;
  15884. $41 = (($40) + 1)|0;
  15885. $42 = (($33) + 2)|0;
  15886. HEAP32[$28>>2] = 1;
  15887. HEAP32[$31>>2] = $41;
  15888. $$191 = $42;$$193 = $39;
  15889. }
  15890. $43 = (((($27) + ($$0101<<5)|0)) + 20|0);
  15891. HEAP32[$43>>2] = 0;
  15892. $44 = (((($27) + ($$0101<<5)|0)) + 24|0);
  15893. HEAP32[$44>>2] = 0;
  15894. $45 = (((($27) + ($$0101<<5)|0)) + 28|0);
  15895. HEAP32[$45>>2] = 0;
  15896. $46 = (($$0101) + 1)|0;
  15897. $47 = ($46|0)<($10|0);
  15898. if ($47) {
  15899. $$0101 = $46;$$090100 = $$191;$$09299 = $$193;$27 = $11;
  15900. } else {
  15901. $$lcssa = $11;
  15902. break;
  15903. }
  15904. }
  15905. $22 = ((($$lcssa)) + 16|0);
  15906. $23 = HEAP32[$22>>2]|0;
  15907. HEAP32[(31036)>>2] = $23;
  15908. $24 = HEAP32[7754]|0;
  15909. HEAP32[$vararg_buffer>>2] = $24;
  15910. _TraceLog(0,3574,$vararg_buffer);
  15911. STACKTOP = sp;return;
  15912. }
  15913. function _InitTimer_10() {
  15914. var $0 = 0, $1 = 0.0, label = 0, sp = 0;
  15915. sp = STACKTOP;
  15916. $0 = (_time((0|0))|0);
  15917. _srand($0);
  15918. $1 = (+_GetTime());
  15919. HEAPF64[1761] = $1;
  15920. return;
  15921. }
  15922. function _EmscriptenFullscreenChangeCallback($0,$1,$2) {
  15923. $0 = $0|0;
  15924. $1 = $1|0;
  15925. $2 = $2|0;
  15926. 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;
  15927. sp = STACKTOP;
  15928. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  15929. $vararg_buffer4 = sp + 16|0;
  15930. $vararg_buffer = sp;
  15931. $3 = HEAP32[$1>>2]|0;
  15932. $4 = ($3|0)==(0);
  15933. $5 = ((($1)) + 264|0);
  15934. $6 = HEAP32[$5>>2]|0;
  15935. $7 = ((($1)) + 268|0);
  15936. $8 = HEAP32[$7>>2]|0;
  15937. $9 = ((($1)) + 272|0);
  15938. $10 = HEAP32[$9>>2]|0;
  15939. $11 = ((($1)) + 276|0);
  15940. $12 = HEAP32[$11>>2]|0;
  15941. if ($4) {
  15942. HEAP32[$vararg_buffer4>>2] = $6;
  15943. $vararg_ptr7 = ((($vararg_buffer4)) + 4|0);
  15944. HEAP32[$vararg_ptr7>>2] = $8;
  15945. $vararg_ptr8 = ((($vararg_buffer4)) + 8|0);
  15946. HEAP32[$vararg_ptr8>>2] = $10;
  15947. $vararg_ptr9 = ((($vararg_buffer4)) + 12|0);
  15948. HEAP32[$vararg_ptr9>>2] = $12;
  15949. _TraceLog(0,3507,$vararg_buffer4);
  15950. STACKTOP = sp;return 0;
  15951. } else {
  15952. HEAP32[$vararg_buffer>>2] = $6;
  15953. $vararg_ptr1 = ((($vararg_buffer)) + 4|0);
  15954. HEAP32[$vararg_ptr1>>2] = $8;
  15955. $vararg_ptr2 = ((($vararg_buffer)) + 8|0);
  15956. HEAP32[$vararg_ptr2>>2] = $10;
  15957. $vararg_ptr3 = ((($vararg_buffer)) + 12|0);
  15958. HEAP32[$vararg_ptr3>>2] = $12;
  15959. _TraceLog(0,3438,$vararg_buffer);
  15960. STACKTOP = sp;return 0;
  15961. }
  15962. return (0)|0;
  15963. }
  15964. function _EmscriptenKeyboardCallback($0,$1,$2) {
  15965. $0 = $0|0;
  15966. $1 = $1|0;
  15967. $2 = $2|0;
  15968. var $3 = 0, $4 = 0, $5 = 0, $6 = 0, label = 0, sp = 0;
  15969. sp = STACKTOP;
  15970. $3 = ($0|0)==(1);
  15971. if (!($3)) {
  15972. return 0;
  15973. }
  15974. $4 = ((($1)) + 32|0);
  15975. $5 = (_strcmp($4,3431)|0);
  15976. $6 = ($5|0)==(0);
  15977. if (!($6)) {
  15978. return 0;
  15979. }
  15980. (_emscripten_exit_pointerlock()|0);
  15981. return 0;
  15982. }
  15983. function _EmscriptenMouseCallback($0,$1,$2) {
  15984. $0 = $0|0;
  15985. $1 = $1|0;
  15986. $2 = $2|0;
  15987. var $3 = 0, $4 = 0, $5 = 0, $6 = 0, label = 0, sp = 0;
  15988. sp = STACKTOP;
  15989. STACKTOP = STACKTOP + 272|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(272|0);
  15990. $3 = sp;
  15991. $4 = ($0|0)==(4);
  15992. if (!($4)) {
  15993. STACKTOP = sp;return 0;
  15994. }
  15995. (_emscripten_get_pointerlock_status(($3|0))|0);
  15996. $5 = HEAP32[$3>>2]|0;
  15997. $6 = ($5|0)==(0);
  15998. if ($6) {
  15999. (_emscripten_request_pointerlock((0|0),1)|0);
  16000. } else {
  16001. (_emscripten_exit_pointerlock()|0);
  16002. (_emscripten_get_pointerlock_status(($3|0))|0);
  16003. }
  16004. STACKTOP = sp;return 0;
  16005. }
  16006. function _EmscriptenTouchCallback($0,$1,$2) {
  16007. $0 = $0|0;
  16008. $1 = $1|0;
  16009. $2 = $2|0;
  16010. 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;
  16011. 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;
  16012. 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;
  16013. var $60 = 0.0, $61 = 0.0, $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  16014. sp = STACKTOP;
  16015. STACKTOP = STACKTOP + 112|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(112|0);
  16016. $$byval_copy = sp + 56|0;
  16017. $3 = sp;
  16018. switch ($0|0) {
  16019. case 22: {
  16020. $$sink = 1;
  16021. label = 4;
  16022. break;
  16023. }
  16024. case 23: {
  16025. $$sink = 0;
  16026. label = 4;
  16027. break;
  16028. }
  16029. case 24: {
  16030. $$sink = 2;
  16031. label = 4;
  16032. break;
  16033. }
  16034. default: {
  16035. }
  16036. }
  16037. if ((label|0) == 4) {
  16038. HEAP32[$3>>2] = $$sink;
  16039. }
  16040. $4 = HEAP32[$1>>2]|0;
  16041. $5 = ((($3)) + 4|0);
  16042. HEAP32[$5>>2] = $4;
  16043. $6 = ((($1)) + 20|0);
  16044. $7 = HEAP32[$6>>2]|0;
  16045. $8 = ((($3)) + 8|0);
  16046. HEAP32[$8>>2] = $7;
  16047. $9 = ((($1)) + 72|0);
  16048. $10 = HEAP32[$9>>2]|0;
  16049. $11 = ((($3)) + 12|0);
  16050. HEAP32[$11>>2] = $10;
  16051. $12 = ((($1)) + 56|0);
  16052. $13 = HEAP32[$12>>2]|0;
  16053. $14 = (+($13|0));
  16054. $15 = ((($1)) + 60|0);
  16055. $16 = HEAP32[$15>>2]|0;
  16056. $17 = (+($16|0));
  16057. $$sroa$03$0$$sroa_idx = ((($3)) + 24|0);
  16058. HEAPF32[$$sroa$03$0$$sroa_idx>>2] = $14;
  16059. $$sroa$24$0$$sroa_idx5 = ((($3)) + 28|0);
  16060. HEAPF32[$$sroa$24$0$$sroa_idx5>>2] = $17;
  16061. $18 = ((($1)) + 108|0);
  16062. $19 = HEAP32[$18>>2]|0;
  16063. $20 = (+($19|0));
  16064. $21 = ((($1)) + 112|0);
  16065. $22 = HEAP32[$21>>2]|0;
  16066. $23 = (+($22|0));
  16067. $$sroa$0$0$$sroa_idx = ((($3)) + 32|0);
  16068. HEAPF32[$$sroa$0$0$$sroa_idx>>2] = $20;
  16069. $$sroa$2$0$$sroa_idx2 = ((($3)) + 36|0);
  16070. HEAPF32[$$sroa$2$0$$sroa_idx2>>2] = $23;
  16071. $24 = ((($3)) + 24|0);
  16072. $25 = $24;
  16073. $26 = $25;
  16074. $27 = HEAP32[$26>>2]|0;
  16075. $28 = (($25) + 4)|0;
  16076. $29 = $28;
  16077. $30 = HEAP32[$29>>2]|0;
  16078. $31 = 14072;
  16079. $32 = $31;
  16080. HEAP32[$32>>2] = $27;
  16081. $33 = (($31) + 4)|0;
  16082. $34 = $33;
  16083. HEAP32[$34>>2] = $30;
  16084. $35 = ((($3)) + 32|0);
  16085. $36 = $35;
  16086. $37 = $36;
  16087. $38 = HEAP32[$37>>2]|0;
  16088. $39 = (($36) + 4)|0;
  16089. $40 = $39;
  16090. $41 = HEAP32[$40>>2]|0;
  16091. $42 = (14080);
  16092. $43 = $42;
  16093. HEAP32[$43>>2] = $38;
  16094. $44 = (($42) + 4)|0;
  16095. $45 = $44;
  16096. HEAP32[$45>>2] = $41;
  16097. $46 = (_GetScreenWidth()|0);
  16098. $47 = (+($46|0));
  16099. $48 = +HEAPF32[$24>>2];
  16100. $49 = $48 / $47;
  16101. HEAPF32[$24>>2] = $49;
  16102. $50 = (_GetScreenHeight()|0);
  16103. $51 = (+($50|0));
  16104. $52 = +HEAPF32[$$sroa$24$0$$sroa_idx5>>2];
  16105. $53 = $52 / $51;
  16106. HEAPF32[$$sroa$24$0$$sroa_idx5>>2] = $53;
  16107. $54 = (_GetScreenWidth()|0);
  16108. $55 = (+($54|0));
  16109. $56 = +HEAPF32[$35>>2];
  16110. $57 = $56 / $55;
  16111. HEAPF32[$35>>2] = $57;
  16112. $58 = (_GetScreenHeight()|0);
  16113. $59 = (+($58|0));
  16114. $60 = +HEAPF32[$$sroa$2$0$$sroa_idx2>>2];
  16115. $61 = $60 / $59;
  16116. HEAPF32[$$sroa$2$0$$sroa_idx2>>2] = $61;
  16117. 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));
  16118. _ProcessGestureEvent($$byval_copy);
  16119. STACKTOP = sp;return 1;
  16120. }
  16121. function _EmscriptenGamepadCallback($0,$1,$2) {
  16122. $0 = $0|0;
  16123. $1 = $1|0;
  16124. $2 = $2|0;
  16125. 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;
  16126. sp = STACKTOP;
  16127. $3 = ((($1)) + 1296|0);
  16128. $4 = HEAP32[$3>>2]|0;
  16129. $5 = ($4|0)==(0);
  16130. if ($5) {
  16131. label = 3;
  16132. } else {
  16133. $6 = ((($1)) + 1300|0);
  16134. $7 = HEAP32[$6>>2]|0;
  16135. $8 = ($7|0)<(4);
  16136. if ($8) {
  16137. $$sink = 1;
  16138. } else {
  16139. label = 3;
  16140. }
  16141. }
  16142. if ((label|0) == 3) {
  16143. $$sink = 0;
  16144. }
  16145. $9 = ((($1)) + 1300|0);
  16146. $10 = HEAP32[$9>>2]|0;
  16147. $11 = (31000 + ($10<<2)|0);
  16148. HEAP32[$11>>2] = $$sink;
  16149. return 0;
  16150. }
  16151. function _SetTargetFPS($0) {
  16152. $0 = $0|0;
  16153. 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;
  16154. sp = STACKTOP;
  16155. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  16156. $vararg_buffer = sp;
  16157. $1 = ($0|0)<(1);
  16158. $2 = (+($0|0));
  16159. $3 = 1.0 / $2;
  16160. $$ = $1 ? 0.0 : $3;
  16161. HEAPF64[1758] = $$;
  16162. $4 = $3;
  16163. $$op = $4 * 1000.0;
  16164. $5 = $$op;
  16165. $6 = $1 ? 0.0 : $5;
  16166. HEAPF64[$vararg_buffer>>3] = $6;
  16167. _TraceLog(0,3387,$vararg_buffer);
  16168. STACKTOP = sp;return;
  16169. }
  16170. function _LogoAnimation() {
  16171. var label = 0, sp = 0;
  16172. sp = STACKTOP;
  16173. HEAP32[7749] = 0;
  16174. return;
  16175. }
  16176. function _GetTime() {
  16177. var $0 = 0.0, label = 0, sp = 0;
  16178. sp = STACKTOP;
  16179. $0 = (+_glfwGetTime());
  16180. return (+$0);
  16181. }
  16182. function _LoadImageEx($0,$1,$2,$3) {
  16183. $0 = $0|0;
  16184. $1 = $1|0;
  16185. $2 = $2|0;
  16186. $3 = $3|0;
  16187. 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;
  16188. 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;
  16189. sp = STACKTOP;
  16190. $4 = $2 << 2;
  16191. $5 = Math_imul($4, $3)|0;
  16192. $6 = (_malloc($5)|0);
  16193. $7 = ($5|0)>(0);
  16194. if ($7) {
  16195. $8 = (($5) + -1)|0;
  16196. $9 = $8 >>> 2;
  16197. $$03334 = 0;$$035 = 0;
  16198. while(1) {
  16199. $10 = (($1) + ($$03334<<2)|0);
  16200. $11 = HEAP8[$10>>0]|0;
  16201. $12 = (($6) + ($$035)|0);
  16202. HEAP8[$12>>0] = $11;
  16203. $13 = (((($1) + ($$03334<<2)|0)) + 1|0);
  16204. $14 = HEAP8[$13>>0]|0;
  16205. $15 = $$035 | 1;
  16206. $16 = (($6) + ($15)|0);
  16207. HEAP8[$16>>0] = $14;
  16208. $17 = (((($1) + ($$03334<<2)|0)) + 2|0);
  16209. $18 = HEAP8[$17>>0]|0;
  16210. $19 = $$035 | 2;
  16211. $20 = (($6) + ($19)|0);
  16212. HEAP8[$20>>0] = $18;
  16213. $21 = (((($1) + ($$03334<<2)|0)) + 3|0);
  16214. $22 = HEAP8[$21>>0]|0;
  16215. $23 = $$035 | 3;
  16216. $24 = (($6) + ($23)|0);
  16217. HEAP8[$24>>0] = $22;
  16218. $25 = (($$03334) + 1)|0;
  16219. $26 = (($$035) + 4)|0;
  16220. $exitcond = ($$03334|0)==($9|0);
  16221. if ($exitcond) {
  16222. break;
  16223. } else {
  16224. $$03334 = $25;$$035 = $26;
  16225. }
  16226. }
  16227. }
  16228. HEAP32[$0>>2] = $6;
  16229. $$sroa$9$0$$sroa_idx18 = ((($0)) + 4|0);
  16230. HEAP32[$$sroa$9$0$$sroa_idx18>>2] = $2;
  16231. $$sroa$12$0$$sroa_idx21 = ((($0)) + 8|0);
  16232. HEAP32[$$sroa$12$0$$sroa_idx21>>2] = $3;
  16233. $$sroa$15$0$$sroa_idx24 = ((($0)) + 12|0);
  16234. HEAP32[$$sroa$15$0$$sroa_idx24>>2] = 1;
  16235. $$sroa$16$0$$sroa_idx26 = ((($0)) + 16|0);
  16236. HEAP32[$$sroa$16$0$$sroa_idx26>>2] = 7;
  16237. return;
  16238. }
  16239. function _ImageFormat($0,$1) {
  16240. $0 = $0|0;
  16241. $1 = $1|0;
  16242. 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;
  16243. 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;
  16244. 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;
  16245. 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;
  16246. 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;
  16247. 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;
  16248. 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;
  16249. 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;
  16250. 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;
  16251. 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;
  16252. 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;
  16253. 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;
  16254. 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;
  16255. 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;
  16256. 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;
  16257. 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;
  16258. sp = STACKTOP;
  16259. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  16260. $$byval_copy = sp + 4|0;
  16261. $vararg_buffer = sp;
  16262. $2 = ((($0)) + 16|0);
  16263. $3 = HEAP32[$2>>2]|0;
  16264. $4 = ($3|0)==($1|0);
  16265. if ($4) {
  16266. STACKTOP = sp;return;
  16267. }
  16268. $5 = ($3|0)<(8);
  16269. $6 = ($1|0)<(8);
  16270. $or$cond = $6 & $5;
  16271. if (!($or$cond)) {
  16272. _TraceLog(2,3950,$vararg_buffer);
  16273. STACKTOP = sp;return;
  16274. }
  16275. ;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;
  16276. $7 = (_GetImageData($$byval_copy)|0);
  16277. $8 = HEAP32[$0>>2]|0;
  16278. _free($8);
  16279. HEAP32[$2>>2] = $1;
  16280. switch ($1|0) {
  16281. case 1: {
  16282. $9 = ((($0)) + 4|0);
  16283. $10 = HEAP32[$9>>2]|0;
  16284. $11 = ((($0)) + 8|0);
  16285. $12 = HEAP32[$11>>2]|0;
  16286. $13 = Math_imul($12, $10)|0;
  16287. $14 = (_malloc($13)|0);
  16288. HEAP32[$0>>2] = $14;
  16289. $15 = Math_imul($12, $10)|0;
  16290. $16 = ($15|0)>(0);
  16291. if ($16) {
  16292. $$0171188 = 0;
  16293. while(1) {
  16294. $17 = (($7) + ($$0171188<<2)|0);
  16295. $18 = HEAP8[$17>>0]|0;
  16296. $19 = (+($18&255));
  16297. $20 = $19 * 0.29899999499320984;
  16298. $21 = (((($7) + ($$0171188<<2)|0)) + 1|0);
  16299. $22 = HEAP8[$21>>0]|0;
  16300. $23 = (+($22&255));
  16301. $24 = $23 * 0.58700001239776611;
  16302. $25 = $20 + $24;
  16303. $26 = (((($7) + ($$0171188<<2)|0)) + 2|0);
  16304. $27 = HEAP8[$26>>0]|0;
  16305. $28 = (+($27&255));
  16306. $29 = $28 * 0.11400000005960464;
  16307. $30 = $25 + $29;
  16308. $31 = (~~(($30))&255);
  16309. $32 = HEAP32[$0>>2]|0;
  16310. $33 = (($32) + ($$0171188)|0);
  16311. HEAP8[$33>>0] = $31;
  16312. $34 = (($$0171188) + 1)|0;
  16313. $35 = HEAP32[$9>>2]|0;
  16314. $36 = HEAP32[$11>>2]|0;
  16315. $37 = Math_imul($36, $35)|0;
  16316. $38 = ($34|0)<($37|0);
  16317. if ($38) {
  16318. $$0171188 = $34;
  16319. } else {
  16320. break;
  16321. }
  16322. }
  16323. }
  16324. break;
  16325. }
  16326. case 2: {
  16327. $39 = ((($0)) + 4|0);
  16328. $40 = HEAP32[$39>>2]|0;
  16329. $41 = ((($0)) + 8|0);
  16330. $42 = HEAP32[$41>>2]|0;
  16331. $43 = $40 << 1;
  16332. $44 = Math_imul($43, $42)|0;
  16333. $45 = (_malloc($44)|0);
  16334. HEAP32[$0>>2] = $45;
  16335. $46 = HEAP32[$39>>2]|0;
  16336. $47 = $46 << 1;
  16337. $48 = Math_imul($47, $42)|0;
  16338. $49 = ($48|0)>(0);
  16339. if ($49) {
  16340. $$0170190 = 0;$$0172189 = 0;
  16341. while(1) {
  16342. $50 = (($7) + ($$0172189<<2)|0);
  16343. $51 = HEAP8[$50>>0]|0;
  16344. $52 = (+($51&255));
  16345. $53 = $52 * 0.29899999499320984;
  16346. $54 = (((($7) + ($$0172189<<2)|0)) + 1|0);
  16347. $55 = HEAP8[$54>>0]|0;
  16348. $56 = (+($55&255));
  16349. $57 = $56 * 0.58700001239776611;
  16350. $58 = $53 + $57;
  16351. $59 = (((($7) + ($$0172189<<2)|0)) + 2|0);
  16352. $60 = HEAP8[$59>>0]|0;
  16353. $61 = (+($60&255));
  16354. $62 = $61 * 0.11400000005960464;
  16355. $63 = $58 + $62;
  16356. $64 = (~~(($63))&255);
  16357. $65 = HEAP32[$0>>2]|0;
  16358. $66 = (($65) + ($$0170190)|0);
  16359. HEAP8[$66>>0] = $64;
  16360. $67 = (((($7) + ($$0172189<<2)|0)) + 3|0);
  16361. $68 = HEAP8[$67>>0]|0;
  16362. $69 = HEAP32[$0>>2]|0;
  16363. $70 = $$0170190 | 1;
  16364. $71 = (($69) + ($70)|0);
  16365. HEAP8[$71>>0] = $68;
  16366. $72 = (($$0172189) + 1)|0;
  16367. $73 = (($$0170190) + 2)|0;
  16368. $74 = HEAP32[$39>>2]|0;
  16369. $75 = HEAP32[$41>>2]|0;
  16370. $76 = $74 << 1;
  16371. $77 = Math_imul($76, $75)|0;
  16372. $78 = ($73|0)<($77|0);
  16373. if ($78) {
  16374. $$0170190 = $73;$$0172189 = $72;
  16375. } else {
  16376. break;
  16377. }
  16378. }
  16379. }
  16380. break;
  16381. }
  16382. case 3: {
  16383. $79 = ((($0)) + 4|0);
  16384. $80 = HEAP32[$79>>2]|0;
  16385. $81 = ((($0)) + 8|0);
  16386. $82 = HEAP32[$81>>2]|0;
  16387. $83 = $80 << 1;
  16388. $84 = Math_imul($83, $82)|0;
  16389. $85 = (_malloc($84)|0);
  16390. HEAP32[$0>>2] = $85;
  16391. $86 = HEAP32[$79>>2]|0;
  16392. $87 = Math_imul($82, $86)|0;
  16393. $88 = ($87|0)>(0);
  16394. if ($88) {
  16395. $89 = HEAP8[$7>>0]|0;
  16396. $90 = (+($89&255));
  16397. $91 = $90 * 31.0;
  16398. $92 = $91 / 255.0;
  16399. $roundf179 = (+_roundf((+$92)));
  16400. $93 = (~~(($roundf179))&255);
  16401. $94 = ((($7)) + 1|0);
  16402. $95 = HEAP8[$94>>0]|0;
  16403. $96 = (+($95&255));
  16404. $97 = $96 * 63.0;
  16405. $98 = $97 / 255.0;
  16406. $roundf180 = (+_roundf((+$98)));
  16407. $99 = (~~(($roundf180))&255);
  16408. $100 = ((($7)) + 2|0);
  16409. $101 = HEAP8[$100>>0]|0;
  16410. $102 = (+($101&255));
  16411. $103 = $102 * 31.0;
  16412. $104 = $103 / 255.0;
  16413. $roundf181 = (+_roundf((+$104)));
  16414. $105 = (~~(($roundf181))&255);
  16415. $106 = $93&255;
  16416. $107 = $106 << 11;
  16417. $108 = $99&255;
  16418. $109 = $108 << 5;
  16419. $110 = $109 | $107;
  16420. $111 = $105&255;
  16421. $112 = $110 | $111;
  16422. $113 = $112&65535;
  16423. $114 = HEAP32[$0>>2]|0;
  16424. $115 = HEAP32[$79>>2]|0;
  16425. $116 = HEAP32[$81>>2]|0;
  16426. $117 = Math_imul($116, $115)|0;
  16427. $$0169192 = 0;
  16428. while(1) {
  16429. $118 = (($114) + ($$0169192<<1)|0);
  16430. HEAP16[$118>>1] = $113;
  16431. $119 = (($$0169192) + 1)|0;
  16432. $120 = ($119|0)<($117|0);
  16433. if ($120) {
  16434. $$0169192 = $119;
  16435. } else {
  16436. break;
  16437. }
  16438. }
  16439. }
  16440. break;
  16441. }
  16442. case 4: {
  16443. $121 = ((($0)) + 4|0);
  16444. $122 = HEAP32[$121>>2]|0;
  16445. $123 = ((($0)) + 8|0);
  16446. $124 = HEAP32[$123>>2]|0;
  16447. $125 = ($122*3)|0;
  16448. $126 = Math_imul($125, $124)|0;
  16449. $127 = (_malloc($126)|0);
  16450. HEAP32[$0>>2] = $127;
  16451. $128 = HEAP32[$121>>2]|0;
  16452. $129 = ($128*3)|0;
  16453. $130 = Math_imul($129, $124)|0;
  16454. $131 = ($130|0)>(0);
  16455. if ($131) {
  16456. $$0168195 = 0;$$1194 = 0;
  16457. while(1) {
  16458. $132 = (($7) + ($$1194<<2)|0);
  16459. $133 = HEAP8[$132>>0]|0;
  16460. $134 = HEAP32[$0>>2]|0;
  16461. $135 = (($134) + ($$0168195)|0);
  16462. HEAP8[$135>>0] = $133;
  16463. $136 = (((($7) + ($$1194<<2)|0)) + 1|0);
  16464. $137 = HEAP8[$136>>0]|0;
  16465. $138 = HEAP32[$0>>2]|0;
  16466. $139 = (($$0168195) + 1)|0;
  16467. $140 = (($138) + ($139)|0);
  16468. HEAP8[$140>>0] = $137;
  16469. $141 = (((($7) + ($$1194<<2)|0)) + 2|0);
  16470. $142 = HEAP8[$141>>0]|0;
  16471. $143 = HEAP32[$0>>2]|0;
  16472. $144 = (($$0168195) + 2)|0;
  16473. $145 = (($143) + ($144)|0);
  16474. HEAP8[$145>>0] = $142;
  16475. $146 = (($$1194) + 1)|0;
  16476. $147 = (($$0168195) + 3)|0;
  16477. $148 = HEAP32[$121>>2]|0;
  16478. $149 = HEAP32[$123>>2]|0;
  16479. $150 = ($148*3)|0;
  16480. $151 = Math_imul($150, $149)|0;
  16481. $152 = ($147|0)<($151|0);
  16482. if ($152) {
  16483. $$0168195 = $147;$$1194 = $146;
  16484. } else {
  16485. break;
  16486. }
  16487. }
  16488. }
  16489. break;
  16490. }
  16491. case 5: {
  16492. $153 = ((($0)) + 4|0);
  16493. $154 = HEAP32[$153>>2]|0;
  16494. $155 = ((($0)) + 8|0);
  16495. $156 = HEAP32[$155>>2]|0;
  16496. $157 = $154 << 1;
  16497. $158 = Math_imul($157, $156)|0;
  16498. $159 = (_malloc($158)|0);
  16499. HEAP32[$0>>2] = $159;
  16500. $160 = HEAP32[$153>>2]|0;
  16501. $161 = Math_imul($156, $160)|0;
  16502. $162 = ($161|0)>(0);
  16503. if ($162) {
  16504. $163 = HEAP32[$0>>2]|0;
  16505. $164 = HEAP32[$153>>2]|0;
  16506. $165 = HEAP32[$155>>2]|0;
  16507. $166 = Math_imul($165, $164)|0;
  16508. $$0167197 = 0;
  16509. while(1) {
  16510. $167 = (($7) + ($$0167197<<2)|0);
  16511. $168 = HEAP8[$167>>0]|0;
  16512. $169 = (+($168&255));
  16513. $170 = $169 * 31.0;
  16514. $171 = $170 / 255.0;
  16515. $roundf176 = (+_roundf((+$171)));
  16516. $172 = (~~(($roundf176))&255);
  16517. $173 = (((($7) + ($$0167197<<2)|0)) + 1|0);
  16518. $174 = HEAP8[$173>>0]|0;
  16519. $175 = (+($174&255));
  16520. $176 = $175 * 31.0;
  16521. $177 = $176 / 255.0;
  16522. $roundf177 = (+_roundf((+$177)));
  16523. $178 = (~~(($roundf177))&255);
  16524. $179 = (((($7) + ($$0167197<<2)|0)) + 2|0);
  16525. $180 = HEAP8[$179>>0]|0;
  16526. $181 = (+($180&255));
  16527. $182 = $181 * 31.0;
  16528. $183 = $182 / 255.0;
  16529. $roundf178 = (+_roundf((+$183)));
  16530. $184 = (~~(($roundf178))&255);
  16531. $185 = (((($7) + ($$0167197<<2)|0)) + 3|0);
  16532. $186 = HEAP8[$185>>0]|0;
  16533. $187 = ($186&255)>(50);
  16534. $188 = $172&255;
  16535. $189 = $188 << 11;
  16536. $190 = $178&255;
  16537. $191 = $190 << 6;
  16538. $192 = $191 | $189;
  16539. $193 = $184&255;
  16540. $194 = $193 << 1;
  16541. $195 = $192 | $194;
  16542. $196 = $187&1;
  16543. $197 = $195 | $196;
  16544. $198 = $197&65535;
  16545. $199 = (($163) + ($$0167197<<1)|0);
  16546. HEAP16[$199>>1] = $198;
  16547. $200 = (($$0167197) + 1)|0;
  16548. $201 = ($200|0)<($166|0);
  16549. if ($201) {
  16550. $$0167197 = $200;
  16551. } else {
  16552. break;
  16553. }
  16554. }
  16555. }
  16556. break;
  16557. }
  16558. case 6: {
  16559. $202 = ((($0)) + 4|0);
  16560. $203 = HEAP32[$202>>2]|0;
  16561. $204 = ((($0)) + 8|0);
  16562. $205 = HEAP32[$204>>2]|0;
  16563. $206 = $203 << 1;
  16564. $207 = Math_imul($206, $205)|0;
  16565. $208 = (_malloc($207)|0);
  16566. HEAP32[$0>>2] = $208;
  16567. $209 = HEAP32[$202>>2]|0;
  16568. $210 = Math_imul($205, $209)|0;
  16569. $211 = ($210|0)>(0);
  16570. if ($211) {
  16571. $212 = HEAP32[$0>>2]|0;
  16572. $213 = HEAP32[$202>>2]|0;
  16573. $214 = HEAP32[$204>>2]|0;
  16574. $215 = Math_imul($214, $213)|0;
  16575. $$0166199 = 0;
  16576. while(1) {
  16577. $216 = (($7) + ($$0166199<<2)|0);
  16578. $217 = HEAP8[$216>>0]|0;
  16579. $218 = (+($217&255));
  16580. $219 = $218 * 15.0;
  16581. $220 = $219 / 255.0;
  16582. $roundf = (+_roundf((+$220)));
  16583. $221 = (~~(($roundf))&255);
  16584. $222 = (((($7) + ($$0166199<<2)|0)) + 1|0);
  16585. $223 = HEAP8[$222>>0]|0;
  16586. $224 = (+($223&255));
  16587. $225 = $224 * 15.0;
  16588. $226 = $225 / 255.0;
  16589. $roundf173 = (+_roundf((+$226)));
  16590. $227 = (~~(($roundf173))&255);
  16591. $228 = (((($7) + ($$0166199<<2)|0)) + 2|0);
  16592. $229 = HEAP8[$228>>0]|0;
  16593. $230 = (+($229&255));
  16594. $231 = $230 * 15.0;
  16595. $232 = $231 / 255.0;
  16596. $roundf174 = (+_roundf((+$232)));
  16597. $233 = (~~(($roundf174))&255);
  16598. $234 = (((($7) + ($$0166199<<2)|0)) + 3|0);
  16599. $235 = HEAP8[$234>>0]|0;
  16600. $236 = (+($235&255));
  16601. $237 = $236 * 15.0;
  16602. $238 = $237 / 255.0;
  16603. $roundf175 = (+_roundf((+$238)));
  16604. $239 = (~~(($roundf175))&255);
  16605. $240 = $221&255;
  16606. $241 = $240 << 12;
  16607. $242 = $227&255;
  16608. $243 = $242 << 8;
  16609. $244 = $243 | $241;
  16610. $245 = $233&255;
  16611. $246 = $245 << 4;
  16612. $247 = $244 | $246;
  16613. $248 = $239&255;
  16614. $249 = $247 | $248;
  16615. $250 = $249&65535;
  16616. $251 = (($212) + ($$0166199<<1)|0);
  16617. HEAP16[$251>>1] = $250;
  16618. $252 = (($$0166199) + 1)|0;
  16619. $253 = ($252|0)<($215|0);
  16620. if ($253) {
  16621. $$0166199 = $252;
  16622. } else {
  16623. break;
  16624. }
  16625. }
  16626. }
  16627. break;
  16628. }
  16629. case 7: {
  16630. $254 = ((($0)) + 4|0);
  16631. $255 = HEAP32[$254>>2]|0;
  16632. $256 = ((($0)) + 8|0);
  16633. $257 = HEAP32[$256>>2]|0;
  16634. $258 = $255 << 2;
  16635. $259 = Math_imul($258, $257)|0;
  16636. $260 = (_malloc($259)|0);
  16637. HEAP32[$0>>2] = $260;
  16638. $261 = HEAP32[$254>>2]|0;
  16639. $262 = $261 << 2;
  16640. $263 = Math_imul($262, $257)|0;
  16641. $264 = ($263|0)>(0);
  16642. if ($264) {
  16643. $$0202 = 0;$$2201 = 0;
  16644. while(1) {
  16645. $265 = (($7) + ($$2201<<2)|0);
  16646. $266 = HEAP8[$265>>0]|0;
  16647. $267 = HEAP32[$0>>2]|0;
  16648. $268 = (($267) + ($$0202)|0);
  16649. HEAP8[$268>>0] = $266;
  16650. $269 = (((($7) + ($$2201<<2)|0)) + 1|0);
  16651. $270 = HEAP8[$269>>0]|0;
  16652. $271 = HEAP32[$0>>2]|0;
  16653. $272 = $$0202 | 1;
  16654. $273 = (($271) + ($272)|0);
  16655. HEAP8[$273>>0] = $270;
  16656. $274 = (((($7) + ($$2201<<2)|0)) + 2|0);
  16657. $275 = HEAP8[$274>>0]|0;
  16658. $276 = HEAP32[$0>>2]|0;
  16659. $277 = $$0202 | 2;
  16660. $278 = (($276) + ($277)|0);
  16661. HEAP8[$278>>0] = $275;
  16662. $279 = (((($7) + ($$2201<<2)|0)) + 3|0);
  16663. $280 = HEAP8[$279>>0]|0;
  16664. $281 = HEAP32[$0>>2]|0;
  16665. $282 = $$0202 | 3;
  16666. $283 = (($281) + ($282)|0);
  16667. HEAP8[$283>>0] = $280;
  16668. $284 = (($$2201) + 1)|0;
  16669. $285 = (($$0202) + 4)|0;
  16670. $286 = HEAP32[$254>>2]|0;
  16671. $287 = HEAP32[$256>>2]|0;
  16672. $288 = $286 << 2;
  16673. $289 = Math_imul($288, $287)|0;
  16674. $290 = ($285|0)<($289|0);
  16675. if ($290) {
  16676. $$0202 = $285;$$2201 = $284;
  16677. } else {
  16678. break;
  16679. }
  16680. }
  16681. }
  16682. break;
  16683. }
  16684. default: {
  16685. }
  16686. }
  16687. _free($7);
  16688. STACKTOP = sp;return;
  16689. }
  16690. function _LoadTextureFromImage($0,$1) {
  16691. $0 = $0|0;
  16692. $1 = $1|0;
  16693. 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;
  16694. sp = STACKTOP;
  16695. $2 = HEAP32[$1>>2]|0;
  16696. $3 = ((($1)) + 4|0);
  16697. $4 = HEAP32[$3>>2]|0;
  16698. $5 = ((($1)) + 8|0);
  16699. $6 = HEAP32[$5>>2]|0;
  16700. $7 = ((($1)) + 16|0);
  16701. $8 = HEAP32[$7>>2]|0;
  16702. $9 = ((($1)) + 12|0);
  16703. $10 = HEAP32[$9>>2]|0;
  16704. $11 = (_rlglLoadTexture($2,$4,$6,$8,$10)|0);
  16705. $12 = HEAP32[$3>>2]|0;
  16706. $13 = HEAP32[$5>>2]|0;
  16707. HEAP32[$0>>2] = $11;
  16708. $$sroa$5$0$$sroa_idx2 = ((($0)) + 4|0);
  16709. HEAP32[$$sroa$5$0$$sroa_idx2>>2] = $12;
  16710. $$sroa$7$0$$sroa_idx4 = ((($0)) + 8|0);
  16711. HEAP32[$$sroa$7$0$$sroa_idx4>>2] = $13;
  16712. $$sroa$9$0$$sroa_idx6 = ((($0)) + 12|0);
  16713. HEAP32[$$sroa$9$0$$sroa_idx6>>2] = $10;
  16714. $$sroa$11$0$$sroa_idx8 = ((($0)) + 16|0);
  16715. HEAP32[$$sroa$11$0$$sroa_idx8>>2] = $8;
  16716. return;
  16717. }
  16718. function _UnloadImage($0) {
  16719. $0 = $0|0;
  16720. var $1 = 0, label = 0, sp = 0;
  16721. sp = STACKTOP;
  16722. $1 = HEAP32[$0>>2]|0;
  16723. _free($1);
  16724. return;
  16725. }
  16726. function _rlglLoadTexture($0,$1,$2,$3,$4) {
  16727. $0 = $0|0;
  16728. $1 = $1|0;
  16729. $2 = $2|0;
  16730. $3 = $3|0;
  16731. $4 = $4|0;
  16732. 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;
  16733. 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;
  16734. 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;
  16735. var $vararg_buffer9 = 0, $vararg_ptr13 = 0, $vararg_ptr14 = 0, label = 0, sp = 0;
  16736. sp = STACKTOP;
  16737. STACKTOP = STACKTOP + 80|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(80|0);
  16738. $vararg_buffer15 = sp + 64|0;
  16739. $vararg_buffer11 = sp + 48|0;
  16740. $vararg_buffer9 = sp + 40|0;
  16741. $vararg_buffer7 = sp + 32|0;
  16742. $vararg_buffer5 = sp + 24|0;
  16743. $vararg_buffer3 = sp + 16|0;
  16744. $vararg_buffer1 = sp + 8|0;
  16745. $vararg_buffer = sp;
  16746. $5 = sp + 68|0;
  16747. _glBindTexture(3553,0);
  16748. HEAP32[$5>>2] = 0;
  16749. $6 = HEAP32[7762]|0;
  16750. $7 = ($6|0)==(0);
  16751. $8 = $3 & -4;
  16752. $switch = ($8|0)==(8);
  16753. $or$cond100 = $switch & $7;
  16754. if ($or$cond100) {
  16755. _TraceLog(2,3619,$vararg_buffer);
  16756. $$0 = HEAP32[$5>>2]|0;
  16757. STACKTOP = sp;return ($$0|0);
  16758. }
  16759. $9 = HEAP32[7763]|0;
  16760. $10 = ($9|0)==(0);
  16761. $11 = ($3|0)==(12);
  16762. $or$cond7 = $11 & $10;
  16763. if ($or$cond7) {
  16764. _TraceLog(2,3663,$vararg_buffer1);
  16765. $$0 = HEAP32[$5>>2]|0;
  16766. STACKTOP = sp;return ($$0|0);
  16767. }
  16768. $12 = HEAP32[7764]|0;
  16769. $13 = ($12|0)==(0);
  16770. $$off = (($3) + -13)|0;
  16771. $14 = ($$off>>>0)<(2);
  16772. $or$cond = $14 & $13;
  16773. if ($or$cond) {
  16774. _TraceLog(2,3708,$vararg_buffer3);
  16775. $$0 = HEAP32[$5>>2]|0;
  16776. STACKTOP = sp;return ($$0|0);
  16777. }
  16778. $15 = HEAP32[7765]|0;
  16779. $16 = ($15|0)==(0);
  16780. $$off92 = (($3) + -15)|0;
  16781. $17 = ($$off92>>>0)<(2);
  16782. $or$cond96 = $17 & $16;
  16783. if ($or$cond96) {
  16784. _TraceLog(2,3753,$vararg_buffer5);
  16785. $$0 = HEAP32[$5>>2]|0;
  16786. STACKTOP = sp;return ($$0|0);
  16787. }
  16788. $18 = HEAP32[7766]|0;
  16789. $19 = ($18|0)==(0);
  16790. $$off93 = (($3) + -17)|0;
  16791. $20 = ($$off93>>>0)<(2);
  16792. $or$cond98 = $20 & $19;
  16793. if ($or$cond98) {
  16794. _TraceLog(2,3798,$vararg_buffer7);
  16795. $$0 = HEAP32[$5>>2]|0;
  16796. STACKTOP = sp;return ($$0|0);
  16797. }
  16798. _glGenTextures(1,($5|0));
  16799. $21 = HEAP32[$5>>2]|0;
  16800. _glBindTexture(3553,($21|0));
  16801. do {
  16802. switch ($3|0) {
  16803. case 1: {
  16804. _glTexImage2D(3553,0,6409,($1|0),($2|0),0,6409,5121,($0|0));
  16805. break;
  16806. }
  16807. case 2: {
  16808. _glTexImage2D(3553,0,6410,($1|0),($2|0),0,6410,5121,($0|0));
  16809. break;
  16810. }
  16811. case 3: {
  16812. _glTexImage2D(3553,0,6407,($1|0),($2|0),0,6407,33635,($0|0));
  16813. break;
  16814. }
  16815. case 4: {
  16816. _glTexImage2D(3553,0,6407,($1|0),($2|0),0,6407,5121,($0|0));
  16817. break;
  16818. }
  16819. case 5: {
  16820. _glTexImage2D(3553,0,6408,($1|0),($2|0),0,6408,32820,($0|0));
  16821. break;
  16822. }
  16823. case 6: {
  16824. _glTexImage2D(3553,0,6408,($1|0),($2|0),0,6408,32819,($0|0));
  16825. break;
  16826. }
  16827. case 7: {
  16828. _glTexImage2D(3553,0,6408,($1|0),($2|0),0,6408,5121,($0|0));
  16829. break;
  16830. }
  16831. case 8: {
  16832. $22 = HEAP32[7762]|0;
  16833. $23 = ($22|0)==(0);
  16834. if (!($23)) {
  16835. _LoadCompressedTexture($0,$1,$2,$4,33776);
  16836. }
  16837. break;
  16838. }
  16839. case 9: {
  16840. $24 = HEAP32[7762]|0;
  16841. $25 = ($24|0)==(0);
  16842. if (!($25)) {
  16843. _LoadCompressedTexture($0,$1,$2,$4,33777);
  16844. }
  16845. break;
  16846. }
  16847. case 10: {
  16848. $26 = HEAP32[7762]|0;
  16849. $27 = ($26|0)==(0);
  16850. if (!($27)) {
  16851. _LoadCompressedTexture($0,$1,$2,$4,33778);
  16852. }
  16853. break;
  16854. }
  16855. case 11: {
  16856. $28 = HEAP32[7762]|0;
  16857. $29 = ($28|0)==(0);
  16858. if (!($29)) {
  16859. _LoadCompressedTexture($0,$1,$2,$4,33779);
  16860. }
  16861. break;
  16862. }
  16863. case 12: {
  16864. $30 = HEAP32[7763]|0;
  16865. $31 = ($30|0)==(0);
  16866. if (!($31)) {
  16867. _LoadCompressedTexture($0,$1,$2,$4,36196);
  16868. }
  16869. break;
  16870. }
  16871. case 13: {
  16872. $32 = HEAP32[7764]|0;
  16873. $33 = ($32|0)==(0);
  16874. if (!($33)) {
  16875. _LoadCompressedTexture($0,$1,$2,$4,37492);
  16876. }
  16877. break;
  16878. }
  16879. case 14: {
  16880. $34 = HEAP32[7764]|0;
  16881. $35 = ($34|0)==(0);
  16882. if (!($35)) {
  16883. _LoadCompressedTexture($0,$1,$2,$4,37496);
  16884. }
  16885. break;
  16886. }
  16887. case 15: {
  16888. $36 = HEAP32[7765]|0;
  16889. $37 = ($36|0)==(0);
  16890. if (!($37)) {
  16891. _LoadCompressedTexture($0,$1,$2,$4,35840);
  16892. }
  16893. break;
  16894. }
  16895. case 16: {
  16896. $38 = HEAP32[7765]|0;
  16897. $39 = ($38|0)==(0);
  16898. if (!($39)) {
  16899. _LoadCompressedTexture($0,$1,$2,$4,35842);
  16900. }
  16901. break;
  16902. }
  16903. case 17: {
  16904. $40 = HEAP32[7766]|0;
  16905. $41 = ($40|0)==(0);
  16906. if (!($41)) {
  16907. _LoadCompressedTexture($0,$1,$2,$4,37808);
  16908. }
  16909. break;
  16910. }
  16911. case 18: {
  16912. $42 = HEAP32[7766]|0;
  16913. $43 = ($42|0)==(0);
  16914. if (!($43)) {
  16915. _LoadCompressedTexture($0,$1,$2,$4,37815);
  16916. }
  16917. break;
  16918. }
  16919. default: {
  16920. _TraceLog(2,3843,$vararg_buffer9);
  16921. }
  16922. }
  16923. } while(0);
  16924. $44 = HEAP32[7767]|0;
  16925. $45 = ($44|0)==(0);
  16926. if ($45) {
  16927. _glTexParameteri(3553,10242,33071);
  16928. _glTexParameteri(3553,10243,33071);
  16929. } else {
  16930. _glTexParameteri(3553,10242,10497);
  16931. _glTexParameteri(3553,10243,10497);
  16932. }
  16933. _glTexParameteri(3553,10240,9728);
  16934. _glTexParameteri(3553,10241,9728);
  16935. _glBindTexture(3553,0);
  16936. $46 = HEAP32[$5>>2]|0;
  16937. $47 = ($46|0)==(0);
  16938. if ($47) {
  16939. _TraceLog(2,3921,$vararg_buffer15);
  16940. $$0 = HEAP32[$5>>2]|0;
  16941. STACKTOP = sp;return ($$0|0);
  16942. } else {
  16943. HEAP32[$vararg_buffer11>>2] = $46;
  16944. $vararg_ptr13 = ((($vararg_buffer11)) + 4|0);
  16945. HEAP32[$vararg_ptr13>>2] = $1;
  16946. $vararg_ptr14 = ((($vararg_buffer11)) + 8|0);
  16947. HEAP32[$vararg_ptr14>>2] = $2;
  16948. _TraceLog(0,3872,$vararg_buffer11);
  16949. $$0 = HEAP32[$5>>2]|0;
  16950. STACKTOP = sp;return ($$0|0);
  16951. }
  16952. return (0)|0;
  16953. }
  16954. function _LoadCompressedTexture($0,$1,$2,$3,$4) {
  16955. $0 = $0|0;
  16956. $1 = $1|0;
  16957. $2 = $2|0;
  16958. $3 = $3|0;
  16959. $4 = $4|0;
  16960. 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;
  16961. var $23 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, $or$cond42 = 0, label = 0, sp = 0;
  16962. sp = STACKTOP;
  16963. _glPixelStorei(3317,1);
  16964. switch ($4|0) {
  16965. case 33776: case 33777: case 36196: case 37492: {
  16966. $$038 = 8;
  16967. break;
  16968. }
  16969. default: {
  16970. $$038 = 16;
  16971. }
  16972. }
  16973. $5 = ($3|0)<(1);
  16974. $6 = $1 | $2;
  16975. $7 = ($6|0)==(0);
  16976. $or$cond42 = $5 | $7;
  16977. if ($or$cond42) {
  16978. return;
  16979. } else {
  16980. $$03645 = 0;$$03744 = 0;$$03943 = $2;$$046 = $1;
  16981. }
  16982. while(1) {
  16983. $8 = (($$046) + 3)|0;
  16984. $9 = (($8|0) / 4)&-1;
  16985. $10 = (($$03943) + 3)|0;
  16986. $11 = (($10|0) / 4)&-1;
  16987. $12 = Math_imul($11, $$038)|0;
  16988. $13 = Math_imul($12, $9)|0;
  16989. $14 = (($0) + ($$03744)|0);
  16990. _glCompressedTexImage2D(3553,($$03645|0),($4|0),($$046|0),($$03943|0),0,($13|0),($14|0));
  16991. $15 = (($13) + ($$03744))|0;
  16992. $16 = (($$046|0) / 2)&-1;
  16993. $17 = (($$03943|0) / 2)&-1;
  16994. $18 = ($$046|0)<(2);
  16995. $$ = $18 ? 1 : $16;
  16996. $19 = ($$03943|0)<(2);
  16997. $$140 = $19 ? 1 : $17;
  16998. $20 = (($$03645) + 1)|0;
  16999. $21 = ($20|0)>=($3|0);
  17000. $22 = $$ | $$140;
  17001. $23 = ($22|0)==(0);
  17002. $or$cond = $21 | $23;
  17003. if ($or$cond) {
  17004. break;
  17005. } else {
  17006. $$03645 = $20;$$03744 = $15;$$03943 = $$140;$$046 = $$;
  17007. }
  17008. }
  17009. return;
  17010. }
  17011. function _GetImageData($0) {
  17012. $0 = $0|0;
  17013. 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;
  17014. 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;
  17015. 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;
  17016. 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;
  17017. 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;
  17018. 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;
  17019. 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;
  17020. var $97 = 0.0, $98 = 0.0, $99 = 0, $vararg_buffer = 0, label = 0, sp = 0;
  17021. sp = STACKTOP;
  17022. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  17023. $vararg_buffer = sp;
  17024. $1 = ((($0)) + 4|0);
  17025. $2 = HEAP32[$1>>2]|0;
  17026. $3 = ((($0)) + 8|0);
  17027. $4 = HEAP32[$3>>2]|0;
  17028. $5 = $2 << 2;
  17029. $6 = Math_imul($5, $4)|0;
  17030. $7 = (_malloc($6)|0);
  17031. $8 = HEAP32[$1>>2]|0;
  17032. $9 = Math_imul($4, $8)|0;
  17033. $10 = ($9|0)>(0);
  17034. if (!($10)) {
  17035. STACKTOP = sp;return ($7|0);
  17036. }
  17037. $11 = ((($0)) + 16|0);
  17038. $12 = HEAP32[$11>>2]|0;
  17039. $13 = HEAP32[$0>>2]|0;
  17040. $$0104105 = 0;$$0106 = 0;
  17041. while(1) {
  17042. switch ($12|0) {
  17043. case 1: {
  17044. $14 = (($13) + ($$0106)|0);
  17045. $15 = HEAP8[$14>>0]|0;
  17046. $16 = (($7) + ($$0104105<<2)|0);
  17047. HEAP8[$16>>0] = $15;
  17048. $17 = HEAP8[$14>>0]|0;
  17049. $18 = (((($7) + ($$0104105<<2)|0)) + 1|0);
  17050. HEAP8[$18>>0] = $17;
  17051. $19 = HEAP8[$14>>0]|0;
  17052. $20 = (((($7) + ($$0104105<<2)|0)) + 2|0);
  17053. HEAP8[$20>>0] = $19;
  17054. $21 = (((($7) + ($$0104105<<2)|0)) + 3|0);
  17055. HEAP8[$21>>0] = -1;
  17056. $22 = (($$0106) + 1)|0;
  17057. $$1 = $22;
  17058. break;
  17059. }
  17060. case 2: {
  17061. $23 = (($13) + ($$0106)|0);
  17062. $24 = HEAP8[$23>>0]|0;
  17063. $25 = (($7) + ($$0104105<<2)|0);
  17064. HEAP8[$25>>0] = $24;
  17065. $26 = HEAP8[$23>>0]|0;
  17066. $27 = (((($7) + ($$0104105<<2)|0)) + 1|0);
  17067. HEAP8[$27>>0] = $26;
  17068. $28 = HEAP8[$23>>0]|0;
  17069. $29 = (((($7) + ($$0104105<<2)|0)) + 2|0);
  17070. HEAP8[$29>>0] = $28;
  17071. $30 = (($$0106) + 1)|0;
  17072. $31 = (($13) + ($30)|0);
  17073. $32 = HEAP8[$31>>0]|0;
  17074. $33 = (((($7) + ($$0104105<<2)|0)) + 3|0);
  17075. HEAP8[$33>>0] = $32;
  17076. $34 = (($$0106) + 2)|0;
  17077. $$1 = $34;
  17078. break;
  17079. }
  17080. case 5: {
  17081. $35 = (($13) + ($$0106<<1)|0);
  17082. $36 = HEAP16[$35>>1]|0;
  17083. $37 = $36&65535;
  17084. $38 = $37 >>> 11;
  17085. $39 = (+($38|0));
  17086. $40 = $39 * 8.0;
  17087. $41 = (~~(($40))&255);
  17088. $42 = (($7) + ($$0104105<<2)|0);
  17089. HEAP8[$42>>0] = $41;
  17090. $43 = $37 >>> 6;
  17091. $44 = $43 & 31;
  17092. $45 = (+($44|0));
  17093. $46 = $45 * 8.0;
  17094. $47 = (~~(($46))&255);
  17095. $48 = (((($7) + ($$0104105<<2)|0)) + 1|0);
  17096. HEAP8[$48>>0] = $47;
  17097. $49 = $37 >>> 1;
  17098. $50 = $49 & 31;
  17099. $51 = (+($50|0));
  17100. $52 = $51 * 8.0;
  17101. $53 = (~~(($52))&255);
  17102. $54 = (((($7) + ($$0104105<<2)|0)) + 2|0);
  17103. HEAP8[$54>>0] = $53;
  17104. $55 = $37 & 1;
  17105. $56 = (0 - ($55))|0;
  17106. $57 = $56&255;
  17107. $58 = (((($7) + ($$0104105<<2)|0)) + 3|0);
  17108. HEAP8[$58>>0] = $57;
  17109. $59 = (($$0106) + 1)|0;
  17110. $$1 = $59;
  17111. break;
  17112. }
  17113. case 3: {
  17114. $60 = (($13) + ($$0106<<1)|0);
  17115. $61 = HEAP16[$60>>1]|0;
  17116. $62 = $61&65535;
  17117. $63 = $62 >>> 11;
  17118. $64 = (+($63|0));
  17119. $65 = $64 * 8.0;
  17120. $66 = (~~(($65))&255);
  17121. $67 = (($7) + ($$0104105<<2)|0);
  17122. HEAP8[$67>>0] = $66;
  17123. $68 = $62 >>> 5;
  17124. $69 = $68 & 63;
  17125. $70 = (+($69|0));
  17126. $71 = $70 * 4.0;
  17127. $72 = (~~(($71))&255);
  17128. $73 = (((($7) + ($$0104105<<2)|0)) + 1|0);
  17129. HEAP8[$73>>0] = $72;
  17130. $74 = $62 & 31;
  17131. $75 = (+($74|0));
  17132. $76 = $75 * 8.0;
  17133. $77 = (~~(($76))&255);
  17134. $78 = (((($7) + ($$0104105<<2)|0)) + 2|0);
  17135. HEAP8[$78>>0] = $77;
  17136. $79 = (((($7) + ($$0104105<<2)|0)) + 3|0);
  17137. HEAP8[$79>>0] = -1;
  17138. $80 = (($$0106) + 1)|0;
  17139. $$1 = $80;
  17140. break;
  17141. }
  17142. case 6: {
  17143. $81 = (($13) + ($$0106<<1)|0);
  17144. $82 = HEAP16[$81>>1]|0;
  17145. $83 = $82&65535;
  17146. $84 = $83 >>> 12;
  17147. $85 = (+($84|0));
  17148. $86 = $85 * 17.0;
  17149. $87 = (~~(($86))&255);
  17150. $88 = (($7) + ($$0104105<<2)|0);
  17151. HEAP8[$88>>0] = $87;
  17152. $89 = $83 >>> 8;
  17153. $90 = $89 & 15;
  17154. $91 = (+($90|0));
  17155. $92 = $91 * 17.0;
  17156. $93 = (~~(($92))&255);
  17157. $94 = (((($7) + ($$0104105<<2)|0)) + 1|0);
  17158. HEAP8[$94>>0] = $93;
  17159. $95 = $83 >>> 4;
  17160. $96 = $95 & 15;
  17161. $97 = (+($96|0));
  17162. $98 = $97 * 17.0;
  17163. $99 = (~~(($98))&255);
  17164. $100 = (((($7) + ($$0104105<<2)|0)) + 2|0);
  17165. HEAP8[$100>>0] = $99;
  17166. $101 = $83 & 15;
  17167. $102 = (+($101|0));
  17168. $103 = $102 * 17.0;
  17169. $104 = (~~(($103))&255);
  17170. $105 = (((($7) + ($$0104105<<2)|0)) + 3|0);
  17171. HEAP8[$105>>0] = $104;
  17172. $106 = (($$0106) + 1)|0;
  17173. $$1 = $106;
  17174. break;
  17175. }
  17176. case 7: {
  17177. $107 = (($13) + ($$0106)|0);
  17178. $108 = HEAP8[$107>>0]|0;
  17179. $109 = (($7) + ($$0104105<<2)|0);
  17180. HEAP8[$109>>0] = $108;
  17181. $110 = (($$0106) + 1)|0;
  17182. $111 = (($13) + ($110)|0);
  17183. $112 = HEAP8[$111>>0]|0;
  17184. $113 = (((($7) + ($$0104105<<2)|0)) + 1|0);
  17185. HEAP8[$113>>0] = $112;
  17186. $114 = (($$0106) + 2)|0;
  17187. $115 = (($13) + ($114)|0);
  17188. $116 = HEAP8[$115>>0]|0;
  17189. $117 = (((($7) + ($$0104105<<2)|0)) + 2|0);
  17190. HEAP8[$117>>0] = $116;
  17191. $118 = (($$0106) + 3)|0;
  17192. $119 = (($13) + ($118)|0);
  17193. $120 = HEAP8[$119>>0]|0;
  17194. $121 = (((($7) + ($$0104105<<2)|0)) + 3|0);
  17195. HEAP8[$121>>0] = $120;
  17196. $122 = (($$0106) + 4)|0;
  17197. $$1 = $122;
  17198. break;
  17199. }
  17200. case 4: {
  17201. $123 = (($13) + ($$0106)|0);
  17202. $124 = HEAP8[$123>>0]|0;
  17203. $125 = (($7) + ($$0104105<<2)|0);
  17204. HEAP8[$125>>0] = $124;
  17205. $126 = (($$0106) + 1)|0;
  17206. $127 = (($13) + ($126)|0);
  17207. $128 = HEAP8[$127>>0]|0;
  17208. $129 = (((($7) + ($$0104105<<2)|0)) + 1|0);
  17209. HEAP8[$129>>0] = $128;
  17210. $130 = (($$0106) + 2)|0;
  17211. $131 = (($13) + ($130)|0);
  17212. $132 = HEAP8[$131>>0]|0;
  17213. $133 = (((($7) + ($$0104105<<2)|0)) + 2|0);
  17214. HEAP8[$133>>0] = $132;
  17215. $134 = (((($7) + ($$0104105<<2)|0)) + 3|0);
  17216. HEAP8[$134>>0] = -1;
  17217. $135 = (($$0106) + 3)|0;
  17218. $$1 = $135;
  17219. break;
  17220. }
  17221. default: {
  17222. _TraceLog(2,4004,$vararg_buffer);
  17223. $$1 = $$0106;
  17224. }
  17225. }
  17226. $136 = (($$0104105) + 1)|0;
  17227. $137 = HEAP32[$1>>2]|0;
  17228. $138 = HEAP32[$3>>2]|0;
  17229. $139 = Math_imul($138, $137)|0;
  17230. $140 = ($136|0)<($139|0);
  17231. if ($140) {
  17232. $$0104105 = $136;$$0106 = $$1;
  17233. } else {
  17234. break;
  17235. }
  17236. }
  17237. STACKTOP = sp;return ($7|0);
  17238. }
  17239. function _ErrorCallback($0,$1) {
  17240. $0 = $0|0;
  17241. $1 = $1|0;
  17242. var $vararg_buffer = 0, $vararg_ptr1 = 0, label = 0, sp = 0;
  17243. sp = STACKTOP;
  17244. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  17245. $vararg_buffer = sp;
  17246. HEAP32[$vararg_buffer>>2] = $0;
  17247. $vararg_ptr1 = ((($vararg_buffer)) + 4|0);
  17248. HEAP32[$vararg_ptr1>>2] = $1;
  17249. _TraceLog(2,7870,$vararg_buffer);
  17250. STACKTOP = sp;return;
  17251. }
  17252. function _rlGetVersion() {
  17253. var label = 0, sp = 0;
  17254. sp = STACKTOP;
  17255. return 4;
  17256. }
  17257. function _SetupFramebufferSize($0,$1) {
  17258. $0 = $0|0;
  17259. $1 = $1|0;
  17260. 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;
  17261. 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;
  17262. 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;
  17263. var $vararg_ptr3 = 0, $vararg_ptr7 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  17264. sp = STACKTOP;
  17265. STACKTOP = STACKTOP + 112|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(112|0);
  17266. $vararg_buffer8 = sp + 24|0;
  17267. $vararg_buffer4 = sp + 16|0;
  17268. $vararg_buffer = sp;
  17269. $2 = sp + 40|0;
  17270. $3 = HEAP32[7746]|0;
  17271. $4 = ($3|0)>($0|0);
  17272. if (!($4)) {
  17273. $5 = HEAP32[7745]|0;
  17274. $6 = ($5|0)>($1|0);
  17275. if (!($6)) {
  17276. $30 = ($3|0)<($0|0);
  17277. $31 = ($5|0)<($1|0);
  17278. $or$cond = $30 | $31;
  17279. if (!($or$cond)) {
  17280. HEAP32[7787] = $3;
  17281. HEAP32[7788] = $5;
  17282. HEAP32[7789] = 0;
  17283. HEAP32[7790] = 0;
  17284. STACKTOP = sp;return;
  17285. }
  17286. HEAP32[$vararg_buffer8>>2] = $3;
  17287. $vararg_ptr11 = ((($vararg_buffer8)) + 4|0);
  17288. HEAP32[$vararg_ptr11>>2] = $5;
  17289. $vararg_ptr12 = ((($vararg_buffer8)) + 8|0);
  17290. HEAP32[$vararg_ptr12>>2] = $0;
  17291. $vararg_ptr13 = ((($vararg_buffer8)) + 12|0);
  17292. HEAP32[$vararg_ptr13>>2] = $1;
  17293. _TraceLog(0,7804,$vararg_buffer8);
  17294. $32 = (+($0|0));
  17295. $33 = (+($1|0));
  17296. $34 = $32 / $33;
  17297. $35 = HEAP32[7746]|0;
  17298. $36 = (+($35|0));
  17299. $37 = HEAP32[7745]|0;
  17300. $38 = (+($37|0));
  17301. $39 = $36 / $38;
  17302. $40 = !($34 <= $39);
  17303. if ($40) {
  17304. $44 = $34 * $38;
  17305. $roundf = (+_roundf((+$44)));
  17306. $45 = (~~(($roundf)));
  17307. HEAP32[7787] = $45;
  17308. HEAP32[7788] = $37;
  17309. $46 = (($45) - ($35))|0;
  17310. HEAP32[7789] = $46;
  17311. $$sink1 = 0;
  17312. } else {
  17313. HEAP32[7787] = $35;
  17314. $41 = $36 / $34;
  17315. $roundf38 = (+_roundf((+$41)));
  17316. $42 = (~~(($roundf38)));
  17317. HEAP32[7788] = $42;
  17318. HEAP32[7789] = 0;
  17319. $43 = (($42) - ($37))|0;
  17320. $$sink1 = $43;
  17321. }
  17322. HEAP32[7790] = $$sink1;
  17323. STACKTOP = sp;return;
  17324. }
  17325. }
  17326. $7 = HEAP32[7745]|0;
  17327. HEAP32[$vararg_buffer>>2] = $3;
  17328. $vararg_ptr1 = ((($vararg_buffer)) + 4|0);
  17329. HEAP32[$vararg_ptr1>>2] = $7;
  17330. $vararg_ptr2 = ((($vararg_buffer)) + 8|0);
  17331. HEAP32[$vararg_ptr2>>2] = $0;
  17332. $vararg_ptr3 = ((($vararg_buffer)) + 12|0);
  17333. HEAP32[$vararg_ptr3>>2] = $1;
  17334. _TraceLog(2,7661,$vararg_buffer);
  17335. $8 = (+($0|0));
  17336. $9 = HEAP32[7746]|0;
  17337. $10 = (+($9|0));
  17338. $11 = $8 / $10;
  17339. $12 = (+($1|0));
  17340. $13 = HEAP32[7745]|0;
  17341. $14 = (+($13|0));
  17342. $15 = $12 / $14;
  17343. $16 = !($11 <= $15);
  17344. if ($16) {
  17345. $22 = $10 * $15;
  17346. $roundf39 = (+_roundf((+$22)));
  17347. $23 = (~~(($roundf39)));
  17348. HEAP32[7787] = $23;
  17349. HEAP32[7788] = $1;
  17350. $24 = (($0) - ($23))|0;
  17351. HEAP32[7789] = $24;
  17352. $$sink = 0;
  17353. } else {
  17354. HEAP32[7787] = $0;
  17355. $17 = HEAP32[7745]|0;
  17356. $18 = (+($17|0));
  17357. $19 = $11 * $18;
  17358. $roundf40 = (+_roundf((+$19)));
  17359. $20 = (~~(($roundf40)));
  17360. HEAP32[7788] = $20;
  17361. HEAP32[7789] = 0;
  17362. $21 = (($1) - ($20))|0;
  17363. $$sink = $21;
  17364. }
  17365. HEAP32[7790] = $$sink;
  17366. $25 = HEAP32[7787]|0;
  17367. $26 = (+($25|0));
  17368. $27 = HEAP32[7746]|0;
  17369. $28 = (+($27|0));
  17370. $29 = $26 / $28;
  17371. _MatrixScale($2,$29,$29,$29);
  17372. dest=31072; 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));
  17373. HEAP32[7787] = $0;
  17374. HEAP32[7788] = $1;
  17375. HEAP32[$vararg_buffer4>>2] = $0;
  17376. $vararg_ptr7 = ((($vararg_buffer4)) + 4|0);
  17377. HEAP32[$vararg_ptr7>>2] = $1;
  17378. _TraceLog(2,7739,$vararg_buffer4);
  17379. STACKTOP = sp;return;
  17380. }
  17381. function _WindowSizeCallback($0,$1,$2) {
  17382. $0 = $0|0;
  17383. $1 = $1|0;
  17384. $2 = $2|0;
  17385. var $3 = 0.0, $4 = 0.0, label = 0, sp = 0;
  17386. sp = STACKTOP;
  17387. _rlViewport(0,0,$1,$2);
  17388. _rlMatrixMode(5889);
  17389. _rlLoadIdentity();
  17390. $3 = (+($1|0));
  17391. $4 = (+($2|0));
  17392. _rlOrtho(0.0,$3,$4,0.0,0.0,1.0);
  17393. _rlMatrixMode(5888);
  17394. _rlLoadIdentity();
  17395. _rlClearScreenBuffers();
  17396. HEAP32[7746] = $1;
  17397. HEAP32[7745] = $2;
  17398. HEAP32[7787] = $1;
  17399. HEAP32[7788] = $2;
  17400. return;
  17401. }
  17402. function _CursorEnterCallback($0,$1) {
  17403. $0 = $0|0;
  17404. $1 = $1|0;
  17405. var label = 0, sp = 0;
  17406. sp = STACKTOP;
  17407. return;
  17408. }
  17409. function _KeyCallback($0,$1,$2,$3,$4) {
  17410. $0 = $0|0;
  17411. $1 = $1|0;
  17412. $2 = $2|0;
  17413. $3 = $3|0;
  17414. $4 = $4|0;
  17415. var $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, label = 0, sp = 0;
  17416. sp = STACKTOP;
  17417. $5 = HEAP32[744]|0;
  17418. $6 = ($5|0)==($1|0);
  17419. $7 = ($3|0)==(1);
  17420. $or$cond = $7 & $6;
  17421. if ($or$cond) {
  17422. _glfwSetWindowShouldClose(($0|0),1);
  17423. return;
  17424. }
  17425. $8 = $3&255;
  17426. $9 = (35955 + ($1)|0);
  17427. HEAP8[$9>>0] = $8;
  17428. if (!($7)) {
  17429. return;
  17430. }
  17431. HEAP32[743] = $1;
  17432. return;
  17433. }
  17434. function _MouseButtonCallback($0,$1,$2,$3) {
  17435. $0 = $0|0;
  17436. $1 = $1|0;
  17437. $2 = $2|0;
  17438. $3 = $3|0;
  17439. 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;
  17440. 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;
  17441. sp = STACKTOP;
  17442. STACKTOP = STACKTOP + 128|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(128|0);
  17443. $$byval_copy = sp + 64|0;
  17444. $4 = sp + 8|0;
  17445. $5 = sp;
  17446. $6 = $2&255;
  17447. $7 = (35949 + ($1)|0);
  17448. HEAP8[$7>>0] = $6;
  17449. $8 = (_IsMouseButtonPressed(0)|0);
  17450. $9 = ($8|0)==(0);
  17451. if ($9) {
  17452. $10 = (_IsMouseButtonReleased(0)|0);
  17453. $11 = ($10|0)==(0);
  17454. if (!($11)) {
  17455. $$sink = 0;
  17456. label = 3;
  17457. }
  17458. } else {
  17459. $$sink = 1;
  17460. label = 3;
  17461. }
  17462. if ((label|0) == 3) {
  17463. HEAP32[$4>>2] = $$sink;
  17464. }
  17465. $12 = ((($4)) + 8|0);
  17466. HEAP32[$12>>2] = 0;
  17467. $13 = ((($4)) + 4|0);
  17468. HEAP32[$13>>2] = 1;
  17469. $14 = ((($4)) + 24|0);
  17470. _GetMousePosition($5);
  17471. $15 = $5;
  17472. $16 = $15;
  17473. $17 = HEAP32[$16>>2]|0;
  17474. $18 = (($15) + 4)|0;
  17475. $19 = $18;
  17476. $20 = HEAP32[$19>>2]|0;
  17477. $21 = $14;
  17478. $22 = $21;
  17479. HEAP32[$22>>2] = $17;
  17480. $23 = (($21) + 4)|0;
  17481. $24 = $23;
  17482. HEAP32[$24>>2] = $20;
  17483. $25 = (_GetScreenWidth()|0);
  17484. $26 = (+($25|0));
  17485. $27 = +HEAPF32[$14>>2];
  17486. $28 = $27 / $26;
  17487. HEAPF32[$14>>2] = $28;
  17488. $29 = (_GetScreenHeight()|0);
  17489. $30 = (+($29|0));
  17490. $31 = ((($4)) + 28|0);
  17491. $32 = +HEAPF32[$31>>2];
  17492. $33 = $32 / $30;
  17493. HEAPF32[$31>>2] = $33;
  17494. 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));
  17495. _ProcessGestureEvent($$byval_copy);
  17496. STACKTOP = sp;return;
  17497. }
  17498. function _MouseCursorPosCallback($0,$1,$2) {
  17499. $0 = $0|0;
  17500. $1 = +$1;
  17501. $2 = +$2;
  17502. 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;
  17503. 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;
  17504. sp = STACKTOP;
  17505. STACKTOP = STACKTOP + 112|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(112|0);
  17506. $$byval_copy = sp + 56|0;
  17507. $3 = sp;
  17508. HEAP32[$3>>2] = 2;
  17509. $4 = ((($3)) + 8|0);
  17510. HEAP32[$4>>2] = 0;
  17511. $5 = ((($3)) + 4|0);
  17512. HEAP32[$5>>2] = 1;
  17513. $6 = $1;
  17514. $7 = $2;
  17515. $$sroa$0$0$$sroa_idx = ((($3)) + 24|0);
  17516. HEAPF32[$$sroa$0$0$$sroa_idx>>2] = $6;
  17517. $$sroa$2$0$$sroa_idx1 = ((($3)) + 28|0);
  17518. HEAPF32[$$sroa$2$0$$sroa_idx1>>2] = $7;
  17519. $8 = ((($3)) + 24|0);
  17520. $9 = $8;
  17521. $10 = $9;
  17522. $11 = HEAP32[$10>>2]|0;
  17523. $12 = (($9) + 4)|0;
  17524. $13 = $12;
  17525. $14 = HEAP32[$13>>2]|0;
  17526. $15 = 14072;
  17527. $16 = $15;
  17528. HEAP32[$16>>2] = $11;
  17529. $17 = (($15) + 4)|0;
  17530. $18 = $17;
  17531. HEAP32[$18>>2] = $14;
  17532. $19 = (_GetScreenWidth()|0);
  17533. $20 = (+($19|0));
  17534. $21 = +HEAPF32[$8>>2];
  17535. $22 = $21 / $20;
  17536. HEAPF32[$8>>2] = $22;
  17537. $23 = (_GetScreenHeight()|0);
  17538. $24 = (+($23|0));
  17539. $25 = +HEAPF32[$$sroa$2$0$$sroa_idx1>>2];
  17540. $26 = $25 / $24;
  17541. HEAPF32[$$sroa$2$0$$sroa_idx1>>2] = $26;
  17542. 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));
  17543. _ProcessGestureEvent($$byval_copy);
  17544. STACKTOP = sp;return;
  17545. }
  17546. function _CharCallback($0,$1) {
  17547. $0 = $0|0;
  17548. $1 = $1|0;
  17549. var label = 0, sp = 0;
  17550. sp = STACKTOP;
  17551. HEAP32[743] = $1;
  17552. return;
  17553. }
  17554. function _ScrollCallback($0,$1,$2) {
  17555. $0 = $0|0;
  17556. $1 = +$1;
  17557. $2 = +$2;
  17558. var $3 = 0, label = 0, sp = 0;
  17559. sp = STACKTOP;
  17560. $3 = (~~(($2)));
  17561. HEAP32[8160] = $3;
  17562. return;
  17563. }
  17564. function _WindowIconifyCallback($0,$1) {
  17565. $0 = $0|0;
  17566. $1 = $1|0;
  17567. var $$sink = 0, $2 = 0, label = 0, sp = 0;
  17568. sp = STACKTOP;
  17569. $2 = ($1|0)!=(0);
  17570. $$sink = $2&1;
  17571. HEAP32[8159] = $$sink;
  17572. return;
  17573. }
  17574. function _rlglInit($0,$1) {
  17575. $0 = $0|0;
  17576. $1 = $1|0;
  17577. 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;
  17578. 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;
  17579. 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;
  17580. 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;
  17581. 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;
  17582. 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;
  17583. sp = STACKTOP;
  17584. STACKTOP = STACKTOP + 2464|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(2464|0);
  17585. $vararg_buffer41 = sp + 2184|0;
  17586. $vararg_buffer39 = sp + 2176|0;
  17587. $vararg_buffer36 = sp + 2168|0;
  17588. $vararg_buffer34 = sp + 2160|0;
  17589. $vararg_buffer31 = sp + 2152|0;
  17590. $vararg_buffer29 = sp + 2144|0;
  17591. $vararg_buffer27 = sp + 2136|0;
  17592. $vararg_buffer25 = sp + 2128|0;
  17593. $vararg_buffer23 = sp + 2120|0;
  17594. $vararg_buffer21 = sp + 2112|0;
  17595. $vararg_buffer19 = sp + 2104|0;
  17596. $vararg_buffer17 = sp + 2096|0;
  17597. $vararg_buffer15 = sp + 2088|0;
  17598. $vararg_buffer13 = sp + 2080|0;
  17599. $vararg_buffer10 = sp + 2072|0;
  17600. $vararg_buffer7 = sp + 24|0;
  17601. $vararg_buffer4 = sp + 16|0;
  17602. $vararg_buffer1 = sp + 8|0;
  17603. $vararg_buffer = sp;
  17604. $2 = sp + 2400|0;
  17605. $3 = sp + 2384|0;
  17606. $4 = sp + 2320|0;
  17607. $5 = sp + 2256|0;
  17608. $6 = sp + 2192|0;
  17609. $7 = (_glGetString(7936)|0);
  17610. HEAP32[$vararg_buffer>>2] = $7;
  17611. _TraceLog(0,4302,$vararg_buffer);
  17612. $8 = (_glGetString(7937)|0);
  17613. HEAP32[$vararg_buffer1>>2] = $8;
  17614. _TraceLog(0,4320,$vararg_buffer1);
  17615. $9 = (_glGetString(7938)|0);
  17616. HEAP32[$vararg_buffer4>>2] = $9;
  17617. _TraceLog(0,4338,$vararg_buffer4);
  17618. $10 = (_glGetString(35724)|0);
  17619. HEAP32[$vararg_buffer7>>2] = $10;
  17620. _TraceLog(0,4356,$vararg_buffer7);
  17621. $11 = (_glGetString(7939)|0);
  17622. $12 = (_strlen($11)|0);
  17623. $13 = (($12) + 1)|0;
  17624. $14 = (_malloc($13)|0);
  17625. _memcpy(($14|0),($11|0),($13|0))|0;
  17626. $$062 = 0;$$sink63 = $14;
  17627. while(1) {
  17628. $15 = (_strtok($$sink63,4374)|0);
  17629. $16 = (($vararg_buffer7) + ($$062<<2)|0);
  17630. HEAP32[$16>>2] = $15;
  17631. $17 = ($15|0)==(0|0);
  17632. $18 = (($$062) + 1)|0;
  17633. if ($17) {
  17634. break;
  17635. } else {
  17636. $$062 = $18;$$sink63 = 0;
  17637. }
  17638. }
  17639. _free($14);
  17640. $19 = (($$062) + -1)|0;
  17641. HEAP32[$vararg_buffer10>>2] = $19;
  17642. _TraceLog(0,4376,$vararg_buffer10);
  17643. $20 = ($$062|0)>(1);
  17644. if ($20) {
  17645. $$06167 = 0;
  17646. while(1) {
  17647. $23 = (($vararg_buffer7) + ($$06167<<2)|0);
  17648. $24 = HEAP32[$23>>2]|0;
  17649. $25 = (_strcmp($24,4411)|0);
  17650. $26 = ($25|0)==(0);
  17651. if ($26) {
  17652. HEAP32[7825] = 1;
  17653. $27 = (_eglGetProcAddress((4438|0))|0);
  17654. HEAP32[7826] = $27;
  17655. $28 = (_eglGetProcAddress((4459|0))|0);
  17656. HEAP32[7827] = $28;
  17657. $29 = (_eglGetProcAddress((4480|0))|0);
  17658. HEAP32[7828] = $29;
  17659. }
  17660. $30 = (_strcmp($24,4504)|0);
  17661. $31 = ($30|0)==(0);
  17662. if ($31) {
  17663. HEAP32[7767] = 1;
  17664. }
  17665. $32 = (_strcmp($24,4524)|0);
  17666. $33 = ($32|0)==(0);
  17667. if ($33) {
  17668. label = 12;
  17669. } else {
  17670. $34 = HEAP32[$23>>2]|0;
  17671. $35 = (_strcmp($34,4556)|0);
  17672. $36 = ($35|0)==(0);
  17673. if ($36) {
  17674. label = 12;
  17675. } else {
  17676. $37 = (_strcmp($34,4589)|0);
  17677. $38 = ($37|0)==(0);
  17678. if ($38) {
  17679. label = 12;
  17680. }
  17681. }
  17682. }
  17683. if ((label|0) == 12) {
  17684. label = 0;
  17685. HEAP32[7762] = 1;
  17686. }
  17687. $39 = (_strcmp($24,4629)|0);
  17688. $40 = ($39|0)==(0);
  17689. if ($40) {
  17690. label = 15;
  17691. } else {
  17692. $41 = HEAP32[$23>>2]|0;
  17693. $42 = (_strcmp($41,4665)|0);
  17694. $43 = ($42|0)==(0);
  17695. if ($43) {
  17696. label = 15;
  17697. }
  17698. }
  17699. if ((label|0) == 15) {
  17700. label = 0;
  17701. HEAP32[7763] = 1;
  17702. }
  17703. $44 = HEAP32[$23>>2]|0;
  17704. $45 = (_strcmp($44,4698)|0);
  17705. $46 = ($45|0)==(0);
  17706. if ($46) {
  17707. HEAP32[7764] = 1;
  17708. }
  17709. $47 = (_strcmp($44,4723)|0);
  17710. $48 = ($47|0)==(0);
  17711. if ($48) {
  17712. HEAP32[7765] = 1;
  17713. }
  17714. $49 = (_strcmp($44,4756)|0);
  17715. $50 = ($49|0)==(0);
  17716. if ($50) {
  17717. HEAP32[7766] = 1;
  17718. }
  17719. $51 = (_strcmp($44,4792)|0);
  17720. $52 = ($51|0)==(0);
  17721. if ($52) {
  17722. HEAP32[7829] = 1;
  17723. _glGetFloatv(34047,(31320|0));
  17724. }
  17725. $53 = HEAP32[$23>>2]|0;
  17726. $54 = (_strcmp($53,4826)|0);
  17727. $55 = ($54|0)==(0);
  17728. if ($55) {
  17729. HEAP32[7831] = 1;
  17730. }
  17731. $56 = (($$06167) + 1)|0;
  17732. $exitcond70 = ($56|0)==($19|0);
  17733. if ($exitcond70) {
  17734. break;
  17735. } else {
  17736. $$06167 = $56;
  17737. }
  17738. }
  17739. }
  17740. $21 = HEAP32[7825]|0;
  17741. $22 = ($21|0)==(0);
  17742. if ($22) {
  17743. _TraceLog(2,4929,$vararg_buffer15);
  17744. } else {
  17745. _TraceLog(0,4854,$vararg_buffer13);
  17746. }
  17747. $57 = HEAP32[7767]|0;
  17748. $58 = ($57|0)==(0);
  17749. if ($58) {
  17750. _TraceLog(2,5065,$vararg_buffer19);
  17751. } else {
  17752. _TraceLog(0,4990,$vararg_buffer17);
  17753. }
  17754. $59 = HEAP32[7762]|0;
  17755. $60 = ($59|0)==(0);
  17756. if (!($60)) {
  17757. _TraceLog(0,5157,$vararg_buffer21);
  17758. }
  17759. $61 = HEAP32[7763]|0;
  17760. $62 = ($61|0)==(0);
  17761. if (!($62)) {
  17762. _TraceLog(0,5203,$vararg_buffer23);
  17763. }
  17764. $63 = HEAP32[7764]|0;
  17765. $64 = ($63|0)==(0);
  17766. if (!($64)) {
  17767. _TraceLog(0,5250,$vararg_buffer25);
  17768. }
  17769. $65 = HEAP32[7765]|0;
  17770. $66 = ($65|0)==(0);
  17771. if (!($66)) {
  17772. _TraceLog(0,5301,$vararg_buffer27);
  17773. }
  17774. $67 = HEAP32[7766]|0;
  17775. $68 = ($67|0)==(0);
  17776. if (!($68)) {
  17777. _TraceLog(0,5348,$vararg_buffer29);
  17778. }
  17779. $69 = HEAP32[7829]|0;
  17780. $70 = ($69|0)==(0);
  17781. if (!($70)) {
  17782. $71 = +HEAPF32[7830];
  17783. $72 = $71;
  17784. HEAPF64[$vararg_buffer31>>3] = $72;
  17785. _TraceLog(0,5395,$vararg_buffer31);
  17786. }
  17787. $73 = HEAP32[7831]|0;
  17788. $74 = ($73|0)==(0);
  17789. if (!($74)) {
  17790. _TraceLog(0,5461,$vararg_buffer34);
  17791. }
  17792. HEAP32[$vararg_buffer10>>2] = -1;
  17793. $75 = (_rlglLoadTexture($vararg_buffer10,1,1,7,1)|0);
  17794. HEAP32[7832] = $75;
  17795. $76 = ($75|0)==(0);
  17796. if ($76) {
  17797. _TraceLog(2,5565,$vararg_buffer39);
  17798. } else {
  17799. HEAP32[$vararg_buffer36>>2] = $75;
  17800. _TraceLog(0,5514,$vararg_buffer36);
  17801. }
  17802. _LoadDefaultShader($2);
  17803. dest=31332; 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));
  17804. dest=31388; 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));
  17805. _LoadDefaultBuffers();
  17806. $77 = (_malloc(49152)|0);
  17807. HEAP32[7861] = $77;
  17808. $$06066 = 0;
  17809. while(1) {
  17810. $79 = HEAP32[7861]|0;
  17811. $80 = (($79) + (($$06066*12)|0)|0);
  17812. _VectorZero($3);
  17813. ;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;
  17814. $81 = (($$06066) + 1)|0;
  17815. $exitcond69 = ($81|0)==(4096);
  17816. if ($exitcond69) {
  17817. break;
  17818. } else {
  17819. $$06066 = $81;
  17820. }
  17821. }
  17822. $78 = (_malloc(36864)|0);
  17823. HEAP32[7862] = $78;
  17824. $$05965 = 0;
  17825. while(1) {
  17826. $82 = (((($78) + (($$05965*144)|0)|0)) + 8|0);
  17827. HEAP32[$82>>2] = 0;
  17828. $83 = (($78) + (($$05965*144)|0)|0);
  17829. HEAP32[$83>>2] = 0;
  17830. $84 = (($$05965) + 1)|0;
  17831. $exitcond = ($84|0)==(256);
  17832. if ($exitcond) {
  17833. break;
  17834. } else {
  17835. $$05965 = $84;
  17836. }
  17837. }
  17838. HEAP32[7863] = 1;
  17839. $85 = HEAP32[7832]|0;
  17840. $86 = ((($78)) + 8|0);
  17841. HEAP32[$86>>2] = $85;
  17842. HEAP32[7864] = 4;
  17843. _MatrixIdentity($4);
  17844. dest=31460; 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));
  17845. _MatrixIdentity($4);
  17846. dest=(31524); 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));
  17847. _MatrixIdentity($4);
  17848. dest=(31588); 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));
  17849. _MatrixIdentity($4);
  17850. dest=(31652); 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));
  17851. _MatrixIdentity($4);
  17852. dest=(31716); 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));
  17853. _MatrixIdentity($4);
  17854. dest=(31780); 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));
  17855. _MatrixIdentity($4);
  17856. dest=(31844); 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));
  17857. _MatrixIdentity($4);
  17858. dest=(31908); 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));
  17859. _MatrixIdentity($4);
  17860. dest=(31972); 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));
  17861. _MatrixIdentity($4);
  17862. dest=(32036); 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));
  17863. _MatrixIdentity($4);
  17864. dest=(32100); 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));
  17865. _MatrixIdentity($4);
  17866. dest=(32164); 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));
  17867. _MatrixIdentity($4);
  17868. dest=(32228); 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));
  17869. _MatrixIdentity($4);
  17870. dest=(32292); 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));
  17871. _MatrixIdentity($4);
  17872. dest=(32356); 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));
  17873. _MatrixIdentity($4);
  17874. dest=(32420); 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));
  17875. _MatrixIdentity($5);
  17876. dest=31168; 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));
  17877. _MatrixIdentity($6);
  17878. dest=31232; 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));
  17879. HEAP32[7791] = 31232;
  17880. _glDepthFunc(515);
  17881. _glDisable(2929);
  17882. _glBlendFunc(770,771);
  17883. _glEnable(3042);
  17884. _glCullFace(1029);
  17885. _glFrontFace(2305);
  17886. _glEnable(2884);
  17887. _glClearColor(0.0,0.0,0.0,1.0);
  17888. _glClearDepthf(1.0);
  17889. _glClear(16640);
  17890. HEAP32[8121] = $0;
  17891. HEAP32[8122] = $1;
  17892. _TraceLog(0,5604,$vararg_buffer41);
  17893. STACKTOP = sp;return;
  17894. }
  17895. function _SetupViewport() {
  17896. var $0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0;
  17897. sp = STACKTOP;
  17898. $0 = HEAP32[7789]|0;
  17899. $1 = (($0|0) / 2)&-1;
  17900. $2 = HEAP32[7790]|0;
  17901. $3 = (($2|0) / 2)&-1;
  17902. $4 = HEAP32[7787]|0;
  17903. $5 = (($4) - ($0))|0;
  17904. $6 = HEAP32[7788]|0;
  17905. $7 = (($6) - ($2))|0;
  17906. _rlViewport($1,$3,$5,$7);
  17907. return;
  17908. }
  17909. function _rlMatrixMode($0) {
  17910. $0 = $0|0;
  17911. var $modelview$sink = 0, label = 0, sp = 0;
  17912. sp = STACKTOP;
  17913. switch ($0|0) {
  17914. case 5889: {
  17915. $modelview$sink = 31168;
  17916. label = 3;
  17917. break;
  17918. }
  17919. case 5888: {
  17920. $modelview$sink = 31232;
  17921. label = 3;
  17922. break;
  17923. }
  17924. default: {
  17925. }
  17926. }
  17927. if ((label|0) == 3) {
  17928. HEAP32[7791] = $modelview$sink;
  17929. }
  17930. HEAP32[7824] = $0;
  17931. return;
  17932. }
  17933. function _rlLoadIdentity() {
  17934. var $0 = 0, $1 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  17935. sp = STACKTOP;
  17936. STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
  17937. $0 = sp;
  17938. $1 = HEAP32[7791]|0;
  17939. _MatrixIdentity($0);
  17940. 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));
  17941. STACKTOP = sp;return;
  17942. }
  17943. function _rlOrtho($0,$1,$2,$3,$4,$5) {
  17944. $0 = +$0;
  17945. $1 = +$1;
  17946. $2 = +$2;
  17947. $3 = +$3;
  17948. $4 = +$4;
  17949. $5 = +$5;
  17950. var $$byval_copy = 0, $$byval_copy1 = 0, $6 = 0, $7 = 0, $8 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  17951. sp = STACKTOP;
  17952. STACKTOP = STACKTOP + 256|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(256|0);
  17953. $$byval_copy1 = sp + 192|0;
  17954. $$byval_copy = sp + 128|0;
  17955. $6 = sp + 64|0;
  17956. $7 = sp;
  17957. _MatrixOrtho($6,$0,$1,$2,$3,$4,$5);
  17958. _MatrixTranspose($6);
  17959. $8 = HEAP32[7791]|0;
  17960. 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));
  17961. 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));
  17962. _MatrixMultiply($7,$$byval_copy,$$byval_copy1);
  17963. 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));
  17964. STACKTOP = sp;return;
  17965. }
  17966. function _ClearBackground($0) {
  17967. $0 = $0|0;
  17968. var $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0;
  17969. sp = STACKTOP;
  17970. $1 = HEAP8[$0>>0]|0;
  17971. $2 = ((($0)) + 1|0);
  17972. $3 = HEAP8[$2>>0]|0;
  17973. $4 = ((($0)) + 2|0);
  17974. $5 = HEAP8[$4>>0]|0;
  17975. $6 = ((($0)) + 3|0);
  17976. $7 = HEAP8[$6>>0]|0;
  17977. _rlClearColor($1,$3,$5,$7);
  17978. return;
  17979. }
  17980. function _rlClearColor($0,$1,$2,$3) {
  17981. $0 = $0|0;
  17982. $1 = $1|0;
  17983. $2 = $2|0;
  17984. $3 = $3|0;
  17985. 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;
  17986. sp = STACKTOP;
  17987. $4 = (+($0&255));
  17988. $5 = $4 / 255.0;
  17989. $6 = (+($1&255));
  17990. $7 = $6 / 255.0;
  17991. $8 = (+($2&255));
  17992. $9 = $8 / 255.0;
  17993. $10 = (+($3&255));
  17994. $11 = $10 / 255.0;
  17995. _glClearColor((+$5),(+$7),(+$9),(+$11));
  17996. return;
  17997. }
  17998. function _rlViewport($0,$1,$2,$3) {
  17999. $0 = $0|0;
  18000. $1 = $1|0;
  18001. $2 = $2|0;
  18002. $3 = $3|0;
  18003. var label = 0, sp = 0;
  18004. sp = STACKTOP;
  18005. _glViewport(($0|0),($1|0),($2|0),($3|0));
  18006. return;
  18007. }
  18008. function _LoadDefaultShader($0) {
  18009. $0 = $0|0;
  18010. 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;
  18011. sp = STACKTOP;
  18012. STACKTOP = STACKTOP + 1008|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(1008|0);
  18013. $vararg_buffer1 = sp + 8|0;
  18014. $vararg_buffer = sp;
  18015. $1 = sp + 16|0;
  18016. $2 = sp + 513|0;
  18017. $3 = sp + 72|0;
  18018. _memcpy(($2|0),(6180|0),489)|0;
  18019. _memcpy(($3|0),(6669|0),441)|0;
  18020. $4 = (_LoadShaderProgram($2,$3)|0);
  18021. HEAP32[$1>>2] = $4;
  18022. $5 = ($4|0)==(0);
  18023. if ($5) {
  18024. HEAP32[$vararg_buffer1>>2] = $4;
  18025. _TraceLog(2,7158,$vararg_buffer1);
  18026. } else {
  18027. HEAP32[$vararg_buffer>>2] = $4;
  18028. _TraceLog(0,7110,$vararg_buffer);
  18029. }
  18030. $6 = HEAP32[$1>>2]|0;
  18031. $7 = ($6|0)==(0);
  18032. if (!($7)) {
  18033. _LoadDefaultShaderLocations($1);
  18034. }
  18035. 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));
  18036. STACKTOP = sp;return;
  18037. }
  18038. function _LoadDefaultBuffers() {
  18039. 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;
  18040. 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;
  18041. 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;
  18042. 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;
  18043. 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;
  18044. 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;
  18045. 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;
  18046. sp = STACKTOP;
  18047. STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
  18048. $vararg_buffer17 = sp + 48|0;
  18049. $vararg_buffer14 = sp + 40|0;
  18050. $vararg_buffer10 = sp + 32|0;
  18051. $vararg_buffer7 = sp + 24|0;
  18052. $vararg_buffer3 = sp + 16|0;
  18053. $vararg_buffer1 = sp + 8|0;
  18054. $vararg_buffer = sp;
  18055. $0 = (_malloc(24576)|0);
  18056. HEAP32[(32504)>>2] = $0;
  18057. $1 = (_malloc(8192)|0);
  18058. HEAP32[(32512)>>2] = $1;
  18059. HEAP32[(32508)>>2] = 0;
  18060. HEAP32[(32516)>>2] = 0;
  18061. _memset(($0|0),0,24576)|0;
  18062. $$05972 = 0;
  18063. while(1) {
  18064. $2 = HEAP32[(32512)>>2]|0;
  18065. $3 = (($2) + ($$05972)|0);
  18066. HEAP8[$3>>0] = 0;
  18067. $4 = (($$05972) + 1)|0;
  18068. $exitcond80 = ($4|0)==(8192);
  18069. if ($exitcond80) {
  18070. break;
  18071. } else {
  18072. $$05972 = $4;
  18073. }
  18074. }
  18075. HEAP32[8123] = 0;
  18076. HEAP32[(32500)>>2] = 0;
  18077. HEAP32[(32496)>>2] = 0;
  18078. $5 = (_malloc(73728)|0);
  18079. HEAP32[(32552)>>2] = $5;
  18080. $6 = (_malloc(24576)|0);
  18081. HEAP32[(32560)>>2] = $6;
  18082. HEAP32[(32556)>>2] = 0;
  18083. HEAP32[(32564)>>2] = 0;
  18084. _memset(($5|0),0,73728)|0;
  18085. $$05770 = 0;
  18086. while(1) {
  18087. $7 = HEAP32[(32560)>>2]|0;
  18088. $8 = (($7) + ($$05770)|0);
  18089. HEAP8[$8>>0] = 0;
  18090. $9 = (($$05770) + 1)|0;
  18091. $exitcond78 = ($9|0)==(24576);
  18092. if ($exitcond78) {
  18093. break;
  18094. } else {
  18095. $$05770 = $9;
  18096. }
  18097. }
  18098. HEAP32[8135] = 0;
  18099. HEAP32[(32548)>>2] = 0;
  18100. HEAP32[(32544)>>2] = 0;
  18101. $10 = (_malloc(49152)|0);
  18102. HEAP32[(32600)>>2] = $10;
  18103. $11 = (_malloc(32768)|0);
  18104. HEAP32[(32604)>>2] = $11;
  18105. $12 = (_malloc(16384)|0);
  18106. HEAP32[(32608)>>2] = $12;
  18107. $13 = (_malloc(12288)|0);
  18108. HEAP32[(32612)>>2] = $13;
  18109. $14 = HEAP32[(32600)>>2]|0;
  18110. _memset(($14|0),0,49152)|0;
  18111. $15 = HEAP32[(32604)>>2]|0;
  18112. _memset(($15|0),0,32768)|0;
  18113. $$05467 = 0;
  18114. while(1) {
  18115. $17 = HEAP32[(32608)>>2]|0;
  18116. $18 = (($17) + ($$05467)|0);
  18117. HEAP8[$18>>0] = 0;
  18118. $19 = (($$05467) + 1)|0;
  18119. $exitcond75 = ($19|0)==(16384);
  18120. if ($exitcond75) {
  18121. break;
  18122. } else {
  18123. $$05467 = $19;
  18124. }
  18125. }
  18126. $16 = HEAP32[(32612)>>2]|0;
  18127. $$05365 = 0;$$066 = 0;
  18128. while(1) {
  18129. $22 = $$05365 << 2;
  18130. $23 = $22&65535;
  18131. $24 = (($16) + ($$066<<1)|0);
  18132. HEAP16[$24>>1] = $23;
  18133. $25 = $22 | 1;
  18134. $26 = $25&65535;
  18135. $27 = $$066 | 1;
  18136. $28 = (($16) + ($27<<1)|0);
  18137. HEAP16[$28>>1] = $26;
  18138. $29 = $22 | 2;
  18139. $30 = $29&65535;
  18140. $31 = (($$066) + 2)|0;
  18141. $32 = (($16) + ($31<<1)|0);
  18142. HEAP16[$32>>1] = $30;
  18143. $33 = (($$066) + 3)|0;
  18144. $34 = (($16) + ($33<<1)|0);
  18145. HEAP16[$34>>1] = $23;
  18146. $35 = (($$066) + 4)|0;
  18147. $36 = (($16) + ($35<<1)|0);
  18148. HEAP16[$36>>1] = $30;
  18149. $37 = $22 | 3;
  18150. $38 = $37&65535;
  18151. $39 = (($$066) + 5)|0;
  18152. $40 = (($16) + ($39<<1)|0);
  18153. HEAP16[$40>>1] = $38;
  18154. $41 = (($$05365) + 1)|0;
  18155. $42 = (($$066) + 6)|0;
  18156. $exitcond = ($41|0)==(1024);
  18157. if ($exitcond) {
  18158. break;
  18159. } else {
  18160. $$05365 = $41;$$066 = $42;
  18161. }
  18162. }
  18163. HEAP32[8147] = 0;
  18164. HEAP32[(32592)>>2] = 0;
  18165. HEAP32[(32596)>>2] = 0;
  18166. _TraceLog(0,5651,$vararg_buffer);
  18167. $20 = HEAP32[7825]|0;
  18168. $21 = ($20|0)==(0);
  18169. if (!($21)) {
  18170. $43 = HEAP32[7826]|0;
  18171. FUNCTION_TABLE_vii[$43 & 63](1,(32520));
  18172. $44 = HEAP32[7827]|0;
  18173. $45 = HEAP32[(32520)>>2]|0;
  18174. FUNCTION_TABLE_vi[$44 & 31]($45);
  18175. }
  18176. _glGenBuffers(2,((32524)|0));
  18177. $46 = HEAP32[(32524)>>2]|0;
  18178. _glBindBuffer(34962,($46|0));
  18179. $47 = HEAP32[(32504)>>2]|0;
  18180. _glBufferData(34962,24576,($47|0),35048);
  18181. $48 = HEAP32[(31392)>>2]|0;
  18182. _glEnableVertexAttribArray(($48|0));
  18183. $49 = HEAP32[(31392)>>2]|0;
  18184. _glVertexAttribPointer(($49|0),3,5126,0,0,(0|0));
  18185. _glGenBuffers(2,((32528)|0));
  18186. $50 = HEAP32[(32528)>>2]|0;
  18187. _glBindBuffer(34962,($50|0));
  18188. $51 = HEAP32[(32512)>>2]|0;
  18189. _glBufferData(34962,8192,($51|0),35048);
  18190. $52 = HEAP32[(31412)>>2]|0;
  18191. _glEnableVertexAttribArray(($52|0));
  18192. $53 = HEAP32[(31412)>>2]|0;
  18193. _glVertexAttribPointer(($53|0),4,5121,1,0,(0|0));
  18194. $54 = HEAP32[7825]|0;
  18195. $55 = ($54|0)==(0);
  18196. if ($55) {
  18197. $57 = HEAP32[(32524)>>2]|0;
  18198. $58 = HEAP32[(32528)>>2]|0;
  18199. HEAP32[$vararg_buffer3>>2] = $57;
  18200. $vararg_ptr6 = ((($vararg_buffer3)) + 4|0);
  18201. HEAP32[$vararg_ptr6>>2] = $58;
  18202. _TraceLog(0,5789,$vararg_buffer3);
  18203. } else {
  18204. $56 = HEAP32[(32520)>>2]|0;
  18205. HEAP32[$vararg_buffer1>>2] = $56;
  18206. _TraceLog(0,5724,$vararg_buffer1);
  18207. }
  18208. $59 = HEAP32[7825]|0;
  18209. $60 = ($59|0)==(0);
  18210. if (!($60)) {
  18211. $61 = HEAP32[7826]|0;
  18212. FUNCTION_TABLE_vii[$61 & 63](1,(32568));
  18213. $62 = HEAP32[7827]|0;
  18214. $63 = HEAP32[(32568)>>2]|0;
  18215. FUNCTION_TABLE_vi[$62 & 31]($63);
  18216. }
  18217. _glGenBuffers(1,((32572)|0));
  18218. $64 = HEAP32[(32572)>>2]|0;
  18219. _glBindBuffer(34962,($64|0));
  18220. $65 = HEAP32[(32552)>>2]|0;
  18221. _glBufferData(34962,73728,($65|0),35048);
  18222. $66 = HEAP32[(31392)>>2]|0;
  18223. _glEnableVertexAttribArray(($66|0));
  18224. $67 = HEAP32[(31392)>>2]|0;
  18225. _glVertexAttribPointer(($67|0),3,5126,0,0,(0|0));
  18226. _glGenBuffers(1,((32576)|0));
  18227. $68 = HEAP32[(32576)>>2]|0;
  18228. _glBindBuffer(34962,($68|0));
  18229. $69 = HEAP32[(32560)>>2]|0;
  18230. _glBufferData(34962,24576,($69|0),35048);
  18231. $70 = HEAP32[(31412)>>2]|0;
  18232. _glEnableVertexAttribArray(($70|0));
  18233. $71 = HEAP32[(31412)>>2]|0;
  18234. _glVertexAttribPointer(($71|0),4,5121,1,0,(0|0));
  18235. $72 = HEAP32[7825]|0;
  18236. $73 = ($72|0)==(0);
  18237. if ($73) {
  18238. $75 = HEAP32[(32572)>>2]|0;
  18239. $76 = HEAP32[(32576)>>2]|0;
  18240. HEAP32[$vararg_buffer10>>2] = $75;
  18241. $vararg_ptr13 = ((($vararg_buffer10)) + 4|0);
  18242. HEAP32[$vararg_ptr13>>2] = $76;
  18243. _TraceLog(0,5935,$vararg_buffer10);
  18244. } else {
  18245. $74 = HEAP32[(32568)>>2]|0;
  18246. HEAP32[$vararg_buffer7>>2] = $74;
  18247. _TraceLog(0,5866,$vararg_buffer7);
  18248. }
  18249. $77 = HEAP32[7825]|0;
  18250. $78 = ($77|0)==(0);
  18251. if (!($78)) {
  18252. $79 = HEAP32[7826]|0;
  18253. FUNCTION_TABLE_vii[$79 & 63](1,(32616));
  18254. $80 = HEAP32[7827]|0;
  18255. $81 = HEAP32[(32616)>>2]|0;
  18256. FUNCTION_TABLE_vi[$80 & 31]($81);
  18257. }
  18258. _glGenBuffers(1,((32620)|0));
  18259. $82 = HEAP32[(32620)>>2]|0;
  18260. _glBindBuffer(34962,($82|0));
  18261. $83 = HEAP32[(32600)>>2]|0;
  18262. _glBufferData(34962,49152,($83|0),35048);
  18263. $84 = HEAP32[(31392)>>2]|0;
  18264. _glEnableVertexAttribArray(($84|0));
  18265. $85 = HEAP32[(31392)>>2]|0;
  18266. _glVertexAttribPointer(($85|0),3,5126,0,0,(0|0));
  18267. _glGenBuffers(1,((32624)|0));
  18268. $86 = HEAP32[(32624)>>2]|0;
  18269. _glBindBuffer(34962,($86|0));
  18270. $87 = HEAP32[(32604)>>2]|0;
  18271. _glBufferData(34962,32768,($87|0),35048);
  18272. $88 = HEAP32[(31396)>>2]|0;
  18273. _glEnableVertexAttribArray(($88|0));
  18274. $89 = HEAP32[(31396)>>2]|0;
  18275. _glVertexAttribPointer(($89|0),2,5126,0,0,(0|0));
  18276. _glGenBuffers(1,((32628)|0));
  18277. $90 = HEAP32[(32628)>>2]|0;
  18278. _glBindBuffer(34962,($90|0));
  18279. $91 = HEAP32[(32608)>>2]|0;
  18280. _glBufferData(34962,16384,($91|0),35048);
  18281. $92 = HEAP32[(31412)>>2]|0;
  18282. _glEnableVertexAttribArray(($92|0));
  18283. $93 = HEAP32[(31412)>>2]|0;
  18284. _glVertexAttribPointer(($93|0),4,5121,1,0,(0|0));
  18285. _glGenBuffers(1,((32632)|0));
  18286. $94 = HEAP32[(32632)>>2]|0;
  18287. _glBindBuffer(34963,($94|0));
  18288. $95 = HEAP32[(32612)>>2]|0;
  18289. _glBufferData(34963,12288,($95|0),35044);
  18290. $96 = HEAP32[7825]|0;
  18291. $97 = ($96|0)==(0);
  18292. if ($97) {
  18293. $99 = HEAP32[(32620)>>2]|0;
  18294. $100 = HEAP32[(32624)>>2]|0;
  18295. $101 = HEAP32[(32628)>>2]|0;
  18296. $102 = HEAP32[(32632)>>2]|0;
  18297. HEAP32[$vararg_buffer17>>2] = $99;
  18298. $vararg_ptr20 = ((($vararg_buffer17)) + 4|0);
  18299. HEAP32[$vararg_ptr20>>2] = $100;
  18300. $vararg_ptr21 = ((($vararg_buffer17)) + 8|0);
  18301. HEAP32[$vararg_ptr21>>2] = $101;
  18302. $vararg_ptr22 = ((($vararg_buffer17)) + 12|0);
  18303. HEAP32[$vararg_ptr22>>2] = $102;
  18304. _TraceLog(0,6081,$vararg_buffer17);
  18305. } else {
  18306. $98 = HEAP32[(32616)>>2]|0;
  18307. HEAP32[$vararg_buffer14>>2] = $98;
  18308. _TraceLog(0,6016,$vararg_buffer14);
  18309. }
  18310. $103 = HEAP32[7825]|0;
  18311. $104 = ($103|0)==(0);
  18312. if ($104) {
  18313. STACKTOP = sp;return;
  18314. }
  18315. $105 = HEAP32[7827]|0;
  18316. FUNCTION_TABLE_vi[$105 & 31](0);
  18317. STACKTOP = sp;return;
  18318. }
  18319. function _LoadShaderProgram($0,$1) {
  18320. $0 = $0|0;
  18321. $1 = $1|0;
  18322. 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;
  18323. 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;
  18324. sp = STACKTOP;
  18325. STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
  18326. $vararg_buffer22 = sp + 64|0;
  18327. $vararg_buffer19 = sp + 56|0;
  18328. $vararg_buffer16 = sp + 48|0;
  18329. $vararg_buffer13 = sp + 40|0;
  18330. $vararg_buffer10 = sp + 32|0;
  18331. $vararg_buffer7 = sp + 24|0;
  18332. $vararg_buffer4 = sp + 16|0;
  18333. $vararg_buffer1 = sp + 8|0;
  18334. $vararg_buffer = sp;
  18335. $2 = sp + 80|0;
  18336. $3 = sp + 76|0;
  18337. $4 = sp + 72|0;
  18338. $5 = sp + 68|0;
  18339. $6 = (_glCreateShader(35633)|0);
  18340. $7 = (_glCreateShader(35632)|0);
  18341. HEAP32[$2>>2] = $0;
  18342. HEAP32[$3>>2] = $1;
  18343. _glShaderSource(($6|0),1,($2|0),(0|0));
  18344. _glShaderSource(($7|0),1,($3|0),(0|0));
  18345. HEAP32[$4>>2] = 0;
  18346. _glCompileShader(($6|0));
  18347. _glGetShaderiv(($6|0),35713,($4|0));
  18348. $8 = HEAP32[$4>>2]|0;
  18349. $9 = ($8|0)==(1);
  18350. if ($9) {
  18351. HEAP32[$vararg_buffer4>>2] = $6;
  18352. _TraceLog(0,7414,$vararg_buffer4);
  18353. } else {
  18354. HEAP32[$vararg_buffer>>2] = $6;
  18355. _TraceLog(2,7362,$vararg_buffer);
  18356. HEAP32[$vararg_buffer>>2] = 0;
  18357. _glGetShaderiv(($6|0),35716,($vararg_buffer|0));
  18358. $10 = HEAP32[$vararg_buffer>>2]|0;
  18359. $11 = (_llvm_stacksave()|0);
  18360. $$alloca_mul = $10;
  18361. $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);;
  18362. $13 = HEAP32[$vararg_buffer>>2]|0;
  18363. _glGetShaderInfoLog(($6|0),($13|0),($5|0),($12|0));
  18364. HEAP32[$vararg_buffer1>>2] = $12;
  18365. _TraceLog(0,7411,$vararg_buffer1);
  18366. _llvm_stackrestore(($11|0));
  18367. }
  18368. _glCompileShader(($7|0));
  18369. _glGetShaderiv(($7|0),35713,($4|0));
  18370. $14 = HEAP32[$4>>2]|0;
  18371. $15 = ($14|0)==(1);
  18372. if ($15) {
  18373. HEAP32[$vararg_buffer13>>2] = $7;
  18374. _TraceLog(0,7515,$vararg_buffer13);
  18375. } else {
  18376. HEAP32[$vararg_buffer7>>2] = $7;
  18377. _TraceLog(2,7464,$vararg_buffer7);
  18378. HEAP32[$vararg_buffer7>>2] = 0;
  18379. _glGetShaderiv(($7|0),35716,($vararg_buffer7|0));
  18380. $16 = HEAP32[$vararg_buffer7>>2]|0;
  18381. $17 = (_llvm_stacksave()|0);
  18382. $$alloca_mul34 = $16;
  18383. $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);;
  18384. $19 = HEAP32[$vararg_buffer7>>2]|0;
  18385. _glGetShaderInfoLog(($7|0),($19|0),($5|0),($18|0));
  18386. HEAP32[$vararg_buffer10>>2] = $18;
  18387. _TraceLog(0,7411,$vararg_buffer10);
  18388. _llvm_stackrestore(($17|0));
  18389. }
  18390. $20 = (_glCreateProgram()|0);
  18391. _glAttachShader(($20|0),($6|0));
  18392. _glAttachShader(($20|0),($7|0));
  18393. _glBindAttribLocation(($20|0),0,(7206|0));
  18394. _glBindAttribLocation(($20|0),1,(7221|0));
  18395. _glBindAttribLocation(($20|0),2,(7252|0));
  18396. _glBindAttribLocation(($20|0),3,(7279|0));
  18397. _glBindAttribLocation(($20|0),4,(7265|0));
  18398. _glBindAttribLocation(($20|0),5,(7236|0));
  18399. _glLinkProgram(($20|0));
  18400. _glGetProgramiv(($20|0),35714,($4|0));
  18401. $21 = HEAP32[$4>>2]|0;
  18402. $22 = ($21|0)==(0);
  18403. if ($22) {
  18404. HEAP32[$vararg_buffer16>>2] = $20;
  18405. _TraceLog(2,7567,$vararg_buffer16);
  18406. HEAP32[$vararg_buffer16>>2] = 0;
  18407. _glGetProgramiv(($20|0),35716,($vararg_buffer16|0));
  18408. $23 = HEAP32[$vararg_buffer16>>2]|0;
  18409. $24 = (_llvm_stacksave()|0);
  18410. $$alloca_mul36 = $23;
  18411. $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);;
  18412. $26 = HEAP32[$vararg_buffer16>>2]|0;
  18413. _glGetProgramInfoLog(($20|0),($26|0),($5|0),($25|0));
  18414. HEAP32[$vararg_buffer19>>2] = $25;
  18415. _TraceLog(0,7411,$vararg_buffer19);
  18416. _glDeleteProgram(($20|0));
  18417. _llvm_stackrestore(($24|0));
  18418. $$0 = 0;
  18419. _glDeleteShader(($6|0));
  18420. _glDeleteShader(($7|0));
  18421. STACKTOP = sp;return ($$0|0);
  18422. } else {
  18423. HEAP32[$vararg_buffer22>>2] = $20;
  18424. _TraceLog(0,7613,$vararg_buffer22);
  18425. $$0 = $20;
  18426. _glDeleteShader(($6|0));
  18427. _glDeleteShader(($7|0));
  18428. STACKTOP = sp;return ($$0|0);
  18429. }
  18430. return (0)|0;
  18431. }
  18432. function _LoadDefaultShaderLocations($0) {
  18433. $0 = $0|0;
  18434. 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;
  18435. 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;
  18436. var sp = 0;
  18437. sp = STACKTOP;
  18438. $1 = HEAP32[$0>>2]|0;
  18439. $2 = (_glGetAttribLocation(($1|0),(7206|0))|0);
  18440. $3 = ((($0)) + 4|0);
  18441. HEAP32[$3>>2] = $2;
  18442. $4 = HEAP32[$0>>2]|0;
  18443. $5 = (_glGetAttribLocation(($4|0),(7221|0))|0);
  18444. $6 = ((($0)) + 8|0);
  18445. HEAP32[$6>>2] = $5;
  18446. $7 = HEAP32[$0>>2]|0;
  18447. $8 = (_glGetAttribLocation(($7|0),(7236|0))|0);
  18448. $9 = ((($0)) + 12|0);
  18449. HEAP32[$9>>2] = $8;
  18450. $10 = HEAP32[$0>>2]|0;
  18451. $11 = (_glGetAttribLocation(($10|0),(7252|0))|0);
  18452. $12 = ((($0)) + 16|0);
  18453. HEAP32[$12>>2] = $11;
  18454. $13 = HEAP32[$0>>2]|0;
  18455. $14 = (_glGetAttribLocation(($13|0),(7265|0))|0);
  18456. $15 = ((($0)) + 20|0);
  18457. HEAP32[$15>>2] = $14;
  18458. $16 = HEAP32[$0>>2]|0;
  18459. $17 = (_glGetAttribLocation(($16|0),(7279|0))|0);
  18460. $18 = ((($0)) + 24|0);
  18461. HEAP32[$18>>2] = $17;
  18462. $19 = HEAP32[$0>>2]|0;
  18463. $20 = (_glGetUniformLocation(($19|0),(7291|0))|0);
  18464. $21 = ((($0)) + 28|0);
  18465. HEAP32[$21>>2] = $20;
  18466. $22 = HEAP32[$0>>2]|0;
  18467. $23 = (_glGetUniformLocation(($22|0),(7301|0))|0);
  18468. $24 = ((($0)) + 32|0);
  18469. HEAP32[$24>>2] = $23;
  18470. $25 = HEAP32[$0>>2]|0;
  18471. $26 = (_glGetUniformLocation(($25|0),(7312|0))|0);
  18472. $27 = ((($0)) + 36|0);
  18473. HEAP32[$27>>2] = $26;
  18474. $28 = HEAP32[$0>>2]|0;
  18475. $29 = (_glGetUniformLocation(($28|0),(7323|0))|0);
  18476. $30 = ((($0)) + 40|0);
  18477. HEAP32[$30>>2] = $29;
  18478. $31 = HEAP32[$0>>2]|0;
  18479. $32 = (_glGetUniformLocation(($31|0),(7335|0))|0);
  18480. $33 = ((($0)) + 44|0);
  18481. HEAP32[$33>>2] = $32;
  18482. $34 = HEAP32[$0>>2]|0;
  18483. $35 = (_glGetUniformLocation(($34|0),(7344|0))|0);
  18484. $36 = ((($0)) + 48|0);
  18485. HEAP32[$36>>2] = $35;
  18486. $37 = HEAP32[$0>>2]|0;
  18487. $38 = (_glGetUniformLocation(($37|0),(7353|0))|0);
  18488. $39 = ((($0)) + 52|0);
  18489. HEAP32[$39>>2] = $38;
  18490. return;
  18491. }
  18492. function _IsMouseButtonPressed($0) {
  18493. $0 = $0|0;
  18494. var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $or$cond = 0, label = 0, sp = 0;
  18495. sp = STACKTOP;
  18496. $1 = (35949 + ($0)|0);
  18497. $2 = HEAP8[$1>>0]|0;
  18498. $3 = (35952 + ($0)|0);
  18499. $4 = HEAP8[$3>>0]|0;
  18500. $5 = ($2<<24>>24)!=($4<<24>>24);
  18501. $6 = ($2<<24>>24)==(1);
  18502. $or$cond = $6 & $5;
  18503. $$0 = $or$cond&1;
  18504. return ($$0|0);
  18505. }
  18506. function _IsMouseButtonReleased($0) {
  18507. $0 = $0|0;
  18508. var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $or$cond = 0, label = 0, sp = 0;
  18509. sp = STACKTOP;
  18510. $1 = (35949 + ($0)|0);
  18511. $2 = HEAP8[$1>>0]|0;
  18512. $3 = (35952 + ($0)|0);
  18513. $4 = HEAP8[$3>>0]|0;
  18514. $5 = ($2<<24>>24)!=($4<<24>>24);
  18515. $6 = ($2<<24>>24)==(0);
  18516. $or$cond = $6 & $5;
  18517. $$0 = $or$cond&1;
  18518. return ($$0|0);
  18519. }
  18520. function _rlClearScreenBuffers() {
  18521. var label = 0, sp = 0;
  18522. sp = STACKTOP;
  18523. _glClear(16640);
  18524. return;
  18525. }
  18526. function _CloseWindow() {
  18527. var $0 = 0, $vararg_buffer = 0, label = 0, sp = 0;
  18528. sp = STACKTOP;
  18529. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  18530. $vararg_buffer = sp;
  18531. _UnloadDefaultFont();
  18532. _rlglClose();
  18533. $0 = HEAP32[7744]|0;
  18534. _glfwDestroyWindow(($0|0));
  18535. _glfwTerminate();
  18536. _TraceLog(0,7925,$vararg_buffer);
  18537. STACKTOP = sp;return;
  18538. }
  18539. function _UnloadDefaultFont() {
  18540. var $$byval_copy = 0, $0 = 0, label = 0, sp = 0;
  18541. sp = STACKTOP;
  18542. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  18543. $$byval_copy = sp;
  18544. ;HEAP32[$$byval_copy>>2]=HEAP32[31016>>2]|0;HEAP32[$$byval_copy+4>>2]=HEAP32[31016+4>>2]|0;HEAP32[$$byval_copy+8>>2]=HEAP32[31016+8>>2]|0;HEAP32[$$byval_copy+12>>2]=HEAP32[31016+12>>2]|0;HEAP32[$$byval_copy+16>>2]=HEAP32[31016+16>>2]|0;
  18545. _UnloadTexture($$byval_copy);
  18546. $0 = HEAP32[(31044)>>2]|0;
  18547. _free($0);
  18548. STACKTOP = sp;return;
  18549. }
  18550. function _rlglClose() {
  18551. var $0 = 0, $1 = 0, $vararg_buffer = 0, label = 0, sp = 0;
  18552. sp = STACKTOP;
  18553. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  18554. $vararg_buffer = sp;
  18555. _UnloadDefaultShader();
  18556. _UnloadDefaultBuffers();
  18557. _glDeleteTextures(1,(31328|0));
  18558. $0 = HEAP32[7832]|0;
  18559. HEAP32[$vararg_buffer>>2] = $0;
  18560. _TraceLog(0,7952,$vararg_buffer);
  18561. $1 = HEAP32[7862]|0;
  18562. _free($1);
  18563. STACKTOP = sp;return;
  18564. }
  18565. function _UnloadDefaultShader() {
  18566. var $0 = 0, label = 0, sp = 0;
  18567. sp = STACKTOP;
  18568. _glUseProgram(0);
  18569. $0 = HEAP32[7833]|0;
  18570. _glDeleteProgram(($0|0));
  18571. return;
  18572. }
  18573. function _UnloadDefaultBuffers() {
  18574. 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;
  18575. sp = STACKTOP;
  18576. $0 = HEAP32[7825]|0;
  18577. $1 = ($0|0)==(0);
  18578. if (!($1)) {
  18579. $2 = HEAP32[7827]|0;
  18580. FUNCTION_TABLE_vi[$2 & 31](0);
  18581. }
  18582. _glDisableVertexAttribArray(0);
  18583. _glDisableVertexAttribArray(1);
  18584. _glDisableVertexAttribArray(2);
  18585. _glDisableVertexAttribArray(3);
  18586. _glBindBuffer(34962,0);
  18587. _glBindBuffer(34963,0);
  18588. _glDeleteBuffers(1,((32524)|0));
  18589. _glDeleteBuffers(1,((32528)|0));
  18590. _glDeleteBuffers(1,((32572)|0));
  18591. _glDeleteBuffers(1,((32576)|0));
  18592. _glDeleteBuffers(1,((32620)|0));
  18593. _glDeleteBuffers(1,((32624)|0));
  18594. _glDeleteBuffers(1,((32628)|0));
  18595. _glDeleteBuffers(1,((32632)|0));
  18596. $3 = HEAP32[7825]|0;
  18597. $4 = ($3|0)==(0);
  18598. if (!($4)) {
  18599. $5 = HEAP32[7828]|0;
  18600. FUNCTION_TABLE_vii[$5 & 63](1,(32520));
  18601. $6 = HEAP32[7828]|0;
  18602. FUNCTION_TABLE_vii[$6 & 63](1,(32568));
  18603. $7 = HEAP32[7828]|0;
  18604. FUNCTION_TABLE_vii[$7 & 63](1,(32616));
  18605. }
  18606. $8 = HEAP32[(32504)>>2]|0;
  18607. _free($8);
  18608. $9 = HEAP32[(32512)>>2]|0;
  18609. _free($9);
  18610. $10 = HEAP32[(32552)>>2]|0;
  18611. _free($10);
  18612. $11 = HEAP32[(32560)>>2]|0;
  18613. _free($11);
  18614. $12 = HEAP32[(32600)>>2]|0;
  18615. _free($12);
  18616. $13 = HEAP32[(32604)>>2]|0;
  18617. _free($13);
  18618. $14 = HEAP32[(32608)>>2]|0;
  18619. _free($14);
  18620. $15 = HEAP32[(32612)>>2]|0;
  18621. _free($15);
  18622. return;
  18623. }
  18624. function _UnloadTexture($0) {
  18625. $0 = $0|0;
  18626. var $1 = 0, $2 = 0, $3 = 0, $vararg_buffer = 0, label = 0, sp = 0;
  18627. sp = STACKTOP;
  18628. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  18629. $vararg_buffer = sp;
  18630. $1 = HEAP32[$0>>2]|0;
  18631. $2 = ($1|0)==(0);
  18632. if ($2) {
  18633. STACKTOP = sp;return;
  18634. }
  18635. _rlDeleteTextures($1);
  18636. $3 = HEAP32[$0>>2]|0;
  18637. HEAP32[$vararg_buffer>>2] = $3;
  18638. _TraceLog(0,8017,$vararg_buffer);
  18639. STACKTOP = sp;return;
  18640. }
  18641. function _rlDeleteTextures($0) {
  18642. $0 = $0|0;
  18643. var $1 = 0, $2 = 0, label = 0, sp = 0;
  18644. sp = STACKTOP;
  18645. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  18646. $1 = sp;
  18647. HEAP32[$1>>2] = $0;
  18648. $2 = ($0|0)==(0);
  18649. if (!($2)) {
  18650. _glDeleteTextures(1,($1|0));
  18651. }
  18652. STACKTOP = sp;return;
  18653. }
  18654. function _BeginDrawing() {
  18655. var $0 = 0.0, $1 = 0.0, $2 = 0.0, $downscaleView$byval_copy = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  18656. sp = STACKTOP;
  18657. STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
  18658. $downscaleView$byval_copy = sp;
  18659. $0 = (+_GetTime());
  18660. HEAPF64[1778] = $0;
  18661. $1 = +HEAPF64[1761];
  18662. $2 = $0 - $1;
  18663. HEAPF64[1779] = $2;
  18664. HEAPF64[1761] = $0;
  18665. _rlClearScreenBuffers();
  18666. _rlLoadIdentity();
  18667. dest=$downscaleView$byval_copy; src=31072; 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));
  18668. (_MatrixToFloat($downscaleView$byval_copy)|0);
  18669. _rlMultMatrixf(32644);
  18670. STACKTOP = sp;return;
  18671. }
  18672. function _MatrixToFloat($0) {
  18673. $0 = $0|0;
  18674. 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;
  18675. 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;
  18676. sp = STACKTOP;
  18677. $1 = HEAP32[$0>>2]|0;
  18678. HEAP32[8161] = $1;
  18679. $2 = ((($0)) + 4|0);
  18680. $3 = HEAP32[$2>>2]|0;
  18681. HEAP32[(32648)>>2] = $3;
  18682. $4 = ((($0)) + 8|0);
  18683. $5 = HEAP32[$4>>2]|0;
  18684. HEAP32[(32652)>>2] = $5;
  18685. $6 = ((($0)) + 12|0);
  18686. $7 = HEAP32[$6>>2]|0;
  18687. HEAP32[(32656)>>2] = $7;
  18688. $8 = ((($0)) + 16|0);
  18689. $9 = HEAP32[$8>>2]|0;
  18690. HEAP32[(32660)>>2] = $9;
  18691. $10 = ((($0)) + 20|0);
  18692. $11 = HEAP32[$10>>2]|0;
  18693. HEAP32[(32664)>>2] = $11;
  18694. $12 = ((($0)) + 24|0);
  18695. $13 = HEAP32[$12>>2]|0;
  18696. HEAP32[(32668)>>2] = $13;
  18697. $14 = ((($0)) + 28|0);
  18698. $15 = HEAP32[$14>>2]|0;
  18699. HEAP32[(32672)>>2] = $15;
  18700. $16 = ((($0)) + 32|0);
  18701. $17 = HEAP32[$16>>2]|0;
  18702. HEAP32[(32676)>>2] = $17;
  18703. $18 = ((($0)) + 36|0);
  18704. $19 = HEAP32[$18>>2]|0;
  18705. HEAP32[(32680)>>2] = $19;
  18706. $20 = ((($0)) + 40|0);
  18707. $21 = HEAP32[$20>>2]|0;
  18708. HEAP32[(32684)>>2] = $21;
  18709. $22 = ((($0)) + 44|0);
  18710. $23 = HEAP32[$22>>2]|0;
  18711. HEAP32[(32688)>>2] = $23;
  18712. $24 = ((($0)) + 48|0);
  18713. $25 = HEAP32[$24>>2]|0;
  18714. HEAP32[(32692)>>2] = $25;
  18715. $26 = ((($0)) + 52|0);
  18716. $27 = HEAP32[$26>>2]|0;
  18717. HEAP32[(32696)>>2] = $27;
  18718. $28 = ((($0)) + 56|0);
  18719. $29 = HEAP32[$28>>2]|0;
  18720. HEAP32[(32700)>>2] = $29;
  18721. $30 = ((($0)) + 60|0);
  18722. $31 = HEAP32[$30>>2]|0;
  18723. HEAP32[(32704)>>2] = $31;
  18724. return (32644|0);
  18725. }
  18726. function _rlMultMatrixf($0) {
  18727. $0 = $0|0;
  18728. 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;
  18729. 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;
  18730. 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;
  18731. sp = STACKTOP;
  18732. STACKTOP = STACKTOP + 256|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(256|0);
  18733. $$byval_copy1 = sp + 192|0;
  18734. $$byval_copy = sp + 128|0;
  18735. $1 = sp + 64|0;
  18736. $2 = sp;
  18737. $3 = HEAP32[$0>>2]|0;
  18738. HEAP32[$1>>2] = $3;
  18739. $4 = ((($1)) + 4|0);
  18740. $5 = ((($0)) + 4|0);
  18741. $6 = HEAP32[$5>>2]|0;
  18742. HEAP32[$4>>2] = $6;
  18743. $7 = ((($1)) + 8|0);
  18744. $8 = ((($0)) + 8|0);
  18745. $9 = HEAP32[$8>>2]|0;
  18746. HEAP32[$7>>2] = $9;
  18747. $10 = ((($1)) + 12|0);
  18748. $11 = ((($0)) + 12|0);
  18749. $12 = HEAP32[$11>>2]|0;
  18750. HEAP32[$10>>2] = $12;
  18751. $13 = ((($1)) + 16|0);
  18752. $14 = ((($0)) + 16|0);
  18753. $15 = HEAP32[$14>>2]|0;
  18754. HEAP32[$13>>2] = $15;
  18755. $16 = ((($1)) + 20|0);
  18756. $17 = ((($0)) + 20|0);
  18757. $18 = HEAP32[$17>>2]|0;
  18758. HEAP32[$16>>2] = $18;
  18759. $19 = ((($1)) + 24|0);
  18760. $20 = ((($0)) + 24|0);
  18761. $21 = HEAP32[$20>>2]|0;
  18762. HEAP32[$19>>2] = $21;
  18763. $22 = ((($1)) + 28|0);
  18764. $23 = ((($0)) + 28|0);
  18765. $24 = HEAP32[$23>>2]|0;
  18766. HEAP32[$22>>2] = $24;
  18767. $25 = ((($1)) + 32|0);
  18768. $26 = ((($0)) + 32|0);
  18769. $27 = HEAP32[$26>>2]|0;
  18770. HEAP32[$25>>2] = $27;
  18771. $28 = ((($1)) + 36|0);
  18772. $29 = ((($0)) + 36|0);
  18773. $30 = HEAP32[$29>>2]|0;
  18774. HEAP32[$28>>2] = $30;
  18775. $31 = ((($1)) + 40|0);
  18776. $32 = ((($0)) + 40|0);
  18777. $33 = HEAP32[$32>>2]|0;
  18778. HEAP32[$31>>2] = $33;
  18779. $34 = ((($1)) + 44|0);
  18780. $35 = ((($0)) + 44|0);
  18781. $36 = HEAP32[$35>>2]|0;
  18782. HEAP32[$34>>2] = $36;
  18783. $37 = ((($1)) + 48|0);
  18784. $38 = ((($0)) + 48|0);
  18785. $39 = HEAP32[$38>>2]|0;
  18786. HEAP32[$37>>2] = $39;
  18787. $40 = ((($1)) + 52|0);
  18788. $41 = ((($0)) + 52|0);
  18789. $42 = HEAP32[$41>>2]|0;
  18790. HEAP32[$40>>2] = $42;
  18791. $43 = ((($1)) + 56|0);
  18792. $44 = ((($0)) + 56|0);
  18793. $45 = HEAP32[$44>>2]|0;
  18794. HEAP32[$43>>2] = $45;
  18795. $46 = ((($1)) + 60|0);
  18796. $47 = ((($0)) + 60|0);
  18797. $48 = HEAP32[$47>>2]|0;
  18798. HEAP32[$46>>2] = $48;
  18799. $49 = HEAP32[7791]|0;
  18800. 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));
  18801. 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));
  18802. _MatrixMultiply($2,$$byval_copy,$$byval_copy1);
  18803. 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));
  18804. STACKTOP = sp;return;
  18805. }
  18806. function _EndDrawing() {
  18807. 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;
  18808. sp = STACKTOP;
  18809. _rlglDraw();
  18810. _SwapBuffers();
  18811. _PollInputEvents();
  18812. $0 = (+_GetTime());
  18813. HEAPF64[1778] = $0;
  18814. $1 = +HEAPF64[1761];
  18815. $2 = $0 - $1;
  18816. HEAPF64[1780] = $2;
  18817. HEAPF64[1761] = $0;
  18818. $3 = +HEAPF64[1779];
  18819. $4 = $2 + $3;
  18820. HEAPF64[1781] = $4;
  18821. $5 = +HEAPF64[1758];
  18822. $6 = $4 < $5;
  18823. if (!($6)) {
  18824. return;
  18825. }
  18826. $7 = $5 - $4;
  18827. $8 = $7 * 1000.0;
  18828. $9 = $8;
  18829. _Wait($9);
  18830. $10 = (+_GetTime());
  18831. HEAPF64[1778] = $10;
  18832. $11 = +HEAPF64[1761];
  18833. $12 = $10 - $11;
  18834. HEAPF64[1761] = $10;
  18835. $13 = +HEAPF64[1781];
  18836. $14 = $12 + $13;
  18837. HEAPF64[1781] = $14;
  18838. return;
  18839. }
  18840. function _rlglDraw() {
  18841. var label = 0, sp = 0;
  18842. sp = STACKTOP;
  18843. _UpdateDefaultBuffers();
  18844. _DrawDefaultBuffers();
  18845. return;
  18846. }
  18847. function _SwapBuffers() {
  18848. var $0 = 0, label = 0, sp = 0;
  18849. sp = STACKTOP;
  18850. $0 = HEAP32[7744]|0;
  18851. _glfwSwapBuffers(($0|0));
  18852. return;
  18853. }
  18854. function _PollInputEvents() {
  18855. 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;
  18856. 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;
  18857. 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;
  18858. sp = STACKTOP;
  18859. STACKTOP = STACKTOP + 1456|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(1456|0);
  18860. $0 = sp + 1440|0;
  18861. $1 = sp + 1432|0;
  18862. $2 = sp;
  18863. _UpdateGestures();
  18864. HEAP32[743] = -1;
  18865. HEAP32[745] = -1;
  18866. HEAP32[8177] = 0;
  18867. $3 = HEAP32[7744]|0;
  18868. _glfwGetCursorPos(($3|0),($0|0),($1|0));
  18869. $4 = +HEAPF64[$0>>3];
  18870. $5 = $4;
  18871. HEAPF32[3514] = $5;
  18872. $6 = +HEAPF64[$1>>3];
  18873. $7 = $6;
  18874. HEAPF32[(14060)>>2] = $7;
  18875. _memcpy((36467|0),(35955|0),512)|0;
  18876. ;HEAP8[35952>>0]=HEAP8[35949>>0]|0;HEAP8[35952+1>>0]=HEAP8[35949+1>>0]|0;HEAP8[35952+2>>0]=HEAP8[35949+2>>0]|0;
  18877. $8 = HEAP32[8160]|0;
  18878. HEAP32[7747] = $8;
  18879. HEAP32[8160] = 0;
  18880. $9 = (_emscripten_get_num_gamepads()|0);
  18881. $10 = ($9|0)>(0);
  18882. if (!($10)) {
  18883. STACKTOP = sp;return;
  18884. }
  18885. $11 = ((($2)) + 12|0);
  18886. $12 = ((($2)) + 8|0);
  18887. $$05160 = 0;
  18888. while(1) {
  18889. $scevgep = (36979 + ($$05160<<5)|0);
  18890. $scevgep67 = (37107 + ($$05160<<5)|0);
  18891. 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));
  18892. $13 = (_emscripten_get_gamepad_status(($$05160|0),($2|0))|0);
  18893. $14 = ($13|0)==(0);
  18894. if ($14) {
  18895. $15 = HEAP32[$11>>2]|0;
  18896. $16 = ($15|0)>(0);
  18897. if ($16) {
  18898. $17 = HEAP32[$11>>2]|0;
  18899. $$04857 = 0;
  18900. while(1) {
  18901. $21 = (((($2)) + 1040|0) + ($$04857<<2)|0);
  18902. $22 = HEAP32[$21>>2]|0;
  18903. $23 = ($22|0)==(1);
  18904. $24 = ((37107 + ($$05160<<5)|0) + ($$04857)|0);
  18905. if ($23) {
  18906. HEAP8[$24>>0] = 1;
  18907. HEAP32[745] = $$04857;
  18908. } else {
  18909. HEAP8[$24>>0] = 0;
  18910. }
  18911. $25 = (($$04857) + 1)|0;
  18912. $26 = ($25|0)<($17|0);
  18913. $27 = ($25|0)<(32);
  18914. $28 = $27 & $26;
  18915. if ($28) {
  18916. $$04857 = $25;
  18917. } else {
  18918. break;
  18919. }
  18920. }
  18921. }
  18922. $18 = HEAP32[$12>>2]|0;
  18923. $19 = ($18|0)>(0);
  18924. if ($19) {
  18925. $20 = HEAP32[$12>>2]|0;
  18926. $$058 = 0;
  18927. while(1) {
  18928. $29 = (((($2)) + 16|0) + ($$058<<3)|0);
  18929. $30 = +HEAPF64[$29>>3];
  18930. $31 = $30;
  18931. $32 = ((32712 + ($$05160<<5)|0) + ($$058<<2)|0);
  18932. HEAPF32[$32>>2] = $31;
  18933. $33 = (($$058) + 1)|0;
  18934. $34 = ($33|0)<($20|0);
  18935. $35 = ($33|0)<(8);
  18936. $36 = $35 & $34;
  18937. if ($36) {
  18938. $$058 = $33;
  18939. } else {
  18940. $$lcssa = $20;
  18941. break;
  18942. }
  18943. }
  18944. } else {
  18945. $$lcssa = $18;
  18946. }
  18947. HEAP32[8177] = $$lcssa;
  18948. }
  18949. $37 = (($$05160) + 1)|0;
  18950. $38 = ($37|0)<($9|0);
  18951. $39 = ($37|0)<(4);
  18952. $40 = $38 & $39;
  18953. if ($40) {
  18954. $$05160 = $37;
  18955. } else {
  18956. break;
  18957. }
  18958. }
  18959. STACKTOP = sp;return;
  18960. }
  18961. function _Wait($0) {
  18962. $0 = +$0;
  18963. 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;
  18964. sp = STACKTOP;
  18965. $1 = (+_GetTime());
  18966. $2 = 0.0 - $1;
  18967. $3 = $0 / 1000.0;
  18968. $4 = $3;
  18969. $5 = $2 < $4;
  18970. if (!($5)) {
  18971. return;
  18972. }
  18973. while(1) {
  18974. $6 = (+_GetTime());
  18975. $7 = $6 - $1;
  18976. $8 = $7 < $4;
  18977. if (!($8)) {
  18978. break;
  18979. }
  18980. }
  18981. return;
  18982. }
  18983. function _UpdateDefaultBuffers() {
  18984. 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;
  18985. 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;
  18986. var $45 = 0, $46 = 0, $47 = 0, $48 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  18987. sp = STACKTOP;
  18988. $0 = HEAP32[8123]|0;
  18989. $1 = ($0|0)>(0);
  18990. if ($1) {
  18991. $2 = HEAP32[7825]|0;
  18992. $3 = ($2|0)==(0);
  18993. if (!($3)) {
  18994. $4 = HEAP32[7827]|0;
  18995. $5 = HEAP32[(32520)>>2]|0;
  18996. FUNCTION_TABLE_vi[$4 & 31]($5);
  18997. }
  18998. $6 = HEAP32[(32524)>>2]|0;
  18999. _glBindBuffer(34962,($6|0));
  19000. $7 = HEAP32[8123]|0;
  19001. $8 = ($7*12)|0;
  19002. $9 = HEAP32[(32504)>>2]|0;
  19003. _glBufferSubData(34962,0,($8|0),($9|0));
  19004. $10 = HEAP32[(32528)>>2]|0;
  19005. _glBindBuffer(34962,($10|0));
  19006. $11 = HEAP32[(32500)>>2]|0;
  19007. $12 = $11 << 2;
  19008. $13 = HEAP32[(32512)>>2]|0;
  19009. _glBufferSubData(34962,0,($12|0),($13|0));
  19010. }
  19011. $14 = HEAP32[8135]|0;
  19012. $15 = ($14|0)>(0);
  19013. if ($15) {
  19014. $16 = HEAP32[7825]|0;
  19015. $17 = ($16|0)==(0);
  19016. if (!($17)) {
  19017. $18 = HEAP32[7827]|0;
  19018. $19 = HEAP32[(32568)>>2]|0;
  19019. FUNCTION_TABLE_vi[$18 & 31]($19);
  19020. }
  19021. $20 = HEAP32[(32572)>>2]|0;
  19022. _glBindBuffer(34962,($20|0));
  19023. $21 = HEAP32[8135]|0;
  19024. $22 = ($21*12)|0;
  19025. $23 = HEAP32[(32552)>>2]|0;
  19026. _glBufferSubData(34962,0,($22|0),($23|0));
  19027. $24 = HEAP32[(32576)>>2]|0;
  19028. _glBindBuffer(34962,($24|0));
  19029. $25 = HEAP32[(32548)>>2]|0;
  19030. $26 = $25 << 2;
  19031. $27 = HEAP32[(32560)>>2]|0;
  19032. _glBufferSubData(34962,0,($26|0),($27|0));
  19033. }
  19034. $28 = HEAP32[8147]|0;
  19035. $29 = ($28|0)>(0);
  19036. if ($29) {
  19037. $30 = HEAP32[7825]|0;
  19038. $31 = ($30|0)==(0);
  19039. if (!($31)) {
  19040. $32 = HEAP32[7827]|0;
  19041. $33 = HEAP32[(32616)>>2]|0;
  19042. FUNCTION_TABLE_vi[$32 & 31]($33);
  19043. }
  19044. $34 = HEAP32[(32620)>>2]|0;
  19045. _glBindBuffer(34962,($34|0));
  19046. $35 = HEAP32[8147]|0;
  19047. $36 = ($35*12)|0;
  19048. $37 = HEAP32[(32600)>>2]|0;
  19049. _glBufferSubData(34962,0,($36|0),($37|0));
  19050. $38 = HEAP32[(32624)>>2]|0;
  19051. _glBindBuffer(34962,($38|0));
  19052. $39 = HEAP32[8147]|0;
  19053. $40 = $39 << 3;
  19054. $41 = HEAP32[(32604)>>2]|0;
  19055. _glBufferSubData(34962,0,($40|0),($41|0));
  19056. $42 = HEAP32[(32628)>>2]|0;
  19057. _glBindBuffer(34962,($42|0));
  19058. $43 = HEAP32[8147]|0;
  19059. $44 = $43 << 2;
  19060. $45 = HEAP32[(32608)>>2]|0;
  19061. _glBufferSubData(34962,0,($44|0),($45|0));
  19062. }
  19063. $46 = HEAP32[7825]|0;
  19064. $47 = ($46|0)==(0);
  19065. if ($47) {
  19066. return;
  19067. }
  19068. $48 = HEAP32[7827]|0;
  19069. FUNCTION_TABLE_vi[$48 & 31](0);
  19070. return;
  19071. }
  19072. function _DrawDefaultBuffers() {
  19073. 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;
  19074. 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;
  19075. 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;
  19076. 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;
  19077. 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;
  19078. var $or$cond = 0, $or$cond3 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  19079. sp = STACKTOP;
  19080. STACKTOP = STACKTOP + 320|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(320|0);
  19081. $$byval_copy2 = sp + 256|0;
  19082. $modelview$byval_copy = sp + 192|0;
  19083. $0 = sp + 128|0;
  19084. $1 = sp + 64|0;
  19085. $2 = sp;
  19086. dest=$0; src=31168; 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));
  19087. dest=$1; src=31232; 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));
  19088. $3 = HEAP32[8210]|0;
  19089. $4 = ($3|0)!=(0);
  19090. $$ = $4 ? 2 : 1;
  19091. $$02932 = 0;
  19092. while(1) {
  19093. if ($4) {
  19094. 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));
  19095. 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));
  19096. _SetStereoView($$02932,$modelview$byval_copy,$$byval_copy2);
  19097. }
  19098. $8 = HEAP32[8123]|0;
  19099. $9 = ($8|0)>(0);
  19100. $10 = HEAP32[8135]|0;
  19101. $11 = ($10|0)>(0);
  19102. $or$cond = $9 | $11;
  19103. $12 = HEAP32[8147]|0;
  19104. $13 = ($12|0)>(0);
  19105. $or$cond3 = $or$cond | $13;
  19106. if ($or$cond3) {
  19107. $14 = HEAP32[7847]|0;
  19108. _glUseProgram(($14|0));
  19109. dest=$modelview$byval_copy; src=31232; 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));
  19110. dest=$$byval_copy2; src=31168; 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));
  19111. _MatrixMultiply($2,$modelview$byval_copy,$$byval_copy2);
  19112. $15 = HEAP32[(31416)>>2]|0;
  19113. 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));
  19114. $16 = (_MatrixToFloat($$byval_copy2)|0);
  19115. _glUniformMatrix4fv(($15|0),1,0,($16|0));
  19116. $17 = HEAP32[(31420)>>2]|0;
  19117. _glUniform4f(($17|0),1.0,1.0,1.0,1.0);
  19118. $18 = HEAP32[(31432)>>2]|0;
  19119. _glUniform1i(($18|0),0);
  19120. }
  19121. $19 = HEAP32[8123]|0;
  19122. $20 = ($19|0)>(0);
  19123. if ($20) {
  19124. $21 = HEAP32[7832]|0;
  19125. _glBindTexture(3553,($21|0));
  19126. $22 = HEAP32[7825]|0;
  19127. $23 = ($22|0)==(0);
  19128. if ($23) {
  19129. $26 = HEAP32[(32524)>>2]|0;
  19130. _glBindBuffer(34962,($26|0));
  19131. $27 = HEAP32[(31392)>>2]|0;
  19132. _glVertexAttribPointer(($27|0),3,5126,0,0,(0|0));
  19133. $28 = HEAP32[(31392)>>2]|0;
  19134. _glEnableVertexAttribArray(($28|0));
  19135. $29 = HEAP32[(32528)>>2]|0;
  19136. _glBindBuffer(34962,($29|0));
  19137. $30 = HEAP32[(31412)>>2]|0;
  19138. _glVertexAttribPointer(($30|0),4,5121,1,0,(0|0));
  19139. $31 = HEAP32[(31412)>>2]|0;
  19140. _glEnableVertexAttribArray(($31|0));
  19141. } else {
  19142. $24 = HEAP32[7827]|0;
  19143. $25 = HEAP32[(32520)>>2]|0;
  19144. FUNCTION_TABLE_vi[$24 & 31]($25);
  19145. }
  19146. $32 = HEAP32[8123]|0;
  19147. _glDrawArrays(1,0,($32|0));
  19148. $33 = HEAP32[7825]|0;
  19149. $34 = ($33|0)==(0);
  19150. if ($34) {
  19151. _glBindBuffer(34962,0);
  19152. }
  19153. _glBindTexture(3553,0);
  19154. }
  19155. $35 = HEAP32[8135]|0;
  19156. $36 = ($35|0)>(0);
  19157. if ($36) {
  19158. $37 = HEAP32[7832]|0;
  19159. _glBindTexture(3553,($37|0));
  19160. $38 = HEAP32[7825]|0;
  19161. $39 = ($38|0)==(0);
  19162. if ($39) {
  19163. $42 = HEAP32[(32572)>>2]|0;
  19164. _glBindBuffer(34962,($42|0));
  19165. $43 = HEAP32[(31392)>>2]|0;
  19166. _glVertexAttribPointer(($43|0),3,5126,0,0,(0|0));
  19167. $44 = HEAP32[(31392)>>2]|0;
  19168. _glEnableVertexAttribArray(($44|0));
  19169. $45 = HEAP32[(32576)>>2]|0;
  19170. _glBindBuffer(34962,($45|0));
  19171. $46 = HEAP32[(31412)>>2]|0;
  19172. _glVertexAttribPointer(($46|0),4,5121,1,0,(0|0));
  19173. $47 = HEAP32[(31412)>>2]|0;
  19174. _glEnableVertexAttribArray(($47|0));
  19175. } else {
  19176. $40 = HEAP32[7827]|0;
  19177. $41 = HEAP32[(32568)>>2]|0;
  19178. FUNCTION_TABLE_vi[$40 & 31]($41);
  19179. }
  19180. $48 = HEAP32[8135]|0;
  19181. _glDrawArrays(4,0,($48|0));
  19182. $49 = HEAP32[7825]|0;
  19183. $50 = ($49|0)==(0);
  19184. if ($50) {
  19185. _glBindBuffer(34962,0);
  19186. }
  19187. _glBindTexture(3553,0);
  19188. }
  19189. $51 = HEAP32[8147]|0;
  19190. $52 = ($51|0)>(0);
  19191. if ($52) {
  19192. $53 = HEAP32[7825]|0;
  19193. $54 = ($53|0)==(0);
  19194. if ($54) {
  19195. $57 = HEAP32[(32620)>>2]|0;
  19196. _glBindBuffer(34962,($57|0));
  19197. $58 = HEAP32[(31392)>>2]|0;
  19198. _glVertexAttribPointer(($58|0),3,5126,0,0,(0|0));
  19199. $59 = HEAP32[(31392)>>2]|0;
  19200. _glEnableVertexAttribArray(($59|0));
  19201. $60 = HEAP32[(32624)>>2]|0;
  19202. _glBindBuffer(34962,($60|0));
  19203. $61 = HEAP32[(31396)>>2]|0;
  19204. _glVertexAttribPointer(($61|0),2,5126,0,0,(0|0));
  19205. $62 = HEAP32[(31396)>>2]|0;
  19206. _glEnableVertexAttribArray(($62|0));
  19207. $63 = HEAP32[(32628)>>2]|0;
  19208. _glBindBuffer(34962,($63|0));
  19209. $64 = HEAP32[(31412)>>2]|0;
  19210. _glVertexAttribPointer(($64|0),4,5121,1,0,(0|0));
  19211. $65 = HEAP32[(31412)>>2]|0;
  19212. _glEnableVertexAttribArray(($65|0));
  19213. $66 = HEAP32[(32632)>>2]|0;
  19214. _glBindBuffer(34963,($66|0));
  19215. } else {
  19216. $55 = HEAP32[7827]|0;
  19217. $56 = HEAP32[(32616)>>2]|0;
  19218. FUNCTION_TABLE_vi[$55 & 31]($56);
  19219. }
  19220. $67 = HEAP32[7863]|0;
  19221. $68 = ($67|0)>(0);
  19222. if ($68) {
  19223. $$02830 = 0;$$031 = 0;
  19224. while(1) {
  19225. $71 = HEAP32[7862]|0;
  19226. $72 = (($71) + (($$031*144)|0)|0);
  19227. $73 = HEAP32[$72>>2]|0;
  19228. $74 = (($73|0) / 4)&-1;
  19229. $75 = ($74*6)|0;
  19230. $76 = (((($71) + (($$031*144)|0)|0)) + 8|0);
  19231. $77 = HEAP32[$76>>2]|0;
  19232. _glBindTexture(3553,($77|0));
  19233. $78 = $$02830 << 1;
  19234. $79 = $78;
  19235. _glDrawElements(4,($75|0),5123,($79|0));
  19236. $80 = HEAP32[7862]|0;
  19237. $81 = (($80) + (($$031*144)|0)|0);
  19238. $82 = HEAP32[$81>>2]|0;
  19239. $83 = (($82|0) / 4)&-1;
  19240. $84 = ($83*6)|0;
  19241. $85 = (($84) + ($$02830))|0;
  19242. $86 = (($$031) + 1)|0;
  19243. $87 = HEAP32[7863]|0;
  19244. $88 = ($86|0)<($87|0);
  19245. if ($88) {
  19246. $$02830 = $85;$$031 = $86;
  19247. } else {
  19248. break;
  19249. }
  19250. }
  19251. }
  19252. $69 = HEAP32[7825]|0;
  19253. $70 = ($69|0)==(0);
  19254. if ($70) {
  19255. _glBindBuffer(34962,0);
  19256. _glBindBuffer(34963,0);
  19257. }
  19258. _glBindTexture(3553,0);
  19259. }
  19260. $89 = HEAP32[7825]|0;
  19261. $90 = ($89|0)==(0);
  19262. if (!($90)) {
  19263. $91 = HEAP32[7827]|0;
  19264. FUNCTION_TABLE_vi[$91 & 31](0);
  19265. }
  19266. _glUseProgram(0);
  19267. $92 = (($$02932) + 1)|0;
  19268. $93 = ($92|0)<($$|0);
  19269. if ($93) {
  19270. $$02932 = $92;
  19271. } else {
  19272. break;
  19273. }
  19274. }
  19275. HEAP32[7863] = 1;
  19276. $5 = HEAP32[7832]|0;
  19277. $6 = HEAP32[7862]|0;
  19278. $7 = ((($6)) + 8|0);
  19279. HEAP32[$7>>2] = $5;
  19280. HEAP32[$6>>2] = 0;
  19281. HEAP32[8123] = 0;
  19282. HEAP32[(32500)>>2] = 0;
  19283. HEAP32[8135] = 0;
  19284. HEAP32[(32548)>>2] = 0;
  19285. HEAP32[8147] = 0;
  19286. HEAP32[(32592)>>2] = 0;
  19287. HEAP32[(32596)>>2] = 0;
  19288. HEAPF32[746] = -1.0;
  19289. dest=31168; 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));
  19290. dest=31232; 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));
  19291. STACKTOP = sp;return;
  19292. }
  19293. function _SetStereoView($0,$1,$2) {
  19294. $0 = $0|0;
  19295. $1 = $1|0;
  19296. $2 = $2|0;
  19297. 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;
  19298. sp = STACKTOP;
  19299. STACKTOP = STACKTOP + 256|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(256|0);
  19300. $$byval_copy3 = sp + 192|0;
  19301. $$byval_copy = sp + 64|0;
  19302. $3 = sp;
  19303. $4 = sp + 128|0;
  19304. 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));
  19305. $5 = HEAP32[8121]|0;
  19306. $6 = Math_imul($5, $0)|0;
  19307. $7 = (($6|0) / 2)&-1;
  19308. $8 = (($5|0) / 2)&-1;
  19309. $9 = HEAP32[8122]|0;
  19310. _rlViewport($7,0,$8,$9);
  19311. $10 = (33072 + ($0<<6)|0);
  19312. 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));
  19313. 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));
  19314. _MatrixMultiply($4,$$byval_copy,$$byval_copy3);
  19315. $11 = (32944 + ($0<<6)|0);
  19316. 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));
  19317. 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));
  19318. _SetMatrixModelview($$byval_copy3);
  19319. 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));
  19320. _SetMatrixProjection($$byval_copy3);
  19321. STACKTOP = sp;return;
  19322. }
  19323. function _SetMatrixModelview($0) {
  19324. $0 = $0|0;
  19325. var dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  19326. sp = STACKTOP;
  19327. dest=31232; 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));
  19328. return;
  19329. }
  19330. function _SetMatrixProjection($0) {
  19331. $0 = $0|0;
  19332. var dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  19333. sp = STACKTOP;
  19334. dest=31168; 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));
  19335. return;
  19336. }
  19337. function _rlPushMatrix() {
  19338. 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;
  19339. sp = STACKTOP;
  19340. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  19341. $vararg_buffer = sp;
  19342. $0 = HEAP32[8300]|0;
  19343. $1 = ($0|0)==(15);
  19344. if ($1) {
  19345. HEAP32[$vararg_buffer>>2] = 16;
  19346. _TraceLog(1,8067,$vararg_buffer);
  19347. }
  19348. $2 = HEAP32[8300]|0;
  19349. $3 = (31460 + ($2<<6)|0);
  19350. $4 = HEAP32[7791]|0;
  19351. 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));
  19352. _rlLoadIdentity();
  19353. $5 = HEAP32[8300]|0;
  19354. $6 = (($5) + 1)|0;
  19355. HEAP32[8300] = $6;
  19356. $7 = HEAP32[7824]|0;
  19357. $8 = ($7|0)==(5888);
  19358. if (!($8)) {
  19359. STACKTOP = sp;return;
  19360. }
  19361. HEAP32[8301] = 1;
  19362. STACKTOP = sp;return;
  19363. }
  19364. function _rlPopMatrix() {
  19365. var $0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, label = 0, sp = 0;
  19366. sp = STACKTOP;
  19367. $0 = HEAP32[8300]|0;
  19368. $1 = ($0|0)>(0);
  19369. if (!($1)) {
  19370. return;
  19371. }
  19372. $2 = HEAP32[8300]|0;
  19373. $3 = (($2) + -1)|0;
  19374. $4 = (31460 + ($3<<6)|0);
  19375. $5 = HEAP32[7791]|0;
  19376. _memmove(($5|0),($4|0),64)|0;
  19377. $6 = (($2) + -1)|0;
  19378. HEAP32[8300] = $6;
  19379. return;
  19380. }
  19381. function _GetFPS() {
  19382. var $0 = 0.0, $1 = 0.0, $2 = 0, label = 0, sp = 0;
  19383. sp = STACKTOP;
  19384. $0 = (+_GetFrameTime());
  19385. $1 = 1.0 / $0;
  19386. $2 = (~~(($1)));
  19387. return ($2|0);
  19388. }
  19389. function _GetFrameTime() {
  19390. var $0 = 0.0, $1 = 0.0, label = 0, sp = 0;
  19391. sp = STACKTOP;
  19392. $0 = +HEAPF64[1781];
  19393. $1 = $0;
  19394. return (+$1);
  19395. }
  19396. function _SetConfigFlags($0) {
  19397. $0 = $0|0;
  19398. var $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, label = 0, sp = 0;
  19399. sp = STACKTOP;
  19400. HEAP8[35948] = $0;
  19401. $1 = $0 & 1;
  19402. $2 = ($1<<24>>24)==(0);
  19403. if (!($2)) {
  19404. HEAP32[7749] = 1;
  19405. }
  19406. $3 = HEAP8[35948]|0;
  19407. $4 = $3 & 2;
  19408. $5 = ($4<<24>>24)==(0);
  19409. if ($5) {
  19410. return;
  19411. }
  19412. HEAP32[7786] = 1;
  19413. return;
  19414. }
  19415. function _IsKeyPressed($0) {
  19416. $0 = $0|0;
  19417. var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $or$cond = 0, label = 0, sp = 0;
  19418. sp = STACKTOP;
  19419. $1 = (35955 + ($0)|0);
  19420. $2 = HEAP8[$1>>0]|0;
  19421. $3 = (36467 + ($0)|0);
  19422. $4 = HEAP8[$3>>0]|0;
  19423. $5 = ($2<<24>>24)!=($4<<24>>24);
  19424. $6 = ($2<<24>>24)==(1);
  19425. $or$cond = $6 & $5;
  19426. $$0 = $or$cond&1;
  19427. return ($$0|0);
  19428. }
  19429. function _rlTranslatef($0,$1,$2) {
  19430. $0 = +$0;
  19431. $1 = +$1;
  19432. $2 = +$2;
  19433. var $$byval_copy = 0, $$byval_copy1 = 0, $3 = 0, $4 = 0, $5 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  19434. sp = STACKTOP;
  19435. STACKTOP = STACKTOP + 256|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(256|0);
  19436. $$byval_copy1 = sp + 192|0;
  19437. $$byval_copy = sp + 128|0;
  19438. $3 = sp + 64|0;
  19439. $4 = sp;
  19440. _MatrixTranslate($3,$0,$1,$2);
  19441. _MatrixTranspose($3);
  19442. $5 = HEAP32[7791]|0;
  19443. 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));
  19444. 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));
  19445. _MatrixMultiply($4,$$byval_copy,$$byval_copy1);
  19446. 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));
  19447. STACKTOP = sp;return;
  19448. }
  19449. function _rlRotatef($0,$1,$2,$3) {
  19450. $0 = +$0;
  19451. $1 = +$1;
  19452. $2 = +$2;
  19453. $3 = +$3;
  19454. 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;
  19455. sp = STACKTOP;
  19456. STACKTOP = STACKTOP + 336|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(336|0);
  19457. $$byval_copy2 = sp + 272|0;
  19458. $$byval_copy1 = sp + 208|0;
  19459. $4 = sp + 144|0;
  19460. $5 = sp + 64|0;
  19461. $6 = sp + 80|0;
  19462. $7 = sp;
  19463. _MatrixIdentity($4);
  19464. HEAPF32[$5>>2] = $1;
  19465. $8 = ((($5)) + 4|0);
  19466. HEAPF32[$8>>2] = $2;
  19467. $9 = ((($5)) + 8|0);
  19468. HEAPF32[$9>>2] = $3;
  19469. _VectorNormalize($5);
  19470. $10 = $0 * 0.01745329238474369;
  19471. ;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;
  19472. _MatrixRotate($6,$$byval_copy2,$10);
  19473. 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));
  19474. _MatrixTranspose($4);
  19475. $11 = HEAP32[7791]|0;
  19476. 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));
  19477. 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));
  19478. _MatrixMultiply($7,$$byval_copy1,$$byval_copy2);
  19479. 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));
  19480. STACKTOP = sp;return;
  19481. }
  19482. function _rlBegin($0) {
  19483. $0 = $0|0;
  19484. var label = 0, sp = 0;
  19485. sp = STACKTOP;
  19486. HEAP32[7864] = $0;
  19487. return;
  19488. }
  19489. function _rlEnd() {
  19490. 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;
  19491. 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;
  19492. 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;
  19493. 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;
  19494. 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;
  19495. 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;
  19496. 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;
  19497. 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;
  19498. var $scevgep = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  19499. sp = STACKTOP;
  19500. STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
  19501. $$byval_copy = sp;
  19502. $0 = HEAP32[8301]|0;
  19503. $1 = ($0|0)==(0);
  19504. if (!($1)) {
  19505. $2 = HEAP32[8302]|0;
  19506. $3 = ($2|0)>(0);
  19507. if ($3) {
  19508. $$03956 = 0;
  19509. while(1) {
  19510. $6 = HEAP32[7861]|0;
  19511. $7 = (($6) + (($$03956*12)|0)|0);
  19512. $8 = HEAP32[7791]|0;
  19513. 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));
  19514. _VectorTransform($7,$$byval_copy);
  19515. $9 = (($$03956) + 1)|0;
  19516. $5 = HEAP32[8302]|0;
  19517. $10 = ($9|0)<($5|0);
  19518. if ($10) {
  19519. $$03956 = $9;
  19520. } else {
  19521. break;
  19522. }
  19523. }
  19524. HEAP32[8301] = 0;
  19525. $4 = ($5|0)>(0);
  19526. if ($4) {
  19527. $$04154 = 0;
  19528. while(1) {
  19529. $11 = HEAP32[7861]|0;
  19530. $12 = (($11) + (($$04154*12)|0)|0);
  19531. $13 = +HEAPF32[$12>>2];
  19532. $14 = (((($11) + (($$04154*12)|0)|0)) + 4|0);
  19533. $15 = +HEAPF32[$14>>2];
  19534. $16 = (((($11) + (($$04154*12)|0)|0)) + 8|0);
  19535. $17 = +HEAPF32[$16>>2];
  19536. _rlVertex3f($13,$15,$17);
  19537. $18 = (($$04154) + 1)|0;
  19538. $19 = HEAP32[8302]|0;
  19539. $20 = ($18|0)<($19|0);
  19540. if ($20) {
  19541. $$04154 = $18;
  19542. } else {
  19543. break;
  19544. }
  19545. }
  19546. }
  19547. } else {
  19548. HEAP32[8301] = 0;
  19549. }
  19550. HEAP32[8302] = 0;
  19551. }
  19552. $21 = HEAP32[7864]|0;
  19553. switch ($21|0) {
  19554. case 1: {
  19555. $22 = HEAP32[8123]|0;
  19556. $23 = HEAP32[(32500)>>2]|0;
  19557. $24 = ($22|0)==($23|0);
  19558. if ($24) {
  19559. $148 = +HEAPF32[746];
  19560. $149 = $148 + 4.9999998736893758E-5;
  19561. HEAPF32[746] = $149;
  19562. STACKTOP = sp;return;
  19563. }
  19564. $25 = (($22) - ($23))|0;
  19565. $26 = ($25|0)>(0);
  19566. if ($26) {
  19567. $$04347 = 0;
  19568. } else {
  19569. $148 = +HEAPF32[746];
  19570. $149 = $148 + 4.9999998736893758E-5;
  19571. HEAPF32[746] = $149;
  19572. STACKTOP = sp;return;
  19573. }
  19574. while(1) {
  19575. $27 = HEAP32[(32512)>>2]|0;
  19576. $28 = HEAP32[(32500)>>2]|0;
  19577. $29 = $28 << 2;
  19578. $30 = (($29) + -4)|0;
  19579. $31 = (($27) + ($30)|0);
  19580. $32 = HEAP8[$31>>0]|0;
  19581. $33 = (($27) + ($29)|0);
  19582. HEAP8[$33>>0] = $32;
  19583. $34 = HEAP32[(32512)>>2]|0;
  19584. $35 = HEAP32[(32500)>>2]|0;
  19585. $36 = $35 << 2;
  19586. $37 = (($36) + -3)|0;
  19587. $38 = (($34) + ($37)|0);
  19588. $39 = HEAP8[$38>>0]|0;
  19589. $40 = $36 | 1;
  19590. $41 = (($34) + ($40)|0);
  19591. HEAP8[$41>>0] = $39;
  19592. $42 = HEAP32[(32512)>>2]|0;
  19593. $43 = HEAP32[(32500)>>2]|0;
  19594. $44 = $43 << 2;
  19595. $45 = (($44) + -2)|0;
  19596. $46 = (($42) + ($45)|0);
  19597. $47 = HEAP8[$46>>0]|0;
  19598. $48 = $44 | 2;
  19599. $49 = (($42) + ($48)|0);
  19600. HEAP8[$49>>0] = $47;
  19601. $50 = HEAP32[(32512)>>2]|0;
  19602. $51 = HEAP32[(32500)>>2]|0;
  19603. $52 = $51 << 2;
  19604. $53 = (($52) + -1)|0;
  19605. $54 = (($50) + ($53)|0);
  19606. $55 = HEAP8[$54>>0]|0;
  19607. $56 = $52 | 3;
  19608. $57 = (($50) + ($56)|0);
  19609. HEAP8[$57>>0] = $55;
  19610. $58 = HEAP32[(32500)>>2]|0;
  19611. $59 = (($58) + 1)|0;
  19612. HEAP32[(32500)>>2] = $59;
  19613. $60 = (($$04347) + 1)|0;
  19614. $exitcond = ($60|0)==($25|0);
  19615. if ($exitcond) {
  19616. break;
  19617. } else {
  19618. $$04347 = $60;
  19619. }
  19620. }
  19621. $148 = +HEAPF32[746];
  19622. $149 = $148 + 4.9999998736893758E-5;
  19623. HEAPF32[746] = $149;
  19624. STACKTOP = sp;return;
  19625. break;
  19626. }
  19627. case 4: {
  19628. $61 = HEAP32[8135]|0;
  19629. $62 = HEAP32[(32548)>>2]|0;
  19630. $63 = ($61|0)==($62|0);
  19631. if ($63) {
  19632. $148 = +HEAPF32[746];
  19633. $149 = $148 + 4.9999998736893758E-5;
  19634. HEAPF32[746] = $149;
  19635. STACKTOP = sp;return;
  19636. }
  19637. $64 = (($61) - ($62))|0;
  19638. $65 = ($64|0)>(0);
  19639. if ($65) {
  19640. $$04248 = 0;
  19641. } else {
  19642. $148 = +HEAPF32[746];
  19643. $149 = $148 + 4.9999998736893758E-5;
  19644. HEAPF32[746] = $149;
  19645. STACKTOP = sp;return;
  19646. }
  19647. while(1) {
  19648. $66 = HEAP32[(32560)>>2]|0;
  19649. $67 = HEAP32[(32548)>>2]|0;
  19650. $68 = $67 << 2;
  19651. $69 = (($68) + -4)|0;
  19652. $70 = (($66) + ($69)|0);
  19653. $71 = HEAP8[$70>>0]|0;
  19654. $72 = (($66) + ($68)|0);
  19655. HEAP8[$72>>0] = $71;
  19656. $73 = HEAP32[(32560)>>2]|0;
  19657. $74 = HEAP32[(32548)>>2]|0;
  19658. $75 = $74 << 2;
  19659. $76 = (($75) + -3)|0;
  19660. $77 = (($73) + ($76)|0);
  19661. $78 = HEAP8[$77>>0]|0;
  19662. $79 = $75 | 1;
  19663. $80 = (($73) + ($79)|0);
  19664. HEAP8[$80>>0] = $78;
  19665. $81 = HEAP32[(32560)>>2]|0;
  19666. $82 = HEAP32[(32548)>>2]|0;
  19667. $83 = $82 << 2;
  19668. $84 = (($83) + -2)|0;
  19669. $85 = (($81) + ($84)|0);
  19670. $86 = HEAP8[$85>>0]|0;
  19671. $87 = $83 | 2;
  19672. $88 = (($81) + ($87)|0);
  19673. HEAP8[$88>>0] = $86;
  19674. $89 = HEAP32[(32560)>>2]|0;
  19675. $90 = HEAP32[(32548)>>2]|0;
  19676. $91 = $90 << 2;
  19677. $92 = (($91) + -1)|0;
  19678. $93 = (($89) + ($92)|0);
  19679. $94 = HEAP8[$93>>0]|0;
  19680. $95 = $91 | 3;
  19681. $96 = (($89) + ($95)|0);
  19682. HEAP8[$96>>0] = $94;
  19683. $97 = HEAP32[(32548)>>2]|0;
  19684. $98 = (($97) + 1)|0;
  19685. HEAP32[(32548)>>2] = $98;
  19686. $99 = (($$04248) + 1)|0;
  19687. $exitcond60 = ($99|0)==($64|0);
  19688. if ($exitcond60) {
  19689. break;
  19690. } else {
  19691. $$04248 = $99;
  19692. }
  19693. }
  19694. $148 = +HEAPF32[746];
  19695. $149 = $148 + 4.9999998736893758E-5;
  19696. HEAPF32[746] = $149;
  19697. STACKTOP = sp;return;
  19698. break;
  19699. }
  19700. case 7: {
  19701. $100 = HEAP32[8147]|0;
  19702. $101 = HEAP32[(32596)>>2]|0;
  19703. $102 = ($100|0)==($101|0);
  19704. if (!($102)) {
  19705. $103 = (($100) - ($101))|0;
  19706. $104 = ($103|0)>(0);
  19707. if ($104) {
  19708. $$04052 = 0;
  19709. while(1) {
  19710. $105 = HEAP32[(32608)>>2]|0;
  19711. $106 = HEAP32[(32596)>>2]|0;
  19712. $107 = $106 << 2;
  19713. $108 = (($107) + -4)|0;
  19714. $109 = (($105) + ($108)|0);
  19715. $110 = HEAP8[$109>>0]|0;
  19716. $111 = (($105) + ($107)|0);
  19717. HEAP8[$111>>0] = $110;
  19718. $112 = HEAP32[(32608)>>2]|0;
  19719. $113 = HEAP32[(32596)>>2]|0;
  19720. $114 = $113 << 2;
  19721. $115 = (($114) + -3)|0;
  19722. $116 = (($112) + ($115)|0);
  19723. $117 = HEAP8[$116>>0]|0;
  19724. $118 = $114 | 1;
  19725. $119 = (($112) + ($118)|0);
  19726. HEAP8[$119>>0] = $117;
  19727. $120 = HEAP32[(32608)>>2]|0;
  19728. $121 = HEAP32[(32596)>>2]|0;
  19729. $122 = $121 << 2;
  19730. $123 = (($122) + -2)|0;
  19731. $124 = (($120) + ($123)|0);
  19732. $125 = HEAP8[$124>>0]|0;
  19733. $126 = $122 | 2;
  19734. $127 = (($120) + ($126)|0);
  19735. HEAP8[$127>>0] = $125;
  19736. $128 = HEAP32[(32608)>>2]|0;
  19737. $129 = HEAP32[(32596)>>2]|0;
  19738. $130 = $129 << 2;
  19739. $131 = (($130) + -1)|0;
  19740. $132 = (($128) + ($131)|0);
  19741. $133 = HEAP8[$132>>0]|0;
  19742. $134 = $130 | 3;
  19743. $135 = (($128) + ($134)|0);
  19744. HEAP8[$135>>0] = $133;
  19745. $136 = HEAP32[(32596)>>2]|0;
  19746. $137 = (($136) + 1)|0;
  19747. HEAP32[(32596)>>2] = $137;
  19748. $138 = (($$04052) + 1)|0;
  19749. $exitcond63 = ($138|0)==($103|0);
  19750. if ($exitcond63) {
  19751. break;
  19752. } else {
  19753. $$04052 = $138;
  19754. }
  19755. }
  19756. }
  19757. }
  19758. $139 = HEAP32[8147]|0;
  19759. $140 = HEAP32[(32592)>>2]|0;
  19760. $141 = ($139|0)>($140|0);
  19761. if (!($141)) {
  19762. $148 = +HEAPF32[746];
  19763. $149 = $148 + 4.9999998736893758E-5;
  19764. HEAPF32[746] = $149;
  19765. STACKTOP = sp;return;
  19766. }
  19767. $142 = HEAP32[(32604)>>2]|0;
  19768. $$promoted = HEAP32[(32592)>>2]|0;
  19769. $143 = $$promoted << 1;
  19770. $scevgep = (($142) + ($143<<2)|0);
  19771. $144 = (($139) - ($140))|0;
  19772. $145 = $144 << 3;
  19773. _memset(($scevgep|0),0,($145|0))|0;
  19774. $146 = (($139) + ($$promoted))|0;
  19775. $147 = (($146) - ($140))|0;
  19776. HEAP32[(32592)>>2] = $147;
  19777. $148 = +HEAPF32[746];
  19778. $149 = $148 + 4.9999998736893758E-5;
  19779. HEAPF32[746] = $149;
  19780. STACKTOP = sp;return;
  19781. break;
  19782. }
  19783. default: {
  19784. $148 = +HEAPF32[746];
  19785. $149 = $148 + 4.9999998736893758E-5;
  19786. HEAPF32[746] = $149;
  19787. STACKTOP = sp;return;
  19788. }
  19789. }
  19790. }
  19791. function _rlVertex3f($0,$1,$2) {
  19792. $0 = +$0;
  19793. $1 = +$1;
  19794. $2 = +$2;
  19795. 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;
  19796. 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;
  19797. var $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, $vararg_buffer3 = 0, label = 0, sp = 0;
  19798. sp = STACKTOP;
  19799. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  19800. $vararg_buffer3 = sp + 16|0;
  19801. $vararg_buffer1 = sp + 8|0;
  19802. $vararg_buffer = sp;
  19803. $3 = HEAP32[8301]|0;
  19804. $4 = ($3|0)==(0);
  19805. if (!($4)) {
  19806. $5 = HEAP32[7861]|0;
  19807. $6 = HEAP32[8302]|0;
  19808. $7 = (($5) + (($6*12)|0)|0);
  19809. HEAPF32[$7>>2] = $0;
  19810. $8 = (((($5) + (($6*12)|0)|0)) + 4|0);
  19811. HEAPF32[$8>>2] = $1;
  19812. $9 = (((($5) + (($6*12)|0)|0)) + 8|0);
  19813. HEAPF32[$9>>2] = $2;
  19814. $10 = (($6) + 1)|0;
  19815. HEAP32[8302] = $10;
  19816. STACKTOP = sp;return;
  19817. }
  19818. $11 = HEAP32[7864]|0;
  19819. switch ($11|0) {
  19820. case 1: {
  19821. $12 = HEAP32[8123]|0;
  19822. $13 = ($12|0)<(2048);
  19823. if ($13) {
  19824. $14 = HEAP32[(32504)>>2]|0;
  19825. $15 = ($12*3)|0;
  19826. $16 = (($14) + ($15<<2)|0);
  19827. HEAPF32[$16>>2] = $0;
  19828. $17 = (($15) + 1)|0;
  19829. $18 = (($14) + ($17<<2)|0);
  19830. HEAPF32[$18>>2] = $1;
  19831. $19 = (($15) + 2)|0;
  19832. $20 = (($14) + ($19<<2)|0);
  19833. HEAPF32[$20>>2] = $2;
  19834. $21 = (($12) + 1)|0;
  19835. HEAP32[8123] = $21;
  19836. STACKTOP = sp;return;
  19837. } else {
  19838. _TraceLog(1,8105,$vararg_buffer);
  19839. STACKTOP = sp;return;
  19840. }
  19841. break;
  19842. }
  19843. case 4: {
  19844. $22 = HEAP32[8135]|0;
  19845. $23 = ($22|0)<(6144);
  19846. if ($23) {
  19847. $24 = HEAP32[(32552)>>2]|0;
  19848. $25 = ($22*3)|0;
  19849. $26 = (($24) + ($25<<2)|0);
  19850. HEAPF32[$26>>2] = $0;
  19851. $27 = (($25) + 1)|0;
  19852. $28 = (($24) + ($27<<2)|0);
  19853. HEAPF32[$28>>2] = $1;
  19854. $29 = (($25) + 2)|0;
  19855. $30 = (($24) + ($29<<2)|0);
  19856. HEAPF32[$30>>2] = $2;
  19857. $31 = (($22) + 1)|0;
  19858. HEAP32[8135] = $31;
  19859. STACKTOP = sp;return;
  19860. } else {
  19861. _TraceLog(1,8130,$vararg_buffer1);
  19862. STACKTOP = sp;return;
  19863. }
  19864. break;
  19865. }
  19866. case 7: {
  19867. $32 = HEAP32[8147]|0;
  19868. $33 = ($32|0)<(4096);
  19869. if ($33) {
  19870. $34 = HEAP32[(32600)>>2]|0;
  19871. $35 = ($32*3)|0;
  19872. $36 = (($34) + ($35<<2)|0);
  19873. HEAPF32[$36>>2] = $0;
  19874. $37 = (($35) + 1)|0;
  19875. $38 = (($34) + ($37<<2)|0);
  19876. HEAPF32[$38>>2] = $1;
  19877. $39 = (($35) + 2)|0;
  19878. $40 = (($34) + ($39<<2)|0);
  19879. HEAPF32[$40>>2] = $2;
  19880. $41 = (($32) + 1)|0;
  19881. HEAP32[8147] = $41;
  19882. $42 = HEAP32[7862]|0;
  19883. $43 = HEAP32[7863]|0;
  19884. $44 = (($43) + -1)|0;
  19885. $45 = (($42) + (($44*144)|0)|0);
  19886. $46 = HEAP32[$45>>2]|0;
  19887. $47 = (($46) + 1)|0;
  19888. HEAP32[$45>>2] = $47;
  19889. STACKTOP = sp;return;
  19890. } else {
  19891. _TraceLog(1,8159,$vararg_buffer3);
  19892. STACKTOP = sp;return;
  19893. }
  19894. break;
  19895. }
  19896. default: {
  19897. STACKTOP = sp;return;
  19898. }
  19899. }
  19900. }
  19901. function _rlVertex2f($0,$1) {
  19902. $0 = +$0;
  19903. $1 = +$1;
  19904. var $2 = 0.0, label = 0, sp = 0;
  19905. sp = STACKTOP;
  19906. $2 = +HEAPF32[746];
  19907. _rlVertex3f($0,$1,$2);
  19908. return;
  19909. }
  19910. function _rlVertex2i($0,$1) {
  19911. $0 = $0|0;
  19912. $1 = $1|0;
  19913. var $2 = 0.0, $3 = 0.0, $4 = 0.0, label = 0, sp = 0;
  19914. sp = STACKTOP;
  19915. $2 = (+($0|0));
  19916. $3 = (+($1|0));
  19917. $4 = +HEAPF32[746];
  19918. _rlVertex3f($2,$3,$4);
  19919. return;
  19920. }
  19921. function _rlTexCoord2f($0,$1) {
  19922. $0 = +$0;
  19923. $1 = +$1;
  19924. var $10 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  19925. sp = STACKTOP;
  19926. $2 = HEAP32[7864]|0;
  19927. $3 = ($2|0)==(7);
  19928. if (!($3)) {
  19929. return;
  19930. }
  19931. $4 = HEAP32[(32604)>>2]|0;
  19932. $5 = HEAP32[(32592)>>2]|0;
  19933. $6 = $5 << 1;
  19934. $7 = (($4) + ($6<<2)|0);
  19935. HEAPF32[$7>>2] = $0;
  19936. $8 = $6 | 1;
  19937. $9 = (($4) + ($8<<2)|0);
  19938. HEAPF32[$9>>2] = $1;
  19939. $10 = (($5) + 1)|0;
  19940. HEAP32[(32592)>>2] = $10;
  19941. return;
  19942. }
  19943. function _rlNormal3f($0,$1,$2) {
  19944. $0 = +$0;
  19945. $1 = +$1;
  19946. $2 = +$2;
  19947. var label = 0, sp = 0;
  19948. sp = STACKTOP;
  19949. return;
  19950. }
  19951. function _rlColor4ub($0,$1,$2,$3) {
  19952. $0 = $0|0;
  19953. $1 = $1|0;
  19954. $2 = $2|0;
  19955. $3 = $3|0;
  19956. 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;
  19957. var $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  19958. sp = STACKTOP;
  19959. $4 = HEAP32[7864]|0;
  19960. switch ($4|0) {
  19961. case 1: {
  19962. $$sink37 = (32500);$$sink38 = (32512);
  19963. break;
  19964. }
  19965. case 4: {
  19966. $$sink37 = (32548);$$sink38 = (32560);
  19967. break;
  19968. }
  19969. case 7: {
  19970. $$sink37 = (32596);$$sink38 = (32608);
  19971. break;
  19972. }
  19973. default: {
  19974. return;
  19975. }
  19976. }
  19977. $5 = HEAP32[$$sink38>>2]|0;
  19978. $6 = HEAP32[$$sink37>>2]|0;
  19979. $7 = $6 << 2;
  19980. $8 = (($5) + ($7)|0);
  19981. HEAP8[$8>>0] = $0;
  19982. $9 = HEAP32[$$sink38>>2]|0;
  19983. $10 = HEAP32[$$sink37>>2]|0;
  19984. $11 = $10 << 2;
  19985. $12 = $11 | 1;
  19986. $13 = (($9) + ($12)|0);
  19987. HEAP8[$13>>0] = $1;
  19988. $14 = HEAP32[$$sink38>>2]|0;
  19989. $15 = HEAP32[$$sink37>>2]|0;
  19990. $16 = $15 << 2;
  19991. $17 = $16 | 2;
  19992. $18 = (($14) + ($17)|0);
  19993. HEAP8[$18>>0] = $2;
  19994. $19 = HEAP32[$$sink38>>2]|0;
  19995. $20 = HEAP32[$$sink37>>2]|0;
  19996. $21 = $20 << 2;
  19997. $22 = $21 | 3;
  19998. $23 = (($19) + ($22)|0);
  19999. HEAP8[$23>>0] = $3;
  20000. $24 = HEAP32[$$sink37>>2]|0;
  20001. $25 = (($24) + 1)|0;
  20002. HEAP32[$$sink37>>2] = $25;
  20003. return;
  20004. }
  20005. function _rlEnableTexture($0) {
  20006. $0 = $0|0;
  20007. 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;
  20008. sp = STACKTOP;
  20009. $1 = HEAP32[7862]|0;
  20010. $2 = HEAP32[7863]|0;
  20011. $3 = (($2) + -1)|0;
  20012. $4 = (((($1) + (($3*144)|0)|0)) + 8|0);
  20013. $5 = HEAP32[$4>>2]|0;
  20014. $6 = ($5|0)==($0|0);
  20015. if ($6) {
  20016. return;
  20017. }
  20018. $7 = (($1) + (($3*144)|0)|0);
  20019. $8 = HEAP32[$7>>2]|0;
  20020. $9 = ($8|0)>(0);
  20021. if ($9) {
  20022. $10 = (($2) + 1)|0;
  20023. HEAP32[7863] = $10;
  20024. }
  20025. $11 = HEAP32[7863]|0;
  20026. $12 = (($11) + -1)|0;
  20027. $13 = (((($1) + (($12*144)|0)|0)) + 8|0);
  20028. HEAP32[$13>>2] = $0;
  20029. $14 = (($1) + (($12*144)|0)|0);
  20030. HEAP32[$14>>2] = 0;
  20031. return;
  20032. }
  20033. function _rlDisableTexture() {
  20034. var $0 = 0, $1 = 0, label = 0, sp = 0;
  20035. sp = STACKTOP;
  20036. $0 = HEAP32[8147]|0;
  20037. $1 = ($0|0)>(4095);
  20038. if (!($1)) {
  20039. return;
  20040. }
  20041. _rlglDraw();
  20042. return;
  20043. }
  20044. function _GetDefaultTexture($0) {
  20045. $0 = $0|0;
  20046. var $$sroa$4$0$$sroa_idx2 = 0, $$sroa$5$0$$sroa_idx4 = 0, $$sroa$6$0$$sroa_idx6 = 0, $$sroa$7$0$$sroa_idx8 = 0, $1 = 0, label = 0, sp = 0;
  20047. sp = STACKTOP;
  20048. $1 = HEAP32[7832]|0;
  20049. HEAP32[$0>>2] = $1;
  20050. $$sroa$4$0$$sroa_idx2 = ((($0)) + 4|0);
  20051. HEAP32[$$sroa$4$0$$sroa_idx2>>2] = 1;
  20052. $$sroa$5$0$$sroa_idx4 = ((($0)) + 8|0);
  20053. HEAP32[$$sroa$5$0$$sroa_idx4>>2] = 1;
  20054. $$sroa$6$0$$sroa_idx6 = ((($0)) + 12|0);
  20055. HEAP32[$$sroa$6$0$$sroa_idx6>>2] = 1;
  20056. $$sroa$7$0$$sroa_idx8 = ((($0)) + 16|0);
  20057. HEAP32[$$sroa$7$0$$sroa_idx8>>2] = 7;
  20058. return;
  20059. }
  20060. function _DrawLineV($0,$1,$2) {
  20061. $0 = $0|0;
  20062. $1 = $1|0;
  20063. $2 = $2|0;
  20064. 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;
  20065. sp = STACKTOP;
  20066. _rlBegin(1);
  20067. $3 = HEAP8[$2>>0]|0;
  20068. $4 = ((($2)) + 1|0);
  20069. $5 = HEAP8[$4>>0]|0;
  20070. $6 = ((($2)) + 2|0);
  20071. $7 = HEAP8[$6>>0]|0;
  20072. $8 = ((($2)) + 3|0);
  20073. $9 = HEAP8[$8>>0]|0;
  20074. _rlColor4ub($3,$5,$7,$9);
  20075. $10 = +HEAPF32[$0>>2];
  20076. $11 = ((($0)) + 4|0);
  20077. $12 = +HEAPF32[$11>>2];
  20078. _rlVertex2f($10,$12);
  20079. $13 = +HEAPF32[$1>>2];
  20080. $14 = ((($1)) + 4|0);
  20081. $15 = +HEAPF32[$14>>2];
  20082. _rlVertex2f($13,$15);
  20083. _rlEnd();
  20084. return;
  20085. }
  20086. function _DrawRectangle($0,$1,$2,$3,$4) {
  20087. $0 = $0|0;
  20088. $1 = $1|0;
  20089. $2 = $2|0;
  20090. $3 = $3|0;
  20091. $4 = $4|0;
  20092. var $$byval_copy = 0, $$byval_copy1 = 0, $$byval_copy2 = 0, $10 = 0.0, $11 = 0, $12 = 0.0, $5 = 0, $6 = 0, $7 = 0.0, $8 = 0, $9 = 0.0, label = 0, sp = 0;
  20093. sp = STACKTOP;
  20094. STACKTOP = STACKTOP + 48|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(48|0);
  20095. $$byval_copy2 = sp + 32|0;
  20096. $$byval_copy1 = sp + 24|0;
  20097. $$byval_copy = sp + 16|0;
  20098. $5 = sp + 8|0;
  20099. $6 = sp;
  20100. $7 = (+($0|0));
  20101. HEAPF32[$5>>2] = $7;
  20102. $8 = ((($5)) + 4|0);
  20103. $9 = (+($1|0));
  20104. HEAPF32[$8>>2] = $9;
  20105. $10 = (+($2|0));
  20106. HEAPF32[$6>>2] = $10;
  20107. $11 = ((($6)) + 4|0);
  20108. $12 = (+($3|0));
  20109. HEAPF32[$11>>2] = $12;
  20110. ;HEAP32[$$byval_copy>>2]=HEAP32[$5>>2]|0;HEAP32[$$byval_copy+4>>2]=HEAP32[$5+4>>2]|0;
  20111. ;HEAP32[$$byval_copy1>>2]=HEAP32[$6>>2]|0;HEAP32[$$byval_copy1+4>>2]=HEAP32[$6+4>>2]|0;
  20112. ;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;
  20113. _DrawRectangleV($$byval_copy,$$byval_copy1,$$byval_copy2);
  20114. STACKTOP = sp;return;
  20115. }
  20116. function _DrawRectangleV($0,$1,$2) {
  20117. $0 = $0|0;
  20118. $1 = $1|0;
  20119. $2 = $2|0;
  20120. var $10 = 0, $11 = 0, $12 = 0, $13 = 0.0, $14 = 0, $15 = 0, $16 = 0.0, $17 = 0, $18 = 0, $19 = 0.0, $20 = 0.0, $21 = 0, $22 = 0.0, $23 = 0.0, $24 = 0.0, $25 = 0, $26 = 0.0, $27 = 0.0, $28 = 0.0, $29 = 0;
  20121. var $3 = 0, $30 = 0.0, $31 = 0, $32 = 0.0, $33 = 0, $34 = 0.0, $35 = 0.0, $36 = 0, $37 = 0.0, $38 = 0.0, $39 = 0, $4 = 0, $40 = 0.0, $41 = 0.0, $42 = 0.0, $43 = 0, $44 = 0.0, $45 = 0, $46 = 0, $47 = 0;
  20122. 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.0, $61 = 0, $62 = 0.0, $63 = 0, $64 = 0.0, $65 = 0.0;
  20123. var $66 = 0.0, $67 = 0.0, $68 = 0.0, $69 = 0.0, $7 = 0, $70 = 0.0, $71 = 0.0, $72 = 0.0, $73 = 0.0, $74 = 0.0, $75 = 0.0, $8 = 0, $9 = 0, label = 0, sp = 0;
  20124. sp = STACKTOP;
  20125. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  20126. $3 = sp;
  20127. $4 = (_rlGetVersion()|0);
  20128. $5 = ($4|0)==(1);
  20129. if ($5) {
  20130. _rlBegin(4);
  20131. $6 = HEAP8[$2>>0]|0;
  20132. $7 = ((($2)) + 1|0);
  20133. $8 = HEAP8[$7>>0]|0;
  20134. $9 = ((($2)) + 2|0);
  20135. $10 = HEAP8[$9>>0]|0;
  20136. $11 = ((($2)) + 3|0);
  20137. $12 = HEAP8[$11>>0]|0;
  20138. _rlColor4ub($6,$8,$10,$12);
  20139. $13 = +HEAPF32[$0>>2];
  20140. $14 = (~~(($13)));
  20141. $15 = ((($0)) + 4|0);
  20142. $16 = +HEAPF32[$15>>2];
  20143. $17 = (~~(($16)));
  20144. _rlVertex2i($14,$17);
  20145. $18 = ((($1)) + 4|0);
  20146. $19 = +HEAPF32[$18>>2];
  20147. $20 = $16 + $19;
  20148. $21 = (~~(($20)));
  20149. _rlVertex2i($14,$21);
  20150. $22 = +HEAPF32[$0>>2];
  20151. $23 = +HEAPF32[$1>>2];
  20152. $24 = $22 + $23;
  20153. $25 = (~~(($24)));
  20154. $26 = +HEAPF32[$15>>2];
  20155. $27 = +HEAPF32[$18>>2];
  20156. $28 = $26 + $27;
  20157. $29 = (~~(($28)));
  20158. _rlVertex2i($25,$29);
  20159. $30 = +HEAPF32[$0>>2];
  20160. $31 = (~~(($30)));
  20161. $32 = +HEAPF32[$15>>2];
  20162. $33 = (~~(($32)));
  20163. _rlVertex2i($31,$33);
  20164. $34 = +HEAPF32[$1>>2];
  20165. $35 = $30 + $34;
  20166. $36 = (~~(($35)));
  20167. $37 = +HEAPF32[$18>>2];
  20168. $38 = $32 + $37;
  20169. $39 = (~~(($38)));
  20170. _rlVertex2i($36,$39);
  20171. $40 = +HEAPF32[$0>>2];
  20172. $41 = +HEAPF32[$1>>2];
  20173. $42 = $40 + $41;
  20174. $43 = (~~(($42)));
  20175. $44 = +HEAPF32[$15>>2];
  20176. $45 = (~~(($44)));
  20177. _rlVertex2i($43,$45);
  20178. _rlEnd();
  20179. STACKTOP = sp;return;
  20180. }
  20181. $46 = (_rlGetVersion()|0);
  20182. $47 = ($46|0)==(2);
  20183. if (!($47)) {
  20184. $48 = (_rlGetVersion()|0);
  20185. $49 = ($48|0)==(3);
  20186. if (!($49)) {
  20187. $50 = (_rlGetVersion()|0);
  20188. $51 = ($50|0)==(4);
  20189. if (!($51)) {
  20190. STACKTOP = sp;return;
  20191. }
  20192. }
  20193. }
  20194. _GetDefaultTexture($3);
  20195. $52 = HEAP32[$3>>2]|0;
  20196. _rlEnableTexture($52);
  20197. _rlBegin(7);
  20198. $53 = HEAP8[$2>>0]|0;
  20199. $54 = ((($2)) + 1|0);
  20200. $55 = HEAP8[$54>>0]|0;
  20201. $56 = ((($2)) + 2|0);
  20202. $57 = HEAP8[$56>>0]|0;
  20203. $58 = ((($2)) + 3|0);
  20204. $59 = HEAP8[$58>>0]|0;
  20205. _rlColor4ub($53,$55,$57,$59);
  20206. _rlTexCoord2f(0.0,0.0);
  20207. $60 = +HEAPF32[$0>>2];
  20208. $61 = ((($0)) + 4|0);
  20209. $62 = +HEAPF32[$61>>2];
  20210. _rlVertex2f($60,$62);
  20211. _rlTexCoord2f(0.0,1.0);
  20212. $63 = ((($1)) + 4|0);
  20213. $64 = +HEAPF32[$63>>2];
  20214. $65 = $62 + $64;
  20215. _rlVertex2f($60,$65);
  20216. _rlTexCoord2f(1.0,1.0);
  20217. $66 = +HEAPF32[$0>>2];
  20218. $67 = +HEAPF32[$1>>2];
  20219. $68 = $66 + $67;
  20220. $69 = +HEAPF32[$61>>2];
  20221. $70 = +HEAPF32[$63>>2];
  20222. $71 = $69 + $70;
  20223. _rlVertex2f($68,$71);
  20224. _rlTexCoord2f(1.0,0.0);
  20225. $72 = +HEAPF32[$0>>2];
  20226. $73 = +HEAPF32[$1>>2];
  20227. $74 = $72 + $73;
  20228. $75 = +HEAPF32[$61>>2];
  20229. _rlVertex2f($74,$75);
  20230. _rlEnd();
  20231. _rlDisableTexture();
  20232. STACKTOP = sp;return;
  20233. }
  20234. function _GetDefaultFont($0) {
  20235. $0 = $0|0;
  20236. var label = 0, sp = 0;
  20237. sp = STACKTOP;
  20238. ;HEAP32[$0>>2]=HEAP32[31016>>2]|0;HEAP32[$0+4>>2]=HEAP32[31016+4>>2]|0;HEAP32[$0+8>>2]=HEAP32[31016+8>>2]|0;HEAP32[$0+12>>2]=HEAP32[31016+12>>2]|0;HEAP32[$0+16>>2]=HEAP32[31016+16>>2]|0;HEAP32[$0+20>>2]=HEAP32[31016+20>>2]|0;HEAP32[$0+24>>2]=HEAP32[31016+24>>2]|0;HEAP32[$0+28>>2]=HEAP32[31016+28>>2]|0;
  20239. return;
  20240. }
  20241. function _MeasureTextEx($0,$1,$2,$3,$4) {
  20242. $0 = $0|0;
  20243. $1 = $1|0;
  20244. $2 = $2|0;
  20245. $3 = +$3;
  20246. $4 = $4|0;
  20247. 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;
  20248. 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;
  20249. 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;
  20250. var sp = 0;
  20251. sp = STACKTOP;
  20252. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  20253. $$byval_copy = sp;
  20254. $5 = (_strlen($2)|0);
  20255. $6 = ((($1)) + 20|0);
  20256. $7 = HEAP32[$6>>2]|0;
  20257. $8 = (+($7|0));
  20258. $9 = $3 / $8;
  20259. $10 = ($5|0)>(0);
  20260. if (!($10)) {
  20261. $$0$lcssa = -1;$$052$lcssa = 0.0;$$055$lcssa = 0.0;$$058$lcssa = $8;
  20262. $12 = $$055$lcssa < $$052$lcssa;
  20263. $$3 = $12 ? $$052$lcssa : $$055$lcssa;
  20264. $13 = $9 * $$3;
  20265. $14 = Math_imul($$0$lcssa, $4)|0;
  20266. $15 = (+($14|0));
  20267. $16 = $13 + $15;
  20268. $17 = $9 * $$058$lcssa;
  20269. HEAPF32[$0>>2] = $16;
  20270. $$sroa$4$0$$sroa_idx2 = ((($0)) + 4|0);
  20271. HEAPF32[$$sroa$4$0$$sroa_idx2>>2] = $17;
  20272. STACKTOP = sp;return;
  20273. }
  20274. $11 = ((($1)) + 28|0);
  20275. $$05064 = 0;$$05263 = 0.0;$$05462 = 0;$$05561 = 0.0;$$05860 = $8;$$065 = 0;
  20276. while(1) {
  20277. $18 = (($$05064) + 1)|0;
  20278. $19 = (($2) + ($$05462)|0);
  20279. $20 = HEAP8[$19>>0]|0;
  20280. $21 = ($20<<24>>24)==(10);
  20281. if ($21) {
  20282. $33 = $$05561 < $$05263;
  20283. $$156 = $33 ? $$05263 : $$05561;
  20284. $34 = HEAP32[$6>>2]|0;
  20285. $35 = (+($34|0));
  20286. $36 = $35 * 1.5;
  20287. $37 = $$05860 + $36;
  20288. $$151 = 0;$$159 = $37;$$2 = 0.0;$$257 = $$156;
  20289. } else {
  20290. $22 = $20 << 24 >> 24;
  20291. ;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;
  20292. $23 = (_GetCharIndex($$byval_copy,$22)|0);
  20293. $24 = HEAP32[$11>>2]|0;
  20294. $25 = (((($24) + ($23<<5)|0)) + 28|0);
  20295. $26 = HEAP32[$25>>2]|0;
  20296. $27 = ($26|0)==(0);
  20297. if ($27) {
  20298. $28 = (((($24) + ($23<<5)|0)) + 20|0);
  20299. $29 = (((($24) + ($23<<5)|0)) + 12|0);
  20300. $30 = HEAP32[$29>>2]|0;
  20301. $31 = HEAP32[$28>>2]|0;
  20302. $32 = (($31) + ($30))|0;
  20303. $$pn$in = $32;
  20304. } else {
  20305. $$pn$in = $26;
  20306. }
  20307. $$pn = (+($$pn$in|0));
  20308. $$153 = $$05263 + $$pn;
  20309. $$151 = $18;$$159 = $$05860;$$2 = $$153;$$257 = $$05561;
  20310. }
  20311. $38 = ($$065|0)<($$151|0);
  20312. $$151$$0 = $38 ? $$151 : $$065;
  20313. $39 = (($$05462) + 1)|0;
  20314. $exitcond = ($39|0)==($5|0);
  20315. if ($exitcond) {
  20316. break;
  20317. } else {
  20318. $$05064 = $$151;$$05263 = $$2;$$05462 = $39;$$05561 = $$257;$$05860 = $$159;$$065 = $$151$$0;
  20319. }
  20320. }
  20321. $phitmp = (($$151$$0) + -1)|0;
  20322. $$0$lcssa = $phitmp;$$052$lcssa = $$2;$$055$lcssa = $$257;$$058$lcssa = $$159;
  20323. $12 = $$055$lcssa < $$052$lcssa;
  20324. $$3 = $12 ? $$052$lcssa : $$055$lcssa;
  20325. $13 = $9 * $$3;
  20326. $14 = Math_imul($$0$lcssa, $4)|0;
  20327. $15 = (+($14|0));
  20328. $16 = $13 + $15;
  20329. $17 = $9 * $$058$lcssa;
  20330. HEAPF32[$0>>2] = $16;
  20331. $$sroa$4$0$$sroa_idx2 = ((($0)) + 4|0);
  20332. HEAPF32[$$sroa$4$0$$sroa_idx2>>2] = $17;
  20333. STACKTOP = sp;return;
  20334. }
  20335. function _GetCharIndex($0,$1) {
  20336. $0 = $0|0;
  20337. $1 = $1|0;
  20338. 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;
  20339. sp = STACKTOP;
  20340. $2 = ((($0)) + 24|0);
  20341. $3 = HEAP32[$2>>2]|0;
  20342. $4 = ($3|0)>(0);
  20343. if (!($4)) {
  20344. $$08 = 0;
  20345. return ($$08|0);
  20346. }
  20347. $5 = ((($0)) + 28|0);
  20348. $6 = HEAP32[$5>>2]|0;
  20349. $$09 = 0;
  20350. while(1) {
  20351. $7 = (($6) + ($$09<<5)|0);
  20352. $8 = HEAP32[$7>>2]|0;
  20353. $9 = ($8|0)==($1|0);
  20354. if ($9) {
  20355. $$08 = $$09;
  20356. label = 5;
  20357. break;
  20358. }
  20359. $10 = (($$09) + 1)|0;
  20360. $11 = HEAP32[$2>>2]|0;
  20361. $12 = ($10|0)<($11|0);
  20362. if ($12) {
  20363. $$09 = $10;
  20364. } else {
  20365. $$08 = 0;
  20366. label = 5;
  20367. break;
  20368. }
  20369. }
  20370. if ((label|0) == 5) {
  20371. return ($$08|0);
  20372. }
  20373. return (0)|0;
  20374. }
  20375. function _DrawTexturePro($0,$1,$2,$3,$4,$5) {
  20376. $0 = $0|0;
  20377. $1 = $1|0;
  20378. $2 = $2|0;
  20379. $3 = $3|0;
  20380. $4 = +$4;
  20381. $5 = $5|0;
  20382. 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;
  20383. 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;
  20384. 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;
  20385. 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;
  20386. 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;
  20387. sp = STACKTOP;
  20388. $6 = HEAP32[$0>>2]|0;
  20389. $7 = ($6|0)==(0);
  20390. if ($7) {
  20391. return;
  20392. }
  20393. $8 = ((($1)) + 8|0);
  20394. $9 = HEAP32[$8>>2]|0;
  20395. $10 = ($9|0)<(0);
  20396. if ($10) {
  20397. $11 = HEAP32[$1>>2]|0;
  20398. $12 = (($11) - ($9))|0;
  20399. HEAP32[$1>>2] = $12;
  20400. }
  20401. $13 = ((($1)) + 12|0);
  20402. $14 = HEAP32[$13>>2]|0;
  20403. $15 = ($14|0)<(0);
  20404. if ($15) {
  20405. $16 = ((($1)) + 4|0);
  20406. $17 = HEAP32[$16>>2]|0;
  20407. $18 = (($17) - ($14))|0;
  20408. HEAP32[$16>>2] = $18;
  20409. }
  20410. $19 = HEAP32[$0>>2]|0;
  20411. _rlEnableTexture($19);
  20412. _rlPushMatrix();
  20413. $20 = HEAP32[$2>>2]|0;
  20414. $21 = (+($20|0));
  20415. $22 = ((($2)) + 4|0);
  20416. $23 = HEAP32[$22>>2]|0;
  20417. $24 = (+($23|0));
  20418. _rlTranslatef($21,$24,0.0);
  20419. _rlRotatef($4,0.0,0.0,1.0);
  20420. $25 = +HEAPF32[$3>>2];
  20421. $26 = -$25;
  20422. $27 = ((($3)) + 4|0);
  20423. $28 = +HEAPF32[$27>>2];
  20424. $29 = -$28;
  20425. _rlTranslatef($26,$29,0.0);
  20426. _rlBegin(7);
  20427. $30 = HEAP8[$5>>0]|0;
  20428. $31 = ((($5)) + 1|0);
  20429. $32 = HEAP8[$31>>0]|0;
  20430. $33 = ((($5)) + 2|0);
  20431. $34 = HEAP8[$33>>0]|0;
  20432. $35 = ((($5)) + 3|0);
  20433. $36 = HEAP8[$35>>0]|0;
  20434. _rlColor4ub($30,$32,$34,$36);
  20435. $37 = HEAP32[$1>>2]|0;
  20436. $38 = (+($37|0));
  20437. $39 = ((($0)) + 4|0);
  20438. $40 = HEAP32[$39>>2]|0;
  20439. $41 = (+($40|0));
  20440. $42 = $38 / $41;
  20441. $43 = ((($1)) + 4|0);
  20442. $44 = HEAP32[$43>>2]|0;
  20443. $45 = (+($44|0));
  20444. $46 = ((($0)) + 8|0);
  20445. $47 = HEAP32[$46>>2]|0;
  20446. $48 = (+($47|0));
  20447. $49 = $45 / $48;
  20448. _rlTexCoord2f($42,$49);
  20449. _rlVertex2f(0.0,0.0);
  20450. $50 = HEAP32[$1>>2]|0;
  20451. $51 = (+($50|0));
  20452. $52 = HEAP32[$39>>2]|0;
  20453. $53 = (+($52|0));
  20454. $54 = $51 / $53;
  20455. $55 = HEAP32[$43>>2]|0;
  20456. $56 = HEAP32[$13>>2]|0;
  20457. $57 = (($56) + ($55))|0;
  20458. $58 = (+($57|0));
  20459. $59 = HEAP32[$46>>2]|0;
  20460. $60 = (+($59|0));
  20461. $61 = $58 / $60;
  20462. _rlTexCoord2f($54,$61);
  20463. $62 = ((($2)) + 12|0);
  20464. $63 = HEAP32[$62>>2]|0;
  20465. $64 = (+($63|0));
  20466. _rlVertex2f(0.0,$64);
  20467. $65 = HEAP32[$1>>2]|0;
  20468. $66 = HEAP32[$8>>2]|0;
  20469. $67 = (($66) + ($65))|0;
  20470. $68 = (+($67|0));
  20471. $69 = HEAP32[$39>>2]|0;
  20472. $70 = (+($69|0));
  20473. $71 = $68 / $70;
  20474. $72 = HEAP32[$43>>2]|0;
  20475. $73 = HEAP32[$13>>2]|0;
  20476. $74 = (($73) + ($72))|0;
  20477. $75 = (+($74|0));
  20478. $76 = HEAP32[$46>>2]|0;
  20479. $77 = (+($76|0));
  20480. $78 = $75 / $77;
  20481. _rlTexCoord2f($71,$78);
  20482. $79 = ((($2)) + 8|0);
  20483. $80 = HEAP32[$79>>2]|0;
  20484. $81 = (+($80|0));
  20485. $82 = HEAP32[$62>>2]|0;
  20486. $83 = (+($82|0));
  20487. _rlVertex2f($81,$83);
  20488. $84 = HEAP32[$1>>2]|0;
  20489. $85 = HEAP32[$8>>2]|0;
  20490. $86 = (($85) + ($84))|0;
  20491. $87 = (+($86|0));
  20492. $88 = HEAP32[$39>>2]|0;
  20493. $89 = (+($88|0));
  20494. $90 = $87 / $89;
  20495. $91 = HEAP32[$43>>2]|0;
  20496. $92 = (+($91|0));
  20497. $93 = HEAP32[$46>>2]|0;
  20498. $94 = (+($93|0));
  20499. $95 = $92 / $94;
  20500. _rlTexCoord2f($90,$95);
  20501. $96 = HEAP32[$79>>2]|0;
  20502. $97 = (+($96|0));
  20503. _rlVertex2f($97,0.0);
  20504. _rlEnd();
  20505. _rlPopMatrix();
  20506. _rlDisableTexture();
  20507. return;
  20508. }
  20509. function _DrawText($0,$1,$2,$3,$4) {
  20510. $0 = $0|0;
  20511. $1 = $1|0;
  20512. $2 = $2|0;
  20513. $3 = $3|0;
  20514. $4 = $4|0;
  20515. 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;
  20516. sp = STACKTOP;
  20517. STACKTOP = STACKTOP + 128|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(128|0);
  20518. $$byval_copy2 = sp + 112|0;
  20519. $$byval_copy1 = sp + 104|0;
  20520. $$byval_copy = sp + 72|0;
  20521. $5 = sp + 32|0;
  20522. $6 = sp + 64|0;
  20523. $7 = sp;
  20524. _GetDefaultFont($5);
  20525. $8 = HEAP32[$5>>2]|0;
  20526. $9 = ($8|0)==(0);
  20527. if ($9) {
  20528. STACKTOP = sp;return;
  20529. }
  20530. $10 = (+($1|0));
  20531. HEAPF32[$6>>2] = $10;
  20532. $11 = ((($6)) + 4|0);
  20533. $12 = (+($2|0));
  20534. HEAPF32[$11>>2] = $12;
  20535. $13 = ($3|0)>(10);
  20536. $$ = $13 ? $3 : 10;
  20537. $14 = (($$>>>0) / 10)&-1;
  20538. _GetDefaultFont($7);
  20539. $15 = (+($$|0));
  20540. ;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;
  20541. ;HEAP32[$$byval_copy1>>2]=HEAP32[$6>>2]|0;HEAP32[$$byval_copy1+4>>2]=HEAP32[$6+4>>2]|0;
  20542. ;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;
  20543. _DrawTextEx($$byval_copy,$0,$$byval_copy1,$15,$14,$$byval_copy2);
  20544. STACKTOP = sp;return;
  20545. }
  20546. function _DrawTextEx($0,$1,$2,$3,$4,$5) {
  20547. $0 = $0|0;
  20548. $1 = $1|0;
  20549. $2 = $2|0;
  20550. $3 = +$3;
  20551. $4 = $4|0;
  20552. $5 = $5|0;
  20553. 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;
  20554. 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;
  20555. 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;
  20556. 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;
  20557. 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;
  20558. sp = STACKTOP;
  20559. STACKTOP = STACKTOP + 128|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(128|0);
  20560. $$byval_copy5 = sp + 88|0;
  20561. $$byval_copy4 = sp + 80|0;
  20562. $$byval_copy3 = sp + 64|0;
  20563. $$byval_copy2 = sp + 48|0;
  20564. $$byval_copy1 = sp + 24|0;
  20565. $6 = sp + 8|0;
  20566. $7 = sp;
  20567. $8 = (_strlen($1)|0);
  20568. $9 = ((($0)) + 20|0);
  20569. $10 = HEAP32[$9>>2]|0;
  20570. $11 = (+($10|0));
  20571. $12 = $3 / $11;
  20572. $13 = ($8|0)>(0);
  20573. if (!($13)) {
  20574. STACKTOP = sp;return;
  20575. }
  20576. $14 = ((($0)) + 28|0);
  20577. $15 = +HEAPF32[$2>>2];
  20578. $16 = ((($6)) + 4|0);
  20579. $17 = ((($2)) + 4|0);
  20580. $18 = ((($6)) + 8|0);
  20581. $19 = ((($6)) + 12|0);
  20582. $20 = ((($7)) + 4|0);
  20583. $21 = (+($4|0));
  20584. $$04954 = 0;$$05153 = 0;$$055 = 0;
  20585. while(1) {
  20586. $22 = (($1) + ($$055)|0);
  20587. $23 = HEAP8[$22>>0]|0;
  20588. switch ($23<<24>>24) {
  20589. case 10: {
  20590. $24 = HEAP32[$9>>2]|0;
  20591. $25 = (($24|0) / 2)&-1;
  20592. $26 = (($25) + ($24))|0;
  20593. $27 = (+($26|0));
  20594. $28 = $12 * $27;
  20595. $29 = (~~(($28)));
  20596. $30 = (($29) + ($$05153))|0;
  20597. $$150 = 0;$$152 = $30;$$2 = $$055;
  20598. break;
  20599. }
  20600. case -62: {
  20601. $31 = (($$055) + 1)|0;
  20602. $32 = (($1) + ($31)|0);
  20603. $33 = HEAP8[$32>>0]|0;
  20604. $34 = $33&255;
  20605. $$1 = $31;$$sink = $34;
  20606. label = 9;
  20607. break;
  20608. }
  20609. case -61: {
  20610. $35 = (($$055) + 1)|0;
  20611. $36 = (($1) + ($35)|0);
  20612. $37 = HEAP8[$36>>0]|0;
  20613. $38 = $37&255;
  20614. $39 = (($38) + 64)|0;
  20615. $$1 = $35;$$sink = $39;
  20616. label = 9;
  20617. break;
  20618. }
  20619. default: {
  20620. $40 = $23 << 24 >> 24;
  20621. $$1 = $$055;$$sink = $40;
  20622. label = 9;
  20623. }
  20624. }
  20625. do {
  20626. if ((label|0) == 9) {
  20627. label = 0;
  20628. ;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;
  20629. $41 = (_GetCharIndex($$byval_copy5,$$sink)|0);
  20630. $42 = HEAP32[$14>>2]|0;
  20631. $43 = (((($42) + ($41<<5)|0)) + 4|0);
  20632. $44 = (+($$04954|0));
  20633. $45 = $44 + $15;
  20634. $46 = (((($42) + ($41<<5)|0)) + 20|0);
  20635. $47 = HEAP32[$46>>2]|0;
  20636. $48 = (+($47|0));
  20637. $49 = $12 * $48;
  20638. $50 = $45 + $49;
  20639. $51 = (~~(($50)));
  20640. HEAP32[$6>>2] = $51;
  20641. $52 = +HEAPF32[$17>>2];
  20642. $53 = (+($$05153|0));
  20643. $54 = $53 + $52;
  20644. $55 = (((($42) + ($41<<5)|0)) + 24|0);
  20645. $56 = HEAP32[$55>>2]|0;
  20646. $57 = (+($56|0));
  20647. $58 = $12 * $57;
  20648. $59 = $54 + $58;
  20649. $60 = (~~(($59)));
  20650. HEAP32[$16>>2] = $60;
  20651. $61 = (((($42) + ($41<<5)|0)) + 12|0);
  20652. $62 = HEAP32[$61>>2]|0;
  20653. $63 = (+($62|0));
  20654. $64 = $12 * $63;
  20655. $65 = (~~(($64)));
  20656. HEAP32[$18>>2] = $65;
  20657. $66 = (((($42) + ($41<<5)|0)) + 16|0);
  20658. $67 = HEAP32[$66>>2]|0;
  20659. $68 = (+($67|0));
  20660. $69 = $12 * $68;
  20661. $70 = (~~(($69)));
  20662. HEAP32[$19>>2] = $70;
  20663. HEAPF32[$7>>2] = 0.0;
  20664. HEAPF32[$20>>2] = 0.0;
  20665. ;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;
  20666. ;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;
  20667. ;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;
  20668. ;HEAP32[$$byval_copy4>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy4+4>>2]=HEAP32[$7+4>>2]|0;
  20669. ;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;
  20670. _DrawTexturePro($$byval_copy1,$$byval_copy2,$$byval_copy3,$$byval_copy4,0.0,$$byval_copy5);
  20671. $71 = HEAP32[$14>>2]|0;
  20672. $72 = (((($71) + ($41<<5)|0)) + 28|0);
  20673. $73 = HEAP32[$72>>2]|0;
  20674. $74 = ($73|0)==(0);
  20675. if ($74) {
  20676. $75 = (((($71) + ($41<<5)|0)) + 12|0);
  20677. $76 = HEAP32[$75>>2]|0;
  20678. $77 = (+($76|0));
  20679. $78 = $12 * $77;
  20680. $79 = $21 + $78;
  20681. $80 = (~~(($79)));
  20682. $81 = (($80) + ($$04954))|0;
  20683. $$150 = $81;$$152 = $$05153;$$2 = $$1;
  20684. break;
  20685. } else {
  20686. $82 = (+($73|0));
  20687. $83 = $12 * $82;
  20688. $84 = $21 + $83;
  20689. $85 = (~~(($84)));
  20690. $86 = (($85) + ($$04954))|0;
  20691. $$150 = $86;$$152 = $$05153;$$2 = $$1;
  20692. break;
  20693. }
  20694. }
  20695. } while(0);
  20696. $87 = (($$2) + 1)|0;
  20697. $88 = ($87|0)<($8|0);
  20698. if ($88) {
  20699. $$04954 = $$150;$$05153 = $$152;$$055 = $87;
  20700. } else {
  20701. break;
  20702. }
  20703. }
  20704. STACKTOP = sp;return;
  20705. }
  20706. function _FormatText($0,$varargs) {
  20707. $0 = $0|0;
  20708. $varargs = $varargs|0;
  20709. var $1 = 0, label = 0, sp = 0;
  20710. sp = STACKTOP;
  20711. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  20712. $1 = sp;
  20713. HEAP32[$1>>2] = $varargs;
  20714. (_vsprintf(37235,$0,$1)|0);
  20715. STACKTOP = sp;return (37235|0);
  20716. }
  20717. function _MeasureText($0,$1) {
  20718. $0 = $0|0;
  20719. $1 = $1|0;
  20720. 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;
  20721. sp = STACKTOP;
  20722. STACKTOP = STACKTOP + 112|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(112|0);
  20723. $$byval_copy = sp + 72|0;
  20724. $2 = sp + 40|0;
  20725. $3 = sp + 8|0;
  20726. $4 = sp;
  20727. _GetDefaultFont($2);
  20728. $5 = HEAP32[$2>>2]|0;
  20729. $6 = ($5|0)==(0);
  20730. if ($6) {
  20731. $$sroa$0$0 = 0;
  20732. STACKTOP = sp;return ($$sroa$0$0|0);
  20733. }
  20734. $7 = ($1|0)>(10);
  20735. $$ = $7 ? $1 : 10;
  20736. $8 = (($$>>>0) / 10)&-1;
  20737. _GetDefaultFont($3);
  20738. $9 = (+($$|0));
  20739. ;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;
  20740. _MeasureTextEx($4,$$byval_copy,$0,$9,$8);
  20741. $$sroa$0$0$copyload = +HEAPF32[$4>>2];
  20742. $phitmp = (~~(($$sroa$0$0$copyload)));
  20743. $$sroa$0$0 = $phitmp;
  20744. STACKTOP = sp;return ($$sroa$0$0|0);
  20745. }
  20746. function _DrawFPS($0,$1) {
  20747. $0 = $0|0;
  20748. $1 = $1|0;
  20749. 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;
  20750. sp = STACKTOP;
  20751. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  20752. $$byval_copy = sp;
  20753. $2 = sp + 4|0;
  20754. $3 = HEAP32[8303]|0;
  20755. $4 = HEAP32[747]|0;
  20756. $5 = ($3|0)<($4|0);
  20757. if ($5) {
  20758. $6 = (($3) + 1)|0;
  20759. $$sink = $6;
  20760. } else {
  20761. $7 = (_GetFPS()|0);
  20762. HEAP32[8304] = $7;
  20763. HEAP32[747] = $7;
  20764. $$sink = 0;
  20765. }
  20766. HEAP32[8303] = $$sink;
  20767. $8 = HEAP32[8304]|0;
  20768. HEAP32[$$byval_copy>>2] = $8;
  20769. (_FormatText(8184,$$byval_copy)|0);
  20770. HEAP8[$2>>0] = 0;
  20771. $9 = ((($2)) + 1|0);
  20772. HEAP8[$9>>0] = -98;
  20773. $10 = ((($2)) + 2|0);
  20774. HEAP8[$10>>0] = 47;
  20775. $11 = ((($2)) + 3|0);
  20776. HEAP8[$11>>0] = -1;
  20777. ;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;
  20778. _DrawText(37235,$0,$1,20,$$byval_copy);
  20779. STACKTOP = sp;return;
  20780. }
  20781. function _emscripten_GetProcAddress($0) {
  20782. $0 = $0|0;
  20783. 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;
  20784. 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;
  20785. 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;
  20786. 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;
  20787. 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;
  20788. 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;
  20789. 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;
  20790. 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;
  20791. 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;
  20792. 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;
  20793. 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;
  20794. 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;
  20795. 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;
  20796. 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;
  20797. 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;
  20798. 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;
  20799. 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;
  20800. 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;
  20801. 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;
  20802. 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;
  20803. 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;
  20804. 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;
  20805. 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;
  20806. 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;
  20807. 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;
  20808. 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;
  20809. 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;
  20810. 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;
  20811. sp = STACKTOP;
  20812. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  20813. $1 = sp + 12|0;
  20814. $2 = sp + 8|0;
  20815. $3 = sp + 4|0;
  20816. $4 = sp;
  20817. HEAP32[$2>>2] = $0;
  20818. $5 = HEAP32[$2>>2]|0;
  20819. $6 = (_strlen($5)|0);
  20820. $7 = (($6) + 1)|0;
  20821. $8 = (_malloc($7)|0);
  20822. HEAP32[$3>>2] = $8;
  20823. $9 = HEAP32[$3>>2]|0;
  20824. $10 = HEAP32[$2>>2]|0;
  20825. (_strcpy($9,$10)|0);
  20826. $11 = HEAP32[$3>>2]|0;
  20827. $12 = (_strstr($11,8192)|0);
  20828. HEAP32[$4>>2] = $12;
  20829. $13 = HEAP32[$4>>2]|0;
  20830. $14 = ($13|0)!=(0|0);
  20831. if ($14) {
  20832. $15 = HEAP32[$4>>2]|0;
  20833. HEAP8[$15>>0] = 0;
  20834. }
  20835. $16 = HEAP32[$3>>2]|0;
  20836. $17 = (_strstr($16,8196)|0);
  20837. HEAP32[$4>>2] = $17;
  20838. $18 = HEAP32[$4>>2]|0;
  20839. $19 = ($18|0)!=(0|0);
  20840. if ($19) {
  20841. $20 = HEAP32[$4>>2]|0;
  20842. HEAP8[$20>>0] = 0;
  20843. }
  20844. $21 = HEAP32[$3>>2]|0;
  20845. $22 = (_strstr($21,8200)|0);
  20846. HEAP32[$4>>2] = $22;
  20847. $23 = HEAP32[$4>>2]|0;
  20848. $24 = ($23|0)!=(0|0);
  20849. if ($24) {
  20850. $25 = HEAP32[$4>>2]|0;
  20851. HEAP8[$25>>0] = 0;
  20852. }
  20853. $26 = HEAP32[$3>>2]|0;
  20854. $27 = (_strstr($26,8204)|0);
  20855. HEAP32[$4>>2] = $27;
  20856. $28 = HEAP32[$4>>2]|0;
  20857. $29 = ($28|0)!=(0|0);
  20858. if ($29) {
  20859. $30 = HEAP32[$4>>2]|0;
  20860. HEAP8[$30>>0] = 0;
  20861. }
  20862. $31 = HEAP32[$3>>2]|0;
  20863. $32 = (_strcmp($31,8210)|0);
  20864. $33 = ($32|0)!=(0);
  20865. do {
  20866. if ($33) {
  20867. $34 = HEAP32[$3>>2]|0;
  20868. $35 = (_strcmp($34,8248)|0);
  20869. $36 = ($35|0)!=(0);
  20870. if (!($36)) {
  20871. HEAP32[$3>>2] = 8267;
  20872. break;
  20873. }
  20874. $37 = HEAP32[$3>>2]|0;
  20875. $38 = (_strcmp($37,8280)|0);
  20876. $39 = ($38|0)!=(0);
  20877. if (!($39)) {
  20878. HEAP32[$3>>2] = 8301;
  20879. break;
  20880. }
  20881. $40 = HEAP32[$3>>2]|0;
  20882. $41 = (_strcmp($40,8316)|0);
  20883. $42 = ($41|0)!=(0);
  20884. if (!($42)) {
  20885. HEAP32[$3>>2] = 8331;
  20886. break;
  20887. }
  20888. $43 = HEAP32[$3>>2]|0;
  20889. $44 = (_strcmp($43,8346)|0);
  20890. $45 = ($44|0)!=(0);
  20891. if (!($45)) {
  20892. HEAP32[$3>>2] = 8361;
  20893. }
  20894. } else {
  20895. HEAP32[$3>>2] = 8232;
  20896. }
  20897. } while(0);
  20898. $46 = HEAP32[$3>>2]|0;
  20899. $47 = (_strcmp($46,8376)|0);
  20900. $48 = ($47|0)!=(0);
  20901. do {
  20902. if ($48) {
  20903. $49 = HEAP32[$3>>2]|0;
  20904. $50 = (_strcmp($49,8390)|0);
  20905. $51 = ($50|0)!=(0);
  20906. if (!($51)) {
  20907. HEAP32[$1>>2] = 3;
  20908. break;
  20909. }
  20910. $52 = HEAP32[$3>>2]|0;
  20911. $53 = (_strcmp($52,8402)|0);
  20912. $54 = ($53|0)!=(0);
  20913. if (!($54)) {
  20914. HEAP32[$1>>2] = 6;
  20915. break;
  20916. }
  20917. $55 = HEAP32[$3>>2]|0;
  20918. $56 = (_strcmp($55,8416)|0);
  20919. $57 = ($56|0)!=(0);
  20920. if (!($57)) {
  20921. HEAP32[$1>>2] = 7;
  20922. break;
  20923. }
  20924. $58 = HEAP32[$3>>2]|0;
  20925. $59 = (_strcmp($58,8428)|0);
  20926. $60 = ($59|0)!=(0);
  20927. if (!($60)) {
  20928. HEAP32[$1>>2] = 8;
  20929. break;
  20930. }
  20931. $61 = HEAP32[$3>>2]|0;
  20932. $62 = (_strcmp($61,8442)|0);
  20933. $63 = ($62|0)!=(0);
  20934. if (!($63)) {
  20935. HEAP32[$1>>2] = 9;
  20936. break;
  20937. }
  20938. $64 = HEAP32[$3>>2]|0;
  20939. $65 = (_strcmp($64,8456)|0);
  20940. $66 = ($65|0)!=(0);
  20941. if (!($66)) {
  20942. HEAP32[$1>>2] = 10;
  20943. break;
  20944. }
  20945. $67 = HEAP32[$3>>2]|0;
  20946. $68 = (_strcmp($67,8473)|0);
  20947. $69 = ($68|0)!=(0);
  20948. if (!($69)) {
  20949. HEAP32[$1>>2] = 1;
  20950. break;
  20951. }
  20952. $70 = HEAP32[$3>>2]|0;
  20953. $71 = (_strcmp($70,8496)|0);
  20954. $72 = ($71|0)!=(0);
  20955. if (!($72)) {
  20956. HEAP32[$1>>2] = 1;
  20957. break;
  20958. }
  20959. $73 = HEAP32[$3>>2]|0;
  20960. $74 = (_strcmp($73,8522)|0);
  20961. $75 = ($74|0)!=(0);
  20962. if (!($75)) {
  20963. HEAP32[$1>>2] = 2;
  20964. break;
  20965. }
  20966. $76 = HEAP32[$3>>2]|0;
  20967. $77 = (_strcmp($76,8535)|0);
  20968. $78 = ($77|0)!=(0);
  20969. if (!($78)) {
  20970. HEAP32[$1>>2] = 3;
  20971. break;
  20972. }
  20973. $79 = HEAP32[$3>>2]|0;
  20974. $80 = (_strcmp($79,8551)|0);
  20975. $81 = ($80|0)!=(0);
  20976. if (!($81)) {
  20977. HEAP32[$1>>2] = 1;
  20978. break;
  20979. }
  20980. $82 = HEAP32[$3>>2]|0;
  20981. $83 = (_strcmp($82,8564)|0);
  20982. $84 = ($83|0)!=(0);
  20983. if (!($84)) {
  20984. HEAP32[$1>>2] = 11;
  20985. break;
  20986. }
  20987. $85 = HEAP32[$3>>2]|0;
  20988. $86 = (_strcmp($85,8578)|0);
  20989. $87 = ($86|0)!=(0);
  20990. if (!($87)) {
  20991. HEAP32[$1>>2] = 2;
  20992. break;
  20993. }
  20994. $88 = HEAP32[$3>>2]|0;
  20995. $89 = (_strcmp($88,8598)|0);
  20996. $90 = ($89|0)!=(0);
  20997. if (!($90)) {
  20998. HEAP32[$1>>2] = 3;
  20999. break;
  21000. }
  21001. $91 = HEAP32[$3>>2]|0;
  21002. $92 = (_strcmp($91,8618)|0);
  21003. $93 = ($92|0)!=(0);
  21004. if (!($93)) {
  21005. HEAP32[$1>>2] = 4;
  21006. break;
  21007. }
  21008. $94 = HEAP32[$3>>2]|0;
  21009. $95 = (_strcmp($94,8635)|0);
  21010. $96 = ($95|0)!=(0);
  21011. if (!($96)) {
  21012. HEAP32[$1>>2] = 5;
  21013. break;
  21014. }
  21015. $97 = HEAP32[$3>>2]|0;
  21016. $98 = (_strcmp($97,8652)|0);
  21017. $99 = ($98|0)!=(0);
  21018. if (!($99)) {
  21019. HEAP32[$1>>2] = 4;
  21020. break;
  21021. }
  21022. $100 = HEAP32[$3>>2]|0;
  21023. $101 = (_strcmp($100,8664)|0);
  21024. $102 = ($101|0)!=(0);
  21025. if (!($102)) {
  21026. HEAP32[$1>>2] = 12;
  21027. break;
  21028. }
  21029. $103 = HEAP32[$3>>2]|0;
  21030. $104 = (_strcmp($103,8677)|0);
  21031. $105 = ($104|0)!=(0);
  21032. if (!($105)) {
  21033. HEAP32[$1>>2] = 13;
  21034. break;
  21035. }
  21036. $106 = HEAP32[$3>>2]|0;
  21037. $107 = (_strcmp($106,8693)|0);
  21038. $108 = ($107|0)!=(0);
  21039. if (!($108)) {
  21040. HEAP32[$1>>2] = 6;
  21041. break;
  21042. }
  21043. $109 = HEAP32[$3>>2]|0;
  21044. $110 = (_strcmp($109,8716)|0);
  21045. $111 = ($110|0)!=(0);
  21046. if (!($111)) {
  21047. HEAP32[$1>>2] = 2;
  21048. break;
  21049. }
  21050. $112 = HEAP32[$3>>2]|0;
  21051. $113 = (_strcmp($112,8729)|0);
  21052. $114 = ($113|0)!=(0);
  21053. if (!($114)) {
  21054. HEAP32[$1>>2] = 3;
  21055. break;
  21056. }
  21057. $115 = HEAP32[$3>>2]|0;
  21058. $116 = (_strcmp($115,8745)|0);
  21059. $117 = ($116|0)!=(0);
  21060. if (!($117)) {
  21061. HEAP32[$1>>2] = 5;
  21062. break;
  21063. }
  21064. $118 = HEAP32[$3>>2]|0;
  21065. $119 = (_strcmp($118,8756)|0);
  21066. $120 = ($119|0)!=(0);
  21067. if (!($120)) {
  21068. HEAP32[$1>>2] = 14;
  21069. break;
  21070. }
  21071. $121 = HEAP32[$3>>2]|0;
  21072. $122 = (_strcmp($121,8775)|0);
  21073. $123 = ($122|0)!=(0);
  21074. if (!($123)) {
  21075. HEAP32[$1>>2] = 15;
  21076. break;
  21077. }
  21078. $124 = HEAP32[$3>>2]|0;
  21079. $125 = (_strcmp($124,8797)|0);
  21080. $126 = ($125|0)!=(0);
  21081. if (!($126)) {
  21082. HEAP32[$1>>2] = 16;
  21083. break;
  21084. }
  21085. $127 = HEAP32[$3>>2]|0;
  21086. $128 = (_strcmp($127,8816)|0);
  21087. $129 = ($128|0)!=(0);
  21088. if (!($129)) {
  21089. HEAP32[$1>>2] = 7;
  21090. break;
  21091. }
  21092. $130 = HEAP32[$3>>2]|0;
  21093. $131 = (_strcmp($130,8845)|0);
  21094. $132 = ($131|0)!=(0);
  21095. if (!($132)) {
  21096. HEAP32[$1>>2] = 6;
  21097. break;
  21098. }
  21099. $133 = HEAP32[$3>>2]|0;
  21100. $134 = (_strcmp($133,8862)|0);
  21101. $135 = ($134|0)!=(0);
  21102. if (!($135)) {
  21103. HEAP32[$1>>2] = 8;
  21104. break;
  21105. }
  21106. $136 = HEAP32[$3>>2]|0;
  21107. $137 = (_strcmp($136,8877)|0);
  21108. $138 = ($137|0)!=(0);
  21109. if (!($138)) {
  21110. HEAP32[$1>>2] = 9;
  21111. break;
  21112. }
  21113. $139 = HEAP32[$3>>2]|0;
  21114. $140 = (_strcmp($139,8892)|0);
  21115. $141 = ($140|0)!=(0);
  21116. if (!($141)) {
  21117. HEAP32[$1>>2] = 1;
  21118. break;
  21119. }
  21120. $142 = HEAP32[$3>>2]|0;
  21121. $143 = (_strcmp($142,8913)|0);
  21122. $144 = ($143|0)!=(0);
  21123. if (!($144)) {
  21124. HEAP32[$1>>2] = 10;
  21125. break;
  21126. }
  21127. $145 = HEAP32[$3>>2]|0;
  21128. $146 = (_strcmp($145,8933)|0);
  21129. $147 = ($146|0)!=(0);
  21130. if (!($147)) {
  21131. HEAP32[$1>>2] = 11;
  21132. break;
  21133. }
  21134. $148 = HEAP32[$3>>2]|0;
  21135. $149 = (_strcmp($148,8953)|0);
  21136. $150 = ($149|0)!=(0);
  21137. if (!($150)) {
  21138. HEAP32[$1>>2] = 12;
  21139. break;
  21140. }
  21141. $151 = HEAP32[$3>>2]|0;
  21142. $152 = (_strcmp($151,8979)|0);
  21143. $153 = ($152|0)!=(0);
  21144. if (!($153)) {
  21145. HEAP32[$1>>2] = 2;
  21146. break;
  21147. }
  21148. $154 = HEAP32[$3>>2]|0;
  21149. $155 = (_strcmp($154,8998)|0);
  21150. $156 = ($155|0)!=(0);
  21151. if (!($156)) {
  21152. HEAP32[$1>>2] = 1;
  21153. break;
  21154. }
  21155. $157 = HEAP32[$3>>2]|0;
  21156. $158 = (_strcmp($157,9010)|0);
  21157. $159 = ($158|0)!=(0);
  21158. if (!($159)) {
  21159. HEAP32[$1>>2] = 3;
  21160. break;
  21161. }
  21162. $160 = HEAP32[$3>>2]|0;
  21163. $161 = (_strcmp($160,9022)|0);
  21164. $162 = ($161|0)!=(0);
  21165. if (!($162)) {
  21166. HEAP32[$1>>2] = 1;
  21167. break;
  21168. }
  21169. $163 = HEAP32[$3>>2]|0;
  21170. $164 = (_strcmp($163,9034)|0);
  21171. $165 = ($164|0)!=(0);
  21172. if (!($165)) {
  21173. HEAP32[$1>>2] = 1;
  21174. break;
  21175. }
  21176. $166 = HEAP32[$3>>2]|0;
  21177. $167 = (_strcmp($166,9046)|0);
  21178. $168 = ($167|0)!=(0);
  21179. if (!($168)) {
  21180. HEAP32[$1>>2] = 17;
  21181. break;
  21182. }
  21183. $169 = HEAP32[$3>>2]|0;
  21184. $170 = (_strcmp($169,9058)|0);
  21185. $171 = ($170|0)!=(0);
  21186. if (!($171)) {
  21187. HEAP32[$1>>2] = 13;
  21188. break;
  21189. }
  21190. $172 = HEAP32[$3>>2]|0;
  21191. $173 = (_strcmp($172,9070)|0);
  21192. $174 = ($173|0)!=(0);
  21193. if (!($174)) {
  21194. HEAP32[$1>>2] = 4;
  21195. break;
  21196. }
  21197. $175 = HEAP32[$3>>2]|0;
  21198. $176 = (_strcmp($175,9082)|0);
  21199. $177 = ($176|0)!=(0);
  21200. if (!($177)) {
  21201. HEAP32[$1>>2] = 2;
  21202. break;
  21203. }
  21204. $178 = HEAP32[$3>>2]|0;
  21205. $179 = (_strcmp($178,9094)|0);
  21206. $180 = ($179|0)!=(0);
  21207. if (!($180)) {
  21208. HEAP32[$1>>2] = 14;
  21209. break;
  21210. }
  21211. $181 = HEAP32[$3>>2]|0;
  21212. $182 = (_strcmp($181,9107)|0);
  21213. $183 = ($182|0)!=(0);
  21214. if (!($183)) {
  21215. HEAP32[$1>>2] = 15;
  21216. break;
  21217. }
  21218. $184 = HEAP32[$3>>2]|0;
  21219. $185 = (_strcmp($184,9120)|0);
  21220. $186 = ($185|0)!=(0);
  21221. if (!($186)) {
  21222. HEAP32[$1>>2] = 16;
  21223. break;
  21224. }
  21225. $187 = HEAP32[$3>>2]|0;
  21226. $188 = (_strcmp($187,9133)|0);
  21227. $189 = ($188|0)!=(0);
  21228. if (!($189)) {
  21229. HEAP32[$1>>2] = 17;
  21230. break;
  21231. }
  21232. $190 = HEAP32[$3>>2]|0;
  21233. $191 = (_strcmp($190,9146)|0);
  21234. $192 = ($191|0)!=(0);
  21235. if (!($192)) {
  21236. HEAP32[$1>>2] = 18;
  21237. break;
  21238. }
  21239. $193 = HEAP32[$3>>2]|0;
  21240. $194 = (_strcmp($193,9159)|0);
  21241. $195 = ($194|0)!=(0);
  21242. if (!($195)) {
  21243. HEAP32[$1>>2] = 19;
  21244. break;
  21245. }
  21246. $196 = HEAP32[$3>>2]|0;
  21247. $197 = (_strcmp($196,9172)|0);
  21248. $198 = ($197|0)!=(0);
  21249. if (!($198)) {
  21250. HEAP32[$1>>2] = 20;
  21251. break;
  21252. }
  21253. $199 = HEAP32[$3>>2]|0;
  21254. $200 = (_strcmp($199,9185)|0);
  21255. $201 = ($200|0)!=(0);
  21256. if (!($201)) {
  21257. HEAP32[$1>>2] = 21;
  21258. break;
  21259. }
  21260. $202 = HEAP32[$3>>2]|0;
  21261. $203 = (_strcmp($202,9198)|0);
  21262. $204 = ($203|0)!=(0);
  21263. if (!($204)) {
  21264. HEAP32[$1>>2] = 5;
  21265. break;
  21266. }
  21267. $205 = HEAP32[$3>>2]|0;
  21268. $206 = (_strcmp($205,9217)|0);
  21269. $207 = ($206|0)!=(0);
  21270. if (!($207)) {
  21271. HEAP32[$1>>2] = 6;
  21272. break;
  21273. }
  21274. $208 = HEAP32[$3>>2]|0;
  21275. $209 = (_strcmp($208,9236)|0);
  21276. $210 = ($209|0)!=(0);
  21277. if (!($210)) {
  21278. HEAP32[$1>>2] = 7;
  21279. break;
  21280. }
  21281. $211 = HEAP32[$3>>2]|0;
  21282. $212 = (_strcmp($211,9255)|0);
  21283. $213 = ($212|0)!=(0);
  21284. if (!($213)) {
  21285. HEAP32[$1>>2] = 18;
  21286. break;
  21287. }
  21288. $214 = HEAP32[$3>>2]|0;
  21289. $215 = (_strcmp($214,9268)|0);
  21290. $216 = ($215|0)!=(0);
  21291. if (!($216)) {
  21292. HEAP32[$1>>2] = 19;
  21293. break;
  21294. }
  21295. $217 = HEAP32[$3>>2]|0;
  21296. $218 = (_strcmp($217,9286)|0);
  21297. $219 = ($218|0)!=(0);
  21298. if (!($219)) {
  21299. HEAP32[$1>>2] = 20;
  21300. break;
  21301. }
  21302. $220 = HEAP32[$3>>2]|0;
  21303. $221 = (_strcmp($220,9304)|0);
  21304. $222 = ($221|0)!=(0);
  21305. if (!($222)) {
  21306. HEAP32[$1>>2] = 21;
  21307. break;
  21308. }
  21309. $223 = HEAP32[$3>>2]|0;
  21310. $224 = (_strcmp($223,9322)|0);
  21311. $225 = ($224|0)!=(0);
  21312. if (!($225)) {
  21313. HEAP32[$1>>2] = 22;
  21314. break;
  21315. }
  21316. $226 = HEAP32[$3>>2]|0;
  21317. $227 = (_strcmp($226,9340)|0);
  21318. $228 = ($227|0)!=(0);
  21319. if (!($228)) {
  21320. HEAP32[$1>>2] = 2;
  21321. break;
  21322. }
  21323. $229 = HEAP32[$3>>2]|0;
  21324. $230 = (_strcmp($229,9360)|0);
  21325. $231 = ($230|0)!=(0);
  21326. if (!($231)) {
  21327. HEAP32[$1>>2] = 3;
  21328. break;
  21329. }
  21330. $232 = HEAP32[$3>>2]|0;
  21331. $233 = (_strcmp($232,8301)|0);
  21332. $234 = ($233|0)!=(0);
  21333. if (!($234)) {
  21334. HEAP32[$1>>2] = 7;
  21335. break;
  21336. }
  21337. $235 = HEAP32[$3>>2]|0;
  21338. $236 = (_strcmp($235,9378)|0);
  21339. $237 = ($236|0)!=(0);
  21340. if (!($237)) {
  21341. HEAP32[$1>>2] = 1;
  21342. break;
  21343. }
  21344. $238 = HEAP32[$3>>2]|0;
  21345. $239 = (_strcmp($238,9393)|0);
  21346. $240 = ($239|0)!=(0);
  21347. if (!($240)) {
  21348. HEAP32[$1>>2] = 8;
  21349. break;
  21350. }
  21351. $241 = HEAP32[$3>>2]|0;
  21352. $242 = (_strcmp($241,9414)|0);
  21353. $243 = ($242|0)!=(0);
  21354. if (!($243)) {
  21355. HEAP32[$1>>2] = 9;
  21356. break;
  21357. }
  21358. $244 = HEAP32[$3>>2]|0;
  21359. $245 = (_strcmp($244,9429)|0);
  21360. $246 = ($245|0)!=(0);
  21361. if (!($246)) {
  21362. HEAP32[$1>>2] = 10;
  21363. break;
  21364. }
  21365. $247 = HEAP32[$3>>2]|0;
  21366. $248 = (_strcmp($247,9447)|0);
  21367. $249 = ($248|0)!=(0);
  21368. if (!($249)) {
  21369. HEAP32[$1>>2] = 2;
  21370. break;
  21371. }
  21372. $250 = HEAP32[$3>>2]|0;
  21373. $251 = (_strcmp($250,9463)|0);
  21374. $252 = ($251|0)!=(0);
  21375. if (!($252)) {
  21376. HEAP32[$1>>2] = 11;
  21377. break;
  21378. }
  21379. $253 = HEAP32[$3>>2]|0;
  21380. $254 = (_strcmp($253,9482)|0);
  21381. $255 = ($254|0)!=(0);
  21382. if (!($255)) {
  21383. HEAP32[$1>>2] = 22;
  21384. break;
  21385. }
  21386. $256 = HEAP32[$3>>2]|0;
  21387. $257 = (_strcmp($256,9496)|0);
  21388. $258 = ($257|0)!=(0);
  21389. if (!($258)) {
  21390. HEAP32[$1>>2] = 23;
  21391. break;
  21392. }
  21393. $259 = HEAP32[$3>>2]|0;
  21394. $260 = (_strcmp($259,9511)|0);
  21395. $261 = ($260|0)!=(0);
  21396. if (!($261)) {
  21397. HEAP32[$1>>2] = 8;
  21398. break;
  21399. }
  21400. $262 = HEAP32[$3>>2]|0;
  21401. $263 = (_strcmp($262,8232)|0);
  21402. $264 = ($263|0)!=(0);
  21403. if (!($264)) {
  21404. HEAP32[$1>>2] = 1;
  21405. break;
  21406. }
  21407. $265 = HEAP32[$3>>2]|0;
  21408. $266 = (_strcmp($265,9522)|0);
  21409. $267 = ($266|0)!=(0);
  21410. if (!($267)) {
  21411. HEAP32[$1>>2] = 3;
  21412. break;
  21413. }
  21414. $268 = HEAP32[$3>>2]|0;
  21415. $269 = (_strcmp($268,8331)|0);
  21416. $270 = ($269|0)!=(0);
  21417. if (!($270)) {
  21418. HEAP32[$1>>2] = 23;
  21419. break;
  21420. }
  21421. $271 = HEAP32[$3>>2]|0;
  21422. $272 = (_strcmp($271,8361)|0);
  21423. $273 = ($272|0)!=(0);
  21424. if (!($273)) {
  21425. HEAP32[$1>>2] = 24;
  21426. break;
  21427. }
  21428. $274 = HEAP32[$3>>2]|0;
  21429. $275 = (_strcmp($274,9538)|0);
  21430. $276 = ($275|0)!=(0);
  21431. if (!($276)) {
  21432. HEAP32[$1>>2] = 12;
  21433. break;
  21434. }
  21435. $277 = HEAP32[$3>>2]|0;
  21436. $278 = (_strcmp($277,9565)|0);
  21437. $279 = ($278|0)!=(0);
  21438. if (!($279)) {
  21439. HEAP32[$1>>2] = 4;
  21440. break;
  21441. }
  21442. $280 = HEAP32[$3>>2]|0;
  21443. $281 = (_strcmp($280,9579)|0);
  21444. $282 = ($281|0)!=(0);
  21445. if (!($282)) {
  21446. HEAP32[$1>>2] = 13;
  21447. break;
  21448. }
  21449. $283 = HEAP32[$3>>2]|0;
  21450. $284 = (_strcmp($283,8267)|0);
  21451. $285 = ($284|0)!=(0);
  21452. if (!($285)) {
  21453. HEAP32[$1>>2] = 5;
  21454. break;
  21455. }
  21456. $286 = HEAP32[$3>>2]|0;
  21457. $287 = (_strcmp($286,9599)|0);
  21458. $288 = ($287|0)!=(0);
  21459. if (!($288)) {
  21460. HEAP32[$1>>2] = 6;
  21461. break;
  21462. }
  21463. $289 = HEAP32[$3>>2]|0;
  21464. $290 = (_strcmp($289,9617)|0);
  21465. $291 = ($290|0)!=(0);
  21466. if (!($291)) {
  21467. HEAP32[$1>>2] = 9;
  21468. break;
  21469. }
  21470. $292 = HEAP32[$3>>2]|0;
  21471. $293 = (_strcmp($292,9629)|0);
  21472. $294 = ($293|0)!=(0);
  21473. if (!($294)) {
  21474. HEAP32[$1>>2] = 24;
  21475. break;
  21476. }
  21477. $295 = HEAP32[$3>>2]|0;
  21478. $296 = (_strcmp($295,9650)|0);
  21479. $297 = ($296|0)!=(0);
  21480. if (!($297)) {
  21481. HEAP32[$1>>2] = 25;
  21482. break;
  21483. }
  21484. $298 = HEAP32[$3>>2]|0;
  21485. $299 = (_strcmp($298,9668)|0);
  21486. $300 = ($299|0)!=(0);
  21487. if (!($300)) {
  21488. HEAP32[$1>>2] = 26;
  21489. break;
  21490. }
  21491. $301 = HEAP32[$3>>2]|0;
  21492. $302 = (_strcmp($301,9686)|0);
  21493. $303 = ($302|0)!=(0);
  21494. if (!($303)) {
  21495. HEAP32[$1>>2] = 27;
  21496. break;
  21497. }
  21498. $304 = HEAP32[$3>>2]|0;
  21499. $305 = (_strcmp($304,9707)|0);
  21500. $306 = ($305|0)!=(0);
  21501. if (!($306)) {
  21502. HEAP32[$1>>2] = 14;
  21503. break;
  21504. }
  21505. $307 = HEAP32[$3>>2]|0;
  21506. $308 = (_strcmp($307,9733)|0);
  21507. $309 = ($308|0)!=(0);
  21508. if (!($309)) {
  21509. HEAP32[$1>>2] = 3;
  21510. break;
  21511. }
  21512. $310 = HEAP32[$3>>2]|0;
  21513. $311 = (_strcmp($310,9756)|0);
  21514. $312 = ($311|0)!=(0);
  21515. if (!($312)) {
  21516. HEAP32[$1>>2] = 15;
  21517. break;
  21518. }
  21519. $313 = HEAP32[$3>>2]|0;
  21520. $314 = (_strcmp($313,9794)|0);
  21521. $315 = ($314|0)!=(0);
  21522. if (!($315)) {
  21523. HEAP32[$1>>2] = 10;
  21524. break;
  21525. }
  21526. $316 = HEAP32[$3>>2]|0;
  21527. $317 = (_strcmp($316,9810)|0);
  21528. $318 = ($317|0)!=(0);
  21529. if (!($318)) {
  21530. HEAP32[$1>>2] = 7;
  21531. break;
  21532. }
  21533. $319 = HEAP32[$3>>2]|0;
  21534. $320 = (_strcmp($319,9825)|0);
  21535. $321 = ($320|0)!=(0);
  21536. if (!($321)) {
  21537. HEAP32[$1>>2] = 25;
  21538. break;
  21539. }
  21540. $322 = HEAP32[$3>>2]|0;
  21541. $323 = (_strcmp($322,9848)|0);
  21542. $324 = ($323|0)!=(0);
  21543. if (!($324)) {
  21544. HEAP32[$1>>2] = 16;
  21545. break;
  21546. }
  21547. $325 = HEAP32[$3>>2]|0;
  21548. $326 = (_strcmp($325,9861)|0);
  21549. $327 = ($326|0)!=(0);
  21550. if (!($327)) {
  21551. HEAP32[$1>>2] = 28;
  21552. break;
  21553. }
  21554. $328 = HEAP32[$3>>2]|0;
  21555. $329 = (_strcmp($328,9875)|0);
  21556. $330 = ($329|0)!=(0);
  21557. if (!($330)) {
  21558. HEAP32[$1>>2] = 29;
  21559. break;
  21560. }
  21561. $331 = HEAP32[$3>>2]|0;
  21562. $332 = (_strcmp($331,9889)|0);
  21563. $333 = ($332|0)!=(0);
  21564. if (!($333)) {
  21565. HEAP32[$1>>2] = 1;
  21566. break;
  21567. }
  21568. $334 = HEAP32[$3>>2]|0;
  21569. $335 = (_strcmp($334,9909)|0);
  21570. $336 = ($335|0)!=(0);
  21571. if (!($336)) {
  21572. HEAP32[$1>>2] = 8;
  21573. break;
  21574. }
  21575. $337 = HEAP32[$3>>2]|0;
  21576. $338 = (_strcmp($337,9929)|0);
  21577. $339 = ($338|0)!=(0);
  21578. if (!($339)) {
  21579. HEAP32[$1>>2] = 17;
  21580. break;
  21581. }
  21582. $340 = HEAP32[$3>>2]|0;
  21583. $341 = (_strcmp($340,9945)|0);
  21584. $342 = ($341|0)!=(0);
  21585. if (!($342)) {
  21586. HEAP32[$1>>2] = 18;
  21587. break;
  21588. }
  21589. $343 = HEAP32[$3>>2]|0;
  21590. $344 = (_strcmp($343,9963)|0);
  21591. $345 = ($344|0)!=(0);
  21592. if (!($345)) {
  21593. HEAP32[$1>>2] = 26;
  21594. break;
  21595. }
  21596. $346 = HEAP32[$3>>2]|0;
  21597. $347 = (_strcmp($346,9979)|0);
  21598. $348 = ($347|0)!=(0);
  21599. if (!($348)) {
  21600. HEAP32[$1>>2] = 19;
  21601. break;
  21602. }
  21603. $349 = HEAP32[$3>>2]|0;
  21604. $350 = (_strcmp($349,9994)|0);
  21605. $351 = ($350|0)!=(0);
  21606. if (!($351)) {
  21607. HEAP32[$1>>2] = 9;
  21608. break;
  21609. }
  21610. $352 = HEAP32[$3>>2]|0;
  21611. $353 = (_strcmp($352,10016)|0);
  21612. $354 = ($353|0)!=(0);
  21613. if (!($354)) {
  21614. HEAP32[$1>>2] = 30;
  21615. break;
  21616. }
  21617. $355 = HEAP32[$3>>2]|0;
  21618. $356 = (_strcmp($355,10034)|0);
  21619. $357 = ($356|0)!=(0);
  21620. if (!($357)) {
  21621. HEAP32[$1>>2] = 31;
  21622. break;
  21623. }
  21624. $358 = HEAP32[$3>>2]|0;
  21625. $359 = (_strcmp($358,10055)|0);
  21626. $360 = ($359|0)!=(0);
  21627. if (!($360)) {
  21628. HEAP32[$1>>2] = 10;
  21629. break;
  21630. }
  21631. $361 = HEAP32[$3>>2]|0;
  21632. $362 = (_strcmp($361,10073)|0);
  21633. $363 = ($362|0)!=(0);
  21634. if (!($363)) {
  21635. HEAP32[$1>>2] = 11;
  21636. break;
  21637. }
  21638. $364 = HEAP32[$3>>2]|0;
  21639. $365 = (_strcmp($364,10086)|0);
  21640. $366 = ($365|0)!=(0);
  21641. if (!($366)) {
  21642. HEAP32[$1>>2] = 2;
  21643. break;
  21644. }
  21645. $367 = HEAP32[$3>>2]|0;
  21646. $368 = (_strcmp($367,10101)|0);
  21647. $369 = ($368|0)!=(0);
  21648. if (!($369)) {
  21649. HEAP32[$1>>2] = 12;
  21650. break;
  21651. }
  21652. $370 = HEAP32[$3>>2]|0;
  21653. $371 = (_strcmp($370,10115)|0);
  21654. $372 = ($371|0)!=(0);
  21655. if (!($372)) {
  21656. HEAP32[$1>>2] = 1;
  21657. break;
  21658. }
  21659. $373 = HEAP32[$3>>2]|0;
  21660. $374 = (_strcmp($373,10125)|0);
  21661. $375 = ($374|0)!=(0);
  21662. if (!($375)) {
  21663. HEAP32[$1>>2] = 1;
  21664. break;
  21665. }
  21666. $376 = HEAP32[$3>>2]|0;
  21667. $377 = (_strcmp($376,10135)|0);
  21668. $378 = ($377|0)!=(0);
  21669. if (!($378)) {
  21670. HEAP32[$1>>2] = 2;
  21671. break;
  21672. }
  21673. $379 = HEAP32[$3>>2]|0;
  21674. $380 = (_strcmp($379,10157)|0);
  21675. $381 = ($380|0)!=(0);
  21676. if (!($381)) {
  21677. HEAP32[$1>>2] = 13;
  21678. break;
  21679. }
  21680. $382 = HEAP32[$3>>2]|0;
  21681. $383 = (_strcmp($382,10183)|0);
  21682. $384 = ($383|0)!=(0);
  21683. if (!($384)) {
  21684. HEAP32[$1>>2] = 14;
  21685. break;
  21686. }
  21687. $385 = HEAP32[$3>>2]|0;
  21688. $386 = (_strcmp($385,10210)|0);
  21689. $387 = ($386|0)!=(0);
  21690. if (!($387)) {
  21691. HEAP32[$1>>2] = 27;
  21692. break;
  21693. }
  21694. $388 = HEAP32[$3>>2]|0;
  21695. $389 = (_strcmp($388,10223)|0);
  21696. $390 = ($389|0)!=(0);
  21697. if (!($390)) {
  21698. HEAP32[$1>>2] = 20;
  21699. break;
  21700. }
  21701. $391 = HEAP32[$3>>2]|0;
  21702. $392 = (_strcmp($391,10238)|0);
  21703. $393 = ($392|0)!=(0);
  21704. if (!($393)) {
  21705. HEAP32[$1>>2] = 4;
  21706. break;
  21707. }
  21708. $394 = HEAP32[$3>>2]|0;
  21709. $395 = (_strcmp($394,10253)|0);
  21710. $396 = ($395|0)!=(0);
  21711. if (!($396)) {
  21712. HEAP32[$1>>2] = 3;
  21713. break;
  21714. }
  21715. $397 = HEAP32[$3>>2]|0;
  21716. $398 = (_strcmp($397,10277)|0);
  21717. $399 = ($398|0)!=(0);
  21718. if (!($399)) {
  21719. HEAP32[$1>>2] = 2;
  21720. break;
  21721. }
  21722. $400 = HEAP32[$3>>2]|0;
  21723. $401 = (_strcmp($400,10288)|0);
  21724. $402 = ($401|0)!=(0);
  21725. if (!($402)) {
  21726. HEAP32[$1>>2] = 32;
  21727. break;
  21728. }
  21729. $403 = HEAP32[$3>>2]|0;
  21730. $404 = (_strcmp($403,10310)|0);
  21731. $405 = ($404|0)!=(0);
  21732. if (!($405)) {
  21733. HEAP32[$1>>2] = 21;
  21734. break;
  21735. }
  21736. $406 = HEAP32[$3>>2]|0;
  21737. $407 = (_strcmp($406,10332)|0);
  21738. $408 = ($407|0)!=(0);
  21739. if (!($408)) {
  21740. HEAP32[$1>>2] = 5;
  21741. break;
  21742. }
  21743. $409 = HEAP32[$3>>2]|0;
  21744. $410 = (_strcmp($409,10356)|0);
  21745. $411 = ($410|0)!=(0);
  21746. if (!($411)) {
  21747. HEAP32[$1>>2] = 4;
  21748. break;
  21749. }
  21750. $412 = HEAP32[$3>>2]|0;
  21751. $413 = (_strcmp($412,10365)|0);
  21752. $414 = ($413|0)!=(0);
  21753. if (!($414)) {
  21754. HEAP32[$1>>2] = 5;
  21755. break;
  21756. }
  21757. $415 = HEAP32[$3>>2]|0;
  21758. $416 = (_strcmp($415,10373)|0);
  21759. $417 = ($416|0)!=(0);
  21760. if (!($417)) {
  21761. HEAP32[$1>>2] = 1;
  21762. break;
  21763. }
  21764. $418 = HEAP32[$3>>2]|0;
  21765. $419 = (_strcmp($418,10386)|0);
  21766. $420 = ($419|0)!=(0);
  21767. if (!($420)) {
  21768. HEAP32[$1>>2] = 2;
  21769. break;
  21770. }
  21771. $421 = HEAP32[$3>>2]|0;
  21772. $422 = (_strcmp($421,10400)|0);
  21773. $423 = ($422|0)!=(0);
  21774. if (!($423)) {
  21775. HEAP32[$1>>2] = 15;
  21776. break;
  21777. }
  21778. $424 = HEAP32[$3>>2]|0;
  21779. $425 = (_strcmp($424,10412)|0);
  21780. $426 = ($425|0)!=(0);
  21781. if (!($426)) {
  21782. HEAP32[$1>>2] = 16;
  21783. break;
  21784. }
  21785. $427 = HEAP32[$3>>2]|0;
  21786. $428 = (_strcmp($427,10421)|0);
  21787. $429 = ($428|0)!=(0);
  21788. if (!($429)) {
  21789. HEAP32[$1>>2] = 17;
  21790. break;
  21791. }
  21792. $430 = HEAP32[$3>>2]|0;
  21793. $431 = (_strcmp($430,10431)|0);
  21794. $432 = ($431|0)!=(0);
  21795. if (!($432)) {
  21796. HEAP32[$1>>2] = 18;
  21797. break;
  21798. }
  21799. $433 = HEAP32[$3>>2]|0;
  21800. $434 = (_strcmp($433,10443)|0);
  21801. $435 = ($434|0)!=(0);
  21802. if (!($435)) {
  21803. HEAP32[$1>>2] = 19;
  21804. break;
  21805. }
  21806. $436 = HEAP32[$3>>2]|0;
  21807. $437 = (_strcmp($436,10454)|0);
  21808. $438 = ($437|0)!=(0);
  21809. if (!($438)) {
  21810. HEAP32[$1>>2] = 20;
  21811. break;
  21812. }
  21813. $439 = HEAP32[$3>>2]|0;
  21814. $440 = (_strcmp($439,10462)|0);
  21815. $441 = ($440|0)!=(0);
  21816. if (!($441)) {
  21817. HEAP32[$1>>2] = 3;
  21818. break;
  21819. }
  21820. $442 = HEAP32[$3>>2]|0;
  21821. $443 = (_strcmp($442,10474)|0);
  21822. $444 = ($443|0)!=(0);
  21823. if (!($444)) {
  21824. HEAP32[$1>>2] = 21;
  21825. break;
  21826. }
  21827. $445 = HEAP32[$3>>2]|0;
  21828. $446 = (_strcmp($445,10489)|0);
  21829. $447 = ($446|0)!=(0);
  21830. if (!($447)) {
  21831. HEAP32[$1>>2] = 22;
  21832. break;
  21833. }
  21834. $448 = HEAP32[$3>>2]|0;
  21835. $449 = (_strcmp($448,10501)|0);
  21836. $450 = ($449|0)!=(0);
  21837. if (!($450)) {
  21838. HEAP32[$1>>2] = 23;
  21839. break;
  21840. }
  21841. $451 = HEAP32[$3>>2]|0;
  21842. $452 = (_strcmp($451,10515)|0);
  21843. $453 = ($452|0)!=(0);
  21844. if (!($453)) {
  21845. HEAP32[$1>>2] = 11;
  21846. break;
  21847. }
  21848. $454 = HEAP32[$3>>2]|0;
  21849. $455 = (_strcmp($454,10540)|0);
  21850. $456 = ($455|0)!=(0);
  21851. if (!($456)) {
  21852. HEAP32[$1>>2] = 24;
  21853. break;
  21854. }
  21855. $457 = HEAP32[$3>>2]|0;
  21856. $458 = (_strcmp($457,10557)|0);
  21857. $459 = ($458|0)!=(0);
  21858. if (!($459)) {
  21859. HEAP32[$1>>2] = 25;
  21860. break;
  21861. }
  21862. $460 = HEAP32[$3>>2]|0;
  21863. $461 = (_strcmp($460,10573)|0);
  21864. $462 = ($461|0)!=(0);
  21865. if (!($462)) {
  21866. HEAP32[$1>>2] = 26;
  21867. break;
  21868. }
  21869. $463 = HEAP32[$3>>2]|0;
  21870. $464 = (_strcmp($463,10589)|0);
  21871. $465 = ($464|0)!=(0);
  21872. if (!($465)) {
  21873. HEAP32[$1>>2] = 12;
  21874. break;
  21875. }
  21876. $466 = HEAP32[$3>>2]|0;
  21877. $467 = (_strcmp($466,10601)|0);
  21878. $468 = ($467|0)!=(0);
  21879. if (!($468)) {
  21880. HEAP32[$1>>2] = 33;
  21881. break;
  21882. }
  21883. $469 = HEAP32[$3>>2]|0;
  21884. $470 = (_strcmp($469,10613)|0);
  21885. $471 = ($470|0)!=(0);
  21886. if (!($471)) {
  21887. HEAP32[$1>>2] = 34;
  21888. break;
  21889. }
  21890. $472 = HEAP32[$3>>2]|0;
  21891. $473 = (_strcmp($472,10637)|0);
  21892. $474 = ($473|0)!=(0);
  21893. if (!($474)) {
  21894. HEAP32[$1>>2] = 1;
  21895. break;
  21896. }
  21897. $475 = HEAP32[$3>>2]|0;
  21898. $476 = (_strcmp($475,10650)|0);
  21899. $477 = ($476|0)!=(0);
  21900. if (!($477)) {
  21901. HEAP32[$1>>2] = 2;
  21902. break;
  21903. }
  21904. $478 = HEAP32[$3>>2]|0;
  21905. $479 = (_strcmp($478,10664)|0);
  21906. $480 = ($479|0)!=(0);
  21907. if (!($480)) {
  21908. HEAP32[$1>>2] = 35;
  21909. break;
  21910. }
  21911. $481 = HEAP32[$3>>2]|0;
  21912. $482 = (_strcmp($481,10686)|0);
  21913. $483 = ($482|0)!=(0);
  21914. if (!($483)) {
  21915. HEAP32[$1>>2] = 36;
  21916. break;
  21917. }
  21918. $484 = HEAP32[$3>>2]|0;
  21919. $485 = (_strcmp($484,10693)|0);
  21920. $486 = ($485|0)!=(0);
  21921. if (!($486)) {
  21922. HEAP32[$1>>2] = 3;
  21923. break;
  21924. }
  21925. $487 = HEAP32[$3>>2]|0;
  21926. $488 = (_strcmp($487,10709)|0);
  21927. $489 = ($488|0)!=(0);
  21928. if (!($489)) {
  21929. HEAP32[$1>>2] = 2;
  21930. break;
  21931. }
  21932. $490 = HEAP32[$3>>2]|0;
  21933. $491 = (_strcmp($490,10726)|0);
  21934. $492 = ($491|0)!=(0);
  21935. if (!($492)) {
  21936. HEAP32[$1>>2] = 1;
  21937. break;
  21938. }
  21939. $493 = HEAP32[$3>>2]|0;
  21940. $494 = (_strcmp($493,10743)|0);
  21941. $495 = ($494|0)!=(0);
  21942. if (!($495)) {
  21943. HEAP32[$1>>2] = 28;
  21944. break;
  21945. }
  21946. $496 = HEAP32[$3>>2]|0;
  21947. $497 = (_strcmp($496,10759)|0);
  21948. $498 = ($497|0)!=(0);
  21949. if (!($498)) {
  21950. HEAP32[$1>>2] = 1;
  21951. break;
  21952. }
  21953. $499 = HEAP32[$3>>2]|0;
  21954. $500 = (_strcmp($499,10775)|0);
  21955. $501 = ($500|0)!=(0);
  21956. if (!($501)) {
  21957. HEAP32[$1>>2] = 4;
  21958. break;
  21959. }
  21960. $502 = HEAP32[$3>>2]|0;
  21961. $503 = (_strcmp($502,10792)|0);
  21962. $504 = ($503|0)!=(0);
  21963. if (!($504)) {
  21964. HEAP32[$1>>2] = 29;
  21965. break;
  21966. }
  21967. $505 = HEAP32[$3>>2]|0;
  21968. $506 = (_strcmp($505,10806)|0);
  21969. $507 = ($506|0)!=(0);
  21970. if (!($507)) {
  21971. HEAP32[$1>>2] = 30;
  21972. break;
  21973. }
  21974. $508 = HEAP32[$3>>2]|0;
  21975. $509 = (_strcmp($508,10818)|0);
  21976. $510 = ($509|0)!=(0);
  21977. if (!($510)) {
  21978. HEAP32[$1>>2] = 22;
  21979. break;
  21980. }
  21981. $511 = HEAP32[$3>>2]|0;
  21982. $512 = (_strcmp($511,10829)|0);
  21983. $513 = ($512|0)!=(0);
  21984. if (!($513)) {
  21985. HEAP32[$1>>2] = 2;
  21986. break;
  21987. }
  21988. $514 = HEAP32[$3>>2]|0;
  21989. $515 = (_strcmp($514,10842)|0);
  21990. $516 = ($515|0)!=(0);
  21991. if (!($516)) {
  21992. HEAP32[$1>>2] = 23;
  21993. break;
  21994. }
  21995. $517 = HEAP32[$3>>2]|0;
  21996. $518 = (_strcmp($517,10852)|0);
  21997. $519 = ($518|0)!=(0);
  21998. if (!($519)) {
  21999. HEAP32[$1>>2] = 2;
  22000. break;
  22001. }
  22002. $520 = HEAP32[$3>>2]|0;
  22003. $521 = (_strcmp($520,10869)|0);
  22004. $522 = ($521|0)!=(0);
  22005. if (!($522)) {
  22006. HEAP32[$1>>2] = 24;
  22007. break;
  22008. }
  22009. $523 = HEAP32[$3>>2]|0;
  22010. $524 = (_strcmp($523,10881)|0);
  22011. $525 = ($524|0)!=(0);
  22012. if (!($525)) {
  22013. HEAP32[$1>>2] = 25;
  22014. break;
  22015. }
  22016. $526 = HEAP32[$3>>2]|0;
  22017. $527 = (_strcmp($526,10903)|0);
  22018. $528 = ($527|0)!=(0);
  22019. if (!($528)) {
  22020. HEAP32[$1>>2] = 26;
  22021. break;
  22022. }
  22023. $529 = HEAP32[$3>>2]|0;
  22024. $530 = (_strcmp($529,10923)|0);
  22025. $531 = ($530|0)!=(0);
  22026. if (!($531)) {
  22027. HEAP32[$1>>2] = 3;
  22028. break;
  22029. }
  22030. $532 = HEAP32[$3>>2]|0;
  22031. $533 = (_strcmp($532,10936)|0);
  22032. $534 = ($533|0)!=(0);
  22033. if (!($534)) {
  22034. HEAP32[$1>>2] = 27;
  22035. break;
  22036. }
  22037. $535 = HEAP32[$3>>2]|0;
  22038. $536 = (_strcmp($535,10958)|0);
  22039. $537 = ($536|0)!=(0);
  22040. if (!($537)) {
  22041. HEAP32[$1>>2] = 28;
  22042. break;
  22043. }
  22044. $538 = HEAP32[$3>>2]|0;
  22045. $539 = (_strcmp($538,10978)|0);
  22046. $540 = ($539|0)!=(0);
  22047. if (!($540)) {
  22048. HEAP32[$1>>2] = 2;
  22049. break;
  22050. }
  22051. $541 = HEAP32[$3>>2]|0;
  22052. $542 = (_strcmp($541,10995)|0);
  22053. $543 = ($542|0)!=(0);
  22054. if (!($543)) {
  22055. HEAP32[$1>>2] = 2;
  22056. break;
  22057. }
  22058. $544 = HEAP32[$3>>2]|0;
  22059. $545 = (_strcmp($544,11012)|0);
  22060. $546 = ($545|0)!=(0);
  22061. if (!($546)) {
  22062. HEAP32[$1>>2] = 3;
  22063. break;
  22064. }
  22065. $547 = HEAP32[$3>>2]|0;
  22066. $548 = (_strcmp($547,11032)|0);
  22067. $549 = ($548|0)!=(0);
  22068. if ($549) {
  22069. $550 = HEAP32[$2>>2]|0;
  22070. $551 = HEAP32[$3>>2]|0;
  22071. $552 = _emscripten_asm_const_iii(0, ($550|0), ($551|0))|0;
  22072. HEAP32[$1>>2] = 0;
  22073. break;
  22074. } else {
  22075. HEAP32[$1>>2] = 37;
  22076. break;
  22077. }
  22078. } else {
  22079. HEAP32[$1>>2] = 5;
  22080. }
  22081. } while(0);
  22082. $553 = HEAP32[$1>>2]|0;
  22083. STACKTOP = sp;return ($553|0);
  22084. }
  22085. function _emscripten_get_global_libc() {
  22086. var label = 0, sp = 0;
  22087. sp = STACKTOP;
  22088. return (33220|0);
  22089. }
  22090. function ___emscripten_pthread_data_constructor() {
  22091. var $0 = 0, $1 = 0, label = 0, sp = 0;
  22092. sp = STACKTOP;
  22093. $0 = (_pthread_self()|0);
  22094. $1 = ((($0)) + 188|0);
  22095. HEAP32[$1>>2] = (33260);
  22096. return;
  22097. }
  22098. function ___stdio_close($0) {
  22099. $0 = $0|0;
  22100. var $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $vararg_buffer = 0, label = 0, sp = 0;
  22101. sp = STACKTOP;
  22102. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  22103. $vararg_buffer = sp;
  22104. $1 = ((($0)) + 60|0);
  22105. $2 = HEAP32[$1>>2]|0;
  22106. $3 = (_dummy_736($2)|0);
  22107. HEAP32[$vararg_buffer>>2] = $3;
  22108. $4 = (___syscall6(6,($vararg_buffer|0))|0);
  22109. $5 = (___syscall_ret($4)|0);
  22110. STACKTOP = sp;return ($5|0);
  22111. }
  22112. function ___stdio_write($0,$1,$2) {
  22113. $0 = $0|0;
  22114. $1 = $1|0;
  22115. $2 = $2|0;
  22116. 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;
  22117. 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;
  22118. 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;
  22119. var $vararg_ptr7 = 0, label = 0, sp = 0;
  22120. sp = STACKTOP;
  22121. STACKTOP = STACKTOP + 48|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(48|0);
  22122. $vararg_buffer3 = sp + 16|0;
  22123. $vararg_buffer = sp;
  22124. $3 = sp + 32|0;
  22125. $4 = ((($0)) + 28|0);
  22126. $5 = HEAP32[$4>>2]|0;
  22127. HEAP32[$3>>2] = $5;
  22128. $6 = ((($3)) + 4|0);
  22129. $7 = ((($0)) + 20|0);
  22130. $8 = HEAP32[$7>>2]|0;
  22131. $9 = (($8) - ($5))|0;
  22132. HEAP32[$6>>2] = $9;
  22133. $10 = ((($3)) + 8|0);
  22134. HEAP32[$10>>2] = $1;
  22135. $11 = ((($3)) + 12|0);
  22136. HEAP32[$11>>2] = $2;
  22137. $12 = (($9) + ($2))|0;
  22138. $13 = ((($0)) + 60|0);
  22139. $14 = HEAP32[$13>>2]|0;
  22140. $15 = $3;
  22141. HEAP32[$vararg_buffer>>2] = $14;
  22142. $vararg_ptr1 = ((($vararg_buffer)) + 4|0);
  22143. HEAP32[$vararg_ptr1>>2] = $15;
  22144. $vararg_ptr2 = ((($vararg_buffer)) + 8|0);
  22145. HEAP32[$vararg_ptr2>>2] = 2;
  22146. $16 = (___syscall146(146,($vararg_buffer|0))|0);
  22147. $17 = (___syscall_ret($16)|0);
  22148. $18 = ($12|0)==($17|0);
  22149. L1: do {
  22150. if ($18) {
  22151. label = 3;
  22152. } else {
  22153. $$04756 = 2;$$04855 = $12;$$04954 = $3;$26 = $17;
  22154. while(1) {
  22155. $25 = ($26|0)<(0);
  22156. if ($25) {
  22157. break;
  22158. }
  22159. $34 = (($$04855) - ($26))|0;
  22160. $35 = ((($$04954)) + 4|0);
  22161. $36 = HEAP32[$35>>2]|0;
  22162. $37 = ($26>>>0)>($36>>>0);
  22163. $38 = ((($$04954)) + 8|0);
  22164. $$150 = $37 ? $38 : $$04954;
  22165. $39 = $37 << 31 >> 31;
  22166. $$1 = (($39) + ($$04756))|0;
  22167. $40 = $37 ? $36 : 0;
  22168. $$0 = (($26) - ($40))|0;
  22169. $41 = HEAP32[$$150>>2]|0;
  22170. $42 = (($41) + ($$0)|0);
  22171. HEAP32[$$150>>2] = $42;
  22172. $43 = ((($$150)) + 4|0);
  22173. $44 = HEAP32[$43>>2]|0;
  22174. $45 = (($44) - ($$0))|0;
  22175. HEAP32[$43>>2] = $45;
  22176. $46 = HEAP32[$13>>2]|0;
  22177. $47 = $$150;
  22178. HEAP32[$vararg_buffer3>>2] = $46;
  22179. $vararg_ptr6 = ((($vararg_buffer3)) + 4|0);
  22180. HEAP32[$vararg_ptr6>>2] = $47;
  22181. $vararg_ptr7 = ((($vararg_buffer3)) + 8|0);
  22182. HEAP32[$vararg_ptr7>>2] = $$1;
  22183. $48 = (___syscall146(146,($vararg_buffer3|0))|0);
  22184. $49 = (___syscall_ret($48)|0);
  22185. $50 = ($34|0)==($49|0);
  22186. if ($50) {
  22187. label = 3;
  22188. break L1;
  22189. } else {
  22190. $$04756 = $$1;$$04855 = $34;$$04954 = $$150;$26 = $49;
  22191. }
  22192. }
  22193. $27 = ((($0)) + 16|0);
  22194. HEAP32[$27>>2] = 0;
  22195. HEAP32[$4>>2] = 0;
  22196. HEAP32[$7>>2] = 0;
  22197. $28 = HEAP32[$0>>2]|0;
  22198. $29 = $28 | 32;
  22199. HEAP32[$0>>2] = $29;
  22200. $30 = ($$04756|0)==(2);
  22201. if ($30) {
  22202. $$051 = 0;
  22203. } else {
  22204. $31 = ((($$04954)) + 4|0);
  22205. $32 = HEAP32[$31>>2]|0;
  22206. $33 = (($2) - ($32))|0;
  22207. $$051 = $33;
  22208. }
  22209. }
  22210. } while(0);
  22211. if ((label|0) == 3) {
  22212. $19 = ((($0)) + 44|0);
  22213. $20 = HEAP32[$19>>2]|0;
  22214. $21 = ((($0)) + 48|0);
  22215. $22 = HEAP32[$21>>2]|0;
  22216. $23 = (($20) + ($22)|0);
  22217. $24 = ((($0)) + 16|0);
  22218. HEAP32[$24>>2] = $23;
  22219. HEAP32[$4>>2] = $20;
  22220. HEAP32[$7>>2] = $20;
  22221. $$051 = $2;
  22222. }
  22223. STACKTOP = sp;return ($$051|0);
  22224. }
  22225. function ___stdio_seek($0,$1,$2) {
  22226. $0 = $0|0;
  22227. $1 = $1|0;
  22228. $2 = $2|0;
  22229. 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;
  22230. sp = STACKTOP;
  22231. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  22232. $vararg_buffer = sp;
  22233. $3 = sp + 20|0;
  22234. $4 = ((($0)) + 60|0);
  22235. $5 = HEAP32[$4>>2]|0;
  22236. $6 = $3;
  22237. HEAP32[$vararg_buffer>>2] = $5;
  22238. $vararg_ptr1 = ((($vararg_buffer)) + 4|0);
  22239. HEAP32[$vararg_ptr1>>2] = 0;
  22240. $vararg_ptr2 = ((($vararg_buffer)) + 8|0);
  22241. HEAP32[$vararg_ptr2>>2] = $1;
  22242. $vararg_ptr3 = ((($vararg_buffer)) + 12|0);
  22243. HEAP32[$vararg_ptr3>>2] = $6;
  22244. $vararg_ptr4 = ((($vararg_buffer)) + 16|0);
  22245. HEAP32[$vararg_ptr4>>2] = $2;
  22246. $7 = (___syscall140(140,($vararg_buffer|0))|0);
  22247. $8 = (___syscall_ret($7)|0);
  22248. $9 = ($8|0)<(0);
  22249. if ($9) {
  22250. HEAP32[$3>>2] = -1;
  22251. $10 = -1;
  22252. } else {
  22253. $$pre = HEAP32[$3>>2]|0;
  22254. $10 = $$pre;
  22255. }
  22256. STACKTOP = sp;return ($10|0);
  22257. }
  22258. function ___syscall_ret($0) {
  22259. $0 = $0|0;
  22260. var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, label = 0, sp = 0;
  22261. sp = STACKTOP;
  22262. $1 = ($0>>>0)>(4294963200);
  22263. if ($1) {
  22264. $2 = (0 - ($0))|0;
  22265. $3 = (___errno_location()|0);
  22266. HEAP32[$3>>2] = $2;
  22267. $$0 = -1;
  22268. } else {
  22269. $$0 = $0;
  22270. }
  22271. return ($$0|0);
  22272. }
  22273. function ___errno_location() {
  22274. var $0 = 0, $1 = 0, label = 0, sp = 0;
  22275. sp = STACKTOP;
  22276. $0 = (___pthread_self_108()|0);
  22277. $1 = ((($0)) + 64|0);
  22278. return ($1|0);
  22279. }
  22280. function ___pthread_self_108() {
  22281. var $0 = 0, label = 0, sp = 0;
  22282. sp = STACKTOP;
  22283. $0 = (_pthread_self()|0);
  22284. return ($0|0);
  22285. }
  22286. function _dummy_736($0) {
  22287. $0 = $0|0;
  22288. var label = 0, sp = 0;
  22289. sp = STACKTOP;
  22290. return ($0|0);
  22291. }
  22292. function ___stdout_write($0,$1,$2) {
  22293. $0 = $0|0;
  22294. $1 = $1|0;
  22295. $2 = $2|0;
  22296. 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;
  22297. sp = STACKTOP;
  22298. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  22299. $vararg_buffer = sp;
  22300. $3 = sp + 16|0;
  22301. $4 = ((($0)) + 36|0);
  22302. HEAP32[$4>>2] = 9;
  22303. $5 = HEAP32[$0>>2]|0;
  22304. $6 = $5 & 64;
  22305. $7 = ($6|0)==(0);
  22306. if ($7) {
  22307. $8 = ((($0)) + 60|0);
  22308. $9 = HEAP32[$8>>2]|0;
  22309. $10 = $3;
  22310. HEAP32[$vararg_buffer>>2] = $9;
  22311. $vararg_ptr1 = ((($vararg_buffer)) + 4|0);
  22312. HEAP32[$vararg_ptr1>>2] = 21523;
  22313. $vararg_ptr2 = ((($vararg_buffer)) + 8|0);
  22314. HEAP32[$vararg_ptr2>>2] = $10;
  22315. $11 = (___syscall54(54,($vararg_buffer|0))|0);
  22316. $12 = ($11|0)==(0);
  22317. if (!($12)) {
  22318. $13 = ((($0)) + 75|0);
  22319. HEAP8[$13>>0] = -1;
  22320. }
  22321. }
  22322. $14 = (___stdio_write($0,$1,$2)|0);
  22323. STACKTOP = sp;return ($14|0);
  22324. }
  22325. function _strcmp($0,$1) {
  22326. $0 = $0|0;
  22327. $1 = $1|0;
  22328. 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;
  22329. var sp = 0;
  22330. sp = STACKTOP;
  22331. $2 = HEAP8[$0>>0]|0;
  22332. $3 = HEAP8[$1>>0]|0;
  22333. $4 = ($2<<24>>24)!=($3<<24>>24);
  22334. $5 = ($2<<24>>24)==(0);
  22335. $or$cond9 = $5 | $4;
  22336. if ($or$cond9) {
  22337. $$lcssa = $3;$$lcssa8 = $2;
  22338. } else {
  22339. $$011 = $1;$$0710 = $0;
  22340. while(1) {
  22341. $6 = ((($$0710)) + 1|0);
  22342. $7 = ((($$011)) + 1|0);
  22343. $8 = HEAP8[$6>>0]|0;
  22344. $9 = HEAP8[$7>>0]|0;
  22345. $10 = ($8<<24>>24)!=($9<<24>>24);
  22346. $11 = ($8<<24>>24)==(0);
  22347. $or$cond = $11 | $10;
  22348. if ($or$cond) {
  22349. $$lcssa = $9;$$lcssa8 = $8;
  22350. break;
  22351. } else {
  22352. $$011 = $7;$$0710 = $6;
  22353. }
  22354. }
  22355. }
  22356. $12 = $$lcssa8&255;
  22357. $13 = $$lcssa&255;
  22358. $14 = (($12) - ($13))|0;
  22359. return ($14|0);
  22360. }
  22361. function _memcmp($0,$1,$2) {
  22362. $0 = $0|0;
  22363. $1 = $1|0;
  22364. $2 = $2|0;
  22365. 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;
  22366. sp = STACKTOP;
  22367. $3 = ($2|0)==(0);
  22368. L1: do {
  22369. if ($3) {
  22370. $14 = 0;
  22371. } else {
  22372. $$01318 = $0;$$01417 = $2;$$019 = $1;
  22373. while(1) {
  22374. $4 = HEAP8[$$01318>>0]|0;
  22375. $5 = HEAP8[$$019>>0]|0;
  22376. $6 = ($4<<24>>24)==($5<<24>>24);
  22377. if (!($6)) {
  22378. break;
  22379. }
  22380. $7 = (($$01417) + -1)|0;
  22381. $8 = ((($$01318)) + 1|0);
  22382. $9 = ((($$019)) + 1|0);
  22383. $10 = ($7|0)==(0);
  22384. if ($10) {
  22385. $14 = 0;
  22386. break L1;
  22387. } else {
  22388. $$01318 = $8;$$01417 = $7;$$019 = $9;
  22389. }
  22390. }
  22391. $11 = $4&255;
  22392. $12 = $5&255;
  22393. $13 = (($11) - ($12))|0;
  22394. $14 = $13;
  22395. }
  22396. } while(0);
  22397. return ($14|0);
  22398. }
  22399. function _vsprintf($0,$1,$2) {
  22400. $0 = $0|0;
  22401. $1 = $1|0;
  22402. $2 = $2|0;
  22403. var $3 = 0, label = 0, sp = 0;
  22404. sp = STACKTOP;
  22405. $3 = (_vsnprintf($0,2147483647,$1,$2)|0);
  22406. return ($3|0);
  22407. }
  22408. function _vsnprintf($0,$1,$2,$3) {
  22409. $0 = $0|0;
  22410. $1 = $1|0;
  22411. $2 = $2|0;
  22412. $3 = $3|0;
  22413. 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;
  22414. var $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
  22415. sp = STACKTOP;
  22416. STACKTOP = STACKTOP + 128|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(128|0);
  22417. $4 = sp + 124|0;
  22418. $5 = sp;
  22419. 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));
  22420. $6 = (($1) + -1)|0;
  22421. $7 = ($6>>>0)>(2147483646);
  22422. if ($7) {
  22423. $8 = ($1|0)==(0);
  22424. if ($8) {
  22425. $$014 = $4;$$015 = 1;
  22426. label = 4;
  22427. } else {
  22428. $9 = (___errno_location()|0);
  22429. HEAP32[$9>>2] = 75;
  22430. $$0 = -1;
  22431. }
  22432. } else {
  22433. $$014 = $0;$$015 = $1;
  22434. label = 4;
  22435. }
  22436. if ((label|0) == 4) {
  22437. $10 = $$014;
  22438. $11 = (-2 - ($10))|0;
  22439. $12 = ($$015>>>0)>($11>>>0);
  22440. $$$015 = $12 ? $11 : $$015;
  22441. $13 = ((($5)) + 48|0);
  22442. HEAP32[$13>>2] = $$$015;
  22443. $14 = ((($5)) + 20|0);
  22444. HEAP32[$14>>2] = $$014;
  22445. $15 = ((($5)) + 44|0);
  22446. HEAP32[$15>>2] = $$014;
  22447. $16 = (($$014) + ($$$015)|0);
  22448. $17 = ((($5)) + 16|0);
  22449. HEAP32[$17>>2] = $16;
  22450. $18 = ((($5)) + 28|0);
  22451. HEAP32[$18>>2] = $16;
  22452. $19 = (_vfprintf($5,$2,$3)|0);
  22453. $20 = ($$$015|0)==(0);
  22454. if ($20) {
  22455. $$0 = $19;
  22456. } else {
  22457. $21 = HEAP32[$14>>2]|0;
  22458. $22 = HEAP32[$17>>2]|0;
  22459. $23 = ($21|0)==($22|0);
  22460. $24 = $23 << 31 >> 31;
  22461. $25 = (($21) + ($24)|0);
  22462. HEAP8[$25>>0] = 0;
  22463. $$0 = $19;
  22464. }
  22465. }
  22466. STACKTOP = sp;return ($$0|0);
  22467. }
  22468. function _vfprintf($0,$1,$2) {
  22469. $0 = $0|0;
  22470. $1 = $1|0;
  22471. $2 = $2|0;
  22472. 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;
  22473. 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;
  22474. var $8 = 0, $9 = 0, $vacopy_currentptr = 0, dest = 0, label = 0, sp = 0, stop = 0;
  22475. sp = STACKTOP;
  22476. STACKTOP = STACKTOP + 224|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(224|0);
  22477. $3 = sp + 120|0;
  22478. $4 = sp + 80|0;
  22479. $5 = sp;
  22480. $6 = sp + 136|0;
  22481. dest=$4; stop=dest+40|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  22482. $vacopy_currentptr = HEAP32[$2>>2]|0;
  22483. HEAP32[$3>>2] = $vacopy_currentptr;
  22484. $7 = (_printf_core(0,$1,$3,$5,$4)|0);
  22485. $8 = ($7|0)<(0);
  22486. if ($8) {
  22487. $$0 = -1;
  22488. } else {
  22489. $9 = ((($0)) + 76|0);
  22490. $10 = (Atomics_load(HEAP32,$9>>2)|0);
  22491. $11 = ($10|0)>(-1);
  22492. if ($11) {
  22493. $12 = (___lockfile($0)|0);
  22494. $40 = $12;
  22495. } else {
  22496. $40 = 0;
  22497. }
  22498. $13 = HEAP32[$0>>2]|0;
  22499. $14 = $13 & 32;
  22500. $15 = ((($0)) + 74|0);
  22501. $16 = HEAP8[$15>>0]|0;
  22502. $17 = ($16<<24>>24)<(1);
  22503. if ($17) {
  22504. $18 = $13 & -33;
  22505. HEAP32[$0>>2] = $18;
  22506. }
  22507. $19 = ((($0)) + 48|0);
  22508. $20 = HEAP32[$19>>2]|0;
  22509. $21 = ($20|0)==(0);
  22510. if ($21) {
  22511. $23 = ((($0)) + 44|0);
  22512. $24 = HEAP32[$23>>2]|0;
  22513. HEAP32[$23>>2] = $6;
  22514. $25 = ((($0)) + 28|0);
  22515. HEAP32[$25>>2] = $6;
  22516. $26 = ((($0)) + 20|0);
  22517. HEAP32[$26>>2] = $6;
  22518. HEAP32[$19>>2] = 80;
  22519. $27 = ((($6)) + 80|0);
  22520. $28 = ((($0)) + 16|0);
  22521. HEAP32[$28>>2] = $27;
  22522. $29 = (_printf_core($0,$1,$3,$5,$4)|0);
  22523. $30 = ($24|0)==(0|0);
  22524. if ($30) {
  22525. $$1 = $29;
  22526. } else {
  22527. $31 = ((($0)) + 36|0);
  22528. $32 = HEAP32[$31>>2]|0;
  22529. (FUNCTION_TABLE_iiii[$32 & 15]($0,0,0)|0);
  22530. $33 = HEAP32[$26>>2]|0;
  22531. $34 = ($33|0)==(0|0);
  22532. $$ = $34 ? -1 : $29;
  22533. HEAP32[$23>>2] = $24;
  22534. HEAP32[$19>>2] = 0;
  22535. HEAP32[$28>>2] = 0;
  22536. HEAP32[$25>>2] = 0;
  22537. HEAP32[$26>>2] = 0;
  22538. $$1 = $$;
  22539. }
  22540. } else {
  22541. $22 = (_printf_core($0,$1,$3,$5,$4)|0);
  22542. $$1 = $22;
  22543. }
  22544. $35 = HEAP32[$0>>2]|0;
  22545. $36 = $35 & 32;
  22546. $37 = ($36|0)==(0);
  22547. $$1$ = $37 ? $$1 : -1;
  22548. $38 = $35 | $14;
  22549. HEAP32[$0>>2] = $38;
  22550. $39 = ($40|0)==(0);
  22551. if (!($39)) {
  22552. ___unlockfile($0);
  22553. }
  22554. $$0 = $$1$;
  22555. }
  22556. STACKTOP = sp;return ($$0|0);
  22557. }
  22558. function _printf_core($0,$1,$2,$3,$4) {
  22559. $0 = $0|0;
  22560. $1 = $1|0;
  22561. $2 = $2|0;
  22562. $3 = $3|0;
  22563. $4 = $4|0;
  22564. 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;
  22565. 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;
  22566. 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;
  22567. 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;
  22568. 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;
  22569. 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;
  22570. 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;
  22571. 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;
  22572. 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;
  22573. 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;
  22574. 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;
  22575. 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;
  22576. 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;
  22577. 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;
  22578. 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;
  22579. 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;
  22580. 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;
  22581. 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;
  22582. 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;
  22583. 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;
  22584. 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;
  22585. 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;
  22586. sp = STACKTOP;
  22587. STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
  22588. $5 = sp + 16|0;
  22589. $6 = sp;
  22590. $7 = sp + 24|0;
  22591. $8 = sp + 8|0;
  22592. $9 = sp + 20|0;
  22593. HEAP32[$5>>2] = $1;
  22594. $10 = ($0|0)!=(0|0);
  22595. $11 = ((($7)) + 40|0);
  22596. $12 = $11;
  22597. $13 = ((($7)) + 39|0);
  22598. $14 = ((($8)) + 4|0);
  22599. $$0243 = 0;$$0247 = 0;$$0269 = 0;$21 = $1;
  22600. L1: while(1) {
  22601. $15 = ($$0247|0)>(-1);
  22602. do {
  22603. if ($15) {
  22604. $16 = (2147483647 - ($$0247))|0;
  22605. $17 = ($$0243|0)>($16|0);
  22606. if ($17) {
  22607. $18 = (___errno_location()|0);
  22608. HEAP32[$18>>2] = 75;
  22609. $$1248 = -1;
  22610. break;
  22611. } else {
  22612. $19 = (($$0243) + ($$0247))|0;
  22613. $$1248 = $19;
  22614. break;
  22615. }
  22616. } else {
  22617. $$1248 = $$0247;
  22618. }
  22619. } while(0);
  22620. $20 = HEAP8[$21>>0]|0;
  22621. $22 = ($20<<24>>24)==(0);
  22622. if ($22) {
  22623. label = 87;
  22624. break;
  22625. } else {
  22626. $23 = $20;$25 = $21;
  22627. }
  22628. L9: while(1) {
  22629. switch ($23<<24>>24) {
  22630. case 37: {
  22631. $$0249306 = $25;$27 = $25;
  22632. label = 9;
  22633. break L9;
  22634. break;
  22635. }
  22636. case 0: {
  22637. $$0249$lcssa = $25;$39 = $25;
  22638. break L9;
  22639. break;
  22640. }
  22641. default: {
  22642. }
  22643. }
  22644. $24 = ((($25)) + 1|0);
  22645. HEAP32[$5>>2] = $24;
  22646. $$pre = HEAP8[$24>>0]|0;
  22647. $23 = $$pre;$25 = $24;
  22648. }
  22649. L12: do {
  22650. if ((label|0) == 9) {
  22651. while(1) {
  22652. label = 0;
  22653. $26 = ((($27)) + 1|0);
  22654. $28 = HEAP8[$26>>0]|0;
  22655. $29 = ($28<<24>>24)==(37);
  22656. if (!($29)) {
  22657. $$0249$lcssa = $$0249306;$39 = $27;
  22658. break L12;
  22659. }
  22660. $30 = ((($$0249306)) + 1|0);
  22661. $31 = ((($27)) + 2|0);
  22662. HEAP32[$5>>2] = $31;
  22663. $32 = HEAP8[$31>>0]|0;
  22664. $33 = ($32<<24>>24)==(37);
  22665. if ($33) {
  22666. $$0249306 = $30;$27 = $31;
  22667. label = 9;
  22668. } else {
  22669. $$0249$lcssa = $30;$39 = $31;
  22670. break;
  22671. }
  22672. }
  22673. }
  22674. } while(0);
  22675. $34 = $$0249$lcssa;
  22676. $35 = $21;
  22677. $36 = (($34) - ($35))|0;
  22678. if ($10) {
  22679. _out($0,$21,$36);
  22680. }
  22681. $37 = ($36|0)==(0);
  22682. if (!($37)) {
  22683. $$0269$phi = $$0269;$$0243 = $36;$$0247 = $$1248;$21 = $39;$$0269 = $$0269$phi;
  22684. continue;
  22685. }
  22686. $38 = ((($39)) + 1|0);
  22687. $40 = HEAP8[$38>>0]|0;
  22688. $41 = $40 << 24 >> 24;
  22689. $isdigittmp = (($41) + -48)|0;
  22690. $isdigit = ($isdigittmp>>>0)<(10);
  22691. if ($isdigit) {
  22692. $42 = ((($39)) + 2|0);
  22693. $43 = HEAP8[$42>>0]|0;
  22694. $44 = ($43<<24>>24)==(36);
  22695. $45 = ((($39)) + 3|0);
  22696. $$377 = $44 ? $45 : $38;
  22697. $$$0269 = $44 ? 1 : $$0269;
  22698. $isdigittmp$ = $44 ? $isdigittmp : -1;
  22699. $$0253 = $isdigittmp$;$$1270 = $$$0269;$storemerge = $$377;
  22700. } else {
  22701. $$0253 = -1;$$1270 = $$0269;$storemerge = $38;
  22702. }
  22703. HEAP32[$5>>2] = $storemerge;
  22704. $46 = HEAP8[$storemerge>>0]|0;
  22705. $47 = $46 << 24 >> 24;
  22706. $48 = (($47) + -32)|0;
  22707. $49 = ($48>>>0)<(32);
  22708. L24: do {
  22709. if ($49) {
  22710. $$0262311 = 0;$329 = $46;$51 = $48;$storemerge273310 = $storemerge;
  22711. while(1) {
  22712. $50 = 1 << $51;
  22713. $52 = $50 & 75913;
  22714. $53 = ($52|0)==(0);
  22715. if ($53) {
  22716. $$0262$lcssa = $$0262311;$$lcssa295 = $329;$62 = $storemerge273310;
  22717. break L24;
  22718. }
  22719. $54 = $50 | $$0262311;
  22720. $55 = ((($storemerge273310)) + 1|0);
  22721. HEAP32[$5>>2] = $55;
  22722. $56 = HEAP8[$55>>0]|0;
  22723. $57 = $56 << 24 >> 24;
  22724. $58 = (($57) + -32)|0;
  22725. $59 = ($58>>>0)<(32);
  22726. if ($59) {
  22727. $$0262311 = $54;$329 = $56;$51 = $58;$storemerge273310 = $55;
  22728. } else {
  22729. $$0262$lcssa = $54;$$lcssa295 = $56;$62 = $55;
  22730. break;
  22731. }
  22732. }
  22733. } else {
  22734. $$0262$lcssa = 0;$$lcssa295 = $46;$62 = $storemerge;
  22735. }
  22736. } while(0);
  22737. $60 = ($$lcssa295<<24>>24)==(42);
  22738. if ($60) {
  22739. $61 = ((($62)) + 1|0);
  22740. $63 = HEAP8[$61>>0]|0;
  22741. $64 = $63 << 24 >> 24;
  22742. $isdigittmp276 = (($64) + -48)|0;
  22743. $isdigit277 = ($isdigittmp276>>>0)<(10);
  22744. if ($isdigit277) {
  22745. $65 = ((($62)) + 2|0);
  22746. $66 = HEAP8[$65>>0]|0;
  22747. $67 = ($66<<24>>24)==(36);
  22748. if ($67) {
  22749. $68 = (($4) + ($isdigittmp276<<2)|0);
  22750. HEAP32[$68>>2] = 10;
  22751. $69 = HEAP8[$61>>0]|0;
  22752. $70 = $69 << 24 >> 24;
  22753. $71 = (($70) + -48)|0;
  22754. $72 = (($3) + ($71<<3)|0);
  22755. $73 = $72;
  22756. $74 = $73;
  22757. $75 = HEAP32[$74>>2]|0;
  22758. $76 = (($73) + 4)|0;
  22759. $77 = $76;
  22760. $78 = HEAP32[$77>>2]|0;
  22761. $79 = ((($62)) + 3|0);
  22762. $$0259 = $75;$$2271 = 1;$storemerge278 = $79;
  22763. } else {
  22764. label = 23;
  22765. }
  22766. } else {
  22767. label = 23;
  22768. }
  22769. if ((label|0) == 23) {
  22770. label = 0;
  22771. $80 = ($$1270|0)==(0);
  22772. if (!($80)) {
  22773. $$0 = -1;
  22774. break;
  22775. }
  22776. if ($10) {
  22777. $arglist_current = HEAP32[$2>>2]|0;
  22778. $81 = $arglist_current;
  22779. $82 = ((0) + 4|0);
  22780. $expanded4 = $82;
  22781. $expanded = (($expanded4) - 1)|0;
  22782. $83 = (($81) + ($expanded))|0;
  22783. $84 = ((0) + 4|0);
  22784. $expanded8 = $84;
  22785. $expanded7 = (($expanded8) - 1)|0;
  22786. $expanded6 = $expanded7 ^ -1;
  22787. $85 = $83 & $expanded6;
  22788. $86 = $85;
  22789. $87 = HEAP32[$86>>2]|0;
  22790. $arglist_next = ((($86)) + 4|0);
  22791. HEAP32[$2>>2] = $arglist_next;
  22792. $$0259 = $87;$$2271 = 0;$storemerge278 = $61;
  22793. } else {
  22794. $$0259 = 0;$$2271 = 0;$storemerge278 = $61;
  22795. }
  22796. }
  22797. HEAP32[$5>>2] = $storemerge278;
  22798. $88 = ($$0259|0)<(0);
  22799. $89 = $$0262$lcssa | 8192;
  22800. $90 = (0 - ($$0259))|0;
  22801. $$$0262 = $88 ? $89 : $$0262$lcssa;
  22802. $$$0259 = $88 ? $90 : $$0259;
  22803. $$1260 = $$$0259;$$1263 = $$$0262;$$3272 = $$2271;$94 = $storemerge278;
  22804. } else {
  22805. $91 = (_getint($5)|0);
  22806. $92 = ($91|0)<(0);
  22807. if ($92) {
  22808. $$0 = -1;
  22809. break;
  22810. }
  22811. $$pre346 = HEAP32[$5>>2]|0;
  22812. $$1260 = $91;$$1263 = $$0262$lcssa;$$3272 = $$1270;$94 = $$pre346;
  22813. }
  22814. $93 = HEAP8[$94>>0]|0;
  22815. $95 = ($93<<24>>24)==(46);
  22816. do {
  22817. if ($95) {
  22818. $96 = ((($94)) + 1|0);
  22819. $97 = HEAP8[$96>>0]|0;
  22820. $98 = ($97<<24>>24)==(42);
  22821. if (!($98)) {
  22822. $125 = ((($94)) + 1|0);
  22823. HEAP32[$5>>2] = $125;
  22824. $126 = (_getint($5)|0);
  22825. $$pre347$pre = HEAP32[$5>>2]|0;
  22826. $$0254 = $126;$$pre347 = $$pre347$pre;
  22827. break;
  22828. }
  22829. $99 = ((($94)) + 2|0);
  22830. $100 = HEAP8[$99>>0]|0;
  22831. $101 = $100 << 24 >> 24;
  22832. $isdigittmp274 = (($101) + -48)|0;
  22833. $isdigit275 = ($isdigittmp274>>>0)<(10);
  22834. if ($isdigit275) {
  22835. $102 = ((($94)) + 3|0);
  22836. $103 = HEAP8[$102>>0]|0;
  22837. $104 = ($103<<24>>24)==(36);
  22838. if ($104) {
  22839. $105 = (($4) + ($isdigittmp274<<2)|0);
  22840. HEAP32[$105>>2] = 10;
  22841. $106 = HEAP8[$99>>0]|0;
  22842. $107 = $106 << 24 >> 24;
  22843. $108 = (($107) + -48)|0;
  22844. $109 = (($3) + ($108<<3)|0);
  22845. $110 = $109;
  22846. $111 = $110;
  22847. $112 = HEAP32[$111>>2]|0;
  22848. $113 = (($110) + 4)|0;
  22849. $114 = $113;
  22850. $115 = HEAP32[$114>>2]|0;
  22851. $116 = ((($94)) + 4|0);
  22852. HEAP32[$5>>2] = $116;
  22853. $$0254 = $112;$$pre347 = $116;
  22854. break;
  22855. }
  22856. }
  22857. $117 = ($$3272|0)==(0);
  22858. if (!($117)) {
  22859. $$0 = -1;
  22860. break L1;
  22861. }
  22862. if ($10) {
  22863. $arglist_current2 = HEAP32[$2>>2]|0;
  22864. $118 = $arglist_current2;
  22865. $119 = ((0) + 4|0);
  22866. $expanded11 = $119;
  22867. $expanded10 = (($expanded11) - 1)|0;
  22868. $120 = (($118) + ($expanded10))|0;
  22869. $121 = ((0) + 4|0);
  22870. $expanded15 = $121;
  22871. $expanded14 = (($expanded15) - 1)|0;
  22872. $expanded13 = $expanded14 ^ -1;
  22873. $122 = $120 & $expanded13;
  22874. $123 = $122;
  22875. $124 = HEAP32[$123>>2]|0;
  22876. $arglist_next3 = ((($123)) + 4|0);
  22877. HEAP32[$2>>2] = $arglist_next3;
  22878. $330 = $124;
  22879. } else {
  22880. $330 = 0;
  22881. }
  22882. HEAP32[$5>>2] = $99;
  22883. $$0254 = $330;$$pre347 = $99;
  22884. } else {
  22885. $$0254 = -1;$$pre347 = $94;
  22886. }
  22887. } while(0);
  22888. $$0252 = 0;$128 = $$pre347;
  22889. while(1) {
  22890. $127 = HEAP8[$128>>0]|0;
  22891. $129 = $127 << 24 >> 24;
  22892. $130 = (($129) + -65)|0;
  22893. $131 = ($130>>>0)>(57);
  22894. if ($131) {
  22895. $$0 = -1;
  22896. break L1;
  22897. }
  22898. $132 = ((($128)) + 1|0);
  22899. HEAP32[$5>>2] = $132;
  22900. $133 = HEAP8[$128>>0]|0;
  22901. $134 = $133 << 24 >> 24;
  22902. $135 = (($134) + -65)|0;
  22903. $136 = ((11148 + (($$0252*58)|0)|0) + ($135)|0);
  22904. $137 = HEAP8[$136>>0]|0;
  22905. $138 = $137&255;
  22906. $139 = (($138) + -1)|0;
  22907. $140 = ($139>>>0)<(8);
  22908. if ($140) {
  22909. $$0252 = $138;$128 = $132;
  22910. } else {
  22911. break;
  22912. }
  22913. }
  22914. $141 = ($137<<24>>24)==(0);
  22915. if ($141) {
  22916. $$0 = -1;
  22917. break;
  22918. }
  22919. $142 = ($137<<24>>24)==(19);
  22920. $143 = ($$0253|0)>(-1);
  22921. do {
  22922. if ($142) {
  22923. if ($143) {
  22924. $$0 = -1;
  22925. break L1;
  22926. } else {
  22927. label = 49;
  22928. }
  22929. } else {
  22930. if ($143) {
  22931. $144 = (($4) + ($$0253<<2)|0);
  22932. HEAP32[$144>>2] = $138;
  22933. $145 = (($3) + ($$0253<<3)|0);
  22934. $146 = $145;
  22935. $147 = $146;
  22936. $148 = HEAP32[$147>>2]|0;
  22937. $149 = (($146) + 4)|0;
  22938. $150 = $149;
  22939. $151 = HEAP32[$150>>2]|0;
  22940. $152 = $6;
  22941. $153 = $152;
  22942. HEAP32[$153>>2] = $148;
  22943. $154 = (($152) + 4)|0;
  22944. $155 = $154;
  22945. HEAP32[$155>>2] = $151;
  22946. label = 49;
  22947. break;
  22948. }
  22949. if (!($10)) {
  22950. $$0 = 0;
  22951. break L1;
  22952. }
  22953. _pop_arg($6,$138,$2);
  22954. }
  22955. } while(0);
  22956. if ((label|0) == 49) {
  22957. label = 0;
  22958. if (!($10)) {
  22959. $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  22960. continue;
  22961. }
  22962. }
  22963. $156 = HEAP8[$128>>0]|0;
  22964. $157 = $156 << 24 >> 24;
  22965. $158 = ($$0252|0)!=(0);
  22966. $159 = $157 & 15;
  22967. $160 = ($159|0)==(3);
  22968. $or$cond281 = $158 & $160;
  22969. $161 = $157 & -33;
  22970. $$0235 = $or$cond281 ? $161 : $157;
  22971. $162 = $$1263 & 8192;
  22972. $163 = ($162|0)==(0);
  22973. $164 = $$1263 & -65537;
  22974. $$1263$ = $163 ? $$1263 : $164;
  22975. L71: do {
  22976. switch ($$0235|0) {
  22977. case 110: {
  22978. $trunc = $$0252&255;
  22979. switch ($trunc<<24>>24) {
  22980. case 0: {
  22981. $171 = HEAP32[$6>>2]|0;
  22982. HEAP32[$171>>2] = $$1248;
  22983. $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  22984. continue L1;
  22985. break;
  22986. }
  22987. case 1: {
  22988. $172 = HEAP32[$6>>2]|0;
  22989. HEAP32[$172>>2] = $$1248;
  22990. $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  22991. continue L1;
  22992. break;
  22993. }
  22994. case 2: {
  22995. $173 = ($$1248|0)<(0);
  22996. $174 = $173 << 31 >> 31;
  22997. $175 = HEAP32[$6>>2]|0;
  22998. $176 = $175;
  22999. $177 = $176;
  23000. HEAP32[$177>>2] = $$1248;
  23001. $178 = (($176) + 4)|0;
  23002. $179 = $178;
  23003. HEAP32[$179>>2] = $174;
  23004. $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23005. continue L1;
  23006. break;
  23007. }
  23008. case 3: {
  23009. $180 = $$1248&65535;
  23010. $181 = HEAP32[$6>>2]|0;
  23011. HEAP16[$181>>1] = $180;
  23012. $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23013. continue L1;
  23014. break;
  23015. }
  23016. case 4: {
  23017. $182 = $$1248&255;
  23018. $183 = HEAP32[$6>>2]|0;
  23019. HEAP8[$183>>0] = $182;
  23020. $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23021. continue L1;
  23022. break;
  23023. }
  23024. case 6: {
  23025. $184 = HEAP32[$6>>2]|0;
  23026. HEAP32[$184>>2] = $$1248;
  23027. $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23028. continue L1;
  23029. break;
  23030. }
  23031. case 7: {
  23032. $185 = ($$1248|0)<(0);
  23033. $186 = $185 << 31 >> 31;
  23034. $187 = HEAP32[$6>>2]|0;
  23035. $188 = $187;
  23036. $189 = $188;
  23037. HEAP32[$189>>2] = $$1248;
  23038. $190 = (($188) + 4)|0;
  23039. $191 = $190;
  23040. HEAP32[$191>>2] = $186;
  23041. $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23042. continue L1;
  23043. break;
  23044. }
  23045. default: {
  23046. $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23047. continue L1;
  23048. }
  23049. }
  23050. break;
  23051. }
  23052. case 112: {
  23053. $192 = ($$0254>>>0)>(8);
  23054. $193 = $192 ? $$0254 : 8;
  23055. $194 = $$1263$ | 8;
  23056. $$1236 = 120;$$1255 = $193;$$3265 = $194;
  23057. label = 61;
  23058. break;
  23059. }
  23060. case 88: case 120: {
  23061. $$1236 = $$0235;$$1255 = $$0254;$$3265 = $$1263$;
  23062. label = 61;
  23063. break;
  23064. }
  23065. case 111: {
  23066. $210 = $6;
  23067. $211 = $210;
  23068. $212 = HEAP32[$211>>2]|0;
  23069. $213 = (($210) + 4)|0;
  23070. $214 = $213;
  23071. $215 = HEAP32[$214>>2]|0;
  23072. $216 = (_fmt_o($212,$215,$11)|0);
  23073. $217 = $$1263$ & 8;
  23074. $218 = ($217|0)==(0);
  23075. $219 = $216;
  23076. $220 = (($12) - ($219))|0;
  23077. $221 = ($$0254|0)>($220|0);
  23078. $222 = (($220) + 1)|0;
  23079. $223 = $218 | $221;
  23080. $$0254$$0254$ = $223 ? $$0254 : $222;
  23081. $$0228 = $216;$$1233 = 0;$$1238 = 11612;$$2256 = $$0254$$0254$;$$4266 = $$1263$;$248 = $212;$250 = $215;
  23082. label = 67;
  23083. break;
  23084. }
  23085. case 105: case 100: {
  23086. $224 = $6;
  23087. $225 = $224;
  23088. $226 = HEAP32[$225>>2]|0;
  23089. $227 = (($224) + 4)|0;
  23090. $228 = $227;
  23091. $229 = HEAP32[$228>>2]|0;
  23092. $230 = ($229|0)<(0);
  23093. if ($230) {
  23094. $231 = (_i64Subtract(0,0,($226|0),($229|0))|0);
  23095. $232 = tempRet0;
  23096. $233 = $6;
  23097. $234 = $233;
  23098. HEAP32[$234>>2] = $231;
  23099. $235 = (($233) + 4)|0;
  23100. $236 = $235;
  23101. HEAP32[$236>>2] = $232;
  23102. $$0232 = 1;$$0237 = 11612;$242 = $231;$243 = $232;
  23103. label = 66;
  23104. break L71;
  23105. } else {
  23106. $237 = $$1263$ & 2048;
  23107. $238 = ($237|0)==(0);
  23108. $239 = $$1263$ & 1;
  23109. $240 = ($239|0)==(0);
  23110. $$ = $240 ? 11612 : (11614);
  23111. $$$ = $238 ? $$ : (11613);
  23112. $241 = $$1263$ & 2049;
  23113. $narrow = ($241|0)!=(0);
  23114. $$284$ = $narrow&1;
  23115. $$0232 = $$284$;$$0237 = $$$;$242 = $226;$243 = $229;
  23116. label = 66;
  23117. break L71;
  23118. }
  23119. break;
  23120. }
  23121. case 117: {
  23122. $165 = $6;
  23123. $166 = $165;
  23124. $167 = HEAP32[$166>>2]|0;
  23125. $168 = (($165) + 4)|0;
  23126. $169 = $168;
  23127. $170 = HEAP32[$169>>2]|0;
  23128. $$0232 = 0;$$0237 = 11612;$242 = $167;$243 = $170;
  23129. label = 66;
  23130. break;
  23131. }
  23132. case 99: {
  23133. $259 = $6;
  23134. $260 = $259;
  23135. $261 = HEAP32[$260>>2]|0;
  23136. $262 = (($259) + 4)|0;
  23137. $263 = $262;
  23138. $264 = HEAP32[$263>>2]|0;
  23139. $265 = $261&255;
  23140. HEAP8[$13>>0] = $265;
  23141. $$2 = $13;$$2234 = 0;$$2239 = 11612;$$2251 = $11;$$5 = 1;$$6268 = $164;
  23142. break;
  23143. }
  23144. case 109: {
  23145. $266 = (___errno_location()|0);
  23146. $267 = HEAP32[$266>>2]|0;
  23147. $268 = (_strerror($267)|0);
  23148. $$1 = $268;
  23149. label = 71;
  23150. break;
  23151. }
  23152. case 115: {
  23153. $269 = HEAP32[$6>>2]|0;
  23154. $270 = ($269|0)!=(0|0);
  23155. $271 = $270 ? $269 : 11622;
  23156. $$1 = $271;
  23157. label = 71;
  23158. break;
  23159. }
  23160. case 67: {
  23161. $278 = $6;
  23162. $279 = $278;
  23163. $280 = HEAP32[$279>>2]|0;
  23164. $281 = (($278) + 4)|0;
  23165. $282 = $281;
  23166. $283 = HEAP32[$282>>2]|0;
  23167. HEAP32[$8>>2] = $280;
  23168. HEAP32[$14>>2] = 0;
  23169. HEAP32[$6>>2] = $8;
  23170. $$4258355 = -1;$331 = $8;
  23171. label = 75;
  23172. break;
  23173. }
  23174. case 83: {
  23175. $$pre349 = HEAP32[$6>>2]|0;
  23176. $284 = ($$0254|0)==(0);
  23177. if ($284) {
  23178. _pad_672($0,32,$$1260,0,$$1263$);
  23179. $$0240$lcssa357 = 0;
  23180. label = 84;
  23181. } else {
  23182. $$4258355 = $$0254;$331 = $$pre349;
  23183. label = 75;
  23184. }
  23185. break;
  23186. }
  23187. case 65: case 71: case 70: case 69: case 97: case 103: case 102: case 101: {
  23188. $306 = +HEAPF64[$6>>3];
  23189. $307 = (_fmt_fp($0,$306,$$1260,$$0254,$$1263$,$$0235)|0);
  23190. $$0243 = $307;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23191. continue L1;
  23192. break;
  23193. }
  23194. default: {
  23195. $$2 = $21;$$2234 = 0;$$2239 = 11612;$$2251 = $11;$$5 = $$0254;$$6268 = $$1263$;
  23196. }
  23197. }
  23198. } while(0);
  23199. L95: do {
  23200. if ((label|0) == 61) {
  23201. label = 0;
  23202. $195 = $6;
  23203. $196 = $195;
  23204. $197 = HEAP32[$196>>2]|0;
  23205. $198 = (($195) + 4)|0;
  23206. $199 = $198;
  23207. $200 = HEAP32[$199>>2]|0;
  23208. $201 = $$1236 & 32;
  23209. $202 = (_fmt_x($197,$200,$11,$201)|0);
  23210. $203 = ($197|0)==(0);
  23211. $204 = ($200|0)==(0);
  23212. $205 = $203 & $204;
  23213. $206 = $$3265 & 8;
  23214. $207 = ($206|0)==(0);
  23215. $or$cond283 = $207 | $205;
  23216. $208 = $$1236 >> 4;
  23217. $209 = (11612 + ($208)|0);
  23218. $$289 = $or$cond283 ? 11612 : $209;
  23219. $$290 = $or$cond283 ? 0 : 2;
  23220. $$0228 = $202;$$1233 = $$290;$$1238 = $$289;$$2256 = $$1255;$$4266 = $$3265;$248 = $197;$250 = $200;
  23221. label = 67;
  23222. }
  23223. else if ((label|0) == 66) {
  23224. label = 0;
  23225. $244 = (_fmt_u($242,$243,$11)|0);
  23226. $$0228 = $244;$$1233 = $$0232;$$1238 = $$0237;$$2256 = $$0254;$$4266 = $$1263$;$248 = $242;$250 = $243;
  23227. label = 67;
  23228. }
  23229. else if ((label|0) == 71) {
  23230. label = 0;
  23231. $272 = (_memchr($$1,0,$$0254)|0);
  23232. $273 = ($272|0)==(0|0);
  23233. $274 = $272;
  23234. $275 = $$1;
  23235. $276 = (($274) - ($275))|0;
  23236. $277 = (($$1) + ($$0254)|0);
  23237. $$3257 = $273 ? $$0254 : $276;
  23238. $$1250 = $273 ? $277 : $272;
  23239. $$2 = $$1;$$2234 = 0;$$2239 = 11612;$$2251 = $$1250;$$5 = $$3257;$$6268 = $164;
  23240. }
  23241. else if ((label|0) == 75) {
  23242. label = 0;
  23243. $$0229322 = $331;$$0240321 = 0;$$1244320 = 0;
  23244. while(1) {
  23245. $285 = HEAP32[$$0229322>>2]|0;
  23246. $286 = ($285|0)==(0);
  23247. if ($286) {
  23248. $$0240$lcssa = $$0240321;$$2245 = $$1244320;
  23249. break;
  23250. }
  23251. $287 = (_wctomb($9,$285)|0);
  23252. $288 = ($287|0)<(0);
  23253. $289 = (($$4258355) - ($$0240321))|0;
  23254. $290 = ($287>>>0)>($289>>>0);
  23255. $or$cond286 = $288 | $290;
  23256. if ($or$cond286) {
  23257. $$0240$lcssa = $$0240321;$$2245 = $287;
  23258. break;
  23259. }
  23260. $291 = ((($$0229322)) + 4|0);
  23261. $292 = (($287) + ($$0240321))|0;
  23262. $293 = ($$4258355>>>0)>($292>>>0);
  23263. if ($293) {
  23264. $$0229322 = $291;$$0240321 = $292;$$1244320 = $287;
  23265. } else {
  23266. $$0240$lcssa = $292;$$2245 = $287;
  23267. break;
  23268. }
  23269. }
  23270. $294 = ($$2245|0)<(0);
  23271. if ($294) {
  23272. $$0 = -1;
  23273. break L1;
  23274. }
  23275. _pad_672($0,32,$$1260,$$0240$lcssa,$$1263$);
  23276. $295 = ($$0240$lcssa|0)==(0);
  23277. if ($295) {
  23278. $$0240$lcssa357 = 0;
  23279. label = 84;
  23280. } else {
  23281. $$1230333 = $331;$$1241332 = 0;
  23282. while(1) {
  23283. $296 = HEAP32[$$1230333>>2]|0;
  23284. $297 = ($296|0)==(0);
  23285. if ($297) {
  23286. $$0240$lcssa357 = $$0240$lcssa;
  23287. label = 84;
  23288. break L95;
  23289. }
  23290. $298 = (_wctomb($9,$296)|0);
  23291. $299 = (($298) + ($$1241332))|0;
  23292. $300 = ($299|0)>($$0240$lcssa|0);
  23293. if ($300) {
  23294. $$0240$lcssa357 = $$0240$lcssa;
  23295. label = 84;
  23296. break L95;
  23297. }
  23298. $301 = ((($$1230333)) + 4|0);
  23299. _out($0,$9,$298);
  23300. $302 = ($299>>>0)<($$0240$lcssa>>>0);
  23301. if ($302) {
  23302. $$1230333 = $301;$$1241332 = $299;
  23303. } else {
  23304. $$0240$lcssa357 = $$0240$lcssa;
  23305. label = 84;
  23306. break;
  23307. }
  23308. }
  23309. }
  23310. }
  23311. } while(0);
  23312. if ((label|0) == 67) {
  23313. label = 0;
  23314. $245 = ($$2256|0)>(-1);
  23315. $246 = $$4266 & -65537;
  23316. $$$4266 = $245 ? $246 : $$4266;
  23317. $247 = ($248|0)!=(0);
  23318. $249 = ($250|0)!=(0);
  23319. $251 = $247 | $249;
  23320. $252 = ($$2256|0)!=(0);
  23321. $or$cond = $252 | $251;
  23322. $253 = $$0228;
  23323. $254 = (($12) - ($253))|0;
  23324. $255 = $251 ^ 1;
  23325. $256 = $255&1;
  23326. $257 = (($256) + ($254))|0;
  23327. $258 = ($$2256|0)>($257|0);
  23328. $$2256$ = $258 ? $$2256 : $257;
  23329. $$2256$$$2256 = $or$cond ? $$2256$ : $$2256;
  23330. $$0228$ = $or$cond ? $$0228 : $11;
  23331. $$2 = $$0228$;$$2234 = $$1233;$$2239 = $$1238;$$2251 = $11;$$5 = $$2256$$$2256;$$6268 = $$$4266;
  23332. }
  23333. else if ((label|0) == 84) {
  23334. label = 0;
  23335. $303 = $$1263$ ^ 8192;
  23336. _pad_672($0,32,$$1260,$$0240$lcssa357,$303);
  23337. $304 = ($$1260|0)>($$0240$lcssa357|0);
  23338. $305 = $304 ? $$1260 : $$0240$lcssa357;
  23339. $$0243 = $305;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23340. continue;
  23341. }
  23342. $308 = $$2251;
  23343. $309 = $$2;
  23344. $310 = (($308) - ($309))|0;
  23345. $311 = ($$5|0)<($310|0);
  23346. $$$5 = $311 ? $310 : $$5;
  23347. $312 = (($$$5) + ($$2234))|0;
  23348. $313 = ($$1260|0)<($312|0);
  23349. $$2261 = $313 ? $312 : $$1260;
  23350. _pad_672($0,32,$$2261,$312,$$6268);
  23351. _out($0,$$2239,$$2234);
  23352. $314 = $$6268 ^ 65536;
  23353. _pad_672($0,48,$$2261,$312,$314);
  23354. _pad_672($0,48,$$$5,$310,0);
  23355. _out($0,$$2,$310);
  23356. $315 = $$6268 ^ 8192;
  23357. _pad_672($0,32,$$2261,$312,$315);
  23358. $$0243 = $$2261;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
  23359. }
  23360. L114: do {
  23361. if ((label|0) == 87) {
  23362. $316 = ($0|0)==(0|0);
  23363. if ($316) {
  23364. $317 = ($$0269|0)==(0);
  23365. if ($317) {
  23366. $$0 = 0;
  23367. } else {
  23368. $$2242305 = 1;
  23369. while(1) {
  23370. $318 = (($4) + ($$2242305<<2)|0);
  23371. $319 = HEAP32[$318>>2]|0;
  23372. $320 = ($319|0)==(0);
  23373. if ($320) {
  23374. $$3303 = $$2242305;
  23375. break;
  23376. }
  23377. $321 = (($3) + ($$2242305<<3)|0);
  23378. _pop_arg($321,$319,$2);
  23379. $322 = (($$2242305) + 1)|0;
  23380. $323 = ($322|0)<(10);
  23381. if ($323) {
  23382. $$2242305 = $322;
  23383. } else {
  23384. $$0 = 1;
  23385. break L114;
  23386. }
  23387. }
  23388. while(1) {
  23389. $326 = (($4) + ($$3303<<2)|0);
  23390. $327 = HEAP32[$326>>2]|0;
  23391. $328 = ($327|0)==(0);
  23392. $325 = (($$3303) + 1)|0;
  23393. if (!($328)) {
  23394. $$0 = -1;
  23395. break L114;
  23396. }
  23397. $324 = ($325|0)<(10);
  23398. if ($324) {
  23399. $$3303 = $325;
  23400. } else {
  23401. $$0 = 1;
  23402. break;
  23403. }
  23404. }
  23405. }
  23406. } else {
  23407. $$0 = $$1248;
  23408. }
  23409. }
  23410. } while(0);
  23411. STACKTOP = sp;return ($$0|0);
  23412. }
  23413. function ___lockfile($0) {
  23414. $0 = $0|0;
  23415. var label = 0, sp = 0;
  23416. sp = STACKTOP;
  23417. return 0;
  23418. }
  23419. function ___unlockfile($0) {
  23420. $0 = $0|0;
  23421. var label = 0, sp = 0;
  23422. sp = STACKTOP;
  23423. return;
  23424. }
  23425. function _out($0,$1,$2) {
  23426. $0 = $0|0;
  23427. $1 = $1|0;
  23428. $2 = $2|0;
  23429. var $3 = 0, $4 = 0, $5 = 0, label = 0, sp = 0;
  23430. sp = STACKTOP;
  23431. $3 = HEAP32[$0>>2]|0;
  23432. $4 = $3 & 32;
  23433. $5 = ($4|0)==(0);
  23434. if ($5) {
  23435. (___fwritex($1,$2,$0)|0);
  23436. }
  23437. return;
  23438. }
  23439. function _getint($0) {
  23440. $0 = $0|0;
  23441. 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;
  23442. sp = STACKTOP;
  23443. $1 = HEAP32[$0>>2]|0;
  23444. $2 = HEAP8[$1>>0]|0;
  23445. $3 = $2 << 24 >> 24;
  23446. $isdigittmp4 = (($3) + -48)|0;
  23447. $isdigit5 = ($isdigittmp4>>>0)<(10);
  23448. if ($isdigit5) {
  23449. $$06 = 0;$7 = $1;$isdigittmp7 = $isdigittmp4;
  23450. while(1) {
  23451. $4 = ($$06*10)|0;
  23452. $5 = (($isdigittmp7) + ($4))|0;
  23453. $6 = ((($7)) + 1|0);
  23454. HEAP32[$0>>2] = $6;
  23455. $8 = HEAP8[$6>>0]|0;
  23456. $9 = $8 << 24 >> 24;
  23457. $isdigittmp = (($9) + -48)|0;
  23458. $isdigit = ($isdigittmp>>>0)<(10);
  23459. if ($isdigit) {
  23460. $$06 = $5;$7 = $6;$isdigittmp7 = $isdigittmp;
  23461. } else {
  23462. $$0$lcssa = $5;
  23463. break;
  23464. }
  23465. }
  23466. } else {
  23467. $$0$lcssa = 0;
  23468. }
  23469. return ($$0$lcssa|0);
  23470. }
  23471. function _pop_arg($0,$1,$2) {
  23472. $0 = $0|0;
  23473. $1 = $1|0;
  23474. $2 = $2|0;
  23475. 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;
  23476. 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;
  23477. 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;
  23478. 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;
  23479. 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;
  23480. 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;
  23481. 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;
  23482. 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;
  23483. 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;
  23484. var $expanded88 = 0, $expanded90 = 0, $expanded91 = 0, $expanded93 = 0, $expanded94 = 0, $expanded95 = 0, label = 0, sp = 0;
  23485. sp = STACKTOP;
  23486. $3 = ($1>>>0)>(20);
  23487. L1: do {
  23488. if (!($3)) {
  23489. do {
  23490. switch ($1|0) {
  23491. case 9: {
  23492. $arglist_current = HEAP32[$2>>2]|0;
  23493. $4 = $arglist_current;
  23494. $5 = ((0) + 4|0);
  23495. $expanded28 = $5;
  23496. $expanded = (($expanded28) - 1)|0;
  23497. $6 = (($4) + ($expanded))|0;
  23498. $7 = ((0) + 4|0);
  23499. $expanded32 = $7;
  23500. $expanded31 = (($expanded32) - 1)|0;
  23501. $expanded30 = $expanded31 ^ -1;
  23502. $8 = $6 & $expanded30;
  23503. $9 = $8;
  23504. $10 = HEAP32[$9>>2]|0;
  23505. $arglist_next = ((($9)) + 4|0);
  23506. HEAP32[$2>>2] = $arglist_next;
  23507. HEAP32[$0>>2] = $10;
  23508. break L1;
  23509. break;
  23510. }
  23511. case 10: {
  23512. $arglist_current2 = HEAP32[$2>>2]|0;
  23513. $11 = $arglist_current2;
  23514. $12 = ((0) + 4|0);
  23515. $expanded35 = $12;
  23516. $expanded34 = (($expanded35) - 1)|0;
  23517. $13 = (($11) + ($expanded34))|0;
  23518. $14 = ((0) + 4|0);
  23519. $expanded39 = $14;
  23520. $expanded38 = (($expanded39) - 1)|0;
  23521. $expanded37 = $expanded38 ^ -1;
  23522. $15 = $13 & $expanded37;
  23523. $16 = $15;
  23524. $17 = HEAP32[$16>>2]|0;
  23525. $arglist_next3 = ((($16)) + 4|0);
  23526. HEAP32[$2>>2] = $arglist_next3;
  23527. $18 = ($17|0)<(0);
  23528. $19 = $18 << 31 >> 31;
  23529. $20 = $0;
  23530. $21 = $20;
  23531. HEAP32[$21>>2] = $17;
  23532. $22 = (($20) + 4)|0;
  23533. $23 = $22;
  23534. HEAP32[$23>>2] = $19;
  23535. break L1;
  23536. break;
  23537. }
  23538. case 11: {
  23539. $arglist_current5 = HEAP32[$2>>2]|0;
  23540. $24 = $arglist_current5;
  23541. $25 = ((0) + 4|0);
  23542. $expanded42 = $25;
  23543. $expanded41 = (($expanded42) - 1)|0;
  23544. $26 = (($24) + ($expanded41))|0;
  23545. $27 = ((0) + 4|0);
  23546. $expanded46 = $27;
  23547. $expanded45 = (($expanded46) - 1)|0;
  23548. $expanded44 = $expanded45 ^ -1;
  23549. $28 = $26 & $expanded44;
  23550. $29 = $28;
  23551. $30 = HEAP32[$29>>2]|0;
  23552. $arglist_next6 = ((($29)) + 4|0);
  23553. HEAP32[$2>>2] = $arglist_next6;
  23554. $31 = $0;
  23555. $32 = $31;
  23556. HEAP32[$32>>2] = $30;
  23557. $33 = (($31) + 4)|0;
  23558. $34 = $33;
  23559. HEAP32[$34>>2] = 0;
  23560. break L1;
  23561. break;
  23562. }
  23563. case 12: {
  23564. $arglist_current8 = HEAP32[$2>>2]|0;
  23565. $35 = $arglist_current8;
  23566. $36 = ((0) + 8|0);
  23567. $expanded49 = $36;
  23568. $expanded48 = (($expanded49) - 1)|0;
  23569. $37 = (($35) + ($expanded48))|0;
  23570. $38 = ((0) + 8|0);
  23571. $expanded53 = $38;
  23572. $expanded52 = (($expanded53) - 1)|0;
  23573. $expanded51 = $expanded52 ^ -1;
  23574. $39 = $37 & $expanded51;
  23575. $40 = $39;
  23576. $41 = $40;
  23577. $42 = $41;
  23578. $43 = HEAP32[$42>>2]|0;
  23579. $44 = (($41) + 4)|0;
  23580. $45 = $44;
  23581. $46 = HEAP32[$45>>2]|0;
  23582. $arglist_next9 = ((($40)) + 8|0);
  23583. HEAP32[$2>>2] = $arglist_next9;
  23584. $47 = $0;
  23585. $48 = $47;
  23586. HEAP32[$48>>2] = $43;
  23587. $49 = (($47) + 4)|0;
  23588. $50 = $49;
  23589. HEAP32[$50>>2] = $46;
  23590. break L1;
  23591. break;
  23592. }
  23593. case 13: {
  23594. $arglist_current11 = HEAP32[$2>>2]|0;
  23595. $51 = $arglist_current11;
  23596. $52 = ((0) + 4|0);
  23597. $expanded56 = $52;
  23598. $expanded55 = (($expanded56) - 1)|0;
  23599. $53 = (($51) + ($expanded55))|0;
  23600. $54 = ((0) + 4|0);
  23601. $expanded60 = $54;
  23602. $expanded59 = (($expanded60) - 1)|0;
  23603. $expanded58 = $expanded59 ^ -1;
  23604. $55 = $53 & $expanded58;
  23605. $56 = $55;
  23606. $57 = HEAP32[$56>>2]|0;
  23607. $arglist_next12 = ((($56)) + 4|0);
  23608. HEAP32[$2>>2] = $arglist_next12;
  23609. $58 = $57&65535;
  23610. $59 = $58 << 16 >> 16;
  23611. $60 = ($59|0)<(0);
  23612. $61 = $60 << 31 >> 31;
  23613. $62 = $0;
  23614. $63 = $62;
  23615. HEAP32[$63>>2] = $59;
  23616. $64 = (($62) + 4)|0;
  23617. $65 = $64;
  23618. HEAP32[$65>>2] = $61;
  23619. break L1;
  23620. break;
  23621. }
  23622. case 14: {
  23623. $arglist_current14 = HEAP32[$2>>2]|0;
  23624. $66 = $arglist_current14;
  23625. $67 = ((0) + 4|0);
  23626. $expanded63 = $67;
  23627. $expanded62 = (($expanded63) - 1)|0;
  23628. $68 = (($66) + ($expanded62))|0;
  23629. $69 = ((0) + 4|0);
  23630. $expanded67 = $69;
  23631. $expanded66 = (($expanded67) - 1)|0;
  23632. $expanded65 = $expanded66 ^ -1;
  23633. $70 = $68 & $expanded65;
  23634. $71 = $70;
  23635. $72 = HEAP32[$71>>2]|0;
  23636. $arglist_next15 = ((($71)) + 4|0);
  23637. HEAP32[$2>>2] = $arglist_next15;
  23638. $$mask31 = $72 & 65535;
  23639. $73 = $0;
  23640. $74 = $73;
  23641. HEAP32[$74>>2] = $$mask31;
  23642. $75 = (($73) + 4)|0;
  23643. $76 = $75;
  23644. HEAP32[$76>>2] = 0;
  23645. break L1;
  23646. break;
  23647. }
  23648. case 15: {
  23649. $arglist_current17 = HEAP32[$2>>2]|0;
  23650. $77 = $arglist_current17;
  23651. $78 = ((0) + 4|0);
  23652. $expanded70 = $78;
  23653. $expanded69 = (($expanded70) - 1)|0;
  23654. $79 = (($77) + ($expanded69))|0;
  23655. $80 = ((0) + 4|0);
  23656. $expanded74 = $80;
  23657. $expanded73 = (($expanded74) - 1)|0;
  23658. $expanded72 = $expanded73 ^ -1;
  23659. $81 = $79 & $expanded72;
  23660. $82 = $81;
  23661. $83 = HEAP32[$82>>2]|0;
  23662. $arglist_next18 = ((($82)) + 4|0);
  23663. HEAP32[$2>>2] = $arglist_next18;
  23664. $84 = $83&255;
  23665. $85 = $84 << 24 >> 24;
  23666. $86 = ($85|0)<(0);
  23667. $87 = $86 << 31 >> 31;
  23668. $88 = $0;
  23669. $89 = $88;
  23670. HEAP32[$89>>2] = $85;
  23671. $90 = (($88) + 4)|0;
  23672. $91 = $90;
  23673. HEAP32[$91>>2] = $87;
  23674. break L1;
  23675. break;
  23676. }
  23677. case 16: {
  23678. $arglist_current20 = HEAP32[$2>>2]|0;
  23679. $92 = $arglist_current20;
  23680. $93 = ((0) + 4|0);
  23681. $expanded77 = $93;
  23682. $expanded76 = (($expanded77) - 1)|0;
  23683. $94 = (($92) + ($expanded76))|0;
  23684. $95 = ((0) + 4|0);
  23685. $expanded81 = $95;
  23686. $expanded80 = (($expanded81) - 1)|0;
  23687. $expanded79 = $expanded80 ^ -1;
  23688. $96 = $94 & $expanded79;
  23689. $97 = $96;
  23690. $98 = HEAP32[$97>>2]|0;
  23691. $arglist_next21 = ((($97)) + 4|0);
  23692. HEAP32[$2>>2] = $arglist_next21;
  23693. $$mask = $98 & 255;
  23694. $99 = $0;
  23695. $100 = $99;
  23696. HEAP32[$100>>2] = $$mask;
  23697. $101 = (($99) + 4)|0;
  23698. $102 = $101;
  23699. HEAP32[$102>>2] = 0;
  23700. break L1;
  23701. break;
  23702. }
  23703. case 17: {
  23704. $arglist_current23 = HEAP32[$2>>2]|0;
  23705. $103 = $arglist_current23;
  23706. $104 = ((0) + 8|0);
  23707. $expanded84 = $104;
  23708. $expanded83 = (($expanded84) - 1)|0;
  23709. $105 = (($103) + ($expanded83))|0;
  23710. $106 = ((0) + 8|0);
  23711. $expanded88 = $106;
  23712. $expanded87 = (($expanded88) - 1)|0;
  23713. $expanded86 = $expanded87 ^ -1;
  23714. $107 = $105 & $expanded86;
  23715. $108 = $107;
  23716. $109 = +HEAPF64[$108>>3];
  23717. $arglist_next24 = ((($108)) + 8|0);
  23718. HEAP32[$2>>2] = $arglist_next24;
  23719. HEAPF64[$0>>3] = $109;
  23720. break L1;
  23721. break;
  23722. }
  23723. case 18: {
  23724. $arglist_current26 = HEAP32[$2>>2]|0;
  23725. $110 = $arglist_current26;
  23726. $111 = ((0) + 8|0);
  23727. $expanded91 = $111;
  23728. $expanded90 = (($expanded91) - 1)|0;
  23729. $112 = (($110) + ($expanded90))|0;
  23730. $113 = ((0) + 8|0);
  23731. $expanded95 = $113;
  23732. $expanded94 = (($expanded95) - 1)|0;
  23733. $expanded93 = $expanded94 ^ -1;
  23734. $114 = $112 & $expanded93;
  23735. $115 = $114;
  23736. $116 = +HEAPF64[$115>>3];
  23737. $arglist_next27 = ((($115)) + 8|0);
  23738. HEAP32[$2>>2] = $arglist_next27;
  23739. HEAPF64[$0>>3] = $116;
  23740. break L1;
  23741. break;
  23742. }
  23743. default: {
  23744. break L1;
  23745. }
  23746. }
  23747. } while(0);
  23748. }
  23749. } while(0);
  23750. return;
  23751. }
  23752. function _fmt_x($0,$1,$2,$3) {
  23753. $0 = $0|0;
  23754. $1 = $1|0;
  23755. $2 = $2|0;
  23756. $3 = $3|0;
  23757. 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;
  23758. var sp = 0;
  23759. sp = STACKTOP;
  23760. $4 = ($0|0)==(0);
  23761. $5 = ($1|0)==(0);
  23762. $6 = $4 & $5;
  23763. if ($6) {
  23764. $$05$lcssa = $2;
  23765. } else {
  23766. $$056 = $2;$15 = $1;$8 = $0;
  23767. while(1) {
  23768. $7 = $8 & 15;
  23769. $9 = (11664 + ($7)|0);
  23770. $10 = HEAP8[$9>>0]|0;
  23771. $11 = $10&255;
  23772. $12 = $11 | $3;
  23773. $13 = $12&255;
  23774. $14 = ((($$056)) + -1|0);
  23775. HEAP8[$14>>0] = $13;
  23776. $16 = (_bitshift64Lshr(($8|0),($15|0),4)|0);
  23777. $17 = tempRet0;
  23778. $18 = ($16|0)==(0);
  23779. $19 = ($17|0)==(0);
  23780. $20 = $18 & $19;
  23781. if ($20) {
  23782. $$05$lcssa = $14;
  23783. break;
  23784. } else {
  23785. $$056 = $14;$15 = $17;$8 = $16;
  23786. }
  23787. }
  23788. }
  23789. return ($$05$lcssa|0);
  23790. }
  23791. function _fmt_o($0,$1,$2) {
  23792. $0 = $0|0;
  23793. $1 = $1|0;
  23794. $2 = $2|0;
  23795. 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;
  23796. sp = STACKTOP;
  23797. $3 = ($0|0)==(0);
  23798. $4 = ($1|0)==(0);
  23799. $5 = $3 & $4;
  23800. if ($5) {
  23801. $$0$lcssa = $2;
  23802. } else {
  23803. $$06 = $2;$11 = $1;$7 = $0;
  23804. while(1) {
  23805. $6 = $7&255;
  23806. $8 = $6 & 7;
  23807. $9 = $8 | 48;
  23808. $10 = ((($$06)) + -1|0);
  23809. HEAP8[$10>>0] = $9;
  23810. $12 = (_bitshift64Lshr(($7|0),($11|0),3)|0);
  23811. $13 = tempRet0;
  23812. $14 = ($12|0)==(0);
  23813. $15 = ($13|0)==(0);
  23814. $16 = $14 & $15;
  23815. if ($16) {
  23816. $$0$lcssa = $10;
  23817. break;
  23818. } else {
  23819. $$06 = $10;$11 = $13;$7 = $12;
  23820. }
  23821. }
  23822. }
  23823. return ($$0$lcssa|0);
  23824. }
  23825. function _fmt_u($0,$1,$2) {
  23826. $0 = $0|0;
  23827. $1 = $1|0;
  23828. $2 = $2|0;
  23829. 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;
  23830. 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;
  23831. sp = STACKTOP;
  23832. $3 = ($1>>>0)>(0);
  23833. $4 = ($0>>>0)>(4294967295);
  23834. $5 = ($1|0)==(0);
  23835. $6 = $5 & $4;
  23836. $7 = $3 | $6;
  23837. if ($7) {
  23838. $$0914 = $2;$8 = $0;$9 = $1;
  23839. while(1) {
  23840. $10 = (___uremdi3(($8|0),($9|0),10,0)|0);
  23841. $11 = tempRet0;
  23842. $12 = $10&255;
  23843. $13 = $12 | 48;
  23844. $14 = ((($$0914)) + -1|0);
  23845. HEAP8[$14>>0] = $13;
  23846. $15 = (___udivdi3(($8|0),($9|0),10,0)|0);
  23847. $16 = tempRet0;
  23848. $17 = ($9>>>0)>(9);
  23849. $18 = ($8>>>0)>(4294967295);
  23850. $19 = ($9|0)==(9);
  23851. $20 = $19 & $18;
  23852. $21 = $17 | $20;
  23853. if ($21) {
  23854. $$0914 = $14;$8 = $15;$9 = $16;
  23855. } else {
  23856. break;
  23857. }
  23858. }
  23859. $$010$lcssa$off0 = $15;$$09$lcssa = $14;
  23860. } else {
  23861. $$010$lcssa$off0 = $0;$$09$lcssa = $2;
  23862. }
  23863. $22 = ($$010$lcssa$off0|0)==(0);
  23864. if ($22) {
  23865. $$1$lcssa = $$09$lcssa;
  23866. } else {
  23867. $$012 = $$010$lcssa$off0;$$111 = $$09$lcssa;
  23868. while(1) {
  23869. $23 = (($$012>>>0) % 10)&-1;
  23870. $24 = $23 | 48;
  23871. $25 = $24&255;
  23872. $26 = ((($$111)) + -1|0);
  23873. HEAP8[$26>>0] = $25;
  23874. $27 = (($$012>>>0) / 10)&-1;
  23875. $28 = ($$012>>>0)<(10);
  23876. if ($28) {
  23877. $$1$lcssa = $26;
  23878. break;
  23879. } else {
  23880. $$012 = $27;$$111 = $26;
  23881. }
  23882. }
  23883. }
  23884. return ($$1$lcssa|0);
  23885. }
  23886. function _strerror($0) {
  23887. $0 = $0|0;
  23888. var $1 = 0, $2 = 0, $3 = 0, $4 = 0, label = 0, sp = 0;
  23889. sp = STACKTOP;
  23890. $1 = (___pthread_self_105()|0);
  23891. $2 = ((($1)) + 188|0);
  23892. $3 = HEAP32[$2>>2]|0;
  23893. $4 = (___strerror_l($0,$3)|0);
  23894. return ($4|0);
  23895. }
  23896. function _memchr($0,$1,$2) {
  23897. $0 = $0|0;
  23898. $1 = $1|0;
  23899. $2 = $2|0;
  23900. 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;
  23901. 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;
  23902. 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;
  23903. sp = STACKTOP;
  23904. $3 = $1 & 255;
  23905. $4 = $0;
  23906. $5 = $4 & 3;
  23907. $6 = ($5|0)!=(0);
  23908. $7 = ($2|0)!=(0);
  23909. $or$cond53 = $7 & $6;
  23910. L1: do {
  23911. if ($or$cond53) {
  23912. $8 = $1&255;
  23913. $$03555 = $0;$$03654 = $2;
  23914. while(1) {
  23915. $9 = HEAP8[$$03555>>0]|0;
  23916. $10 = ($9<<24>>24)==($8<<24>>24);
  23917. if ($10) {
  23918. $$035$lcssa65 = $$03555;$$036$lcssa64 = $$03654;
  23919. label = 6;
  23920. break L1;
  23921. }
  23922. $11 = ((($$03555)) + 1|0);
  23923. $12 = (($$03654) + -1)|0;
  23924. $13 = $11;
  23925. $14 = $13 & 3;
  23926. $15 = ($14|0)!=(0);
  23927. $16 = ($12|0)!=(0);
  23928. $or$cond = $16 & $15;
  23929. if ($or$cond) {
  23930. $$03555 = $11;$$03654 = $12;
  23931. } else {
  23932. $$035$lcssa = $11;$$036$lcssa = $12;$$lcssa = $16;
  23933. label = 5;
  23934. break;
  23935. }
  23936. }
  23937. } else {
  23938. $$035$lcssa = $0;$$036$lcssa = $2;$$lcssa = $7;
  23939. label = 5;
  23940. }
  23941. } while(0);
  23942. if ((label|0) == 5) {
  23943. if ($$lcssa) {
  23944. $$035$lcssa65 = $$035$lcssa;$$036$lcssa64 = $$036$lcssa;
  23945. label = 6;
  23946. } else {
  23947. $$2 = $$035$lcssa;$$3 = 0;
  23948. }
  23949. }
  23950. L8: do {
  23951. if ((label|0) == 6) {
  23952. $17 = HEAP8[$$035$lcssa65>>0]|0;
  23953. $18 = $1&255;
  23954. $19 = ($17<<24>>24)==($18<<24>>24);
  23955. if ($19) {
  23956. $$2 = $$035$lcssa65;$$3 = $$036$lcssa64;
  23957. } else {
  23958. $20 = Math_imul($3, 16843009)|0;
  23959. $21 = ($$036$lcssa64>>>0)>(3);
  23960. L11: do {
  23961. if ($21) {
  23962. $$046 = $$035$lcssa65;$$13745 = $$036$lcssa64;
  23963. while(1) {
  23964. $22 = HEAP32[$$046>>2]|0;
  23965. $23 = $22 ^ $20;
  23966. $24 = (($23) + -16843009)|0;
  23967. $25 = $23 & -2139062144;
  23968. $26 = $25 ^ -2139062144;
  23969. $27 = $26 & $24;
  23970. $28 = ($27|0)==(0);
  23971. if (!($28)) {
  23972. break;
  23973. }
  23974. $29 = ((($$046)) + 4|0);
  23975. $30 = (($$13745) + -4)|0;
  23976. $31 = ($30>>>0)>(3);
  23977. if ($31) {
  23978. $$046 = $29;$$13745 = $30;
  23979. } else {
  23980. $$0$lcssa = $29;$$137$lcssa = $30;
  23981. label = 11;
  23982. break L11;
  23983. }
  23984. }
  23985. $$140 = $$046;$$23839 = $$13745;
  23986. } else {
  23987. $$0$lcssa = $$035$lcssa65;$$137$lcssa = $$036$lcssa64;
  23988. label = 11;
  23989. }
  23990. } while(0);
  23991. if ((label|0) == 11) {
  23992. $32 = ($$137$lcssa|0)==(0);
  23993. if ($32) {
  23994. $$2 = $$0$lcssa;$$3 = 0;
  23995. break;
  23996. } else {
  23997. $$140 = $$0$lcssa;$$23839 = $$137$lcssa;
  23998. }
  23999. }
  24000. while(1) {
  24001. $33 = HEAP8[$$140>>0]|0;
  24002. $34 = ($33<<24>>24)==($18<<24>>24);
  24003. if ($34) {
  24004. $$2 = $$140;$$3 = $$23839;
  24005. break L8;
  24006. }
  24007. $35 = ((($$140)) + 1|0);
  24008. $36 = (($$23839) + -1)|0;
  24009. $37 = ($36|0)==(0);
  24010. if ($37) {
  24011. $$2 = $35;$$3 = 0;
  24012. break;
  24013. } else {
  24014. $$140 = $35;$$23839 = $36;
  24015. }
  24016. }
  24017. }
  24018. }
  24019. } while(0);
  24020. $38 = ($$3|0)!=(0);
  24021. $39 = $38 ? $$2 : 0;
  24022. return ($39|0);
  24023. }
  24024. function _pad_672($0,$1,$2,$3,$4) {
  24025. $0 = $0|0;
  24026. $1 = $1|0;
  24027. $2 = $2|0;
  24028. $3 = $3|0;
  24029. $4 = $4|0;
  24030. 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;
  24031. sp = STACKTOP;
  24032. STACKTOP = STACKTOP + 256|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(256|0);
  24033. $5 = sp;
  24034. $6 = $4 & 73728;
  24035. $7 = ($6|0)==(0);
  24036. $8 = ($2|0)>($3|0);
  24037. $or$cond = $8 & $7;
  24038. if ($or$cond) {
  24039. $9 = (($2) - ($3))|0;
  24040. $10 = ($9>>>0)<(256);
  24041. $11 = $10 ? $9 : 256;
  24042. _memset(($5|0),($1|0),($11|0))|0;
  24043. $12 = ($9>>>0)>(255);
  24044. if ($12) {
  24045. $13 = (($2) - ($3))|0;
  24046. $$011 = $9;
  24047. while(1) {
  24048. _out($0,$5,256);
  24049. $14 = (($$011) + -256)|0;
  24050. $15 = ($14>>>0)>(255);
  24051. if ($15) {
  24052. $$011 = $14;
  24053. } else {
  24054. break;
  24055. }
  24056. }
  24057. $16 = $13 & 255;
  24058. $$0$lcssa = $16;
  24059. } else {
  24060. $$0$lcssa = $9;
  24061. }
  24062. _out($0,$5,$$0$lcssa);
  24063. }
  24064. STACKTOP = sp;return;
  24065. }
  24066. function _wctomb($0,$1) {
  24067. $0 = $0|0;
  24068. $1 = $1|0;
  24069. var $$0 = 0, $2 = 0, $3 = 0, label = 0, sp = 0;
  24070. sp = STACKTOP;
  24071. $2 = ($0|0)==(0|0);
  24072. if ($2) {
  24073. $$0 = 0;
  24074. } else {
  24075. $3 = (_wcrtomb($0,$1,0)|0);
  24076. $$0 = $3;
  24077. }
  24078. return ($$0|0);
  24079. }
  24080. function _fmt_fp($0,$1,$2,$3,$4,$5) {
  24081. $0 = $0|0;
  24082. $1 = +$1;
  24083. $2 = $2|0;
  24084. $3 = $3|0;
  24085. $4 = $4|0;
  24086. $5 = $5|0;
  24087. 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;
  24088. 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;
  24089. 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;
  24090. 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;
  24091. 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;
  24092. 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;
  24093. 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;
  24094. 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;
  24095. 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;
  24096. 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;
  24097. 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;
  24098. 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;
  24099. 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;
  24100. 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;
  24101. 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;
  24102. 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;
  24103. 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;
  24104. 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;
  24105. 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;
  24106. 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;
  24107. 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;
  24108. 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;
  24109. 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;
  24110. 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;
  24111. 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;
  24112. 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;
  24113. sp = STACKTOP;
  24114. STACKTOP = STACKTOP + 560|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(560|0);
  24115. $6 = sp + 8|0;
  24116. $7 = sp;
  24117. $8 = sp + 524|0;
  24118. $9 = $8;
  24119. $10 = sp + 512|0;
  24120. HEAP32[$7>>2] = 0;
  24121. $11 = ((($10)) + 12|0);
  24122. (___DOUBLE_BITS_673($1)|0);
  24123. $12 = tempRet0;
  24124. $13 = ($12|0)<(0);
  24125. if ($13) {
  24126. $14 = -$1;
  24127. $$0471 = $14;$$0520 = 1;$$0521 = 11629;
  24128. } else {
  24129. $15 = $4 & 2048;
  24130. $16 = ($15|0)==(0);
  24131. $17 = $4 & 1;
  24132. $18 = ($17|0)==(0);
  24133. $$ = $18 ? (11630) : (11635);
  24134. $$$ = $16 ? $$ : (11632);
  24135. $19 = $4 & 2049;
  24136. $narrow = ($19|0)!=(0);
  24137. $$534$ = $narrow&1;
  24138. $$0471 = $1;$$0520 = $$534$;$$0521 = $$$;
  24139. }
  24140. (___DOUBLE_BITS_673($$0471)|0);
  24141. $20 = tempRet0;
  24142. $21 = $20 & 2146435072;
  24143. $22 = ($21>>>0)<(2146435072);
  24144. $23 = (0)<(0);
  24145. $24 = ($21|0)==(2146435072);
  24146. $25 = $24 & $23;
  24147. $26 = $22 | $25;
  24148. do {
  24149. if ($26) {
  24150. $35 = (+_frexpl($$0471,$7));
  24151. $36 = $35 * 2.0;
  24152. $37 = $36 != 0.0;
  24153. if ($37) {
  24154. $38 = HEAP32[$7>>2]|0;
  24155. $39 = (($38) + -1)|0;
  24156. HEAP32[$7>>2] = $39;
  24157. }
  24158. $40 = $5 | 32;
  24159. $41 = ($40|0)==(97);
  24160. if ($41) {
  24161. $42 = $5 & 32;
  24162. $43 = ($42|0)==(0);
  24163. $44 = ((($$0521)) + 9|0);
  24164. $$0521$ = $43 ? $$0521 : $44;
  24165. $45 = $$0520 | 2;
  24166. $46 = ($3>>>0)>(11);
  24167. $47 = (12 - ($3))|0;
  24168. $48 = ($47|0)==(0);
  24169. $49 = $46 | $48;
  24170. do {
  24171. if ($49) {
  24172. $$1472 = $36;
  24173. } else {
  24174. $$0509582 = 8.0;$$1508583 = $47;
  24175. while(1) {
  24176. $50 = (($$1508583) + -1)|0;
  24177. $51 = $$0509582 * 16.0;
  24178. $52 = ($50|0)==(0);
  24179. if ($52) {
  24180. break;
  24181. } else {
  24182. $$0509582 = $51;$$1508583 = $50;
  24183. }
  24184. }
  24185. $53 = HEAP8[$$0521$>>0]|0;
  24186. $54 = ($53<<24>>24)==(45);
  24187. if ($54) {
  24188. $55 = -$36;
  24189. $56 = $55 - $51;
  24190. $57 = $51 + $56;
  24191. $58 = -$57;
  24192. $$1472 = $58;
  24193. break;
  24194. } else {
  24195. $59 = $36 + $51;
  24196. $60 = $59 - $51;
  24197. $$1472 = $60;
  24198. break;
  24199. }
  24200. }
  24201. } while(0);
  24202. $61 = HEAP32[$7>>2]|0;
  24203. $62 = ($61|0)<(0);
  24204. $63 = (0 - ($61))|0;
  24205. $64 = $62 ? $63 : $61;
  24206. $65 = ($64|0)<(0);
  24207. $66 = $65 << 31 >> 31;
  24208. $67 = (_fmt_u($64,$66,$11)|0);
  24209. $68 = ($67|0)==($11|0);
  24210. if ($68) {
  24211. $69 = ((($10)) + 11|0);
  24212. HEAP8[$69>>0] = 48;
  24213. $$0511 = $69;
  24214. } else {
  24215. $$0511 = $67;
  24216. }
  24217. $70 = $61 >> 31;
  24218. $71 = $70 & 2;
  24219. $72 = (($71) + 43)|0;
  24220. $73 = $72&255;
  24221. $74 = ((($$0511)) + -1|0);
  24222. HEAP8[$74>>0] = $73;
  24223. $75 = (($5) + 15)|0;
  24224. $76 = $75&255;
  24225. $77 = ((($$0511)) + -2|0);
  24226. HEAP8[$77>>0] = $76;
  24227. $notrhs = ($3|0)<(1);
  24228. $78 = $4 & 8;
  24229. $79 = ($78|0)==(0);
  24230. $$0523 = $8;$$2473 = $$1472;
  24231. while(1) {
  24232. $80 = (~~(($$2473)));
  24233. $81 = (11664 + ($80)|0);
  24234. $82 = HEAP8[$81>>0]|0;
  24235. $83 = $82&255;
  24236. $84 = $83 | $42;
  24237. $85 = $84&255;
  24238. $86 = ((($$0523)) + 1|0);
  24239. HEAP8[$$0523>>0] = $85;
  24240. $87 = (+($80|0));
  24241. $88 = $$2473 - $87;
  24242. $89 = $88 * 16.0;
  24243. $90 = $86;
  24244. $91 = (($90) - ($9))|0;
  24245. $92 = ($91|0)==(1);
  24246. if ($92) {
  24247. $notlhs = $89 == 0.0;
  24248. $or$cond3$not = $notrhs & $notlhs;
  24249. $or$cond = $79 & $or$cond3$not;
  24250. if ($or$cond) {
  24251. $$1524 = $86;
  24252. } else {
  24253. $93 = ((($$0523)) + 2|0);
  24254. HEAP8[$86>>0] = 46;
  24255. $$1524 = $93;
  24256. }
  24257. } else {
  24258. $$1524 = $86;
  24259. }
  24260. $94 = $89 != 0.0;
  24261. if ($94) {
  24262. $$0523 = $$1524;$$2473 = $89;
  24263. } else {
  24264. break;
  24265. }
  24266. }
  24267. $95 = ($3|0)!=(0);
  24268. $96 = $77;
  24269. $97 = $11;
  24270. $98 = $$1524;
  24271. $99 = (($98) - ($9))|0;
  24272. $100 = (($97) - ($96))|0;
  24273. $101 = (($99) + -2)|0;
  24274. $102 = ($101|0)<($3|0);
  24275. $or$cond537 = $95 & $102;
  24276. $103 = (($3) + 2)|0;
  24277. $$pn = $or$cond537 ? $103 : $99;
  24278. $$0525 = (($100) + ($45))|0;
  24279. $104 = (($$0525) + ($$pn))|0;
  24280. _pad_672($0,32,$2,$104,$4);
  24281. _out($0,$$0521$,$45);
  24282. $105 = $4 ^ 65536;
  24283. _pad_672($0,48,$2,$104,$105);
  24284. _out($0,$8,$99);
  24285. $106 = (($$pn) - ($99))|0;
  24286. _pad_672($0,48,$106,0,0);
  24287. _out($0,$77,$100);
  24288. $107 = $4 ^ 8192;
  24289. _pad_672($0,32,$2,$104,$107);
  24290. $$sink562 = $104;
  24291. break;
  24292. }
  24293. $108 = ($3|0)<(0);
  24294. $$539 = $108 ? 6 : $3;
  24295. if ($37) {
  24296. $109 = $36 * 268435456.0;
  24297. $110 = HEAP32[$7>>2]|0;
  24298. $111 = (($110) + -28)|0;
  24299. HEAP32[$7>>2] = $111;
  24300. $$3 = $109;$$pr = $111;
  24301. } else {
  24302. $$pre = HEAP32[$7>>2]|0;
  24303. $$3 = $36;$$pr = $$pre;
  24304. }
  24305. $112 = ($$pr|0)<(0);
  24306. $113 = ((($6)) + 288|0);
  24307. $$556 = $112 ? $6 : $113;
  24308. $$0498 = $$556;$$4 = $$3;
  24309. while(1) {
  24310. $114 = (~~(($$4))>>>0);
  24311. HEAP32[$$0498>>2] = $114;
  24312. $115 = ((($$0498)) + 4|0);
  24313. $116 = (+($114>>>0));
  24314. $117 = $$4 - $116;
  24315. $118 = $117 * 1.0E+9;
  24316. $119 = $118 != 0.0;
  24317. if ($119) {
  24318. $$0498 = $115;$$4 = $118;
  24319. } else {
  24320. break;
  24321. }
  24322. }
  24323. $120 = ($$pr|0)>(0);
  24324. if ($120) {
  24325. $$1482661 = $$556;$$1499660 = $115;$122 = $$pr;
  24326. while(1) {
  24327. $121 = ($122|0)<(29);
  24328. $123 = $121 ? $122 : 29;
  24329. $$0488653 = ((($$1499660)) + -4|0);
  24330. $124 = ($$0488653>>>0)<($$1482661>>>0);
  24331. if ($124) {
  24332. $$2483$ph = $$1482661;
  24333. } else {
  24334. $$0488655 = $$0488653;$$0497654 = 0;
  24335. while(1) {
  24336. $125 = HEAP32[$$0488655>>2]|0;
  24337. $126 = (_bitshift64Shl(($125|0),0,($123|0))|0);
  24338. $127 = tempRet0;
  24339. $128 = (_i64Add(($126|0),($127|0),($$0497654|0),0)|0);
  24340. $129 = tempRet0;
  24341. $130 = (___uremdi3(($128|0),($129|0),1000000000,0)|0);
  24342. $131 = tempRet0;
  24343. HEAP32[$$0488655>>2] = $130;
  24344. $132 = (___udivdi3(($128|0),($129|0),1000000000,0)|0);
  24345. $133 = tempRet0;
  24346. $$0488 = ((($$0488655)) + -4|0);
  24347. $134 = ($$0488>>>0)<($$1482661>>>0);
  24348. if ($134) {
  24349. break;
  24350. } else {
  24351. $$0488655 = $$0488;$$0497654 = $132;
  24352. }
  24353. }
  24354. $135 = ($132|0)==(0);
  24355. if ($135) {
  24356. $$2483$ph = $$1482661;
  24357. } else {
  24358. $136 = ((($$1482661)) + -4|0);
  24359. HEAP32[$136>>2] = $132;
  24360. $$2483$ph = $136;
  24361. }
  24362. }
  24363. $$2500 = $$1499660;
  24364. while(1) {
  24365. $137 = ($$2500>>>0)>($$2483$ph>>>0);
  24366. if (!($137)) {
  24367. break;
  24368. }
  24369. $138 = ((($$2500)) + -4|0);
  24370. $139 = HEAP32[$138>>2]|0;
  24371. $140 = ($139|0)==(0);
  24372. if ($140) {
  24373. $$2500 = $138;
  24374. } else {
  24375. break;
  24376. }
  24377. }
  24378. $141 = HEAP32[$7>>2]|0;
  24379. $142 = (($141) - ($123))|0;
  24380. HEAP32[$7>>2] = $142;
  24381. $143 = ($142|0)>(0);
  24382. if ($143) {
  24383. $$1482661 = $$2483$ph;$$1499660 = $$2500;$122 = $142;
  24384. } else {
  24385. $$1482$lcssa = $$2483$ph;$$1499$lcssa = $$2500;$$pr564 = $142;
  24386. break;
  24387. }
  24388. }
  24389. } else {
  24390. $$1482$lcssa = $$556;$$1499$lcssa = $115;$$pr564 = $$pr;
  24391. }
  24392. $144 = ($$pr564|0)<(0);
  24393. if ($144) {
  24394. $145 = (($$539) + 25)|0;
  24395. $146 = (($145|0) / 9)&-1;
  24396. $147 = (($146) + 1)|0;
  24397. $148 = ($40|0)==(102);
  24398. $$3484648 = $$1482$lcssa;$$3501647 = $$1499$lcssa;$150 = $$pr564;
  24399. while(1) {
  24400. $149 = (0 - ($150))|0;
  24401. $151 = ($149|0)<(9);
  24402. $152 = $151 ? $149 : 9;
  24403. $153 = ($$3484648>>>0)<($$3501647>>>0);
  24404. if ($153) {
  24405. $157 = 1 << $152;
  24406. $158 = (($157) + -1)|0;
  24407. $159 = 1000000000 >>> $152;
  24408. $$0487642 = 0;$$1489641 = $$3484648;
  24409. while(1) {
  24410. $160 = HEAP32[$$1489641>>2]|0;
  24411. $161 = $160 & $158;
  24412. $162 = $160 >>> $152;
  24413. $163 = (($162) + ($$0487642))|0;
  24414. HEAP32[$$1489641>>2] = $163;
  24415. $164 = Math_imul($161, $159)|0;
  24416. $165 = ((($$1489641)) + 4|0);
  24417. $166 = ($165>>>0)<($$3501647>>>0);
  24418. if ($166) {
  24419. $$0487642 = $164;$$1489641 = $165;
  24420. } else {
  24421. break;
  24422. }
  24423. }
  24424. $167 = HEAP32[$$3484648>>2]|0;
  24425. $168 = ($167|0)==(0);
  24426. $169 = ((($$3484648)) + 4|0);
  24427. $$$3484 = $168 ? $169 : $$3484648;
  24428. $170 = ($164|0)==(0);
  24429. if ($170) {
  24430. $$$3484692 = $$$3484;$$4502 = $$3501647;
  24431. } else {
  24432. $171 = ((($$3501647)) + 4|0);
  24433. HEAP32[$$3501647>>2] = $164;
  24434. $$$3484692 = $$$3484;$$4502 = $171;
  24435. }
  24436. } else {
  24437. $154 = HEAP32[$$3484648>>2]|0;
  24438. $155 = ($154|0)==(0);
  24439. $156 = ((($$3484648)) + 4|0);
  24440. $$$3484691 = $155 ? $156 : $$3484648;
  24441. $$$3484692 = $$$3484691;$$4502 = $$3501647;
  24442. }
  24443. $172 = $148 ? $$556 : $$$3484692;
  24444. $173 = $$4502;
  24445. $174 = $172;
  24446. $175 = (($173) - ($174))|0;
  24447. $176 = $175 >> 2;
  24448. $177 = ($176|0)>($147|0);
  24449. $178 = (($172) + ($147<<2)|0);
  24450. $$$4502 = $177 ? $178 : $$4502;
  24451. $179 = HEAP32[$7>>2]|0;
  24452. $180 = (($179) + ($152))|0;
  24453. HEAP32[$7>>2] = $180;
  24454. $181 = ($180|0)<(0);
  24455. if ($181) {
  24456. $$3484648 = $$$3484692;$$3501647 = $$$4502;$150 = $180;
  24457. } else {
  24458. $$3484$lcssa = $$$3484692;$$3501$lcssa = $$$4502;
  24459. break;
  24460. }
  24461. }
  24462. } else {
  24463. $$3484$lcssa = $$1482$lcssa;$$3501$lcssa = $$1499$lcssa;
  24464. }
  24465. $182 = ($$3484$lcssa>>>0)<($$3501$lcssa>>>0);
  24466. $183 = $$556;
  24467. if ($182) {
  24468. $184 = $$3484$lcssa;
  24469. $185 = (($183) - ($184))|0;
  24470. $186 = $185 >> 2;
  24471. $187 = ($186*9)|0;
  24472. $188 = HEAP32[$$3484$lcssa>>2]|0;
  24473. $189 = ($188>>>0)<(10);
  24474. if ($189) {
  24475. $$1515 = $187;
  24476. } else {
  24477. $$0514637 = $187;$$0530636 = 10;
  24478. while(1) {
  24479. $190 = ($$0530636*10)|0;
  24480. $191 = (($$0514637) + 1)|0;
  24481. $192 = ($188>>>0)<($190>>>0);
  24482. if ($192) {
  24483. $$1515 = $191;
  24484. break;
  24485. } else {
  24486. $$0514637 = $191;$$0530636 = $190;
  24487. }
  24488. }
  24489. }
  24490. } else {
  24491. $$1515 = 0;
  24492. }
  24493. $193 = ($40|0)!=(102);
  24494. $194 = $193 ? $$1515 : 0;
  24495. $195 = (($$539) - ($194))|0;
  24496. $196 = ($40|0)==(103);
  24497. $197 = ($$539|0)!=(0);
  24498. $198 = $197 & $196;
  24499. $$neg = $198 << 31 >> 31;
  24500. $199 = (($195) + ($$neg))|0;
  24501. $200 = $$3501$lcssa;
  24502. $201 = (($200) - ($183))|0;
  24503. $202 = $201 >> 2;
  24504. $203 = ($202*9)|0;
  24505. $204 = (($203) + -9)|0;
  24506. $205 = ($199|0)<($204|0);
  24507. if ($205) {
  24508. $206 = ((($$556)) + 4|0);
  24509. $207 = (($199) + 9216)|0;
  24510. $208 = (($207|0) / 9)&-1;
  24511. $209 = (($208) + -1024)|0;
  24512. $210 = (($206) + ($209<<2)|0);
  24513. $211 = (($207|0) % 9)&-1;
  24514. $$0527629 = (($211) + 1)|0;
  24515. $212 = ($$0527629|0)<(9);
  24516. if ($212) {
  24517. $$0527631 = $$0527629;$$1531630 = 10;
  24518. while(1) {
  24519. $213 = ($$1531630*10)|0;
  24520. $$0527 = (($$0527631) + 1)|0;
  24521. $exitcond = ($$0527|0)==(9);
  24522. if ($exitcond) {
  24523. $$1531$lcssa = $213;
  24524. break;
  24525. } else {
  24526. $$0527631 = $$0527;$$1531630 = $213;
  24527. }
  24528. }
  24529. } else {
  24530. $$1531$lcssa = 10;
  24531. }
  24532. $214 = HEAP32[$210>>2]|0;
  24533. $215 = (($214>>>0) % ($$1531$lcssa>>>0))&-1;
  24534. $216 = ($215|0)==(0);
  24535. $217 = ((($210)) + 4|0);
  24536. $218 = ($217|0)==($$3501$lcssa|0);
  24537. $or$cond541 = $218 & $216;
  24538. if ($or$cond541) {
  24539. $$4492 = $210;$$4518 = $$1515;$$8 = $$3484$lcssa;
  24540. } else {
  24541. $219 = (($214>>>0) / ($$1531$lcssa>>>0))&-1;
  24542. $220 = $219 & 1;
  24543. $221 = ($220|0)==(0);
  24544. $$542 = $221 ? 9007199254740992.0 : 9007199254740994.0;
  24545. $222 = (($$1531$lcssa|0) / 2)&-1;
  24546. $223 = ($215>>>0)<($222>>>0);
  24547. $224 = ($215|0)==($222|0);
  24548. $or$cond544 = $218 & $224;
  24549. $$559 = $or$cond544 ? 1.0 : 1.5;
  24550. $$$559 = $223 ? 0.5 : $$559;
  24551. $225 = ($$0520|0)==(0);
  24552. if ($225) {
  24553. $$1467 = $$$559;$$1469 = $$542;
  24554. } else {
  24555. $226 = HEAP8[$$0521>>0]|0;
  24556. $227 = ($226<<24>>24)==(45);
  24557. $228 = -$$542;
  24558. $229 = -$$$559;
  24559. $$$542 = $227 ? $228 : $$542;
  24560. $$$$559 = $227 ? $229 : $$$559;
  24561. $$1467 = $$$$559;$$1469 = $$$542;
  24562. }
  24563. $230 = (($214) - ($215))|0;
  24564. HEAP32[$210>>2] = $230;
  24565. $231 = $$1469 + $$1467;
  24566. $232 = $231 != $$1469;
  24567. if ($232) {
  24568. $233 = (($230) + ($$1531$lcssa))|0;
  24569. HEAP32[$210>>2] = $233;
  24570. $234 = ($233>>>0)>(999999999);
  24571. if ($234) {
  24572. $$5486623 = $$3484$lcssa;$$sink545622 = $210;
  24573. while(1) {
  24574. $235 = ((($$sink545622)) + -4|0);
  24575. HEAP32[$$sink545622>>2] = 0;
  24576. $236 = ($235>>>0)<($$5486623>>>0);
  24577. if ($236) {
  24578. $237 = ((($$5486623)) + -4|0);
  24579. HEAP32[$237>>2] = 0;
  24580. $$6 = $237;
  24581. } else {
  24582. $$6 = $$5486623;
  24583. }
  24584. $238 = HEAP32[$235>>2]|0;
  24585. $239 = (($238) + 1)|0;
  24586. HEAP32[$235>>2] = $239;
  24587. $240 = ($239>>>0)>(999999999);
  24588. if ($240) {
  24589. $$5486623 = $$6;$$sink545622 = $235;
  24590. } else {
  24591. $$5486$lcssa = $$6;$$sink545$lcssa = $235;
  24592. break;
  24593. }
  24594. }
  24595. } else {
  24596. $$5486$lcssa = $$3484$lcssa;$$sink545$lcssa = $210;
  24597. }
  24598. $241 = $$5486$lcssa;
  24599. $242 = (($183) - ($241))|0;
  24600. $243 = $242 >> 2;
  24601. $244 = ($243*9)|0;
  24602. $245 = HEAP32[$$5486$lcssa>>2]|0;
  24603. $246 = ($245>>>0)<(10);
  24604. if ($246) {
  24605. $$4492 = $$sink545$lcssa;$$4518 = $244;$$8 = $$5486$lcssa;
  24606. } else {
  24607. $$2516618 = $244;$$2532617 = 10;
  24608. while(1) {
  24609. $247 = ($$2532617*10)|0;
  24610. $248 = (($$2516618) + 1)|0;
  24611. $249 = ($245>>>0)<($247>>>0);
  24612. if ($249) {
  24613. $$4492 = $$sink545$lcssa;$$4518 = $248;$$8 = $$5486$lcssa;
  24614. break;
  24615. } else {
  24616. $$2516618 = $248;$$2532617 = $247;
  24617. }
  24618. }
  24619. }
  24620. } else {
  24621. $$4492 = $210;$$4518 = $$1515;$$8 = $$3484$lcssa;
  24622. }
  24623. }
  24624. $250 = ((($$4492)) + 4|0);
  24625. $251 = ($$3501$lcssa>>>0)>($250>>>0);
  24626. $$$3501 = $251 ? $250 : $$3501$lcssa;
  24627. $$5519$ph = $$4518;$$7505$ph = $$$3501;$$9$ph = $$8;
  24628. } else {
  24629. $$5519$ph = $$1515;$$7505$ph = $$3501$lcssa;$$9$ph = $$3484$lcssa;
  24630. }
  24631. $$7505 = $$7505$ph;
  24632. while(1) {
  24633. $252 = ($$7505>>>0)>($$9$ph>>>0);
  24634. if (!($252)) {
  24635. $$lcssa673 = 0;
  24636. break;
  24637. }
  24638. $253 = ((($$7505)) + -4|0);
  24639. $254 = HEAP32[$253>>2]|0;
  24640. $255 = ($254|0)==(0);
  24641. if ($255) {
  24642. $$7505 = $253;
  24643. } else {
  24644. $$lcssa673 = 1;
  24645. break;
  24646. }
  24647. }
  24648. $256 = (0 - ($$5519$ph))|0;
  24649. do {
  24650. if ($196) {
  24651. $not$ = $197 ^ 1;
  24652. $257 = $not$&1;
  24653. $$539$ = (($257) + ($$539))|0;
  24654. $258 = ($$539$|0)>($$5519$ph|0);
  24655. $259 = ($$5519$ph|0)>(-5);
  24656. $or$cond6 = $258 & $259;
  24657. if ($or$cond6) {
  24658. $260 = (($5) + -1)|0;
  24659. $$neg567 = (($$539$) + -1)|0;
  24660. $261 = (($$neg567) - ($$5519$ph))|0;
  24661. $$0479 = $260;$$2476 = $261;
  24662. } else {
  24663. $262 = (($5) + -2)|0;
  24664. $263 = (($$539$) + -1)|0;
  24665. $$0479 = $262;$$2476 = $263;
  24666. }
  24667. $264 = $4 & 8;
  24668. $265 = ($264|0)==(0);
  24669. if ($265) {
  24670. if ($$lcssa673) {
  24671. $266 = ((($$7505)) + -4|0);
  24672. $267 = HEAP32[$266>>2]|0;
  24673. $268 = ($267|0)==(0);
  24674. if ($268) {
  24675. $$2529 = 9;
  24676. } else {
  24677. $269 = (($267>>>0) % 10)&-1;
  24678. $270 = ($269|0)==(0);
  24679. if ($270) {
  24680. $$1528614 = 0;$$3533613 = 10;
  24681. while(1) {
  24682. $271 = ($$3533613*10)|0;
  24683. $272 = (($$1528614) + 1)|0;
  24684. $273 = (($267>>>0) % ($271>>>0))&-1;
  24685. $274 = ($273|0)==(0);
  24686. if ($274) {
  24687. $$1528614 = $272;$$3533613 = $271;
  24688. } else {
  24689. $$2529 = $272;
  24690. break;
  24691. }
  24692. }
  24693. } else {
  24694. $$2529 = 0;
  24695. }
  24696. }
  24697. } else {
  24698. $$2529 = 9;
  24699. }
  24700. $275 = $$0479 | 32;
  24701. $276 = ($275|0)==(102);
  24702. $277 = $$7505;
  24703. $278 = (($277) - ($183))|0;
  24704. $279 = $278 >> 2;
  24705. $280 = ($279*9)|0;
  24706. $281 = (($280) + -9)|0;
  24707. if ($276) {
  24708. $282 = (($281) - ($$2529))|0;
  24709. $283 = ($282|0)>(0);
  24710. $$546 = $283 ? $282 : 0;
  24711. $284 = ($$2476|0)<($$546|0);
  24712. $$2476$$547 = $284 ? $$2476 : $$546;
  24713. $$1480 = $$0479;$$3477 = $$2476$$547;$$pre$phi690Z2D = 0;
  24714. break;
  24715. } else {
  24716. $285 = (($281) + ($$5519$ph))|0;
  24717. $286 = (($285) - ($$2529))|0;
  24718. $287 = ($286|0)>(0);
  24719. $$548 = $287 ? $286 : 0;
  24720. $288 = ($$2476|0)<($$548|0);
  24721. $$2476$$549 = $288 ? $$2476 : $$548;
  24722. $$1480 = $$0479;$$3477 = $$2476$$549;$$pre$phi690Z2D = 0;
  24723. break;
  24724. }
  24725. } else {
  24726. $$1480 = $$0479;$$3477 = $$2476;$$pre$phi690Z2D = $264;
  24727. }
  24728. } else {
  24729. $$pre689 = $4 & 8;
  24730. $$1480 = $5;$$3477 = $$539;$$pre$phi690Z2D = $$pre689;
  24731. }
  24732. } while(0);
  24733. $289 = $$3477 | $$pre$phi690Z2D;
  24734. $290 = ($289|0)!=(0);
  24735. $291 = $290&1;
  24736. $292 = $$1480 | 32;
  24737. $293 = ($292|0)==(102);
  24738. if ($293) {
  24739. $294 = ($$5519$ph|0)>(0);
  24740. $295 = $294 ? $$5519$ph : 0;
  24741. $$2513 = 0;$$pn566 = $295;
  24742. } else {
  24743. $296 = ($$5519$ph|0)<(0);
  24744. $297 = $296 ? $256 : $$5519$ph;
  24745. $298 = ($297|0)<(0);
  24746. $299 = $298 << 31 >> 31;
  24747. $300 = (_fmt_u($297,$299,$11)|0);
  24748. $301 = $11;
  24749. $302 = $300;
  24750. $303 = (($301) - ($302))|0;
  24751. $304 = ($303|0)<(2);
  24752. if ($304) {
  24753. $$1512607 = $300;
  24754. while(1) {
  24755. $305 = ((($$1512607)) + -1|0);
  24756. HEAP8[$305>>0] = 48;
  24757. $306 = $305;
  24758. $307 = (($301) - ($306))|0;
  24759. $308 = ($307|0)<(2);
  24760. if ($308) {
  24761. $$1512607 = $305;
  24762. } else {
  24763. $$1512$lcssa = $305;
  24764. break;
  24765. }
  24766. }
  24767. } else {
  24768. $$1512$lcssa = $300;
  24769. }
  24770. $309 = $$5519$ph >> 31;
  24771. $310 = $309 & 2;
  24772. $311 = (($310) + 43)|0;
  24773. $312 = $311&255;
  24774. $313 = ((($$1512$lcssa)) + -1|0);
  24775. HEAP8[$313>>0] = $312;
  24776. $314 = $$1480&255;
  24777. $315 = ((($$1512$lcssa)) + -2|0);
  24778. HEAP8[$315>>0] = $314;
  24779. $316 = $315;
  24780. $317 = (($301) - ($316))|0;
  24781. $$2513 = $315;$$pn566 = $317;
  24782. }
  24783. $318 = (($$0520) + 1)|0;
  24784. $319 = (($318) + ($$3477))|0;
  24785. $$1526 = (($319) + ($291))|0;
  24786. $320 = (($$1526) + ($$pn566))|0;
  24787. _pad_672($0,32,$2,$320,$4);
  24788. _out($0,$$0521,$$0520);
  24789. $321 = $4 ^ 65536;
  24790. _pad_672($0,48,$2,$320,$321);
  24791. if ($293) {
  24792. $322 = ($$9$ph>>>0)>($$556>>>0);
  24793. $$0496$$9 = $322 ? $$556 : $$9$ph;
  24794. $323 = ((($8)) + 9|0);
  24795. $324 = $323;
  24796. $325 = ((($8)) + 8|0);
  24797. $$5493597 = $$0496$$9;
  24798. while(1) {
  24799. $326 = HEAP32[$$5493597>>2]|0;
  24800. $327 = (_fmt_u($326,0,$323)|0);
  24801. $328 = ($$5493597|0)==($$0496$$9|0);
  24802. if ($328) {
  24803. $334 = ($327|0)==($323|0);
  24804. if ($334) {
  24805. HEAP8[$325>>0] = 48;
  24806. $$1465 = $325;
  24807. } else {
  24808. $$1465 = $327;
  24809. }
  24810. } else {
  24811. $329 = ($327>>>0)>($8>>>0);
  24812. if ($329) {
  24813. $330 = $327;
  24814. $331 = (($330) - ($9))|0;
  24815. _memset(($8|0),48,($331|0))|0;
  24816. $$0464594 = $327;
  24817. while(1) {
  24818. $332 = ((($$0464594)) + -1|0);
  24819. $333 = ($332>>>0)>($8>>>0);
  24820. if ($333) {
  24821. $$0464594 = $332;
  24822. } else {
  24823. $$1465 = $332;
  24824. break;
  24825. }
  24826. }
  24827. } else {
  24828. $$1465 = $327;
  24829. }
  24830. }
  24831. $335 = $$1465;
  24832. $336 = (($324) - ($335))|0;
  24833. _out($0,$$1465,$336);
  24834. $337 = ((($$5493597)) + 4|0);
  24835. $338 = ($337>>>0)>($$556>>>0);
  24836. if ($338) {
  24837. break;
  24838. } else {
  24839. $$5493597 = $337;
  24840. }
  24841. }
  24842. $339 = ($289|0)==(0);
  24843. if (!($339)) {
  24844. _out($0,11680,1);
  24845. }
  24846. $340 = ($337>>>0)<($$7505>>>0);
  24847. $341 = ($$3477|0)>(0);
  24848. $342 = $340 & $341;
  24849. if ($342) {
  24850. $$4478590 = $$3477;$$6494589 = $337;
  24851. while(1) {
  24852. $343 = HEAP32[$$6494589>>2]|0;
  24853. $344 = (_fmt_u($343,0,$323)|0);
  24854. $345 = ($344>>>0)>($8>>>0);
  24855. if ($345) {
  24856. $346 = $344;
  24857. $347 = (($346) - ($9))|0;
  24858. _memset(($8|0),48,($347|0))|0;
  24859. $$0463584 = $344;
  24860. while(1) {
  24861. $348 = ((($$0463584)) + -1|0);
  24862. $349 = ($348>>>0)>($8>>>0);
  24863. if ($349) {
  24864. $$0463584 = $348;
  24865. } else {
  24866. $$0463$lcssa = $348;
  24867. break;
  24868. }
  24869. }
  24870. } else {
  24871. $$0463$lcssa = $344;
  24872. }
  24873. $350 = ($$4478590|0)<(9);
  24874. $351 = $350 ? $$4478590 : 9;
  24875. _out($0,$$0463$lcssa,$351);
  24876. $352 = ((($$6494589)) + 4|0);
  24877. $353 = (($$4478590) + -9)|0;
  24878. $354 = ($352>>>0)<($$7505>>>0);
  24879. $355 = ($$4478590|0)>(9);
  24880. $356 = $354 & $355;
  24881. if ($356) {
  24882. $$4478590 = $353;$$6494589 = $352;
  24883. } else {
  24884. $$4478$lcssa = $353;
  24885. break;
  24886. }
  24887. }
  24888. } else {
  24889. $$4478$lcssa = $$3477;
  24890. }
  24891. $357 = (($$4478$lcssa) + 9)|0;
  24892. _pad_672($0,48,$357,9,0);
  24893. } else {
  24894. $358 = ((($$9$ph)) + 4|0);
  24895. $$7505$ = $$lcssa673 ? $$7505 : $358;
  24896. $359 = ($$3477|0)>(-1);
  24897. if ($359) {
  24898. $360 = ((($8)) + 9|0);
  24899. $361 = ($$pre$phi690Z2D|0)==(0);
  24900. $362 = $360;
  24901. $363 = (0 - ($9))|0;
  24902. $364 = ((($8)) + 8|0);
  24903. $$5602 = $$3477;$$7495601 = $$9$ph;
  24904. while(1) {
  24905. $365 = HEAP32[$$7495601>>2]|0;
  24906. $366 = (_fmt_u($365,0,$360)|0);
  24907. $367 = ($366|0)==($360|0);
  24908. if ($367) {
  24909. HEAP8[$364>>0] = 48;
  24910. $$0 = $364;
  24911. } else {
  24912. $$0 = $366;
  24913. }
  24914. $368 = ($$7495601|0)==($$9$ph|0);
  24915. do {
  24916. if ($368) {
  24917. $372 = ((($$0)) + 1|0);
  24918. _out($0,$$0,1);
  24919. $373 = ($$5602|0)<(1);
  24920. $or$cond554 = $361 & $373;
  24921. if ($or$cond554) {
  24922. $$2 = $372;
  24923. break;
  24924. }
  24925. _out($0,11680,1);
  24926. $$2 = $372;
  24927. } else {
  24928. $369 = ($$0>>>0)>($8>>>0);
  24929. if (!($369)) {
  24930. $$2 = $$0;
  24931. break;
  24932. }
  24933. $scevgep684 = (($$0) + ($363)|0);
  24934. $scevgep684685 = $scevgep684;
  24935. _memset(($8|0),48,($scevgep684685|0))|0;
  24936. $$1598 = $$0;
  24937. while(1) {
  24938. $370 = ((($$1598)) + -1|0);
  24939. $371 = ($370>>>0)>($8>>>0);
  24940. if ($371) {
  24941. $$1598 = $370;
  24942. } else {
  24943. $$2 = $370;
  24944. break;
  24945. }
  24946. }
  24947. }
  24948. } while(0);
  24949. $374 = $$2;
  24950. $375 = (($362) - ($374))|0;
  24951. $376 = ($$5602|0)>($375|0);
  24952. $377 = $376 ? $375 : $$5602;
  24953. _out($0,$$2,$377);
  24954. $378 = (($$5602) - ($375))|0;
  24955. $379 = ((($$7495601)) + 4|0);
  24956. $380 = ($379>>>0)<($$7505$>>>0);
  24957. $381 = ($378|0)>(-1);
  24958. $382 = $380 & $381;
  24959. if ($382) {
  24960. $$5602 = $378;$$7495601 = $379;
  24961. } else {
  24962. $$5$lcssa = $378;
  24963. break;
  24964. }
  24965. }
  24966. } else {
  24967. $$5$lcssa = $$3477;
  24968. }
  24969. $383 = (($$5$lcssa) + 18)|0;
  24970. _pad_672($0,48,$383,18,0);
  24971. $384 = $11;
  24972. $385 = $$2513;
  24973. $386 = (($384) - ($385))|0;
  24974. _out($0,$$2513,$386);
  24975. }
  24976. $387 = $4 ^ 8192;
  24977. _pad_672($0,32,$2,$320,$387);
  24978. $$sink562 = $320;
  24979. } else {
  24980. $27 = $5 & 32;
  24981. $28 = ($27|0)!=(0);
  24982. $29 = $28 ? 11648 : 11652;
  24983. $30 = ($$0471 != $$0471) | (0.0 != 0.0);
  24984. $31 = $28 ? 11656 : 11660;
  24985. $$0510 = $30 ? $31 : $29;
  24986. $32 = (($$0520) + 3)|0;
  24987. $33 = $4 & -65537;
  24988. _pad_672($0,32,$2,$32,$33);
  24989. _out($0,$$0521,$$0520);
  24990. _out($0,$$0510,3);
  24991. $34 = $4 ^ 8192;
  24992. _pad_672($0,32,$2,$32,$34);
  24993. $$sink562 = $32;
  24994. }
  24995. } while(0);
  24996. $388 = ($$sink562|0)<($2|0);
  24997. $$555 = $388 ? $2 : $$sink562;
  24998. STACKTOP = sp;return ($$555|0);
  24999. }
  25000. function ___DOUBLE_BITS_673($0) {
  25001. $0 = +$0;
  25002. var $1 = 0, $2 = 0, label = 0, sp = 0;
  25003. sp = STACKTOP;
  25004. HEAPF64[tempDoublePtr>>3] = $0;$1 = HEAP32[tempDoublePtr>>2]|0;
  25005. $2 = HEAP32[tempDoublePtr+4>>2]|0;
  25006. tempRet0 = ($2);
  25007. return ($1|0);
  25008. }
  25009. function _frexpl($0,$1) {
  25010. $0 = +$0;
  25011. $1 = $1|0;
  25012. var $2 = 0.0, label = 0, sp = 0;
  25013. sp = STACKTOP;
  25014. $2 = (+_frexp($0,$1));
  25015. return (+$2);
  25016. }
  25017. function _frexp($0,$1) {
  25018. $0 = +$0;
  25019. $1 = $1|0;
  25020. 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;
  25021. var sp = 0;
  25022. sp = STACKTOP;
  25023. HEAPF64[tempDoublePtr>>3] = $0;$2 = HEAP32[tempDoublePtr>>2]|0;
  25024. $3 = HEAP32[tempDoublePtr+4>>2]|0;
  25025. $4 = (_bitshift64Lshr(($2|0),($3|0),52)|0);
  25026. $5 = tempRet0;
  25027. $6 = $4&65535;
  25028. $trunc$clear = $6 & 2047;
  25029. switch ($trunc$clear<<16>>16) {
  25030. case 0: {
  25031. $7 = $0 != 0.0;
  25032. if ($7) {
  25033. $8 = $0 * 1.8446744073709552E+19;
  25034. $9 = (+_frexp($8,$1));
  25035. $10 = HEAP32[$1>>2]|0;
  25036. $11 = (($10) + -64)|0;
  25037. $$016 = $9;$storemerge = $11;
  25038. } else {
  25039. $$016 = $0;$storemerge = 0;
  25040. }
  25041. HEAP32[$1>>2] = $storemerge;
  25042. $$0 = $$016;
  25043. break;
  25044. }
  25045. case 2047: {
  25046. $$0 = $0;
  25047. break;
  25048. }
  25049. default: {
  25050. $12 = $4 & 2047;
  25051. $13 = (($12) + -1022)|0;
  25052. HEAP32[$1>>2] = $13;
  25053. $14 = $3 & -2146435073;
  25054. $15 = $14 | 1071644672;
  25055. HEAP32[tempDoublePtr>>2] = $2;HEAP32[tempDoublePtr+4>>2] = $15;$16 = +HEAPF64[tempDoublePtr>>3];
  25056. $$0 = $16;
  25057. }
  25058. }
  25059. return (+$$0);
  25060. }
  25061. function _wcrtomb($0,$1,$2) {
  25062. $0 = $0|0;
  25063. $1 = $1|0;
  25064. $2 = $2|0;
  25065. 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;
  25066. 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;
  25067. 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;
  25068. sp = STACKTOP;
  25069. $3 = ($0|0)==(0|0);
  25070. do {
  25071. if ($3) {
  25072. $$0 = 1;
  25073. } else {
  25074. $4 = ($1>>>0)<(128);
  25075. if ($4) {
  25076. $5 = $1&255;
  25077. HEAP8[$0>>0] = $5;
  25078. $$0 = 1;
  25079. break;
  25080. }
  25081. $6 = (___pthread_self_446()|0);
  25082. $7 = ((($6)) + 188|0);
  25083. $8 = HEAP32[$7>>2]|0;
  25084. $9 = (Atomics_load(HEAP32,$8>>2)|0);
  25085. $not$ = ($9|0)==(0|0);
  25086. if ($not$) {
  25087. $10 = $1 & -128;
  25088. $11 = ($10|0)==(57216);
  25089. if ($11) {
  25090. $13 = $1&255;
  25091. HEAP8[$0>>0] = $13;
  25092. $$0 = 1;
  25093. break;
  25094. } else {
  25095. $12 = (___errno_location()|0);
  25096. HEAP32[$12>>2] = 84;
  25097. $$0 = -1;
  25098. break;
  25099. }
  25100. }
  25101. $14 = ($1>>>0)<(2048);
  25102. if ($14) {
  25103. $15 = $1 >>> 6;
  25104. $16 = $15 | 192;
  25105. $17 = $16&255;
  25106. $18 = ((($0)) + 1|0);
  25107. HEAP8[$0>>0] = $17;
  25108. $19 = $1 & 63;
  25109. $20 = $19 | 128;
  25110. $21 = $20&255;
  25111. HEAP8[$18>>0] = $21;
  25112. $$0 = 2;
  25113. break;
  25114. }
  25115. $22 = ($1>>>0)<(55296);
  25116. $23 = $1 & -8192;
  25117. $24 = ($23|0)==(57344);
  25118. $or$cond = $22 | $24;
  25119. if ($or$cond) {
  25120. $25 = $1 >>> 12;
  25121. $26 = $25 | 224;
  25122. $27 = $26&255;
  25123. $28 = ((($0)) + 1|0);
  25124. HEAP8[$0>>0] = $27;
  25125. $29 = $1 >>> 6;
  25126. $30 = $29 & 63;
  25127. $31 = $30 | 128;
  25128. $32 = $31&255;
  25129. $33 = ((($0)) + 2|0);
  25130. HEAP8[$28>>0] = $32;
  25131. $34 = $1 & 63;
  25132. $35 = $34 | 128;
  25133. $36 = $35&255;
  25134. HEAP8[$33>>0] = $36;
  25135. $$0 = 3;
  25136. break;
  25137. }
  25138. $37 = (($1) + -65536)|0;
  25139. $38 = ($37>>>0)<(1048576);
  25140. if ($38) {
  25141. $39 = $1 >>> 18;
  25142. $40 = $39 | 240;
  25143. $41 = $40&255;
  25144. $42 = ((($0)) + 1|0);
  25145. HEAP8[$0>>0] = $41;
  25146. $43 = $1 >>> 12;
  25147. $44 = $43 & 63;
  25148. $45 = $44 | 128;
  25149. $46 = $45&255;
  25150. $47 = ((($0)) + 2|0);
  25151. HEAP8[$42>>0] = $46;
  25152. $48 = $1 >>> 6;
  25153. $49 = $48 & 63;
  25154. $50 = $49 | 128;
  25155. $51 = $50&255;
  25156. $52 = ((($0)) + 3|0);
  25157. HEAP8[$47>>0] = $51;
  25158. $53 = $1 & 63;
  25159. $54 = $53 | 128;
  25160. $55 = $54&255;
  25161. HEAP8[$52>>0] = $55;
  25162. $$0 = 4;
  25163. break;
  25164. } else {
  25165. $56 = (___errno_location()|0);
  25166. HEAP32[$56>>2] = 84;
  25167. $$0 = -1;
  25168. break;
  25169. }
  25170. }
  25171. } while(0);
  25172. return ($$0|0);
  25173. }
  25174. function ___pthread_self_446() {
  25175. var $0 = 0, label = 0, sp = 0;
  25176. sp = STACKTOP;
  25177. $0 = (_pthread_self()|0);
  25178. return ($0|0);
  25179. }
  25180. function ___pthread_self_105() {
  25181. var $0 = 0, label = 0, sp = 0;
  25182. sp = STACKTOP;
  25183. $0 = (_pthread_self()|0);
  25184. return ($0|0);
  25185. }
  25186. function ___strerror_l($0,$1) {
  25187. $0 = $0|0;
  25188. $1 = $1|0;
  25189. 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;
  25190. var label = 0, sp = 0;
  25191. sp = STACKTOP;
  25192. $$016 = 0;
  25193. while(1) {
  25194. $3 = (11682 + ($$016)|0);
  25195. $4 = HEAP8[$3>>0]|0;
  25196. $5 = $4&255;
  25197. $6 = ($5|0)==($0|0);
  25198. if ($6) {
  25199. label = 2;
  25200. break;
  25201. }
  25202. $7 = (($$016) + 1)|0;
  25203. $8 = ($7|0)==(87);
  25204. if ($8) {
  25205. $$01214 = 11770;$$115 = 87;
  25206. label = 5;
  25207. break;
  25208. } else {
  25209. $$016 = $7;
  25210. }
  25211. }
  25212. if ((label|0) == 2) {
  25213. $2 = ($$016|0)==(0);
  25214. if ($2) {
  25215. $$012$lcssa = 11770;
  25216. } else {
  25217. $$01214 = 11770;$$115 = $$016;
  25218. label = 5;
  25219. }
  25220. }
  25221. if ((label|0) == 5) {
  25222. while(1) {
  25223. label = 0;
  25224. $$113 = $$01214;
  25225. while(1) {
  25226. $9 = HEAP8[$$113>>0]|0;
  25227. $10 = ($9<<24>>24)==(0);
  25228. $11 = ((($$113)) + 1|0);
  25229. if ($10) {
  25230. break;
  25231. } else {
  25232. $$113 = $11;
  25233. }
  25234. }
  25235. $12 = (($$115) + -1)|0;
  25236. $13 = ($12|0)==(0);
  25237. if ($13) {
  25238. $$012$lcssa = $11;
  25239. break;
  25240. } else {
  25241. $$01214 = $11;$$115 = $12;
  25242. label = 5;
  25243. }
  25244. }
  25245. }
  25246. $14 = ((($1)) + 20|0);
  25247. $15 = (Atomics_load(HEAP32,$14>>2)|0);
  25248. $16 = (___lctrans($$012$lcssa,$15)|0);
  25249. return ($16|0);
  25250. }
  25251. function ___lctrans($0,$1) {
  25252. $0 = $0|0;
  25253. $1 = $1|0;
  25254. var $2 = 0, label = 0, sp = 0;
  25255. sp = STACKTOP;
  25256. $2 = (___lctrans_impl($0,$1)|0);
  25257. return ($2|0);
  25258. }
  25259. function ___lctrans_impl($0,$1) {
  25260. $0 = $0|0;
  25261. $1 = $1|0;
  25262. var $$0 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, label = 0, sp = 0;
  25263. sp = STACKTOP;
  25264. $2 = ($1|0)==(0|0);
  25265. if ($2) {
  25266. $$0 = 0;
  25267. } else {
  25268. $3 = HEAP32[$1>>2]|0;
  25269. $4 = ((($1)) + 4|0);
  25270. $5 = HEAP32[$4>>2]|0;
  25271. $6 = (___mo_lookup($3,$5,$0)|0);
  25272. $$0 = $6;
  25273. }
  25274. $7 = ($$0|0)!=(0|0);
  25275. $8 = $7 ? $$0 : $0;
  25276. return ($8|0);
  25277. }
  25278. function ___mo_lookup($0,$1,$2) {
  25279. $0 = $0|0;
  25280. $1 = $1|0;
  25281. $2 = $2|0;
  25282. 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;
  25283. 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;
  25284. 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;
  25285. 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;
  25286. sp = STACKTOP;
  25287. $3 = HEAP32[$0>>2]|0;
  25288. $4 = (($3) + 1794895138)|0;
  25289. $5 = ((($0)) + 8|0);
  25290. $6 = HEAP32[$5>>2]|0;
  25291. $7 = (_swapc($6,$4)|0);
  25292. $8 = ((($0)) + 12|0);
  25293. $9 = HEAP32[$8>>2]|0;
  25294. $10 = (_swapc($9,$4)|0);
  25295. $11 = ((($0)) + 16|0);
  25296. $12 = HEAP32[$11>>2]|0;
  25297. $13 = (_swapc($12,$4)|0);
  25298. $14 = $1 >>> 2;
  25299. $15 = ($7>>>0)<($14>>>0);
  25300. L1: do {
  25301. if ($15) {
  25302. $16 = $7 << 2;
  25303. $17 = (($1) - ($16))|0;
  25304. $18 = ($10>>>0)<($17>>>0);
  25305. $19 = ($13>>>0)<($17>>>0);
  25306. $or$cond = $18 & $19;
  25307. if ($or$cond) {
  25308. $20 = $13 | $10;
  25309. $21 = $20 & 3;
  25310. $22 = ($21|0)==(0);
  25311. if ($22) {
  25312. $23 = $10 >>> 2;
  25313. $24 = $13 >>> 2;
  25314. $$090 = 0;$$094 = $7;
  25315. while(1) {
  25316. $25 = $$094 >>> 1;
  25317. $26 = (($$090) + ($25))|0;
  25318. $27 = $26 << 1;
  25319. $28 = (($27) + ($23))|0;
  25320. $29 = (($0) + ($28<<2)|0);
  25321. $30 = HEAP32[$29>>2]|0;
  25322. $31 = (_swapc($30,$4)|0);
  25323. $32 = (($28) + 1)|0;
  25324. $33 = (($0) + ($32<<2)|0);
  25325. $34 = HEAP32[$33>>2]|0;
  25326. $35 = (_swapc($34,$4)|0);
  25327. $36 = ($35>>>0)<($1>>>0);
  25328. $37 = (($1) - ($35))|0;
  25329. $38 = ($31>>>0)<($37>>>0);
  25330. $or$cond102 = $36 & $38;
  25331. if (!($or$cond102)) {
  25332. $$4 = 0;
  25333. break L1;
  25334. }
  25335. $39 = (($35) + ($31))|0;
  25336. $40 = (($0) + ($39)|0);
  25337. $41 = HEAP8[$40>>0]|0;
  25338. $42 = ($41<<24>>24)==(0);
  25339. if (!($42)) {
  25340. $$4 = 0;
  25341. break L1;
  25342. }
  25343. $43 = (($0) + ($35)|0);
  25344. $44 = (_strcmp($2,$43)|0);
  25345. $45 = ($44|0)==(0);
  25346. if ($45) {
  25347. break;
  25348. }
  25349. $62 = ($$094|0)==(1);
  25350. $63 = ($44|0)<(0);
  25351. $64 = (($$094) - ($25))|0;
  25352. $$195 = $63 ? $25 : $64;
  25353. $$191 = $63 ? $$090 : $26;
  25354. if ($62) {
  25355. $$4 = 0;
  25356. break L1;
  25357. } else {
  25358. $$090 = $$191;$$094 = $$195;
  25359. }
  25360. }
  25361. $46 = (($27) + ($24))|0;
  25362. $47 = (($0) + ($46<<2)|0);
  25363. $48 = HEAP32[$47>>2]|0;
  25364. $49 = (_swapc($48,$4)|0);
  25365. $50 = (($46) + 1)|0;
  25366. $51 = (($0) + ($50<<2)|0);
  25367. $52 = HEAP32[$51>>2]|0;
  25368. $53 = (_swapc($52,$4)|0);
  25369. $54 = ($53>>>0)<($1>>>0);
  25370. $55 = (($1) - ($53))|0;
  25371. $56 = ($49>>>0)<($55>>>0);
  25372. $or$cond104 = $54 & $56;
  25373. if ($or$cond104) {
  25374. $57 = (($0) + ($53)|0);
  25375. $58 = (($53) + ($49))|0;
  25376. $59 = (($0) + ($58)|0);
  25377. $60 = HEAP8[$59>>0]|0;
  25378. $61 = ($60<<24>>24)==(0);
  25379. $$ = $61 ? $57 : 0;
  25380. $$4 = $$;
  25381. } else {
  25382. $$4 = 0;
  25383. }
  25384. } else {
  25385. $$4 = 0;
  25386. }
  25387. } else {
  25388. $$4 = 0;
  25389. }
  25390. } else {
  25391. $$4 = 0;
  25392. }
  25393. } while(0);
  25394. return ($$4|0);
  25395. }
  25396. function _swapc($0,$1) {
  25397. $0 = $0|0;
  25398. $1 = $1|0;
  25399. var $$ = 0, $2 = 0, $3 = 0, label = 0, sp = 0;
  25400. sp = STACKTOP;
  25401. $2 = ($1|0)==(0);
  25402. $3 = (_llvm_bswap_i32(($0|0))|0);
  25403. $$ = $2 ? $0 : $3;
  25404. return ($$|0);
  25405. }
  25406. function ___fwritex($0,$1,$2) {
  25407. $0 = $0|0;
  25408. $1 = $1|0;
  25409. $2 = $2|0;
  25410. 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;
  25411. 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;
  25412. var label = 0, sp = 0;
  25413. sp = STACKTOP;
  25414. $3 = ((($2)) + 16|0);
  25415. $4 = HEAP32[$3>>2]|0;
  25416. $5 = ($4|0)==(0|0);
  25417. if ($5) {
  25418. $7 = (___towrite($2)|0);
  25419. $8 = ($7|0)==(0);
  25420. if ($8) {
  25421. $$pre = HEAP32[$3>>2]|0;
  25422. $12 = $$pre;
  25423. label = 5;
  25424. } else {
  25425. $$1 = 0;
  25426. }
  25427. } else {
  25428. $6 = $4;
  25429. $12 = $6;
  25430. label = 5;
  25431. }
  25432. L5: do {
  25433. if ((label|0) == 5) {
  25434. $9 = ((($2)) + 20|0);
  25435. $10 = HEAP32[$9>>2]|0;
  25436. $11 = (($12) - ($10))|0;
  25437. $13 = ($11>>>0)<($1>>>0);
  25438. $14 = $10;
  25439. if ($13) {
  25440. $15 = ((($2)) + 36|0);
  25441. $16 = HEAP32[$15>>2]|0;
  25442. $17 = (FUNCTION_TABLE_iiii[$16 & 15]($2,$0,$1)|0);
  25443. $$1 = $17;
  25444. break;
  25445. }
  25446. $18 = ((($2)) + 75|0);
  25447. $19 = HEAP8[$18>>0]|0;
  25448. $20 = ($19<<24>>24)>(-1);
  25449. L10: do {
  25450. if ($20) {
  25451. $$038 = $1;
  25452. while(1) {
  25453. $21 = ($$038|0)==(0);
  25454. if ($21) {
  25455. $$139 = 0;$$141 = $0;$$143 = $1;$31 = $14;
  25456. break L10;
  25457. }
  25458. $22 = (($$038) + -1)|0;
  25459. $23 = (($0) + ($22)|0);
  25460. $24 = HEAP8[$23>>0]|0;
  25461. $25 = ($24<<24>>24)==(10);
  25462. if ($25) {
  25463. break;
  25464. } else {
  25465. $$038 = $22;
  25466. }
  25467. }
  25468. $26 = ((($2)) + 36|0);
  25469. $27 = HEAP32[$26>>2]|0;
  25470. $28 = (FUNCTION_TABLE_iiii[$27 & 15]($2,$0,$$038)|0);
  25471. $29 = ($28>>>0)<($$038>>>0);
  25472. if ($29) {
  25473. $$1 = $28;
  25474. break L5;
  25475. }
  25476. $30 = (($0) + ($$038)|0);
  25477. $$042 = (($1) - ($$038))|0;
  25478. $$pre47 = HEAP32[$9>>2]|0;
  25479. $$139 = $$038;$$141 = $30;$$143 = $$042;$31 = $$pre47;
  25480. } else {
  25481. $$139 = 0;$$141 = $0;$$143 = $1;$31 = $14;
  25482. }
  25483. } while(0);
  25484. _memcpy(($31|0),($$141|0),($$143|0))|0;
  25485. $32 = HEAP32[$9>>2]|0;
  25486. $33 = (($32) + ($$143)|0);
  25487. HEAP32[$9>>2] = $33;
  25488. $34 = (($$139) + ($$143))|0;
  25489. $$1 = $34;
  25490. }
  25491. } while(0);
  25492. return ($$1|0);
  25493. }
  25494. function ___towrite($0) {
  25495. $0 = $0|0;
  25496. 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;
  25497. var $9 = 0, label = 0, sp = 0;
  25498. sp = STACKTOP;
  25499. $1 = ((($0)) + 74|0);
  25500. $2 = HEAP8[$1>>0]|0;
  25501. $3 = $2 << 24 >> 24;
  25502. $4 = (($3) + 255)|0;
  25503. $5 = $4 | $3;
  25504. $6 = $5&255;
  25505. HEAP8[$1>>0] = $6;
  25506. $7 = HEAP32[$0>>2]|0;
  25507. $8 = $7 & 8;
  25508. $9 = ($8|0)==(0);
  25509. if ($9) {
  25510. $11 = ((($0)) + 8|0);
  25511. HEAP32[$11>>2] = 0;
  25512. $12 = ((($0)) + 4|0);
  25513. HEAP32[$12>>2] = 0;
  25514. $13 = ((($0)) + 44|0);
  25515. $14 = HEAP32[$13>>2]|0;
  25516. $15 = ((($0)) + 28|0);
  25517. HEAP32[$15>>2] = $14;
  25518. $16 = ((($0)) + 20|0);
  25519. HEAP32[$16>>2] = $14;
  25520. $17 = ((($0)) + 48|0);
  25521. $18 = HEAP32[$17>>2]|0;
  25522. $19 = (($14) + ($18)|0);
  25523. $20 = ((($0)) + 16|0);
  25524. HEAP32[$20>>2] = $19;
  25525. $$0 = 0;
  25526. } else {
  25527. $10 = $7 | 32;
  25528. HEAP32[$0>>2] = $10;
  25529. $$0 = -1;
  25530. }
  25531. return ($$0|0);
  25532. }
  25533. function _sn_write($0,$1,$2) {
  25534. $0 = $0|0;
  25535. $1 = $1|0;
  25536. $2 = $2|0;
  25537. var $$ = 0, $10 = 0, $11 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  25538. sp = STACKTOP;
  25539. $3 = ((($0)) + 16|0);
  25540. $4 = HEAP32[$3>>2]|0;
  25541. $5 = ((($0)) + 20|0);
  25542. $6 = HEAP32[$5>>2]|0;
  25543. $7 = $6;
  25544. $8 = (($4) - ($7))|0;
  25545. $9 = ($8>>>0)>($2>>>0);
  25546. $$ = $9 ? $2 : $8;
  25547. _memcpy(($6|0),($1|0),($$|0))|0;
  25548. $10 = HEAP32[$5>>2]|0;
  25549. $11 = (($10) + ($$)|0);
  25550. HEAP32[$5>>2] = $11;
  25551. return ($2|0);
  25552. }
  25553. function _strlen($0) {
  25554. $0 = $0|0;
  25555. 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;
  25556. 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;
  25557. sp = STACKTOP;
  25558. $1 = $0;
  25559. $2 = $1 & 3;
  25560. $3 = ($2|0)==(0);
  25561. L1: do {
  25562. if ($3) {
  25563. $$015$lcssa = $0;
  25564. label = 4;
  25565. } else {
  25566. $$01519 = $0;$23 = $1;
  25567. while(1) {
  25568. $4 = HEAP8[$$01519>>0]|0;
  25569. $5 = ($4<<24>>24)==(0);
  25570. if ($5) {
  25571. $$sink = $23;
  25572. break L1;
  25573. }
  25574. $6 = ((($$01519)) + 1|0);
  25575. $7 = $6;
  25576. $8 = $7 & 3;
  25577. $9 = ($8|0)==(0);
  25578. if ($9) {
  25579. $$015$lcssa = $6;
  25580. label = 4;
  25581. break;
  25582. } else {
  25583. $$01519 = $6;$23 = $7;
  25584. }
  25585. }
  25586. }
  25587. } while(0);
  25588. if ((label|0) == 4) {
  25589. $$0 = $$015$lcssa;
  25590. while(1) {
  25591. $10 = HEAP32[$$0>>2]|0;
  25592. $11 = (($10) + -16843009)|0;
  25593. $12 = $10 & -2139062144;
  25594. $13 = $12 ^ -2139062144;
  25595. $14 = $13 & $11;
  25596. $15 = ($14|0)==(0);
  25597. $16 = ((($$0)) + 4|0);
  25598. if ($15) {
  25599. $$0 = $16;
  25600. } else {
  25601. break;
  25602. }
  25603. }
  25604. $17 = $10&255;
  25605. $18 = ($17<<24>>24)==(0);
  25606. if ($18) {
  25607. $$1$lcssa = $$0;
  25608. } else {
  25609. $$pn = $$0;
  25610. while(1) {
  25611. $19 = ((($$pn)) + 1|0);
  25612. $$pre = HEAP8[$19>>0]|0;
  25613. $20 = ($$pre<<24>>24)==(0);
  25614. if ($20) {
  25615. $$1$lcssa = $19;
  25616. break;
  25617. } else {
  25618. $$pn = $19;
  25619. }
  25620. }
  25621. }
  25622. $21 = $$1$lcssa;
  25623. $$sink = $21;
  25624. }
  25625. $22 = (($$sink) - ($1))|0;
  25626. return ($22|0);
  25627. }
  25628. function _strchr($0,$1) {
  25629. $0 = $0|0;
  25630. $1 = $1|0;
  25631. var $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, label = 0, sp = 0;
  25632. sp = STACKTOP;
  25633. $2 = (___strchrnul($0,$1)|0);
  25634. $3 = HEAP8[$2>>0]|0;
  25635. $4 = $1&255;
  25636. $5 = ($3<<24>>24)==($4<<24>>24);
  25637. $6 = $5 ? $2 : 0;
  25638. return ($6|0);
  25639. }
  25640. function ___strchrnul($0,$1) {
  25641. $0 = $0|0;
  25642. $1 = $1|0;
  25643. 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;
  25644. 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;
  25645. 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;
  25646. sp = STACKTOP;
  25647. $2 = $1 & 255;
  25648. $3 = ($2|0)==(0);
  25649. L1: do {
  25650. if ($3) {
  25651. $8 = (_strlen($0)|0);
  25652. $9 = (($0) + ($8)|0);
  25653. $$0 = $9;
  25654. } else {
  25655. $4 = $0;
  25656. $5 = $4 & 3;
  25657. $6 = ($5|0)==(0);
  25658. if ($6) {
  25659. $$030$lcssa = $0;
  25660. } else {
  25661. $7 = $1&255;
  25662. $$03039 = $0;
  25663. while(1) {
  25664. $10 = HEAP8[$$03039>>0]|0;
  25665. $11 = ($10<<24>>24)==(0);
  25666. $12 = ($10<<24>>24)==($7<<24>>24);
  25667. $or$cond = $11 | $12;
  25668. if ($or$cond) {
  25669. $$0 = $$03039;
  25670. break L1;
  25671. }
  25672. $13 = ((($$03039)) + 1|0);
  25673. $14 = $13;
  25674. $15 = $14 & 3;
  25675. $16 = ($15|0)==(0);
  25676. if ($16) {
  25677. $$030$lcssa = $13;
  25678. break;
  25679. } else {
  25680. $$03039 = $13;
  25681. }
  25682. }
  25683. }
  25684. $17 = Math_imul($2, 16843009)|0;
  25685. $18 = HEAP32[$$030$lcssa>>2]|0;
  25686. $19 = (($18) + -16843009)|0;
  25687. $20 = $18 & -2139062144;
  25688. $21 = $20 ^ -2139062144;
  25689. $22 = $21 & $19;
  25690. $23 = ($22|0)==(0);
  25691. L10: do {
  25692. if ($23) {
  25693. $$02936 = $$030$lcssa;$25 = $18;
  25694. while(1) {
  25695. $24 = $25 ^ $17;
  25696. $26 = (($24) + -16843009)|0;
  25697. $27 = $24 & -2139062144;
  25698. $28 = $27 ^ -2139062144;
  25699. $29 = $28 & $26;
  25700. $30 = ($29|0)==(0);
  25701. if (!($30)) {
  25702. $$029$lcssa = $$02936;
  25703. break L10;
  25704. }
  25705. $31 = ((($$02936)) + 4|0);
  25706. $32 = HEAP32[$31>>2]|0;
  25707. $33 = (($32) + -16843009)|0;
  25708. $34 = $32 & -2139062144;
  25709. $35 = $34 ^ -2139062144;
  25710. $36 = $35 & $33;
  25711. $37 = ($36|0)==(0);
  25712. if ($37) {
  25713. $$02936 = $31;$25 = $32;
  25714. } else {
  25715. $$029$lcssa = $31;
  25716. break;
  25717. }
  25718. }
  25719. } else {
  25720. $$029$lcssa = $$030$lcssa;
  25721. }
  25722. } while(0);
  25723. $38 = $1&255;
  25724. $$1 = $$029$lcssa;
  25725. while(1) {
  25726. $39 = HEAP8[$$1>>0]|0;
  25727. $40 = ($39<<24>>24)==(0);
  25728. $41 = ($39<<24>>24)==($38<<24>>24);
  25729. $or$cond33 = $40 | $41;
  25730. $42 = ((($$1)) + 1|0);
  25731. if ($or$cond33) {
  25732. $$0 = $$1;
  25733. break;
  25734. } else {
  25735. $$1 = $42;
  25736. }
  25737. }
  25738. }
  25739. } while(0);
  25740. return ($$0|0);
  25741. }
  25742. function _strcpy($0,$1) {
  25743. $0 = $0|0;
  25744. $1 = $1|0;
  25745. var label = 0, sp = 0;
  25746. sp = STACKTOP;
  25747. (___stpcpy($0,$1)|0);
  25748. return ($0|0);
  25749. }
  25750. function ___stpcpy($0,$1) {
  25751. $0 = $0|0;
  25752. $1 = $1|0;
  25753. 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;
  25754. 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;
  25755. var $35 = 0, $36 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  25756. sp = STACKTOP;
  25757. $2 = $1;
  25758. $3 = $0;
  25759. $4 = $2 ^ $3;
  25760. $5 = $4 & 3;
  25761. $6 = ($5|0)==(0);
  25762. L1: do {
  25763. if ($6) {
  25764. $7 = $2 & 3;
  25765. $8 = ($7|0)==(0);
  25766. if ($8) {
  25767. $$026$lcssa = $1;$$027$lcssa = $0;
  25768. } else {
  25769. $$02642 = $1;$$02741 = $0;
  25770. while(1) {
  25771. $9 = HEAP8[$$02642>>0]|0;
  25772. HEAP8[$$02741>>0] = $9;
  25773. $10 = ($9<<24>>24)==(0);
  25774. if ($10) {
  25775. $$029 = $$02741;
  25776. break L1;
  25777. }
  25778. $11 = ((($$02642)) + 1|0);
  25779. $12 = ((($$02741)) + 1|0);
  25780. $13 = $11;
  25781. $14 = $13 & 3;
  25782. $15 = ($14|0)==(0);
  25783. if ($15) {
  25784. $$026$lcssa = $11;$$027$lcssa = $12;
  25785. break;
  25786. } else {
  25787. $$02642 = $11;$$02741 = $12;
  25788. }
  25789. }
  25790. }
  25791. $16 = HEAP32[$$026$lcssa>>2]|0;
  25792. $17 = (($16) + -16843009)|0;
  25793. $18 = $16 & -2139062144;
  25794. $19 = $18 ^ -2139062144;
  25795. $20 = $19 & $17;
  25796. $21 = ($20|0)==(0);
  25797. if ($21) {
  25798. $$02536 = $$027$lcssa;$$037 = $$026$lcssa;$24 = $16;
  25799. while(1) {
  25800. $22 = ((($$037)) + 4|0);
  25801. $23 = ((($$02536)) + 4|0);
  25802. HEAP32[$$02536>>2] = $24;
  25803. $25 = HEAP32[$22>>2]|0;
  25804. $26 = (($25) + -16843009)|0;
  25805. $27 = $25 & -2139062144;
  25806. $28 = $27 ^ -2139062144;
  25807. $29 = $28 & $26;
  25808. $30 = ($29|0)==(0);
  25809. if ($30) {
  25810. $$02536 = $23;$$037 = $22;$24 = $25;
  25811. } else {
  25812. $$0$lcssa = $22;$$025$lcssa = $23;
  25813. break;
  25814. }
  25815. }
  25816. } else {
  25817. $$0$lcssa = $$026$lcssa;$$025$lcssa = $$027$lcssa;
  25818. }
  25819. $$1$ph = $$0$lcssa;$$128$ph = $$025$lcssa;
  25820. label = 8;
  25821. } else {
  25822. $$1$ph = $1;$$128$ph = $0;
  25823. label = 8;
  25824. }
  25825. } while(0);
  25826. if ((label|0) == 8) {
  25827. $31 = HEAP8[$$1$ph>>0]|0;
  25828. HEAP8[$$128$ph>>0] = $31;
  25829. $32 = ($31<<24>>24)==(0);
  25830. if ($32) {
  25831. $$029 = $$128$ph;
  25832. } else {
  25833. $$12834 = $$128$ph;$$135 = $$1$ph;
  25834. while(1) {
  25835. $33 = ((($$135)) + 1|0);
  25836. $34 = ((($$12834)) + 1|0);
  25837. $35 = HEAP8[$33>>0]|0;
  25838. HEAP8[$34>>0] = $35;
  25839. $36 = ($35<<24>>24)==(0);
  25840. if ($36) {
  25841. $$029 = $34;
  25842. break;
  25843. } else {
  25844. $$12834 = $34;$$135 = $33;
  25845. }
  25846. }
  25847. }
  25848. }
  25849. return ($$029|0);
  25850. }
  25851. function ___ofl_lock() {
  25852. var label = 0, sp = 0;
  25853. sp = STACKTOP;
  25854. ___lock((33284|0));
  25855. return (33292|0);
  25856. }
  25857. function ___ofl_unlock() {
  25858. var label = 0, sp = 0;
  25859. sp = STACKTOP;
  25860. ___unlock((33284|0));
  25861. return;
  25862. }
  25863. function _fflush($0) {
  25864. $0 = $0|0;
  25865. 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;
  25866. 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;
  25867. sp = STACKTOP;
  25868. $1 = ($0|0)==(0|0);
  25869. do {
  25870. if ($1) {
  25871. $8 = (Atomics_load(HEAP32,780)|0);
  25872. $9 = ($8|0)==(0|0);
  25873. if ($9) {
  25874. $29 = 0;
  25875. } else {
  25876. $10 = (Atomics_load(HEAP32,780)|0);
  25877. $11 = (_fflush($10)|0);
  25878. $29 = $11;
  25879. }
  25880. $12 = (___ofl_lock()|0);
  25881. $$02325 = HEAP32[$12>>2]|0;
  25882. $13 = ($$02325|0)==(0|0);
  25883. if ($13) {
  25884. $$024$lcssa = $29;
  25885. } else {
  25886. $$02327 = $$02325;$$02426 = $29;
  25887. while(1) {
  25888. $14 = ((($$02327)) + 76|0);
  25889. $15 = (Atomics_load(HEAP32,$14>>2)|0);
  25890. $16 = ($15|0)>(-1);
  25891. if ($16) {
  25892. $17 = (___lockfile($$02327)|0);
  25893. $26 = $17;
  25894. } else {
  25895. $26 = 0;
  25896. }
  25897. $18 = ((($$02327)) + 20|0);
  25898. $19 = HEAP32[$18>>2]|0;
  25899. $20 = ((($$02327)) + 28|0);
  25900. $21 = HEAP32[$20>>2]|0;
  25901. $22 = ($19>>>0)>($21>>>0);
  25902. if ($22) {
  25903. $23 = (___fflush_unlocked($$02327)|0);
  25904. $24 = $23 | $$02426;
  25905. $$1 = $24;
  25906. } else {
  25907. $$1 = $$02426;
  25908. }
  25909. $25 = ($26|0)==(0);
  25910. if (!($25)) {
  25911. ___unlockfile($$02327);
  25912. }
  25913. $27 = ((($$02327)) + 56|0);
  25914. $$023 = HEAP32[$27>>2]|0;
  25915. $28 = ($$023|0)==(0|0);
  25916. if ($28) {
  25917. $$024$lcssa = $$1;
  25918. break;
  25919. } else {
  25920. $$02327 = $$023;$$02426 = $$1;
  25921. }
  25922. }
  25923. }
  25924. ___ofl_unlock();
  25925. $$0 = $$024$lcssa;
  25926. } else {
  25927. $2 = ((($0)) + 76|0);
  25928. $3 = (Atomics_load(HEAP32,$2>>2)|0);
  25929. $4 = ($3|0)>(-1);
  25930. if (!($4)) {
  25931. $5 = (___fflush_unlocked($0)|0);
  25932. $$0 = $5;
  25933. break;
  25934. }
  25935. $6 = (___lockfile($0)|0);
  25936. $phitmp = ($6|0)==(0);
  25937. $7 = (___fflush_unlocked($0)|0);
  25938. if ($phitmp) {
  25939. $$0 = $7;
  25940. } else {
  25941. ___unlockfile($0);
  25942. $$0 = $7;
  25943. }
  25944. }
  25945. } while(0);
  25946. return ($$0|0);
  25947. }
  25948. function ___fflush_unlocked($0) {
  25949. $0 = $0|0;
  25950. 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;
  25951. var $9 = 0, label = 0, sp = 0;
  25952. sp = STACKTOP;
  25953. $1 = ((($0)) + 20|0);
  25954. $2 = HEAP32[$1>>2]|0;
  25955. $3 = ((($0)) + 28|0);
  25956. $4 = HEAP32[$3>>2]|0;
  25957. $5 = ($2>>>0)>($4>>>0);
  25958. if ($5) {
  25959. $6 = ((($0)) + 36|0);
  25960. $7 = HEAP32[$6>>2]|0;
  25961. (FUNCTION_TABLE_iiii[$7 & 15]($0,0,0)|0);
  25962. $8 = HEAP32[$1>>2]|0;
  25963. $9 = ($8|0)==(0|0);
  25964. if ($9) {
  25965. $$0 = -1;
  25966. } else {
  25967. label = 3;
  25968. }
  25969. } else {
  25970. label = 3;
  25971. }
  25972. if ((label|0) == 3) {
  25973. $10 = ((($0)) + 4|0);
  25974. $11 = HEAP32[$10>>2]|0;
  25975. $12 = ((($0)) + 8|0);
  25976. $13 = HEAP32[$12>>2]|0;
  25977. $14 = ($11>>>0)<($13>>>0);
  25978. if ($14) {
  25979. $15 = $11;
  25980. $16 = $13;
  25981. $17 = (($15) - ($16))|0;
  25982. $18 = ((($0)) + 40|0);
  25983. $19 = HEAP32[$18>>2]|0;
  25984. (FUNCTION_TABLE_iiii[$19 & 15]($0,$17,1)|0);
  25985. }
  25986. $20 = ((($0)) + 16|0);
  25987. HEAP32[$20>>2] = 0;
  25988. HEAP32[$3>>2] = 0;
  25989. HEAP32[$1>>2] = 0;
  25990. HEAP32[$12>>2] = 0;
  25991. HEAP32[$10>>2] = 0;
  25992. $$0 = 0;
  25993. }
  25994. return ($$0|0);
  25995. }
  25996. function _strstr($0,$1) {
  25997. $0 = $0|0;
  25998. $1 = $1|0;
  25999. 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;
  26000. 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;
  26001. sp = STACKTOP;
  26002. $2 = HEAP8[$1>>0]|0;
  26003. $3 = ($2<<24>>24)==(0);
  26004. do {
  26005. if ($3) {
  26006. $$0 = $0;
  26007. } else {
  26008. $4 = $2 << 24 >> 24;
  26009. $5 = (_strchr($0,$4)|0);
  26010. $6 = ($5|0)==(0|0);
  26011. if ($6) {
  26012. $$0 = 0;
  26013. } else {
  26014. $7 = ((($1)) + 1|0);
  26015. $8 = HEAP8[$7>>0]|0;
  26016. $9 = ($8<<24>>24)==(0);
  26017. if ($9) {
  26018. $$0 = $5;
  26019. } else {
  26020. $10 = ((($5)) + 1|0);
  26021. $11 = HEAP8[$10>>0]|0;
  26022. $12 = ($11<<24>>24)==(0);
  26023. if ($12) {
  26024. $$0 = 0;
  26025. } else {
  26026. $13 = ((($1)) + 2|0);
  26027. $14 = HEAP8[$13>>0]|0;
  26028. $15 = ($14<<24>>24)==(0);
  26029. if ($15) {
  26030. $16 = (_twobyte_strstr($5,$1)|0);
  26031. $$0 = $16;
  26032. break;
  26033. }
  26034. $17 = ((($5)) + 2|0);
  26035. $18 = HEAP8[$17>>0]|0;
  26036. $19 = ($18<<24>>24)==(0);
  26037. if ($19) {
  26038. $$0 = 0;
  26039. } else {
  26040. $20 = ((($1)) + 3|0);
  26041. $21 = HEAP8[$20>>0]|0;
  26042. $22 = ($21<<24>>24)==(0);
  26043. if ($22) {
  26044. $23 = (_threebyte_strstr($5,$1)|0);
  26045. $$0 = $23;
  26046. break;
  26047. }
  26048. $24 = ((($5)) + 3|0);
  26049. $25 = HEAP8[$24>>0]|0;
  26050. $26 = ($25<<24>>24)==(0);
  26051. if ($26) {
  26052. $$0 = 0;
  26053. } else {
  26054. $27 = ((($1)) + 4|0);
  26055. $28 = HEAP8[$27>>0]|0;
  26056. $29 = ($28<<24>>24)==(0);
  26057. if ($29) {
  26058. $30 = (_fourbyte_strstr($5,$1)|0);
  26059. $$0 = $30;
  26060. break;
  26061. } else {
  26062. $31 = (_twoway_strstr($5,$1)|0);
  26063. $$0 = $31;
  26064. break;
  26065. }
  26066. }
  26067. }
  26068. }
  26069. }
  26070. }
  26071. }
  26072. } while(0);
  26073. return ($$0|0);
  26074. }
  26075. function _twobyte_strstr($0,$1) {
  26076. $0 = $0|0;
  26077. $1 = $1|0;
  26078. 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;
  26079. var label = 0, sp = 0;
  26080. sp = STACKTOP;
  26081. $2 = HEAP8[$1>>0]|0;
  26082. $3 = $2&255;
  26083. $4 = $3 << 8;
  26084. $5 = ((($1)) + 1|0);
  26085. $6 = HEAP8[$5>>0]|0;
  26086. $7 = $6&255;
  26087. $8 = $4 | $7;
  26088. $9 = HEAP8[$0>>0]|0;
  26089. $10 = $9&255;
  26090. $$sink$in = $10;$$sink17$sink = $0;
  26091. while(1) {
  26092. $11 = ((($$sink17$sink)) + 1|0);
  26093. $12 = HEAP8[$11>>0]|0;
  26094. $13 = ($12<<24>>24)==(0);
  26095. if ($13) {
  26096. $$lcssa = 0;
  26097. break;
  26098. }
  26099. $$sink = $$sink$in << 8;
  26100. $14 = $12&255;
  26101. $$sink$masked = $$sink & 65280;
  26102. $15 = $14 | $$sink$masked;
  26103. $16 = ($15|0)==($8|0);
  26104. if ($16) {
  26105. $$lcssa = $$sink17$sink;
  26106. break;
  26107. } else {
  26108. $$sink$in = $15;$$sink17$sink = $11;
  26109. }
  26110. }
  26111. return ($$lcssa|0);
  26112. }
  26113. function _threebyte_strstr($0,$1) {
  26114. $0 = $0|0;
  26115. $1 = $1|0;
  26116. 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;
  26117. 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;
  26118. var $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, $or$cond18 = 0, label = 0, sp = 0;
  26119. sp = STACKTOP;
  26120. $2 = HEAP8[$1>>0]|0;
  26121. $3 = $2&255;
  26122. $4 = $3 << 24;
  26123. $5 = ((($1)) + 1|0);
  26124. $6 = HEAP8[$5>>0]|0;
  26125. $7 = $6&255;
  26126. $8 = $7 << 16;
  26127. $9 = $8 | $4;
  26128. $10 = ((($1)) + 2|0);
  26129. $11 = HEAP8[$10>>0]|0;
  26130. $12 = $11&255;
  26131. $13 = $12 << 8;
  26132. $14 = $9 | $13;
  26133. $15 = HEAP8[$0>>0]|0;
  26134. $16 = $15&255;
  26135. $17 = $16 << 24;
  26136. $18 = ((($0)) + 1|0);
  26137. $19 = HEAP8[$18>>0]|0;
  26138. $20 = $19&255;
  26139. $21 = $20 << 16;
  26140. $22 = $21 | $17;
  26141. $23 = ((($0)) + 2|0);
  26142. $24 = HEAP8[$23>>0]|0;
  26143. $25 = $24&255;
  26144. $26 = $25 << 8;
  26145. $27 = $22 | $26;
  26146. $28 = ($24<<24>>24)!=(0);
  26147. $$not17 = $28 ^ 1;
  26148. $29 = ($27|0)==($14|0);
  26149. $or$cond18 = $29 | $$not17;
  26150. if ($or$cond18) {
  26151. $$016$lcssa = $23;$$lcssa = $28;
  26152. } else {
  26153. $$01619 = $23;$$020 = $27;
  26154. while(1) {
  26155. $30 = ((($$01619)) + 1|0);
  26156. $31 = HEAP8[$30>>0]|0;
  26157. $32 = $31&255;
  26158. $33 = $32 | $$020;
  26159. $34 = $33 << 8;
  26160. $35 = ($31<<24>>24)!=(0);
  26161. $$not = $35 ^ 1;
  26162. $36 = ($34|0)==($14|0);
  26163. $or$cond = $36 | $$not;
  26164. if ($or$cond) {
  26165. $$016$lcssa = $30;$$lcssa = $35;
  26166. break;
  26167. } else {
  26168. $$01619 = $30;$$020 = $34;
  26169. }
  26170. }
  26171. }
  26172. $37 = ((($$016$lcssa)) + -2|0);
  26173. $38 = $$lcssa ? $37 : 0;
  26174. return ($38|0);
  26175. }
  26176. function _fourbyte_strstr($0,$1) {
  26177. $0 = $0|0;
  26178. $1 = $1|0;
  26179. 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;
  26180. 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;
  26181. 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;
  26182. sp = STACKTOP;
  26183. $2 = HEAP8[$1>>0]|0;
  26184. $3 = $2&255;
  26185. $4 = $3 << 24;
  26186. $5 = ((($1)) + 1|0);
  26187. $6 = HEAP8[$5>>0]|0;
  26188. $7 = $6&255;
  26189. $8 = $7 << 16;
  26190. $9 = $8 | $4;
  26191. $10 = ((($1)) + 2|0);
  26192. $11 = HEAP8[$10>>0]|0;
  26193. $12 = $11&255;
  26194. $13 = $12 << 8;
  26195. $14 = $9 | $13;
  26196. $15 = ((($1)) + 3|0);
  26197. $16 = HEAP8[$15>>0]|0;
  26198. $17 = $16&255;
  26199. $18 = $14 | $17;
  26200. $19 = HEAP8[$0>>0]|0;
  26201. $20 = $19&255;
  26202. $21 = $20 << 24;
  26203. $22 = ((($0)) + 1|0);
  26204. $23 = HEAP8[$22>>0]|0;
  26205. $24 = $23&255;
  26206. $25 = $24 << 16;
  26207. $26 = $25 | $21;
  26208. $27 = ((($0)) + 2|0);
  26209. $28 = HEAP8[$27>>0]|0;
  26210. $29 = $28&255;
  26211. $30 = $29 << 8;
  26212. $31 = $26 | $30;
  26213. $32 = ((($0)) + 3|0);
  26214. $33 = HEAP8[$32>>0]|0;
  26215. $34 = $33&255;
  26216. $35 = $34 | $31;
  26217. $36 = ($33<<24>>24)!=(0);
  26218. $$not22 = $36 ^ 1;
  26219. $37 = ($35|0)==($18|0);
  26220. $or$cond23 = $37 | $$not22;
  26221. if ($or$cond23) {
  26222. $$lcssa = $36;$$sink21$lcssa = $32;
  26223. } else {
  26224. $$sink2124 = $32;$39 = $35;
  26225. while(1) {
  26226. $38 = $39 << 8;
  26227. $40 = ((($$sink2124)) + 1|0);
  26228. $41 = HEAP8[$40>>0]|0;
  26229. $42 = $41&255;
  26230. $43 = $42 | $38;
  26231. $44 = ($41<<24>>24)!=(0);
  26232. $$not = $44 ^ 1;
  26233. $45 = ($43|0)==($18|0);
  26234. $or$cond = $45 | $$not;
  26235. if ($or$cond) {
  26236. $$lcssa = $44;$$sink21$lcssa = $40;
  26237. break;
  26238. } else {
  26239. $$sink2124 = $40;$39 = $43;
  26240. }
  26241. }
  26242. }
  26243. $46 = ((($$sink21$lcssa)) + -3|0);
  26244. $47 = $$lcssa ? $46 : 0;
  26245. return ($47|0);
  26246. }
  26247. function _twoway_strstr($0,$1) {
  26248. $0 = $0|0;
  26249. $1 = $1|0;
  26250. 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;
  26251. 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;
  26252. 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;
  26253. 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;
  26254. 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;
  26255. 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;
  26256. 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;
  26257. 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;
  26258. 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;
  26259. sp = STACKTOP;
  26260. STACKTOP = STACKTOP + 1056|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(1056|0);
  26261. $2 = sp + 1024|0;
  26262. $3 = sp;
  26263. ;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;
  26264. $4 = HEAP8[$1>>0]|0;
  26265. $cond265 = ($4<<24>>24)==(0);
  26266. L1: do {
  26267. if ($cond265) {
  26268. $$0175$ph$ph$lcssa220323 = 1;$$0185$ph$lcssa322 = -1;$$0187$lcssa320321 = 0;$$1176$ph$ph$lcssa211 = 1;$$1186$ph$lcssa = -1;
  26269. label = 27;
  26270. } else {
  26271. $5 = $4&255;
  26272. $$0187266 = 0;$12 = $4;$20 = $5;
  26273. while(1) {
  26274. $8 = (($0) + ($$0187266)|0);
  26275. $9 = HEAP8[$8>>0]|0;
  26276. $10 = ($9<<24>>24)==(0);
  26277. if ($10) {
  26278. $$3 = 0;
  26279. break L1;
  26280. }
  26281. $11 = $12 & 31;
  26282. $13 = $11&255;
  26283. $14 = 1 << $13;
  26284. $div188 = ($12&255) >>> 5;
  26285. $15 = $div188&255;
  26286. $16 = (($2) + ($15<<2)|0);
  26287. $17 = HEAP32[$16>>2]|0;
  26288. $18 = $17 | $14;
  26289. HEAP32[$16>>2] = $18;
  26290. $7 = (($$0187266) + 1)|0;
  26291. $19 = (($3) + ($20<<2)|0);
  26292. HEAP32[$19>>2] = $7;
  26293. $21 = (($1) + ($7)|0);
  26294. $22 = HEAP8[$21>>0]|0;
  26295. $23 = $22&255;
  26296. $cond = ($22<<24>>24)==(0);
  26297. if ($cond) {
  26298. break;
  26299. } else {
  26300. $$0187266 = $7;$12 = $22;$20 = $23;
  26301. }
  26302. }
  26303. $6 = ($7>>>0)>(1);
  26304. if ($6) {
  26305. $$0183$ph262 = 0;$$0185$ph261 = -1;$129 = 1;
  26306. L7: while(1) {
  26307. $$0175$ph$ph256 = 1;$$0183$ph200$ph255 = $$0183$ph262;$132 = $129;
  26308. while(1) {
  26309. $$0183$ph200250 = $$0183$ph200$ph255;$131 = $132;
  26310. L11: while(1) {
  26311. $$0179244 = 1;$31 = $131;
  26312. while(1) {
  26313. $27 = (($$0179244) + ($$0185$ph261))|0;
  26314. $28 = (($1) + ($27)|0);
  26315. $29 = HEAP8[$28>>0]|0;
  26316. $30 = (($1) + ($31)|0);
  26317. $32 = HEAP8[$30>>0]|0;
  26318. $33 = ($29<<24>>24)==($32<<24>>24);
  26319. if (!($33)) {
  26320. break L11;
  26321. }
  26322. $34 = ($$0179244|0)==($$0175$ph$ph256|0);
  26323. $25 = (($$0179244) + 1)|0;
  26324. if ($34) {
  26325. break;
  26326. }
  26327. $24 = (($25) + ($$0183$ph200250))|0;
  26328. $26 = ($24>>>0)<($7>>>0);
  26329. if ($26) {
  26330. $$0179244 = $25;$31 = $24;
  26331. } else {
  26332. $$0175$ph$ph$lcssa220 = $$0175$ph$ph256;$$0185$ph$lcssa = $$0185$ph261;
  26333. break L7;
  26334. }
  26335. }
  26336. $35 = (($$0175$ph$ph256) + ($$0183$ph200250))|0;
  26337. $36 = (($35) + 1)|0;
  26338. $37 = ($36>>>0)<($7>>>0);
  26339. if ($37) {
  26340. $$0183$ph200250 = $35;$131 = $36;
  26341. } else {
  26342. $$0175$ph$ph$lcssa220 = $$0175$ph$ph256;$$0185$ph$lcssa = $$0185$ph261;
  26343. break L7;
  26344. }
  26345. }
  26346. $38 = ($29&255)>($32&255);
  26347. $39 = (($31) - ($$0185$ph261))|0;
  26348. if (!($38)) {
  26349. break;
  26350. }
  26351. $43 = (($31) + 1)|0;
  26352. $44 = ($43>>>0)<($7>>>0);
  26353. if ($44) {
  26354. $$0175$ph$ph256 = $39;$$0183$ph200$ph255 = $31;$132 = $43;
  26355. } else {
  26356. $$0175$ph$ph$lcssa220 = $39;$$0185$ph$lcssa = $$0185$ph261;
  26357. break L7;
  26358. }
  26359. }
  26360. $40 = (($$0183$ph200250) + 1)|0;
  26361. $41 = (($$0183$ph200250) + 2)|0;
  26362. $42 = ($41>>>0)<($7>>>0);
  26363. if ($42) {
  26364. $$0183$ph262 = $40;$$0185$ph261 = $$0183$ph200250;$129 = $41;
  26365. } else {
  26366. $$0175$ph$ph$lcssa220 = 1;$$0185$ph$lcssa = $$0183$ph200250;
  26367. break;
  26368. }
  26369. }
  26370. if ($6) {
  26371. $$1184$ph241 = 0;$$1186$ph240 = -1;$130 = 1;
  26372. while(1) {
  26373. $$1176$ph$ph235 = 1;$$1184$ph196$ph234 = $$1184$ph241;$134 = $130;
  26374. while(1) {
  26375. $$1184$ph196229 = $$1184$ph196$ph234;$133 = $134;
  26376. L26: while(1) {
  26377. $$1180224 = 1;$52 = $133;
  26378. while(1) {
  26379. $48 = (($$1180224) + ($$1186$ph240))|0;
  26380. $49 = (($1) + ($48)|0);
  26381. $50 = HEAP8[$49>>0]|0;
  26382. $51 = (($1) + ($52)|0);
  26383. $53 = HEAP8[$51>>0]|0;
  26384. $54 = ($50<<24>>24)==($53<<24>>24);
  26385. if (!($54)) {
  26386. break L26;
  26387. }
  26388. $55 = ($$1180224|0)==($$1176$ph$ph235|0);
  26389. $46 = (($$1180224) + 1)|0;
  26390. if ($55) {
  26391. break;
  26392. }
  26393. $45 = (($46) + ($$1184$ph196229))|0;
  26394. $47 = ($45>>>0)<($7>>>0);
  26395. if ($47) {
  26396. $$1180224 = $46;$52 = $45;
  26397. } else {
  26398. $$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;
  26399. label = 27;
  26400. break L1;
  26401. }
  26402. }
  26403. $56 = (($$1176$ph$ph235) + ($$1184$ph196229))|0;
  26404. $57 = (($56) + 1)|0;
  26405. $58 = ($57>>>0)<($7>>>0);
  26406. if ($58) {
  26407. $$1184$ph196229 = $56;$133 = $57;
  26408. } else {
  26409. $$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;
  26410. label = 27;
  26411. break L1;
  26412. }
  26413. }
  26414. $59 = ($50&255)<($53&255);
  26415. $60 = (($52) - ($$1186$ph240))|0;
  26416. if (!($59)) {
  26417. break;
  26418. }
  26419. $64 = (($52) + 1)|0;
  26420. $65 = ($64>>>0)<($7>>>0);
  26421. if ($65) {
  26422. $$1176$ph$ph235 = $60;$$1184$ph196$ph234 = $52;$134 = $64;
  26423. } else {
  26424. $$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;
  26425. label = 27;
  26426. break L1;
  26427. }
  26428. }
  26429. $61 = (($$1184$ph196229) + 1)|0;
  26430. $62 = (($$1184$ph196229) + 2)|0;
  26431. $63 = ($62>>>0)<($7>>>0);
  26432. if ($63) {
  26433. $$1184$ph241 = $61;$$1186$ph240 = $$1184$ph196229;$130 = $62;
  26434. } else {
  26435. $$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;
  26436. label = 27;
  26437. break;
  26438. }
  26439. }
  26440. } else {
  26441. $$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;
  26442. label = 27;
  26443. }
  26444. } else {
  26445. $$0175$ph$ph$lcssa220323 = 1;$$0185$ph$lcssa322 = -1;$$0187$lcssa320321 = $7;$$1176$ph$ph$lcssa211 = 1;$$1186$ph$lcssa = -1;
  26446. label = 27;
  26447. }
  26448. }
  26449. } while(0);
  26450. L36: do {
  26451. if ((label|0) == 27) {
  26452. $66 = (($$1186$ph$lcssa) + 1)|0;
  26453. $67 = (($$0185$ph$lcssa322) + 1)|0;
  26454. $68 = ($66>>>0)>($67>>>0);
  26455. $$1176$$0175 = $68 ? $$1176$ph$ph$lcssa211 : $$0175$ph$ph$lcssa220323;
  26456. $$1186$$0185 = $68 ? $$1186$ph$lcssa : $$0185$ph$lcssa322;
  26457. $69 = (($1) + ($$1176$$0175)|0);
  26458. $70 = (($$1186$$0185) + 1)|0;
  26459. $71 = (_memcmp($1,$69,$70)|0);
  26460. $72 = ($71|0)==(0);
  26461. if ($72) {
  26462. $77 = (($$0187$lcssa320321) - ($$1176$$0175))|0;
  26463. $$0168 = $77;$$3178 = $$1176$$0175;
  26464. } else {
  26465. $73 = (($$0187$lcssa320321) - ($$1186$$0185))|0;
  26466. $74 = (($73) + -1)|0;
  26467. $75 = ($$1186$$0185>>>0)>($74>>>0);
  26468. $$1186$$0185$ = $75 ? $$1186$$0185 : $74;
  26469. $76 = (($$1186$$0185$) + 1)|0;
  26470. $$0168 = 0;$$3178 = $76;
  26471. }
  26472. $78 = $$0187$lcssa320321 | 63;
  26473. $79 = (($$0187$lcssa320321) + -1)|0;
  26474. $80 = ($$0168|0)!=(0);
  26475. $81 = (($$0187$lcssa320321) - ($$3178))|0;
  26476. $$0166 = $0;$$0169 = 0;$$0170 = $0;
  26477. while(1) {
  26478. $82 = $$0170;
  26479. $83 = $$0166;
  26480. $84 = (($82) - ($83))|0;
  26481. $85 = ($84>>>0)<($$0187$lcssa320321>>>0);
  26482. do {
  26483. if ($85) {
  26484. $86 = (_memchr($$0170,0,$78)|0);
  26485. $87 = ($86|0)==(0|0);
  26486. if ($87) {
  26487. $91 = (($$0170) + ($78)|0);
  26488. $$3173 = $91;
  26489. break;
  26490. } else {
  26491. $88 = $86;
  26492. $89 = (($88) - ($83))|0;
  26493. $90 = ($89>>>0)<($$0187$lcssa320321>>>0);
  26494. if ($90) {
  26495. $$3 = 0;
  26496. break L36;
  26497. } else {
  26498. $$3173 = $86;
  26499. break;
  26500. }
  26501. }
  26502. } else {
  26503. $$3173 = $$0170;
  26504. }
  26505. } while(0);
  26506. $92 = (($$0166) + ($79)|0);
  26507. $93 = HEAP8[$92>>0]|0;
  26508. $div = ($93&255) >>> 5;
  26509. $94 = $div&255;
  26510. $95 = (($2) + ($94<<2)|0);
  26511. $96 = HEAP32[$95>>2]|0;
  26512. $97 = $93 & 31;
  26513. $98 = $97&255;
  26514. $99 = 1 << $98;
  26515. $100 = $99 & $96;
  26516. $101 = ($100|0)==(0);
  26517. L50: do {
  26518. if ($101) {
  26519. $$0169$be = 0;$$2181$sink = $$0187$lcssa320321;
  26520. } else {
  26521. $102 = $93&255;
  26522. $103 = (($3) + ($102<<2)|0);
  26523. $104 = HEAP32[$103>>2]|0;
  26524. $105 = (($$0187$lcssa320321) - ($104))|0;
  26525. $106 = ($105|0)==(0);
  26526. if (!($106)) {
  26527. $107 = ($$0169|0)!=(0);
  26528. $or$cond = $80 & $107;
  26529. $108 = ($105>>>0)<($$3178>>>0);
  26530. $or$cond190 = $or$cond & $108;
  26531. $$2181 = $or$cond190 ? $81 : $105;
  26532. $$0169$be = 0;$$2181$sink = $$2181;
  26533. break;
  26534. }
  26535. $110 = ($70>>>0)>($$0169>>>0);
  26536. $111 = $110 ? $70 : $$0169;
  26537. $112 = (($1) + ($111)|0);
  26538. $113 = HEAP8[$112>>0]|0;
  26539. $cond191222 = ($113<<24>>24)==(0);
  26540. L55: do {
  26541. if ($cond191222) {
  26542. $$4 = $70;
  26543. } else {
  26544. $$3182223 = $111;$117 = $113;
  26545. while(1) {
  26546. $114 = (($$0166) + ($$3182223)|0);
  26547. $115 = HEAP8[$114>>0]|0;
  26548. $116 = ($117<<24>>24)==($115<<24>>24);
  26549. if (!($116)) {
  26550. break;
  26551. }
  26552. $118 = (($$3182223) + 1)|0;
  26553. $119 = (($1) + ($118)|0);
  26554. $120 = HEAP8[$119>>0]|0;
  26555. $cond191 = ($120<<24>>24)==(0);
  26556. if ($cond191) {
  26557. $$4 = $70;
  26558. break L55;
  26559. } else {
  26560. $$3182223 = $118;$117 = $120;
  26561. }
  26562. }
  26563. $121 = (($$3182223) - ($$1186$$0185))|0;
  26564. $$0169$be = 0;$$2181$sink = $121;
  26565. break L50;
  26566. }
  26567. } while(0);
  26568. while(1) {
  26569. $122 = ($$4>>>0)>($$0169>>>0);
  26570. if (!($122)) {
  26571. $$3 = $$0166;
  26572. break L36;
  26573. }
  26574. $123 = (($$4) + -1)|0;
  26575. $124 = (($1) + ($123)|0);
  26576. $125 = HEAP8[$124>>0]|0;
  26577. $126 = (($$0166) + ($123)|0);
  26578. $127 = HEAP8[$126>>0]|0;
  26579. $128 = ($125<<24>>24)==($127<<24>>24);
  26580. if ($128) {
  26581. $$4 = $123;
  26582. } else {
  26583. $$0169$be = $$0168;$$2181$sink = $$3178;
  26584. break;
  26585. }
  26586. }
  26587. }
  26588. } while(0);
  26589. $109 = (($$0166) + ($$2181$sink)|0);
  26590. $$0166 = $109;$$0169 = $$0169$be;$$0170 = $$3173;
  26591. }
  26592. }
  26593. } while(0);
  26594. STACKTOP = sp;return ($$3|0);
  26595. }
  26596. function _strspn($0,$1) {
  26597. $0 = $0|0;
  26598. $1 = $1|0;
  26599. 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;
  26600. 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;
  26601. var $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $div = 0, $div21 = 0, label = 0, sp = 0;
  26602. sp = STACKTOP;
  26603. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  26604. $2 = sp;
  26605. ;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;
  26606. $3 = HEAP8[$1>>0]|0;
  26607. $4 = ($3<<24>>24)==(0);
  26608. do {
  26609. if ($4) {
  26610. $$0 = 0;
  26611. } else {
  26612. $5 = ((($1)) + 1|0);
  26613. $6 = HEAP8[$5>>0]|0;
  26614. $7 = ($6<<24>>24)==(0);
  26615. if ($7) {
  26616. $$020 = $0;
  26617. while(1) {
  26618. $8 = HEAP8[$$020>>0]|0;
  26619. $9 = ($8<<24>>24)==($3<<24>>24);
  26620. $10 = ((($$020)) + 1|0);
  26621. if ($9) {
  26622. $$020 = $10;
  26623. } else {
  26624. break;
  26625. }
  26626. }
  26627. $11 = $$020;
  26628. $12 = $0;
  26629. $13 = (($11) - ($12))|0;
  26630. $$0 = $13;
  26631. break;
  26632. } else {
  26633. $$01925 = $1;$17 = $3;
  26634. }
  26635. while(1) {
  26636. $16 = $17 & 31;
  26637. $18 = $16&255;
  26638. $19 = 1 << $18;
  26639. $div21 = ($17&255) >>> 5;
  26640. $20 = $div21&255;
  26641. $21 = (($2) + ($20<<2)|0);
  26642. $22 = HEAP32[$21>>2]|0;
  26643. $23 = $22 | $19;
  26644. HEAP32[$21>>2] = $23;
  26645. $24 = ((($$01925)) + 1|0);
  26646. $25 = HEAP8[$24>>0]|0;
  26647. $26 = ($25<<24>>24)==(0);
  26648. if ($26) {
  26649. break;
  26650. } else {
  26651. $$01925 = $24;$17 = $25;
  26652. }
  26653. }
  26654. $14 = HEAP8[$0>>0]|0;
  26655. $15 = ($14<<24>>24)==(0);
  26656. L10: do {
  26657. if ($15) {
  26658. $$1$lcssa = $0;
  26659. } else {
  26660. $$123 = $0;$27 = $14;
  26661. while(1) {
  26662. $div = ($27&255) >>> 5;
  26663. $28 = $div&255;
  26664. $29 = (($2) + ($28<<2)|0);
  26665. $30 = HEAP32[$29>>2]|0;
  26666. $31 = $27 & 31;
  26667. $32 = $31&255;
  26668. $33 = 1 << $32;
  26669. $34 = $30 & $33;
  26670. $35 = ($34|0)==(0);
  26671. if ($35) {
  26672. $$1$lcssa = $$123;
  26673. break L10;
  26674. }
  26675. $36 = ((($$123)) + 1|0);
  26676. $37 = HEAP8[$36>>0]|0;
  26677. $38 = ($37<<24>>24)==(0);
  26678. if ($38) {
  26679. $$1$lcssa = $36;
  26680. break;
  26681. } else {
  26682. $$123 = $36;$27 = $37;
  26683. }
  26684. }
  26685. }
  26686. } while(0);
  26687. $39 = $$1$lcssa;
  26688. $40 = $0;
  26689. $41 = (($39) - ($40))|0;
  26690. $$0 = $41;
  26691. }
  26692. } while(0);
  26693. STACKTOP = sp;return ($$0|0);
  26694. }
  26695. function _srand($0) {
  26696. $0 = $0|0;
  26697. var $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, label = 0, sp = 0;
  26698. sp = STACKTOP;
  26699. $1 = (($0) + -1)|0;
  26700. $2 = 14256;
  26701. $3 = $2;
  26702. HEAP32[$3>>2] = $1;
  26703. $4 = (($2) + 4)|0;
  26704. $5 = $4;
  26705. HEAP32[$5>>2] = 0;
  26706. return;
  26707. }
  26708. function _vprintf($0,$1) {
  26709. $0 = $0|0;
  26710. $1 = $1|0;
  26711. var $2 = 0, $3 = 0, label = 0, sp = 0;
  26712. sp = STACKTOP;
  26713. $2 = HEAP32[748]|0;
  26714. $3 = (_vfprintf($2,$0,$1)|0);
  26715. return ($3|0);
  26716. }
  26717. function _strcspn($0,$1) {
  26718. $0 = $0|0;
  26719. $1 = $1|0;
  26720. 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;
  26721. 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;
  26722. var $div20 = 0, label = 0, sp = 0;
  26723. sp = STACKTOP;
  26724. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  26725. $2 = sp;
  26726. $3 = HEAP8[$1>>0]|0;
  26727. $4 = ($3<<24>>24)==(0);
  26728. L1: do {
  26729. if ($4) {
  26730. label = 3;
  26731. } else {
  26732. $5 = ((($1)) + 1|0);
  26733. $6 = HEAP8[$5>>0]|0;
  26734. $7 = ($6<<24>>24)==(0);
  26735. if ($7) {
  26736. label = 3;
  26737. } else {
  26738. ;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;
  26739. $$01824 = $1;$13 = $3;
  26740. while(1) {
  26741. $12 = $13 & 31;
  26742. $14 = $12&255;
  26743. $15 = 1 << $14;
  26744. $div20 = ($13&255) >>> 5;
  26745. $16 = $div20&255;
  26746. $17 = (($2) + ($16<<2)|0);
  26747. $18 = HEAP32[$17>>2]|0;
  26748. $19 = $18 | $15;
  26749. HEAP32[$17>>2] = $19;
  26750. $20 = ((($$01824)) + 1|0);
  26751. $21 = HEAP8[$20>>0]|0;
  26752. $22 = ($21<<24>>24)==(0);
  26753. if ($22) {
  26754. break;
  26755. } else {
  26756. $$01824 = $20;$13 = $21;
  26757. }
  26758. }
  26759. $10 = HEAP8[$0>>0]|0;
  26760. $11 = ($10<<24>>24)==(0);
  26761. if ($11) {
  26762. $$019$sink = $0;
  26763. } else {
  26764. $$01922 = $0;$23 = $10;
  26765. while(1) {
  26766. $div = ($23&255) >>> 5;
  26767. $24 = $div&255;
  26768. $25 = (($2) + ($24<<2)|0);
  26769. $26 = HEAP32[$25>>2]|0;
  26770. $27 = $23 & 31;
  26771. $28 = $27&255;
  26772. $29 = 1 << $28;
  26773. $30 = $26 & $29;
  26774. $31 = ($30|0)==(0);
  26775. if (!($31)) {
  26776. $$019$sink = $$01922;
  26777. break L1;
  26778. }
  26779. $32 = ((($$01922)) + 1|0);
  26780. $33 = HEAP8[$32>>0]|0;
  26781. $34 = ($33<<24>>24)==(0);
  26782. if ($34) {
  26783. $$019$sink = $32;
  26784. break;
  26785. } else {
  26786. $$01922 = $32;$23 = $33;
  26787. }
  26788. }
  26789. }
  26790. }
  26791. }
  26792. } while(0);
  26793. if ((label|0) == 3) {
  26794. $8 = $3 << 24 >> 24;
  26795. $9 = (___strchrnul($0,$8)|0);
  26796. $$019$sink = $9;
  26797. }
  26798. $35 = $$019$sink;
  26799. $36 = $0;
  26800. $37 = (($35) - ($36))|0;
  26801. STACKTOP = sp;return ($37|0);
  26802. }
  26803. function _strcat($0,$1) {
  26804. $0 = $0|0;
  26805. $1 = $1|0;
  26806. var $2 = 0, $3 = 0, label = 0, sp = 0;
  26807. sp = STACKTOP;
  26808. $2 = (_strlen($0)|0);
  26809. $3 = (($0) + ($2)|0);
  26810. (_strcpy($3,$1)|0);
  26811. return ($0|0);
  26812. }
  26813. function _strtok($0,$1) {
  26814. $0 = $0|0;
  26815. $1 = $1|0;
  26816. 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;
  26817. sp = STACKTOP;
  26818. $2 = ($0|0)==(0|0);
  26819. if ($2) {
  26820. $3 = HEAP32[8324]|0;
  26821. $4 = ($3|0)==(0|0);
  26822. if ($4) {
  26823. $$0 = 0;
  26824. } else {
  26825. $$010 = $3;
  26826. label = 3;
  26827. }
  26828. } else {
  26829. $$010 = $0;
  26830. label = 3;
  26831. }
  26832. do {
  26833. if ((label|0) == 3) {
  26834. $5 = (_strspn($$010,$1)|0);
  26835. $6 = (($$010) + ($5)|0);
  26836. $7 = HEAP8[$6>>0]|0;
  26837. $8 = ($7<<24>>24)==(0);
  26838. if ($8) {
  26839. HEAP32[8324] = 0;
  26840. $$0 = 0;
  26841. break;
  26842. }
  26843. $9 = (_strcspn($6,$1)|0);
  26844. $10 = (($6) + ($9)|0);
  26845. HEAP32[8324] = $10;
  26846. $11 = HEAP8[$10>>0]|0;
  26847. $12 = ($11<<24>>24)==(0);
  26848. if ($12) {
  26849. HEAP32[8324] = 0;
  26850. $$0 = $6;
  26851. break;
  26852. } else {
  26853. $13 = ((($10)) + 1|0);
  26854. HEAP32[8324] = $13;
  26855. HEAP8[$10>>0] = 0;
  26856. $$0 = $6;
  26857. break;
  26858. }
  26859. }
  26860. } while(0);
  26861. return ($$0|0);
  26862. }
  26863. function __emscripten_atomic_fetch_and_add_u64($0,$1,$2) {
  26864. $0 = $0|0;
  26865. $1 = $1|0;
  26866. $2 = $2|0;
  26867. 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;
  26868. var $9 = 0, label = 0, sp = 0;
  26869. sp = STACKTOP;
  26870. $3 = $0;
  26871. $4 = $3 >>> 3;
  26872. $5 = $4 & 255;
  26873. $6 = (34372 + ($5<<2)|0);
  26874. while(1) {
  26875. while(1) {
  26876. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  26877. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  26878. $9 = ($7|0)==($8|0);
  26879. if ($9) {
  26880. break;
  26881. }
  26882. }
  26883. $10 = ($7|0)==(0);
  26884. if ($10) {
  26885. break;
  26886. }
  26887. }
  26888. $11 = $0;
  26889. $12 = $11;
  26890. $13 = HEAP32[$12>>2]|0;
  26891. $14 = (($11) + 4)|0;
  26892. $15 = $14;
  26893. $16 = HEAP32[$15>>2]|0;
  26894. $17 = (_i64Add(($13|0),($16|0),($1|0),($2|0))|0);
  26895. $18 = tempRet0;
  26896. $19 = $0;
  26897. $20 = $19;
  26898. HEAP32[$20>>2] = $17;
  26899. $21 = (($19) + 4)|0;
  26900. $22 = $21;
  26901. HEAP32[$22>>2] = $18;
  26902. $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  26903. tempRet0 = ($16);
  26904. return ($13|0);
  26905. }
  26906. function __emscripten_atomic_fetch_and_and_u64($0,$1,$2) {
  26907. $0 = $0|0;
  26908. $1 = $1|0;
  26909. $2 = $2|0;
  26910. 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;
  26911. var $9 = 0, label = 0, sp = 0;
  26912. sp = STACKTOP;
  26913. $3 = $0;
  26914. $4 = $3 >>> 3;
  26915. $5 = $4 & 255;
  26916. $6 = (34372 + ($5<<2)|0);
  26917. while(1) {
  26918. while(1) {
  26919. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  26920. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  26921. $9 = ($7|0)==($8|0);
  26922. if ($9) {
  26923. break;
  26924. }
  26925. }
  26926. $10 = ($7|0)==(0);
  26927. if ($10) {
  26928. break;
  26929. }
  26930. }
  26931. $11 = $0;
  26932. $12 = $11;
  26933. $13 = HEAP32[$12>>2]|0;
  26934. $14 = (($11) + 4)|0;
  26935. $15 = $14;
  26936. $16 = HEAP32[$15>>2]|0;
  26937. $17 = $13 & $1;
  26938. $18 = $16 & $2;
  26939. $19 = $0;
  26940. $20 = $19;
  26941. HEAP32[$20>>2] = $17;
  26942. $21 = (($19) + 4)|0;
  26943. $22 = $21;
  26944. HEAP32[$22>>2] = $18;
  26945. $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  26946. tempRet0 = ($16);
  26947. return ($13|0);
  26948. }
  26949. function __emscripten_atomic_fetch_and_or_u64($0,$1,$2) {
  26950. $0 = $0|0;
  26951. $1 = $1|0;
  26952. $2 = $2|0;
  26953. 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;
  26954. var $9 = 0, label = 0, sp = 0;
  26955. sp = STACKTOP;
  26956. $3 = $0;
  26957. $4 = $3 >>> 3;
  26958. $5 = $4 & 255;
  26959. $6 = (34372 + ($5<<2)|0);
  26960. while(1) {
  26961. while(1) {
  26962. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  26963. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  26964. $9 = ($7|0)==($8|0);
  26965. if ($9) {
  26966. break;
  26967. }
  26968. }
  26969. $10 = ($7|0)==(0);
  26970. if ($10) {
  26971. break;
  26972. }
  26973. }
  26974. $11 = $0;
  26975. $12 = $11;
  26976. $13 = HEAP32[$12>>2]|0;
  26977. $14 = (($11) + 4)|0;
  26978. $15 = $14;
  26979. $16 = HEAP32[$15>>2]|0;
  26980. $17 = $13 | $1;
  26981. $18 = $16 | $2;
  26982. $19 = $0;
  26983. $20 = $19;
  26984. HEAP32[$20>>2] = $17;
  26985. $21 = (($19) + 4)|0;
  26986. $22 = $21;
  26987. HEAP32[$22>>2] = $18;
  26988. $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  26989. tempRet0 = ($16);
  26990. return ($13|0);
  26991. }
  26992. function __emscripten_atomic_fetch_and_sub_u64($0,$1,$2) {
  26993. $0 = $0|0;
  26994. $1 = $1|0;
  26995. $2 = $2|0;
  26996. 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;
  26997. var $9 = 0, label = 0, sp = 0;
  26998. sp = STACKTOP;
  26999. $3 = $0;
  27000. $4 = $3 >>> 3;
  27001. $5 = $4 & 255;
  27002. $6 = (34372 + ($5<<2)|0);
  27003. while(1) {
  27004. while(1) {
  27005. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  27006. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  27007. $9 = ($7|0)==($8|0);
  27008. if ($9) {
  27009. break;
  27010. }
  27011. }
  27012. $10 = ($7|0)==(0);
  27013. if ($10) {
  27014. break;
  27015. }
  27016. }
  27017. $11 = $0;
  27018. $12 = $11;
  27019. $13 = HEAP32[$12>>2]|0;
  27020. $14 = (($11) + 4)|0;
  27021. $15 = $14;
  27022. $16 = HEAP32[$15>>2]|0;
  27023. $17 = (_i64Subtract(($13|0),($16|0),($1|0),($2|0))|0);
  27024. $18 = tempRet0;
  27025. $19 = $0;
  27026. $20 = $19;
  27027. HEAP32[$20>>2] = $17;
  27028. $21 = (($19) + 4)|0;
  27029. $22 = $21;
  27030. HEAP32[$22>>2] = $18;
  27031. $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  27032. tempRet0 = ($16);
  27033. return ($13|0);
  27034. }
  27035. function __emscripten_atomic_fetch_and_xor_u64($0,$1,$2) {
  27036. $0 = $0|0;
  27037. $1 = $1|0;
  27038. $2 = $2|0;
  27039. 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;
  27040. var $9 = 0, label = 0, sp = 0;
  27041. sp = STACKTOP;
  27042. $3 = $0;
  27043. $4 = $3 >>> 3;
  27044. $5 = $4 & 255;
  27045. $6 = (34372 + ($5<<2)|0);
  27046. while(1) {
  27047. while(1) {
  27048. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  27049. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  27050. $9 = ($7|0)==($8|0);
  27051. if ($9) {
  27052. break;
  27053. }
  27054. }
  27055. $10 = ($7|0)==(0);
  27056. if ($10) {
  27057. break;
  27058. }
  27059. }
  27060. $11 = $0;
  27061. $12 = $11;
  27062. $13 = HEAP32[$12>>2]|0;
  27063. $14 = (($11) + 4)|0;
  27064. $15 = $14;
  27065. $16 = HEAP32[$15>>2]|0;
  27066. $17 = $13 ^ $1;
  27067. $18 = $16 ^ $2;
  27068. $19 = $0;
  27069. $20 = $19;
  27070. HEAP32[$20>>2] = $17;
  27071. $21 = (($19) + 4)|0;
  27072. $22 = $21;
  27073. HEAP32[$22>>2] = $18;
  27074. $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  27075. tempRet0 = ($16);
  27076. return ($13|0);
  27077. }
  27078. function _emscripten_async_run_in_main_thread($0) {
  27079. $0 = $0|0;
  27080. 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;
  27081. var $9 = 0, $call_queue$init$val = 0, $call_queue$init$val$pre_trunc = 0, label = 0, sp = 0;
  27082. sp = STACKTOP;
  27083. $1 = ($0|0)==(0|0);
  27084. if ($1) {
  27085. ___assert_fail((13864|0),(13696|0),260,(13869|0));
  27086. // unreachable;
  27087. }
  27088. $2 = (_emscripten_is_main_runtime_thread()|0);
  27089. $3 = ($2|0)==(0);
  27090. if (!($3)) {
  27091. __do_call($0);
  27092. return;
  27093. }
  27094. (___pthread_mutex_lock(33816)|0);
  27095. $call_queue$init$val$pre_trunc = HEAP8[38331]|0;
  27096. $call_queue$init$val = $call_queue$init$val$pre_trunc&1;
  27097. if (!($call_queue$init$val)) {
  27098. $$expand_i1_val = 1;
  27099. HEAP8[38331] = $$expand_i1_val;
  27100. }
  27101. $4 = (Atomics_load(HEAP32, 8461)|0);
  27102. $5 = (Atomics_load(HEAP32, 8462)|0);
  27103. $$0$in19 = (($5) + 1)|0;
  27104. $$020 = (($$0$in19|0) % 128)&-1;
  27105. $6 = ($$020|0)==($4|0);
  27106. if ($6) {
  27107. $7 = $4;
  27108. while(1) {
  27109. (___pthread_mutex_unlock(33816)|0);
  27110. (_emscripten_futex_wait((33844|0),($7|0),inf)|0);
  27111. (___pthread_mutex_lock(33816)|0);
  27112. $8 = (Atomics_load(HEAP32, 8461)|0);
  27113. $9 = (Atomics_load(HEAP32, 8462)|0);
  27114. $$0$in = (($9) + 1)|0;
  27115. $$0 = (($$0$in|0) % 128)&-1;
  27116. $10 = ($$0|0)==($8|0);
  27117. if ($10) {
  27118. $7 = $8;
  27119. } else {
  27120. $$0$lcssa = $$0;$$lcssa = $9;$$lcssa18 = $8;
  27121. break;
  27122. }
  27123. }
  27124. } else {
  27125. $$0$lcssa = $$020;$$lcssa = $5;$$lcssa18 = $4;
  27126. }
  27127. $11 = (33852 + ($$lcssa<<2)|0);
  27128. HEAP32[$11>>2] = $0;
  27129. $12 = ($$lcssa18|0)==($$lcssa|0);
  27130. if ($12) {
  27131. _emscripten_asm_const_v(1);
  27132. }
  27133. $13 = (Atomics_store(HEAP32, 8462, $$0$lcssa)|0);
  27134. (___pthread_mutex_unlock(33816)|0);
  27135. return;
  27136. }
  27137. function _emscripten_atomic_add_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 = (34372 + ($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 = (_i64Add(($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 = ($18);
  27178. return ($17|0);
  27179. }
  27180. function _emscripten_atomic_and_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 = (34372 + ($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 = ($18);
  27221. return ($17|0);
  27222. }
  27223. function _emscripten_atomic_cas_u64($0,$1,$2,$3,$4) {
  27224. $0 = $0|0;
  27225. $1 = $1|0;
  27226. $2 = $2|0;
  27227. $3 = $3|0;
  27228. $4 = $4|0;
  27229. 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;
  27230. var $8 = 0, $9 = 0, label = 0, sp = 0;
  27231. sp = STACKTOP;
  27232. $5 = $0;
  27233. $6 = $5 >>> 3;
  27234. $7 = $6 & 255;
  27235. $8 = (34372 + ($7<<2)|0);
  27236. while(1) {
  27237. while(1) {
  27238. $9 = (Atomics_load(HEAP32, $8>>2)|0);
  27239. $10 = (Atomics_compareExchange(HEAP32, $8>>2, $9, 1)|0);
  27240. $11 = ($9|0)==($10|0);
  27241. if ($11) {
  27242. break;
  27243. }
  27244. }
  27245. $12 = ($9|0)==(0);
  27246. if ($12) {
  27247. break;
  27248. }
  27249. }
  27250. $13 = $0;
  27251. $14 = $13;
  27252. $15 = HEAP32[$14>>2]|0;
  27253. $16 = (($13) + 4)|0;
  27254. $17 = $16;
  27255. $18 = HEAP32[$17>>2]|0;
  27256. $19 = ($15|0)==($1|0);
  27257. $20 = ($18|0)==($2|0);
  27258. $21 = $19 & $20;
  27259. if (!($21)) {
  27260. $26 = (Atomics_store(HEAP32, $8>>2, 0)|0);
  27261. tempRet0 = ($18);
  27262. return ($15|0);
  27263. }
  27264. $22 = $0;
  27265. $23 = $22;
  27266. HEAP32[$23>>2] = $3;
  27267. $24 = (($22) + 4)|0;
  27268. $25 = $24;
  27269. HEAP32[$25>>2] = $4;
  27270. $26 = (Atomics_store(HEAP32, $8>>2, 0)|0);
  27271. tempRet0 = ($18);
  27272. return ($15|0);
  27273. }
  27274. function _emscripten_atomic_exchange_u32($0,$1) {
  27275. $0 = $0|0;
  27276. $1 = $1|0;
  27277. var $2 = 0, $3 = 0, $4 = 0, label = 0, sp = 0;
  27278. sp = STACKTOP;
  27279. while(1) {
  27280. $2 = (Atomics_load(HEAP32, $0>>2)|0);
  27281. $3 = (Atomics_compareExchange(HEAP32, $0>>2, $2, $1)|0);
  27282. $4 = ($2|0)==($3|0);
  27283. if ($4) {
  27284. break;
  27285. }
  27286. }
  27287. return ($2|0);
  27288. }
  27289. function _emscripten_atomic_exchange_u64($0,$1,$2) {
  27290. $0 = $0|0;
  27291. $1 = $1|0;
  27292. $2 = $2|0;
  27293. 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;
  27294. var sp = 0;
  27295. sp = STACKTOP;
  27296. $3 = $0;
  27297. $4 = $3 >>> 3;
  27298. $5 = $4 & 255;
  27299. $6 = (34372 + ($5<<2)|0);
  27300. while(1) {
  27301. while(1) {
  27302. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  27303. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  27304. $9 = ($7|0)==($8|0);
  27305. if ($9) {
  27306. break;
  27307. }
  27308. }
  27309. $10 = ($7|0)==(0);
  27310. if ($10) {
  27311. break;
  27312. }
  27313. }
  27314. $11 = $0;
  27315. $12 = $11;
  27316. $13 = HEAP32[$12>>2]|0;
  27317. $14 = (($11) + 4)|0;
  27318. $15 = $14;
  27319. $16 = HEAP32[$15>>2]|0;
  27320. $17 = $0;
  27321. $18 = $17;
  27322. HEAP32[$18>>2] = $1;
  27323. $19 = (($17) + 4)|0;
  27324. $20 = $19;
  27325. HEAP32[$20>>2] = $2;
  27326. $21 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  27327. tempRet0 = ($16);
  27328. return ($13|0);
  27329. }
  27330. function _emscripten_atomic_load_f32($0) {
  27331. $0 = $0|0;
  27332. var $1 = 0, $2 = 0.0, label = 0, sp = 0;
  27333. sp = STACKTOP;
  27334. $1 = (Atomics_load(HEAP32, $0>>2)|0);
  27335. $2 = (HEAP32[tempDoublePtr>>2]=$1,+HEAPF32[tempDoublePtr>>2]);
  27336. return (+$2);
  27337. }
  27338. function _emscripten_atomic_load_f64($0) {
  27339. $0 = $0|0;
  27340. 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;
  27341. sp = STACKTOP;
  27342. $1 = $0;
  27343. $2 = $1 >>> 3;
  27344. $3 = $2 & 255;
  27345. $4 = (34372 + ($3<<2)|0);
  27346. while(1) {
  27347. while(1) {
  27348. $5 = (Atomics_load(HEAP32, $4>>2)|0);
  27349. $6 = (Atomics_compareExchange(HEAP32, $4>>2, $5, 1)|0);
  27350. $7 = ($5|0)==($6|0);
  27351. if ($7) {
  27352. break;
  27353. }
  27354. }
  27355. $8 = ($5|0)==(0);
  27356. if ($8) {
  27357. break;
  27358. }
  27359. }
  27360. $9 = +HEAPF64[$0>>3];
  27361. $10 = (Atomics_store(HEAP32, $4>>2, 0)|0);
  27362. return (+$9);
  27363. }
  27364. function _emscripten_atomic_load_u64($0) {
  27365. $0 = $0|0;
  27366. 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;
  27367. sp = STACKTOP;
  27368. $1 = $0;
  27369. $2 = $1 >>> 3;
  27370. $3 = $2 & 255;
  27371. $4 = (34372 + ($3<<2)|0);
  27372. while(1) {
  27373. while(1) {
  27374. $5 = (Atomics_load(HEAP32, $4>>2)|0);
  27375. $6 = (Atomics_compareExchange(HEAP32, $4>>2, $5, 1)|0);
  27376. $7 = ($5|0)==($6|0);
  27377. if ($7) {
  27378. break;
  27379. }
  27380. }
  27381. $8 = ($5|0)==(0);
  27382. if ($8) {
  27383. break;
  27384. }
  27385. }
  27386. $9 = $0;
  27387. $10 = $9;
  27388. $11 = HEAP32[$10>>2]|0;
  27389. $12 = (($9) + 4)|0;
  27390. $13 = $12;
  27391. $14 = HEAP32[$13>>2]|0;
  27392. $15 = (Atomics_store(HEAP32, $4>>2, 0)|0);
  27393. tempRet0 = ($14);
  27394. return ($11|0);
  27395. }
  27396. function _emscripten_atomic_or_u64($0,$1,$2) {
  27397. $0 = $0|0;
  27398. $1 = $1|0;
  27399. $2 = $2|0;
  27400. 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;
  27401. var $9 = 0, label = 0, sp = 0;
  27402. sp = STACKTOP;
  27403. $3 = $0;
  27404. $4 = $3 >>> 3;
  27405. $5 = $4 & 255;
  27406. $6 = (34372 + ($5<<2)|0);
  27407. while(1) {
  27408. while(1) {
  27409. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  27410. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  27411. $9 = ($7|0)==($8|0);
  27412. if ($9) {
  27413. break;
  27414. }
  27415. }
  27416. $10 = ($7|0)==(0);
  27417. if ($10) {
  27418. break;
  27419. }
  27420. }
  27421. $11 = $0;
  27422. $12 = $11;
  27423. $13 = HEAP32[$12>>2]|0;
  27424. $14 = (($11) + 4)|0;
  27425. $15 = $14;
  27426. $16 = HEAP32[$15>>2]|0;
  27427. $17 = $13 | $1;
  27428. $18 = $16 | $2;
  27429. $19 = $0;
  27430. $20 = $19;
  27431. HEAP32[$20>>2] = $17;
  27432. $21 = (($19) + 4)|0;
  27433. $22 = $21;
  27434. HEAP32[$22>>2] = $18;
  27435. $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  27436. tempRet0 = ($18);
  27437. return ($17|0);
  27438. }
  27439. function _emscripten_atomic_store_f32($0,$1) {
  27440. $0 = $0|0;
  27441. $1 = +$1;
  27442. var $2 = 0, $3 = 0, $4 = 0.0, label = 0, sp = 0;
  27443. sp = STACKTOP;
  27444. $2 = (HEAPF32[tempDoublePtr>>2]=$1,HEAP32[tempDoublePtr>>2]|0);
  27445. $3 = (Atomics_store(HEAP32, $0>>2, $2)|0);
  27446. $4 = (+($3>>>0));
  27447. return (+$4);
  27448. }
  27449. function _emscripten_atomic_store_f64($0,$1) {
  27450. $0 = $0|0;
  27451. $1 = +$1;
  27452. var $10 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
  27453. sp = STACKTOP;
  27454. $2 = $0;
  27455. $3 = $2 >>> 3;
  27456. $4 = $3 & 255;
  27457. $5 = (34372 + ($4<<2)|0);
  27458. while(1) {
  27459. while(1) {
  27460. $6 = (Atomics_load(HEAP32, $5>>2)|0);
  27461. $7 = (Atomics_compareExchange(HEAP32, $5>>2, $6, 1)|0);
  27462. $8 = ($6|0)==($7|0);
  27463. if ($8) {
  27464. break;
  27465. }
  27466. }
  27467. $9 = ($6|0)==(0);
  27468. if ($9) {
  27469. break;
  27470. }
  27471. }
  27472. HEAPF64[$0>>3] = $1;
  27473. $10 = (Atomics_store(HEAP32, $5>>2, 0)|0);
  27474. return (+$1);
  27475. }
  27476. function _emscripten_atomic_store_u64($0,$1,$2) {
  27477. $0 = $0|0;
  27478. $1 = $1|0;
  27479. $2 = $2|0;
  27480. 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;
  27481. sp = STACKTOP;
  27482. $3 = $0;
  27483. $4 = $3 >>> 3;
  27484. $5 = $4 & 255;
  27485. $6 = (34372 + ($5<<2)|0);
  27486. while(1) {
  27487. while(1) {
  27488. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  27489. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  27490. $9 = ($7|0)==($8|0);
  27491. if ($9) {
  27492. break;
  27493. }
  27494. }
  27495. $10 = ($7|0)==(0);
  27496. if ($10) {
  27497. break;
  27498. }
  27499. }
  27500. $11 = $0;
  27501. $12 = $11;
  27502. HEAP32[$12>>2] = $1;
  27503. $13 = (($11) + 4)|0;
  27504. $14 = $13;
  27505. HEAP32[$14>>2] = $2;
  27506. $15 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  27507. tempRet0 = ($2);
  27508. return ($1|0);
  27509. }
  27510. function _emscripten_atomic_sub_u64($0,$1,$2) {
  27511. $0 = $0|0;
  27512. $1 = $1|0;
  27513. $2 = $2|0;
  27514. 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;
  27515. var $9 = 0, label = 0, sp = 0;
  27516. sp = STACKTOP;
  27517. $3 = $0;
  27518. $4 = $3 >>> 3;
  27519. $5 = $4 & 255;
  27520. $6 = (34372 + ($5<<2)|0);
  27521. while(1) {
  27522. while(1) {
  27523. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  27524. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  27525. $9 = ($7|0)==($8|0);
  27526. if ($9) {
  27527. break;
  27528. }
  27529. }
  27530. $10 = ($7|0)==(0);
  27531. if ($10) {
  27532. break;
  27533. }
  27534. }
  27535. $11 = $0;
  27536. $12 = $11;
  27537. $13 = HEAP32[$12>>2]|0;
  27538. $14 = (($11) + 4)|0;
  27539. $15 = $14;
  27540. $16 = HEAP32[$15>>2]|0;
  27541. $17 = (_i64Subtract(($13|0),($16|0),($1|0),($2|0))|0);
  27542. $18 = tempRet0;
  27543. $19 = $0;
  27544. $20 = $19;
  27545. HEAP32[$20>>2] = $17;
  27546. $21 = (($19) + 4)|0;
  27547. $22 = $21;
  27548. HEAP32[$22>>2] = $18;
  27549. $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  27550. tempRet0 = ($18);
  27551. return ($17|0);
  27552. }
  27553. function _emscripten_atomic_xor_u64($0,$1,$2) {
  27554. $0 = $0|0;
  27555. $1 = $1|0;
  27556. $2 = $2|0;
  27557. 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;
  27558. var $9 = 0, label = 0, sp = 0;
  27559. sp = STACKTOP;
  27560. $3 = $0;
  27561. $4 = $3 >>> 3;
  27562. $5 = $4 & 255;
  27563. $6 = (34372 + ($5<<2)|0);
  27564. while(1) {
  27565. while(1) {
  27566. $7 = (Atomics_load(HEAP32, $6>>2)|0);
  27567. $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
  27568. $9 = ($7|0)==($8|0);
  27569. if ($9) {
  27570. break;
  27571. }
  27572. }
  27573. $10 = ($7|0)==(0);
  27574. if ($10) {
  27575. break;
  27576. }
  27577. }
  27578. $11 = $0;
  27579. $12 = $11;
  27580. $13 = HEAP32[$12>>2]|0;
  27581. $14 = (($11) + 4)|0;
  27582. $15 = $14;
  27583. $16 = HEAP32[$15>>2]|0;
  27584. $17 = $13 ^ $1;
  27585. $18 = $16 ^ $2;
  27586. $19 = $0;
  27587. $20 = $19;
  27588. HEAP32[$20>>2] = $17;
  27589. $21 = (($19) + 4)|0;
  27590. $22 = $21;
  27591. HEAP32[$22>>2] = $18;
  27592. $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
  27593. tempRet0 = ($18);
  27594. return ($17|0);
  27595. }
  27596. function _emscripten_main_thread_process_queued_calls() {
  27597. 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;
  27598. sp = STACKTOP;
  27599. $0 = (_emscripten_is_main_runtime_thread()|0);
  27600. $1 = ($0|0)==(0);
  27601. if ($1) {
  27602. ___assert_fail((13574|0),(13696|0),424,(13760|0));
  27603. // unreachable;
  27604. }
  27605. $2 = (_emscripten_is_main_runtime_thread()|0);
  27606. $3 = ($2|0)==(0);
  27607. $4 = HEAP32[8453]|0;
  27608. $5 = ($4|0)!=(0);
  27609. $or$cond = $3 | $5;
  27610. if ($or$cond) {
  27611. return;
  27612. }
  27613. HEAP32[8453] = 1;
  27614. (___pthread_mutex_lock(33816)|0);
  27615. $6 = (Atomics_load(HEAP32, 8461)|0);
  27616. $7 = (Atomics_load(HEAP32, 8462)|0);
  27617. $8 = ($6|0)==($7|0);
  27618. (___pthread_mutex_unlock(33816)|0);
  27619. if (!($8)) {
  27620. $$0910 = $6;
  27621. while(1) {
  27622. $9 = (33852 + ($$0910<<2)|0);
  27623. $10 = HEAP32[$9>>2]|0;
  27624. __do_call($10);
  27625. (___pthread_mutex_lock(33816)|0);
  27626. $11 = (($$0910) + 1)|0;
  27627. $12 = (($11|0) % 128)&-1;
  27628. $13 = (Atomics_store(HEAP32, 8461, $12)|0);
  27629. $14 = (Atomics_load(HEAP32, 8462)|0);
  27630. $15 = ($12|0)==($14|0);
  27631. (___pthread_mutex_unlock(33816)|0);
  27632. if ($15) {
  27633. break;
  27634. } else {
  27635. $$0910 = $12;
  27636. }
  27637. }
  27638. }
  27639. (_emscripten_futex_wake((33844|0),2147483647)|0);
  27640. HEAP32[8453] = 0;
  27641. return;
  27642. }
  27643. function _emscripten_sync_run_in_main_thread($0) {
  27644. $0 = $0|0;
  27645. var label = 0, sp = 0;
  27646. sp = STACKTOP;
  27647. _emscripten_async_run_in_main_thread($0);
  27648. (_emscripten_wait_for_call_v($0,inf)|0);
  27649. return;
  27650. }
  27651. function _emscripten_sync_run_in_main_thread_0($0) {
  27652. $0 = $0|0;
  27653. var $1 = 0, $2 = 0, $3 = 0, dest = 0, label = 0, sp = 0, stop = 0;
  27654. sp = STACKTOP;
  27655. STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
  27656. $1 = sp;
  27657. dest=$1; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  27658. HEAP32[$1>>2] = $0;
  27659. $2 = ((($1)) + 80|0);
  27660. HEAP32[$2>>2] = 0;
  27661. _emscripten_async_run_in_main_thread($1);
  27662. (_emscripten_wait_for_call_v($1,inf)|0);
  27663. $3 = HEAP32[$2>>2]|0;
  27664. STACKTOP = sp;return ($3|0);
  27665. }
  27666. function _emscripten_sync_run_in_main_thread_1($0,$1) {
  27667. $0 = $0|0;
  27668. $1 = $1|0;
  27669. var $2 = 0, $3 = 0, $4 = 0, $5 = 0, dest = 0, label = 0, sp = 0, stop = 0;
  27670. sp = STACKTOP;
  27671. STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
  27672. $2 = sp;
  27673. dest=$2; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  27674. HEAP32[$2>>2] = $0;
  27675. $3 = ((($2)) + 16|0);
  27676. HEAP32[$3>>2] = $1;
  27677. $4 = ((($2)) + 80|0);
  27678. HEAP32[$4>>2] = 0;
  27679. _emscripten_async_run_in_main_thread($2);
  27680. (_emscripten_wait_for_call_v($2,inf)|0);
  27681. $5 = HEAP32[$4>>2]|0;
  27682. STACKTOP = sp;return ($5|0);
  27683. }
  27684. function _emscripten_sync_run_in_main_thread_2($0,$1,$2) {
  27685. $0 = $0|0;
  27686. $1 = $1|0;
  27687. $2 = $2|0;
  27688. var $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, dest = 0, label = 0, sp = 0, stop = 0;
  27689. sp = STACKTOP;
  27690. STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
  27691. $3 = sp;
  27692. dest=$3; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  27693. HEAP32[$3>>2] = $0;
  27694. $4 = ((($3)) + 16|0);
  27695. HEAP32[$4>>2] = $1;
  27696. $5 = ((($3)) + 24|0);
  27697. HEAP32[$5>>2] = $2;
  27698. $6 = ((($3)) + 80|0);
  27699. HEAP32[$6>>2] = 0;
  27700. _emscripten_async_run_in_main_thread($3);
  27701. (_emscripten_wait_for_call_v($3,inf)|0);
  27702. $7 = HEAP32[$6>>2]|0;
  27703. STACKTOP = sp;return ($7|0);
  27704. }
  27705. function _emscripten_sync_run_in_main_thread_3($0,$1,$2,$3) {
  27706. $0 = $0|0;
  27707. $1 = $1|0;
  27708. $2 = $2|0;
  27709. $3 = $3|0;
  27710. var $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, stop = 0;
  27711. sp = STACKTOP;
  27712. STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
  27713. $4 = sp;
  27714. dest=$4; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  27715. HEAP32[$4>>2] = $0;
  27716. $5 = ((($4)) + 16|0);
  27717. HEAP32[$5>>2] = $1;
  27718. $6 = ((($4)) + 24|0);
  27719. HEAP32[$6>>2] = $2;
  27720. $7 = ((($4)) + 32|0);
  27721. HEAP32[$7>>2] = $3;
  27722. $8 = ((($4)) + 80|0);
  27723. HEAP32[$8>>2] = 0;
  27724. _emscripten_async_run_in_main_thread($4);
  27725. (_emscripten_wait_for_call_v($4,inf)|0);
  27726. $9 = HEAP32[$8>>2]|0;
  27727. STACKTOP = sp;return ($9|0);
  27728. }
  27729. function _emscripten_sync_run_in_main_thread_4($0,$1,$2,$3,$4) {
  27730. $0 = $0|0;
  27731. $1 = $1|0;
  27732. $2 = $2|0;
  27733. $3 = $3|0;
  27734. $4 = $4|0;
  27735. var $10 = 0, $11 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, stop = 0;
  27736. sp = STACKTOP;
  27737. STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
  27738. $5 = sp;
  27739. dest=$5; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  27740. HEAP32[$5>>2] = $0;
  27741. $6 = ((($5)) + 16|0);
  27742. HEAP32[$6>>2] = $1;
  27743. $7 = ((($5)) + 24|0);
  27744. HEAP32[$7>>2] = $2;
  27745. $8 = ((($5)) + 32|0);
  27746. HEAP32[$8>>2] = $3;
  27747. $9 = ((($5)) + 40|0);
  27748. HEAP32[$9>>2] = $4;
  27749. $10 = ((($5)) + 80|0);
  27750. HEAP32[$10>>2] = 0;
  27751. _emscripten_async_run_in_main_thread($5);
  27752. (_emscripten_wait_for_call_v($5,inf)|0);
  27753. $11 = HEAP32[$10>>2]|0;
  27754. STACKTOP = sp;return ($11|0);
  27755. }
  27756. function _emscripten_sync_run_in_main_thread_5($0,$1,$2,$3,$4,$5) {
  27757. $0 = $0|0;
  27758. $1 = $1|0;
  27759. $2 = $2|0;
  27760. $3 = $3|0;
  27761. $4 = $4|0;
  27762. $5 = $5|0;
  27763. 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;
  27764. sp = STACKTOP;
  27765. STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
  27766. $6 = sp;
  27767. dest=$6; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  27768. HEAP32[$6>>2] = $0;
  27769. $7 = ((($6)) + 16|0);
  27770. HEAP32[$7>>2] = $1;
  27771. $8 = ((($6)) + 24|0);
  27772. HEAP32[$8>>2] = $2;
  27773. $9 = ((($6)) + 32|0);
  27774. HEAP32[$9>>2] = $3;
  27775. $10 = ((($6)) + 40|0);
  27776. HEAP32[$10>>2] = $4;
  27777. $11 = ((($6)) + 48|0);
  27778. HEAP32[$11>>2] = $5;
  27779. $12 = ((($6)) + 80|0);
  27780. HEAP32[$12>>2] = 0;
  27781. _emscripten_async_run_in_main_thread($6);
  27782. (_emscripten_wait_for_call_v($6,inf)|0);
  27783. $13 = HEAP32[$12>>2]|0;
  27784. STACKTOP = sp;return ($13|0);
  27785. }
  27786. function _emscripten_sync_run_in_main_thread_6($0,$1,$2,$3,$4,$5,$6) {
  27787. $0 = $0|0;
  27788. $1 = $1|0;
  27789. $2 = $2|0;
  27790. $3 = $3|0;
  27791. $4 = $4|0;
  27792. $5 = $5|0;
  27793. $6 = $6|0;
  27794. 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;
  27795. sp = STACKTOP;
  27796. STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
  27797. $7 = sp;
  27798. dest=$7; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  27799. HEAP32[$7>>2] = $0;
  27800. $8 = ((($7)) + 16|0);
  27801. HEAP32[$8>>2] = $1;
  27802. $9 = ((($7)) + 24|0);
  27803. HEAP32[$9>>2] = $2;
  27804. $10 = ((($7)) + 32|0);
  27805. HEAP32[$10>>2] = $3;
  27806. $11 = ((($7)) + 40|0);
  27807. HEAP32[$11>>2] = $4;
  27808. $12 = ((($7)) + 48|0);
  27809. HEAP32[$12>>2] = $5;
  27810. $13 = ((($7)) + 56|0);
  27811. HEAP32[$13>>2] = $6;
  27812. $14 = ((($7)) + 80|0);
  27813. HEAP32[$14>>2] = 0;
  27814. _emscripten_async_run_in_main_thread($7);
  27815. (_emscripten_wait_for_call_v($7,inf)|0);
  27816. $15 = HEAP32[$14>>2]|0;
  27817. STACKTOP = sp;return ($15|0);
  27818. }
  27819. function _emscripten_sync_run_in_main_thread_7($0,$1,$2,$3,$4,$5,$6,$7) {
  27820. $0 = $0|0;
  27821. $1 = $1|0;
  27822. $2 = $2|0;
  27823. $3 = $3|0;
  27824. $4 = $4|0;
  27825. $5 = $5|0;
  27826. $6 = $6|0;
  27827. $7 = $7|0;
  27828. 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;
  27829. sp = STACKTOP;
  27830. STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
  27831. $8 = sp;
  27832. dest=$8; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  27833. HEAP32[$8>>2] = $0;
  27834. $9 = ((($8)) + 16|0);
  27835. HEAP32[$9>>2] = $1;
  27836. $10 = ((($8)) + 24|0);
  27837. HEAP32[$10>>2] = $2;
  27838. $11 = ((($8)) + 32|0);
  27839. HEAP32[$11>>2] = $3;
  27840. $12 = ((($8)) + 40|0);
  27841. HEAP32[$12>>2] = $4;
  27842. $13 = ((($8)) + 48|0);
  27843. HEAP32[$13>>2] = $5;
  27844. $14 = ((($8)) + 56|0);
  27845. HEAP32[$14>>2] = $6;
  27846. $15 = ((($8)) + 64|0);
  27847. HEAP32[$15>>2] = $7;
  27848. $16 = ((($8)) + 80|0);
  27849. HEAP32[$16>>2] = 0;
  27850. _emscripten_async_run_in_main_thread($8);
  27851. (_emscripten_wait_for_call_v($8,inf)|0);
  27852. $17 = HEAP32[$16>>2]|0;
  27853. STACKTOP = sp;return ($17|0);
  27854. }
  27855. function _emscripten_sync_run_in_main_thread_xprintf_varargs($0,$1,$2,$varargs) {
  27856. $0 = $0|0;
  27857. $1 = $1|0;
  27858. $2 = $2|0;
  27859. $varargs = $varargs|0;
  27860. 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;
  27861. sp = STACKTOP;
  27862. STACKTOP = STACKTOP + 240|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(240|0);
  27863. $3 = sp + 96|0;
  27864. $4 = sp + 112|0;
  27865. $5 = sp;
  27866. HEAP32[$3>>2] = $varargs;
  27867. $6 = (_vsnprintf($4,128,$2,$3)|0);
  27868. $7 = ($6|0)>(127);
  27869. $8 = (($6) + 1)|0;
  27870. if ($7) {
  27871. $9 = (_malloc($8)|0);
  27872. HEAP32[$3>>2] = $varargs;
  27873. (_vsnprintf($9,$8,$2,$3)|0);
  27874. $$0 = $9;
  27875. } else {
  27876. $$0 = $4;
  27877. }
  27878. dest=$5; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
  27879. HEAP32[$5>>2] = $0;
  27880. $10 = $1;
  27881. $11 = ((($5)) + 16|0);
  27882. HEAP32[$11>>2] = $10;
  27883. $12 = ((($5)) + 24|0);
  27884. HEAP32[$12>>2] = $$0;
  27885. $13 = ((($5)) + 80|0);
  27886. HEAP32[$13>>2] = 0;
  27887. _emscripten_async_run_in_main_thread($5);
  27888. (_emscripten_wait_for_call_v($5,inf)|0);
  27889. $14 = ($$0|0)==($4|0);
  27890. if ($14) {
  27891. $15 = HEAP32[$13>>2]|0;
  27892. STACKTOP = sp;return ($15|0);
  27893. }
  27894. _free($$0);
  27895. $15 = HEAP32[$13>>2]|0;
  27896. STACKTOP = sp;return ($15|0);
  27897. }
  27898. function ___pthread_tsd_run_dtors() {
  27899. 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;
  27900. var $8 = 0, $9 = 0, $exitcond = 0, label = 0, sp = 0;
  27901. sp = STACKTOP;
  27902. $0 = (_pthread_self()|0);
  27903. $1 = ((($0)) + 60|0);
  27904. $2 = HEAP32[$1>>2]|0;
  27905. $3 = ($2|0)==(0);
  27906. if ($3) {
  27907. return;
  27908. }
  27909. $4 = ((($0)) + 116|0);
  27910. $$02427 = 0;
  27911. while(1) {
  27912. $$026 = 0;$$125 = 0;
  27913. while(1) {
  27914. $5 = HEAP32[$4>>2]|0;
  27915. $6 = (($5) + ($$026<<2)|0);
  27916. $7 = HEAP32[$6>>2]|0;
  27917. $8 = ($7|0)==(0|0);
  27918. if ($8) {
  27919. $$2 = $$125;
  27920. } else {
  27921. $9 = (33300 + ($$026<<2)|0);
  27922. $10 = (Atomics_load(HEAP32,$9>>2)|0);
  27923. $11 = ($10|0)==(0|0);
  27924. if ($11) {
  27925. $$2 = $$125;
  27926. } else {
  27927. HEAP32[$6>>2] = 0;
  27928. $12 = (Atomics_load(HEAP32,$9>>2)|0);
  27929. FUNCTION_TABLE_vi[$12 & 31]($7);
  27930. $$2 = 1;
  27931. }
  27932. }
  27933. $13 = (($$026) + 1)|0;
  27934. $exitcond = ($13|0)==(128);
  27935. if ($exitcond) {
  27936. break;
  27937. } else {
  27938. $$026 = $13;$$125 = $$2;
  27939. }
  27940. }
  27941. $14 = (($$02427) + 1)|0;
  27942. $15 = ($$2|0)!=(0);
  27943. $16 = ($14|0)<(4);
  27944. $17 = $16 & $15;
  27945. if ($17) {
  27946. $$02427 = $14;
  27947. } else {
  27948. break;
  27949. }
  27950. }
  27951. return;
  27952. }
  27953. function _emscripten_wait_for_call_v($0,$1) {
  27954. $0 = $0|0;
  27955. $1 = +$1;
  27956. 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;
  27957. sp = STACKTOP;
  27958. $2 = ((($0)) + 8|0);
  27959. $3 = (Atomics_load(HEAP32, $2>>2)|0);
  27960. $4 = ($3|0)==(0);
  27961. if (!($4)) {
  27962. $$1 = $3;
  27963. $13 = ($$1|0)==(0);
  27964. $$ = $13 ? -8 : 0;
  27965. return ($$|0);
  27966. }
  27967. $5 = (+_emscripten_get_now());
  27968. $6 = $5 + $1;
  27969. _emscripten_set_current_thread_status(5);
  27970. $7 = $5 < $6;
  27971. if ($7) {
  27972. $$01921 = $5;
  27973. while(1) {
  27974. $8 = $6 - $$01921;
  27975. (_emscripten_futex_wait(($2|0),0,(+$8))|0);
  27976. $9 = (Atomics_load(HEAP32, $2>>2)|0);
  27977. $10 = (+_emscripten_get_now());
  27978. $11 = ($9|0)==(0);
  27979. $12 = $10 < $6;
  27980. $or$cond = $11 & $12;
  27981. if ($or$cond) {
  27982. $$01921 = $10;
  27983. } else {
  27984. $$020$lcssa = $9;
  27985. break;
  27986. }
  27987. }
  27988. } else {
  27989. $$020$lcssa = 0;
  27990. }
  27991. _emscripten_set_current_thread_status(1);
  27992. $$1 = $$020$lcssa;
  27993. $13 = ($$1|0)==(0);
  27994. $$ = $13 ? -8 : 0;
  27995. return ($$|0);
  27996. }
  27997. function __do_call($0) {
  27998. $0 = $0|0;
  27999. 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;
  28000. 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;
  28001. 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;
  28002. 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;
  28003. 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;
  28004. 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;
  28005. var $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, label = 0, sp = 0;
  28006. sp = STACKTOP;
  28007. $1 = HEAP32[$0>>2]|0;
  28008. do {
  28009. switch ($1|0) {
  28010. case 12: {
  28011. $2 = ((($0)) + 16|0);
  28012. $3 = HEAP32[$2>>2]|0;
  28013. $4 = ((($0)) + 24|0);
  28014. $5 = HEAP32[$4>>2]|0;
  28015. $6 = (_utime(($3|0),($5|0))|0);
  28016. $7 = ((($0)) + 80|0);
  28017. HEAP32[$7>>2] = $6;
  28018. break;
  28019. }
  28020. case 13: {
  28021. $8 = ((($0)) + 16|0);
  28022. $9 = HEAP32[$8>>2]|0;
  28023. $10 = ((($0)) + 24|0);
  28024. $11 = HEAP32[$10>>2]|0;
  28025. $12 = (_utimes(($9|0),($11|0))|0);
  28026. $13 = ((($0)) + 80|0);
  28027. HEAP32[$13>>2] = $12;
  28028. break;
  28029. }
  28030. case 37: {
  28031. $14 = ((($0)) + 16|0);
  28032. $15 = HEAP32[$14>>2]|0;
  28033. $16 = (_chroot(($15|0))|0);
  28034. $17 = ((($0)) + 80|0);
  28035. HEAP32[$17>>2] = $16;
  28036. break;
  28037. }
  28038. case 46: {
  28039. $18 = ((($0)) + 16|0);
  28040. $19 = HEAP32[$18>>2]|0;
  28041. $20 = ((($0)) + 24|0);
  28042. $21 = HEAP32[$20>>2]|0;
  28043. $22 = (_fpathconf(($19|0),($21|0))|0);
  28044. $23 = ((($0)) + 80|0);
  28045. HEAP32[$23>>2] = $22;
  28046. break;
  28047. }
  28048. case 68: {
  28049. $24 = ((($0)) + 16|0);
  28050. $25 = HEAP32[$24>>2]|0;
  28051. $26 = ((($0)) + 24|0);
  28052. $27 = HEAP32[$26>>2]|0;
  28053. $28 = ((($0)) + 32|0);
  28054. $29 = HEAP32[$28>>2]|0;
  28055. $30 = (_confstr(($25|0),($27|0),($29|0))|0);
  28056. $31 = ((($0)) + 80|0);
  28057. HEAP32[$31>>2] = $30;
  28058. break;
  28059. }
  28060. case 72: {
  28061. $32 = ((($0)) + 16|0);
  28062. $33 = HEAP32[$32>>2]|0;
  28063. $34 = (_sysconf(($33|0))|0);
  28064. $35 = ((($0)) + 80|0);
  28065. HEAP32[$35>>2] = $34;
  28066. break;
  28067. }
  28068. case 110: {
  28069. $36 = ((($0)) + 16|0);
  28070. $37 = HEAP32[$36>>2]|0;
  28071. $38 = (_atexit(($37|0))|0);
  28072. $39 = ((($0)) + 80|0);
  28073. HEAP32[$39>>2] = $38;
  28074. break;
  28075. }
  28076. case 111: {
  28077. $40 = ((($0)) + 16|0);
  28078. $41 = HEAP32[$40>>2]|0;
  28079. $42 = (_getenv(($41|0))|0);
  28080. $43 = ((($0)) + 80|0);
  28081. HEAP32[$43>>2] = $42;
  28082. break;
  28083. }
  28084. case 112: {
  28085. $44 = (_clearenv()|0);
  28086. $45 = ((($0)) + 80|0);
  28087. HEAP32[$45>>2] = $44;
  28088. break;
  28089. }
  28090. case 113: {
  28091. $46 = ((($0)) + 16|0);
  28092. $47 = HEAP32[$46>>2]|0;
  28093. $48 = ((($0)) + 24|0);
  28094. $49 = HEAP32[$48>>2]|0;
  28095. $50 = ((($0)) + 32|0);
  28096. $51 = HEAP32[$50>>2]|0;
  28097. $52 = (_setenv(($47|0),($49|0),($51|0))|0);
  28098. $53 = ((($0)) + 80|0);
  28099. HEAP32[$53>>2] = $52;
  28100. break;
  28101. }
  28102. case 114: {
  28103. $54 = ((($0)) + 16|0);
  28104. $55 = HEAP32[$54>>2]|0;
  28105. $56 = (_unsetenv(($55|0))|0);
  28106. $57 = ((($0)) + 80|0);
  28107. HEAP32[$57>>2] = $56;
  28108. break;
  28109. }
  28110. case 115: {
  28111. $58 = ((($0)) + 16|0);
  28112. $59 = HEAP32[$58>>2]|0;
  28113. $60 = (_putenv(($59|0))|0);
  28114. $61 = ((($0)) + 80|0);
  28115. HEAP32[$61>>2] = $60;
  28116. break;
  28117. }
  28118. case 119: {
  28119. _tzset();
  28120. break;
  28121. }
  28122. case 137: {
  28123. $62 = ((($0)) + 16|0);
  28124. $63 = HEAP32[$62>>2]|0;
  28125. $64 = ((($0)) + 24|0);
  28126. $65 = HEAP32[$64>>2]|0;
  28127. $66 = ((($0)) + 32|0);
  28128. $67 = HEAP32[$66>>2]|0;
  28129. $68 = ((($0)) + 40|0);
  28130. $69 = HEAP32[$68>>2]|0;
  28131. $70 = (_pthread_create(($63|0),($65|0),($67|0),($69|0))|0);
  28132. $71 = ((($0)) + 80|0);
  28133. HEAP32[$71>>2] = $70;
  28134. break;
  28135. }
  28136. case 138: {
  28137. $72 = ((($0)) + 16|0);
  28138. $73 = HEAP32[$72>>2]|0;
  28139. $74 = ((($0)) + 24|0);
  28140. $75 = HEAP32[$74>>2]|0;
  28141. $76 = (_emscripten_syscall(($73|0),($75|0))|0);
  28142. $77 = ((($0)) + 80|0);
  28143. HEAP32[$77>>2] = $76;
  28144. break;
  28145. }
  28146. case 1024: {
  28147. $78 = ((($0)) + 4|0);
  28148. $79 = HEAP32[$78>>2]|0;
  28149. FUNCTION_TABLE_v[$79 & 7]();
  28150. break;
  28151. }
  28152. case 1025: {
  28153. $80 = ((($0)) + 4|0);
  28154. $81 = HEAP32[$80>>2]|0;
  28155. $82 = ((($0)) + 16|0);
  28156. $83 = HEAP32[$82>>2]|0;
  28157. FUNCTION_TABLE_vi[$81 & 31]($83);
  28158. break;
  28159. }
  28160. case 1026: {
  28161. $84 = ((($0)) + 4|0);
  28162. $85 = HEAP32[$84>>2]|0;
  28163. $86 = ((($0)) + 16|0);
  28164. $87 = HEAP32[$86>>2]|0;
  28165. $88 = ((($0)) + 24|0);
  28166. $89 = HEAP32[$88>>2]|0;
  28167. FUNCTION_TABLE_vii[$85 & 63]($87,$89);
  28168. break;
  28169. }
  28170. case 1027: {
  28171. $90 = ((($0)) + 4|0);
  28172. $91 = HEAP32[$90>>2]|0;
  28173. $92 = ((($0)) + 16|0);
  28174. $93 = HEAP32[$92>>2]|0;
  28175. $94 = ((($0)) + 24|0);
  28176. $95 = HEAP32[$94>>2]|0;
  28177. $96 = ((($0)) + 32|0);
  28178. $97 = HEAP32[$96>>2]|0;
  28179. FUNCTION_TABLE_viii[$91 & 31]($93,$95,$97);
  28180. break;
  28181. }
  28182. case 2048: {
  28183. $98 = ((($0)) + 4|0);
  28184. $99 = HEAP32[$98>>2]|0;
  28185. $100 = (FUNCTION_TABLE_i[$99 & 3]()|0);
  28186. $101 = ((($0)) + 80|0);
  28187. HEAP32[$101>>2] = $100;
  28188. break;
  28189. }
  28190. case 2049: {
  28191. $102 = ((($0)) + 4|0);
  28192. $103 = HEAP32[$102>>2]|0;
  28193. $104 = ((($0)) + 16|0);
  28194. $105 = HEAP32[$104>>2]|0;
  28195. $106 = (FUNCTION_TABLE_ii[$103 & 15]($105)|0);
  28196. $107 = ((($0)) + 80|0);
  28197. HEAP32[$107>>2] = $106;
  28198. break;
  28199. }
  28200. case 2050: {
  28201. $108 = ((($0)) + 4|0);
  28202. $109 = HEAP32[$108>>2]|0;
  28203. $110 = ((($0)) + 16|0);
  28204. $111 = HEAP32[$110>>2]|0;
  28205. $112 = ((($0)) + 24|0);
  28206. $113 = HEAP32[$112>>2]|0;
  28207. $114 = (FUNCTION_TABLE_iii[$109 & 3]($111,$113)|0);
  28208. $115 = ((($0)) + 80|0);
  28209. HEAP32[$115>>2] = $114;
  28210. break;
  28211. }
  28212. case 2051: {
  28213. $116 = ((($0)) + 4|0);
  28214. $117 = HEAP32[$116>>2]|0;
  28215. $118 = ((($0)) + 16|0);
  28216. $119 = HEAP32[$118>>2]|0;
  28217. $120 = ((($0)) + 24|0);
  28218. $121 = HEAP32[$120>>2]|0;
  28219. $122 = ((($0)) + 32|0);
  28220. $123 = HEAP32[$122>>2]|0;
  28221. $124 = (FUNCTION_TABLE_iiii[$117 & 15]($119,$121,$123)|0);
  28222. $125 = ((($0)) + 80|0);
  28223. HEAP32[$125>>2] = $124;
  28224. break;
  28225. }
  28226. default: {
  28227. ___assert_fail((13804|0),(13696|0),211,(13855|0));
  28228. // unreachable;
  28229. }
  28230. }
  28231. } while(0);
  28232. $126 = ((($0)) + 88|0);
  28233. $127 = HEAP32[$126>>2]|0;
  28234. $128 = ($127|0)==(0);
  28235. if ($128) {
  28236. $129 = ((($0)) + 8|0);
  28237. HEAP32[$129>>2] = 1;
  28238. (_emscripten_futex_wake(($129|0),2147483647)|0);
  28239. return;
  28240. } else {
  28241. _free($0);
  28242. return;
  28243. }
  28244. }
  28245. function ___pthread_mutex_unlock($0) {
  28246. $0 = $0|0;
  28247. 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;
  28248. 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;
  28249. var $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, $or$cond3 = 0, label = 0, sp = 0;
  28250. sp = STACKTOP;
  28251. $1 = ((($0)) + 8|0);
  28252. $2 = (Atomics_load(HEAP32,$1>>2)|0);
  28253. $3 = HEAP32[$0>>2]|0;
  28254. $4 = $3 & 15;
  28255. $5 = $3 & 128;
  28256. $6 = $5 ^ 128;
  28257. $7 = ($4|0)==(0);
  28258. if ($7) {
  28259. $$pre = ((($0)) + 4|0);
  28260. $$045 = 0;$$pre$phiZ2D = $$pre;
  28261. } else {
  28262. $8 = (_pthread_self()|0);
  28263. $9 = ((($0)) + 4|0);
  28264. $10 = (Atomics_load(HEAP32,$9>>2)|0);
  28265. $11 = $10 & 2147483647;
  28266. $12 = ((($8)) + 52|0);
  28267. $13 = HEAP32[$12>>2]|0;
  28268. $14 = ($11|0)==($13|0);
  28269. if (!($14)) {
  28270. $$0 = 1;
  28271. return ($$0|0);
  28272. }
  28273. $15 = $3 & 3;
  28274. $16 = ($15|0)==(1);
  28275. if ($16) {
  28276. $17 = ((($0)) + 20|0);
  28277. $18 = HEAP32[$17>>2]|0;
  28278. $19 = ($18|0)==(0);
  28279. if (!($19)) {
  28280. $20 = (($18) + -1)|0;
  28281. HEAP32[$17>>2] = $20;
  28282. $$0 = 0;
  28283. return ($$0|0);
  28284. }
  28285. }
  28286. $21 = ($6|0)==(0);
  28287. $22 = ((($0)) + 16|0);
  28288. if ($21) {
  28289. $23 = ((($8)) + 176|0);
  28290. Atomics_store(HEAP32,$23>>2,$22)|0;
  28291. ___vm_lock();
  28292. }
  28293. $24 = ((($0)) + 12|0);
  28294. $25 = HEAP32[$24>>2]|0;
  28295. $26 = HEAP32[$22>>2]|0;
  28296. Atomics_store(HEAP32,$25>>2,$26)|0;
  28297. $27 = ((($8)) + 168|0);
  28298. $28 = ($26|0)==($27|0);
  28299. if ($28) {
  28300. $$045 = $8;$$pre$phiZ2D = $9;
  28301. } else {
  28302. $29 = ((($26)) + -4|0);
  28303. Atomics_store(HEAP32,$29>>2,$25)|0;
  28304. $$045 = $8;$$pre$phiZ2D = $9;
  28305. }
  28306. }
  28307. $30 = $3 & 8;
  28308. $31 = ($30|0)!=(0);
  28309. $32 = $31 ? 2147483647 : 0;
  28310. while(1) {
  28311. $33 = (Atomics_load(HEAP32, $$pre$phiZ2D>>2)|0);
  28312. $34 = (Atomics_compareExchange(HEAP32, $$pre$phiZ2D>>2, $33, $32)|0);
  28313. $35 = ($34|0)==($33|0);
  28314. if ($35) {
  28315. break;
  28316. }
  28317. }
  28318. $36 = ($6|0)!=(0);
  28319. $or$cond = $7 | $36;
  28320. if (!($or$cond)) {
  28321. $37 = ((($$045)) + 176|0);
  28322. Atomics_store(HEAP32,$37>>2,0)|0;
  28323. ___vm_unlock();
  28324. }
  28325. $38 = ($2|0)!=(0);
  28326. $39 = ($33|0)<(0);
  28327. $or$cond3 = $38 | $39;
  28328. if (!($or$cond3)) {
  28329. $$0 = 0;
  28330. return ($$0|0);
  28331. }
  28332. (_emscripten_futex_wake(($$pre$phiZ2D|0),1)|0);
  28333. $$0 = 0;
  28334. return ($$0|0);
  28335. }
  28336. function ___vm_lock() {
  28337. var $0 = 0, label = 0, sp = 0;
  28338. sp = STACKTOP;
  28339. $0 = (Atomics_add(HEAP32, 8591, 1)|0);
  28340. return;
  28341. }
  28342. function ___vm_unlock() {
  28343. var $0 = 0, $1 = 0, $2 = 0, $3 = 0, label = 0, sp = 0;
  28344. sp = STACKTOP;
  28345. $0 = (Atomics_add(HEAP32, 8591, -1)|0);
  28346. $1 = ($0|0)==(1);
  28347. if (!($1)) {
  28348. return;
  28349. }
  28350. $2 = (Atomics_load(HEAP32,(34368)>>2)|0);
  28351. $3 = ($2|0)==(0);
  28352. if ($3) {
  28353. return;
  28354. }
  28355. (_emscripten_futex_wake((34364|0),2147483647)|0);
  28356. return;
  28357. }
  28358. function ___pthread_mutex_lock($0) {
  28359. $0 = $0|0;
  28360. var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0;
  28361. sp = STACKTOP;
  28362. $1 = HEAP32[$0>>2]|0;
  28363. $2 = $1 & 15;
  28364. $3 = ($2|0)==(0);
  28365. if ($3) {
  28366. $4 = ((($0)) + 4|0);
  28367. $5 = (Atomics_compareExchange(HEAP32, $4>>2, 0, 16)|0);
  28368. $6 = ($5|0)==(0);
  28369. if ($6) {
  28370. $$0 = 0;
  28371. return ($$0|0);
  28372. }
  28373. }
  28374. $7 = (___pthread_mutex_timedlock($0,0)|0);
  28375. $$0 = $7;
  28376. return ($$0|0);
  28377. }
  28378. function ___pthread_mutex_timedlock($0,$1) {
  28379. $0 = $0|0;
  28380. $1 = $1|0;
  28381. 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;
  28382. 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;
  28383. var $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $or$cond40 = 0, label = 0, sp = 0;
  28384. sp = STACKTOP;
  28385. $2 = HEAP32[$0>>2]|0;
  28386. $3 = $2 & 15;
  28387. $4 = ($3|0)==(0);
  28388. do {
  28389. if ($4) {
  28390. $5 = ((($0)) + 4|0);
  28391. $6 = (Atomics_compareExchange(HEAP32, $5>>2, 0, 16)|0);
  28392. $7 = ($6|0)==(0);
  28393. if ($7) {
  28394. $$2 = 0;
  28395. return ($$2|0);
  28396. } else {
  28397. $$pre = HEAP32[$0>>2]|0;
  28398. $9 = $$pre;
  28399. break;
  28400. }
  28401. } else {
  28402. $9 = $2;
  28403. }
  28404. } while(0);
  28405. $8 = $9 & 128;
  28406. $10 = $8 ^ 128;
  28407. $11 = (___pthread_mutex_trylock($0)|0);
  28408. $12 = ($11|0)==(16);
  28409. if (!($12)) {
  28410. $$2 = $11;
  28411. return ($$2|0);
  28412. }
  28413. $13 = ((($0)) + 4|0);
  28414. $14 = ((($0)) + 8|0);
  28415. $$0 = 100;
  28416. while(1) {
  28417. $15 = (($$0) + -1)|0;
  28418. $16 = ($$0|0)==(0);
  28419. if ($16) {
  28420. break;
  28421. }
  28422. $17 = (Atomics_load(HEAP32,$13>>2)|0);
  28423. $18 = ($17|0)==(0);
  28424. if ($18) {
  28425. break;
  28426. }
  28427. $19 = (Atomics_load(HEAP32,$14>>2)|0);
  28428. $20 = ($19|0)==(0);
  28429. if ($20) {
  28430. $$0 = $15;
  28431. } else {
  28432. break;
  28433. }
  28434. }
  28435. $21 = (___pthread_mutex_trylock($0)|0);
  28436. $22 = ($21|0)==(16);
  28437. if (!($22)) {
  28438. $$2 = $21;
  28439. return ($$2|0);
  28440. }
  28441. L18: while(1) {
  28442. $23 = (Atomics_load(HEAP32,$13>>2)|0);
  28443. $24 = ($23|0)==(0);
  28444. if (!($24)) {
  28445. $27 = $23 & 1073741824;
  28446. $28 = ($27|0)==(0);
  28447. $29 = HEAP32[$0>>2]|0;
  28448. $30 = $29 & 4;
  28449. $31 = ($30|0)==(0);
  28450. $or$cond40 = $28 | $31;
  28451. if ($or$cond40) {
  28452. $32 = $29 & 3;
  28453. $33 = ($32|0)==(2);
  28454. if ($33) {
  28455. $34 = $23 & 2147483647;
  28456. $35 = (_pthread_self()|0);
  28457. $36 = ((($35)) + 52|0);
  28458. $37 = HEAP32[$36>>2]|0;
  28459. $38 = ($34|0)==($37|0);
  28460. if ($38) {
  28461. $$2 = 35;
  28462. label = 17;
  28463. break;
  28464. }
  28465. }
  28466. $39 = (Atomics_add(HEAP32, $14>>2, 1)|0);
  28467. $40 = $23 | -2147483648;
  28468. $41 = (Atomics_compareExchange(HEAP32, $13>>2, $23, $40)|0);
  28469. $42 = (___timedwait($13,$40,0,$1,$10)|0);
  28470. $43 = (Atomics_sub(HEAP32, $14>>2, 1)|0);
  28471. switch ($42|0) {
  28472. case 0: case 4: {
  28473. break;
  28474. }
  28475. default: {
  28476. $$2 = $42;
  28477. label = 17;
  28478. break L18;
  28479. }
  28480. }
  28481. }
  28482. }
  28483. $25 = (___pthread_mutex_trylock($0)|0);
  28484. $26 = ($25|0)==(16);
  28485. if (!($26)) {
  28486. $$2 = $25;
  28487. label = 17;
  28488. break;
  28489. }
  28490. }
  28491. if ((label|0) == 17) {
  28492. return ($$2|0);
  28493. }
  28494. return (0)|0;
  28495. }
  28496. function ___timedwait($0,$1,$2,$3,$4) {
  28497. $0 = $0|0;
  28498. $1 = $1|0;
  28499. $2 = $2|0;
  28500. $3 = $3|0;
  28501. $4 = $4|0;
  28502. var $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0;
  28503. sp = STACKTOP;
  28504. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  28505. $5 = sp;
  28506. (___pthread_setcancelstate(1,($5|0))|0);
  28507. _emscripten_conditional_set_current_thread_status(1,4);
  28508. $6 = (___timedwait_cp($0,$1,$2,$3,$4)|0);
  28509. _emscripten_conditional_set_current_thread_status(4,1);
  28510. $7 = HEAP32[$5>>2]|0;
  28511. (___pthread_setcancelstate(($7|0),(0|0))|0);
  28512. STACKTOP = sp;return ($6|0);
  28513. }
  28514. function ___timedwait_cp($0,$1,$2,$3,$4) {
  28515. $0 = $0|0;
  28516. $1 = $1|0;
  28517. $2 = $2|0;
  28518. $3 = $3|0;
  28519. $4 = $4|0;
  28520. 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;
  28521. 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;
  28522. 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;
  28523. sp = STACKTOP;
  28524. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  28525. $5 = sp;
  28526. $6 = ($3|0)!=(0|0);
  28527. if ($6) {
  28528. $7 = ((($3)) + 4|0);
  28529. $8 = HEAP32[$7>>2]|0;
  28530. $9 = ($8>>>0)>(999999999);
  28531. if ($9) {
  28532. $$138 = 22;
  28533. STACKTOP = sp;return ($$138|0);
  28534. }
  28535. $10 = (___clock_gettime(($2|0),($5|0))|0);
  28536. $11 = ($10|0)==(0);
  28537. if (!($11)) {
  28538. $$138 = 22;
  28539. STACKTOP = sp;return ($$138|0);
  28540. }
  28541. $12 = HEAP32[$3>>2]|0;
  28542. $13 = HEAP32[$5>>2]|0;
  28543. $14 = (($12) - ($13))|0;
  28544. HEAP32[$5>>2] = $14;
  28545. $15 = HEAP32[$7>>2]|0;
  28546. $16 = ((($5)) + 4|0);
  28547. $17 = HEAP32[$16>>2]|0;
  28548. $18 = (($15) - ($17))|0;
  28549. HEAP32[$16>>2] = $18;
  28550. $19 = ($18|0)<(0);
  28551. if ($19) {
  28552. $20 = (($14) + -1)|0;
  28553. HEAP32[$5>>2] = $20;
  28554. $21 = (($18) + 1000000000)|0;
  28555. HEAP32[$16>>2] = $21;
  28556. $23 = $20;
  28557. } else {
  28558. $23 = $14;
  28559. }
  28560. $22 = ($23|0)<(0);
  28561. if ($22) {
  28562. $$138 = 110;
  28563. STACKTOP = sp;return ($$138|0);
  28564. }
  28565. }
  28566. $24 = (_emscripten_is_main_runtime_thread()|0);
  28567. $25 = ($24|0)!=(0);
  28568. $$$045 = $25 ? 1.0 : 100.0;
  28569. if ($25) {
  28570. L15: while(1) {
  28571. $26 = (_pthread_self()|0);
  28572. $27 = (__pthread_isduecanceled($26)|0);
  28573. $28 = ($27|0)==(0);
  28574. if (!($28)) {
  28575. $$138$ph = 125;
  28576. break;
  28577. }
  28578. _emscripten_main_thread_process_queued_calls();
  28579. if ($6) {
  28580. $29 = (+__pthread_msecs_until($3));
  28581. $30 = !($29 <= 0.0);
  28582. $31 = $29 > 100.0;
  28583. $$0$us = $31 ? 100.0 : $29;
  28584. $32 = $$0$us > 1.0;
  28585. $$$0$us = $32 ? 1.0 : $$0$us;
  28586. if ($30) {
  28587. $$$046$us = $$$0$us;
  28588. } else {
  28589. $$138$ph = 110;
  28590. break;
  28591. }
  28592. } else {
  28593. $$$046$us = $$$045;
  28594. }
  28595. $33 = (_emscripten_futex_wait(($0|0),($1|0),(+$$$046$us))|0);
  28596. $34 = (0 - ($33))|0;
  28597. switch ($34|0) {
  28598. case 110: {
  28599. break;
  28600. }
  28601. case 4: case 125: {
  28602. $$138$ph = $34;
  28603. break L15;
  28604. break;
  28605. }
  28606. default: {
  28607. $$138 = 0;
  28608. label = 21;
  28609. break L15;
  28610. }
  28611. }
  28612. }
  28613. if ((label|0) == 21) {
  28614. STACKTOP = sp;return ($$138|0);
  28615. }
  28616. $$138 = $$138$ph;
  28617. STACKTOP = sp;return ($$138|0);
  28618. }
  28619. if (!($6)) {
  28620. L27: while(1) {
  28621. $43 = (_pthread_self()|0);
  28622. $44 = (__pthread_isduecanceled($43)|0);
  28623. $45 = ($44|0)==(0);
  28624. if (!($45)) {
  28625. $$138$ph72 = 125;
  28626. break;
  28627. }
  28628. $46 = (_emscripten_futex_wait(($0|0),($1|0),(+$$$045))|0);
  28629. $47 = (0 - ($46))|0;
  28630. switch ($47|0) {
  28631. case 110: {
  28632. break;
  28633. }
  28634. case 4: case 125: {
  28635. $$138$ph72 = $47;
  28636. break L27;
  28637. break;
  28638. }
  28639. default: {
  28640. $$138 = 0;
  28641. label = 21;
  28642. break L27;
  28643. }
  28644. }
  28645. }
  28646. if ((label|0) == 21) {
  28647. STACKTOP = sp;return ($$138|0);
  28648. }
  28649. $$138 = $$138$ph72;
  28650. STACKTOP = sp;return ($$138|0);
  28651. }
  28652. L34: while(1) {
  28653. $35 = (_pthread_self()|0);
  28654. $36 = (__pthread_isduecanceled($35)|0);
  28655. $37 = ($36|0)==(0);
  28656. if (!($37)) {
  28657. $$138$ph70 = 125;
  28658. break;
  28659. }
  28660. $38 = (+__pthread_msecs_until($3));
  28661. $39 = !($38 <= 0.0);
  28662. if (!($39)) {
  28663. $$138$ph70 = 110;
  28664. break;
  28665. }
  28666. $40 = $38 > 100.0;
  28667. $$0$us53 = $40 ? 100.0 : $38;
  28668. $41 = (_emscripten_futex_wait(($0|0),($1|0),(+$$0$us53))|0);
  28669. $42 = (0 - ($41))|0;
  28670. switch ($42|0) {
  28671. case 110: {
  28672. break;
  28673. }
  28674. case 4: case 125: {
  28675. $$138$ph70 = $42;
  28676. break L34;
  28677. break;
  28678. }
  28679. default: {
  28680. $$138 = 0;
  28681. label = 21;
  28682. break L34;
  28683. }
  28684. }
  28685. }
  28686. if ((label|0) == 21) {
  28687. STACKTOP = sp;return ($$138|0);
  28688. }
  28689. $$138 = $$138$ph70;
  28690. STACKTOP = sp;return ($$138|0);
  28691. }
  28692. function __pthread_isduecanceled($0) {
  28693. $0 = $0|0;
  28694. var $1 = 0, $2 = 0, $3 = 0, label = 0, sp = 0;
  28695. sp = STACKTOP;
  28696. $1 = HEAP32[$0>>2]|0;
  28697. $2 = ($1|0)==(2);
  28698. $3 = $2&1;
  28699. return ($3|0);
  28700. }
  28701. function __pthread_msecs_until($0) {
  28702. $0 = $0|0;
  28703. 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;
  28704. sp = STACKTOP;
  28705. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  28706. $1 = sp;
  28707. (_gettimeofday(($1|0),(0|0))|0);
  28708. $2 = HEAP32[$1>>2]|0;
  28709. $3 = (+($2|0));
  28710. $4 = $3 * 1000.0;
  28711. $5 = ((($1)) + 4|0);
  28712. $6 = HEAP32[$5>>2]|0;
  28713. $7 = (+($6|0));
  28714. $8 = $7 * 0.001;
  28715. $9 = $4 + $8;
  28716. $10 = HEAP32[$0>>2]|0;
  28717. $11 = (+($10|0));
  28718. $12 = $11 * 1000.0;
  28719. $13 = ((($0)) + 4|0);
  28720. $14 = HEAP32[$13>>2]|0;
  28721. $15 = (+($14|0));
  28722. $16 = $15 * 9.9999999999999995E-7;
  28723. $17 = $12 + $16;
  28724. $18 = $17 - $9;
  28725. STACKTOP = sp;return (+$18);
  28726. }
  28727. function ___pthread_mutex_trylock($0) {
  28728. $0 = $0|0;
  28729. var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0;
  28730. sp = STACKTOP;
  28731. $1 = HEAP32[$0>>2]|0;
  28732. $2 = $1 & 15;
  28733. $3 = ($2|0)==(0);
  28734. if ($3) {
  28735. $4 = ((($0)) + 4|0);
  28736. $5 = (Atomics_compareExchange(HEAP32, $4>>2, 0, 16)|0);
  28737. $6 = $5 & 16;
  28738. $$0 = $6;
  28739. return ($$0|0);
  28740. } else {
  28741. $7 = (___pthread_mutex_trylock_owner($0)|0);
  28742. $$0 = $7;
  28743. return ($$0|0);
  28744. }
  28745. return (0)|0;
  28746. }
  28747. function ___pthread_mutex_trylock_owner($0) {
  28748. $0 = $0|0;
  28749. 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;
  28750. 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;
  28751. 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;
  28752. sp = STACKTOP;
  28753. $1 = HEAP32[$0>>2]|0;
  28754. $2 = (_pthread_self()|0);
  28755. $3 = ((($2)) + 52|0);
  28756. $4 = HEAP32[$3>>2]|0;
  28757. $5 = ((($0)) + 4|0);
  28758. $6 = (Atomics_load(HEAP32,$5>>2)|0);
  28759. $7 = $6 & 2147483647;
  28760. $8 = ($7|0)==($4|0);
  28761. $9 = $1 & 3;
  28762. $10 = ($9|0)==(1);
  28763. $or$cond = $10 & $8;
  28764. if ($or$cond) {
  28765. $11 = ((($0)) + 20|0);
  28766. $12 = HEAP32[$11>>2]|0;
  28767. $13 = ($12>>>0)>(2147483646);
  28768. if ($13) {
  28769. $$1 = 11;
  28770. return ($$1|0);
  28771. }
  28772. $14 = (($12) + 1)|0;
  28773. HEAP32[$11>>2] = $14;
  28774. $$1 = 0;
  28775. return ($$1|0);
  28776. }
  28777. $15 = ($7|0)==(2147483647);
  28778. if ($15) {
  28779. $$1 = 131;
  28780. return ($$1|0);
  28781. }
  28782. $16 = HEAP32[$0>>2]|0;
  28783. $17 = $16 & 128;
  28784. $18 = ($17|0)==(0);
  28785. if ($18) {
  28786. $$154 = $4;
  28787. } else {
  28788. $19 = ((($2)) + 172|0);
  28789. $20 = HEAP32[$19>>2]|0;
  28790. $21 = ($20|0)==(0);
  28791. if ($21) {
  28792. HEAP32[$19>>2] = -12;
  28793. }
  28794. $22 = ((($0)) + 8|0);
  28795. $23 = (Atomics_load(HEAP32,$22>>2)|0);
  28796. $24 = ($23|0)==(0);
  28797. $25 = $4 | -2147483648;
  28798. $$ = $24 ? $4 : $25;
  28799. $26 = ((($0)) + 16|0);
  28800. $27 = ((($2)) + 176|0);
  28801. Atomics_store(HEAP32,$27>>2,$26)|0;
  28802. $$154 = $$;
  28803. }
  28804. $28 = ($7|0)!=(0);
  28805. if ($28) {
  28806. $29 = $6 & 1073741824;
  28807. $30 = ($29|0)==(0);
  28808. $31 = $1 & 4;
  28809. $32 = ($31|0)==(0);
  28810. $or$cond57 = $32 | $30;
  28811. if (!($or$cond57)) {
  28812. label = 11;
  28813. }
  28814. } else {
  28815. label = 11;
  28816. }
  28817. if ((label|0) == 11) {
  28818. $33 = (Atomics_compareExchange(HEAP32, $5>>2, $6, $$154)|0);
  28819. $34 = ($33|0)==($6|0);
  28820. if ($34) {
  28821. $36 = ((($2)) + 168|0);
  28822. $37 = (Atomics_load(HEAP32,$36>>2)|0);
  28823. $38 = ((($0)) + 16|0);
  28824. HEAP32[$38>>2] = $37;
  28825. $39 = ((($0)) + 12|0);
  28826. HEAP32[$39>>2] = $36;
  28827. $40 = ($37|0)==($36|0);
  28828. if (!($40)) {
  28829. $41 = ((($37)) + -4|0);
  28830. Atomics_store(HEAP32,$41>>2,$38)|0;
  28831. }
  28832. Atomics_store(HEAP32,$36>>2,$38)|0;
  28833. $42 = ((($2)) + 176|0);
  28834. Atomics_store(HEAP32,$42>>2,0)|0;
  28835. if (!($28)) {
  28836. $$1 = 0;
  28837. return ($$1|0);
  28838. }
  28839. $43 = ((($0)) + 20|0);
  28840. HEAP32[$43>>2] = 0;
  28841. $44 = HEAP32[$0>>2]|0;
  28842. $45 = $44 | 8;
  28843. HEAP32[$0>>2] = $45;
  28844. $$1 = 130;
  28845. return ($$1|0);
  28846. }
  28847. }
  28848. $35 = ((($2)) + 176|0);
  28849. Atomics_store(HEAP32,$35>>2,0)|0;
  28850. $$1 = 16;
  28851. return ($$1|0);
  28852. }
  28853. function _pthread_mutexattr_destroy($0) {
  28854. $0 = $0|0;
  28855. var label = 0, sp = 0;
  28856. sp = STACKTOP;
  28857. return 0;
  28858. }
  28859. function _pthread_mutexattr_init($0) {
  28860. $0 = $0|0;
  28861. var label = 0, sp = 0;
  28862. sp = STACKTOP;
  28863. HEAP32[$0>>2] = 0;
  28864. return 0;
  28865. }
  28866. function _pthread_mutex_init($0,$1) {
  28867. $0 = $0|0;
  28868. $1 = $1|0;
  28869. var $$sroa$0 = 0, $2 = 0, $3 = 0, label = 0, sp = 0;
  28870. sp = STACKTOP;
  28871. STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
  28872. $$sroa$0 = sp;
  28873. ;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;
  28874. ;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;
  28875. $2 = ($1|0)==(0|0);
  28876. if ($2) {
  28877. STACKTOP = sp;return 0;
  28878. }
  28879. $3 = HEAP32[$1>>2]|0;
  28880. HEAP32[$0>>2] = $3;
  28881. STACKTOP = sp;return 0;
  28882. }
  28883. function _malloc($0) {
  28884. $0 = $0|0;
  28885. 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;
  28886. 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;
  28887. 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;
  28888. 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;
  28889. 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;
  28890. 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;
  28891. 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;
  28892. 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;
  28893. 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;
  28894. 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;
  28895. 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;
  28896. 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;
  28897. 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;
  28898. 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;
  28899. 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;
  28900. 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;
  28901. 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;
  28902. 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;
  28903. 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;
  28904. 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;
  28905. 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;
  28906. 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;
  28907. 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;
  28908. 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;
  28909. 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;
  28910. 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;
  28911. 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;
  28912. 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;
  28913. 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;
  28914. 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;
  28915. 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;
  28916. 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;
  28917. 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;
  28918. 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;
  28919. 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;
  28920. 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;
  28921. 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;
  28922. 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;
  28923. 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;
  28924. 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;
  28925. 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;
  28926. 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;
  28927. 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;
  28928. 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;
  28929. 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;
  28930. 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;
  28931. 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;
  28932. 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;
  28933. 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;
  28934. 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;
  28935. 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;
  28936. 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;
  28937. 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;
  28938. 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;
  28939. 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;
  28940. 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;
  28941. 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;
  28942. 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;
  28943. 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;
  28944. 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;
  28945. 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;
  28946. sp = STACKTOP;
  28947. STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
  28948. $1 = sp + 4|0;
  28949. $2 = sp;
  28950. $3 = HEAP32[8849]|0;
  28951. $4 = ($3|0)==(0);
  28952. if ($4) {
  28953. (___pthread_mutex_lock(35420)|0);
  28954. $5 = HEAP32[8849]|0;
  28955. $6 = ($5|0)==(0);
  28956. if ($6) {
  28957. HEAP32[(35404)>>2] = 4096;
  28958. HEAP32[(35400)>>2] = 4096;
  28959. HEAP32[(35408)>>2] = -1;
  28960. HEAP32[(35412)>>2] = -1;
  28961. HEAP32[(35416)>>2] = 2;
  28962. HEAP32[(35892)>>2] = 2;
  28963. $7 = (_pthread_mutexattr_init($1)|0);
  28964. $8 = ($7|0)==(0);
  28965. if ($8) {
  28966. $9 = (_pthread_mutex_init((35896),$1)|0);
  28967. $10 = ($9|0)==(0);
  28968. if ($10) {
  28969. }
  28970. }
  28971. $11 = $2;
  28972. $12 = $11 & -16;
  28973. $13 = $12 ^ 1431655768;
  28974. HEAP32[$2>>2] = $13;
  28975. Atomics_store(HEAP32,8849,$13)|0;
  28976. }
  28977. (___pthread_mutex_unlock(35420)|0);
  28978. }
  28979. $14 = HEAP32[(35892)>>2]|0;
  28980. $15 = $14 & 2;
  28981. $16 = ($15|0)==(0);
  28982. if (!($16)) {
  28983. $17 = (___pthread_mutex_lock((35896))|0);
  28984. $18 = ($17|0)==(0);
  28985. if (!($18)) {
  28986. $$1 = 0;
  28987. STACKTOP = sp;return ($$1|0);
  28988. }
  28989. }
  28990. $19 = ($0>>>0)<(245);
  28991. do {
  28992. if ($19) {
  28993. $20 = ($0>>>0)<(11);
  28994. $21 = (($0) + 11)|0;
  28995. $22 = $21 & -8;
  28996. $23 = $20 ? 16 : $22;
  28997. $24 = $23 >>> 3;
  28998. $25 = HEAP32[8862]|0;
  28999. $26 = $25 >>> $24;
  29000. $27 = $26 & 3;
  29001. $28 = ($27|0)==(0);
  29002. if (!($28)) {
  29003. $29 = $26 & 1;
  29004. $30 = $29 ^ 1;
  29005. $31 = (($30) + ($24))|0;
  29006. $32 = $31 << 1;
  29007. $33 = (35488 + ($32<<2)|0);
  29008. $34 = ((($33)) + 8|0);
  29009. $35 = HEAP32[$34>>2]|0;
  29010. $36 = ((($35)) + 8|0);
  29011. $37 = HEAP32[$36>>2]|0;
  29012. $38 = ($33|0)==($37|0);
  29013. do {
  29014. if ($38) {
  29015. $39 = 1 << $31;
  29016. $40 = $39 ^ -1;
  29017. $41 = $25 & $40;
  29018. HEAP32[8862] = $41;
  29019. } else {
  29020. $42 = HEAP32[(35464)>>2]|0;
  29021. $43 = ($37>>>0)<($42>>>0);
  29022. if ($43) {
  29023. _abort();
  29024. // unreachable;
  29025. }
  29026. $44 = ((($37)) + 12|0);
  29027. $45 = HEAP32[$44>>2]|0;
  29028. $46 = ($45|0)==($35|0);
  29029. if ($46) {
  29030. HEAP32[$44>>2] = $33;
  29031. HEAP32[$34>>2] = $37;
  29032. break;
  29033. } else {
  29034. _abort();
  29035. // unreachable;
  29036. }
  29037. }
  29038. } while(0);
  29039. $47 = $31 << 3;
  29040. $48 = $47 | 3;
  29041. $49 = ((($35)) + 4|0);
  29042. HEAP32[$49>>2] = $48;
  29043. $50 = (($35) + ($47)|0);
  29044. $51 = ((($50)) + 4|0);
  29045. $52 = HEAP32[$51>>2]|0;
  29046. $53 = $52 | 1;
  29047. HEAP32[$51>>2] = $53;
  29048. $$2 = $36;
  29049. break;
  29050. }
  29051. $54 = HEAP32[(35456)>>2]|0;
  29052. $55 = ($23>>>0)>($54>>>0);
  29053. if ($55) {
  29054. $56 = ($26|0)==(0);
  29055. if (!($56)) {
  29056. $57 = $26 << $24;
  29057. $58 = 2 << $24;
  29058. $59 = (0 - ($58))|0;
  29059. $60 = $58 | $59;
  29060. $61 = $57 & $60;
  29061. $62 = (0 - ($61))|0;
  29062. $63 = $61 & $62;
  29063. $64 = (($63) + -1)|0;
  29064. $65 = $64 >>> 12;
  29065. $66 = $65 & 16;
  29066. $67 = $64 >>> $66;
  29067. $68 = $67 >>> 5;
  29068. $69 = $68 & 8;
  29069. $70 = $69 | $66;
  29070. $71 = $67 >>> $69;
  29071. $72 = $71 >>> 2;
  29072. $73 = $72 & 4;
  29073. $74 = $70 | $73;
  29074. $75 = $71 >>> $73;
  29075. $76 = $75 >>> 1;
  29076. $77 = $76 & 2;
  29077. $78 = $74 | $77;
  29078. $79 = $75 >>> $77;
  29079. $80 = $79 >>> 1;
  29080. $81 = $80 & 1;
  29081. $82 = $78 | $81;
  29082. $83 = $79 >>> $81;
  29083. $84 = (($82) + ($83))|0;
  29084. $85 = $84 << 1;
  29085. $86 = (35488 + ($85<<2)|0);
  29086. $87 = ((($86)) + 8|0);
  29087. $88 = HEAP32[$87>>2]|0;
  29088. $89 = ((($88)) + 8|0);
  29089. $90 = HEAP32[$89>>2]|0;
  29090. $91 = ($86|0)==($90|0);
  29091. do {
  29092. if ($91) {
  29093. $92 = 1 << $84;
  29094. $93 = $92 ^ -1;
  29095. $94 = $25 & $93;
  29096. HEAP32[8862] = $94;
  29097. $115 = $94;
  29098. } else {
  29099. $95 = HEAP32[(35464)>>2]|0;
  29100. $96 = ($90>>>0)<($95>>>0);
  29101. if ($96) {
  29102. _abort();
  29103. // unreachable;
  29104. }
  29105. $97 = ((($90)) + 12|0);
  29106. $98 = HEAP32[$97>>2]|0;
  29107. $99 = ($98|0)==($88|0);
  29108. if ($99) {
  29109. HEAP32[$97>>2] = $86;
  29110. HEAP32[$87>>2] = $90;
  29111. $115 = $25;
  29112. break;
  29113. } else {
  29114. _abort();
  29115. // unreachable;
  29116. }
  29117. }
  29118. } while(0);
  29119. $100 = $84 << 3;
  29120. $101 = (($100) - ($23))|0;
  29121. $102 = $23 | 3;
  29122. $103 = ((($88)) + 4|0);
  29123. HEAP32[$103>>2] = $102;
  29124. $104 = (($88) + ($23)|0);
  29125. $105 = $101 | 1;
  29126. $106 = ((($104)) + 4|0);
  29127. HEAP32[$106>>2] = $105;
  29128. $107 = (($104) + ($101)|0);
  29129. HEAP32[$107>>2] = $101;
  29130. $108 = ($54|0)==(0);
  29131. if (!($108)) {
  29132. $109 = HEAP32[(35468)>>2]|0;
  29133. $110 = $54 >>> 3;
  29134. $111 = $110 << 1;
  29135. $112 = (35488 + ($111<<2)|0);
  29136. $113 = 1 << $110;
  29137. $114 = $115 & $113;
  29138. $116 = ($114|0)==(0);
  29139. if ($116) {
  29140. $117 = $115 | $113;
  29141. HEAP32[8862] = $117;
  29142. $$pre = ((($112)) + 8|0);
  29143. $$0200 = $112;$$pre$phiZ2D = $$pre;
  29144. } else {
  29145. $118 = ((($112)) + 8|0);
  29146. $119 = HEAP32[$118>>2]|0;
  29147. $120 = HEAP32[(35464)>>2]|0;
  29148. $121 = ($119>>>0)<($120>>>0);
  29149. if ($121) {
  29150. _abort();
  29151. // unreachable;
  29152. } else {
  29153. $$0200 = $119;$$pre$phiZ2D = $118;
  29154. }
  29155. }
  29156. HEAP32[$$pre$phiZ2D>>2] = $109;
  29157. $122 = ((($$0200)) + 12|0);
  29158. HEAP32[$122>>2] = $109;
  29159. $123 = ((($109)) + 8|0);
  29160. HEAP32[$123>>2] = $$0200;
  29161. $124 = ((($109)) + 12|0);
  29162. HEAP32[$124>>2] = $112;
  29163. }
  29164. HEAP32[(35456)>>2] = $101;
  29165. HEAP32[(35468)>>2] = $104;
  29166. $$2 = $89;
  29167. break;
  29168. }
  29169. $125 = HEAP32[(35452)>>2]|0;
  29170. $126 = ($125|0)==(0);
  29171. if ($126) {
  29172. $$0198 = $23;
  29173. label = 153;
  29174. } else {
  29175. $127 = (0 - ($125))|0;
  29176. $128 = $125 & $127;
  29177. $129 = (($128) + -1)|0;
  29178. $130 = $129 >>> 12;
  29179. $131 = $130 & 16;
  29180. $132 = $129 >>> $131;
  29181. $133 = $132 >>> 5;
  29182. $134 = $133 & 8;
  29183. $135 = $134 | $131;
  29184. $136 = $132 >>> $134;
  29185. $137 = $136 >>> 2;
  29186. $138 = $137 & 4;
  29187. $139 = $135 | $138;
  29188. $140 = $136 >>> $138;
  29189. $141 = $140 >>> 1;
  29190. $142 = $141 & 2;
  29191. $143 = $139 | $142;
  29192. $144 = $140 >>> $142;
  29193. $145 = $144 >>> 1;
  29194. $146 = $145 & 1;
  29195. $147 = $143 | $146;
  29196. $148 = $144 >>> $146;
  29197. $149 = (($147) + ($148))|0;
  29198. $150 = (35752 + ($149<<2)|0);
  29199. $151 = HEAP32[$150>>2]|0;
  29200. $152 = ((($151)) + 4|0);
  29201. $153 = HEAP32[$152>>2]|0;
  29202. $154 = $153 & -8;
  29203. $155 = (($154) - ($23))|0;
  29204. $156 = ((($151)) + 16|0);
  29205. $157 = HEAP32[$156>>2]|0;
  29206. $not$5$i = ($157|0)==(0|0);
  29207. $$sink16$i = $not$5$i&1;
  29208. $158 = (((($151)) + 16|0) + ($$sink16$i<<2)|0);
  29209. $159 = HEAP32[$158>>2]|0;
  29210. $160 = ($159|0)==(0|0);
  29211. if ($160) {
  29212. $$0192$lcssa$i = $151;$$0193$lcssa$i = $155;
  29213. } else {
  29214. $$01928$i = $151;$$01937$i = $155;$162 = $159;
  29215. while(1) {
  29216. $161 = ((($162)) + 4|0);
  29217. $163 = HEAP32[$161>>2]|0;
  29218. $164 = $163 & -8;
  29219. $165 = (($164) - ($23))|0;
  29220. $166 = ($165>>>0)<($$01937$i>>>0);
  29221. $$$0193$i = $166 ? $165 : $$01937$i;
  29222. $$$0192$i = $166 ? $162 : $$01928$i;
  29223. $167 = ((($162)) + 16|0);
  29224. $168 = HEAP32[$167>>2]|0;
  29225. $not$$i = ($168|0)==(0|0);
  29226. $$sink1$i = $not$$i&1;
  29227. $169 = (((($162)) + 16|0) + ($$sink1$i<<2)|0);
  29228. $170 = HEAP32[$169>>2]|0;
  29229. $171 = ($170|0)==(0|0);
  29230. if ($171) {
  29231. $$0192$lcssa$i = $$$0192$i;$$0193$lcssa$i = $$$0193$i;
  29232. break;
  29233. } else {
  29234. $$01928$i = $$$0192$i;$$01937$i = $$$0193$i;$162 = $170;
  29235. }
  29236. }
  29237. }
  29238. $172 = HEAP32[(35464)>>2]|0;
  29239. $173 = ($$0192$lcssa$i>>>0)<($172>>>0);
  29240. if ($173) {
  29241. _abort();
  29242. // unreachable;
  29243. }
  29244. $174 = (($$0192$lcssa$i) + ($23)|0);
  29245. $175 = ($$0192$lcssa$i>>>0)<($174>>>0);
  29246. if (!($175)) {
  29247. _abort();
  29248. // unreachable;
  29249. }
  29250. $176 = ((($$0192$lcssa$i)) + 24|0);
  29251. $177 = HEAP32[$176>>2]|0;
  29252. $178 = ((($$0192$lcssa$i)) + 12|0);
  29253. $179 = HEAP32[$178>>2]|0;
  29254. $180 = ($179|0)==($$0192$lcssa$i|0);
  29255. do {
  29256. if ($180) {
  29257. $190 = ((($$0192$lcssa$i)) + 20|0);
  29258. $191 = HEAP32[$190>>2]|0;
  29259. $192 = ($191|0)==(0|0);
  29260. if ($192) {
  29261. $193 = ((($$0192$lcssa$i)) + 16|0);
  29262. $194 = HEAP32[$193>>2]|0;
  29263. $195 = ($194|0)==(0|0);
  29264. if ($195) {
  29265. $$3$i = 0;
  29266. break;
  29267. } else {
  29268. $$1196$i = $194;$$1198$i = $193;
  29269. }
  29270. } else {
  29271. $$1196$i = $191;$$1198$i = $190;
  29272. }
  29273. while(1) {
  29274. $196 = ((($$1196$i)) + 20|0);
  29275. $197 = HEAP32[$196>>2]|0;
  29276. $198 = ($197|0)==(0|0);
  29277. if (!($198)) {
  29278. $$1196$i = $197;$$1198$i = $196;
  29279. continue;
  29280. }
  29281. $199 = ((($$1196$i)) + 16|0);
  29282. $200 = HEAP32[$199>>2]|0;
  29283. $201 = ($200|0)==(0|0);
  29284. if ($201) {
  29285. break;
  29286. } else {
  29287. $$1196$i = $200;$$1198$i = $199;
  29288. }
  29289. }
  29290. $202 = ($$1198$i>>>0)<($172>>>0);
  29291. if ($202) {
  29292. _abort();
  29293. // unreachable;
  29294. } else {
  29295. HEAP32[$$1198$i>>2] = 0;
  29296. $$3$i = $$1196$i;
  29297. break;
  29298. }
  29299. } else {
  29300. $181 = ((($$0192$lcssa$i)) + 8|0);
  29301. $182 = HEAP32[$181>>2]|0;
  29302. $183 = ($182>>>0)<($172>>>0);
  29303. if ($183) {
  29304. _abort();
  29305. // unreachable;
  29306. }
  29307. $184 = ((($182)) + 12|0);
  29308. $185 = HEAP32[$184>>2]|0;
  29309. $186 = ($185|0)==($$0192$lcssa$i|0);
  29310. if (!($186)) {
  29311. _abort();
  29312. // unreachable;
  29313. }
  29314. $187 = ((($179)) + 8|0);
  29315. $188 = HEAP32[$187>>2]|0;
  29316. $189 = ($188|0)==($$0192$lcssa$i|0);
  29317. if ($189) {
  29318. HEAP32[$184>>2] = $179;
  29319. HEAP32[$187>>2] = $182;
  29320. $$3$i = $179;
  29321. break;
  29322. } else {
  29323. _abort();
  29324. // unreachable;
  29325. }
  29326. }
  29327. } while(0);
  29328. $203 = ($177|0)==(0|0);
  29329. L85: do {
  29330. if (!($203)) {
  29331. $204 = ((($$0192$lcssa$i)) + 28|0);
  29332. $205 = HEAP32[$204>>2]|0;
  29333. $206 = (35752 + ($205<<2)|0);
  29334. $207 = HEAP32[$206>>2]|0;
  29335. $208 = ($$0192$lcssa$i|0)==($207|0);
  29336. do {
  29337. if ($208) {
  29338. HEAP32[$206>>2] = $$3$i;
  29339. $cond$i = ($$3$i|0)==(0|0);
  29340. if ($cond$i) {
  29341. $209 = 1 << $205;
  29342. $210 = $209 ^ -1;
  29343. $211 = $125 & $210;
  29344. HEAP32[(35452)>>2] = $211;
  29345. break L85;
  29346. }
  29347. } else {
  29348. $212 = HEAP32[(35464)>>2]|0;
  29349. $213 = ($177>>>0)<($212>>>0);
  29350. if ($213) {
  29351. _abort();
  29352. // unreachable;
  29353. } else {
  29354. $214 = ((($177)) + 16|0);
  29355. $215 = HEAP32[$214>>2]|0;
  29356. $not$1$i = ($215|0)!=($$0192$lcssa$i|0);
  29357. $$sink2$i = $not$1$i&1;
  29358. $216 = (((($177)) + 16|0) + ($$sink2$i<<2)|0);
  29359. HEAP32[$216>>2] = $$3$i;
  29360. $217 = ($$3$i|0)==(0|0);
  29361. if ($217) {
  29362. break L85;
  29363. } else {
  29364. break;
  29365. }
  29366. }
  29367. }
  29368. } while(0);
  29369. $218 = HEAP32[(35464)>>2]|0;
  29370. $219 = ($$3$i>>>0)<($218>>>0);
  29371. if ($219) {
  29372. _abort();
  29373. // unreachable;
  29374. }
  29375. $220 = ((($$3$i)) + 24|0);
  29376. HEAP32[$220>>2] = $177;
  29377. $221 = ((($$0192$lcssa$i)) + 16|0);
  29378. $222 = HEAP32[$221>>2]|0;
  29379. $223 = ($222|0)==(0|0);
  29380. do {
  29381. if (!($223)) {
  29382. $224 = ($222>>>0)<($218>>>0);
  29383. if ($224) {
  29384. _abort();
  29385. // unreachable;
  29386. } else {
  29387. $225 = ((($$3$i)) + 16|0);
  29388. HEAP32[$225>>2] = $222;
  29389. $226 = ((($222)) + 24|0);
  29390. HEAP32[$226>>2] = $$3$i;
  29391. break;
  29392. }
  29393. }
  29394. } while(0);
  29395. $227 = ((($$0192$lcssa$i)) + 20|0);
  29396. $228 = HEAP32[$227>>2]|0;
  29397. $229 = ($228|0)==(0|0);
  29398. if (!($229)) {
  29399. $230 = HEAP32[(35464)>>2]|0;
  29400. $231 = ($228>>>0)<($230>>>0);
  29401. if ($231) {
  29402. _abort();
  29403. // unreachable;
  29404. } else {
  29405. $232 = ((($$3$i)) + 20|0);
  29406. HEAP32[$232>>2] = $228;
  29407. $233 = ((($228)) + 24|0);
  29408. HEAP32[$233>>2] = $$3$i;
  29409. break;
  29410. }
  29411. }
  29412. }
  29413. } while(0);
  29414. $234 = ($$0193$lcssa$i>>>0)<(16);
  29415. if ($234) {
  29416. $235 = (($$0193$lcssa$i) + ($23))|0;
  29417. $236 = $235 | 3;
  29418. $237 = ((($$0192$lcssa$i)) + 4|0);
  29419. HEAP32[$237>>2] = $236;
  29420. $238 = (($$0192$lcssa$i) + ($235)|0);
  29421. $239 = ((($238)) + 4|0);
  29422. $240 = HEAP32[$239>>2]|0;
  29423. $241 = $240 | 1;
  29424. HEAP32[$239>>2] = $241;
  29425. } else {
  29426. $242 = $23 | 3;
  29427. $243 = ((($$0192$lcssa$i)) + 4|0);
  29428. HEAP32[$243>>2] = $242;
  29429. $244 = $$0193$lcssa$i | 1;
  29430. $245 = ((($174)) + 4|0);
  29431. HEAP32[$245>>2] = $244;
  29432. $246 = (($174) + ($$0193$lcssa$i)|0);
  29433. HEAP32[$246>>2] = $$0193$lcssa$i;
  29434. $247 = ($54|0)==(0);
  29435. if (!($247)) {
  29436. $248 = HEAP32[(35468)>>2]|0;
  29437. $249 = $54 >>> 3;
  29438. $250 = $249 << 1;
  29439. $251 = (35488 + ($250<<2)|0);
  29440. $252 = 1 << $249;
  29441. $253 = $25 & $252;
  29442. $254 = ($253|0)==(0);
  29443. if ($254) {
  29444. $255 = $25 | $252;
  29445. HEAP32[8862] = $255;
  29446. $$pre$i = ((($251)) + 8|0);
  29447. $$0189$i = $251;$$pre$phi$iZ2D = $$pre$i;
  29448. } else {
  29449. $256 = ((($251)) + 8|0);
  29450. $257 = HEAP32[$256>>2]|0;
  29451. $258 = HEAP32[(35464)>>2]|0;
  29452. $259 = ($257>>>0)<($258>>>0);
  29453. if ($259) {
  29454. _abort();
  29455. // unreachable;
  29456. } else {
  29457. $$0189$i = $257;$$pre$phi$iZ2D = $256;
  29458. }
  29459. }
  29460. HEAP32[$$pre$phi$iZ2D>>2] = $248;
  29461. $260 = ((($$0189$i)) + 12|0);
  29462. HEAP32[$260>>2] = $248;
  29463. $261 = ((($248)) + 8|0);
  29464. HEAP32[$261>>2] = $$0189$i;
  29465. $262 = ((($248)) + 12|0);
  29466. HEAP32[$262>>2] = $251;
  29467. }
  29468. HEAP32[(35456)>>2] = $$0193$lcssa$i;
  29469. HEAP32[(35468)>>2] = $174;
  29470. }
  29471. $263 = ((($$0192$lcssa$i)) + 8|0);
  29472. $$2 = $263;
  29473. }
  29474. } else {
  29475. $$0198 = $23;
  29476. label = 153;
  29477. }
  29478. } else {
  29479. $264 = ($0>>>0)>(4294967231);
  29480. if ($264) {
  29481. $$0198 = -1;
  29482. label = 153;
  29483. } else {
  29484. $265 = (($0) + 11)|0;
  29485. $266 = $265 & -8;
  29486. $267 = HEAP32[(35452)>>2]|0;
  29487. $268 = ($267|0)==(0);
  29488. if ($268) {
  29489. $$0198 = $266;
  29490. label = 153;
  29491. } else {
  29492. $269 = (0 - ($266))|0;
  29493. $270 = $265 >>> 8;
  29494. $271 = ($270|0)==(0);
  29495. if ($271) {
  29496. $$0358$i = 0;
  29497. } else {
  29498. $272 = ($266>>>0)>(16777215);
  29499. if ($272) {
  29500. $$0358$i = 31;
  29501. } else {
  29502. $273 = (($270) + 1048320)|0;
  29503. $274 = $273 >>> 16;
  29504. $275 = $274 & 8;
  29505. $276 = $270 << $275;
  29506. $277 = (($276) + 520192)|0;
  29507. $278 = $277 >>> 16;
  29508. $279 = $278 & 4;
  29509. $280 = $279 | $275;
  29510. $281 = $276 << $279;
  29511. $282 = (($281) + 245760)|0;
  29512. $283 = $282 >>> 16;
  29513. $284 = $283 & 2;
  29514. $285 = $280 | $284;
  29515. $286 = (14 - ($285))|0;
  29516. $287 = $281 << $284;
  29517. $288 = $287 >>> 15;
  29518. $289 = (($286) + ($288))|0;
  29519. $290 = $289 << 1;
  29520. $291 = (($289) + 7)|0;
  29521. $292 = $266 >>> $291;
  29522. $293 = $292 & 1;
  29523. $294 = $293 | $290;
  29524. $$0358$i = $294;
  29525. }
  29526. }
  29527. $295 = (35752 + ($$0358$i<<2)|0);
  29528. $296 = HEAP32[$295>>2]|0;
  29529. $297 = ($296|0)==(0|0);
  29530. L128: do {
  29531. if ($297) {
  29532. $$2355$i = 0;$$3$i202 = 0;$$3350$i = $269;
  29533. label = 90;
  29534. } else {
  29535. $298 = ($$0358$i|0)==(31);
  29536. $299 = $$0358$i >>> 1;
  29537. $300 = (25 - ($299))|0;
  29538. $301 = $298 ? 0 : $300;
  29539. $302 = $266 << $301;
  29540. $$0342$i = 0;$$0347$i = $269;$$0353$i = $296;$$0359$i = $302;$$0362$i = 0;
  29541. while(1) {
  29542. $303 = ((($$0353$i)) + 4|0);
  29543. $304 = HEAP32[$303>>2]|0;
  29544. $305 = $304 & -8;
  29545. $306 = (($305) - ($266))|0;
  29546. $307 = ($306>>>0)<($$0347$i>>>0);
  29547. if ($307) {
  29548. $308 = ($306|0)==(0);
  29549. if ($308) {
  29550. $$415$i = $$0353$i;$$435114$i = 0;$$435713$i = $$0353$i;
  29551. label = 94;
  29552. break L128;
  29553. } else {
  29554. $$1343$i = $$0353$i;$$1348$i = $306;
  29555. }
  29556. } else {
  29557. $$1343$i = $$0342$i;$$1348$i = $$0347$i;
  29558. }
  29559. $309 = ((($$0353$i)) + 20|0);
  29560. $310 = HEAP32[$309>>2]|0;
  29561. $311 = $$0359$i >>> 31;
  29562. $312 = (((($$0353$i)) + 16|0) + ($311<<2)|0);
  29563. $313 = HEAP32[$312>>2]|0;
  29564. $314 = ($310|0)==(0|0);
  29565. $315 = ($310|0)==($313|0);
  29566. $or$cond2$i = $314 | $315;
  29567. $$1363$i = $or$cond2$i ? $$0362$i : $310;
  29568. $316 = ($313|0)==(0|0);
  29569. $not$8$i = $316 ^ 1;
  29570. $317 = $not$8$i&1;
  29571. $$0359$$i = $$0359$i << $317;
  29572. if ($316) {
  29573. $$2355$i = $$1363$i;$$3$i202 = $$1343$i;$$3350$i = $$1348$i;
  29574. label = 90;
  29575. break;
  29576. } else {
  29577. $$0342$i = $$1343$i;$$0347$i = $$1348$i;$$0353$i = $313;$$0359$i = $$0359$$i;$$0362$i = $$1363$i;
  29578. }
  29579. }
  29580. }
  29581. } while(0);
  29582. if ((label|0) == 90) {
  29583. $318 = ($$2355$i|0)==(0|0);
  29584. $319 = ($$3$i202|0)==(0|0);
  29585. $or$cond$i = $318 & $319;
  29586. if ($or$cond$i) {
  29587. $320 = 2 << $$0358$i;
  29588. $321 = (0 - ($320))|0;
  29589. $322 = $320 | $321;
  29590. $323 = $267 & $322;
  29591. $324 = ($323|0)==(0);
  29592. if ($324) {
  29593. $$0198 = $266;
  29594. label = 153;
  29595. break;
  29596. }
  29597. $325 = (0 - ($323))|0;
  29598. $326 = $323 & $325;
  29599. $327 = (($326) + -1)|0;
  29600. $328 = $327 >>> 12;
  29601. $329 = $328 & 16;
  29602. $330 = $327 >>> $329;
  29603. $331 = $330 >>> 5;
  29604. $332 = $331 & 8;
  29605. $333 = $332 | $329;
  29606. $334 = $330 >>> $332;
  29607. $335 = $334 >>> 2;
  29608. $336 = $335 & 4;
  29609. $337 = $333 | $336;
  29610. $338 = $334 >>> $336;
  29611. $339 = $338 >>> 1;
  29612. $340 = $339 & 2;
  29613. $341 = $337 | $340;
  29614. $342 = $338 >>> $340;
  29615. $343 = $342 >>> 1;
  29616. $344 = $343 & 1;
  29617. $345 = $341 | $344;
  29618. $346 = $342 >>> $344;
  29619. $347 = (($345) + ($346))|0;
  29620. $348 = (35752 + ($347<<2)|0);
  29621. $349 = HEAP32[$348>>2]|0;
  29622. $$4$ph$i = 0;$$4357$ph$i = $349;
  29623. } else {
  29624. $$4$ph$i = $$3$i202;$$4357$ph$i = $$2355$i;
  29625. }
  29626. $350 = ($$4357$ph$i|0)==(0|0);
  29627. if ($350) {
  29628. $$4$lcssa$i = $$4$ph$i;$$4351$lcssa$i = $$3350$i;
  29629. } else {
  29630. $$415$i = $$4$ph$i;$$435114$i = $$3350$i;$$435713$i = $$4357$ph$i;
  29631. label = 94;
  29632. }
  29633. }
  29634. if ((label|0) == 94) {
  29635. while(1) {
  29636. label = 0;
  29637. $351 = ((($$435713$i)) + 4|0);
  29638. $352 = HEAP32[$351>>2]|0;
  29639. $353 = $352 & -8;
  29640. $354 = (($353) - ($266))|0;
  29641. $355 = ($354>>>0)<($$435114$i>>>0);
  29642. $$$4351$i = $355 ? $354 : $$435114$i;
  29643. $$4357$$4$i = $355 ? $$435713$i : $$415$i;
  29644. $356 = ((($$435713$i)) + 16|0);
  29645. $357 = HEAP32[$356>>2]|0;
  29646. $not$1$i204 = ($357|0)==(0|0);
  29647. $$sink2$i205 = $not$1$i204&1;
  29648. $358 = (((($$435713$i)) + 16|0) + ($$sink2$i205<<2)|0);
  29649. $359 = HEAP32[$358>>2]|0;
  29650. $360 = ($359|0)==(0|0);
  29651. if ($360) {
  29652. $$4$lcssa$i = $$4357$$4$i;$$4351$lcssa$i = $$$4351$i;
  29653. break;
  29654. } else {
  29655. $$415$i = $$4357$$4$i;$$435114$i = $$$4351$i;$$435713$i = $359;
  29656. label = 94;
  29657. }
  29658. }
  29659. }
  29660. $361 = ($$4$lcssa$i|0)==(0|0);
  29661. if ($361) {
  29662. $$0198 = $266;
  29663. label = 153;
  29664. } else {
  29665. $362 = HEAP32[(35456)>>2]|0;
  29666. $363 = (($362) - ($266))|0;
  29667. $364 = ($$4351$lcssa$i>>>0)<($363>>>0);
  29668. if ($364) {
  29669. $365 = HEAP32[(35464)>>2]|0;
  29670. $366 = ($$4$lcssa$i>>>0)<($365>>>0);
  29671. if ($366) {
  29672. _abort();
  29673. // unreachable;
  29674. }
  29675. $367 = (($$4$lcssa$i) + ($266)|0);
  29676. $368 = ($$4$lcssa$i>>>0)<($367>>>0);
  29677. if (!($368)) {
  29678. _abort();
  29679. // unreachable;
  29680. }
  29681. $369 = ((($$4$lcssa$i)) + 24|0);
  29682. $370 = HEAP32[$369>>2]|0;
  29683. $371 = ((($$4$lcssa$i)) + 12|0);
  29684. $372 = HEAP32[$371>>2]|0;
  29685. $373 = ($372|0)==($$4$lcssa$i|0);
  29686. do {
  29687. if ($373) {
  29688. $383 = ((($$4$lcssa$i)) + 20|0);
  29689. $384 = HEAP32[$383>>2]|0;
  29690. $385 = ($384|0)==(0|0);
  29691. if ($385) {
  29692. $386 = ((($$4$lcssa$i)) + 16|0);
  29693. $387 = HEAP32[$386>>2]|0;
  29694. $388 = ($387|0)==(0|0);
  29695. if ($388) {
  29696. $$3372$i = 0;
  29697. break;
  29698. } else {
  29699. $$1370$i = $387;$$1374$i = $386;
  29700. }
  29701. } else {
  29702. $$1370$i = $384;$$1374$i = $383;
  29703. }
  29704. while(1) {
  29705. $389 = ((($$1370$i)) + 20|0);
  29706. $390 = HEAP32[$389>>2]|0;
  29707. $391 = ($390|0)==(0|0);
  29708. if (!($391)) {
  29709. $$1370$i = $390;$$1374$i = $389;
  29710. continue;
  29711. }
  29712. $392 = ((($$1370$i)) + 16|0);
  29713. $393 = HEAP32[$392>>2]|0;
  29714. $394 = ($393|0)==(0|0);
  29715. if ($394) {
  29716. break;
  29717. } else {
  29718. $$1370$i = $393;$$1374$i = $392;
  29719. }
  29720. }
  29721. $395 = ($$1374$i>>>0)<($365>>>0);
  29722. if ($395) {
  29723. _abort();
  29724. // unreachable;
  29725. } else {
  29726. HEAP32[$$1374$i>>2] = 0;
  29727. $$3372$i = $$1370$i;
  29728. break;
  29729. }
  29730. } else {
  29731. $374 = ((($$4$lcssa$i)) + 8|0);
  29732. $375 = HEAP32[$374>>2]|0;
  29733. $376 = ($375>>>0)<($365>>>0);
  29734. if ($376) {
  29735. _abort();
  29736. // unreachable;
  29737. }
  29738. $377 = ((($375)) + 12|0);
  29739. $378 = HEAP32[$377>>2]|0;
  29740. $379 = ($378|0)==($$4$lcssa$i|0);
  29741. if (!($379)) {
  29742. _abort();
  29743. // unreachable;
  29744. }
  29745. $380 = ((($372)) + 8|0);
  29746. $381 = HEAP32[$380>>2]|0;
  29747. $382 = ($381|0)==($$4$lcssa$i|0);
  29748. if ($382) {
  29749. HEAP32[$377>>2] = $372;
  29750. HEAP32[$380>>2] = $375;
  29751. $$3372$i = $372;
  29752. break;
  29753. } else {
  29754. _abort();
  29755. // unreachable;
  29756. }
  29757. }
  29758. } while(0);
  29759. $396 = ($370|0)==(0|0);
  29760. L175: do {
  29761. if ($396) {
  29762. $487 = $267;
  29763. } else {
  29764. $397 = ((($$4$lcssa$i)) + 28|0);
  29765. $398 = HEAP32[$397>>2]|0;
  29766. $399 = (35752 + ($398<<2)|0);
  29767. $400 = HEAP32[$399>>2]|0;
  29768. $401 = ($$4$lcssa$i|0)==($400|0);
  29769. do {
  29770. if ($401) {
  29771. HEAP32[$399>>2] = $$3372$i;
  29772. $cond$i209 = ($$3372$i|0)==(0|0);
  29773. if ($cond$i209) {
  29774. $402 = 1 << $398;
  29775. $403 = $402 ^ -1;
  29776. $404 = $267 & $403;
  29777. HEAP32[(35452)>>2] = $404;
  29778. $487 = $404;
  29779. break L175;
  29780. }
  29781. } else {
  29782. $405 = HEAP32[(35464)>>2]|0;
  29783. $406 = ($370>>>0)<($405>>>0);
  29784. if ($406) {
  29785. _abort();
  29786. // unreachable;
  29787. } else {
  29788. $407 = ((($370)) + 16|0);
  29789. $408 = HEAP32[$407>>2]|0;
  29790. $not$$i210 = ($408|0)!=($$4$lcssa$i|0);
  29791. $$sink3$i = $not$$i210&1;
  29792. $409 = (((($370)) + 16|0) + ($$sink3$i<<2)|0);
  29793. HEAP32[$409>>2] = $$3372$i;
  29794. $410 = ($$3372$i|0)==(0|0);
  29795. if ($410) {
  29796. $487 = $267;
  29797. break L175;
  29798. } else {
  29799. break;
  29800. }
  29801. }
  29802. }
  29803. } while(0);
  29804. $411 = HEAP32[(35464)>>2]|0;
  29805. $412 = ($$3372$i>>>0)<($411>>>0);
  29806. if ($412) {
  29807. _abort();
  29808. // unreachable;
  29809. }
  29810. $413 = ((($$3372$i)) + 24|0);
  29811. HEAP32[$413>>2] = $370;
  29812. $414 = ((($$4$lcssa$i)) + 16|0);
  29813. $415 = HEAP32[$414>>2]|0;
  29814. $416 = ($415|0)==(0|0);
  29815. do {
  29816. if (!($416)) {
  29817. $417 = ($415>>>0)<($411>>>0);
  29818. if ($417) {
  29819. _abort();
  29820. // unreachable;
  29821. } else {
  29822. $418 = ((($$3372$i)) + 16|0);
  29823. HEAP32[$418>>2] = $415;
  29824. $419 = ((($415)) + 24|0);
  29825. HEAP32[$419>>2] = $$3372$i;
  29826. break;
  29827. }
  29828. }
  29829. } while(0);
  29830. $420 = ((($$4$lcssa$i)) + 20|0);
  29831. $421 = HEAP32[$420>>2]|0;
  29832. $422 = ($421|0)==(0|0);
  29833. if ($422) {
  29834. $487 = $267;
  29835. } else {
  29836. $423 = HEAP32[(35464)>>2]|0;
  29837. $424 = ($421>>>0)<($423>>>0);
  29838. if ($424) {
  29839. _abort();
  29840. // unreachable;
  29841. } else {
  29842. $425 = ((($$3372$i)) + 20|0);
  29843. HEAP32[$425>>2] = $421;
  29844. $426 = ((($421)) + 24|0);
  29845. HEAP32[$426>>2] = $$3372$i;
  29846. $487 = $267;
  29847. break;
  29848. }
  29849. }
  29850. }
  29851. } while(0);
  29852. $427 = ($$4351$lcssa$i>>>0)<(16);
  29853. do {
  29854. if ($427) {
  29855. $428 = (($$4351$lcssa$i) + ($266))|0;
  29856. $429 = $428 | 3;
  29857. $430 = ((($$4$lcssa$i)) + 4|0);
  29858. HEAP32[$430>>2] = $429;
  29859. $431 = (($$4$lcssa$i) + ($428)|0);
  29860. $432 = ((($431)) + 4|0);
  29861. $433 = HEAP32[$432>>2]|0;
  29862. $434 = $433 | 1;
  29863. HEAP32[$432>>2] = $434;
  29864. } else {
  29865. $435 = $266 | 3;
  29866. $436 = ((($$4$lcssa$i)) + 4|0);
  29867. HEAP32[$436>>2] = $435;
  29868. $437 = $$4351$lcssa$i | 1;
  29869. $438 = ((($367)) + 4|0);
  29870. HEAP32[$438>>2] = $437;
  29871. $439 = (($367) + ($$4351$lcssa$i)|0);
  29872. HEAP32[$439>>2] = $$4351$lcssa$i;
  29873. $440 = $$4351$lcssa$i >>> 3;
  29874. $441 = ($$4351$lcssa$i>>>0)<(256);
  29875. if ($441) {
  29876. $442 = $440 << 1;
  29877. $443 = (35488 + ($442<<2)|0);
  29878. $444 = HEAP32[8862]|0;
  29879. $445 = 1 << $440;
  29880. $446 = $444 & $445;
  29881. $447 = ($446|0)==(0);
  29882. do {
  29883. if ($447) {
  29884. $448 = $444 | $445;
  29885. HEAP32[8862] = $448;
  29886. $$pre$i211 = ((($443)) + 8|0);
  29887. $$0368$i = $443;$$pre$phi$i212Z2D = $$pre$i211;
  29888. } else {
  29889. $449 = ((($443)) + 8|0);
  29890. $450 = HEAP32[$449>>2]|0;
  29891. $451 = HEAP32[(35464)>>2]|0;
  29892. $452 = ($450>>>0)<($451>>>0);
  29893. if (!($452)) {
  29894. $$0368$i = $450;$$pre$phi$i212Z2D = $449;
  29895. break;
  29896. }
  29897. _abort();
  29898. // unreachable;
  29899. }
  29900. } while(0);
  29901. HEAP32[$$pre$phi$i212Z2D>>2] = $367;
  29902. $453 = ((($$0368$i)) + 12|0);
  29903. HEAP32[$453>>2] = $367;
  29904. $454 = ((($367)) + 8|0);
  29905. HEAP32[$454>>2] = $$0368$i;
  29906. $455 = ((($367)) + 12|0);
  29907. HEAP32[$455>>2] = $443;
  29908. break;
  29909. }
  29910. $456 = $$4351$lcssa$i >>> 8;
  29911. $457 = ($456|0)==(0);
  29912. if ($457) {
  29913. $$0361$i = 0;
  29914. } else {
  29915. $458 = ($$4351$lcssa$i>>>0)>(16777215);
  29916. if ($458) {
  29917. $$0361$i = 31;
  29918. } else {
  29919. $459 = (($456) + 1048320)|0;
  29920. $460 = $459 >>> 16;
  29921. $461 = $460 & 8;
  29922. $462 = $456 << $461;
  29923. $463 = (($462) + 520192)|0;
  29924. $464 = $463 >>> 16;
  29925. $465 = $464 & 4;
  29926. $466 = $465 | $461;
  29927. $467 = $462 << $465;
  29928. $468 = (($467) + 245760)|0;
  29929. $469 = $468 >>> 16;
  29930. $470 = $469 & 2;
  29931. $471 = $466 | $470;
  29932. $472 = (14 - ($471))|0;
  29933. $473 = $467 << $470;
  29934. $474 = $473 >>> 15;
  29935. $475 = (($472) + ($474))|0;
  29936. $476 = $475 << 1;
  29937. $477 = (($475) + 7)|0;
  29938. $478 = $$4351$lcssa$i >>> $477;
  29939. $479 = $478 & 1;
  29940. $480 = $479 | $476;
  29941. $$0361$i = $480;
  29942. }
  29943. }
  29944. $481 = (35752 + ($$0361$i<<2)|0);
  29945. $482 = ((($367)) + 28|0);
  29946. HEAP32[$482>>2] = $$0361$i;
  29947. $483 = ((($367)) + 16|0);
  29948. $484 = ((($483)) + 4|0);
  29949. HEAP32[$484>>2] = 0;
  29950. HEAP32[$483>>2] = 0;
  29951. $485 = 1 << $$0361$i;
  29952. $486 = $487 & $485;
  29953. $488 = ($486|0)==(0);
  29954. if ($488) {
  29955. $489 = $487 | $485;
  29956. HEAP32[(35452)>>2] = $489;
  29957. HEAP32[$481>>2] = $367;
  29958. $490 = ((($367)) + 24|0);
  29959. HEAP32[$490>>2] = $481;
  29960. $491 = ((($367)) + 12|0);
  29961. HEAP32[$491>>2] = $367;
  29962. $492 = ((($367)) + 8|0);
  29963. HEAP32[$492>>2] = $367;
  29964. break;
  29965. }
  29966. $493 = HEAP32[$481>>2]|0;
  29967. $494 = ($$0361$i|0)==(31);
  29968. $495 = $$0361$i >>> 1;
  29969. $496 = (25 - ($495))|0;
  29970. $497 = $494 ? 0 : $496;
  29971. $498 = $$4351$lcssa$i << $497;
  29972. $$0344$i = $498;$$0345$i = $493;
  29973. while(1) {
  29974. $499 = ((($$0345$i)) + 4|0);
  29975. $500 = HEAP32[$499>>2]|0;
  29976. $501 = $500 & -8;
  29977. $502 = ($501|0)==($$4351$lcssa$i|0);
  29978. if ($502) {
  29979. label = 148;
  29980. break;
  29981. }
  29982. $503 = $$0344$i >>> 31;
  29983. $504 = (((($$0345$i)) + 16|0) + ($503<<2)|0);
  29984. $505 = $$0344$i << 1;
  29985. $506 = HEAP32[$504>>2]|0;
  29986. $507 = ($506|0)==(0|0);
  29987. if ($507) {
  29988. label = 145;
  29989. break;
  29990. } else {
  29991. $$0344$i = $505;$$0345$i = $506;
  29992. }
  29993. }
  29994. if ((label|0) == 145) {
  29995. $508 = HEAP32[(35464)>>2]|0;
  29996. $509 = ($504>>>0)<($508>>>0);
  29997. if ($509) {
  29998. _abort();
  29999. // unreachable;
  30000. } else {
  30001. HEAP32[$504>>2] = $367;
  30002. $510 = ((($367)) + 24|0);
  30003. HEAP32[$510>>2] = $$0345$i;
  30004. $511 = ((($367)) + 12|0);
  30005. HEAP32[$511>>2] = $367;
  30006. $512 = ((($367)) + 8|0);
  30007. HEAP32[$512>>2] = $367;
  30008. break;
  30009. }
  30010. }
  30011. else if ((label|0) == 148) {
  30012. $513 = ((($$0345$i)) + 8|0);
  30013. $514 = HEAP32[$513>>2]|0;
  30014. $515 = HEAP32[(35464)>>2]|0;
  30015. $516 = ($514>>>0)>=($515>>>0);
  30016. $not$9$i = ($$0345$i>>>0)>=($515>>>0);
  30017. $517 = $516 & $not$9$i;
  30018. if ($517) {
  30019. $518 = ((($514)) + 12|0);
  30020. HEAP32[$518>>2] = $367;
  30021. HEAP32[$513>>2] = $367;
  30022. $519 = ((($367)) + 8|0);
  30023. HEAP32[$519>>2] = $514;
  30024. $520 = ((($367)) + 12|0);
  30025. HEAP32[$520>>2] = $$0345$i;
  30026. $521 = ((($367)) + 24|0);
  30027. HEAP32[$521>>2] = 0;
  30028. break;
  30029. } else {
  30030. _abort();
  30031. // unreachable;
  30032. }
  30033. }
  30034. }
  30035. } while(0);
  30036. $522 = ((($$4$lcssa$i)) + 8|0);
  30037. $$2 = $522;
  30038. } else {
  30039. $$0198 = $266;
  30040. label = 153;
  30041. }
  30042. }
  30043. }
  30044. }
  30045. }
  30046. } while(0);
  30047. L230: do {
  30048. if ((label|0) == 153) {
  30049. $523 = HEAP32[(35456)>>2]|0;
  30050. $524 = ($523>>>0)<($$0198>>>0);
  30051. if (!($524)) {
  30052. $525 = (($523) - ($$0198))|0;
  30053. $526 = HEAP32[(35468)>>2]|0;
  30054. $527 = ($525>>>0)>(15);
  30055. if ($527) {
  30056. $528 = (($526) + ($$0198)|0);
  30057. HEAP32[(35468)>>2] = $528;
  30058. HEAP32[(35456)>>2] = $525;
  30059. $529 = $525 | 1;
  30060. $530 = ((($528)) + 4|0);
  30061. HEAP32[$530>>2] = $529;
  30062. $531 = (($528) + ($525)|0);
  30063. HEAP32[$531>>2] = $525;
  30064. $532 = $$0198 | 3;
  30065. $533 = ((($526)) + 4|0);
  30066. HEAP32[$533>>2] = $532;
  30067. } else {
  30068. HEAP32[(35456)>>2] = 0;
  30069. HEAP32[(35468)>>2] = 0;
  30070. $534 = $523 | 3;
  30071. $535 = ((($526)) + 4|0);
  30072. HEAP32[$535>>2] = $534;
  30073. $536 = (($526) + ($523)|0);
  30074. $537 = ((($536)) + 4|0);
  30075. $538 = HEAP32[$537>>2]|0;
  30076. $539 = $538 | 1;
  30077. HEAP32[$537>>2] = $539;
  30078. }
  30079. $540 = ((($526)) + 8|0);
  30080. $$2 = $540;
  30081. break;
  30082. }
  30083. $541 = HEAP32[(35460)>>2]|0;
  30084. $542 = ($541>>>0)>($$0198>>>0);
  30085. if ($542) {
  30086. $543 = (($541) - ($$0198))|0;
  30087. HEAP32[(35460)>>2] = $543;
  30088. $544 = HEAP32[(35472)>>2]|0;
  30089. $545 = (($544) + ($$0198)|0);
  30090. HEAP32[(35472)>>2] = $545;
  30091. $546 = $543 | 1;
  30092. $547 = ((($545)) + 4|0);
  30093. HEAP32[$547>>2] = $546;
  30094. $548 = $$0198 | 3;
  30095. $549 = ((($544)) + 4|0);
  30096. HEAP32[$549>>2] = $548;
  30097. $550 = ((($544)) + 8|0);
  30098. $$2 = $550;
  30099. break;
  30100. }
  30101. $551 = HEAP32[8849]|0;
  30102. $552 = ($551|0)==(0);
  30103. if ($552) {
  30104. (___pthread_mutex_lock(35420)|0);
  30105. $553 = HEAP32[8849]|0;
  30106. $554 = ($553|0)==(0);
  30107. if ($554) {
  30108. HEAP32[(35404)>>2] = 4096;
  30109. HEAP32[(35400)>>2] = 4096;
  30110. HEAP32[(35408)>>2] = -1;
  30111. HEAP32[(35412)>>2] = -1;
  30112. HEAP32[(35416)>>2] = 2;
  30113. HEAP32[(35892)>>2] = 2;
  30114. $555 = (_pthread_mutexattr_init($1)|0);
  30115. $556 = ($555|0)==(0);
  30116. if ($556) {
  30117. $557 = (_pthread_mutex_init((35896),$1)|0);
  30118. $558 = ($557|0)==(0);
  30119. if ($558) {
  30120. }
  30121. }
  30122. $559 = $2;
  30123. $560 = $559 & -16;
  30124. $561 = $560 ^ 1431655768;
  30125. HEAP32[$2>>2] = $561;
  30126. Atomics_store(HEAP32,8849,$561)|0;
  30127. }
  30128. (___pthread_mutex_unlock(35420)|0);
  30129. }
  30130. $562 = (($$0198) + 48)|0;
  30131. $563 = HEAP32[(35404)>>2]|0;
  30132. $564 = (($$0198) + 47)|0;
  30133. $565 = (($563) + ($564))|0;
  30134. $566 = (0 - ($563))|0;
  30135. $567 = $565 & $566;
  30136. $568 = ($567>>>0)>($$0198>>>0);
  30137. if ($568) {
  30138. $569 = HEAP32[(35888)>>2]|0;
  30139. $570 = ($569|0)==(0);
  30140. if (!($570)) {
  30141. $571 = HEAP32[(35880)>>2]|0;
  30142. $572 = (($571) + ($567))|0;
  30143. $573 = ($572>>>0)<=($571>>>0);
  30144. $574 = ($572>>>0)>($569>>>0);
  30145. $or$cond1$i = $573 | $574;
  30146. if ($or$cond1$i) {
  30147. $$2 = 0;
  30148. break;
  30149. }
  30150. }
  30151. $575 = HEAP32[(35892)>>2]|0;
  30152. $576 = $575 & 4;
  30153. $577 = ($576|0)==(0);
  30154. if ($577) {
  30155. $578 = HEAP32[(35472)>>2]|0;
  30156. $579 = ($578|0)==(0|0);
  30157. L258: do {
  30158. if ($579) {
  30159. label = 176;
  30160. } else {
  30161. $$0$i$i = (35924);
  30162. while(1) {
  30163. $580 = HEAP32[$$0$i$i>>2]|0;
  30164. $581 = ($580>>>0)>($578>>>0);
  30165. if (!($581)) {
  30166. $582 = ((($$0$i$i)) + 4|0);
  30167. $583 = HEAP32[$582>>2]|0;
  30168. $584 = (($580) + ($583)|0);
  30169. $585 = ($584>>>0)>($578>>>0);
  30170. if ($585) {
  30171. break;
  30172. }
  30173. }
  30174. $586 = ((($$0$i$i)) + 8|0);
  30175. $587 = HEAP32[$586>>2]|0;
  30176. $588 = ($587|0)==(0|0);
  30177. if ($588) {
  30178. label = 176;
  30179. break L258;
  30180. } else {
  30181. $$0$i$i = $587;
  30182. }
  30183. }
  30184. (___pthread_mutex_lock(35420)|0);
  30185. $611 = HEAP32[(35460)>>2]|0;
  30186. $612 = HEAP32[(35404)>>2]|0;
  30187. $613 = (($564) - ($611))|0;
  30188. $614 = (($613) + ($612))|0;
  30189. $615 = (0 - ($612))|0;
  30190. $616 = $614 & $615;
  30191. $617 = ($616>>>0)<(2147483647);
  30192. if ($617) {
  30193. $618 = (_sbrk(($616|0))|0);
  30194. $619 = HEAP32[$$0$i$i>>2]|0;
  30195. $620 = HEAP32[$582>>2]|0;
  30196. $621 = (($619) + ($620)|0);
  30197. $622 = ($618|0)==($621|0);
  30198. if ($622) {
  30199. $623 = ($618|0)==((-1)|0);
  30200. if ($623) {
  30201. $$2234253237$i = $616;
  30202. label = 190;
  30203. } else {
  30204. $$3229$i = $618;$$3235$i = $616;
  30205. }
  30206. } else {
  30207. $$2247$ph$i = $618;$$2253$ph$i = $616;
  30208. label = 184;
  30209. }
  30210. } else {
  30211. $$2234253237$i = 0;
  30212. label = 190;
  30213. }
  30214. }
  30215. } while(0);
  30216. do {
  30217. if ((label|0) == 176) {
  30218. (___pthread_mutex_lock(35420)|0);
  30219. $589 = (_sbrk(0)|0);
  30220. $590 = ($589|0)==((-1)|0);
  30221. if ($590) {
  30222. $$2234253237$i = 0;
  30223. label = 190;
  30224. } else {
  30225. $591 = $589;
  30226. $592 = HEAP32[(35400)>>2]|0;
  30227. $593 = (($592) + -1)|0;
  30228. $594 = $593 & $591;
  30229. $595 = ($594|0)==(0);
  30230. $596 = (($593) + ($591))|0;
  30231. $597 = (0 - ($592))|0;
  30232. $598 = $596 & $597;
  30233. $599 = (($598) - ($591))|0;
  30234. $600 = $595 ? 0 : $599;
  30235. $$$i = (($600) + ($567))|0;
  30236. $601 = HEAP32[(35880)>>2]|0;
  30237. $602 = (($$$i) + ($601))|0;
  30238. $603 = ($$$i>>>0)>($$0198>>>0);
  30239. $604 = ($$$i>>>0)<(2147483647);
  30240. $or$cond$i213 = $603 & $604;
  30241. if ($or$cond$i213) {
  30242. $605 = HEAP32[(35888)>>2]|0;
  30243. $606 = ($605|0)==(0);
  30244. if (!($606)) {
  30245. $607 = ($602>>>0)<=($601>>>0);
  30246. $608 = ($602>>>0)>($605>>>0);
  30247. $or$cond2$i214 = $607 | $608;
  30248. if ($or$cond2$i214) {
  30249. $$2234253237$i = 0;
  30250. label = 190;
  30251. break;
  30252. }
  30253. }
  30254. $609 = (_sbrk(($$$i|0))|0);
  30255. $610 = ($609|0)==($589|0);
  30256. if ($610) {
  30257. $$3229$i = $589;$$3235$i = $$$i;
  30258. } else {
  30259. $$2247$ph$i = $609;$$2253$ph$i = $$$i;
  30260. label = 184;
  30261. }
  30262. } else {
  30263. $$2234253237$i = 0;
  30264. label = 190;
  30265. }
  30266. }
  30267. }
  30268. } while(0);
  30269. do {
  30270. if ((label|0) == 184) {
  30271. $624 = (0 - ($$2253$ph$i))|0;
  30272. $625 = ($$2247$ph$i|0)!=((-1)|0);
  30273. $626 = ($$2253$ph$i>>>0)<(2147483647);
  30274. $or$cond7$i = $626 & $625;
  30275. $627 = ($562>>>0)>($$2253$ph$i>>>0);
  30276. $or$cond10$i = $627 & $or$cond7$i;
  30277. if (!($or$cond10$i)) {
  30278. $637 = ($$2247$ph$i|0)==((-1)|0);
  30279. if ($637) {
  30280. $$2234253237$i = 0;
  30281. label = 190;
  30282. break;
  30283. } else {
  30284. $$3229$i = $$2247$ph$i;$$3235$i = $$2253$ph$i;
  30285. break;
  30286. }
  30287. }
  30288. $628 = HEAP32[(35404)>>2]|0;
  30289. $629 = (($564) - ($$2253$ph$i))|0;
  30290. $630 = (($629) + ($628))|0;
  30291. $631 = (0 - ($628))|0;
  30292. $632 = $630 & $631;
  30293. $633 = ($632>>>0)<(2147483647);
  30294. if ($633) {
  30295. $634 = (_sbrk(($632|0))|0);
  30296. $635 = ($634|0)==((-1)|0);
  30297. if ($635) {
  30298. (_sbrk(($624|0))|0);
  30299. $$2234253237$i = 0;
  30300. label = 190;
  30301. break;
  30302. } else {
  30303. $636 = (($632) + ($$2253$ph$i))|0;
  30304. $$3229$i = $$2247$ph$i;$$3235$i = $636;
  30305. break;
  30306. }
  30307. } else {
  30308. $$3229$i = $$2247$ph$i;$$3235$i = $$2253$ph$i;
  30309. }
  30310. }
  30311. } while(0);
  30312. if ((label|0) == 190) {
  30313. $638 = HEAP32[(35892)>>2]|0;
  30314. $639 = $638 | 4;
  30315. HEAP32[(35892)>>2] = $639;
  30316. $$3229$i = (-1);$$3235$i = $$2234253237$i;
  30317. }
  30318. (___pthread_mutex_unlock(35420)|0);
  30319. $$4230$i = $$3229$i;$$4236$i = $$3235$i;
  30320. } else {
  30321. $$4230$i = (-1);$$4236$i = 0;
  30322. }
  30323. $640 = ($$4230$i|0)==((-1)|0);
  30324. $641 = ($567>>>0)<(2147483647);
  30325. $or$cond9$i = $641 & $640;
  30326. if ($or$cond9$i) {
  30327. (___pthread_mutex_lock(35420)|0);
  30328. $642 = (_sbrk(($567|0))|0);
  30329. $643 = (_sbrk(0)|0);
  30330. (___pthread_mutex_unlock(35420)|0);
  30331. $644 = ($642|0)!=((-1)|0);
  30332. $645 = ($643|0)!=((-1)|0);
  30333. $or$cond5$i = $644 & $645;
  30334. $646 = ($642>>>0)<($643>>>0);
  30335. $or$cond11$i = $646 & $or$cond5$i;
  30336. $647 = $643;
  30337. $648 = $642;
  30338. $649 = (($647) - ($648))|0;
  30339. $650 = (($$0198) + 40)|0;
  30340. $651 = ($649>>>0)>($650>>>0);
  30341. $$$4236$i = $651 ? $649 : $$4236$i;
  30342. $$$4230$i = $651 ? $642 : (-1);
  30343. if ($or$cond11$i) {
  30344. $$7$i = $$$4230$i;$$7239$i = $$$4236$i;
  30345. label = 194;
  30346. }
  30347. } else {
  30348. $$7$i = $$4230$i;$$7239$i = $$4236$i;
  30349. label = 194;
  30350. }
  30351. if ((label|0) == 194) {
  30352. $652 = ($$7$i|0)==((-1)|0);
  30353. if (!($652)) {
  30354. $653 = HEAP32[(35880)>>2]|0;
  30355. $654 = (($653) + ($$7239$i))|0;
  30356. HEAP32[(35880)>>2] = $654;
  30357. $655 = HEAP32[(35884)>>2]|0;
  30358. $656 = ($654>>>0)>($655>>>0);
  30359. if ($656) {
  30360. HEAP32[(35884)>>2] = $654;
  30361. }
  30362. $657 = HEAP32[(35472)>>2]|0;
  30363. $658 = ($657|0)==(0|0);
  30364. do {
  30365. if ($658) {
  30366. $659 = HEAP32[(35464)>>2]|0;
  30367. $660 = ($659|0)==(0|0);
  30368. $661 = ($$7$i>>>0)<($659>>>0);
  30369. $or$cond12$i = $660 | $661;
  30370. if ($or$cond12$i) {
  30371. HEAP32[(35464)>>2] = $$7$i;
  30372. }
  30373. HEAP32[(35924)>>2] = $$7$i;
  30374. HEAP32[(35928)>>2] = $$7239$i;
  30375. HEAP32[(35936)>>2] = 0;
  30376. $662 = HEAP32[8849]|0;
  30377. HEAP32[(35484)>>2] = $662;
  30378. HEAP32[(35480)>>2] = -1;
  30379. $$01$i$i = 0;
  30380. while(1) {
  30381. $663 = $$01$i$i << 1;
  30382. $664 = (35488 + ($663<<2)|0);
  30383. $665 = ((($664)) + 12|0);
  30384. HEAP32[$665>>2] = $664;
  30385. $666 = ((($664)) + 8|0);
  30386. HEAP32[$666>>2] = $664;
  30387. $667 = (($$01$i$i) + 1)|0;
  30388. $exitcond$i$i = ($667|0)==(32);
  30389. if ($exitcond$i$i) {
  30390. break;
  30391. } else {
  30392. $$01$i$i = $667;
  30393. }
  30394. }
  30395. $668 = (($$7239$i) + -40)|0;
  30396. $669 = ((($$7$i)) + 8|0);
  30397. $670 = $669;
  30398. $671 = $670 & 7;
  30399. $672 = ($671|0)==(0);
  30400. $673 = (0 - ($670))|0;
  30401. $674 = $673 & 7;
  30402. $675 = $672 ? 0 : $674;
  30403. $676 = (($$7$i) + ($675)|0);
  30404. $677 = (($668) - ($675))|0;
  30405. HEAP32[(35472)>>2] = $676;
  30406. HEAP32[(35460)>>2] = $677;
  30407. $678 = $677 | 1;
  30408. $679 = ((($676)) + 4|0);
  30409. HEAP32[$679>>2] = $678;
  30410. $680 = (($676) + ($677)|0);
  30411. $681 = ((($680)) + 4|0);
  30412. HEAP32[$681>>2] = 40;
  30413. $682 = HEAP32[(35412)>>2]|0;
  30414. HEAP32[(35476)>>2] = $682;
  30415. } else {
  30416. $$024363$i = (35924);
  30417. while(1) {
  30418. $683 = HEAP32[$$024363$i>>2]|0;
  30419. $684 = ((($$024363$i)) + 4|0);
  30420. $685 = HEAP32[$684>>2]|0;
  30421. $686 = (($683) + ($685)|0);
  30422. $687 = ($$7$i|0)==($686|0);
  30423. if ($687) {
  30424. label = 205;
  30425. break;
  30426. }
  30427. $688 = ((($$024363$i)) + 8|0);
  30428. $689 = HEAP32[$688>>2]|0;
  30429. $690 = ($689|0)==(0|0);
  30430. if ($690) {
  30431. break;
  30432. } else {
  30433. $$024363$i = $689;
  30434. }
  30435. }
  30436. if ((label|0) == 205) {
  30437. $691 = ((($$024363$i)) + 12|0);
  30438. $692 = HEAP32[$691>>2]|0;
  30439. $693 = $692 & 8;
  30440. $694 = ($693|0)==(0);
  30441. if ($694) {
  30442. $695 = ($657>>>0)>=($683>>>0);
  30443. $696 = ($657>>>0)<($$7$i>>>0);
  30444. $or$cond43$i = $696 & $695;
  30445. if ($or$cond43$i) {
  30446. $697 = (($685) + ($$7239$i))|0;
  30447. HEAP32[$684>>2] = $697;
  30448. $698 = HEAP32[(35460)>>2]|0;
  30449. $699 = ((($657)) + 8|0);
  30450. $700 = $699;
  30451. $701 = $700 & 7;
  30452. $702 = ($701|0)==(0);
  30453. $703 = (0 - ($700))|0;
  30454. $704 = $703 & 7;
  30455. $705 = $702 ? 0 : $704;
  30456. $706 = (($657) + ($705)|0);
  30457. $707 = (($$7239$i) - ($705))|0;
  30458. $708 = (($698) + ($707))|0;
  30459. HEAP32[(35472)>>2] = $706;
  30460. HEAP32[(35460)>>2] = $708;
  30461. $709 = $708 | 1;
  30462. $710 = ((($706)) + 4|0);
  30463. HEAP32[$710>>2] = $709;
  30464. $711 = (($706) + ($708)|0);
  30465. $712 = ((($711)) + 4|0);
  30466. HEAP32[$712>>2] = 40;
  30467. $713 = HEAP32[(35412)>>2]|0;
  30468. HEAP32[(35476)>>2] = $713;
  30469. break;
  30470. }
  30471. }
  30472. }
  30473. $714 = HEAP32[(35464)>>2]|0;
  30474. $715 = ($$7$i>>>0)<($714>>>0);
  30475. if ($715) {
  30476. HEAP32[(35464)>>2] = $$7$i;
  30477. $779 = $$7$i;
  30478. } else {
  30479. $779 = $714;
  30480. }
  30481. $716 = (($$7$i) + ($$7239$i)|0);
  30482. $$124462$i = (35924);
  30483. while(1) {
  30484. $717 = HEAP32[$$124462$i>>2]|0;
  30485. $718 = ($717|0)==($716|0);
  30486. if ($718) {
  30487. label = 213;
  30488. break;
  30489. }
  30490. $719 = ((($$124462$i)) + 8|0);
  30491. $720 = HEAP32[$719>>2]|0;
  30492. $721 = ($720|0)==(0|0);
  30493. if ($721) {
  30494. break;
  30495. } else {
  30496. $$124462$i = $720;
  30497. }
  30498. }
  30499. if ((label|0) == 213) {
  30500. $722 = ((($$124462$i)) + 12|0);
  30501. $723 = HEAP32[$722>>2]|0;
  30502. $724 = $723 & 8;
  30503. $725 = ($724|0)==(0);
  30504. if ($725) {
  30505. HEAP32[$$124462$i>>2] = $$7$i;
  30506. $726 = ((($$124462$i)) + 4|0);
  30507. $727 = HEAP32[$726>>2]|0;
  30508. $728 = (($727) + ($$7239$i))|0;
  30509. HEAP32[$726>>2] = $728;
  30510. $729 = ((($$7$i)) + 8|0);
  30511. $730 = $729;
  30512. $731 = $730 & 7;
  30513. $732 = ($731|0)==(0);
  30514. $733 = (0 - ($730))|0;
  30515. $734 = $733 & 7;
  30516. $735 = $732 ? 0 : $734;
  30517. $736 = (($$7$i) + ($735)|0);
  30518. $737 = ((($716)) + 8|0);
  30519. $738 = $737;
  30520. $739 = $738 & 7;
  30521. $740 = ($739|0)==(0);
  30522. $741 = (0 - ($738))|0;
  30523. $742 = $741 & 7;
  30524. $743 = $740 ? 0 : $742;
  30525. $744 = (($716) + ($743)|0);
  30526. $745 = $744;
  30527. $746 = $736;
  30528. $747 = (($745) - ($746))|0;
  30529. $748 = (($736) + ($$0198)|0);
  30530. $749 = (($747) - ($$0198))|0;
  30531. $750 = $$0198 | 3;
  30532. $751 = ((($736)) + 4|0);
  30533. HEAP32[$751>>2] = $750;
  30534. $752 = ($744|0)==($657|0);
  30535. do {
  30536. if ($752) {
  30537. $753 = HEAP32[(35460)>>2]|0;
  30538. $754 = (($753) + ($749))|0;
  30539. HEAP32[(35460)>>2] = $754;
  30540. HEAP32[(35472)>>2] = $748;
  30541. $755 = $754 | 1;
  30542. $756 = ((($748)) + 4|0);
  30543. HEAP32[$756>>2] = $755;
  30544. } else {
  30545. $757 = HEAP32[(35468)>>2]|0;
  30546. $758 = ($744|0)==($757|0);
  30547. if ($758) {
  30548. $759 = HEAP32[(35456)>>2]|0;
  30549. $760 = (($759) + ($749))|0;
  30550. HEAP32[(35456)>>2] = $760;
  30551. HEAP32[(35468)>>2] = $748;
  30552. $761 = $760 | 1;
  30553. $762 = ((($748)) + 4|0);
  30554. HEAP32[$762>>2] = $761;
  30555. $763 = (($748) + ($760)|0);
  30556. HEAP32[$763>>2] = $760;
  30557. break;
  30558. }
  30559. $764 = ((($744)) + 4|0);
  30560. $765 = HEAP32[$764>>2]|0;
  30561. $766 = $765 & 3;
  30562. $767 = ($766|0)==(1);
  30563. if ($767) {
  30564. $768 = $765 & -8;
  30565. $769 = $765 >>> 3;
  30566. $770 = ($765>>>0)<(256);
  30567. L329: do {
  30568. if ($770) {
  30569. $771 = ((($744)) + 8|0);
  30570. $772 = HEAP32[$771>>2]|0;
  30571. $773 = ((($744)) + 12|0);
  30572. $774 = HEAP32[$773>>2]|0;
  30573. $775 = $769 << 1;
  30574. $776 = (35488 + ($775<<2)|0);
  30575. $777 = ($772|0)==($776|0);
  30576. do {
  30577. if (!($777)) {
  30578. $778 = ($772>>>0)<($779>>>0);
  30579. if ($778) {
  30580. _abort();
  30581. // unreachable;
  30582. }
  30583. $780 = ((($772)) + 12|0);
  30584. $781 = HEAP32[$780>>2]|0;
  30585. $782 = ($781|0)==($744|0);
  30586. if ($782) {
  30587. break;
  30588. }
  30589. _abort();
  30590. // unreachable;
  30591. }
  30592. } while(0);
  30593. $783 = ($774|0)==($772|0);
  30594. if ($783) {
  30595. $784 = 1 << $769;
  30596. $785 = $784 ^ -1;
  30597. $786 = HEAP32[8862]|0;
  30598. $787 = $786 & $785;
  30599. HEAP32[8862] = $787;
  30600. break;
  30601. }
  30602. $788 = ($774|0)==($776|0);
  30603. do {
  30604. if ($788) {
  30605. $$pre10$i$i = ((($774)) + 8|0);
  30606. $$pre$phi11$i$iZ2D = $$pre10$i$i;
  30607. } else {
  30608. $789 = ($774>>>0)<($779>>>0);
  30609. if ($789) {
  30610. _abort();
  30611. // unreachable;
  30612. }
  30613. $790 = ((($774)) + 8|0);
  30614. $791 = HEAP32[$790>>2]|0;
  30615. $792 = ($791|0)==($744|0);
  30616. if ($792) {
  30617. $$pre$phi11$i$iZ2D = $790;
  30618. break;
  30619. }
  30620. _abort();
  30621. // unreachable;
  30622. }
  30623. } while(0);
  30624. $793 = ((($772)) + 12|0);
  30625. HEAP32[$793>>2] = $774;
  30626. HEAP32[$$pre$phi11$i$iZ2D>>2] = $772;
  30627. } else {
  30628. $794 = ((($744)) + 24|0);
  30629. $795 = HEAP32[$794>>2]|0;
  30630. $796 = ((($744)) + 12|0);
  30631. $797 = HEAP32[$796>>2]|0;
  30632. $798 = ($797|0)==($744|0);
  30633. do {
  30634. if ($798) {
  30635. $808 = ((($744)) + 16|0);
  30636. $809 = ((($808)) + 4|0);
  30637. $810 = HEAP32[$809>>2]|0;
  30638. $811 = ($810|0)==(0|0);
  30639. if ($811) {
  30640. $812 = HEAP32[$808>>2]|0;
  30641. $813 = ($812|0)==(0|0);
  30642. if ($813) {
  30643. $$3$i$i = 0;
  30644. break;
  30645. } else {
  30646. $$1291$i$i = $812;$$1293$i$i = $808;
  30647. }
  30648. } else {
  30649. $$1291$i$i = $810;$$1293$i$i = $809;
  30650. }
  30651. while(1) {
  30652. $814 = ((($$1291$i$i)) + 20|0);
  30653. $815 = HEAP32[$814>>2]|0;
  30654. $816 = ($815|0)==(0|0);
  30655. if (!($816)) {
  30656. $$1291$i$i = $815;$$1293$i$i = $814;
  30657. continue;
  30658. }
  30659. $817 = ((($$1291$i$i)) + 16|0);
  30660. $818 = HEAP32[$817>>2]|0;
  30661. $819 = ($818|0)==(0|0);
  30662. if ($819) {
  30663. break;
  30664. } else {
  30665. $$1291$i$i = $818;$$1293$i$i = $817;
  30666. }
  30667. }
  30668. $820 = ($$1293$i$i>>>0)<($779>>>0);
  30669. if ($820) {
  30670. _abort();
  30671. // unreachable;
  30672. } else {
  30673. HEAP32[$$1293$i$i>>2] = 0;
  30674. $$3$i$i = $$1291$i$i;
  30675. break;
  30676. }
  30677. } else {
  30678. $799 = ((($744)) + 8|0);
  30679. $800 = HEAP32[$799>>2]|0;
  30680. $801 = ($800>>>0)<($779>>>0);
  30681. if ($801) {
  30682. _abort();
  30683. // unreachable;
  30684. }
  30685. $802 = ((($800)) + 12|0);
  30686. $803 = HEAP32[$802>>2]|0;
  30687. $804 = ($803|0)==($744|0);
  30688. if (!($804)) {
  30689. _abort();
  30690. // unreachable;
  30691. }
  30692. $805 = ((($797)) + 8|0);
  30693. $806 = HEAP32[$805>>2]|0;
  30694. $807 = ($806|0)==($744|0);
  30695. if ($807) {
  30696. HEAP32[$802>>2] = $797;
  30697. HEAP32[$805>>2] = $800;
  30698. $$3$i$i = $797;
  30699. break;
  30700. } else {
  30701. _abort();
  30702. // unreachable;
  30703. }
  30704. }
  30705. } while(0);
  30706. $821 = ($795|0)==(0|0);
  30707. if ($821) {
  30708. break;
  30709. }
  30710. $822 = ((($744)) + 28|0);
  30711. $823 = HEAP32[$822>>2]|0;
  30712. $824 = (35752 + ($823<<2)|0);
  30713. $825 = HEAP32[$824>>2]|0;
  30714. $826 = ($744|0)==($825|0);
  30715. do {
  30716. if ($826) {
  30717. HEAP32[$824>>2] = $$3$i$i;
  30718. $cond$i$i = ($$3$i$i|0)==(0|0);
  30719. if (!($cond$i$i)) {
  30720. break;
  30721. }
  30722. $827 = 1 << $823;
  30723. $828 = $827 ^ -1;
  30724. $829 = HEAP32[(35452)>>2]|0;
  30725. $830 = $829 & $828;
  30726. HEAP32[(35452)>>2] = $830;
  30727. break L329;
  30728. } else {
  30729. $831 = HEAP32[(35464)>>2]|0;
  30730. $832 = ($795>>>0)<($831>>>0);
  30731. if ($832) {
  30732. _abort();
  30733. // unreachable;
  30734. } else {
  30735. $833 = ((($795)) + 16|0);
  30736. $834 = HEAP32[$833>>2]|0;
  30737. $not$$i$i = ($834|0)!=($744|0);
  30738. $$sink1$i$i = $not$$i$i&1;
  30739. $835 = (((($795)) + 16|0) + ($$sink1$i$i<<2)|0);
  30740. HEAP32[$835>>2] = $$3$i$i;
  30741. $836 = ($$3$i$i|0)==(0|0);
  30742. if ($836) {
  30743. break L329;
  30744. } else {
  30745. break;
  30746. }
  30747. }
  30748. }
  30749. } while(0);
  30750. $837 = HEAP32[(35464)>>2]|0;
  30751. $838 = ($$3$i$i>>>0)<($837>>>0);
  30752. if ($838) {
  30753. _abort();
  30754. // unreachable;
  30755. }
  30756. $839 = ((($$3$i$i)) + 24|0);
  30757. HEAP32[$839>>2] = $795;
  30758. $840 = ((($744)) + 16|0);
  30759. $841 = HEAP32[$840>>2]|0;
  30760. $842 = ($841|0)==(0|0);
  30761. do {
  30762. if (!($842)) {
  30763. $843 = ($841>>>0)<($837>>>0);
  30764. if ($843) {
  30765. _abort();
  30766. // unreachable;
  30767. } else {
  30768. $844 = ((($$3$i$i)) + 16|0);
  30769. HEAP32[$844>>2] = $841;
  30770. $845 = ((($841)) + 24|0);
  30771. HEAP32[$845>>2] = $$3$i$i;
  30772. break;
  30773. }
  30774. }
  30775. } while(0);
  30776. $846 = ((($840)) + 4|0);
  30777. $847 = HEAP32[$846>>2]|0;
  30778. $848 = ($847|0)==(0|0);
  30779. if ($848) {
  30780. break;
  30781. }
  30782. $849 = HEAP32[(35464)>>2]|0;
  30783. $850 = ($847>>>0)<($849>>>0);
  30784. if ($850) {
  30785. _abort();
  30786. // unreachable;
  30787. } else {
  30788. $851 = ((($$3$i$i)) + 20|0);
  30789. HEAP32[$851>>2] = $847;
  30790. $852 = ((($847)) + 24|0);
  30791. HEAP32[$852>>2] = $$3$i$i;
  30792. break;
  30793. }
  30794. }
  30795. } while(0);
  30796. $853 = (($744) + ($768)|0);
  30797. $854 = (($768) + ($749))|0;
  30798. $$0$i17$i = $853;$$0287$i$i = $854;
  30799. } else {
  30800. $$0$i17$i = $744;$$0287$i$i = $749;
  30801. }
  30802. $855 = ((($$0$i17$i)) + 4|0);
  30803. $856 = HEAP32[$855>>2]|0;
  30804. $857 = $856 & -2;
  30805. HEAP32[$855>>2] = $857;
  30806. $858 = $$0287$i$i | 1;
  30807. $859 = ((($748)) + 4|0);
  30808. HEAP32[$859>>2] = $858;
  30809. $860 = (($748) + ($$0287$i$i)|0);
  30810. HEAP32[$860>>2] = $$0287$i$i;
  30811. $861 = $$0287$i$i >>> 3;
  30812. $862 = ($$0287$i$i>>>0)<(256);
  30813. if ($862) {
  30814. $863 = $861 << 1;
  30815. $864 = (35488 + ($863<<2)|0);
  30816. $865 = HEAP32[8862]|0;
  30817. $866 = 1 << $861;
  30818. $867 = $865 & $866;
  30819. $868 = ($867|0)==(0);
  30820. do {
  30821. if ($868) {
  30822. $869 = $865 | $866;
  30823. HEAP32[8862] = $869;
  30824. $$pre$i$i = ((($864)) + 8|0);
  30825. $$0295$i$i = $864;$$pre$phi$i$iZ2D = $$pre$i$i;
  30826. } else {
  30827. $870 = ((($864)) + 8|0);
  30828. $871 = HEAP32[$870>>2]|0;
  30829. $872 = HEAP32[(35464)>>2]|0;
  30830. $873 = ($871>>>0)<($872>>>0);
  30831. if (!($873)) {
  30832. $$0295$i$i = $871;$$pre$phi$i$iZ2D = $870;
  30833. break;
  30834. }
  30835. _abort();
  30836. // unreachable;
  30837. }
  30838. } while(0);
  30839. HEAP32[$$pre$phi$i$iZ2D>>2] = $748;
  30840. $874 = ((($$0295$i$i)) + 12|0);
  30841. HEAP32[$874>>2] = $748;
  30842. $875 = ((($748)) + 8|0);
  30843. HEAP32[$875>>2] = $$0295$i$i;
  30844. $876 = ((($748)) + 12|0);
  30845. HEAP32[$876>>2] = $864;
  30846. break;
  30847. }
  30848. $877 = $$0287$i$i >>> 8;
  30849. $878 = ($877|0)==(0);
  30850. do {
  30851. if ($878) {
  30852. $$0296$i$i = 0;
  30853. } else {
  30854. $879 = ($$0287$i$i>>>0)>(16777215);
  30855. if ($879) {
  30856. $$0296$i$i = 31;
  30857. break;
  30858. }
  30859. $880 = (($877) + 1048320)|0;
  30860. $881 = $880 >>> 16;
  30861. $882 = $881 & 8;
  30862. $883 = $877 << $882;
  30863. $884 = (($883) + 520192)|0;
  30864. $885 = $884 >>> 16;
  30865. $886 = $885 & 4;
  30866. $887 = $886 | $882;
  30867. $888 = $883 << $886;
  30868. $889 = (($888) + 245760)|0;
  30869. $890 = $889 >>> 16;
  30870. $891 = $890 & 2;
  30871. $892 = $887 | $891;
  30872. $893 = (14 - ($892))|0;
  30873. $894 = $888 << $891;
  30874. $895 = $894 >>> 15;
  30875. $896 = (($893) + ($895))|0;
  30876. $897 = $896 << 1;
  30877. $898 = (($896) + 7)|0;
  30878. $899 = $$0287$i$i >>> $898;
  30879. $900 = $899 & 1;
  30880. $901 = $900 | $897;
  30881. $$0296$i$i = $901;
  30882. }
  30883. } while(0);
  30884. $902 = (35752 + ($$0296$i$i<<2)|0);
  30885. $903 = ((($748)) + 28|0);
  30886. HEAP32[$903>>2] = $$0296$i$i;
  30887. $904 = ((($748)) + 16|0);
  30888. $905 = ((($904)) + 4|0);
  30889. HEAP32[$905>>2] = 0;
  30890. HEAP32[$904>>2] = 0;
  30891. $906 = HEAP32[(35452)>>2]|0;
  30892. $907 = 1 << $$0296$i$i;
  30893. $908 = $906 & $907;
  30894. $909 = ($908|0)==(0);
  30895. if ($909) {
  30896. $910 = $906 | $907;
  30897. HEAP32[(35452)>>2] = $910;
  30898. HEAP32[$902>>2] = $748;
  30899. $911 = ((($748)) + 24|0);
  30900. HEAP32[$911>>2] = $902;
  30901. $912 = ((($748)) + 12|0);
  30902. HEAP32[$912>>2] = $748;
  30903. $913 = ((($748)) + 8|0);
  30904. HEAP32[$913>>2] = $748;
  30905. break;
  30906. }
  30907. $914 = HEAP32[$902>>2]|0;
  30908. $915 = ($$0296$i$i|0)==(31);
  30909. $916 = $$0296$i$i >>> 1;
  30910. $917 = (25 - ($916))|0;
  30911. $918 = $915 ? 0 : $917;
  30912. $919 = $$0287$i$i << $918;
  30913. $$0288$i$i = $919;$$0289$i$i = $914;
  30914. while(1) {
  30915. $920 = ((($$0289$i$i)) + 4|0);
  30916. $921 = HEAP32[$920>>2]|0;
  30917. $922 = $921 & -8;
  30918. $923 = ($922|0)==($$0287$i$i|0);
  30919. if ($923) {
  30920. label = 280;
  30921. break;
  30922. }
  30923. $924 = $$0288$i$i >>> 31;
  30924. $925 = (((($$0289$i$i)) + 16|0) + ($924<<2)|0);
  30925. $926 = $$0288$i$i << 1;
  30926. $927 = HEAP32[$925>>2]|0;
  30927. $928 = ($927|0)==(0|0);
  30928. if ($928) {
  30929. label = 277;
  30930. break;
  30931. } else {
  30932. $$0288$i$i = $926;$$0289$i$i = $927;
  30933. }
  30934. }
  30935. if ((label|0) == 277) {
  30936. $929 = HEAP32[(35464)>>2]|0;
  30937. $930 = ($925>>>0)<($929>>>0);
  30938. if ($930) {
  30939. _abort();
  30940. // unreachable;
  30941. } else {
  30942. HEAP32[$925>>2] = $748;
  30943. $931 = ((($748)) + 24|0);
  30944. HEAP32[$931>>2] = $$0289$i$i;
  30945. $932 = ((($748)) + 12|0);
  30946. HEAP32[$932>>2] = $748;
  30947. $933 = ((($748)) + 8|0);
  30948. HEAP32[$933>>2] = $748;
  30949. break;
  30950. }
  30951. }
  30952. else if ((label|0) == 280) {
  30953. $934 = ((($$0289$i$i)) + 8|0);
  30954. $935 = HEAP32[$934>>2]|0;
  30955. $936 = HEAP32[(35464)>>2]|0;
  30956. $937 = ($935>>>0)>=($936>>>0);
  30957. $not$7$i$i = ($$0289$i$i>>>0)>=($936>>>0);
  30958. $938 = $937 & $not$7$i$i;
  30959. if ($938) {
  30960. $939 = ((($935)) + 12|0);
  30961. HEAP32[$939>>2] = $748;
  30962. HEAP32[$934>>2] = $748;
  30963. $940 = ((($748)) + 8|0);
  30964. HEAP32[$940>>2] = $935;
  30965. $941 = ((($748)) + 12|0);
  30966. HEAP32[$941>>2] = $$0289$i$i;
  30967. $942 = ((($748)) + 24|0);
  30968. HEAP32[$942>>2] = 0;
  30969. break;
  30970. } else {
  30971. _abort();
  30972. // unreachable;
  30973. }
  30974. }
  30975. }
  30976. } while(0);
  30977. $1074 = ((($736)) + 8|0);
  30978. $$2 = $1074;
  30979. break L230;
  30980. }
  30981. }
  30982. $$0$i$i$i = (35924);
  30983. while(1) {
  30984. $943 = HEAP32[$$0$i$i$i>>2]|0;
  30985. $944 = ($943>>>0)>($657>>>0);
  30986. if (!($944)) {
  30987. $945 = ((($$0$i$i$i)) + 4|0);
  30988. $946 = HEAP32[$945>>2]|0;
  30989. $947 = (($943) + ($946)|0);
  30990. $948 = ($947>>>0)>($657>>>0);
  30991. if ($948) {
  30992. break;
  30993. }
  30994. }
  30995. $949 = ((($$0$i$i$i)) + 8|0);
  30996. $950 = HEAP32[$949>>2]|0;
  30997. $$0$i$i$i = $950;
  30998. }
  30999. $951 = ((($947)) + -47|0);
  31000. $952 = ((($951)) + 8|0);
  31001. $953 = $952;
  31002. $954 = $953 & 7;
  31003. $955 = ($954|0)==(0);
  31004. $956 = (0 - ($953))|0;
  31005. $957 = $956 & 7;
  31006. $958 = $955 ? 0 : $957;
  31007. $959 = (($951) + ($958)|0);
  31008. $960 = ((($657)) + 16|0);
  31009. $961 = ($959>>>0)<($960>>>0);
  31010. $962 = $961 ? $657 : $959;
  31011. $963 = ((($962)) + 8|0);
  31012. $964 = ((($962)) + 24|0);
  31013. $965 = (($$7239$i) + -40)|0;
  31014. $966 = ((($$7$i)) + 8|0);
  31015. $967 = $966;
  31016. $968 = $967 & 7;
  31017. $969 = ($968|0)==(0);
  31018. $970 = (0 - ($967))|0;
  31019. $971 = $970 & 7;
  31020. $972 = $969 ? 0 : $971;
  31021. $973 = (($$7$i) + ($972)|0);
  31022. $974 = (($965) - ($972))|0;
  31023. HEAP32[(35472)>>2] = $973;
  31024. HEAP32[(35460)>>2] = $974;
  31025. $975 = $974 | 1;
  31026. $976 = ((($973)) + 4|0);
  31027. HEAP32[$976>>2] = $975;
  31028. $977 = (($973) + ($974)|0);
  31029. $978 = ((($977)) + 4|0);
  31030. HEAP32[$978>>2] = 40;
  31031. $979 = HEAP32[(35412)>>2]|0;
  31032. HEAP32[(35476)>>2] = $979;
  31033. $980 = ((($962)) + 4|0);
  31034. HEAP32[$980>>2] = 27;
  31035. ;HEAP32[$963>>2]=HEAP32[(35924)>>2]|0;HEAP32[$963+4>>2]=HEAP32[(35924)+4>>2]|0;HEAP32[$963+8>>2]=HEAP32[(35924)+8>>2]|0;HEAP32[$963+12>>2]=HEAP32[(35924)+12>>2]|0;
  31036. HEAP32[(35924)>>2] = $$7$i;
  31037. HEAP32[(35928)>>2] = $$7239$i;
  31038. HEAP32[(35936)>>2] = 0;
  31039. HEAP32[(35932)>>2] = $963;
  31040. $982 = $964;
  31041. while(1) {
  31042. $981 = ((($982)) + 4|0);
  31043. HEAP32[$981>>2] = 7;
  31044. $983 = ((($982)) + 8|0);
  31045. $984 = ($983>>>0)<($947>>>0);
  31046. if ($984) {
  31047. $982 = $981;
  31048. } else {
  31049. break;
  31050. }
  31051. }
  31052. $985 = ($962|0)==($657|0);
  31053. if (!($985)) {
  31054. $986 = $962;
  31055. $987 = $657;
  31056. $988 = (($986) - ($987))|0;
  31057. $989 = HEAP32[$980>>2]|0;
  31058. $990 = $989 & -2;
  31059. HEAP32[$980>>2] = $990;
  31060. $991 = $988 | 1;
  31061. $992 = ((($657)) + 4|0);
  31062. HEAP32[$992>>2] = $991;
  31063. HEAP32[$962>>2] = $988;
  31064. $993 = $988 >>> 3;
  31065. $994 = ($988>>>0)<(256);
  31066. if ($994) {
  31067. $995 = $993 << 1;
  31068. $996 = (35488 + ($995<<2)|0);
  31069. $997 = HEAP32[8862]|0;
  31070. $998 = 1 << $993;
  31071. $999 = $997 & $998;
  31072. $1000 = ($999|0)==(0);
  31073. do {
  31074. if ($1000) {
  31075. $1001 = $997 | $998;
  31076. HEAP32[8862] = $1001;
  31077. $$pre$i18$i = ((($996)) + 8|0);
  31078. $$0211$i$i = $996;$$pre$phi$i19$iZ2D = $$pre$i18$i;
  31079. } else {
  31080. $1002 = ((($996)) + 8|0);
  31081. $1003 = HEAP32[$1002>>2]|0;
  31082. $1004 = HEAP32[(35464)>>2]|0;
  31083. $1005 = ($1003>>>0)<($1004>>>0);
  31084. if (!($1005)) {
  31085. $$0211$i$i = $1003;$$pre$phi$i19$iZ2D = $1002;
  31086. break;
  31087. }
  31088. _abort();
  31089. // unreachable;
  31090. }
  31091. } while(0);
  31092. HEAP32[$$pre$phi$i19$iZ2D>>2] = $657;
  31093. $1006 = ((($$0211$i$i)) + 12|0);
  31094. HEAP32[$1006>>2] = $657;
  31095. $1007 = ((($657)) + 8|0);
  31096. HEAP32[$1007>>2] = $$0211$i$i;
  31097. $1008 = ((($657)) + 12|0);
  31098. HEAP32[$1008>>2] = $996;
  31099. break;
  31100. }
  31101. $1009 = $988 >>> 8;
  31102. $1010 = ($1009|0)==(0);
  31103. do {
  31104. if ($1010) {
  31105. $$0212$i$i = 0;
  31106. } else {
  31107. $1011 = ($988>>>0)>(16777215);
  31108. if ($1011) {
  31109. $$0212$i$i = 31;
  31110. break;
  31111. }
  31112. $1012 = (($1009) + 1048320)|0;
  31113. $1013 = $1012 >>> 16;
  31114. $1014 = $1013 & 8;
  31115. $1015 = $1009 << $1014;
  31116. $1016 = (($1015) + 520192)|0;
  31117. $1017 = $1016 >>> 16;
  31118. $1018 = $1017 & 4;
  31119. $1019 = $1018 | $1014;
  31120. $1020 = $1015 << $1018;
  31121. $1021 = (($1020) + 245760)|0;
  31122. $1022 = $1021 >>> 16;
  31123. $1023 = $1022 & 2;
  31124. $1024 = $1019 | $1023;
  31125. $1025 = (14 - ($1024))|0;
  31126. $1026 = $1020 << $1023;
  31127. $1027 = $1026 >>> 15;
  31128. $1028 = (($1025) + ($1027))|0;
  31129. $1029 = $1028 << 1;
  31130. $1030 = (($1028) + 7)|0;
  31131. $1031 = $988 >>> $1030;
  31132. $1032 = $1031 & 1;
  31133. $1033 = $1032 | $1029;
  31134. $$0212$i$i = $1033;
  31135. }
  31136. } while(0);
  31137. $1034 = (35752 + ($$0212$i$i<<2)|0);
  31138. $1035 = ((($657)) + 28|0);
  31139. HEAP32[$1035>>2] = $$0212$i$i;
  31140. $1036 = ((($657)) + 20|0);
  31141. HEAP32[$1036>>2] = 0;
  31142. HEAP32[$960>>2] = 0;
  31143. $1037 = HEAP32[(35452)>>2]|0;
  31144. $1038 = 1 << $$0212$i$i;
  31145. $1039 = $1037 & $1038;
  31146. $1040 = ($1039|0)==(0);
  31147. if ($1040) {
  31148. $1041 = $1037 | $1038;
  31149. HEAP32[(35452)>>2] = $1041;
  31150. HEAP32[$1034>>2] = $657;
  31151. $1042 = ((($657)) + 24|0);
  31152. HEAP32[$1042>>2] = $1034;
  31153. $1043 = ((($657)) + 12|0);
  31154. HEAP32[$1043>>2] = $657;
  31155. $1044 = ((($657)) + 8|0);
  31156. HEAP32[$1044>>2] = $657;
  31157. break;
  31158. }
  31159. $1045 = HEAP32[$1034>>2]|0;
  31160. $1046 = ($$0212$i$i|0)==(31);
  31161. $1047 = $$0212$i$i >>> 1;
  31162. $1048 = (25 - ($1047))|0;
  31163. $1049 = $1046 ? 0 : $1048;
  31164. $1050 = $988 << $1049;
  31165. $$0206$i$i = $1050;$$0207$i$i = $1045;
  31166. while(1) {
  31167. $1051 = ((($$0207$i$i)) + 4|0);
  31168. $1052 = HEAP32[$1051>>2]|0;
  31169. $1053 = $1052 & -8;
  31170. $1054 = ($1053|0)==($988|0);
  31171. if ($1054) {
  31172. label = 307;
  31173. break;
  31174. }
  31175. $1055 = $$0206$i$i >>> 31;
  31176. $1056 = (((($$0207$i$i)) + 16|0) + ($1055<<2)|0);
  31177. $1057 = $$0206$i$i << 1;
  31178. $1058 = HEAP32[$1056>>2]|0;
  31179. $1059 = ($1058|0)==(0|0);
  31180. if ($1059) {
  31181. label = 304;
  31182. break;
  31183. } else {
  31184. $$0206$i$i = $1057;$$0207$i$i = $1058;
  31185. }
  31186. }
  31187. if ((label|0) == 304) {
  31188. $1060 = HEAP32[(35464)>>2]|0;
  31189. $1061 = ($1056>>>0)<($1060>>>0);
  31190. if ($1061) {
  31191. _abort();
  31192. // unreachable;
  31193. } else {
  31194. HEAP32[$1056>>2] = $657;
  31195. $1062 = ((($657)) + 24|0);
  31196. HEAP32[$1062>>2] = $$0207$i$i;
  31197. $1063 = ((($657)) + 12|0);
  31198. HEAP32[$1063>>2] = $657;
  31199. $1064 = ((($657)) + 8|0);
  31200. HEAP32[$1064>>2] = $657;
  31201. break;
  31202. }
  31203. }
  31204. else if ((label|0) == 307) {
  31205. $1065 = ((($$0207$i$i)) + 8|0);
  31206. $1066 = HEAP32[$1065>>2]|0;
  31207. $1067 = HEAP32[(35464)>>2]|0;
  31208. $1068 = ($1066>>>0)>=($1067>>>0);
  31209. $not$$i21$i = ($$0207$i$i>>>0)>=($1067>>>0);
  31210. $1069 = $1068 & $not$$i21$i;
  31211. if ($1069) {
  31212. $1070 = ((($1066)) + 12|0);
  31213. HEAP32[$1070>>2] = $657;
  31214. HEAP32[$1065>>2] = $657;
  31215. $1071 = ((($657)) + 8|0);
  31216. HEAP32[$1071>>2] = $1066;
  31217. $1072 = ((($657)) + 12|0);
  31218. HEAP32[$1072>>2] = $$0207$i$i;
  31219. $1073 = ((($657)) + 24|0);
  31220. HEAP32[$1073>>2] = 0;
  31221. break;
  31222. } else {
  31223. _abort();
  31224. // unreachable;
  31225. }
  31226. }
  31227. }
  31228. }
  31229. } while(0);
  31230. $1075 = HEAP32[(35460)>>2]|0;
  31231. $1076 = ($1075>>>0)>($$0198>>>0);
  31232. if ($1076) {
  31233. $1077 = (($1075) - ($$0198))|0;
  31234. HEAP32[(35460)>>2] = $1077;
  31235. $1078 = HEAP32[(35472)>>2]|0;
  31236. $1079 = (($1078) + ($$0198)|0);
  31237. HEAP32[(35472)>>2] = $1079;
  31238. $1080 = $1077 | 1;
  31239. $1081 = ((($1079)) + 4|0);
  31240. HEAP32[$1081>>2] = $1080;
  31241. $1082 = $$0198 | 3;
  31242. $1083 = ((($1078)) + 4|0);
  31243. HEAP32[$1083>>2] = $1082;
  31244. $1084 = ((($1078)) + 8|0);
  31245. $$2 = $1084;
  31246. break;
  31247. }
  31248. }
  31249. }
  31250. $1085 = (___errno_location()|0);
  31251. HEAP32[$1085>>2] = 12;
  31252. $$2 = 0;
  31253. } else {
  31254. $$2 = 0;
  31255. }
  31256. }
  31257. } while(0);
  31258. $1086 = HEAP32[(35892)>>2]|0;
  31259. $1087 = $1086 & 2;
  31260. $1088 = ($1087|0)==(0);
  31261. if ($1088) {
  31262. $$1 = $$2;
  31263. STACKTOP = sp;return ($$1|0);
  31264. }
  31265. (___pthread_mutex_unlock((35896))|0);
  31266. $$1 = $$2;
  31267. STACKTOP = sp;return ($$1|0);
  31268. }
  31269. function _free($0) {
  31270. $0 = $0|0;
  31271. 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;
  31272. 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;
  31273. 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;
  31274. 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;
  31275. 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;
  31276. 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;
  31277. 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;
  31278. 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;
  31279. 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;
  31280. 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;
  31281. 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;
  31282. 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;
  31283. 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;
  31284. 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;
  31285. 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;
  31286. 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;
  31287. 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;
  31288. 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;
  31289. sp = STACKTOP;
  31290. $1 = ($0|0)==(0|0);
  31291. if ($1) {
  31292. return;
  31293. }
  31294. $2 = ((($0)) + -8|0);
  31295. $3 = HEAP32[(35892)>>2]|0;
  31296. $4 = $3 & 2;
  31297. $5 = ($4|0)==(0);
  31298. if (!($5)) {
  31299. $6 = (___pthread_mutex_lock((35896))|0);
  31300. $7 = ($6|0)==(0);
  31301. if (!($7)) {
  31302. return;
  31303. }
  31304. }
  31305. $8 = HEAP32[(35464)>>2]|0;
  31306. $9 = ($2>>>0)<($8>>>0);
  31307. if ($9) {
  31308. _abort();
  31309. // unreachable;
  31310. }
  31311. $10 = ((($0)) + -4|0);
  31312. $11 = HEAP32[$10>>2]|0;
  31313. $12 = $11 & 3;
  31314. $13 = ($12|0)==(1);
  31315. if ($13) {
  31316. _abort();
  31317. // unreachable;
  31318. }
  31319. $14 = $11 & -8;
  31320. $15 = (($2) + ($14)|0);
  31321. $16 = $11 & 1;
  31322. $17 = ($16|0)==(0);
  31323. L14: do {
  31324. if ($17) {
  31325. $18 = HEAP32[$2>>2]|0;
  31326. $19 = ($12|0)==(0);
  31327. if (!($19)) {
  31328. $20 = (0 - ($18))|0;
  31329. $21 = (($2) + ($20)|0);
  31330. $22 = (($18) + ($14))|0;
  31331. $23 = ($21>>>0)<($8>>>0);
  31332. if ($23) {
  31333. _abort();
  31334. // unreachable;
  31335. }
  31336. $24 = HEAP32[(35468)>>2]|0;
  31337. $25 = ($21|0)==($24|0);
  31338. if ($25) {
  31339. $109 = ((($15)) + 4|0);
  31340. $110 = HEAP32[$109>>2]|0;
  31341. $111 = $110 & 3;
  31342. $112 = ($111|0)==(3);
  31343. if (!($112)) {
  31344. $$1 = $21;$$1382 = $22;$118 = $21;
  31345. label = 55;
  31346. break;
  31347. }
  31348. $113 = (($21) + ($22)|0);
  31349. $114 = ((($21)) + 4|0);
  31350. $115 = $22 | 1;
  31351. $116 = $110 & -2;
  31352. HEAP32[(35456)>>2] = $22;
  31353. HEAP32[$109>>2] = $116;
  31354. HEAP32[$114>>2] = $115;
  31355. HEAP32[$113>>2] = $22;
  31356. break;
  31357. }
  31358. $26 = $18 >>> 3;
  31359. $27 = ($18>>>0)<(256);
  31360. if ($27) {
  31361. $28 = ((($21)) + 8|0);
  31362. $29 = HEAP32[$28>>2]|0;
  31363. $30 = ((($21)) + 12|0);
  31364. $31 = HEAP32[$30>>2]|0;
  31365. $32 = $26 << 1;
  31366. $33 = (35488 + ($32<<2)|0);
  31367. $34 = ($29|0)==($33|0);
  31368. if (!($34)) {
  31369. $35 = ($29>>>0)<($8>>>0);
  31370. if ($35) {
  31371. _abort();
  31372. // unreachable;
  31373. }
  31374. $36 = ((($29)) + 12|0);
  31375. $37 = HEAP32[$36>>2]|0;
  31376. $38 = ($37|0)==($21|0);
  31377. if (!($38)) {
  31378. _abort();
  31379. // unreachable;
  31380. }
  31381. }
  31382. $39 = ($31|0)==($29|0);
  31383. if ($39) {
  31384. $40 = 1 << $26;
  31385. $41 = $40 ^ -1;
  31386. $42 = HEAP32[8862]|0;
  31387. $43 = $42 & $41;
  31388. HEAP32[8862] = $43;
  31389. $$1 = $21;$$1382 = $22;$118 = $21;
  31390. label = 55;
  31391. break;
  31392. }
  31393. $44 = ($31|0)==($33|0);
  31394. if ($44) {
  31395. $$pre444 = ((($31)) + 8|0);
  31396. $$pre$phi445Z2D = $$pre444;
  31397. } else {
  31398. $45 = ($31>>>0)<($8>>>0);
  31399. if ($45) {
  31400. _abort();
  31401. // unreachable;
  31402. }
  31403. $46 = ((($31)) + 8|0);
  31404. $47 = HEAP32[$46>>2]|0;
  31405. $48 = ($47|0)==($21|0);
  31406. if ($48) {
  31407. $$pre$phi445Z2D = $46;
  31408. } else {
  31409. _abort();
  31410. // unreachable;
  31411. }
  31412. }
  31413. $49 = ((($29)) + 12|0);
  31414. HEAP32[$49>>2] = $31;
  31415. HEAP32[$$pre$phi445Z2D>>2] = $29;
  31416. $$1 = $21;$$1382 = $22;$118 = $21;
  31417. label = 55;
  31418. break;
  31419. }
  31420. $50 = ((($21)) + 24|0);
  31421. $51 = HEAP32[$50>>2]|0;
  31422. $52 = ((($21)) + 12|0);
  31423. $53 = HEAP32[$52>>2]|0;
  31424. $54 = ($53|0)==($21|0);
  31425. do {
  31426. if ($54) {
  31427. $64 = ((($21)) + 16|0);
  31428. $65 = ((($64)) + 4|0);
  31429. $66 = HEAP32[$65>>2]|0;
  31430. $67 = ($66|0)==(0|0);
  31431. if ($67) {
  31432. $68 = HEAP32[$64>>2]|0;
  31433. $69 = ($68|0)==(0|0);
  31434. if ($69) {
  31435. $$3 = 0;
  31436. break;
  31437. } else {
  31438. $$1387 = $68;$$1390 = $64;
  31439. }
  31440. } else {
  31441. $$1387 = $66;$$1390 = $65;
  31442. }
  31443. while(1) {
  31444. $70 = ((($$1387)) + 20|0);
  31445. $71 = HEAP32[$70>>2]|0;
  31446. $72 = ($71|0)==(0|0);
  31447. if (!($72)) {
  31448. $$1387 = $71;$$1390 = $70;
  31449. continue;
  31450. }
  31451. $73 = ((($$1387)) + 16|0);
  31452. $74 = HEAP32[$73>>2]|0;
  31453. $75 = ($74|0)==(0|0);
  31454. if ($75) {
  31455. break;
  31456. } else {
  31457. $$1387 = $74;$$1390 = $73;
  31458. }
  31459. }
  31460. $76 = ($$1390>>>0)<($8>>>0);
  31461. if ($76) {
  31462. _abort();
  31463. // unreachable;
  31464. } else {
  31465. HEAP32[$$1390>>2] = 0;
  31466. $$3 = $$1387;
  31467. break;
  31468. }
  31469. } else {
  31470. $55 = ((($21)) + 8|0);
  31471. $56 = HEAP32[$55>>2]|0;
  31472. $57 = ($56>>>0)<($8>>>0);
  31473. if ($57) {
  31474. _abort();
  31475. // unreachable;
  31476. }
  31477. $58 = ((($56)) + 12|0);
  31478. $59 = HEAP32[$58>>2]|0;
  31479. $60 = ($59|0)==($21|0);
  31480. if (!($60)) {
  31481. _abort();
  31482. // unreachable;
  31483. }
  31484. $61 = ((($53)) + 8|0);
  31485. $62 = HEAP32[$61>>2]|0;
  31486. $63 = ($62|0)==($21|0);
  31487. if ($63) {
  31488. HEAP32[$58>>2] = $53;
  31489. HEAP32[$61>>2] = $56;
  31490. $$3 = $53;
  31491. break;
  31492. } else {
  31493. _abort();
  31494. // unreachable;
  31495. }
  31496. }
  31497. } while(0);
  31498. $77 = ($51|0)==(0|0);
  31499. if ($77) {
  31500. $$1 = $21;$$1382 = $22;$118 = $21;
  31501. label = 55;
  31502. } else {
  31503. $78 = ((($21)) + 28|0);
  31504. $79 = HEAP32[$78>>2]|0;
  31505. $80 = (35752 + ($79<<2)|0);
  31506. $81 = HEAP32[$80>>2]|0;
  31507. $82 = ($21|0)==($81|0);
  31508. do {
  31509. if ($82) {
  31510. HEAP32[$80>>2] = $$3;
  31511. $cond421 = ($$3|0)==(0|0);
  31512. if ($cond421) {
  31513. $83 = 1 << $79;
  31514. $84 = $83 ^ -1;
  31515. $85 = HEAP32[(35452)>>2]|0;
  31516. $86 = $85 & $84;
  31517. HEAP32[(35452)>>2] = $86;
  31518. $$1 = $21;$$1382 = $22;$118 = $21;
  31519. label = 55;
  31520. break L14;
  31521. }
  31522. } else {
  31523. $87 = HEAP32[(35464)>>2]|0;
  31524. $88 = ($51>>>0)<($87>>>0);
  31525. if ($88) {
  31526. _abort();
  31527. // unreachable;
  31528. } else {
  31529. $89 = ((($51)) + 16|0);
  31530. $90 = HEAP32[$89>>2]|0;
  31531. $not$405 = ($90|0)!=($21|0);
  31532. $$sink3 = $not$405&1;
  31533. $91 = (((($51)) + 16|0) + ($$sink3<<2)|0);
  31534. HEAP32[$91>>2] = $$3;
  31535. $92 = ($$3|0)==(0|0);
  31536. if ($92) {
  31537. $$1 = $21;$$1382 = $22;$118 = $21;
  31538. label = 55;
  31539. break L14;
  31540. } else {
  31541. break;
  31542. }
  31543. }
  31544. }
  31545. } while(0);
  31546. $93 = HEAP32[(35464)>>2]|0;
  31547. $94 = ($$3>>>0)<($93>>>0);
  31548. if ($94) {
  31549. _abort();
  31550. // unreachable;
  31551. }
  31552. $95 = ((($$3)) + 24|0);
  31553. HEAP32[$95>>2] = $51;
  31554. $96 = ((($21)) + 16|0);
  31555. $97 = HEAP32[$96>>2]|0;
  31556. $98 = ($97|0)==(0|0);
  31557. do {
  31558. if (!($98)) {
  31559. $99 = ($97>>>0)<($93>>>0);
  31560. if ($99) {
  31561. _abort();
  31562. // unreachable;
  31563. } else {
  31564. $100 = ((($$3)) + 16|0);
  31565. HEAP32[$100>>2] = $97;
  31566. $101 = ((($97)) + 24|0);
  31567. HEAP32[$101>>2] = $$3;
  31568. break;
  31569. }
  31570. }
  31571. } while(0);
  31572. $102 = ((($96)) + 4|0);
  31573. $103 = HEAP32[$102>>2]|0;
  31574. $104 = ($103|0)==(0|0);
  31575. if ($104) {
  31576. $$1 = $21;$$1382 = $22;$118 = $21;
  31577. label = 55;
  31578. } else {
  31579. $105 = HEAP32[(35464)>>2]|0;
  31580. $106 = ($103>>>0)<($105>>>0);
  31581. if ($106) {
  31582. _abort();
  31583. // unreachable;
  31584. } else {
  31585. $107 = ((($$3)) + 20|0);
  31586. HEAP32[$107>>2] = $103;
  31587. $108 = ((($103)) + 24|0);
  31588. HEAP32[$108>>2] = $$3;
  31589. $$1 = $21;$$1382 = $22;$118 = $21;
  31590. label = 55;
  31591. break;
  31592. }
  31593. }
  31594. }
  31595. }
  31596. } else {
  31597. $$1 = $2;$$1382 = $14;$118 = $2;
  31598. label = 55;
  31599. }
  31600. } while(0);
  31601. do {
  31602. if ((label|0) == 55) {
  31603. $117 = ($118>>>0)<($15>>>0);
  31604. if (!($117)) {
  31605. _abort();
  31606. // unreachable;
  31607. }
  31608. $119 = ((($15)) + 4|0);
  31609. $120 = HEAP32[$119>>2]|0;
  31610. $121 = $120 & 1;
  31611. $122 = ($121|0)==(0);
  31612. if ($122) {
  31613. _abort();
  31614. // unreachable;
  31615. }
  31616. $123 = $120 & 2;
  31617. $124 = ($123|0)==(0);
  31618. if ($124) {
  31619. $125 = HEAP32[(35472)>>2]|0;
  31620. $126 = ($15|0)==($125|0);
  31621. $127 = HEAP32[(35468)>>2]|0;
  31622. if ($126) {
  31623. $128 = HEAP32[(35460)>>2]|0;
  31624. $129 = (($128) + ($$1382))|0;
  31625. HEAP32[(35460)>>2] = $129;
  31626. HEAP32[(35472)>>2] = $$1;
  31627. $130 = $129 | 1;
  31628. $131 = ((($$1)) + 4|0);
  31629. HEAP32[$131>>2] = $130;
  31630. $132 = ($$1|0)==($127|0);
  31631. if (!($132)) {
  31632. break;
  31633. }
  31634. HEAP32[(35468)>>2] = 0;
  31635. HEAP32[(35456)>>2] = 0;
  31636. break;
  31637. }
  31638. $133 = ($15|0)==($127|0);
  31639. if ($133) {
  31640. $134 = HEAP32[(35456)>>2]|0;
  31641. $135 = (($134) + ($$1382))|0;
  31642. HEAP32[(35456)>>2] = $135;
  31643. HEAP32[(35468)>>2] = $118;
  31644. $136 = $135 | 1;
  31645. $137 = ((($$1)) + 4|0);
  31646. HEAP32[$137>>2] = $136;
  31647. $138 = (($118) + ($135)|0);
  31648. HEAP32[$138>>2] = $135;
  31649. break;
  31650. }
  31651. $139 = $120 & -8;
  31652. $140 = (($139) + ($$1382))|0;
  31653. $141 = $120 >>> 3;
  31654. $142 = ($120>>>0)<(256);
  31655. L106: do {
  31656. if ($142) {
  31657. $143 = ((($15)) + 8|0);
  31658. $144 = HEAP32[$143>>2]|0;
  31659. $145 = ((($15)) + 12|0);
  31660. $146 = HEAP32[$145>>2]|0;
  31661. $147 = $141 << 1;
  31662. $148 = (35488 + ($147<<2)|0);
  31663. $149 = ($144|0)==($148|0);
  31664. if (!($149)) {
  31665. $150 = HEAP32[(35464)>>2]|0;
  31666. $151 = ($144>>>0)<($150>>>0);
  31667. if ($151) {
  31668. _abort();
  31669. // unreachable;
  31670. }
  31671. $152 = ((($144)) + 12|0);
  31672. $153 = HEAP32[$152>>2]|0;
  31673. $154 = ($153|0)==($15|0);
  31674. if (!($154)) {
  31675. _abort();
  31676. // unreachable;
  31677. }
  31678. }
  31679. $155 = ($146|0)==($144|0);
  31680. if ($155) {
  31681. $156 = 1 << $141;
  31682. $157 = $156 ^ -1;
  31683. $158 = HEAP32[8862]|0;
  31684. $159 = $158 & $157;
  31685. HEAP32[8862] = $159;
  31686. break;
  31687. }
  31688. $160 = ($146|0)==($148|0);
  31689. if ($160) {
  31690. $$pre442 = ((($146)) + 8|0);
  31691. $$pre$phi443Z2D = $$pre442;
  31692. } else {
  31693. $161 = HEAP32[(35464)>>2]|0;
  31694. $162 = ($146>>>0)<($161>>>0);
  31695. if ($162) {
  31696. _abort();
  31697. // unreachable;
  31698. }
  31699. $163 = ((($146)) + 8|0);
  31700. $164 = HEAP32[$163>>2]|0;
  31701. $165 = ($164|0)==($15|0);
  31702. if ($165) {
  31703. $$pre$phi443Z2D = $163;
  31704. } else {
  31705. _abort();
  31706. // unreachable;
  31707. }
  31708. }
  31709. $166 = ((($144)) + 12|0);
  31710. HEAP32[$166>>2] = $146;
  31711. HEAP32[$$pre$phi443Z2D>>2] = $144;
  31712. } else {
  31713. $167 = ((($15)) + 24|0);
  31714. $168 = HEAP32[$167>>2]|0;
  31715. $169 = ((($15)) + 12|0);
  31716. $170 = HEAP32[$169>>2]|0;
  31717. $171 = ($170|0)==($15|0);
  31718. do {
  31719. if ($171) {
  31720. $182 = ((($15)) + 16|0);
  31721. $183 = ((($182)) + 4|0);
  31722. $184 = HEAP32[$183>>2]|0;
  31723. $185 = ($184|0)==(0|0);
  31724. if ($185) {
  31725. $186 = HEAP32[$182>>2]|0;
  31726. $187 = ($186|0)==(0|0);
  31727. if ($187) {
  31728. $$3400 = 0;
  31729. break;
  31730. } else {
  31731. $$1398 = $186;$$1402 = $182;
  31732. }
  31733. } else {
  31734. $$1398 = $184;$$1402 = $183;
  31735. }
  31736. while(1) {
  31737. $188 = ((($$1398)) + 20|0);
  31738. $189 = HEAP32[$188>>2]|0;
  31739. $190 = ($189|0)==(0|0);
  31740. if (!($190)) {
  31741. $$1398 = $189;$$1402 = $188;
  31742. continue;
  31743. }
  31744. $191 = ((($$1398)) + 16|0);
  31745. $192 = HEAP32[$191>>2]|0;
  31746. $193 = ($192|0)==(0|0);
  31747. if ($193) {
  31748. break;
  31749. } else {
  31750. $$1398 = $192;$$1402 = $191;
  31751. }
  31752. }
  31753. $194 = HEAP32[(35464)>>2]|0;
  31754. $195 = ($$1402>>>0)<($194>>>0);
  31755. if ($195) {
  31756. _abort();
  31757. // unreachable;
  31758. } else {
  31759. HEAP32[$$1402>>2] = 0;
  31760. $$3400 = $$1398;
  31761. break;
  31762. }
  31763. } else {
  31764. $172 = ((($15)) + 8|0);
  31765. $173 = HEAP32[$172>>2]|0;
  31766. $174 = HEAP32[(35464)>>2]|0;
  31767. $175 = ($173>>>0)<($174>>>0);
  31768. if ($175) {
  31769. _abort();
  31770. // unreachable;
  31771. }
  31772. $176 = ((($173)) + 12|0);
  31773. $177 = HEAP32[$176>>2]|0;
  31774. $178 = ($177|0)==($15|0);
  31775. if (!($178)) {
  31776. _abort();
  31777. // unreachable;
  31778. }
  31779. $179 = ((($170)) + 8|0);
  31780. $180 = HEAP32[$179>>2]|0;
  31781. $181 = ($180|0)==($15|0);
  31782. if ($181) {
  31783. HEAP32[$176>>2] = $170;
  31784. HEAP32[$179>>2] = $173;
  31785. $$3400 = $170;
  31786. break;
  31787. } else {
  31788. _abort();
  31789. // unreachable;
  31790. }
  31791. }
  31792. } while(0);
  31793. $196 = ($168|0)==(0|0);
  31794. if (!($196)) {
  31795. $197 = ((($15)) + 28|0);
  31796. $198 = HEAP32[$197>>2]|0;
  31797. $199 = (35752 + ($198<<2)|0);
  31798. $200 = HEAP32[$199>>2]|0;
  31799. $201 = ($15|0)==($200|0);
  31800. do {
  31801. if ($201) {
  31802. HEAP32[$199>>2] = $$3400;
  31803. $cond422 = ($$3400|0)==(0|0);
  31804. if ($cond422) {
  31805. $202 = 1 << $198;
  31806. $203 = $202 ^ -1;
  31807. $204 = HEAP32[(35452)>>2]|0;
  31808. $205 = $204 & $203;
  31809. HEAP32[(35452)>>2] = $205;
  31810. break L106;
  31811. }
  31812. } else {
  31813. $206 = HEAP32[(35464)>>2]|0;
  31814. $207 = ($168>>>0)<($206>>>0);
  31815. if ($207) {
  31816. _abort();
  31817. // unreachable;
  31818. } else {
  31819. $208 = ((($168)) + 16|0);
  31820. $209 = HEAP32[$208>>2]|0;
  31821. $not$ = ($209|0)!=($15|0);
  31822. $$sink5 = $not$&1;
  31823. $210 = (((($168)) + 16|0) + ($$sink5<<2)|0);
  31824. HEAP32[$210>>2] = $$3400;
  31825. $211 = ($$3400|0)==(0|0);
  31826. if ($211) {
  31827. break L106;
  31828. } else {
  31829. break;
  31830. }
  31831. }
  31832. }
  31833. } while(0);
  31834. $212 = HEAP32[(35464)>>2]|0;
  31835. $213 = ($$3400>>>0)<($212>>>0);
  31836. if ($213) {
  31837. _abort();
  31838. // unreachable;
  31839. }
  31840. $214 = ((($$3400)) + 24|0);
  31841. HEAP32[$214>>2] = $168;
  31842. $215 = ((($15)) + 16|0);
  31843. $216 = HEAP32[$215>>2]|0;
  31844. $217 = ($216|0)==(0|0);
  31845. do {
  31846. if (!($217)) {
  31847. $218 = ($216>>>0)<($212>>>0);
  31848. if ($218) {
  31849. _abort();
  31850. // unreachable;
  31851. } else {
  31852. $219 = ((($$3400)) + 16|0);
  31853. HEAP32[$219>>2] = $216;
  31854. $220 = ((($216)) + 24|0);
  31855. HEAP32[$220>>2] = $$3400;
  31856. break;
  31857. }
  31858. }
  31859. } while(0);
  31860. $221 = ((($215)) + 4|0);
  31861. $222 = HEAP32[$221>>2]|0;
  31862. $223 = ($222|0)==(0|0);
  31863. if (!($223)) {
  31864. $224 = HEAP32[(35464)>>2]|0;
  31865. $225 = ($222>>>0)<($224>>>0);
  31866. if ($225) {
  31867. _abort();
  31868. // unreachable;
  31869. } else {
  31870. $226 = ((($$3400)) + 20|0);
  31871. HEAP32[$226>>2] = $222;
  31872. $227 = ((($222)) + 24|0);
  31873. HEAP32[$227>>2] = $$3400;
  31874. break;
  31875. }
  31876. }
  31877. }
  31878. }
  31879. } while(0);
  31880. $228 = $140 | 1;
  31881. $229 = ((($$1)) + 4|0);
  31882. HEAP32[$229>>2] = $228;
  31883. $230 = (($118) + ($140)|0);
  31884. HEAP32[$230>>2] = $140;
  31885. $231 = HEAP32[(35468)>>2]|0;
  31886. $232 = ($$1|0)==($231|0);
  31887. if ($232) {
  31888. HEAP32[(35456)>>2] = $140;
  31889. break;
  31890. } else {
  31891. $$2 = $140;
  31892. }
  31893. } else {
  31894. $233 = $120 & -2;
  31895. HEAP32[$119>>2] = $233;
  31896. $234 = $$1382 | 1;
  31897. $235 = ((($$1)) + 4|0);
  31898. HEAP32[$235>>2] = $234;
  31899. $236 = (($118) + ($$1382)|0);
  31900. HEAP32[$236>>2] = $$1382;
  31901. $$2 = $$1382;
  31902. }
  31903. $237 = $$2 >>> 3;
  31904. $238 = ($$2>>>0)<(256);
  31905. if ($238) {
  31906. $239 = $237 << 1;
  31907. $240 = (35488 + ($239<<2)|0);
  31908. $241 = HEAP32[8862]|0;
  31909. $242 = 1 << $237;
  31910. $243 = $241 & $242;
  31911. $244 = ($243|0)==(0);
  31912. if ($244) {
  31913. $245 = $241 | $242;
  31914. HEAP32[8862] = $245;
  31915. $$pre = ((($240)) + 8|0);
  31916. $$0403 = $240;$$pre$phiZ2D = $$pre;
  31917. } else {
  31918. $246 = ((($240)) + 8|0);
  31919. $247 = HEAP32[$246>>2]|0;
  31920. $248 = HEAP32[(35464)>>2]|0;
  31921. $249 = ($247>>>0)<($248>>>0);
  31922. if ($249) {
  31923. _abort();
  31924. // unreachable;
  31925. } else {
  31926. $$0403 = $247;$$pre$phiZ2D = $246;
  31927. }
  31928. }
  31929. HEAP32[$$pre$phiZ2D>>2] = $$1;
  31930. $250 = ((($$0403)) + 12|0);
  31931. HEAP32[$250>>2] = $$1;
  31932. $251 = ((($$1)) + 8|0);
  31933. HEAP32[$251>>2] = $$0403;
  31934. $252 = ((($$1)) + 12|0);
  31935. HEAP32[$252>>2] = $240;
  31936. break;
  31937. }
  31938. $253 = $$2 >>> 8;
  31939. $254 = ($253|0)==(0);
  31940. if ($254) {
  31941. $$0396 = 0;
  31942. } else {
  31943. $255 = ($$2>>>0)>(16777215);
  31944. if ($255) {
  31945. $$0396 = 31;
  31946. } else {
  31947. $256 = (($253) + 1048320)|0;
  31948. $257 = $256 >>> 16;
  31949. $258 = $257 & 8;
  31950. $259 = $253 << $258;
  31951. $260 = (($259) + 520192)|0;
  31952. $261 = $260 >>> 16;
  31953. $262 = $261 & 4;
  31954. $263 = $262 | $258;
  31955. $264 = $259 << $262;
  31956. $265 = (($264) + 245760)|0;
  31957. $266 = $265 >>> 16;
  31958. $267 = $266 & 2;
  31959. $268 = $263 | $267;
  31960. $269 = (14 - ($268))|0;
  31961. $270 = $264 << $267;
  31962. $271 = $270 >>> 15;
  31963. $272 = (($269) + ($271))|0;
  31964. $273 = $272 << 1;
  31965. $274 = (($272) + 7)|0;
  31966. $275 = $$2 >>> $274;
  31967. $276 = $275 & 1;
  31968. $277 = $276 | $273;
  31969. $$0396 = $277;
  31970. }
  31971. }
  31972. $278 = (35752 + ($$0396<<2)|0);
  31973. $279 = ((($$1)) + 28|0);
  31974. HEAP32[$279>>2] = $$0396;
  31975. $280 = ((($$1)) + 16|0);
  31976. $281 = ((($$1)) + 20|0);
  31977. HEAP32[$281>>2] = 0;
  31978. HEAP32[$280>>2] = 0;
  31979. $282 = HEAP32[(35452)>>2]|0;
  31980. $283 = 1 << $$0396;
  31981. $284 = $282 & $283;
  31982. $285 = ($284|0)==(0);
  31983. do {
  31984. if ($285) {
  31985. $286 = $282 | $283;
  31986. HEAP32[(35452)>>2] = $286;
  31987. HEAP32[$278>>2] = $$1;
  31988. $287 = ((($$1)) + 24|0);
  31989. HEAP32[$287>>2] = $278;
  31990. $288 = ((($$1)) + 12|0);
  31991. HEAP32[$288>>2] = $$1;
  31992. $289 = ((($$1)) + 8|0);
  31993. HEAP32[$289>>2] = $$1;
  31994. } else {
  31995. $290 = HEAP32[$278>>2]|0;
  31996. $291 = ($$0396|0)==(31);
  31997. $292 = $$0396 >>> 1;
  31998. $293 = (25 - ($292))|0;
  31999. $294 = $291 ? 0 : $293;
  32000. $295 = $$2 << $294;
  32001. $$0383 = $295;$$0384 = $290;
  32002. while(1) {
  32003. $296 = ((($$0384)) + 4|0);
  32004. $297 = HEAP32[$296>>2]|0;
  32005. $298 = $297 & -8;
  32006. $299 = ($298|0)==($$2|0);
  32007. if ($299) {
  32008. label = 126;
  32009. break;
  32010. }
  32011. $300 = $$0383 >>> 31;
  32012. $301 = (((($$0384)) + 16|0) + ($300<<2)|0);
  32013. $302 = $$0383 << 1;
  32014. $303 = HEAP32[$301>>2]|0;
  32015. $304 = ($303|0)==(0|0);
  32016. if ($304) {
  32017. label = 123;
  32018. break;
  32019. } else {
  32020. $$0383 = $302;$$0384 = $303;
  32021. }
  32022. }
  32023. if ((label|0) == 123) {
  32024. $305 = HEAP32[(35464)>>2]|0;
  32025. $306 = ($301>>>0)<($305>>>0);
  32026. if ($306) {
  32027. _abort();
  32028. // unreachable;
  32029. } else {
  32030. HEAP32[$301>>2] = $$1;
  32031. $307 = ((($$1)) + 24|0);
  32032. HEAP32[$307>>2] = $$0384;
  32033. $308 = ((($$1)) + 12|0);
  32034. HEAP32[$308>>2] = $$1;
  32035. $309 = ((($$1)) + 8|0);
  32036. HEAP32[$309>>2] = $$1;
  32037. break;
  32038. }
  32039. }
  32040. else if ((label|0) == 126) {
  32041. $310 = ((($$0384)) + 8|0);
  32042. $311 = HEAP32[$310>>2]|0;
  32043. $312 = HEAP32[(35464)>>2]|0;
  32044. $313 = ($311>>>0)>=($312>>>0);
  32045. $not$437 = ($$0384>>>0)>=($312>>>0);
  32046. $314 = $313 & $not$437;
  32047. if ($314) {
  32048. $315 = ((($311)) + 12|0);
  32049. HEAP32[$315>>2] = $$1;
  32050. HEAP32[$310>>2] = $$1;
  32051. $316 = ((($$1)) + 8|0);
  32052. HEAP32[$316>>2] = $311;
  32053. $317 = ((($$1)) + 12|0);
  32054. HEAP32[$317>>2] = $$0384;
  32055. $318 = ((($$1)) + 24|0);
  32056. HEAP32[$318>>2] = 0;
  32057. break;
  32058. } else {
  32059. _abort();
  32060. // unreachable;
  32061. }
  32062. }
  32063. }
  32064. } while(0);
  32065. $319 = HEAP32[(35480)>>2]|0;
  32066. $320 = (($319) + -1)|0;
  32067. HEAP32[(35480)>>2] = $320;
  32068. $321 = ($320|0)==(0);
  32069. if ($321) {
  32070. $$0212$in$i = (35932);
  32071. while(1) {
  32072. $$0212$i = HEAP32[$$0212$in$i>>2]|0;
  32073. $322 = ($$0212$i|0)==(0|0);
  32074. $323 = ((($$0212$i)) + 8|0);
  32075. if ($322) {
  32076. break;
  32077. } else {
  32078. $$0212$in$i = $323;
  32079. }
  32080. }
  32081. HEAP32[(35480)>>2] = -1;
  32082. }
  32083. }
  32084. } while(0);
  32085. $324 = HEAP32[(35892)>>2]|0;
  32086. $325 = $324 & 2;
  32087. $326 = ($325|0)==(0);
  32088. if ($326) {
  32089. return;
  32090. }
  32091. (___pthread_mutex_unlock((35896))|0);
  32092. return;
  32093. }
  32094. function runPostSets() {
  32095. }
  32096. function _memset(ptr, value, num) {
  32097. ptr = ptr|0; value = value|0; num = num|0;
  32098. var end = 0, aligned_end = 0, block_aligned_end = 0, value4 = 0;
  32099. end = (ptr + num)|0;
  32100. value = value & 0xff;
  32101. if ((num|0) >= 67 /* 64 bytes for an unrolled loop + 3 bytes for unaligned head*/) {
  32102. while ((ptr&3) != 0) {
  32103. HEAP8[((ptr)>>0)]=value;
  32104. ptr = (ptr+1)|0;
  32105. }
  32106. aligned_end = (end & -4)|0;
  32107. block_aligned_end = (aligned_end - 64)|0;
  32108. value4 = value | (value << 8) | (value << 16) | (value << 24);
  32109. while((ptr|0) <= (block_aligned_end|0)) {
  32110. HEAP32[((ptr)>>2)]=value4;
  32111. HEAP32[(((ptr)+(4))>>2)]=value4;
  32112. HEAP32[(((ptr)+(8))>>2)]=value4;
  32113. HEAP32[(((ptr)+(12))>>2)]=value4;
  32114. HEAP32[(((ptr)+(16))>>2)]=value4;
  32115. HEAP32[(((ptr)+(20))>>2)]=value4;
  32116. HEAP32[(((ptr)+(24))>>2)]=value4;
  32117. HEAP32[(((ptr)+(28))>>2)]=value4;
  32118. HEAP32[(((ptr)+(32))>>2)]=value4;
  32119. HEAP32[(((ptr)+(36))>>2)]=value4;
  32120. HEAP32[(((ptr)+(40))>>2)]=value4;
  32121. HEAP32[(((ptr)+(44))>>2)]=value4;
  32122. HEAP32[(((ptr)+(48))>>2)]=value4;
  32123. HEAP32[(((ptr)+(52))>>2)]=value4;
  32124. HEAP32[(((ptr)+(56))>>2)]=value4;
  32125. HEAP32[(((ptr)+(60))>>2)]=value4;
  32126. ptr = (ptr + 64)|0;
  32127. }
  32128. while ((ptr|0) < (aligned_end|0) ) {
  32129. HEAP32[((ptr)>>2)]=value4;
  32130. ptr = (ptr+4)|0;
  32131. }
  32132. }
  32133. // The remaining bytes.
  32134. while ((ptr|0) < (end|0)) {
  32135. HEAP8[((ptr)>>0)]=value;
  32136. ptr = (ptr+1)|0;
  32137. }
  32138. return (end-num)|0;
  32139. }
  32140. function _i64Subtract(a, b, c, d) {
  32141. a = a|0; b = b|0; c = c|0; d = d|0;
  32142. var l = 0, h = 0;
  32143. l = (a - c)>>>0;
  32144. h = (b - d)>>>0;
  32145. h = (b - d - (((c>>>0) > (a>>>0))|0))>>>0; // Borrow one from high word to low word on underflow.
  32146. return ((tempRet0 = h,l|0)|0);
  32147. }
  32148. function _i64Add(a, b, c, d) {
  32149. /*
  32150. x = a + b*2^32
  32151. y = c + d*2^32
  32152. result = l + h*2^32
  32153. */
  32154. a = a|0; b = b|0; c = c|0; d = d|0;
  32155. var l = 0, h = 0;
  32156. l = (a + c)>>>0;
  32157. h = (b + d + (((l>>>0) < (a>>>0))|0))>>>0; // Add carry from low word to high word on overflow.
  32158. return ((tempRet0 = h,l|0)|0);
  32159. }
  32160. function ___muldsi3($a, $b) {
  32161. $a = $a | 0;
  32162. $b = $b | 0;
  32163. var $1 = 0, $2 = 0, $3 = 0, $6 = 0, $8 = 0, $11 = 0, $12 = 0;
  32164. $1 = $a & 65535;
  32165. $2 = $b & 65535;
  32166. $3 = Math_imul($2, $1) | 0;
  32167. $6 = $a >>> 16;
  32168. $8 = ($3 >>> 16) + (Math_imul($2, $6) | 0) | 0;
  32169. $11 = $b >>> 16;
  32170. $12 = Math_imul($11, $1) | 0;
  32171. return (tempRet0 = (($8 >>> 16) + (Math_imul($11, $6) | 0) | 0) + ((($8 & 65535) + $12 | 0) >>> 16) | 0, 0 | ($8 + $12 << 16 | $3 & 65535)) | 0;
  32172. }
  32173. function ___muldi3($a$0, $a$1, $b$0, $b$1) {
  32174. $a$0 = $a$0 | 0;
  32175. $a$1 = $a$1 | 0;
  32176. $b$0 = $b$0 | 0;
  32177. $b$1 = $b$1 | 0;
  32178. var $x_sroa_0_0_extract_trunc = 0, $y_sroa_0_0_extract_trunc = 0, $1$0 = 0, $1$1 = 0, $2 = 0;
  32179. $x_sroa_0_0_extract_trunc = $a$0;
  32180. $y_sroa_0_0_extract_trunc = $b$0;
  32181. $1$0 = ___muldsi3($x_sroa_0_0_extract_trunc, $y_sroa_0_0_extract_trunc) | 0;
  32182. $1$1 = tempRet0;
  32183. $2 = Math_imul($a$1, $y_sroa_0_0_extract_trunc) | 0;
  32184. 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;
  32185. }
  32186. function _memcpy(dest, src, num) {
  32187. dest = dest|0; src = src|0; num = num|0;
  32188. var ret = 0;
  32189. var aligned_dest_end = 0;
  32190. var block_aligned_dest_end = 0;
  32191. var dest_end = 0;
  32192. // Test against a benchmarked cutoff limit for when HEAPU8.set() becomes faster to use.
  32193. if ((num|0) >=
  32194. 8192
  32195. ) {
  32196. return _emscripten_memcpy_big(dest|0, src|0, num|0)|0;
  32197. }
  32198. ret = dest|0;
  32199. dest_end = (dest + num)|0;
  32200. if ((dest&3) == (src&3)) {
  32201. // The initial unaligned < 4-byte front.
  32202. while (dest & 3) {
  32203. if ((num|0) == 0) return ret|0;
  32204. HEAP8[((dest)>>0)]=((HEAP8[((src)>>0)])|0);
  32205. dest = (dest+1)|0;
  32206. src = (src+1)|0;
  32207. num = (num-1)|0;
  32208. }
  32209. aligned_dest_end = (dest_end & -4)|0;
  32210. block_aligned_dest_end = (aligned_dest_end - 64)|0;
  32211. while ((dest|0) <= (block_aligned_dest_end|0) ) {
  32212. HEAP32[((dest)>>2)]=((HEAP32[((src)>>2)])|0);
  32213. HEAP32[(((dest)+(4))>>2)]=((HEAP32[(((src)+(4))>>2)])|0);
  32214. HEAP32[(((dest)+(8))>>2)]=((HEAP32[(((src)+(8))>>2)])|0);
  32215. HEAP32[(((dest)+(12))>>2)]=((HEAP32[(((src)+(12))>>2)])|0);
  32216. HEAP32[(((dest)+(16))>>2)]=((HEAP32[(((src)+(16))>>2)])|0);
  32217. HEAP32[(((dest)+(20))>>2)]=((HEAP32[(((src)+(20))>>2)])|0);
  32218. HEAP32[(((dest)+(24))>>2)]=((HEAP32[(((src)+(24))>>2)])|0);
  32219. HEAP32[(((dest)+(28))>>2)]=((HEAP32[(((src)+(28))>>2)])|0);
  32220. HEAP32[(((dest)+(32))>>2)]=((HEAP32[(((src)+(32))>>2)])|0);
  32221. HEAP32[(((dest)+(36))>>2)]=((HEAP32[(((src)+(36))>>2)])|0);
  32222. HEAP32[(((dest)+(40))>>2)]=((HEAP32[(((src)+(40))>>2)])|0);
  32223. HEAP32[(((dest)+(44))>>2)]=((HEAP32[(((src)+(44))>>2)])|0);
  32224. HEAP32[(((dest)+(48))>>2)]=((HEAP32[(((src)+(48))>>2)])|0);
  32225. HEAP32[(((dest)+(52))>>2)]=((HEAP32[(((src)+(52))>>2)])|0);
  32226. HEAP32[(((dest)+(56))>>2)]=((HEAP32[(((src)+(56))>>2)])|0);
  32227. HEAP32[(((dest)+(60))>>2)]=((HEAP32[(((src)+(60))>>2)])|0);
  32228. dest = (dest+64)|0;
  32229. src = (src+64)|0;
  32230. }
  32231. while ((dest|0) < (aligned_dest_end|0) ) {
  32232. HEAP32[((dest)>>2)]=((HEAP32[((src)>>2)])|0);
  32233. dest = (dest+4)|0;
  32234. src = (src+4)|0;
  32235. }
  32236. } else {
  32237. // In the unaligned copy case, unroll a bit as well.
  32238. aligned_dest_end = (dest_end - 4)|0;
  32239. while ((dest|0) < (aligned_dest_end|0) ) {
  32240. HEAP8[((dest)>>0)]=((HEAP8[((src)>>0)])|0);
  32241. HEAP8[(((dest)+(1))>>0)]=((HEAP8[(((src)+(1))>>0)])|0);
  32242. HEAP8[(((dest)+(2))>>0)]=((HEAP8[(((src)+(2))>>0)])|0);
  32243. HEAP8[(((dest)+(3))>>0)]=((HEAP8[(((src)+(3))>>0)])|0);
  32244. dest = (dest+4)|0;
  32245. src = (src+4)|0;
  32246. }
  32247. }
  32248. // The remaining unaligned < 4 byte tail.
  32249. while ((dest|0) < (dest_end|0)) {
  32250. HEAP8[((dest)>>0)]=((HEAP8[((src)>>0)])|0);
  32251. dest = (dest+1)|0;
  32252. src = (src+1)|0;
  32253. }
  32254. return ret|0;
  32255. }
  32256. function _memmove(dest, src, num) {
  32257. dest = dest|0; src = src|0; num = num|0;
  32258. var ret = 0;
  32259. if (((src|0) < (dest|0)) & ((dest|0) < ((src + num)|0))) {
  32260. // Unlikely case: Copy backwards in a safe manner
  32261. ret = dest;
  32262. src = (src + num)|0;
  32263. dest = (dest + num)|0;
  32264. while ((num|0) > 0) {
  32265. dest = (dest - 1)|0;
  32266. src = (src - 1)|0;
  32267. num = (num - 1)|0;
  32268. HEAP8[((dest)>>0)]=((HEAP8[((src)>>0)])|0);
  32269. }
  32270. dest = ret;
  32271. } else {
  32272. _memcpy(dest, src, num) | 0;
  32273. }
  32274. return dest | 0;
  32275. }
  32276. function _llvm_cttz_i32(x) {
  32277. x = x|0;
  32278. var ret = 0;
  32279. ret = ((HEAP8[(((cttz_i8)+(x & 0xff))>>0)])|0);
  32280. if ((ret|0) < 8) return ret|0;
  32281. ret = ((HEAP8[(((cttz_i8)+((x >> 8)&0xff))>>0)])|0);
  32282. if ((ret|0) < 8) return (ret + 8)|0;
  32283. ret = ((HEAP8[(((cttz_i8)+((x >> 16)&0xff))>>0)])|0);
  32284. if ((ret|0) < 8) return (ret + 16)|0;
  32285. return (((HEAP8[(((cttz_i8)+(x >>> 24))>>0)])|0) + 24)|0;
  32286. }
  32287. function ___udivmoddi4($a$0, $a$1, $b$0, $b$1, $rem) {
  32288. $a$0 = $a$0 | 0;
  32289. $a$1 = $a$1 | 0;
  32290. $b$0 = $b$0 | 0;
  32291. $b$1 = $b$1 | 0;
  32292. $rem = $rem | 0;
  32293. 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;
  32294. $n_sroa_0_0_extract_trunc = $a$0;
  32295. $n_sroa_1_4_extract_shift$0 = $a$1;
  32296. $n_sroa_1_4_extract_trunc = $n_sroa_1_4_extract_shift$0;
  32297. $d_sroa_0_0_extract_trunc = $b$0;
  32298. $d_sroa_1_4_extract_shift$0 = $b$1;
  32299. $d_sroa_1_4_extract_trunc = $d_sroa_1_4_extract_shift$0;
  32300. if (($n_sroa_1_4_extract_trunc | 0) == 0) {
  32301. $4 = ($rem | 0) != 0;
  32302. if (($d_sroa_1_4_extract_trunc | 0) == 0) {
  32303. if ($4) {
  32304. HEAP32[$rem >> 2] = ($n_sroa_0_0_extract_trunc >>> 0) % ($d_sroa_0_0_extract_trunc >>> 0);
  32305. HEAP32[$rem + 4 >> 2] = 0;
  32306. }
  32307. $_0$1 = 0;
  32308. $_0$0 = ($n_sroa_0_0_extract_trunc >>> 0) / ($d_sroa_0_0_extract_trunc >>> 0) >>> 0;
  32309. return (tempRet0 = $_0$1, $_0$0) | 0;
  32310. } else {
  32311. if (!$4) {
  32312. $_0$1 = 0;
  32313. $_0$0 = 0;
  32314. return (tempRet0 = $_0$1, $_0$0) | 0;
  32315. }
  32316. HEAP32[$rem >> 2] = $a$0 & -1;
  32317. HEAP32[$rem + 4 >> 2] = $a$1 & 0;
  32318. $_0$1 = 0;
  32319. $_0$0 = 0;
  32320. return (tempRet0 = $_0$1, $_0$0) | 0;
  32321. }
  32322. }
  32323. $17 = ($d_sroa_1_4_extract_trunc | 0) == 0;
  32324. do {
  32325. if (($d_sroa_0_0_extract_trunc | 0) == 0) {
  32326. if ($17) {
  32327. if (($rem | 0) != 0) {
  32328. HEAP32[$rem >> 2] = ($n_sroa_1_4_extract_trunc >>> 0) % ($d_sroa_0_0_extract_trunc >>> 0);
  32329. HEAP32[$rem + 4 >> 2] = 0;
  32330. }
  32331. $_0$1 = 0;
  32332. $_0$0 = ($n_sroa_1_4_extract_trunc >>> 0) / ($d_sroa_0_0_extract_trunc >>> 0) >>> 0;
  32333. return (tempRet0 = $_0$1, $_0$0) | 0;
  32334. }
  32335. if (($n_sroa_0_0_extract_trunc | 0) == 0) {
  32336. if (($rem | 0) != 0) {
  32337. HEAP32[$rem >> 2] = 0;
  32338. HEAP32[$rem + 4 >> 2] = ($n_sroa_1_4_extract_trunc >>> 0) % ($d_sroa_1_4_extract_trunc >>> 0);
  32339. }
  32340. $_0$1 = 0;
  32341. $_0$0 = ($n_sroa_1_4_extract_trunc >>> 0) / ($d_sroa_1_4_extract_trunc >>> 0) >>> 0;
  32342. return (tempRet0 = $_0$1, $_0$0) | 0;
  32343. }
  32344. $37 = $d_sroa_1_4_extract_trunc - 1 | 0;
  32345. if (($37 & $d_sroa_1_4_extract_trunc | 0) == 0) {
  32346. if (($rem | 0) != 0) {
  32347. HEAP32[$rem >> 2] = 0 | $a$0 & -1;
  32348. HEAP32[$rem + 4 >> 2] = $37 & $n_sroa_1_4_extract_trunc | $a$1 & 0;
  32349. }
  32350. $_0$1 = 0;
  32351. $_0$0 = $n_sroa_1_4_extract_trunc >>> ((_llvm_cttz_i32($d_sroa_1_4_extract_trunc | 0) | 0) >>> 0);
  32352. return (tempRet0 = $_0$1, $_0$0) | 0;
  32353. }
  32354. $49 = Math_clz32($d_sroa_1_4_extract_trunc | 0) | 0;
  32355. $51 = $49 - (Math_clz32($n_sroa_1_4_extract_trunc | 0) | 0) | 0;
  32356. if ($51 >>> 0 <= 30) {
  32357. $57 = $51 + 1 | 0;
  32358. $58 = 31 - $51 | 0;
  32359. $sr_1_ph = $57;
  32360. $r_sroa_0_1_ph = $n_sroa_1_4_extract_trunc << $58 | $n_sroa_0_0_extract_trunc >>> ($57 >>> 0);
  32361. $r_sroa_1_1_ph = $n_sroa_1_4_extract_trunc >>> ($57 >>> 0);
  32362. $q_sroa_0_1_ph = 0;
  32363. $q_sroa_1_1_ph = $n_sroa_0_0_extract_trunc << $58;
  32364. break;
  32365. }
  32366. if (($rem | 0) == 0) {
  32367. $_0$1 = 0;
  32368. $_0$0 = 0;
  32369. return (tempRet0 = $_0$1, $_0$0) | 0;
  32370. }
  32371. HEAP32[$rem >> 2] = 0 | $a$0 & -1;
  32372. HEAP32[$rem + 4 >> 2] = $n_sroa_1_4_extract_shift$0 | $a$1 & 0;
  32373. $_0$1 = 0;
  32374. $_0$0 = 0;
  32375. return (tempRet0 = $_0$1, $_0$0) | 0;
  32376. } else {
  32377. if (!$17) {
  32378. $117 = Math_clz32($d_sroa_1_4_extract_trunc | 0) | 0;
  32379. $119 = $117 - (Math_clz32($n_sroa_1_4_extract_trunc | 0) | 0) | 0;
  32380. if ($119 >>> 0 <= 31) {
  32381. $125 = $119 + 1 | 0;
  32382. $126 = 31 - $119 | 0;
  32383. $130 = $119 - 31 >> 31;
  32384. $sr_1_ph = $125;
  32385. $r_sroa_0_1_ph = $n_sroa_0_0_extract_trunc >>> ($125 >>> 0) & $130 | $n_sroa_1_4_extract_trunc << $126;
  32386. $r_sroa_1_1_ph = $n_sroa_1_4_extract_trunc >>> ($125 >>> 0) & $130;
  32387. $q_sroa_0_1_ph = 0;
  32388. $q_sroa_1_1_ph = $n_sroa_0_0_extract_trunc << $126;
  32389. break;
  32390. }
  32391. if (($rem | 0) == 0) {
  32392. $_0$1 = 0;
  32393. $_0$0 = 0;
  32394. return (tempRet0 = $_0$1, $_0$0) | 0;
  32395. }
  32396. HEAP32[$rem >> 2] = 0 | $a$0 & -1;
  32397. HEAP32[$rem + 4 >> 2] = $n_sroa_1_4_extract_shift$0 | $a$1 & 0;
  32398. $_0$1 = 0;
  32399. $_0$0 = 0;
  32400. return (tempRet0 = $_0$1, $_0$0) | 0;
  32401. }
  32402. $66 = $d_sroa_0_0_extract_trunc - 1 | 0;
  32403. if (($66 & $d_sroa_0_0_extract_trunc | 0) != 0) {
  32404. $86 = (Math_clz32($d_sroa_0_0_extract_trunc | 0) | 0) + 33 | 0;
  32405. $88 = $86 - (Math_clz32($n_sroa_1_4_extract_trunc | 0) | 0) | 0;
  32406. $89 = 64 - $88 | 0;
  32407. $91 = 32 - $88 | 0;
  32408. $92 = $91 >> 31;
  32409. $95 = $88 - 32 | 0;
  32410. $105 = $95 >> 31;
  32411. $sr_1_ph = $88;
  32412. $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;
  32413. $r_sroa_1_1_ph = $105 & $n_sroa_1_4_extract_trunc >>> ($88 >>> 0);
  32414. $q_sroa_0_1_ph = $n_sroa_0_0_extract_trunc << $89 & $92;
  32415. $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;
  32416. break;
  32417. }
  32418. if (($rem | 0) != 0) {
  32419. HEAP32[$rem >> 2] = $66 & $n_sroa_0_0_extract_trunc;
  32420. HEAP32[$rem + 4 >> 2] = 0;
  32421. }
  32422. if (($d_sroa_0_0_extract_trunc | 0) == 1) {
  32423. $_0$1 = $n_sroa_1_4_extract_shift$0 | $a$1 & 0;
  32424. $_0$0 = 0 | $a$0 & -1;
  32425. return (tempRet0 = $_0$1, $_0$0) | 0;
  32426. } else {
  32427. $78 = _llvm_cttz_i32($d_sroa_0_0_extract_trunc | 0) | 0;
  32428. $_0$1 = 0 | $n_sroa_1_4_extract_trunc >>> ($78 >>> 0);
  32429. $_0$0 = $n_sroa_1_4_extract_trunc << 32 - $78 | $n_sroa_0_0_extract_trunc >>> ($78 >>> 0) | 0;
  32430. return (tempRet0 = $_0$1, $_0$0) | 0;
  32431. }
  32432. }
  32433. } while (0);
  32434. if (($sr_1_ph | 0) == 0) {
  32435. $q_sroa_1_1_lcssa = $q_sroa_1_1_ph;
  32436. $q_sroa_0_1_lcssa = $q_sroa_0_1_ph;
  32437. $r_sroa_1_1_lcssa = $r_sroa_1_1_ph;
  32438. $r_sroa_0_1_lcssa = $r_sroa_0_1_ph;
  32439. $carry_0_lcssa$1 = 0;
  32440. $carry_0_lcssa$0 = 0;
  32441. } else {
  32442. $d_sroa_0_0_insert_insert99$0 = 0 | $b$0 & -1;
  32443. $d_sroa_0_0_insert_insert99$1 = $d_sroa_1_4_extract_shift$0 | $b$1 & 0;
  32444. $137$0 = _i64Add($d_sroa_0_0_insert_insert99$0 | 0, $d_sroa_0_0_insert_insert99$1 | 0, -1, -1) | 0;
  32445. $137$1 = tempRet0;
  32446. $q_sroa_1_1198 = $q_sroa_1_1_ph;
  32447. $q_sroa_0_1199 = $q_sroa_0_1_ph;
  32448. $r_sroa_1_1200 = $r_sroa_1_1_ph;
  32449. $r_sroa_0_1201 = $r_sroa_0_1_ph;
  32450. $sr_1202 = $sr_1_ph;
  32451. $carry_0203 = 0;
  32452. while (1) {
  32453. $147 = $q_sroa_0_1199 >>> 31 | $q_sroa_1_1198 << 1;
  32454. $149 = $carry_0203 | $q_sroa_0_1199 << 1;
  32455. $r_sroa_0_0_insert_insert42$0 = 0 | ($r_sroa_0_1201 << 1 | $q_sroa_1_1198 >>> 31);
  32456. $r_sroa_0_0_insert_insert42$1 = $r_sroa_0_1201 >>> 31 | $r_sroa_1_1200 << 1 | 0;
  32457. _i64Subtract($137$0 | 0, $137$1 | 0, $r_sroa_0_0_insert_insert42$0 | 0, $r_sroa_0_0_insert_insert42$1 | 0) | 0;
  32458. $150$1 = tempRet0;
  32459. $151$0 = $150$1 >> 31 | (($150$1 | 0) < 0 ? -1 : 0) << 1;
  32460. $152 = $151$0 & 1;
  32461. $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;
  32462. $r_sroa_0_0_extract_trunc = $154$0;
  32463. $r_sroa_1_4_extract_trunc = tempRet0;
  32464. $155 = $sr_1202 - 1 | 0;
  32465. if (($155 | 0) == 0) {
  32466. break;
  32467. } else {
  32468. $q_sroa_1_1198 = $147;
  32469. $q_sroa_0_1199 = $149;
  32470. $r_sroa_1_1200 = $r_sroa_1_4_extract_trunc;
  32471. $r_sroa_0_1201 = $r_sroa_0_0_extract_trunc;
  32472. $sr_1202 = $155;
  32473. $carry_0203 = $152;
  32474. }
  32475. }
  32476. $q_sroa_1_1_lcssa = $147;
  32477. $q_sroa_0_1_lcssa = $149;
  32478. $r_sroa_1_1_lcssa = $r_sroa_1_4_extract_trunc;
  32479. $r_sroa_0_1_lcssa = $r_sroa_0_0_extract_trunc;
  32480. $carry_0_lcssa$1 = 0;
  32481. $carry_0_lcssa$0 = $152;
  32482. }
  32483. $q_sroa_0_0_insert_ext75$0 = $q_sroa_0_1_lcssa;
  32484. $q_sroa_0_0_insert_ext75$1 = 0;
  32485. $q_sroa_0_0_insert_insert77$1 = $q_sroa_1_1_lcssa | $q_sroa_0_0_insert_ext75$1;
  32486. if (($rem | 0) != 0) {
  32487. HEAP32[$rem >> 2] = 0 | $r_sroa_0_1_lcssa;
  32488. HEAP32[$rem + 4 >> 2] = $r_sroa_1_1_lcssa | 0;
  32489. }
  32490. $_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;
  32491. $_0$0 = ($q_sroa_0_0_insert_ext75$0 << 1 | 0 >>> 31) & -2 | $carry_0_lcssa$0;
  32492. return (tempRet0 = $_0$1, $_0$0) | 0;
  32493. }
  32494. function ___uremdi3($a$0, $a$1, $b$0, $b$1) {
  32495. $a$0 = $a$0 | 0;
  32496. $a$1 = $a$1 | 0;
  32497. $b$0 = $b$0 | 0;
  32498. $b$1 = $b$1 | 0;
  32499. var $rem = 0, __stackBase__ = 0;
  32500. __stackBase__ = STACKTOP;
  32501. STACKTOP = STACKTOP + 16 | 0;
  32502. $rem = __stackBase__ | 0;
  32503. ___udivmoddi4($a$0, $a$1, $b$0, $b$1, $rem) | 0;
  32504. STACKTOP = __stackBase__;
  32505. return (tempRet0 = HEAP32[$rem + 4 >> 2] | 0, HEAP32[$rem >> 2] | 0) | 0;
  32506. }
  32507. function ___udivdi3($a$0, $a$1, $b$0, $b$1) {
  32508. $a$0 = $a$0 | 0;
  32509. $a$1 = $a$1 | 0;
  32510. $b$0 = $b$0 | 0;
  32511. $b$1 = $b$1 | 0;
  32512. var $1$0 = 0;
  32513. $1$0 = ___udivmoddi4($a$0, $a$1, $b$0, $b$1, 0) | 0;
  32514. return $1$0 | 0;
  32515. }
  32516. function _roundf(f) {
  32517. f = +f;
  32518. return f >= +0 ? +Math_floor(f + +0.5) : +Math_ceil(f - +0.5); // TODO: use fround?
  32519. }
  32520. function _emscripten_set_current_thread_status(newStatus) {
  32521. newStatus = newStatus|0;
  32522. }
  32523. function _bitshift64Lshr(low, high, bits) {
  32524. low = low|0; high = high|0; bits = bits|0;
  32525. var ander = 0;
  32526. if ((bits|0) < 32) {
  32527. ander = ((1 << bits) - 1)|0;
  32528. tempRet0 = high >>> bits;
  32529. return (low >>> bits) | ((high&ander) << (32 - bits));
  32530. }
  32531. tempRet0 = 0;
  32532. return (high >>> (bits - 32))|0;
  32533. }
  32534. function _emscripten_conditional_set_current_thread_status(expectedStatus, newStatus) {
  32535. expectedStatus = expectedStatus|0;
  32536. newStatus = newStatus|0;
  32537. }
  32538. function _sbrk(increment) {
  32539. increment = increment|0;
  32540. var oldDynamicTop = 0;
  32541. var oldDynamicTopOnChange = 0;
  32542. var newDynamicTop = 0;
  32543. var totalMemory = 0;
  32544. increment = ((increment + 15) & -16)|0;
  32545. totalMemory = getTotalMemory()|0;
  32546. // Perform a compare-and-swap loop to update the new dynamic top value. This is because
  32547. // this function can becalled simultaneously in multiple threads.
  32548. do {
  32549. oldDynamicTop = Atomics_load(HEAP32, DYNAMICTOP_PTR>>2)|0;
  32550. newDynamicTop = oldDynamicTop + increment | 0;
  32551. // Asking to increase dynamic top to a too high value? In pthreads builds we cannot
  32552. // enlarge memory, so this needs to fail.
  32553. if (((increment|0) > 0 & (newDynamicTop|0) < (oldDynamicTop|0)) // Detect and fail if we would wrap around signed 32-bit int.
  32554. | (newDynamicTop|0) < 0 // Also underflow, sbrk() should be able to be used to subtract.
  32555. | (newDynamicTop|0) > (totalMemory|0)) {
  32556. abortOnCannotGrowMemory()|0;
  32557. }
  32558. // Attempt to update the dynamic top to new value. Another thread may have beat this thread to the update,
  32559. // in which case we will need to start over by iterating the loop body again.
  32560. oldDynamicTopOnChange = Atomics_compareExchange(HEAP32, DYNAMICTOP_PTR>>2, oldDynamicTop|0, newDynamicTop|0)|0;
  32561. } while((oldDynamicTopOnChange|0) != (oldDynamicTop|0));
  32562. return oldDynamicTop|0;
  32563. }
  32564. function _bitshift64Shl(low, high, bits) {
  32565. low = low|0; high = high|0; bits = bits|0;
  32566. var ander = 0;
  32567. if ((bits|0) < 32) {
  32568. ander = ((1 << bits) - 1)|0;
  32569. tempRet0 = (high << bits) | ((low&(ander << (32 - bits))) >>> (32 - bits));
  32570. return low << bits;
  32571. }
  32572. tempRet0 = low << (bits - 32);
  32573. return 0;
  32574. }
  32575. function _llvm_bswap_i32(x) {
  32576. x = x|0;
  32577. return (((x&0xff)<<24) | (((x>>8)&0xff)<<16) | (((x>>16)&0xff)<<8) | (x>>>24))|0;
  32578. }
  32579. function dynCall_viiiii(index,a1,a2,a3,a4,a5) {
  32580. index = index|0;
  32581. a1=a1|0; a2=a2|0; a3=a3|0; a4=a4|0; a5=a5|0;
  32582. FUNCTION_TABLE_viiiii[index&7](a1|0,a2|0,a3|0,a4|0,a5|0);
  32583. }
  32584. function dynCall_vd(index,a1) {
  32585. index = index|0;
  32586. a1=+a1;
  32587. FUNCTION_TABLE_vd[index&3](+a1);
  32588. }
  32589. function dynCall_vid(index,a1,a2) {
  32590. index = index|0;
  32591. a1=a1|0; a2=+a2;
  32592. FUNCTION_TABLE_vid[index&3](a1|0,+a2);
  32593. }
  32594. function dynCall_vi(index,a1) {
  32595. index = index|0;
  32596. a1=a1|0;
  32597. FUNCTION_TABLE_vi[index&31](a1|0);
  32598. }
  32599. function dynCall_vii(index,a1,a2) {
  32600. index = index|0;
  32601. a1=a1|0; a2=a2|0;
  32602. FUNCTION_TABLE_vii[index&63](a1|0,a2|0);
  32603. }
  32604. function dynCall_ii(index,a1) {
  32605. index = index|0;
  32606. a1=a1|0;
  32607. return FUNCTION_TABLE_ii[index&15](a1|0)|0;
  32608. }
  32609. function dynCall_viddd(index,a1,a2,a3,a4) {
  32610. index = index|0;
  32611. a1=a1|0; a2=+a2; a3=+a3; a4=+a4;
  32612. FUNCTION_TABLE_viddd[index&3](a1|0,+a2,+a3,+a4);
  32613. }
  32614. function dynCall_vidd(index,a1,a2,a3) {
  32615. index = index|0;
  32616. a1=a1|0; a2=+a2; a3=+a3;
  32617. FUNCTION_TABLE_vidd[index&7](a1|0,+a2,+a3);
  32618. }
  32619. function dynCall_iiii(index,a1,a2,a3) {
  32620. index = index|0;
  32621. a1=a1|0; a2=a2|0; a3=a3|0;
  32622. return FUNCTION_TABLE_iiii[index&15](a1|0,a2|0,a3|0)|0;
  32623. }
  32624. function dynCall_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8) {
  32625. index = index|0;
  32626. a1=a1|0; a2=a2|0; a3=a3|0; a4=a4|0; a5=a5|0; a6=a6|0; a7=a7|0; a8=a8|0;
  32627. FUNCTION_TABLE_viiiiiiii[index&3](a1|0,a2|0,a3|0,a4|0,a5|0,a6|0,a7|0,a8|0);
  32628. }
  32629. function dynCall_viiiiii(index,a1,a2,a3,a4,a5,a6) {
  32630. index = index|0;
  32631. a1=a1|0; a2=a2|0; a3=a3|0; a4=a4|0; a5=a5|0; a6=a6|0;
  32632. FUNCTION_TABLE_viiiiii[index&3](a1|0,a2|0,a3|0,a4|0,a5|0,a6|0);
  32633. }
  32634. function dynCall_viii(index,a1,a2,a3) {
  32635. index = index|0;
  32636. a1=a1|0; a2=a2|0; a3=a3|0;
  32637. FUNCTION_TABLE_viii[index&31](a1|0,a2|0,a3|0);
  32638. }
  32639. function dynCall_vidddd(index,a1,a2,a3,a4,a5) {
  32640. index = index|0;
  32641. a1=a1|0; a2=+a2; a3=+a3; a4=+a4; a5=+a5;
  32642. FUNCTION_TABLE_vidddd[index&3](a1|0,+a2,+a3,+a4,+a5);
  32643. }
  32644. function dynCall_vdi(index,a1,a2) {
  32645. index = index|0;
  32646. a1=+a1; a2=a2|0;
  32647. FUNCTION_TABLE_vdi[index&1](+a1,a2|0);
  32648. }
  32649. function dynCall_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7) {
  32650. index = index|0;
  32651. a1=a1|0; a2=a2|0; a3=a3|0; a4=a4|0; a5=a5|0; a6=a6|0; a7=a7|0;
  32652. FUNCTION_TABLE_viiiiiii[index&3](a1|0,a2|0,a3|0,a4|0,a5|0,a6|0,a7|0);
  32653. }
  32654. function dynCall_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9) {
  32655. index = index|0;
  32656. 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;
  32657. FUNCTION_TABLE_viiiiiiiii[index&3](a1|0,a2|0,a3|0,a4|0,a5|0,a6|0,a7|0,a8|0,a9|0);
  32658. }
  32659. function dynCall_iii(index,a1,a2) {
  32660. index = index|0;
  32661. a1=a1|0; a2=a2|0;
  32662. return FUNCTION_TABLE_iii[index&3](a1|0,a2|0)|0;
  32663. }
  32664. function dynCall_i(index) {
  32665. index = index|0;
  32666. return FUNCTION_TABLE_i[index&3]()|0;
  32667. }
  32668. function dynCall_vdddddd(index,a1,a2,a3,a4,a5,a6) {
  32669. index = index|0;
  32670. a1=+a1; a2=+a2; a3=+a3; a4=+a4; a5=+a5; a6=+a6;
  32671. FUNCTION_TABLE_vdddddd[index&1](+a1,+a2,+a3,+a4,+a5,+a6);
  32672. }
  32673. function dynCall_vdddd(index,a1,a2,a3,a4) {
  32674. index = index|0;
  32675. a1=+a1; a2=+a2; a3=+a3; a4=+a4;
  32676. FUNCTION_TABLE_vdddd[index&3](+a1,+a2,+a3,+a4);
  32677. }
  32678. function dynCall_vdd(index,a1,a2) {
  32679. index = index|0;
  32680. a1=+a1; a2=+a2;
  32681. FUNCTION_TABLE_vdd[index&3](+a1,+a2);
  32682. }
  32683. function dynCall_v(index) {
  32684. index = index|0;
  32685. FUNCTION_TABLE_v[index&7]();
  32686. }
  32687. function dynCall_viid(index,a1,a2,a3) {
  32688. index = index|0;
  32689. a1=a1|0; a2=a2|0; a3=+a3;
  32690. FUNCTION_TABLE_viid[index&1](a1|0,a2|0,+a3);
  32691. }
  32692. function dynCall_viiii(index,a1,a2,a3,a4) {
  32693. index = index|0;
  32694. a1=a1|0; a2=a2|0; a3=a3|0; a4=a4|0;
  32695. FUNCTION_TABLE_viiii[index&31](a1|0,a2|0,a3|0,a4|0);
  32696. }
  32697. function b0(p0,p1,p2,p3,p4) {
  32698. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0; nullFunc_viiiii(0);
  32699. }
  32700. function _emscripten_glUniform4i__wrapper(p0,p1,p2,p3,p4) {
  32701. 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);
  32702. }
  32703. function _emscripten_glFramebufferTexture2D__wrapper(p0,p1,p2,p3,p4) {
  32704. 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);
  32705. }
  32706. function _emscripten_glShaderBinary__wrapper(p0,p1,p2,p3,p4) {
  32707. 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);
  32708. }
  32709. function _emscripten_glDrawElementsInstanced__wrapper(p0,p1,p2,p3,p4) {
  32710. 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);
  32711. }
  32712. function b1(p0) {
  32713. p0 = +p0; nullFunc_vd(1);
  32714. }
  32715. function _emscripten_glClearDepth__wrapper(p0) {
  32716. p0 = +p0; _emscripten_glClearDepth(+p0);
  32717. }
  32718. function _emscripten_glClearDepthf__wrapper(p0) {
  32719. p0 = +p0; _emscripten_glClearDepthf(+p0);
  32720. }
  32721. function _emscripten_glLineWidth__wrapper(p0) {
  32722. p0 = +p0; _emscripten_glLineWidth(+p0);
  32723. }
  32724. function b2(p0,p1) {
  32725. p0 = p0|0;p1 = +p1; nullFunc_vid(2);
  32726. }
  32727. function _emscripten_glUniform1f__wrapper(p0,p1) {
  32728. p0 = p0|0;p1 = +p1; _emscripten_glUniform1f(p0|0,+p1);
  32729. }
  32730. function _emscripten_glVertexAttrib1f__wrapper(p0,p1) {
  32731. p0 = p0|0;p1 = +p1; _emscripten_glVertexAttrib1f(p0|0,+p1);
  32732. }
  32733. function b3(p0) {
  32734. p0 = p0|0; nullFunc_vi(3);
  32735. }
  32736. function _emscripten_glDeleteShader__wrapper(p0) {
  32737. p0 = p0|0; _emscripten_glDeleteShader(p0|0);
  32738. }
  32739. function _emscripten_glCompileShader__wrapper(p0) {
  32740. p0 = p0|0; _emscripten_glCompileShader(p0|0);
  32741. }
  32742. function _emscripten_glDeleteProgram__wrapper(p0) {
  32743. p0 = p0|0; _emscripten_glDeleteProgram(p0|0);
  32744. }
  32745. function _emscripten_glLinkProgram__wrapper(p0) {
  32746. p0 = p0|0; _emscripten_glLinkProgram(p0|0);
  32747. }
  32748. function _emscripten_glUseProgram__wrapper(p0) {
  32749. p0 = p0|0; _emscripten_glUseProgram(p0|0);
  32750. }
  32751. function _emscripten_glValidateProgram__wrapper(p0) {
  32752. p0 = p0|0; _emscripten_glValidateProgram(p0|0);
  32753. }
  32754. function _emscripten_glDeleteObjectARB__wrapper(p0) {
  32755. p0 = p0|0; _emscripten_glDeleteObjectARB(p0|0);
  32756. }
  32757. function _emscripten_glEnableClientState__wrapper(p0) {
  32758. p0 = p0|0; _emscripten_glEnableClientState(p0|0);
  32759. }
  32760. function _emscripten_glClientActiveTexture__wrapper(p0) {
  32761. p0 = p0|0; _emscripten_glClientActiveTexture(p0|0);
  32762. }
  32763. function _emscripten_glBindVertexArray__wrapper(p0) {
  32764. p0 = p0|0; _emscripten_glBindVertexArray(p0|0);
  32765. }
  32766. function _emscripten_glMatrixMode__wrapper(p0) {
  32767. p0 = p0|0; _emscripten_glMatrixMode(p0|0);
  32768. }
  32769. function _emscripten_glLoadMatrixf__wrapper(p0) {
  32770. p0 = p0|0; _emscripten_glLoadMatrixf(p0|0);
  32771. }
  32772. function _emscripten_glEnableVertexAttribArray__wrapper(p0) {
  32773. p0 = p0|0; _emscripten_glEnableVertexAttribArray(p0|0);
  32774. }
  32775. function _emscripten_glDisableVertexAttribArray__wrapper(p0) {
  32776. p0 = p0|0; _emscripten_glDisableVertexAttribArray(p0|0);
  32777. }
  32778. function _emscripten_glDepthFunc__wrapper(p0) {
  32779. p0 = p0|0; _emscripten_glDepthFunc(p0|0);
  32780. }
  32781. function _emscripten_glEnable__wrapper(p0) {
  32782. p0 = p0|0; _emscripten_glEnable(p0|0);
  32783. }
  32784. function _emscripten_glDisable__wrapper(p0) {
  32785. p0 = p0|0; _emscripten_glDisable(p0|0);
  32786. }
  32787. function _emscripten_glFrontFace__wrapper(p0) {
  32788. p0 = p0|0; _emscripten_glFrontFace(p0|0);
  32789. }
  32790. function _emscripten_glCullFace__wrapper(p0) {
  32791. p0 = p0|0; _emscripten_glCullFace(p0|0);
  32792. }
  32793. function _emscripten_glClear__wrapper(p0) {
  32794. p0 = p0|0; _emscripten_glClear(p0|0);
  32795. }
  32796. function _emscripten_glClearStencil__wrapper(p0) {
  32797. p0 = p0|0; _emscripten_glClearStencil(p0|0);
  32798. }
  32799. function _emscripten_glDepthMask__wrapper(p0) {
  32800. p0 = p0|0; _emscripten_glDepthMask(p0|0);
  32801. }
  32802. function _emscripten_glStencilMask__wrapper(p0) {
  32803. p0 = p0|0; _emscripten_glStencilMask(p0|0);
  32804. }
  32805. function _emscripten_glGenerateMipmap__wrapper(p0) {
  32806. p0 = p0|0; _emscripten_glGenerateMipmap(p0|0);
  32807. }
  32808. function _emscripten_glActiveTexture__wrapper(p0) {
  32809. p0 = p0|0; _emscripten_glActiveTexture(p0|0);
  32810. }
  32811. function _emscripten_glBlendEquation__wrapper(p0) {
  32812. p0 = p0|0; _emscripten_glBlendEquation(p0|0);
  32813. }
  32814. function b4(p0,p1) {
  32815. p0 = p0|0;p1 = p1|0; nullFunc_vii(4);
  32816. }
  32817. function _emscripten_glPixelStorei__wrapper(p0,p1) {
  32818. p0 = p0|0;p1 = p1|0; _emscripten_glPixelStorei(p0|0,p1|0);
  32819. }
  32820. function _emscripten_glGetIntegerv__wrapper(p0,p1) {
  32821. p0 = p0|0;p1 = p1|0; _emscripten_glGetIntegerv(p0|0,p1|0);
  32822. }
  32823. function _emscripten_glGetFloatv__wrapper(p0,p1) {
  32824. p0 = p0|0;p1 = p1|0; _emscripten_glGetFloatv(p0|0,p1|0);
  32825. }
  32826. function _emscripten_glGetBooleanv__wrapper(p0,p1) {
  32827. p0 = p0|0;p1 = p1|0; _emscripten_glGetBooleanv(p0|0,p1|0);
  32828. }
  32829. function _emscripten_glGenTextures__wrapper(p0,p1) {
  32830. p0 = p0|0;p1 = p1|0; _emscripten_glGenTextures(p0|0,p1|0);
  32831. }
  32832. function _emscripten_glDeleteTextures__wrapper(p0,p1) {
  32833. p0 = p0|0;p1 = p1|0; _emscripten_glDeleteTextures(p0|0,p1|0);
  32834. }
  32835. function _emscripten_glBindTexture__wrapper(p0,p1) {
  32836. p0 = p0|0;p1 = p1|0; _emscripten_glBindTexture(p0|0,p1|0);
  32837. }
  32838. function _emscripten_glGenBuffers__wrapper(p0,p1) {
  32839. p0 = p0|0;p1 = p1|0; _emscripten_glGenBuffers(p0|0,p1|0);
  32840. }
  32841. function _emscripten_glDeleteBuffers__wrapper(p0,p1) {
  32842. p0 = p0|0;p1 = p1|0; _emscripten_glDeleteBuffers(p0|0,p1|0);
  32843. }
  32844. function _emscripten_glGenRenderbuffers__wrapper(p0,p1) {
  32845. p0 = p0|0;p1 = p1|0; _emscripten_glGenRenderbuffers(p0|0,p1|0);
  32846. }
  32847. function _emscripten_glDeleteRenderbuffers__wrapper(p0,p1) {
  32848. p0 = p0|0;p1 = p1|0; _emscripten_glDeleteRenderbuffers(p0|0,p1|0);
  32849. }
  32850. function _emscripten_glBindRenderbuffer__wrapper(p0,p1) {
  32851. p0 = p0|0;p1 = p1|0; _emscripten_glBindRenderbuffer(p0|0,p1|0);
  32852. }
  32853. function _emscripten_glUniform1i__wrapper(p0,p1) {
  32854. p0 = p0|0;p1 = p1|0; _emscripten_glUniform1i(p0|0,p1|0);
  32855. }
  32856. function _emscripten_glBindBuffer__wrapper(p0,p1) {
  32857. p0 = p0|0;p1 = p1|0; _emscripten_glBindBuffer(p0|0,p1|0);
  32858. }
  32859. function _emscripten_glVertexAttrib1fv__wrapper(p0,p1) {
  32860. p0 = p0|0;p1 = p1|0; _emscripten_glVertexAttrib1fv(p0|0,p1|0);
  32861. }
  32862. function _emscripten_glVertexAttrib2fv__wrapper(p0,p1) {
  32863. p0 = p0|0;p1 = p1|0; _emscripten_glVertexAttrib2fv(p0|0,p1|0);
  32864. }
  32865. function _emscripten_glVertexAttrib3fv__wrapper(p0,p1) {
  32866. p0 = p0|0;p1 = p1|0; _emscripten_glVertexAttrib3fv(p0|0,p1|0);
  32867. }
  32868. function _emscripten_glVertexAttrib4fv__wrapper(p0,p1) {
  32869. p0 = p0|0;p1 = p1|0; _emscripten_glVertexAttrib4fv(p0|0,p1|0);
  32870. }
  32871. function _emscripten_glAttachShader__wrapper(p0,p1) {
  32872. p0 = p0|0;p1 = p1|0; _emscripten_glAttachShader(p0|0,p1|0);
  32873. }
  32874. function _emscripten_glDetachShader__wrapper(p0,p1) {
  32875. p0 = p0|0;p1 = p1|0; _emscripten_glDetachShader(p0|0,p1|0);
  32876. }
  32877. function _emscripten_glBindFramebuffer__wrapper(p0,p1) {
  32878. p0 = p0|0;p1 = p1|0; _emscripten_glBindFramebuffer(p0|0,p1|0);
  32879. }
  32880. function _emscripten_glGenFramebuffers__wrapper(p0,p1) {
  32881. p0 = p0|0;p1 = p1|0; _emscripten_glGenFramebuffers(p0|0,p1|0);
  32882. }
  32883. function _emscripten_glDeleteFramebuffers__wrapper(p0,p1) {
  32884. p0 = p0|0;p1 = p1|0; _emscripten_glDeleteFramebuffers(p0|0,p1|0);
  32885. }
  32886. function _emscripten_glBindProgramARB__wrapper(p0,p1) {
  32887. p0 = p0|0;p1 = p1|0; _emscripten_glBindProgramARB(p0|0,p1|0);
  32888. }
  32889. function _emscripten_glGetPointerv__wrapper(p0,p1) {
  32890. p0 = p0|0;p1 = p1|0; _emscripten_glGetPointerv(p0|0,p1|0);
  32891. }
  32892. function _emscripten_glGenVertexArrays__wrapper(p0,p1) {
  32893. p0 = p0|0;p1 = p1|0; _emscripten_glGenVertexArrays(p0|0,p1|0);
  32894. }
  32895. function _emscripten_glDeleteVertexArrays__wrapper(p0,p1) {
  32896. p0 = p0|0;p1 = p1|0; _emscripten_glDeleteVertexArrays(p0|0,p1|0);
  32897. }
  32898. function _emscripten_glVertexAttribDivisor__wrapper(p0,p1) {
  32899. p0 = p0|0;p1 = p1|0; _emscripten_glVertexAttribDivisor(p0|0,p1|0);
  32900. }
  32901. function _emscripten_glBlendFunc__wrapper(p0,p1) {
  32902. p0 = p0|0;p1 = p1|0; _emscripten_glBlendFunc(p0|0,p1|0);
  32903. }
  32904. function _emscripten_glBlendEquationSeparate__wrapper(p0,p1) {
  32905. p0 = p0|0;p1 = p1|0; _emscripten_glBlendEquationSeparate(p0|0,p1|0);
  32906. }
  32907. function _emscripten_glStencilMaskSeparate__wrapper(p0,p1) {
  32908. p0 = p0|0;p1 = p1|0; _emscripten_glStencilMaskSeparate(p0|0,p1|0);
  32909. }
  32910. function _emscripten_glHint__wrapper(p0,p1) {
  32911. p0 = p0|0;p1 = p1|0; _emscripten_glHint(p0|0,p1|0);
  32912. }
  32913. function _emscripten_glDrawBuffers__wrapper(p0,p1) {
  32914. p0 = p0|0;p1 = p1|0; _emscripten_glDrawBuffers(p0|0,p1|0);
  32915. }
  32916. function b5(p0) {
  32917. p0 = p0|0; nullFunc_ii(5);return 0;
  32918. }
  32919. function _emscripten_glGetString__wrapper(p0) {
  32920. p0 = p0|0; return _emscripten_glGetString(p0|0)|0;
  32921. }
  32922. function _emscripten_glIsTexture__wrapper(p0) {
  32923. p0 = p0|0; return _emscripten_glIsTexture(p0|0)|0;
  32924. }
  32925. function _emscripten_glIsBuffer__wrapper(p0) {
  32926. p0 = p0|0; return _emscripten_glIsBuffer(p0|0)|0;
  32927. }
  32928. function _emscripten_glIsRenderbuffer__wrapper(p0) {
  32929. p0 = p0|0; return _emscripten_glIsRenderbuffer(p0|0)|0;
  32930. }
  32931. function _emscripten_glCreateShader__wrapper(p0) {
  32932. p0 = p0|0; return _emscripten_glCreateShader(p0|0)|0;
  32933. }
  32934. function _emscripten_glIsShader__wrapper(p0) {
  32935. p0 = p0|0; return _emscripten_glIsShader(p0|0)|0;
  32936. }
  32937. function _emscripten_glIsProgram__wrapper(p0) {
  32938. p0 = p0|0; return _emscripten_glIsProgram(p0|0)|0;
  32939. }
  32940. function _emscripten_glIsFramebuffer__wrapper(p0) {
  32941. p0 = p0|0; return _emscripten_glIsFramebuffer(p0|0)|0;
  32942. }
  32943. function _emscripten_glCheckFramebufferStatus__wrapper(p0) {
  32944. p0 = p0|0; return _emscripten_glCheckFramebufferStatus(p0|0)|0;
  32945. }
  32946. function _emscripten_glIsEnabled__wrapper(p0) {
  32947. p0 = p0|0; return _emscripten_glIsEnabled(p0|0)|0;
  32948. }
  32949. function b6(p0,p1,p2,p3) {
  32950. p0 = p0|0;p1 = +p1;p2 = +p2;p3 = +p3; nullFunc_viddd(6);
  32951. }
  32952. function _emscripten_glUniform3f__wrapper(p0,p1,p2,p3) {
  32953. p0 = p0|0;p1 = +p1;p2 = +p2;p3 = +p3; _emscripten_glUniform3f(p0|0,+p1,+p2,+p3);
  32954. }
  32955. function _emscripten_glVertexAttrib3f__wrapper(p0,p1,p2,p3) {
  32956. p0 = p0|0;p1 = +p1;p2 = +p2;p3 = +p3; _emscripten_glVertexAttrib3f(p0|0,+p1,+p2,+p3);
  32957. }
  32958. function b7(p0,p1,p2) {
  32959. p0 = p0|0;p1 = +p1;p2 = +p2; nullFunc_vidd(7);
  32960. }
  32961. function _emscripten_glUniform2f__wrapper(p0,p1,p2) {
  32962. p0 = p0|0;p1 = +p1;p2 = +p2; _emscripten_glUniform2f(p0|0,+p1,+p2);
  32963. }
  32964. function _emscripten_glVertexAttrib2f__wrapper(p0,p1,p2) {
  32965. p0 = p0|0;p1 = +p1;p2 = +p2; _emscripten_glVertexAttrib2f(p0|0,+p1,+p2);
  32966. }
  32967. function b8(p0,p1,p2) {
  32968. p0 = p0|0;p1 = p1|0;p2 = p2|0; nullFunc_iiii(8);return 0;
  32969. }
  32970. function b9(p0,p1,p2,p3,p4,p5,p6,p7) {
  32971. 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);
  32972. }
  32973. function _emscripten_glCompressedTexImage2D__wrapper(p0,p1,p2,p3,p4,p5,p6,p7) {
  32974. 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);
  32975. }
  32976. function _emscripten_glCopyTexImage2D__wrapper(p0,p1,p2,p3,p4,p5,p6,p7) {
  32977. 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);
  32978. }
  32979. function _emscripten_glCopyTexSubImage2D__wrapper(p0,p1,p2,p3,p4,p5,p6,p7) {
  32980. 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);
  32981. }
  32982. function b10(p0,p1,p2,p3,p4,p5) {
  32983. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0;p5 = p5|0; nullFunc_viiiiii(10);
  32984. }
  32985. function _emscripten_glDrawRangeElements__wrapper(p0,p1,p2,p3,p4,p5) {
  32986. 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);
  32987. }
  32988. function _emscripten_glVertexAttribPointer__wrapper(p0,p1,p2,p3,p4,p5) {
  32989. 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);
  32990. }
  32991. function b11(p0,p1,p2) {
  32992. p0 = p0|0;p1 = p1|0;p2 = p2|0; nullFunc_viii(11);
  32993. }
  32994. function _emscripten_glGetTexParameterfv__wrapper(p0,p1,p2) {
  32995. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetTexParameterfv(p0|0,p1|0,p2|0);
  32996. }
  32997. function _emscripten_glGetTexParameteriv__wrapper(p0,p1,p2) {
  32998. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetTexParameteriv(p0|0,p1|0,p2|0);
  32999. }
  33000. function _emscripten_glTexParameterfv__wrapper(p0,p1,p2) {
  33001. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glTexParameterfv(p0|0,p1|0,p2|0);
  33002. }
  33003. function _emscripten_glTexParameteriv__wrapper(p0,p1,p2) {
  33004. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glTexParameteriv(p0|0,p1|0,p2|0);
  33005. }
  33006. function _emscripten_glGetBufferParameteriv__wrapper(p0,p1,p2) {
  33007. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetBufferParameteriv(p0|0,p1|0,p2|0);
  33008. }
  33009. function _emscripten_glGetRenderbufferParameteriv__wrapper(p0,p1,p2) {
  33010. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetRenderbufferParameteriv(p0|0,p1|0,p2|0);
  33011. }
  33012. function _emscripten_glGetUniformfv__wrapper(p0,p1,p2) {
  33013. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetUniformfv(p0|0,p1|0,p2|0);
  33014. }
  33015. function _emscripten_glGetUniformiv__wrapper(p0,p1,p2) {
  33016. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetUniformiv(p0|0,p1|0,p2|0);
  33017. }
  33018. function _emscripten_glGetVertexAttribfv__wrapper(p0,p1,p2) {
  33019. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetVertexAttribfv(p0|0,p1|0,p2|0);
  33020. }
  33021. function _emscripten_glGetVertexAttribiv__wrapper(p0,p1,p2) {
  33022. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetVertexAttribiv(p0|0,p1|0,p2|0);
  33023. }
  33024. function _emscripten_glGetVertexAttribPointerv__wrapper(p0,p1,p2) {
  33025. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetVertexAttribPointerv(p0|0,p1|0,p2|0);
  33026. }
  33027. function _emscripten_glUniform2i__wrapper(p0,p1,p2) {
  33028. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform2i(p0|0,p1|0,p2|0);
  33029. }
  33030. function _emscripten_glUniform1iv__wrapper(p0,p1,p2) {
  33031. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform1iv(p0|0,p1|0,p2|0);
  33032. }
  33033. function _emscripten_glUniform2iv__wrapper(p0,p1,p2) {
  33034. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform2iv(p0|0,p1|0,p2|0);
  33035. }
  33036. function _emscripten_glUniform3iv__wrapper(p0,p1,p2) {
  33037. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform3iv(p0|0,p1|0,p2|0);
  33038. }
  33039. function _emscripten_glUniform4iv__wrapper(p0,p1,p2) {
  33040. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform4iv(p0|0,p1|0,p2|0);
  33041. }
  33042. function _emscripten_glUniform1fv__wrapper(p0,p1,p2) {
  33043. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform1fv(p0|0,p1|0,p2|0);
  33044. }
  33045. function _emscripten_glUniform2fv__wrapper(p0,p1,p2) {
  33046. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform2fv(p0|0,p1|0,p2|0);
  33047. }
  33048. function _emscripten_glUniform3fv__wrapper(p0,p1,p2) {
  33049. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform3fv(p0|0,p1|0,p2|0);
  33050. }
  33051. function _emscripten_glUniform4fv__wrapper(p0,p1,p2) {
  33052. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform4fv(p0|0,p1|0,p2|0);
  33053. }
  33054. function _emscripten_glGetShaderiv__wrapper(p0,p1,p2) {
  33055. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetShaderiv(p0|0,p1|0,p2|0);
  33056. }
  33057. function _emscripten_glGetProgramiv__wrapper(p0,p1,p2) {
  33058. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetProgramiv(p0|0,p1|0,p2|0);
  33059. }
  33060. function _emscripten_glBindAttribLocation__wrapper(p0,p1,p2) {
  33061. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glBindAttribLocation(p0|0,p1|0,p2|0);
  33062. }
  33063. function _emscripten_glGetObjectParameterivARB__wrapper(p0,p1,p2) {
  33064. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetObjectParameterivARB(p0|0,p1|0,p2|0);
  33065. }
  33066. function _emscripten_glNormalPointer__wrapper(p0,p1,p2) {
  33067. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glNormalPointer(p0|0,p1|0,p2|0);
  33068. }
  33069. function _emscripten_glDrawArrays__wrapper(p0,p1,p2) {
  33070. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glDrawArrays(p0|0,p1|0,p2|0);
  33071. }
  33072. function _emscripten_glTexParameteri__wrapper(p0,p1,p2) {
  33073. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glTexParameteri(p0|0,p1|0,p2|0);
  33074. }
  33075. function _emscripten_glStencilFunc__wrapper(p0,p1,p2) {
  33076. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glStencilFunc(p0|0,p1|0,p2|0);
  33077. }
  33078. function _emscripten_glStencilOp__wrapper(p0,p1,p2) {
  33079. p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glStencilOp(p0|0,p1|0,p2|0);
  33080. }
  33081. function b12(p0,p1,p2,p3,p4) {
  33082. p0 = p0|0;p1 = +p1;p2 = +p2;p3 = +p3;p4 = +p4; nullFunc_vidddd(12);
  33083. }
  33084. function _emscripten_glUniform4f__wrapper(p0,p1,p2,p3,p4) {
  33085. p0 = p0|0;p1 = +p1;p2 = +p2;p3 = +p3;p4 = +p4; _emscripten_glUniform4f(p0|0,+p1,+p2,+p3,+p4);
  33086. }
  33087. function _emscripten_glVertexAttrib4f__wrapper(p0,p1,p2,p3,p4) {
  33088. p0 = p0|0;p1 = +p1;p2 = +p2;p3 = +p3;p4 = +p4; _emscripten_glVertexAttrib4f(p0|0,+p1,+p2,+p3,+p4);
  33089. }
  33090. function b13(p0,p1) {
  33091. p0 = +p0;p1 = p1|0; nullFunc_vdi(13);
  33092. }
  33093. function _emscripten_glSampleCoverage__wrapper(p0,p1) {
  33094. p0 = +p0;p1 = p1|0; _emscripten_glSampleCoverage(+p0,p1|0);
  33095. }
  33096. function b14(p0,p1,p2,p3,p4,p5,p6) {
  33097. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0;p5 = p5|0;p6 = p6|0; nullFunc_viiiiiii(14);
  33098. }
  33099. function _emscripten_glReadPixels__wrapper(p0,p1,p2,p3,p4,p5,p6) {
  33100. 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);
  33101. }
  33102. function _emscripten_glGetActiveUniform__wrapper(p0,p1,p2,p3,p4,p5,p6) {
  33103. 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);
  33104. }
  33105. function _emscripten_glGetActiveAttrib__wrapper(p0,p1,p2,p3,p4,p5,p6) {
  33106. 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);
  33107. }
  33108. function b15(p0,p1,p2,p3,p4,p5,p6,p7,p8) {
  33109. 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);
  33110. }
  33111. function _emscripten_glCompressedTexSubImage2D__wrapper(p0,p1,p2,p3,p4,p5,p6,p7,p8) {
  33112. 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);
  33113. }
  33114. function _emscripten_glTexImage2D__wrapper(p0,p1,p2,p3,p4,p5,p6,p7,p8) {
  33115. 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);
  33116. }
  33117. function _emscripten_glTexSubImage2D__wrapper(p0,p1,p2,p3,p4,p5,p6,p7,p8) {
  33118. 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);
  33119. }
  33120. function b16(p0,p1) {
  33121. p0 = p0|0;p1 = p1|0; nullFunc_iii(16);return 0;
  33122. }
  33123. function _emscripten_glGetUniformLocation__wrapper(p0,p1) {
  33124. p0 = p0|0;p1 = p1|0; return _emscripten_glGetUniformLocation(p0|0,p1|0)|0;
  33125. }
  33126. function _emscripten_glGetAttribLocation__wrapper(p0,p1) {
  33127. p0 = p0|0;p1 = p1|0; return _emscripten_glGetAttribLocation(p0|0,p1|0)|0;
  33128. }
  33129. function b17() {
  33130. ; nullFunc_i(17);return 0;
  33131. }
  33132. function _emscripten_glCreateProgram__wrapper() {
  33133. ; return _emscripten_glCreateProgram()|0;
  33134. }
  33135. function _emscripten_glGetError__wrapper() {
  33136. ; return _emscripten_glGetError()|0;
  33137. }
  33138. function b18(p0,p1,p2,p3,p4,p5) {
  33139. p0 = +p0;p1 = +p1;p2 = +p2;p3 = +p3;p4 = +p4;p5 = +p5; nullFunc_vdddddd(18);
  33140. }
  33141. function _emscripten_glFrustum__wrapper(p0,p1,p2,p3,p4,p5) {
  33142. p0 = +p0;p1 = +p1;p2 = +p2;p3 = +p3;p4 = +p4;p5 = +p5; _emscripten_glFrustum(+p0,+p1,+p2,+p3,+p4,+p5);
  33143. }
  33144. function b19(p0,p1,p2,p3) {
  33145. p0 = +p0;p1 = +p1;p2 = +p2;p3 = +p3; nullFunc_vdddd(19);
  33146. }
  33147. function _emscripten_glRotatef__wrapper(p0,p1,p2,p3) {
  33148. p0 = +p0;p1 = +p1;p2 = +p2;p3 = +p3; _emscripten_glRotatef(+p0,+p1,+p2,+p3);
  33149. }
  33150. function _emscripten_glClearColor__wrapper(p0,p1,p2,p3) {
  33151. p0 = +p0;p1 = +p1;p2 = +p2;p3 = +p3; _emscripten_glClearColor(+p0,+p1,+p2,+p3);
  33152. }
  33153. function _emscripten_glBlendColor__wrapper(p0,p1,p2,p3) {
  33154. p0 = +p0;p1 = +p1;p2 = +p2;p3 = +p3; _emscripten_glBlendColor(+p0,+p1,+p2,+p3);
  33155. }
  33156. function b20(p0,p1) {
  33157. p0 = +p0;p1 = +p1; nullFunc_vdd(20);
  33158. }
  33159. function _emscripten_glDepthRange__wrapper(p0,p1) {
  33160. p0 = +p0;p1 = +p1; _emscripten_glDepthRange(+p0,+p1);
  33161. }
  33162. function _emscripten_glDepthRangef__wrapper(p0,p1) {
  33163. p0 = +p0;p1 = +p1; _emscripten_glDepthRangef(+p0,+p1);
  33164. }
  33165. function _emscripten_glPolygonOffset__wrapper(p0,p1) {
  33166. p0 = +p0;p1 = +p1; _emscripten_glPolygonOffset(+p0,+p1);
  33167. }
  33168. function b21() {
  33169. ; nullFunc_v(21);
  33170. }
  33171. function _emscripten_glLoadIdentity__wrapper() {
  33172. ; _emscripten_glLoadIdentity();
  33173. }
  33174. function _emscripten_glReleaseShaderCompiler__wrapper() {
  33175. ; _emscripten_glReleaseShaderCompiler();
  33176. }
  33177. function _emscripten_glFinish__wrapper() {
  33178. ; _emscripten_glFinish();
  33179. }
  33180. function _emscripten_glFlush__wrapper() {
  33181. ; _emscripten_glFlush();
  33182. }
  33183. function b22(p0,p1,p2) {
  33184. p0 = p0|0;p1 = p1|0;p2 = +p2; nullFunc_viid(22);
  33185. }
  33186. function _emscripten_glTexParameterf__wrapper(p0,p1,p2) {
  33187. p0 = p0|0;p1 = p1|0;p2 = +p2; _emscripten_glTexParameterf(p0|0,p1|0,+p2);
  33188. }
  33189. function b23(p0,p1,p2,p3) {
  33190. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; nullFunc_viiii(23);
  33191. }
  33192. function _emscripten_glBufferData__wrapper(p0,p1,p2,p3) {
  33193. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glBufferData(p0|0,p1|0,p2|0,p3|0);
  33194. }
  33195. function _emscripten_glBufferSubData__wrapper(p0,p1,p2,p3) {
  33196. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glBufferSubData(p0|0,p1|0,p2|0,p3|0);
  33197. }
  33198. function _emscripten_glUniform3i__wrapper(p0,p1,p2,p3) {
  33199. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glUniform3i(p0|0,p1|0,p2|0,p3|0);
  33200. }
  33201. function _emscripten_glUniformMatrix2fv__wrapper(p0,p1,p2,p3) {
  33202. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glUniformMatrix2fv(p0|0,p1|0,p2|0,p3|0);
  33203. }
  33204. function _emscripten_glUniformMatrix3fv__wrapper(p0,p1,p2,p3) {
  33205. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glUniformMatrix3fv(p0|0,p1|0,p2|0,p3|0);
  33206. }
  33207. function _emscripten_glUniformMatrix4fv__wrapper(p0,p1,p2,p3) {
  33208. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glUniformMatrix4fv(p0|0,p1|0,p2|0,p3|0);
  33209. }
  33210. function _emscripten_glGetAttachedShaders__wrapper(p0,p1,p2,p3) {
  33211. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetAttachedShaders(p0|0,p1|0,p2|0,p3|0);
  33212. }
  33213. function _emscripten_glShaderSource__wrapper(p0,p1,p2,p3) {
  33214. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glShaderSource(p0|0,p1|0,p2|0,p3|0);
  33215. }
  33216. function _emscripten_glGetShaderSource__wrapper(p0,p1,p2,p3) {
  33217. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetShaderSource(p0|0,p1|0,p2|0,p3|0);
  33218. }
  33219. function _emscripten_glGetShaderInfoLog__wrapper(p0,p1,p2,p3) {
  33220. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetShaderInfoLog(p0|0,p1|0,p2|0,p3|0);
  33221. }
  33222. function _emscripten_glGetShaderPrecisionFormat__wrapper(p0,p1,p2,p3) {
  33223. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetShaderPrecisionFormat(p0|0,p1|0,p2|0,p3|0);
  33224. }
  33225. function _emscripten_glGetProgramInfoLog__wrapper(p0,p1,p2,p3) {
  33226. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetProgramInfoLog(p0|0,p1|0,p2|0,p3|0);
  33227. }
  33228. function _emscripten_glFramebufferRenderbuffer__wrapper(p0,p1,p2,p3) {
  33229. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glFramebufferRenderbuffer(p0|0,p1|0,p2|0,p3|0);
  33230. }
  33231. function _emscripten_glGetFramebufferAttachmentParameteriv__wrapper(p0,p1,p2,p3) {
  33232. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetFramebufferAttachmentParameteriv(p0|0,p1|0,p2|0,p3|0);
  33233. }
  33234. function _emscripten_glGetInfoLogARB__wrapper(p0,p1,p2,p3) {
  33235. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetInfoLogARB(p0|0,p1|0,p2|0,p3|0);
  33236. }
  33237. function _emscripten_glVertexPointer__wrapper(p0,p1,p2,p3) {
  33238. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glVertexPointer(p0|0,p1|0,p2|0,p3|0);
  33239. }
  33240. function _emscripten_glTexCoordPointer__wrapper(p0,p1,p2,p3) {
  33241. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glTexCoordPointer(p0|0,p1|0,p2|0,p3|0);
  33242. }
  33243. function _emscripten_glColorPointer__wrapper(p0,p1,p2,p3) {
  33244. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glColorPointer(p0|0,p1|0,p2|0,p3|0);
  33245. }
  33246. function _emscripten_glDrawElements__wrapper(p0,p1,p2,p3) {
  33247. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glDrawElements(p0|0,p1|0,p2|0,p3|0);
  33248. }
  33249. function _emscripten_glDrawArraysInstanced__wrapper(p0,p1,p2,p3) {
  33250. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glDrawArraysInstanced(p0|0,p1|0,p2|0,p3|0);
  33251. }
  33252. function _emscripten_glViewport__wrapper(p0,p1,p2,p3) {
  33253. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glViewport(p0|0,p1|0,p2|0,p3|0);
  33254. }
  33255. function _emscripten_glScissor__wrapper(p0,p1,p2,p3) {
  33256. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glScissor(p0|0,p1|0,p2|0,p3|0);
  33257. }
  33258. function _emscripten_glColorMask__wrapper(p0,p1,p2,p3) {
  33259. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glColorMask(p0|0,p1|0,p2|0,p3|0);
  33260. }
  33261. function _emscripten_glRenderbufferStorage__wrapper(p0,p1,p2,p3) {
  33262. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glRenderbufferStorage(p0|0,p1|0,p2|0,p3|0);
  33263. }
  33264. function _emscripten_glBlendFuncSeparate__wrapper(p0,p1,p2,p3) {
  33265. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glBlendFuncSeparate(p0|0,p1|0,p2|0,p3|0);
  33266. }
  33267. function _emscripten_glStencilFuncSeparate__wrapper(p0,p1,p2,p3) {
  33268. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glStencilFuncSeparate(p0|0,p1|0,p2|0,p3|0);
  33269. }
  33270. function _emscripten_glStencilOpSeparate__wrapper(p0,p1,p2,p3) {
  33271. p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glStencilOpSeparate(p0|0,p1|0,p2|0,p3|0);
  33272. }
  33273. // EMSCRIPTEN_END_FUNCS
  33274. var FUNCTION_TABLE_viiiii = [b0,_KeyCallback,_emscripten_glUniform4i__wrapper,_emscripten_glFramebufferTexture2D__wrapper,_emscripten_glShaderBinary__wrapper,_emscripten_glDrawElementsInstanced__wrapper,b0,b0];
  33275. var FUNCTION_TABLE_vd = [b1,_emscripten_glClearDepth__wrapper,_emscripten_glClearDepthf__wrapper,_emscripten_glLineWidth__wrapper];
  33276. var FUNCTION_TABLE_vid = [b2,_emscripten_glUniform1f__wrapper,_emscripten_glVertexAttrib1f__wrapper,b2];
  33277. 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
  33278. ,b3,b3,b3];
  33279. 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
  33280. ,b4,b4,b4,b4,b4];
  33281. 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];
  33282. var FUNCTION_TABLE_viddd = [b6,_emscripten_glUniform3f__wrapper,_emscripten_glVertexAttrib3f__wrapper,b6];
  33283. var FUNCTION_TABLE_vidd = [b7,_MouseCursorPosCallback,_ScrollCallback,_emscripten_glUniform2f__wrapper,_emscripten_glVertexAttrib2f__wrapper,b7,b7,b7];
  33284. var FUNCTION_TABLE_iiii = [b8,___stdout_write,___stdio_seek,_sn_write,_EmscriptenFullscreenChangeCallback,_EmscriptenKeyboardCallback,_EmscriptenMouseCallback,_EmscriptenTouchCallback,_EmscriptenGamepadCallback,___stdio_write,b8,b8,b8,b8,b8,b8];
  33285. var FUNCTION_TABLE_viiiiiiii = [b9,_emscripten_glCompressedTexImage2D__wrapper,_emscripten_glCopyTexImage2D__wrapper,_emscripten_glCopyTexSubImage2D__wrapper];
  33286. var FUNCTION_TABLE_viiiiii = [b10,_emscripten_glDrawRangeElements__wrapper,_emscripten_glVertexAttribPointer__wrapper,b10];
  33287. 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];
  33288. var FUNCTION_TABLE_vidddd = [b12,_emscripten_glUniform4f__wrapper,_emscripten_glVertexAttrib4f__wrapper,b12];
  33289. var FUNCTION_TABLE_vdi = [b13,_emscripten_glSampleCoverage__wrapper];
  33290. var FUNCTION_TABLE_viiiiiii = [b14,_emscripten_glReadPixels__wrapper,_emscripten_glGetActiveUniform__wrapper,_emscripten_glGetActiveAttrib__wrapper];
  33291. var FUNCTION_TABLE_viiiiiiiii = [b15,_emscripten_glCompressedTexSubImage2D__wrapper,_emscripten_glTexImage2D__wrapper,_emscripten_glTexSubImage2D__wrapper];
  33292. var FUNCTION_TABLE_iii = [b16,_emscripten_glGetUniformLocation__wrapper,_emscripten_glGetAttribLocation__wrapper,b16];
  33293. var FUNCTION_TABLE_i = [b17,_emscripten_glCreateProgram__wrapper,_emscripten_glGetError__wrapper,b17];
  33294. var FUNCTION_TABLE_vdddddd = [b18,_emscripten_glFrustum__wrapper];
  33295. var FUNCTION_TABLE_vdddd = [b19,_emscripten_glRotatef__wrapper,_emscripten_glClearColor__wrapper,_emscripten_glBlendColor__wrapper];
  33296. var FUNCTION_TABLE_vdd = [b20,_emscripten_glDepthRange__wrapper,_emscripten_glDepthRangef__wrapper,_emscripten_glPolygonOffset__wrapper];
  33297. var FUNCTION_TABLE_v = [b21,_UpdateDrawFrame,_emscripten_glLoadIdentity__wrapper,_emscripten_glReleaseShaderCompiler__wrapper,_emscripten_glFinish__wrapper,_emscripten_glFlush__wrapper,b21,b21];
  33298. var FUNCTION_TABLE_viid = [b22,_emscripten_glTexParameterf__wrapper];
  33299. 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];
  33300. 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 };
  33301. })
  33302. // EMSCRIPTEN_END_ASM
  33303. (Module.asmGlobalArg, Module.asmLibraryArg, buffer);
  33304. var real___emscripten_atomic_fetch_and_xor_u64 = asm["__emscripten_atomic_fetch_and_xor_u64"]; asm["__emscripten_atomic_fetch_and_xor_u64"] = function() {
  33305. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33306. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33307. return real___emscripten_atomic_fetch_and_xor_u64.apply(null, arguments);
  33308. };
  33309. var real__roundf = asm["_roundf"]; asm["_roundf"] = function() {
  33310. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33311. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33312. return real__roundf.apply(null, arguments);
  33313. };
  33314. var real__bitshift64Shl = asm["_bitshift64Shl"]; asm["_bitshift64Shl"] = function() {
  33315. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33316. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33317. return real__bitshift64Shl.apply(null, arguments);
  33318. };
  33319. var real__emscripten_atomic_load_f32 = asm["_emscripten_atomic_load_f32"]; asm["_emscripten_atomic_load_f32"] = function() {
  33320. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33321. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33322. return real__emscripten_atomic_load_f32.apply(null, arguments);
  33323. };
  33324. var real____emscripten_pthread_data_constructor = asm["___emscripten_pthread_data_constructor"]; asm["___emscripten_pthread_data_constructor"] = function() {
  33325. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33326. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33327. return real____emscripten_pthread_data_constructor.apply(null, arguments);
  33328. };
  33329. var real_stackSave = asm["stackSave"]; asm["stackSave"] = function() {
  33330. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33331. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33332. return real_stackSave.apply(null, arguments);
  33333. };
  33334. var real__emscripten_atomic_xor_u64 = asm["_emscripten_atomic_xor_u64"]; asm["_emscripten_atomic_xor_u64"] = function() {
  33335. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33336. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33337. return real__emscripten_atomic_xor_u64.apply(null, arguments);
  33338. };
  33339. var real__emscripten_atomic_load_u64 = asm["_emscripten_atomic_load_u64"]; asm["_emscripten_atomic_load_u64"] = function() {
  33340. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33341. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33342. return real__emscripten_atomic_load_u64.apply(null, arguments);
  33343. };
  33344. var real____udivdi3 = asm["___udivdi3"]; asm["___udivdi3"] = function() {
  33345. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33346. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33347. return real____udivdi3.apply(null, arguments);
  33348. };
  33349. var real__bitshift64Lshr = asm["_bitshift64Lshr"]; asm["_bitshift64Lshr"] = function() {
  33350. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33351. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33352. return real__bitshift64Lshr.apply(null, arguments);
  33353. };
  33354. var real_getTempRet0 = asm["getTempRet0"]; asm["getTempRet0"] = function() {
  33355. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33356. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33357. return real_getTempRet0.apply(null, arguments);
  33358. };
  33359. var real__emscripten_atomic_and_u64 = asm["_emscripten_atomic_and_u64"]; asm["_emscripten_atomic_and_u64"] = function() {
  33360. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33361. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33362. return real__emscripten_atomic_and_u64.apply(null, arguments);
  33363. };
  33364. var real__emscripten_sync_run_in_main_thread = asm["_emscripten_sync_run_in_main_thread"]; asm["_emscripten_sync_run_in_main_thread"] = function() {
  33365. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33366. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33367. return real__emscripten_sync_run_in_main_thread.apply(null, arguments);
  33368. };
  33369. 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() {
  33370. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33371. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33372. return real__emscripten_sync_run_in_main_thread_4.apply(null, arguments);
  33373. };
  33374. 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() {
  33375. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33376. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33377. return real__emscripten_sync_run_in_main_thread_5.apply(null, arguments);
  33378. };
  33379. 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() {
  33380. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33381. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33382. return real__emscripten_sync_run_in_main_thread_6.apply(null, arguments);
  33383. };
  33384. 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() {
  33385. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33386. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33387. return real__emscripten_sync_run_in_main_thread_7.apply(null, arguments);
  33388. };
  33389. 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() {
  33390. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33391. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33392. return real__emscripten_sync_run_in_main_thread_0.apply(null, arguments);
  33393. };
  33394. 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() {
  33395. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33396. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33397. return real__emscripten_sync_run_in_main_thread_1.apply(null, arguments);
  33398. };
  33399. 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() {
  33400. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33401. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33402. return real__emscripten_sync_run_in_main_thread_2.apply(null, arguments);
  33403. };
  33404. var real___emscripten_atomic_fetch_and_sub_u64 = asm["__emscripten_atomic_fetch_and_sub_u64"]; asm["__emscripten_atomic_fetch_and_sub_u64"] = function() {
  33405. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33406. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33407. return real___emscripten_atomic_fetch_and_sub_u64.apply(null, arguments);
  33408. };
  33409. var real__emscripten_atomic_exchange_u32 = asm["_emscripten_atomic_exchange_u32"]; asm["_emscripten_atomic_exchange_u32"] = function() {
  33410. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33411. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33412. return real__emscripten_atomic_exchange_u32.apply(null, arguments);
  33413. };
  33414. var real__fflush = asm["_fflush"]; asm["_fflush"] = function() {
  33415. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33416. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33417. return real__fflush.apply(null, arguments);
  33418. };
  33419. var real__emscripten_set_current_thread_status = asm["_emscripten_set_current_thread_status"]; asm["_emscripten_set_current_thread_status"] = function() {
  33420. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33421. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33422. return real__emscripten_set_current_thread_status.apply(null, arguments);
  33423. };
  33424. var real__emscripten_atomic_cas_u64 = asm["_emscripten_atomic_cas_u64"]; asm["_emscripten_atomic_cas_u64"] = function() {
  33425. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33426. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33427. return real__emscripten_atomic_cas_u64.apply(null, arguments);
  33428. };
  33429. var real__llvm_cttz_i32 = asm["_llvm_cttz_i32"]; asm["_llvm_cttz_i32"] = function() {
  33430. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33431. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33432. return real__llvm_cttz_i32.apply(null, arguments);
  33433. };
  33434. var real__emscripten_atomic_sub_u64 = asm["_emscripten_atomic_sub_u64"]; asm["_emscripten_atomic_sub_u64"] = function() {
  33435. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33436. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33437. return real__emscripten_atomic_sub_u64.apply(null, arguments);
  33438. };
  33439. var real__main = asm["_main"]; asm["_main"] = function() {
  33440. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33441. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33442. return real__main.apply(null, arguments);
  33443. };
  33444. 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() {
  33445. assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
  33446. assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
  33447. return real__emscripten_sync_run_in_main_thread_xprintf_varargs.apply(null, arguments);
  33448. };
  33449. var real____errno_location = asm["___errno_location"]; asm["___errno_location"] = 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____errno_location.apply(null, arguments);
  33453. };
  33454. var real____muldi3 = asm["___muldi3"]; asm["___muldi3"] = 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____muldi3.apply(null, arguments);
  33458. };
  33459. var real___emscripten_atomic_fetch_and_and_u64 = asm["__emscripten_atomic_fetch_and_and_u64"]; asm["__emscripten_atomic_fetch_and_and_u64"] = 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___emscripten_atomic_fetch_and_and_u64.apply(null, arguments);
  33463. };
  33464. 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() {
  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_sync_run_in_main_thread_3.apply(null, arguments);
  33468. };
  33469. var real____uremdi3 = asm["___uremdi3"]; asm["___uremdi3"] = 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____uremdi3.apply(null, arguments);
  33473. };
  33474. var real_stackAlloc = asm["stackAlloc"]; asm["stackAlloc"] = 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_stackAlloc.apply(null, arguments);
  33478. };
  33479. var real__i64Subtract = asm["_i64Subtract"]; asm["_i64Subtract"] = 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__i64Subtract.apply(null, arguments);
  33483. };
  33484. var real_setTempRet0 = asm["setTempRet0"]; asm["setTempRet0"] = 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_setTempRet0.apply(null, arguments);
  33488. };
  33489. var real__i64Add = asm["_i64Add"]; asm["_i64Add"] = 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__i64Add.apply(null, arguments);
  33493. };
  33494. var real__emscripten_atomic_store_u64 = asm["_emscripten_atomic_store_u64"]; asm["_emscripten_atomic_store_u64"] = 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__emscripten_atomic_store_u64.apply(null, arguments);
  33498. };
  33499. var real__emscripten_atomic_load_f64 = asm["_emscripten_atomic_load_f64"]; asm["_emscripten_atomic_load_f64"] = 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__emscripten_atomic_load_f64.apply(null, arguments);
  33503. };
  33504. var real__emscripten_get_global_libc = asm["_emscripten_get_global_libc"]; asm["_emscripten_get_global_libc"] = 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_get_global_libc.apply(null, arguments);
  33508. };
  33509. var real___emscripten_atomic_fetch_and_add_u64 = asm["__emscripten_atomic_fetch_and_add_u64"]; asm["__emscripten_atomic_fetch_and_add_u64"] = 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_atomic_fetch_and_add_u64.apply(null, arguments);
  33513. };
  33514. var real___emscripten_atomic_fetch_and_or_u64 = asm["__emscripten_atomic_fetch_and_or_u64"]; asm["__emscripten_atomic_fetch_and_or_u64"] = 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_atomic_fetch_and_or_u64.apply(null, arguments);
  33518. };
  33519. var real__emscripten_GetProcAddress = asm["_emscripten_GetProcAddress"]; asm["_emscripten_GetProcAddress"] = 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_GetProcAddress.apply(null, arguments);
  33523. };
  33524. var real__emscripten_async_run_in_main_thread = asm["_emscripten_async_run_in_main_thread"]; asm["_emscripten_async_run_in_main_thread"] = 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_async_run_in_main_thread.apply(null, arguments);
  33528. };
  33529. var real__llvm_bswap_i32 = asm["_llvm_bswap_i32"]; asm["_llvm_bswap_i32"] = 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__llvm_bswap_i32.apply(null, arguments);
  33533. };
  33534. var real____muldsi3 = asm["___muldsi3"]; asm["___muldsi3"] = 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____muldsi3.apply(null, arguments);
  33538. };
  33539. var real__emscripten_main_thread_process_queued_calls = asm["_emscripten_main_thread_process_queued_calls"]; asm["_emscripten_main_thread_process_queued_calls"] = 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_main_thread_process_queued_calls.apply(null, arguments);
  33543. };
  33544. var real__emscripten_atomic_add_u64 = asm["_emscripten_atomic_add_u64"]; asm["_emscripten_atomic_add_u64"] = 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_atomic_add_u64.apply(null, arguments);
  33548. };
  33549. var real__free = asm["_free"]; asm["_free"] = 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__free.apply(null, arguments);
  33553. };
  33554. var real__emscripten_atomic_store_f32 = asm["_emscripten_atomic_store_f32"]; asm["_emscripten_atomic_store_f32"] = 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_store_f32.apply(null, arguments);
  33558. };
  33559. var real_setThrew = asm["setThrew"]; asm["setThrew"] = 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_setThrew.apply(null, arguments);
  33563. };
  33564. var real__emscripten_atomic_exchange_u64 = asm["_emscripten_atomic_exchange_u64"]; asm["_emscripten_atomic_exchange_u64"] = 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_atomic_exchange_u64.apply(null, arguments);
  33568. };
  33569. var real__emscripten_atomic_store_f64 = asm["_emscripten_atomic_store_f64"]; asm["_emscripten_atomic_store_f64"] = 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_store_f64.apply(null, arguments);
  33573. };
  33574. var real____pthread_tsd_run_dtors = asm["___pthread_tsd_run_dtors"]; asm["___pthread_tsd_run_dtors"] = 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____pthread_tsd_run_dtors.apply(null, arguments);
  33578. };
  33579. var real_stackRestore = asm["stackRestore"]; asm["stackRestore"] = 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_stackRestore.apply(null, arguments);
  33583. };
  33584. var real____udivmoddi4 = asm["___udivmoddi4"]; asm["___udivmoddi4"] = 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____udivmoddi4.apply(null, arguments);
  33588. };
  33589. var real__malloc = asm["_malloc"]; asm["_malloc"] = 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__malloc.apply(null, arguments);
  33593. };
  33594. var real_establishStackSpace = asm["establishStackSpace"]; asm["establishStackSpace"] = 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_establishStackSpace.apply(null, arguments);
  33598. };
  33599. var real__emscripten_conditional_set_current_thread_status = asm["_emscripten_conditional_set_current_thread_status"]; asm["_emscripten_conditional_set_current_thread_status"] = 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__emscripten_conditional_set_current_thread_status.apply(null, arguments);
  33603. };
  33604. var real__sbrk = asm["_sbrk"]; asm["_sbrk"] = 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__sbrk.apply(null, arguments);
  33608. };
  33609. var real__memmove = asm["_memmove"]; asm["_memmove"] = 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__memmove.apply(null, arguments);
  33613. };
  33614. var real__emscripten_atomic_or_u64 = asm["_emscripten_atomic_or_u64"]; asm["_emscripten_atomic_or_u64"] = 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__emscripten_atomic_or_u64.apply(null, arguments);
  33618. };
  33619. var real__strstr = asm["_strstr"]; asm["_strstr"] = 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__strstr.apply(null, arguments);
  33623. };
  33624. var __emscripten_atomic_fetch_and_xor_u64 = Module["__emscripten_atomic_fetch_and_xor_u64"] = asm["__emscripten_atomic_fetch_and_xor_u64"];
  33625. var _roundf = Module["_roundf"] = asm["_roundf"];
  33626. var _bitshift64Shl = Module["_bitshift64Shl"] = asm["_bitshift64Shl"];
  33627. var _emscripten_atomic_load_f32 = Module["_emscripten_atomic_load_f32"] = asm["_emscripten_atomic_load_f32"];
  33628. var ___emscripten_pthread_data_constructor = Module["___emscripten_pthread_data_constructor"] = asm["___emscripten_pthread_data_constructor"];
  33629. var stackSave = Module["stackSave"] = asm["stackSave"];
  33630. var _emscripten_atomic_xor_u64 = Module["_emscripten_atomic_xor_u64"] = asm["_emscripten_atomic_xor_u64"];
  33631. var _emscripten_atomic_load_u64 = Module["_emscripten_atomic_load_u64"] = asm["_emscripten_atomic_load_u64"];
  33632. var ___udivdi3 = Module["___udivdi3"] = asm["___udivdi3"];
  33633. var _bitshift64Lshr = Module["_bitshift64Lshr"] = asm["_bitshift64Lshr"];
  33634. var getTempRet0 = Module["getTempRet0"] = asm["getTempRet0"];
  33635. var _emscripten_atomic_and_u64 = Module["_emscripten_atomic_and_u64"] = asm["_emscripten_atomic_and_u64"];
  33636. var _emscripten_sync_run_in_main_thread = Module["_emscripten_sync_run_in_main_thread"] = asm["_emscripten_sync_run_in_main_thread"];
  33637. var _emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = asm["_emscripten_sync_run_in_main_thread_4"];
  33638. var _emscripten_sync_run_in_main_thread_5 = Module["_emscripten_sync_run_in_main_thread_5"] = asm["_emscripten_sync_run_in_main_thread_5"];
  33639. var _emscripten_sync_run_in_main_thread_6 = Module["_emscripten_sync_run_in_main_thread_6"] = asm["_emscripten_sync_run_in_main_thread_6"];
  33640. var _emscripten_sync_run_in_main_thread_7 = Module["_emscripten_sync_run_in_main_thread_7"] = asm["_emscripten_sync_run_in_main_thread_7"];
  33641. var _emscripten_sync_run_in_main_thread_0 = Module["_emscripten_sync_run_in_main_thread_0"] = asm["_emscripten_sync_run_in_main_thread_0"];
  33642. var _emscripten_sync_run_in_main_thread_1 = Module["_emscripten_sync_run_in_main_thread_1"] = asm["_emscripten_sync_run_in_main_thread_1"];
  33643. var _emscripten_sync_run_in_main_thread_2 = Module["_emscripten_sync_run_in_main_thread_2"] = asm["_emscripten_sync_run_in_main_thread_2"];
  33644. var __emscripten_atomic_fetch_and_sub_u64 = Module["__emscripten_atomic_fetch_and_sub_u64"] = asm["__emscripten_atomic_fetch_and_sub_u64"];
  33645. var _emscripten_atomic_exchange_u32 = Module["_emscripten_atomic_exchange_u32"] = asm["_emscripten_atomic_exchange_u32"];
  33646. var _fflush = Module["_fflush"] = asm["_fflush"];
  33647. var _emscripten_set_current_thread_status = Module["_emscripten_set_current_thread_status"] = asm["_emscripten_set_current_thread_status"];
  33648. var _emscripten_atomic_cas_u64 = Module["_emscripten_atomic_cas_u64"] = asm["_emscripten_atomic_cas_u64"];
  33649. var _llvm_cttz_i32 = Module["_llvm_cttz_i32"] = asm["_llvm_cttz_i32"];
  33650. var _emscripten_atomic_sub_u64 = Module["_emscripten_atomic_sub_u64"] = asm["_emscripten_atomic_sub_u64"];
  33651. var _main = Module["_main"] = asm["_main"];
  33652. 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"];
  33653. var _memcpy = Module["_memcpy"] = asm["_memcpy"];
  33654. var ___errno_location = Module["___errno_location"] = asm["___errno_location"];
  33655. var ___muldi3 = Module["___muldi3"] = asm["___muldi3"];
  33656. var __emscripten_atomic_fetch_and_and_u64 = Module["__emscripten_atomic_fetch_and_and_u64"] = asm["__emscripten_atomic_fetch_and_and_u64"];
  33657. var _emscripten_sync_run_in_main_thread_3 = Module["_emscripten_sync_run_in_main_thread_3"] = asm["_emscripten_sync_run_in_main_thread_3"];
  33658. var ___uremdi3 = Module["___uremdi3"] = asm["___uremdi3"];
  33659. var stackAlloc = Module["stackAlloc"] = asm["stackAlloc"];
  33660. var _i64Subtract = Module["_i64Subtract"] = asm["_i64Subtract"];
  33661. var _memset = Module["_memset"] = asm["_memset"];
  33662. var setTempRet0 = Module["setTempRet0"] = asm["setTempRet0"];
  33663. var _i64Add = Module["_i64Add"] = asm["_i64Add"];
  33664. var _emscripten_atomic_store_u64 = Module["_emscripten_atomic_store_u64"] = asm["_emscripten_atomic_store_u64"];
  33665. var _emscripten_atomic_load_f64 = Module["_emscripten_atomic_load_f64"] = asm["_emscripten_atomic_load_f64"];
  33666. var _emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = asm["_emscripten_get_global_libc"];
  33667. var __emscripten_atomic_fetch_and_add_u64 = Module["__emscripten_atomic_fetch_and_add_u64"] = asm["__emscripten_atomic_fetch_and_add_u64"];
  33668. var __emscripten_atomic_fetch_and_or_u64 = Module["__emscripten_atomic_fetch_and_or_u64"] = asm["__emscripten_atomic_fetch_and_or_u64"];
  33669. var _emscripten_GetProcAddress = Module["_emscripten_GetProcAddress"] = asm["_emscripten_GetProcAddress"];
  33670. var _emscripten_async_run_in_main_thread = Module["_emscripten_async_run_in_main_thread"] = asm["_emscripten_async_run_in_main_thread"];
  33671. var _llvm_bswap_i32 = Module["_llvm_bswap_i32"] = asm["_llvm_bswap_i32"];
  33672. var runPostSets = Module["runPostSets"] = asm["runPostSets"];
  33673. var ___muldsi3 = Module["___muldsi3"] = asm["___muldsi3"];
  33674. var _emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = asm["_emscripten_main_thread_process_queued_calls"];
  33675. var _emscripten_atomic_add_u64 = Module["_emscripten_atomic_add_u64"] = asm["_emscripten_atomic_add_u64"];
  33676. var _free = Module["_free"] = asm["_free"];
  33677. var _emscripten_atomic_store_f32 = Module["_emscripten_atomic_store_f32"] = asm["_emscripten_atomic_store_f32"];
  33678. var setThrew = Module["setThrew"] = asm["setThrew"];
  33679. var _emscripten_atomic_exchange_u64 = Module["_emscripten_atomic_exchange_u64"] = asm["_emscripten_atomic_exchange_u64"];
  33680. var _emscripten_atomic_store_f64 = Module["_emscripten_atomic_store_f64"] = asm["_emscripten_atomic_store_f64"];
  33681. var ___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = asm["___pthread_tsd_run_dtors"];
  33682. var stackRestore = Module["stackRestore"] = asm["stackRestore"];
  33683. var ___udivmoddi4 = Module["___udivmoddi4"] = asm["___udivmoddi4"];
  33684. var _malloc = Module["_malloc"] = asm["_malloc"];
  33685. var establishStackSpace = Module["establishStackSpace"] = asm["establishStackSpace"];
  33686. var _emscripten_conditional_set_current_thread_status = Module["_emscripten_conditional_set_current_thread_status"] = asm["_emscripten_conditional_set_current_thread_status"];
  33687. var _sbrk = Module["_sbrk"] = asm["_sbrk"];
  33688. var _memmove = Module["_memmove"] = asm["_memmove"];
  33689. var _emscripten_atomic_or_u64 = Module["_emscripten_atomic_or_u64"] = asm["_emscripten_atomic_or_u64"];
  33690. var _strstr = Module["_strstr"] = asm["_strstr"];
  33691. var dynCall_viiiii = Module["dynCall_viiiii"] = asm["dynCall_viiiii"];
  33692. var dynCall_vd = Module["dynCall_vd"] = asm["dynCall_vd"];
  33693. var dynCall_vid = Module["dynCall_vid"] = asm["dynCall_vid"];
  33694. var dynCall_vi = Module["dynCall_vi"] = asm["dynCall_vi"];
  33695. var dynCall_vii = Module["dynCall_vii"] = asm["dynCall_vii"];
  33696. var dynCall_ii = Module["dynCall_ii"] = asm["dynCall_ii"];
  33697. var dynCall_viddd = Module["dynCall_viddd"] = asm["dynCall_viddd"];
  33698. var dynCall_vidd = Module["dynCall_vidd"] = asm["dynCall_vidd"];
  33699. var dynCall_iiii = Module["dynCall_iiii"] = asm["dynCall_iiii"];
  33700. var dynCall_viiiiiiii = Module["dynCall_viiiiiiii"] = asm["dynCall_viiiiiiii"];
  33701. var dynCall_viiiiii = Module["dynCall_viiiiii"] = asm["dynCall_viiiiii"];
  33702. var dynCall_viii = Module["dynCall_viii"] = asm["dynCall_viii"];
  33703. var dynCall_vidddd = Module["dynCall_vidddd"] = asm["dynCall_vidddd"];
  33704. var dynCall_vdi = Module["dynCall_vdi"] = asm["dynCall_vdi"];
  33705. var dynCall_viiiiiii = Module["dynCall_viiiiiii"] = asm["dynCall_viiiiiii"];
  33706. var dynCall_viiiiiiiii = Module["dynCall_viiiiiiiii"] = asm["dynCall_viiiiiiiii"];
  33707. var dynCall_iii = Module["dynCall_iii"] = asm["dynCall_iii"];
  33708. var dynCall_i = Module["dynCall_i"] = asm["dynCall_i"];
  33709. var dynCall_vdddddd = Module["dynCall_vdddddd"] = asm["dynCall_vdddddd"];
  33710. var dynCall_vdddd = Module["dynCall_vdddd"] = asm["dynCall_vdddd"];
  33711. var dynCall_vdd = Module["dynCall_vdd"] = asm["dynCall_vdd"];
  33712. var dynCall_v = Module["dynCall_v"] = asm["dynCall_v"];
  33713. var dynCall_viid = Module["dynCall_viid"] = asm["dynCall_viid"];
  33714. var dynCall_viiii = Module["dynCall_viiii"] = asm["dynCall_viiii"];
  33715. ;
  33716. Runtime.stackAlloc = Module['stackAlloc'];
  33717. Runtime.stackSave = Module['stackSave'];
  33718. Runtime.stackRestore = Module['stackRestore'];
  33719. Runtime.establishStackSpace = Module['establishStackSpace'];
  33720. Runtime.setTempRet0 = Module['setTempRet0'];
  33721. Runtime.getTempRet0 = Module['getTempRet0'];
  33722. // === Auto-generated postamble setup entry stuff ===
  33723. Module['asm'] = asm;
  33724. function ExitStatus(status) {
  33725. this.name = "ExitStatus";
  33726. this.message = "Program terminated with exit(" + status + ")";
  33727. this.status = status;
  33728. };
  33729. ExitStatus.prototype = new Error();
  33730. ExitStatus.prototype.constructor = ExitStatus;
  33731. var initialStackTop;
  33732. var preloadStartTime = null;
  33733. var calledMain = false;
  33734. dependenciesFulfilled = function runCaller() {
  33735. // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)
  33736. if (!Module['calledRun']) run();
  33737. if (!Module['calledRun']) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled
  33738. }
  33739. Module['callMain'] = Module.callMain = function callMain(args) {
  33740. assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on __ATMAIN__)');
  33741. assert(__ATPRERUN__.length == 0, 'cannot call main when preRun functions remain to be called');
  33742. args = args || [];
  33743. ensureInitRuntime();
  33744. var argc = args.length+1;
  33745. function pad() {
  33746. for (var i = 0; i < 4-1; i++) {
  33747. argv.push(0);
  33748. }
  33749. }
  33750. var argv = [allocate(intArrayFromString(Module['thisProgram']), 'i8', ALLOC_NORMAL) ];
  33751. pad();
  33752. for (var i = 0; i < argc-1; i = i + 1) {
  33753. argv.push(allocate(intArrayFromString(args[i]), 'i8', ALLOC_NORMAL));
  33754. pad();
  33755. }
  33756. argv.push(0);
  33757. argv = allocate(argv, 'i32', ALLOC_NORMAL);
  33758. try {
  33759. var ret = Module['_main'](argc, argv, 0);
  33760. // if we're not running an evented main loop, it's time to exit
  33761. exit(ret, /* implicit = */ true);
  33762. }
  33763. catch(e) {
  33764. if (e instanceof ExitStatus) {
  33765. // exit() throws this once it's done to make sure execution
  33766. // has been stopped completely
  33767. return;
  33768. } else if (e == 'SimulateInfiniteLoop') {
  33769. // running an evented main loop, don't immediately exit
  33770. Module['noExitRuntime'] = true;
  33771. return;
  33772. } else {
  33773. var toLog = e;
  33774. if (e && typeof e === 'object' && e.stack) {
  33775. toLog = [e, e.stack];
  33776. }
  33777. Module.printErr('exception thrown: ' + toLog);
  33778. Module['quit'](1, e);
  33779. }
  33780. } finally {
  33781. calledMain = true;
  33782. }
  33783. }
  33784. function run(args) {
  33785. args = args || Module['arguments'];
  33786. if (preloadStartTime === null) preloadStartTime = Date.now();
  33787. if (runDependencies > 0) {
  33788. Module.printErr('run() called, but dependencies remain, so not running');
  33789. return;
  33790. }
  33791. writeStackCookie();
  33792. preRun();
  33793. if (runDependencies > 0) return; // a preRun added a dependency, run will be called later
  33794. if (Module['calledRun']) return; // run may have just been called through dependencies being fulfilled just in this very frame
  33795. function doRun() {
  33796. if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening
  33797. Module['calledRun'] = true;
  33798. if (ABORT) return;
  33799. ensureInitRuntime();
  33800. preMain();
  33801. if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {
  33802. Module.printErr('pre-main prep time: ' + (Date.now() - preloadStartTime) + ' ms');
  33803. }
  33804. if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();
  33805. if (Module['_main'] && shouldRunNow) Module['callMain'](args);
  33806. postRun();
  33807. }
  33808. if (Module['setStatus']) {
  33809. Module['setStatus']('Running...');
  33810. setTimeout(function() {
  33811. setTimeout(function() {
  33812. Module['setStatus']('');
  33813. }, 1);
  33814. doRun();
  33815. }, 1);
  33816. } else {
  33817. doRun();
  33818. }
  33819. checkStackCookie();
  33820. }
  33821. Module['run'] = Module.run = run;
  33822. function exit(status, implicit) {
  33823. if (implicit && Module['noExitRuntime']) {
  33824. 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)');
  33825. return;
  33826. }
  33827. if (Module['noExitRuntime']) {
  33828. 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)');
  33829. } else {
  33830. PThread.terminateAllThreads();
  33831. ABORT = true;
  33832. EXITSTATUS = status;
  33833. STACKTOP = initialStackTop;
  33834. exitRuntime();
  33835. if (Module['onExit']) Module['onExit'](status);
  33836. }
  33837. if (ENVIRONMENT_IS_NODE) {
  33838. process['exit'](status);
  33839. }
  33840. Module['quit'](status, new ExitStatus(status));
  33841. }
  33842. Module['exit'] = Module.exit = exit;
  33843. var abortDecorators = [];
  33844. function abort(what) {
  33845. if (ENVIRONMENT_IS_PTHREAD) console.error('Pthread aborting at ' + new Error().stack);
  33846. if (what !== undefined) {
  33847. Module.print(what);
  33848. Module.printErr(what);
  33849. what = JSON.stringify(what)
  33850. } else {
  33851. what = '';
  33852. }
  33853. ABORT = true;
  33854. EXITSTATUS = 1;
  33855. var extra = '';
  33856. var output = 'abort(' + what + ') at ' + stackTrace() + extra;
  33857. if (abortDecorators) {
  33858. abortDecorators.forEach(function(decorator) {
  33859. output = decorator(output, what);
  33860. });
  33861. }
  33862. throw output;
  33863. }
  33864. Module['abort'] = Module.abort = abort;
  33865. // {{PRE_RUN_ADDITIONS}}
  33866. if (Module['preInit']) {
  33867. if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']];
  33868. while (Module['preInit'].length > 0) {
  33869. Module['preInit'].pop()();
  33870. }
  33871. }
  33872. // shouldRunNow refers to calling main(), not run().
  33873. var shouldRunNow = true;
  33874. if (Module['noInitialRun']) {
  33875. shouldRunNow = false;
  33876. }
  33877. if (!ENVIRONMENT_IS_PTHREAD) run();
  33878. // {{POST_RUN_ADDITIONS}}
  33879. // {{MODULE_ADDITIONS}}