12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005 |
- // The Module object: Our interface to the outside world. We import
- // and export values on it, and do the work to get that through
- // closure compiler if necessary. There are various ways Module can be used:
- // 1. Not defined. We create it here
- // 2. A function parameter, function(Module) { ..generated code.. }
- // 3. pre-run appended it, var Module = {}; ..generated code..
- // 4. External script tag defines var Module.
- // We need to do an eval in order to handle the closure compiler
- // case, where this code here is minified but Module was defined
- // elsewhere (e.g. case 4 above). We also need to check if Module
- // already exists (e.g. case 3 above).
- // Note that if you want to run closure, and also to use Module
- // after the generated code, you will need to define var Module = {};
- // before the code. Then that object will be used in the code, and you
- // can continue to use Module afterwards as well.
- var Module;
- if (!Module) Module = (typeof Module !== 'undefined' ? Module : null) || {};
- // Sometimes an existing Module object exists with properties
- // meant to overwrite the default module functionality. Here
- // we collect those properties and reapply _after_ we configure
- // the current environment's defaults to avoid having to be so
- // defensive during initialization.
- var moduleOverrides = {};
- for (var key in Module) {
- if (Module.hasOwnProperty(key)) {
- moduleOverrides[key] = Module[key];
- }
- }
- // The environment setup code below is customized to use Module.
- // *** Environment setup code ***
- var ENVIRONMENT_IS_WEB = false;
- var ENVIRONMENT_IS_WORKER = false;
- var ENVIRONMENT_IS_NODE = false;
- var ENVIRONMENT_IS_SHELL = false;
- // Three configurations we can be running in:
- // 1) We could be the application main() thread running in the main JS UI thread. (ENVIRONMENT_IS_WORKER == false and ENVIRONMENT_IS_PTHREAD == false)
- // 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)
- // 3) We could be an application pthread running in a worker. (ENVIRONMENT_IS_WORKER == true and ENVIRONMENT_IS_PTHREAD == true)
- if (Module['ENVIRONMENT']) {
- if (Module['ENVIRONMENT'] === 'WEB') {
- ENVIRONMENT_IS_WEB = true;
- } else if (Module['ENVIRONMENT'] === 'WORKER') {
- ENVIRONMENT_IS_WORKER = true;
- } else if (Module['ENVIRONMENT'] === 'NODE') {
- ENVIRONMENT_IS_NODE = true;
- } else if (Module['ENVIRONMENT'] === 'SHELL') {
- ENVIRONMENT_IS_SHELL = true;
- } else {
- throw new Error('The provided Module[\'ENVIRONMENT\'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.');
- }
- } else {
- ENVIRONMENT_IS_WEB = typeof window === 'object';
- ENVIRONMENT_IS_WORKER = typeof importScripts === 'function';
- ENVIRONMENT_IS_NODE = typeof process === 'object' && typeof require === 'function' && !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_WORKER;
- ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;
- }
- var ENVIRONMENT_IS_PTHREAD;
- 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.
- var PthreadWorkerInit; // Collects together variables that are needed at initialization time for the web workers that host pthreads.
- if (!ENVIRONMENT_IS_PTHREAD) PthreadWorkerInit = {};
- var currentScriptUrl = ENVIRONMENT_IS_WORKER ? undefined : document.currentScript.src;
- if (ENVIRONMENT_IS_NODE) {
- // Expose functionality in the same simple way that the shells work
- // Note that we pollute the global namespace here, otherwise we break in node
- if (!Module['print']) Module['print'] = console.log;
- if (!Module['printErr']) Module['printErr'] = console.warn;
- var nodeFS;
- var nodePath;
- Module['read'] = function read(filename, binary) {
- if (!nodeFS) nodeFS = require('fs');
- if (!nodePath) nodePath = require('path');
- filename = nodePath['normalize'](filename);
- var ret = nodeFS['readFileSync'](filename);
- return binary ? ret : ret.toString();
- };
- Module['readBinary'] = function readBinary(filename) {
- var ret = Module['read'](filename, true);
- if (!ret.buffer) {
- ret = new Uint8Array(ret);
- }
- assert(ret.buffer);
- return ret;
- };
- Module['load'] = function load(f) {
- globalEval(read(f));
- };
- if (!Module['thisProgram']) {
- if (process['argv'].length > 1) {
- Module['thisProgram'] = process['argv'][1].replace(/\\/g, '/');
- } else {
- Module['thisProgram'] = 'unknown-program';
- }
- }
- Module['arguments'] = process['argv'].slice(2);
- if (typeof module !== 'undefined') {
- module['exports'] = Module;
- }
- process['on']('uncaughtException', function(ex) {
- // suppress ExitStatus exceptions from showing an error
- if (!(ex instanceof ExitStatus)) {
- throw ex;
- }
- });
- Module['inspect'] = function () { return '[Emscripten Module object]'; };
- }
- else if (ENVIRONMENT_IS_SHELL) {
- if (!Module['print']) Module['print'] = print;
- if (typeof printErr != 'undefined') Module['printErr'] = printErr; // not present in v8 or older sm
- if (typeof read != 'undefined') {
- Module['read'] = read;
- } else {
- Module['read'] = function read() { throw 'no read() available' };
- }
- Module['readBinary'] = function readBinary(f) {
- if (typeof readbuffer === 'function') {
- return new Uint8Array(readbuffer(f));
- }
- var data = read(f, 'binary');
- assert(typeof data === 'object');
- return data;
- };
- if (typeof scriptArgs != 'undefined') {
- Module['arguments'] = scriptArgs;
- } else if (typeof arguments != 'undefined') {
- Module['arguments'] = arguments;
- }
- if (typeof quit === 'function') {
- Module['quit'] = function(status, toThrow) {
- quit(status);
- }
- }
- }
- else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
- Module['read'] = function read(url) {
- var xhr = new XMLHttpRequest();
- xhr.open('GET', url, false);
- xhr.send(null);
- return xhr.responseText;
- };
- if (ENVIRONMENT_IS_WORKER) {
- Module['readBinary'] = function read(url) {
- var xhr = new XMLHttpRequest();
- xhr.open('GET', url, false);
- xhr.responseType = 'arraybuffer';
- xhr.send(null);
- return xhr.response;
- };
- }
- Module['readAsync'] = function readAsync(url, onload, onerror) {
- var xhr = new XMLHttpRequest();
- xhr.open('GET', url, true);
- xhr.responseType = 'arraybuffer';
- xhr.onload = function xhr_onload() {
- if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
- onload(xhr.response);
- } else {
- onerror();
- }
- };
- xhr.onerror = onerror;
- xhr.send(null);
- };
- if (typeof arguments != 'undefined') {
- Module['arguments'] = arguments;
- }
- if (typeof console !== 'undefined') {
- if (!Module['print']) Module['print'] = function print(x) {
- console.log(x);
- };
- if (!Module['printErr']) Module['printErr'] = function printErr(x) {
- console.warn(x);
- };
- } else {
- // Probably a worker, and without console.log. We can do very little here...
- var TRY_USE_DUMP = false;
- if (!Module['print']) Module['print'] = (TRY_USE_DUMP && (typeof(dump) !== "undefined") ? (function(x) {
- dump(x);
- }) : (function(x) {
- // self.postMessage(x); // enable this if you want stdout to be sent as messages
- }));
- }
- if (ENVIRONMENT_IS_WORKER) {
- Module['load'] = importScripts;
- }
- if (typeof Module['setWindowTitle'] === 'undefined') {
- Module['setWindowTitle'] = function(title) { document.title = title };
- }
- }
- else {
- // Unreachable because SHELL is dependant on the others
- throw 'Unknown runtime environment. Where are we?';
- }
- function globalEval(x) {
- eval.call(null, x);
- }
- if (!Module['load'] && Module['read']) {
- Module['load'] = function load(f) {
- globalEval(Module['read'](f));
- };
- }
- if (!Module['print']) {
- Module['print'] = function(){};
- }
- if (!Module['printErr']) {
- Module['printErr'] = Module['print'];
- }
- if (!Module['arguments']) {
- Module['arguments'] = [];
- }
- if (!Module['thisProgram']) {
- Module['thisProgram'] = './this.program';
- }
- if (!Module['quit']) {
- Module['quit'] = function(status, toThrow) {
- throw toThrow;
- }
- }
- // *** Environment setup code ***
- // Closure helpers
- Module.print = Module['print'];
- Module.printErr = Module['printErr'];
- // Callbacks
- Module['preRun'] = [];
- Module['postRun'] = [];
- // Merge back in the overrides
- for (var key in moduleOverrides) {
- if (moduleOverrides.hasOwnProperty(key)) {
- Module[key] = moduleOverrides[key];
- }
- }
- // Free the object hierarchy contained in the overrides, this lets the GC
- // reclaim data used e.g. in memoryInitializerRequest, which is a large typed array.
- moduleOverrides = undefined;
- // {{PREAMBLE_ADDITIONS}}
- // === Preamble library stuff ===
- // Documentation for the public APIs defined in this file must be updated in:
- // site/source/docs/api_reference/preamble.js.rst
- // A prebuilt local version of the documentation is available at:
- // site/build/text/docs/api_reference/preamble.js.txt
- // You can also build docs locally as HTML or other formats in site/
- // An online HTML version (which may be of a different version of Emscripten)
- // is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html
- //========================================
- // Runtime code shared with compiler
- //========================================
- var Runtime = {
- setTempRet0: function (value) {
- tempRet0 = value;
- return value;
- },
- getTempRet0: function () {
- return tempRet0;
- },
- stackSave: function () {
- return STACKTOP;
- },
- stackRestore: function (stackTop) {
- STACKTOP = stackTop;
- },
- getNativeTypeSize: function (type) {
- switch (type) {
- case 'i1': case 'i8': return 1;
- case 'i16': return 2;
- case 'i32': return 4;
- case 'i64': return 8;
- case 'float': return 4;
- case 'double': return 8;
- default: {
- if (type[type.length-1] === '*') {
- return Runtime.QUANTUM_SIZE; // A pointer
- } else if (type[0] === 'i') {
- var bits = parseInt(type.substr(1));
- assert(bits % 8 === 0);
- return bits/8;
- } else {
- return 0;
- }
- }
- }
- },
- getNativeFieldSize: function (type) {
- return Math.max(Runtime.getNativeTypeSize(type), Runtime.QUANTUM_SIZE);
- },
- STACK_ALIGN: 16,
- prepVararg: function (ptr, type) {
- if (type === 'double' || type === 'i64') {
- // move so the load is aligned
- if (ptr & 7) {
- assert((ptr & 7) === 4);
- ptr += 4;
- }
- } else {
- assert((ptr & 3) === 0);
- }
- return ptr;
- },
- getAlignSize: function (type, size, vararg) {
- // we align i64s and doubles on 64-bit boundaries, unlike x86
- if (!vararg && (type == 'i64' || type == 'double')) return 8;
- if (!type) return Math.min(size, 8); // align structures internally to 64 bits
- return Math.min(size || (type ? Runtime.getNativeFieldSize(type) : 0), Runtime.QUANTUM_SIZE);
- },
- dynCall: function (sig, ptr, args) {
- if (args && args.length) {
- assert(args.length == sig.length-1);
- assert(('dynCall_' + sig) in Module, 'bad function pointer type - no table for sig \'' + sig + '\'');
- return Module['dynCall_' + sig].apply(null, [ptr].concat(args));
- } else {
- assert(sig.length == 1);
- assert(('dynCall_' + sig) in Module, 'bad function pointer type - no table for sig \'' + sig + '\'');
- return Module['dynCall_' + sig].call(null, ptr);
- }
- },
- functionPointers: [],
- addFunction: function (func) {
- for (var i = 0; i < Runtime.functionPointers.length; i++) {
- if (!Runtime.functionPointers[i]) {
- Runtime.functionPointers[i] = func;
- return 2*(1 + i);
- }
- }
- throw 'Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.';
- },
- removeFunction: function (index) {
- Runtime.functionPointers[(index-2)/2] = null;
- },
- warnOnce: function (text) {
- if (!Runtime.warnOnce.shown) Runtime.warnOnce.shown = {};
- if (!Runtime.warnOnce.shown[text]) {
- Runtime.warnOnce.shown[text] = 1;
- Module.printErr(text);
- }
- },
- funcWrappers: {},
- getFuncWrapper: function (func, sig) {
- assert(sig);
- if (!Runtime.funcWrappers[sig]) {
- Runtime.funcWrappers[sig] = {};
- }
- var sigCache = Runtime.funcWrappers[sig];
- if (!sigCache[func]) {
- // optimize away arguments usage in common cases
- if (sig.length === 1) {
- sigCache[func] = function dynCall_wrapper() {
- return Runtime.dynCall(sig, func);
- };
- } else if (sig.length === 2) {
- sigCache[func] = function dynCall_wrapper(arg) {
- return Runtime.dynCall(sig, func, [arg]);
- };
- } else {
- // general case
- sigCache[func] = function dynCall_wrapper() {
- return Runtime.dynCall(sig, func, Array.prototype.slice.call(arguments));
- };
- }
- }
- return sigCache[func];
- },
- getCompilerSetting: function (name) {
- throw 'You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work';
- },
- stackAlloc: function (size) { var ret = STACKTOP;STACKTOP = (STACKTOP + size)|0;STACKTOP = (((STACKTOP)+15)&-16);(assert((((STACKTOP|0) < (STACK_MAX|0))|0))|0); return ret; },
- staticAlloc: function (size) { var ret = STATICTOP;STATICTOP = (STATICTOP + (assert(!staticSealed),size))|0;STATICTOP = (((STATICTOP)+15)&-16); return ret; },
- 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;},
- alignMemory: function (size,quantum) { var ret = size = Math.ceil((size)/(quantum ? quantum : 16))*(quantum ? quantum : 16); return ret; },
- makeBigInt: function (low,high,unsigned) { var ret = (unsigned ? ((+((low>>>0)))+((+((high>>>0)))*4294967296.0)) : ((+((low>>>0)))+((+((high|0)))*4294967296.0))); return ret; },
- GLOBAL_BASE: 8,
- QUANTUM_SIZE: 4,
- __dummy__: 0
- }
- Module["Runtime"] = Runtime;
- //========================================
- // Runtime essentials
- //========================================
- var ABORT = 0; // whether we are quitting the application. no code should run after this. set in exit() and abort()
- var EXITSTATUS = 0;
- function assert(condition, text) {
- if (!condition) {
- abort('Assertion failed: ' + text);
- }
- }
- var globalScope = this;
- // Returns the C function with a specified identifier (for C++, you need to do manual name mangling)
- function getCFunc(ident) {
- var func = Module['_' + ident]; // closure exported function
- if (!func) {
- try { func = eval('_' + ident); } catch(e) {}
- }
- assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)');
- return func;
- }
- var cwrap, ccall;
- (function(){
- var JSfuncs = {
- // Helpers for cwrap -- it can't refer to Runtime directly because it might
- // be renamed by closure, instead it calls JSfuncs['stackSave'].body to find
- // out what the minified function name is.
- 'stackSave': function() {
- Runtime.stackSave()
- },
- 'stackRestore': function() {
- Runtime.stackRestore()
- },
- // type conversion from js to c
- 'arrayToC' : function(arr) {
- var ret = Runtime.stackAlloc(arr.length);
- writeArrayToMemory(arr, ret);
- return ret;
- },
- 'stringToC' : function(str) {
- var ret = 0;
- if (str !== null && str !== undefined && str !== 0) { // null string
- // at most 4 bytes per UTF-8 code point, +1 for the trailing '\0'
- var len = (str.length << 2) + 1;
- ret = Runtime.stackAlloc(len);
- stringToUTF8(str, ret, len);
- }
- return ret;
- }
- };
- // For fast lookup of conversion functions
- var toC = {'string' : JSfuncs['stringToC'], 'array' : JSfuncs['arrayToC']};
- // C calling interface.
- ccall = function ccallFunc(ident, returnType, argTypes, args, opts) {
- var func = getCFunc(ident);
- var cArgs = [];
- var stack = 0;
- assert(returnType !== 'array', 'Return type should not be "array".');
- if (args) {
- for (var i = 0; i < args.length; i++) {
- var converter = toC[argTypes[i]];
- if (converter) {
- if (stack === 0) stack = Runtime.stackSave();
- cArgs[i] = converter(args[i]);
- } else {
- cArgs[i] = args[i];
- }
- }
- }
- var ret = func.apply(null, cArgs);
- if ((!opts || !opts.async) && typeof EmterpreterAsync === 'object') {
- assert(!EmterpreterAsync.state, 'cannot start async op with normal JS calling ccall');
- }
- if (opts && opts.async) assert(!returnType, 'async ccalls cannot return values');
- if (returnType === 'string') ret = Pointer_stringify(ret);
- if (stack !== 0) {
- if (opts && opts.async) {
- EmterpreterAsync.asyncFinalizers.push(function() {
- Runtime.stackRestore(stack);
- });
- return;
- }
- Runtime.stackRestore(stack);
- }
- return ret;
- }
- var sourceRegex = /^function\s*[a-zA-Z$_0-9]*\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/;
- function parseJSFunc(jsfunc) {
- // Match the body and the return value of a javascript function source
- var parsed = jsfunc.toString().match(sourceRegex).slice(1);
- return {arguments : parsed[0], body : parsed[1], returnValue: parsed[2]}
- }
- // sources of useful functions. we create this lazily as it can trigger a source decompression on this entire file
- var JSsource = null;
- function ensureJSsource() {
- if (!JSsource) {
- JSsource = {};
- for (var fun in JSfuncs) {
- if (JSfuncs.hasOwnProperty(fun)) {
- // Elements of toCsource are arrays of three items:
- // the code, and the return value
- JSsource[fun] = parseJSFunc(JSfuncs[fun]);
- }
- }
- }
- }
- cwrap = function cwrap(ident, returnType, argTypes) {
- argTypes = argTypes || [];
- var cfunc = getCFunc(ident);
- // When the function takes numbers and returns a number, we can just return
- // the original function
- var numericArgs = argTypes.every(function(type){ return type === 'number'});
- var numericRet = (returnType !== 'string');
- if ( numericRet && numericArgs) {
- return cfunc;
- }
- // Creation of the arguments list (["$1","$2",...,"$nargs"])
- var argNames = argTypes.map(function(x,i){return '$'+i});
- var funcstr = "(function(" + argNames.join(',') + ") {";
- var nargs = argTypes.length;
- if (!numericArgs) {
- // Generate the code needed to convert the arguments from javascript
- // values to pointers
- ensureJSsource();
- funcstr += 'var stack = ' + JSsource['stackSave'].body + ';';
- for (var i = 0; i < nargs; i++) {
- var arg = argNames[i], type = argTypes[i];
- if (type === 'number') continue;
- var convertCode = JSsource[type + 'ToC']; // [code, return]
- funcstr += 'var ' + convertCode.arguments + ' = ' + arg + ';';
- funcstr += convertCode.body + ';';
- funcstr += arg + '=(' + convertCode.returnValue + ');';
- }
- }
- // When the code is compressed, the name of cfunc is not literally 'cfunc' anymore
- var cfuncname = parseJSFunc(function(){return cfunc}).returnValue;
- // Call the function
- funcstr += 'var ret = ' + cfuncname + '(' + argNames.join(',') + ');';
- if (!numericRet) { // Return type can only by 'string' or 'number'
- // Convert the result to a string
- var strgfy = parseJSFunc(function(){return Pointer_stringify}).returnValue;
- funcstr += 'ret = ' + strgfy + '(ret);';
- }
- funcstr += "if (typeof EmterpreterAsync === 'object') { assert(!EmterpreterAsync.state, 'cannot start async op with normal JS calling cwrap') }";
- if (!numericArgs) {
- // If we had a stack, restore it
- ensureJSsource();
- funcstr += JSsource['stackRestore'].body.replace('()', '(stack)') + ';';
- }
- funcstr += 'return ret})';
- return eval(funcstr);
- };
- })();
- Module["ccall"] = ccall;
- Module["cwrap"] = cwrap;
- function setValue(ptr, value, type, noSafe) {
- type = type || 'i8';
- if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit
- switch(type) {
- case 'i1': HEAP8[((ptr)>>0)]=value; break;
- case 'i8': HEAP8[((ptr)>>0)]=value; break;
- case 'i16': HEAP16[((ptr)>>1)]=value; break;
- case 'i32': HEAP32[((ptr)>>2)]=value; break;
- 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;
- case 'float': HEAPF32[((ptr)>>2)]=value; break;
- case 'double': HEAPF64[((ptr)>>3)]=value; break;
- default: abort('invalid type for setValue: ' + type);
- }
- }
- Module["setValue"] = setValue;
- function getValue(ptr, type, noSafe) {
- type = type || 'i8';
- if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit
- switch(type) {
- case 'i1': return HEAP8[((ptr)>>0)];
- case 'i8': return HEAP8[((ptr)>>0)];
- case 'i16': return HEAP16[((ptr)>>1)];
- case 'i32': return HEAP32[((ptr)>>2)];
- case 'i64': return HEAP32[((ptr)>>2)];
- case 'float': return HEAPF32[((ptr)>>2)];
- case 'double': return HEAPF64[((ptr)>>3)];
- default: abort('invalid type for setValue: ' + type);
- }
- return null;
- }
- Module["getValue"] = getValue;
- var ALLOC_NORMAL = 0; // Tries to use _malloc()
- var ALLOC_STACK = 1; // Lives for the duration of the current function call
- var ALLOC_STATIC = 2; // Cannot be freed
- var ALLOC_DYNAMIC = 3; // Cannot be freed except through sbrk
- var ALLOC_NONE = 4; // Do not allocate
- Module["ALLOC_NORMAL"] = ALLOC_NORMAL;
- Module["ALLOC_STACK"] = ALLOC_STACK;
- Module["ALLOC_STATIC"] = ALLOC_STATIC;
- Module["ALLOC_DYNAMIC"] = ALLOC_DYNAMIC;
- Module["ALLOC_NONE"] = ALLOC_NONE;
- // allocate(): This is for internal use. You can use it yourself as well, but the interface
- // is a little tricky (see docs right below). The reason is that it is optimized
- // for multiple syntaxes to save space in generated code. So you should
- // normally not use allocate(), and instead allocate memory using _malloc(),
- // initialize it with setValue(), and so forth.
- // @slab: An array of data, or a number. If a number, then the size of the block to allocate,
- // in *bytes* (note that this is sometimes confusing: the next parameter does not
- // affect this!)
- // @types: Either an array of types, one for each byte (or 0 if no type at that position),
- // or a single type which is used for the entire block. This only matters if there
- // is initial data - if @slab is a number, then this does not matter at all and is
- // ignored.
- // @allocator: How to allocate memory, see ALLOC_*
- function allocate(slab, types, allocator, ptr) {
- var zeroinit, size;
- if (typeof slab === 'number') {
- zeroinit = true;
- size = slab;
- } else {
- zeroinit = false;
- size = slab.length;
- }
- var singleType = typeof types === 'string' ? types : null;
- var ret;
- if (allocator == ALLOC_NONE) {
- ret = ptr;
- } else {
- 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));
- }
- if (zeroinit) {
- var ptr = ret, stop;
- assert((ret & 3) == 0);
- stop = ret + (size & ~3);
- for (; ptr < stop; ptr += 4) {
- HEAP32[((ptr)>>2)]=0;
- }
- stop = ret + size;
- while (ptr < stop) {
- HEAP8[((ptr++)>>0)]=0;
- }
- return ret;
- }
- if (singleType === 'i8') {
- if (slab.subarray || slab.slice) {
- HEAPU8.set(slab, ret);
- } else {
- HEAPU8.set(new Uint8Array(slab), ret);
- }
- return ret;
- }
- var i = 0, type, typeSize, previousType;
- while (i < size) {
- var curr = slab[i];
- if (typeof curr === 'function') {
- curr = Runtime.getFunctionIndex(curr);
- }
- type = singleType || types[i];
- if (type === 0) {
- i++;
- continue;
- }
- assert(type, 'Must know what type to store in allocate!');
- if (type == 'i64') type = 'i32'; // special case: we have one i32 here, and one i32 later
- setValue(ret+i, curr, type);
- // no need to look up size unless type changes, so cache it
- if (previousType !== type) {
- typeSize = Runtime.getNativeTypeSize(type);
- previousType = type;
- }
- i += typeSize;
- }
- return ret;
- }
- Module["allocate"] = allocate;
- // Allocate memory during any stage of startup - static memory early on, dynamic memory later, malloc when ready
- function getMemory(size) {
- if (!staticSealed) return Runtime.staticAlloc(size);
- if (!runtimeInitialized) return Runtime.dynamicAlloc(size);
- return _malloc(size);
- }
- Module["getMemory"] = getMemory;
- function Pointer_stringify(ptr, /* optional */ length) {
- if (length === 0 || !ptr) return '';
- // TODO: use TextDecoder
- // Find the length, and check for UTF while doing so
- var hasUtf = 0;
- var t;
- var i = 0;
- while (1) {
- assert(ptr + i < TOTAL_MEMORY);
- t = HEAPU8[(((ptr)+(i))>>0)];
- hasUtf |= t;
- if (t == 0 && !length) break;
- i++;
- if (length && i == length) break;
- }
- if (!length) length = i;
- var ret = '';
- if (hasUtf < 128) {
- var MAX_CHUNK = 1024; // split up into chunks, because .apply on a huge string can overflow the stack
- var curr;
- while (length > 0) {
- curr = String.fromCharCode.apply(String, HEAPU8.subarray(ptr, ptr + Math.min(length, MAX_CHUNK)));
- ret = ret ? ret + curr : curr;
- ptr += MAX_CHUNK;
- length -= MAX_CHUNK;
- }
- return ret;
- }
- return Module['UTF8ToString'](ptr);
- }
- Module["Pointer_stringify"] = Pointer_stringify;
- // Given a pointer 'ptr' to a null-terminated ASCII-encoded string in the emscripten HEAP, returns
- // a copy of that string as a Javascript String object.
- function AsciiToString(ptr) {
- var str = '';
- while (1) {
- var ch = HEAP8[((ptr++)>>0)];
- if (!ch) return str;
- str += String.fromCharCode(ch);
- }
- }
- Module["AsciiToString"] = AsciiToString;
- // Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
- // null-terminated and encoded in ASCII form. The copy will require at most str.length+1 bytes of space in the HEAP.
- function stringToAscii(str, outPtr) {
- return writeAsciiToMemory(str, outPtr, false);
- }
- Module["stringToAscii"] = stringToAscii;
- // Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the given array that contains uint8 values, returns
- // a copy of that string as a Javascript String object.
- var UTF8Decoder = typeof TextDecoder !== 'undefined' ? new TextDecoder('utf8') : undefined;
- function UTF8ArrayToString(u8Array, idx) {
- var endPtr = idx;
- // TextDecoder needs to know the byte length in advance, it doesn't stop on null terminator by itself.
- // Also, use the length info to avoid running tiny strings through TextDecoder, since .subarray() allocates garbage.
- while (u8Array[endPtr]) ++endPtr;
- if (endPtr - idx > 16 && u8Array.subarray && UTF8Decoder) {
- return UTF8Decoder.decode(u8Array.subarray(idx, endPtr));
- } else {
- var u0, u1, u2, u3, u4, u5;
- var str = '';
- while (1) {
- // 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
- u0 = u8Array[idx++];
- if (!u0) return str;
- if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; }
- u1 = u8Array[idx++] & 63;
- if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; }
- u2 = u8Array[idx++] & 63;
- if ((u0 & 0xF0) == 0xE0) {
- u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;
- } else {
- u3 = u8Array[idx++] & 63;
- if ((u0 & 0xF8) == 0xF0) {
- u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | u3;
- } else {
- u4 = u8Array[idx++] & 63;
- if ((u0 & 0xFC) == 0xF8) {
- u0 = ((u0 & 3) << 24) | (u1 << 18) | (u2 << 12) | (u3 << 6) | u4;
- } else {
- u5 = u8Array[idx++] & 63;
- u0 = ((u0 & 1) << 30) | (u1 << 24) | (u2 << 18) | (u3 << 12) | (u4 << 6) | u5;
- }
- }
- }
- if (u0 < 0x10000) {
- str += String.fromCharCode(u0);
- } else {
- var ch = u0 - 0x10000;
- str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));
- }
- }
- }
- }
- Module["UTF8ArrayToString"] = UTF8ArrayToString;
- // Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the emscripten HEAP, returns
- // a copy of that string as a Javascript String object.
- function UTF8ToString(ptr) {
- return UTF8ArrayToString(HEAPU8,ptr);
- }
- Module["UTF8ToString"] = UTF8ToString;
- // Copies the given Javascript String object 'str' to the given byte array at address 'outIdx',
- // encoded in UTF8 form and null-terminated. The copy will require at most str.length*4+1 bytes of space in the HEAP.
- // Use the function lengthBytesUTF8 to compute the exact number of bytes (excluding null terminator) that this function will write.
- // Parameters:
- // str: the Javascript string to copy.
- // outU8Array: the array to copy to. Each index in this array is assumed to be one 8-byte element.
- // outIdx: The starting offset in the array to begin the copying.
- // maxBytesToWrite: The maximum number of bytes this function can write to the array. This count should include the null
- // terminator, i.e. if maxBytesToWrite=1, only the null terminator will be written and nothing else.
- // maxBytesToWrite=0 does not write any bytes to the output, not even the null terminator.
- // Returns the number of bytes written, EXCLUDING the null terminator.
- function stringToUTF8Array(str, outU8Array, outIdx, maxBytesToWrite) {
- if (!(maxBytesToWrite > 0)) // Parameter maxBytesToWrite is not optional. Negative values, 0, null, undefined and false each don't write out any bytes.
- return 0;
- var startIdx = outIdx;
- var endIdx = outIdx + maxBytesToWrite - 1; // -1 for string null terminator.
- for (var i = 0; i < str.length; ++i) {
- // 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.
- // See http://unicode.org/faq/utf_bom.html#utf16-3
- // 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
- var u = str.charCodeAt(i); // possibly a lead surrogate
- if (u >= 0xD800 && u <= 0xDFFF) u = 0x10000 + ((u & 0x3FF) << 10) | (str.charCodeAt(++i) & 0x3FF);
- if (u <= 0x7F) {
- if (outIdx >= endIdx) break;
- outU8Array[outIdx++] = u;
- } else if (u <= 0x7FF) {
- if (outIdx + 1 >= endIdx) break;
- outU8Array[outIdx++] = 0xC0 | (u >> 6);
- outU8Array[outIdx++] = 0x80 | (u & 63);
- } else if (u <= 0xFFFF) {
- if (outIdx + 2 >= endIdx) break;
- outU8Array[outIdx++] = 0xE0 | (u >> 12);
- outU8Array[outIdx++] = 0x80 | ((u >> 6) & 63);
- outU8Array[outIdx++] = 0x80 | (u & 63);
- } else if (u <= 0x1FFFFF) {
- if (outIdx + 3 >= endIdx) break;
- outU8Array[outIdx++] = 0xF0 | (u >> 18);
- outU8Array[outIdx++] = 0x80 | ((u >> 12) & 63);
- outU8Array[outIdx++] = 0x80 | ((u >> 6) & 63);
- outU8Array[outIdx++] = 0x80 | (u & 63);
- } else if (u <= 0x3FFFFFF) {
- if (outIdx + 4 >= endIdx) break;
- outU8Array[outIdx++] = 0xF8 | (u >> 24);
- outU8Array[outIdx++] = 0x80 | ((u >> 18) & 63);
- outU8Array[outIdx++] = 0x80 | ((u >> 12) & 63);
- outU8Array[outIdx++] = 0x80 | ((u >> 6) & 63);
- outU8Array[outIdx++] = 0x80 | (u & 63);
- } else {
- if (outIdx + 5 >= endIdx) break;
- outU8Array[outIdx++] = 0xFC | (u >> 30);
- outU8Array[outIdx++] = 0x80 | ((u >> 24) & 63);
- outU8Array[outIdx++] = 0x80 | ((u >> 18) & 63);
- outU8Array[outIdx++] = 0x80 | ((u >> 12) & 63);
- outU8Array[outIdx++] = 0x80 | ((u >> 6) & 63);
- outU8Array[outIdx++] = 0x80 | (u & 63);
- }
- }
- // Null-terminate the pointer to the buffer.
- outU8Array[outIdx] = 0;
- return outIdx - startIdx;
- }
- Module["stringToUTF8Array"] = stringToUTF8Array;
- // Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
- // null-terminated and encoded in UTF8 form. The copy will require at most str.length*4+1 bytes of space in the HEAP.
- // Use the function lengthBytesUTF8 to compute the exact number of bytes (excluding null terminator) that this function will write.
- // Returns the number of bytes written, EXCLUDING the null terminator.
- function stringToUTF8(str, outPtr, maxBytesToWrite) {
- assert(typeof maxBytesToWrite == 'number', 'stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');
- return stringToUTF8Array(str, HEAPU8,outPtr, maxBytesToWrite);
- }
- Module["stringToUTF8"] = stringToUTF8;
- // Returns the number of bytes the given Javascript string takes if encoded as a UTF8 byte array, EXCLUDING the null terminator byte.
- function lengthBytesUTF8(str) {
- var len = 0;
- for (var i = 0; i < str.length; ++i) {
- // 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.
- // See http://unicode.org/faq/utf_bom.html#utf16-3
- var u = str.charCodeAt(i); // possibly a lead surrogate
- if (u >= 0xD800 && u <= 0xDFFF) u = 0x10000 + ((u & 0x3FF) << 10) | (str.charCodeAt(++i) & 0x3FF);
- if (u <= 0x7F) {
- ++len;
- } else if (u <= 0x7FF) {
- len += 2;
- } else if (u <= 0xFFFF) {
- len += 3;
- } else if (u <= 0x1FFFFF) {
- len += 4;
- } else if (u <= 0x3FFFFFF) {
- len += 5;
- } else {
- len += 6;
- }
- }
- return len;
- }
- Module["lengthBytesUTF8"] = lengthBytesUTF8;
- // Given a pointer 'ptr' to a null-terminated UTF16LE-encoded string in the emscripten HEAP, returns
- // a copy of that string as a Javascript String object.
- var UTF16Decoder = typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-16le') : undefined;
- function UTF16ToString(ptr) {
- assert(ptr % 2 == 0, 'Pointer passed to UTF16ToString must be aligned to two bytes!');
- var endPtr = ptr;
- // TextDecoder needs to know the byte length in advance, it doesn't stop on null terminator by itself.
- // Also, use the length info to avoid running tiny strings through TextDecoder, since .subarray() allocates garbage.
- var idx = endPtr >> 1;
- while (HEAP16[idx]) ++idx;
- endPtr = idx << 1;
- if (endPtr - ptr > 32 && UTF16Decoder) {
- return UTF16Decoder.decode(HEAPU8.subarray(ptr, endPtr));
- } else {
- var i = 0;
- var str = '';
- while (1) {
- var codeUnit = HEAP16[(((ptr)+(i*2))>>1)];
- if (codeUnit == 0) return str;
- ++i;
- // fromCharCode constructs a character from a UTF-16 code unit, so we can pass the UTF16 string right through.
- str += String.fromCharCode(codeUnit);
- }
- }
- }
- // Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
- // null-terminated and encoded in UTF16 form. The copy will require at most str.length*4+2 bytes of space in the HEAP.
- // Use the function lengthBytesUTF16() to compute the exact number of bytes (excluding null terminator) that this function will write.
- // Parameters:
- // str: the Javascript string to copy.
- // outPtr: Byte address in Emscripten HEAP where to write the string to.
- // maxBytesToWrite: The maximum number of bytes this function can write to the array. This count should include the null
- // terminator, i.e. if maxBytesToWrite=2, only the null terminator will be written and nothing else.
- // maxBytesToWrite<2 does not write any bytes to the output, not even the null terminator.
- // Returns the number of bytes written, EXCLUDING the null terminator.
- function stringToUTF16(str, outPtr, maxBytesToWrite) {
- assert(outPtr % 2 == 0, 'Pointer passed to stringToUTF16 must be aligned to two bytes!');
- assert(typeof maxBytesToWrite == 'number', 'stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');
- // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed.
- if (maxBytesToWrite === undefined) {
- maxBytesToWrite = 0x7FFFFFFF;
- }
- if (maxBytesToWrite < 2) return 0;
- maxBytesToWrite -= 2; // Null terminator.
- var startPtr = outPtr;
- var numCharsToWrite = (maxBytesToWrite < str.length*2) ? (maxBytesToWrite / 2) : str.length;
- for (var i = 0; i < numCharsToWrite; ++i) {
- // charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP.
- var codeUnit = str.charCodeAt(i); // possibly a lead surrogate
- HEAP16[((outPtr)>>1)]=codeUnit;
- outPtr += 2;
- }
- // Null-terminate the pointer to the HEAP.
- HEAP16[((outPtr)>>1)]=0;
- return outPtr - startPtr;
- }
- // Returns the number of bytes the given Javascript string takes if encoded as a UTF16 byte array, EXCLUDING the null terminator byte.
- function lengthBytesUTF16(str) {
- return str.length*2;
- }
- function UTF32ToString(ptr) {
- assert(ptr % 4 == 0, 'Pointer passed to UTF32ToString must be aligned to four bytes!');
- var i = 0;
- var str = '';
- while (1) {
- var utf32 = HEAP32[(((ptr)+(i*4))>>2)];
- if (utf32 == 0)
- return str;
- ++i;
- // 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.
- // See http://unicode.org/faq/utf_bom.html#utf16-3
- if (utf32 >= 0x10000) {
- var ch = utf32 - 0x10000;
- str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));
- } else {
- str += String.fromCharCode(utf32);
- }
- }
- }
- // Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
- // null-terminated and encoded in UTF32 form. The copy will require at most str.length*4+4 bytes of space in the HEAP.
- // Use the function lengthBytesUTF32() to compute the exact number of bytes (excluding null terminator) that this function will write.
- // Parameters:
- // str: the Javascript string to copy.
- // outPtr: Byte address in Emscripten HEAP where to write the string to.
- // maxBytesToWrite: The maximum number of bytes this function can write to the array. This count should include the null
- // terminator, i.e. if maxBytesToWrite=4, only the null terminator will be written and nothing else.
- // maxBytesToWrite<4 does not write any bytes to the output, not even the null terminator.
- // Returns the number of bytes written, EXCLUDING the null terminator.
- function stringToUTF32(str, outPtr, maxBytesToWrite) {
- assert(outPtr % 4 == 0, 'Pointer passed to stringToUTF32 must be aligned to four bytes!');
- assert(typeof maxBytesToWrite == 'number', 'stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');
- // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed.
- if (maxBytesToWrite === undefined) {
- maxBytesToWrite = 0x7FFFFFFF;
- }
- if (maxBytesToWrite < 4) return 0;
- var startPtr = outPtr;
- var endPtr = startPtr + maxBytesToWrite - 4;
- for (var i = 0; i < str.length; ++i) {
- // 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.
- // See http://unicode.org/faq/utf_bom.html#utf16-3
- var codeUnit = str.charCodeAt(i); // possibly a lead surrogate
- if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) {
- var trailSurrogate = str.charCodeAt(++i);
- codeUnit = 0x10000 + ((codeUnit & 0x3FF) << 10) | (trailSurrogate & 0x3FF);
- }
- HEAP32[((outPtr)>>2)]=codeUnit;
- outPtr += 4;
- if (outPtr + 4 > endPtr) break;
- }
- // Null-terminate the pointer to the HEAP.
- HEAP32[((outPtr)>>2)]=0;
- return outPtr - startPtr;
- }
- // Returns the number of bytes the given Javascript string takes if encoded as a UTF16 byte array, EXCLUDING the null terminator byte.
- function lengthBytesUTF32(str) {
- var len = 0;
- for (var i = 0; i < str.length; ++i) {
- // 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.
- // See http://unicode.org/faq/utf_bom.html#utf16-3
- var codeUnit = str.charCodeAt(i);
- if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) ++i; // possibly a lead surrogate, so skip over the tail surrogate.
- len += 4;
- }
- return len;
- }
- function demangle(func) {
- var __cxa_demangle_func = Module['___cxa_demangle'] || Module['__cxa_demangle'];
- if (__cxa_demangle_func) {
- try {
- var s =
- func.substr(1);
- var len = lengthBytesUTF8(s)+1;
- var buf = _malloc(len);
- stringToUTF8(s, buf, len);
- var status = _malloc(4);
- var ret = __cxa_demangle_func(buf, 0, 0, status);
- if (getValue(status, 'i32') === 0 && ret) {
- return Pointer_stringify(ret);
- }
- // otherwise, libcxxabi failed
- } catch(e) {
- // ignore problems here
- } finally {
- if (buf) _free(buf);
- if (status) _free(status);
- if (ret) _free(ret);
- }
- // failure when using libcxxabi, don't demangle
- return func;
- }
- Runtime.warnOnce('warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling');
- return func;
- }
- function demangleAll(text) {
- var regex =
- /__Z[\w\d_]+/g;
- return text.replace(regex,
- function(x) {
- var y = demangle(x);
- return x === y ? x : (x + ' [' + y + ']');
- });
- }
- function jsStackTrace() {
- var err = new Error();
- if (!err.stack) {
- // IE10+ special cases: It does have callstack info, but it is only populated if an Error object is thrown,
- // so try that as a special-case.
- try {
- throw new Error(0);
- } catch(e) {
- err = e;
- }
- if (!err.stack) {
- return '(no stack trace available)';
- }
- }
- return err.stack.toString();
- }
- function stackTrace() {
- var js = jsStackTrace();
- if (Module['extraStackTrace']) js += '\n' + Module['extraStackTrace']();
- return demangleAll(js);
- }
- Module["stackTrace"] = stackTrace;
- // Memory management
- var PAGE_SIZE = 16384;
- var WASM_PAGE_SIZE = 65536;
- var ASMJS_PAGE_SIZE = 16777216;
- var MIN_TOTAL_MEMORY = 16777216;
- function alignUp(x, multiple) {
- if (x % multiple > 0) {
- x += multiple - (x % multiple);
- }
- return x;
- }
- var HEAP;
- var buffer;
- var HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;
- function updateGlobalBuffer(buf) {
- Module['buffer'] = buffer = buf;
- }
- function updateGlobalBufferViews() {
- Module['HEAP8'] = HEAP8 = new Int8Array(buffer);
- Module['HEAP16'] = HEAP16 = new Int16Array(buffer);
- Module['HEAP32'] = HEAP32 = new Int32Array(buffer);
- Module['HEAPU8'] = HEAPU8 = new Uint8Array(buffer);
- Module['HEAPU16'] = HEAPU16 = new Uint16Array(buffer);
- Module['HEAPU32'] = HEAPU32 = new Uint32Array(buffer);
- Module['HEAPF32'] = HEAPF32 = new Float32Array(buffer);
- Module['HEAPF64'] = HEAPF64 = new Float64Array(buffer);
- }
- var STATIC_BASE, STATICTOP, staticSealed; // static area
- var STACK_BASE, STACKTOP, STACK_MAX; // stack area
- var DYNAMIC_BASE, DYNAMICTOP_PTR; // dynamic area handled by sbrk
- 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
- STATIC_BASE = STATICTOP = STACK_BASE = STACKTOP = STACK_MAX = DYNAMIC_BASE = DYNAMICTOP_PTR = 0;
- staticSealed = false;
- }
- if (ENVIRONMENT_IS_PTHREAD) {
- staticSealed = true; // The static memory area has been initialized already in the main thread, pthreads skip this.
- }
- // Initializes the stack cookie. Called at the startup of main and at the startup of each thread in pthreads mode.
- function writeStackCookie() {
- assert((STACK_MAX & 3) == 0);
- HEAPU32[(STACK_MAX >> 2)-1] = 0x02135467;
- HEAPU32[(STACK_MAX >> 2)-2] = 0x89BACDFE;
- }
- function checkStackCookie() {
- if (HEAPU32[(STACK_MAX >> 2)-1] != 0x02135467 || HEAPU32[(STACK_MAX >> 2)-2] != 0x89BACDFE) {
- 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));
- }
- // 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.
- if (HEAP32[0] !== 0x63736d65 /* 'emsc' */) throw 'Runtime error: The application has corrupted its heap memory area (address zero)!';
- }
- function abortStackOverflow(allocSize) {
- abort('Stack overflow! Attempted to allocate ' + allocSize + ' bytes on the stack, but stack has only ' + (STACK_MAX - asm.stackSave() + allocSize) + ' bytes available!');
- }
- function abortOnCannotGrowMemory() {
- 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 ');
- }
- function enlargeMemory() {
- abort('Cannot enlarge memory arrays, since compiling with pthreads support enabled (-s USE_PTHREADS=1).');
- }
- var TOTAL_STACK = Module['TOTAL_STACK'] || 5242880;
- var TOTAL_MEMORY = Module['TOTAL_MEMORY'] || 16777216;
- if (TOTAL_MEMORY < TOTAL_STACK) Module.printErr('TOTAL_MEMORY should be larger than TOTAL_STACK, was ' + TOTAL_MEMORY + '! (TOTAL_STACK=' + TOTAL_STACK + ')');
- // Initialize the runtime's memory
- // check for full engine support (use string 'subarray' to avoid closure compiler confusion)
- assert(typeof Int32Array !== 'undefined' && typeof Float64Array !== 'undefined' && !!(new Int32Array(1)['subarray']) && !!(new Int32Array(1)['set']),
- 'JS engine does not provide full typed array support');
- if (typeof SharedArrayBuffer !== 'undefined') {
- if (!ENVIRONMENT_IS_PTHREAD) buffer = new SharedArrayBuffer(TOTAL_MEMORY);
- // Currently SharedArrayBuffer does not have a slice() operation, so polyfill it in.
- // Adapted from https://github.com/ttaubert/node-arraybuffer-slice, (c) 2014 Tim Taubert <[email protected]>
- // arraybuffer-slice may be freely distributed under the MIT license.
- (function (undefined) {
- "use strict";
- function clamp(val, length) {
- val = (val|0) || 0;
- if (val < 0) return Math.max(val + length, 0);
- return Math.min(val, length);
- }
- if (typeof SharedArrayBuffer !== 'undefined' && !SharedArrayBuffer.prototype.slice) {
- SharedArrayBuffer.prototype.slice = function (from, to) {
- var length = this.byteLength;
- var begin = clamp(from, length);
- var end = length;
- if (to !== undefined) end = clamp(to, length);
- if (begin > end) return new ArrayBuffer(0);
- var num = end - begin;
- var target = new ArrayBuffer(num);
- var targetArray = new Uint8Array(target);
- var sourceArray = new Uint8Array(this, begin, num);
- targetArray.set(sourceArray);
- return target;
- };
- }
- })();
- } else {
- if (!ENVIRONMENT_IS_PTHREAD) buffer = new ArrayBuffer(TOTAL_MEMORY);
- }
- updateGlobalBufferViews();
- if (typeof Atomics === 'undefined') {
- // Polyfill singlethreaded atomics ops from http://lars-t-hansen.github.io/ecmascript_sharedmem/shmem.html#Atomics.add
- // No thread-safety needed since we don't have multithreading support.
- Atomics = {};
- Atomics['add'] = function(t, i, v) { var w = t[i]; t[i] += v; return w; }
- Atomics['and'] = function(t, i, v) { var w = t[i]; t[i] &= v; return w; }
- Atomics['compareExchange'] = function(t, i, e, r) { var w = t[i]; if (w == e) t[i] = r; return w; }
- Atomics['exchange'] = function(t, i, v) { var w = t[i]; t[i] = v; return w; }
- Atomics['wait'] = function(t, i, v, o) { if (t[i] != v) return 'not-equal'; else return 'timed-out'; }
- Atomics['wake'] = function(t, i, c) { return 0; }
- Atomics['wakeOrRequeue'] = function(t, i1, c, i2, v) { return 0; }
- Atomics['isLockFree'] = function(s) { return true; }
- Atomics['load'] = function(t, i) { return t[i]; }
- Atomics['or'] = function(t, i, v) { var w = t[i]; t[i] |= v; return w; }
- Atomics['store'] = function(t, i, v) { t[i] = v; return v; }
- Atomics['sub'] = function(t, i, v) { var w = t[i]; t[i] -= v; return w; }
- Atomics['xor'] = function(t, i, v) { var w = t[i]; t[i] ^= v; return w; }
- }
- function getTotalMemory() {
- return TOTAL_MEMORY;
- }
- // Endianness check (note: assumes compiler arch was little-endian)
- if (!ENVIRONMENT_IS_PTHREAD) {
- HEAP32[0] = 0x63736d65; /* 'emsc' */
- } else {
- if (HEAP32[0] !== 0x63736d65) throw 'Runtime error: The application has corrupted its heap memory area (address zero)!';
- }
- HEAP16[1] = 0x6373;
- if (HEAPU8[2] !== 0x73 || HEAPU8[3] !== 0x63) throw 'Runtime error: expected the system to be little-endian!';
- Module['HEAP'] = HEAP;
- Module['buffer'] = buffer;
- Module['HEAP8'] = HEAP8;
- Module['HEAP16'] = HEAP16;
- Module['HEAP32'] = HEAP32;
- Module['HEAPU8'] = HEAPU8;
- Module['HEAPU16'] = HEAPU16;
- Module['HEAPU32'] = HEAPU32;
- Module['HEAPF32'] = HEAPF32;
- Module['HEAPF64'] = HEAPF64;
- function callRuntimeCallbacks(callbacks) {
- while(callbacks.length > 0) {
- var callback = callbacks.shift();
- if (typeof callback == 'function') {
- callback();
- continue;
- }
- var func = callback.func;
- if (typeof func === 'number') {
- if (callback.arg === undefined) {
- Module['dynCall_v'](func);
- } else {
- Module['dynCall_vi'](func, callback.arg);
- }
- } else {
- func(callback.arg === undefined ? null : callback.arg);
- }
- }
- }
- var __ATPRERUN__ = []; // functions called before the runtime is initialized
- var __ATINIT__ = []; // functions called during startup
- var __ATMAIN__ = []; // functions called when main() is to be run
- var __ATEXIT__ = []; // functions called during shutdown
- var __ATPOSTRUN__ = []; // functions called after the runtime has exited
- var runtimeInitialized = false;
- var runtimeExited = false;
- 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.
- function preRun() {
- if (ENVIRONMENT_IS_PTHREAD) return; // PThreads reuse the runtime from the main thread.
- // compatibility - merge in anything from Module['preRun'] at this time
- if (Module['preRun']) {
- if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']];
- while (Module['preRun'].length) {
- addOnPreRun(Module['preRun'].shift());
- }
- }
- callRuntimeCallbacks(__ATPRERUN__);
- }
- function ensureInitRuntime() {
- checkStackCookie();
- if (ENVIRONMENT_IS_PTHREAD) return; // PThreads reuse the runtime from the main thread.
- if (runtimeInitialized) return;
- runtimeInitialized = true;
- callRuntimeCallbacks(__ATINIT__);
- }
- function preMain() {
- checkStackCookie();
- if (ENVIRONMENT_IS_PTHREAD) return; // PThreads reuse the runtime from the main thread.
- callRuntimeCallbacks(__ATMAIN__);
- }
- function exitRuntime() {
- checkStackCookie();
- if (ENVIRONMENT_IS_PTHREAD) return; // PThreads reuse the runtime from the main thread.
- callRuntimeCallbacks(__ATEXIT__);
- runtimeExited = true;
- }
- function postRun() {
- checkStackCookie();
- if (ENVIRONMENT_IS_PTHREAD) return; // PThreads reuse the runtime from the main thread.
- // compatibility - merge in anything from Module['postRun'] at this time
- if (Module['postRun']) {
- if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']];
- while (Module['postRun'].length) {
- addOnPostRun(Module['postRun'].shift());
- }
- }
- callRuntimeCallbacks(__ATPOSTRUN__);
- }
- function addOnPreRun(cb) {
- __ATPRERUN__.unshift(cb);
- }
- Module["addOnPreRun"] = addOnPreRun;
- function addOnInit(cb) {
- __ATINIT__.unshift(cb);
- }
- Module["addOnInit"] = addOnInit;
- function addOnPreMain(cb) {
- __ATMAIN__.unshift(cb);
- }
- Module["addOnPreMain"] = addOnPreMain;
- function addOnExit(cb) {
- __ATEXIT__.unshift(cb);
- }
- Module["addOnExit"] = addOnExit;
- function addOnPostRun(cb) {
- __ATPOSTRUN__.unshift(cb);
- }
- Module["addOnPostRun"] = addOnPostRun;
- // Tools
- function intArrayFromString(stringy, dontAddNull, length /* optional */) {
- var len = length > 0 ? length : lengthBytesUTF8(stringy)+1;
- var u8array = new Array(len);
- var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length);
- if (dontAddNull) u8array.length = numBytesWritten;
- return u8array;
- }
- Module["intArrayFromString"] = intArrayFromString;
- function intArrayToString(array) {
- var ret = [];
- for (var i = 0; i < array.length; i++) {
- var chr = array[i];
- if (chr > 0xFF) {
- assert(false, 'Character code ' + chr + ' (' + String.fromCharCode(chr) + ') at offset ' + i + ' not in 0x00-0xFF.');
- chr &= 0xFF;
- }
- ret.push(String.fromCharCode(chr));
- }
- return ret.join('');
- }
- Module["intArrayToString"] = intArrayToString;
- // Deprecated: This function should not be called because it is unsafe and does not provide
- // a maximum length limit of how many bytes it is allowed to write. Prefer calling the
- // function stringToUTF8Array() instead, which takes in a maximum length that can be used
- // to be secure from out of bounds writes.
- function writeStringToMemory(string, buffer, dontAddNull) {
- Runtime.warnOnce('writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!');
- var lastChar, end;
- if (dontAddNull) {
- // stringToUTF8Array always appends null. If we don't want to do that, remember the
- // character that existed at the location where the null will be placed, and restore
- // that after the write (below).
- end = buffer + lengthBytesUTF8(string);
- lastChar = HEAP8[end];
- }
- stringToUTF8(string, buffer, Infinity);
- if (dontAddNull) HEAP8[end] = lastChar; // Restore the value under the null character.
- }
- Module["writeStringToMemory"] = writeStringToMemory;
- function writeArrayToMemory(array, buffer) {
- assert(array.length >= 0, 'writeArrayToMemory array must have a length (should be an array or typed array)')
- HEAP8.set(array, buffer);
- }
- Module["writeArrayToMemory"] = writeArrayToMemory;
- function writeAsciiToMemory(str, buffer, dontAddNull) {
- for (var i = 0; i < str.length; ++i) {
- assert(str.charCodeAt(i) === str.charCodeAt(i)&0xff);
- HEAP8[((buffer++)>>0)]=str.charCodeAt(i);
- }
- // Null-terminate the pointer to the HEAP.
- if (!dontAddNull) HEAP8[((buffer)>>0)]=0;
- }
- Module["writeAsciiToMemory"] = writeAsciiToMemory;
- function unSign(value, bits, ignore) {
- if (value >= 0) {
- return value;
- }
- 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
- : Math.pow(2, bits) + value;
- }
- function reSign(value, bits, ignore) {
- if (value <= 0) {
- return value;
- }
- var half = bits <= 32 ? Math.abs(1 << (bits-1)) // abs is needed if bits == 32
- : Math.pow(2, bits-1);
- 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
- // but, in general there is no perfect solution here. With 64-bit ints, we get rounding and errors
- // TODO: In i64 mode 1, resign the two parts separately and safely
- value = -2*half + value; // Cannot bitshift half, as it may be at the limit of the bits JS uses in bitshifts
- }
- return value;
- }
- // Atomics.exchange is not yet implemented in the spec, so polyfill that in via compareExchange in the meanwhile.
- // TODO: Keep an eye out for the opportunity to remove this once Atomics.exchange is available.
- if (typeof Atomics !== 'undefined' && !Atomics['exchange']) {
- Atomics['exchange'] = function(heap, index, val) {
- var oldVal, oldVal2;
- do {
- oldVal = Atomics['load'](heap, index);
- oldVal2 = Atomics['compareExchange'](heap, index, oldVal, val);
- } while(oldVal != oldVal2);
- return oldVal;
- }
- }
- // check for imul support, and also for correctness ( https://bugs.webkit.org/show_bug.cgi?id=126345 )
- if (!Math['imul'] || Math['imul'](0xffffffff, 5) !== -5) Math['imul'] = function imul(a, b) {
- var ah = a >>> 16;
- var al = a & 0xffff;
- var bh = b >>> 16;
- var bl = b & 0xffff;
- return (al*bl + ((ah*bl + al*bh) << 16))|0;
- };
- Math.imul = Math['imul'];
- if (!Math['clz32']) Math['clz32'] = function(x) {
- x = x >>> 0;
- for (var i = 0; i < 32; i++) {
- if (x & (1 << (31 - i))) return i;
- }
- return 32;
- };
- Math.clz32 = Math['clz32']
- if (!Math['trunc']) Math['trunc'] = function(x) {
- return x < 0 ? Math.ceil(x) : Math.floor(x);
- };
- Math.trunc = Math['trunc'];
- var Math_abs = Math.abs;
- var Math_cos = Math.cos;
- var Math_sin = Math.sin;
- var Math_tan = Math.tan;
- var Math_acos = Math.acos;
- var Math_asin = Math.asin;
- var Math_atan = Math.atan;
- var Math_atan2 = Math.atan2;
- var Math_exp = Math.exp;
- var Math_log = Math.log;
- var Math_sqrt = Math.sqrt;
- var Math_ceil = Math.ceil;
- var Math_floor = Math.floor;
- var Math_pow = Math.pow;
- var Math_imul = Math.imul;
- var Math_fround = Math.fround;
- var Math_round = Math.round;
- var Math_min = Math.min;
- var Math_clz32 = Math.clz32;
- var Math_trunc = Math.trunc;
- // A counter of dependencies for calling run(). If we need to
- // do asynchronous work before running, increment this and
- // decrement it. Incrementing must happen in a place like
- // PRE_RUN_ADDITIONS (used by emcc to add file preloading).
- // Note that you can add dependencies in preRun, even though
- // it happens right before run - run will be postponed until
- // the dependencies are met.
- var runDependencies = 0;
- var runDependencyWatcher = null;
- var dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled
- var runDependencyTracking = {};
- function getUniqueRunDependency(id) {
- var orig = id;
- while (1) {
- if (!runDependencyTracking[id]) return id;
- id = orig + Math.random();
- }
- return id;
- }
- function addRunDependency(id) {
- // 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,
- // so good to be very explicit)
- assert(!ENVIRONMENT_IS_PTHREAD);
- runDependencies++;
- if (Module['monitorRunDependencies']) {
- Module['monitorRunDependencies'](runDependencies);
- }
- if (id) {
- assert(!runDependencyTracking[id]);
- runDependencyTracking[id] = 1;
- if (runDependencyWatcher === null && typeof setInterval !== 'undefined') {
- // Check for missing dependencies every few seconds
- runDependencyWatcher = setInterval(function() {
- if (ABORT) {
- clearInterval(runDependencyWatcher);
- runDependencyWatcher = null;
- return;
- }
- var shown = false;
- for (var dep in runDependencyTracking) {
- if (!shown) {
- shown = true;
- Module.printErr('still waiting on run dependencies:');
- }
- Module.printErr('dependency: ' + dep);
- }
- if (shown) {
- Module.printErr('(end of list)');
- }
- }, 10000);
- }
- } else {
- Module.printErr('warning: run dependency added without ID');
- }
- }
- Module["addRunDependency"] = addRunDependency;
- function removeRunDependency(id) {
- runDependencies--;
- if (Module['monitorRunDependencies']) {
- Module['monitorRunDependencies'](runDependencies);
- }
- if (id) {
- assert(runDependencyTracking[id]);
- delete runDependencyTracking[id];
- } else {
- Module.printErr('warning: run dependency removed without ID');
- }
- if (runDependencies == 0) {
- if (runDependencyWatcher !== null) {
- clearInterval(runDependencyWatcher);
- runDependencyWatcher = null;
- }
- if (dependenciesFulfilled) {
- var callback = dependenciesFulfilled;
- dependenciesFulfilled = null;
- callback(); // can add another dependenciesFulfilled
- }
- }
- }
- Module["removeRunDependency"] = removeRunDependency;
- Module["preloadedImages"] = {}; // maps url to image data
- Module["preloadedAudios"] = {}; // maps url to audio data
- var memoryInitializer = null;
- // === Body ===
- var ASM_CONSTS = [function($0, $1) { { Module.printErr('bad name in getProcAddress: ' + [Pointer_stringify($0), Pointer_stringify($1)]); } },
- function() { postMessage({ cmd: 'processQueuedMainThreadWork' }) }];
- function _emscripten_asm_const_iii(code, a0, a1) {
- return ASM_CONSTS[code](a0, a1);
- }
- function _emscripten_asm_const_v(code) {
- return ASM_CONSTS[code]();
- }
- STATIC_BASE = 8;
- STATICTOP = STATIC_BASE + 38336;
- /* global initializers */ if (!ENVIRONMENT_IS_PTHREAD) __ATINIT__.push({ func: function() { ___emscripten_pthread_data_constructor() } });
-
- if (!ENVIRONMENT_IS_PTHREAD) {
- /* 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,191,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,109,111,118,101,109,101,110,116,0,80,104,121,115,97,99,0,85,115,101,32,39,65,82,82,79,87,83,39,32,116,111,32,109,111,118,101,32,112,108,97,121,101,114,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], "i8", ALLOC_NONE, Runtime.GLOBAL_BASE);
- /* memory initializer */ allocate([97,100,101,114,66,105,110,97,114,121,0,103,108,82,101,108,101,97,115,101,83,104,97,100,101,114,67,111,109,112,105,108,101,114,0,103,108,71,101,116,69,114,114,111,114,0,103,108,86,101,114,116,101,120,65,116,116,114,105,98,68,105,118,105,115,111,114,0,103,108,68,114,97,119,65,114,114,97,121,115,73,110,115,116,97,110,99,101,100,0,103,108,68,114,97,119,69,108,101,109,101,110,116,115,73,110,115,116,97,110,99,101,100,0,103,108,70,105,110,105,115,104,0,103,108,70,108,117,115,104,0,103,108,67,108,101,97,114,68,101,112,116,104,0,103,108,67,108,101,97,114,68,101,112,116,104,102,0,103,108,68,101,112,116,104,70,117,110,99,0,103,108,69,110,97,98,108,101,0,103,108,68,105,115,97,98,108,101,0,103,108,70,114,111,110,116,70,97,99,101,0,103,108,67,117,108,108,70,97,99,101,0,103,108,67,108,101,97,114,0,103,108,76,105,110,101,87,105,100,116,104,0,103,108,67,108,101,97,114,83,116,101,110,99,105,108,0,103,108,68,101,112,116,104,77,97,115,107,0,103,108,83,116,101,110,99,105,108,77,97,115,107,0,103,108,67,104,101,99,107,70,114,97,109,101,98,117,102,102,101,114,83,116,97,116,117,115,0,103,108,71,101,110,101,114,97,116,101,77,105,112,109,97,112,0,103,108,65,99,116,105,118,101,84,101,120,116,117,114,101,0,103,108,66,108,101,110,100,69,113,117,97,116,105,111,110,0,103,108,73,115,69,110,97,98,108,101,100,0,103,108,66,108,101,110,100,70,117,110,99,0,103,108,66,108,101,110,100,69,113,117,97,116,105,111,110,83,101,112,97,114,97,116,101,0,103,108,68,101,112,116,104,82,97,110,103,101,0,103,108,68,101,112,116,104,82,97,110,103,101,102,0,103,108,83,116,101,110,99,105,108,77,97,115,107,83,101,112,97,114,97,116,101,0,103,108,72,105,110,116,0,103,108,80,111,108,121,103,111,110,79,102,102,115,101,116,0,103,108,86,101,114,116,101,120,65,116,116,114,105,98,49,102,0,103,108,83,97,109,112,108,101,67,111,118,101,114,97,103,101,0,103,108,84,101,120,80,97,114,97,109,101,116,101,114,105,0,103,108,84,101,120,80,97,114,97,109,101,116,101,114,102,0,103,108,86,101,114,116,101,120,65,116,116,114,105,98,50,102,0,103,108,83,116,101,110,99,105,108,70,117,110,99,0,103,108,83,116,101,110,99,105,108,79,112,0,103,108,86,105,101,119,112,111,114,116,0,103,108,67,108,101,97,114,67,111,108,111,114,0,103,108,83,99,105,115,115,111,114,0,103,108,86,101,114,116,101,120,65,116,116,114,105,98,51,102,0,103,108,67,111,108,111,114,77,97,115,107,0,103,108,82,101,110,100,101,114,98,117,102,102,101,114,83,116,111,114,97,103,101,0,103,108,66,108,101,110,100,70,117,110,99,83,101,112,97,114,97,116,101,0,103,108,66,108,101,110,100,67,111,108,111,114,0,103,108,83,116,101,110,99,105,108,70,117,110,99,83,101,112,97,114,97,116,101,0,103,108,83,116,101,110,99,105,108,79,112,83,101,112,97,114,97,116,101,0,103,108,86,101,114,116,101,120,65,116,116,114,105,98,52,102,0,103,108,67,111,112,121,84,101,120,73,109,97,103,101,50,68,0,103,108,67,111,112,121,84,101,120,83,117,98,73,109,97,103,101,50,68,0,103,108,68,114,97,119,66,117,102,102,101,114,115,0,123,32,77,111,100,117,108,101,46,112,114,105,110,116,69,114,114,40,39,98,97,100,32,110,97,109,101,32,105,110,32,103,101,116,80,114,111,99,65,100,100,114,101,115,115,58,32,39,32,43,32,91,80,111,105,110,116,101,114,95,115,116,114,105,110,103,105,102,121,40,36,48,41,44,32,80,111,105,110,116,101,114,95,115,116,114,105,110,103,105,102,121,40,36,49,41,93,41,59,32,125,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,46,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,101,109,115,99,114,105,112,116,101,110,95,105,115,95,109,97,105,110,95,114,117,110,116,105,109,101,95,116,104,114,101,97,100,40,41,32,38,38,32,34,101,109,115,99,114,105,112,116,101,110,95,109,97,105,110,95,116,104,114,101,97,100,95,112,114,111,99,101,115,115,95,113,117,101,117,101,100,95,99,97,108,108,115,32,109,117,115,116,32,98,101,32,99,97,108,108,101,100,32,102,114,111,109,32,116,104,101,32,109,97,105,110,32,116,104,114,101,97,100,33,34,0,67,58,92,101,109,115,100,107,92,101,109,115,99,114,105,112,116,101,110,92,49,46,51,55,46,57,92,115,121,115,116,101,109,92,108,105,98,92,112,116,104,114,101,97,100,92,108,105,98,114,97,114,121,95,112,116,104,114,101,97,100,46,99,0,101,109,115,99,114,105,112,116,101,110,95,109,97,105,110,95,116,104,114,101,97,100,95,112,114,111,99,101,115,115,95,113,117,101,117,101,100,95,99,97,108,108,115,0,48,32,38,38,32,34,73,110,118,97,108,105,100,32,69,109,115,99,114,105,112,116,101,110,32,112,116,104,114,101,97,100,32,95,100,111,95,99,97,108,108,32,111,112,99,111,100,101,33,34,0,95,100,111,95,99,97,108,108,0,99,97,108,108,0,101,109,115,99,114,105,112,116,101,110,95,97,115,121,110,99,95,114,117,110,95,105,110,95,109,97,105,110,95,116,104,114,101,97,100,0,112,111,115,116,77,101,115,115,97,103,101,40,123,32,99,109,100,58,32,39,112,114,111,99,101,115,115,81,117,101,117,101,100,77,97,105,110,84,104,114,101,97,100,87,111,114,107,39,32,125,41,0], "i8", ALLOC_NONE, Runtime.GLOBAL_BASE+10240);
- }
- /* no memory initializer */
- var tempDoublePtr;
- if (!ENVIRONMENT_IS_PTHREAD) tempDoublePtr = Runtime.alignMemory(allocate(12, "i8", ALLOC_STATIC), 8);
- assert(tempDoublePtr % 8 == 0);
- function copyTempFloat(ptr) { // functions, because inlining this code increases code size too much
- HEAP8[tempDoublePtr] = HEAP8[ptr];
- HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];
- HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];
- HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];
- }
- function copyTempDouble(ptr) {
- HEAP8[tempDoublePtr] = HEAP8[ptr];
- HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];
- HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];
- HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];
- HEAP8[tempDoublePtr+4] = HEAP8[ptr+4];
- HEAP8[tempDoublePtr+5] = HEAP8[ptr+5];
- HEAP8[tempDoublePtr+6] = HEAP8[ptr+6];
- HEAP8[tempDoublePtr+7] = HEAP8[ptr+7];
- }
- // {{PRE_LIBRARY}}
-
- 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 () {
- GL.miniTempBuffer = new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);
- for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) {
- GL.miniTempBufferViews[i] = GL.miniTempBuffer.subarray(0, i+1);
- }
-
- // For functions such as glDrawBuffers, glInvalidateFramebuffer and glInvalidateSubFramebuffer that need to pass a short array to the WebGL API,
- // create a set of short fixed-length arrays to avoid having to generate any garbage when calling those functions.
- for (var i = 0; i < 32; i++) {
- GL.tempFixedLengthArray.push(new Array(i));
- }
- },recordError:function recordError(errorCode) {
- if (!GL.lastError) {
- GL.lastError = errorCode;
- }
- },getNewId:function (table) {
- var ret = GL.counter++;
- for (var i = table.length; i < ret; i++) {
- table[i] = null;
- }
- return ret;
- },MINI_TEMP_BUFFER_SIZE:256,miniTempBuffer:null,miniTempBufferViews:[0],getSource:function (shader, count, string, length) {
- var source = '';
- for (var i = 0; i < count; ++i) {
- var frag;
- if (length) {
- var len = HEAP32[(((length)+(i*4))>>2)];
- if (len < 0) {
- frag = Pointer_stringify(HEAP32[(((string)+(i*4))>>2)]);
- } else {
- frag = Pointer_stringify(HEAP32[(((string)+(i*4))>>2)], len);
- }
- } else {
- frag = Pointer_stringify(HEAP32[(((string)+(i*4))>>2)]);
- }
- source += frag;
- }
- return source;
- },createContext:function (canvas, webGLContextAttributes) {
- if (typeof webGLContextAttributes['majorVersion'] === 'undefined' && typeof webGLContextAttributes['minorVersion'] === 'undefined') {
- webGLContextAttributes['majorVersion'] = 1;
- webGLContextAttributes['minorVersion'] = 0;
- }
- var ctx;
- var errorInfo = '?';
- function onContextCreationError(event) {
- errorInfo = event.statusMessage || errorInfo;
- }
- try {
- canvas.addEventListener('webglcontextcreationerror', onContextCreationError, false);
- try {
- if (webGLContextAttributes['majorVersion'] == 1 && webGLContextAttributes['minorVersion'] == 0) {
- ctx = canvas.getContext("webgl", webGLContextAttributes) || canvas.getContext("experimental-webgl", webGLContextAttributes);
- } else if (webGLContextAttributes['majorVersion'] == 2 && webGLContextAttributes['minorVersion'] == 0) {
- ctx = canvas.getContext("webgl2", webGLContextAttributes) || canvas.getContext("experimental-webgl2", webGLContextAttributes);
- } else {
- throw 'Unsupported WebGL context version ' + majorVersion + '.' + minorVersion + '!'
- }
- } finally {
- canvas.removeEventListener('webglcontextcreationerror', onContextCreationError, false);
- }
- if (!ctx) throw ':(';
- } catch (e) {
- Module.print('Could not create canvas: ' + [errorInfo, e, JSON.stringify(webGLContextAttributes)]);
- return 0;
- }
- // possible GL_DEBUG entry point: ctx = wrapDebugGL(ctx);
-
- if (!ctx) return 0;
- return GL.registerContext(ctx, webGLContextAttributes);
- },registerContext:function (ctx, webGLContextAttributes) {
- var handle = GL.getNewId(GL.contexts);
- var context = {
- handle: handle,
- attributes: webGLContextAttributes,
- version: webGLContextAttributes['majorVersion'],
- GLctx: ctx
- };
-
-
- // Store the created context object so that we can access the context given a canvas without having to pass the parameters again.
- if (ctx.canvas) ctx.canvas.GLctxObject = context;
- GL.contexts[handle] = context;
- if (typeof webGLContextAttributes['enableExtensionsByDefault'] === 'undefined' || webGLContextAttributes['enableExtensionsByDefault']) {
- GL.initExtensions(context);
- }
- return handle;
- },makeContextCurrent:function (contextHandle) {
- var context = GL.contexts[contextHandle];
- if (!context) return false;
- GLctx = Module.ctx = context.GLctx; // Active WebGL context object.
- GL.currentContext = context; // Active Emscripten GL layer context object.
- return true;
- },getContext:function (contextHandle) {
- return GL.contexts[contextHandle];
- },deleteContext:function (contextHandle) {
- if (GL.currentContext === GL.contexts[contextHandle]) GL.currentContext = null;
- 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.
- 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.
- GL.contexts[contextHandle] = null;
- },initExtensions:function (context) {
- // If this function is called without a specific context object, init the extensions of the currently active context.
- if (!context) context = GL.currentContext;
-
- if (context.initExtensionsDone) return;
- context.initExtensionsDone = true;
-
- var GLctx = context.GLctx;
-
- context.maxVertexAttribs = GLctx.getParameter(GLctx.MAX_VERTEX_ATTRIBS);
-
- // Detect the presence of a few extensions manually, this GL interop layer itself will need to know if they exist.
-
- if (context.version < 2) {
- // Extension available from Firefox 26 and Google Chrome 30
- var instancedArraysExt = GLctx.getExtension('ANGLE_instanced_arrays');
- if (instancedArraysExt) {
- GLctx['vertexAttribDivisor'] = function(index, divisor) { instancedArraysExt['vertexAttribDivisorANGLE'](index, divisor); };
- GLctx['drawArraysInstanced'] = function(mode, first, count, primcount) { instancedArraysExt['drawArraysInstancedANGLE'](mode, first, count, primcount); };
- GLctx['drawElementsInstanced'] = function(mode, count, type, indices, primcount) { instancedArraysExt['drawElementsInstancedANGLE'](mode, count, type, indices, primcount); };
- }
-
- // Extension available from Firefox 25 and WebKit
- var vaoExt = GLctx.getExtension('OES_vertex_array_object');
- if (vaoExt) {
- GLctx['createVertexArray'] = function() { return vaoExt['createVertexArrayOES'](); };
- GLctx['deleteVertexArray'] = function(vao) { vaoExt['deleteVertexArrayOES'](vao); };
- GLctx['bindVertexArray'] = function(vao) { vaoExt['bindVertexArrayOES'](vao); };
- GLctx['isVertexArray'] = function(vao) { return vaoExt['isVertexArrayOES'](vao); };
- }
-
- var drawBuffersExt = GLctx.getExtension('WEBGL_draw_buffers');
- if (drawBuffersExt) {
- GLctx['drawBuffers'] = function(n, bufs) { drawBuffersExt['drawBuffersWEBGL'](n, bufs); };
- }
- }
-
- GLctx.disjointTimerQueryExt = GLctx.getExtension("EXT_disjoint_timer_query");
-
- // These are the 'safe' feature-enabling extensions that don't add any performance impact related to e.g. debugging, and
- // should be enabled by default so that client GLES2/GL code will not need to go through extra hoops to get its stuff working.
- // As new extensions are ratified at http://www.khronos.org/registry/webgl/extensions/ , feel free to add your new extensions
- // here, as long as they don't produce a performance impact for users that might not be using those extensions.
- // E.g. debugging-related extensions should probably be off by default.
- var automaticallyEnabledExtensions = [ "OES_texture_float", "OES_texture_half_float", "OES_standard_derivatives",
- "OES_vertex_array_object", "WEBGL_compressed_texture_s3tc", "WEBGL_depth_texture",
- "OES_element_index_uint", "EXT_texture_filter_anisotropic", "ANGLE_instanced_arrays",
- "OES_texture_float_linear", "OES_texture_half_float_linear", "WEBGL_compressed_texture_atc",
- "WEBGL_compressed_texture_pvrtc", "EXT_color_buffer_half_float", "WEBGL_color_buffer_float",
- "EXT_frag_depth", "EXT_sRGB", "WEBGL_draw_buffers", "WEBGL_shared_resources",
- "EXT_shader_texture_lod", "EXT_color_buffer_float"];
-
- function shouldEnableAutomatically(extension) {
- var ret = false;
- automaticallyEnabledExtensions.forEach(function(include) {
- if (ext.indexOf(include) != -1) {
- ret = true;
- }
- });
- return ret;
- }
-
- var exts = GLctx.getSupportedExtensions();
- if (exts && exts.length > 0) {
- GLctx.getSupportedExtensions().forEach(function(ext) {
- if (automaticallyEnabledExtensions.indexOf(ext) != -1) {
- GLctx.getExtension(ext); // Calling .getExtension enables that extension permanently, no need to store the return value to be enabled.
- }
- });
- }
- },populateUniformTable:function (program) {
- var p = GL.programs[program];
- GL.programInfos[program] = {
- uniforms: {},
- maxUniformLength: 0, // This is eagerly computed below, since we already enumerate all uniforms anyway.
- maxAttributeLength: -1, // This is lazily computed and cached, computed when/if first asked, "-1" meaning not computed yet.
- maxUniformBlockNameLength: -1 // Lazily computed as well
- };
-
- var ptable = GL.programInfos[program];
- var utable = ptable.uniforms;
- // A program's uniform table maps the string name of an uniform to an integer location of that uniform.
- // The global GL.uniforms map maps integer locations to WebGLUniformLocations.
- var numUniforms = GLctx.getProgramParameter(p, GLctx.ACTIVE_UNIFORMS);
- for (var i = 0; i < numUniforms; ++i) {
- var u = GLctx.getActiveUniform(p, i);
-
- var name = u.name;
- ptable.maxUniformLength = Math.max(ptable.maxUniformLength, name.length+1);
-
- // Strip off any trailing array specifier we might have got, e.g. "[0]".
- if (name.indexOf(']', name.length-1) !== -1) {
- var ls = name.lastIndexOf('[');
- name = name.slice(0, ls);
- }
-
- // Optimize memory usage slightly: If we have an array of uniforms, e.g. 'vec3 colors[3];', then
- // only store the string 'colors' in utable, and 'colors[0]', 'colors[1]' and 'colors[2]' will be parsed as 'colors'+i.
- // Note that for the GL.uniforms table, we still need to fetch the all WebGLUniformLocations for all the indices.
- var loc = GLctx.getUniformLocation(p, name);
- if (loc != null)
- {
- var id = GL.getNewId(GL.uniforms);
- utable[name] = [u.size, id];
- GL.uniforms[id] = loc;
-
- for (var j = 1; j < u.size; ++j) {
- var n = name + '['+j+']';
- loc = GLctx.getUniformLocation(p, n);
- id = GL.getNewId(GL.uniforms);
-
- GL.uniforms[id] = loc;
- }
- }
- }
- }};function _emscripten_glIsRenderbuffer(renderbuffer) {
- var rb = GL.renderbuffers[renderbuffer];
- if (!rb) return 0;
- return GLctx.isRenderbuffer(rb);
- }
- function _emscripten_glStencilMaskSeparate(x0, x1) { GLctx['stencilMaskSeparate'](x0, x1) }
- function ___pthread_setcancelstate() { return 0 }
-
-
- function _emscripten_get_now() { abort() }
-
-
-
- function _emscripten_set_main_loop_timing(mode, value) {
- Browser.mainLoop.timingMode = mode;
- Browser.mainLoop.timingValue = value;
-
- if (!Browser.mainLoop.func) {
- 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.');
- return 1; // Return non-zero on failure, can't set timing mode when there is no main loop.
- }
-
- if (mode == 0 /*EM_TIMING_SETTIMEOUT*/) {
- Browser.mainLoop.scheduler = function Browser_mainLoop_scheduler_setTimeout() {
- var timeUntilNextTick = Math.max(0, Browser.mainLoop.tickStartTime + value - _emscripten_get_now())|0;
- setTimeout(Browser.mainLoop.runner, timeUntilNextTick); // doing this each time means that on exception, we stop
- };
- Browser.mainLoop.method = 'timeout';
- } else if (mode == 1 /*EM_TIMING_RAF*/) {
- Browser.mainLoop.scheduler = function Browser_mainLoop_scheduler_rAF() {
- Browser.requestAnimationFrame(Browser.mainLoop.runner);
- };
- Browser.mainLoop.method = 'rAF';
- } else if (mode == 2 /*EM_TIMING_SETIMMEDIATE*/) {
- if (!window['setImmediate']) {
- // Emulate setImmediate. (note: not a complete polyfill, we don't emulate clearImmediate() to keep code size to minimum, since not needed)
- var setImmediates = [];
- var emscriptenMainLoopMessageId = 'setimmediate';
- function Browser_setImmediate_messageHandler(event) {
- if (event.source === window && event.data === emscriptenMainLoopMessageId) {
- event.stopPropagation();
- setImmediates.shift()();
- }
- }
- window.addEventListener("message", Browser_setImmediate_messageHandler, true);
- window['setImmediate'] = function Browser_emulated_setImmediate(func) {
- setImmediates.push(func);
- if (ENVIRONMENT_IS_WORKER) {
- if (Module['setImmediates'] === undefined) Module['setImmediates'] = [];
- Module['setImmediates'].push(func);
- window.postMessage({target: emscriptenMainLoopMessageId}); // In --proxy-to-worker, route the message via proxyClient.js
- } else window.postMessage(emscriptenMainLoopMessageId, "*"); // On the main thread, can just send the message to itself.
- }
- }
- Browser.mainLoop.scheduler = function Browser_mainLoop_scheduler_setImmediate() {
- window['setImmediate'](Browser.mainLoop.runner);
- };
- Browser.mainLoop.method = 'immediate';
- }
- return 0;
- }function _emscripten_set_main_loop(func, fps, simulateInfiniteLoop, arg, noSetTiming) {
- Module['noExitRuntime'] = true;
-
- 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.');
-
- Browser.mainLoop.func = func;
- Browser.mainLoop.arg = arg;
-
- var browserIterationFunc;
- if (typeof arg !== 'undefined') {
- browserIterationFunc = function() {
- Module['dynCall_vi'](func, arg);
- };
- } else {
- browserIterationFunc = function() {
- Module['dynCall_v'](func);
- };
- }
-
- var thisMainLoopId = Browser.mainLoop.currentlyRunningMainloop;
-
- Browser.mainLoop.runner = function Browser_mainLoop_runner() {
- if (ABORT) return;
- if (Browser.mainLoop.queue.length > 0) {
- var start = Date.now();
- var blocker = Browser.mainLoop.queue.shift();
- blocker.func(blocker.arg);
- if (Browser.mainLoop.remainingBlockers) {
- var remaining = Browser.mainLoop.remainingBlockers;
- var next = remaining%1 == 0 ? remaining-1 : Math.floor(remaining);
- if (blocker.counted) {
- Browser.mainLoop.remainingBlockers = next;
- } else {
- // not counted, but move the progress along a tiny bit
- next = next + 0.5; // do not steal all the next one's progress
- Browser.mainLoop.remainingBlockers = (8*remaining + next)/9;
- }
- }
- console.log('main loop blocker "' + blocker.name + '" took ' + (Date.now() - start) + ' ms'); //, left: ' + Browser.mainLoop.remainingBlockers);
- Browser.mainLoop.updateStatus();
-
- // catches pause/resume main loop from blocker execution
- if (thisMainLoopId < Browser.mainLoop.currentlyRunningMainloop) return;
-
- setTimeout(Browser.mainLoop.runner, 0);
- return;
- }
-
- // catch pauses from non-main loop sources
- if (thisMainLoopId < Browser.mainLoop.currentlyRunningMainloop) return;
-
- // Implement very basic swap interval control
- Browser.mainLoop.currentFrameNumber = Browser.mainLoop.currentFrameNumber + 1 | 0;
- if (Browser.mainLoop.timingMode == 1/*EM_TIMING_RAF*/ && Browser.mainLoop.timingValue > 1 && Browser.mainLoop.currentFrameNumber % Browser.mainLoop.timingValue != 0) {
- // Not the scheduled time to render this frame - skip.
- Browser.mainLoop.scheduler();
- return;
- } else if (Browser.mainLoop.timingMode == 0/*EM_TIMING_SETTIMEOUT*/) {
- Browser.mainLoop.tickStartTime = _emscripten_get_now();
- }
-
- // Signal GL rendering layer that processing of a new frame is about to start. This helps it optimize
- // VBO double-buffering and reduce GPU stalls.
-
-
- if (Browser.mainLoop.method === 'timeout' && Module.ctx) {
- 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!');
- Browser.mainLoop.method = ''; // just warn once per call to set main loop
- }
-
- Browser.mainLoop.runIter(browserIterationFunc);
-
- checkStackCookie();
-
- // catch pauses from the main loop itself
- if (thisMainLoopId < Browser.mainLoop.currentlyRunningMainloop) return;
-
- // Queue new audio data. This is important to be right after the main loop invocation, so that we will immediately be able
- // to queue the newest produced audio samples.
- // TODO: Consider adding pre- and post- rAF callbacks so that GL.newRenderingFrameStarted() and SDL.audio.queueNewAudioData()
- // do not need to be hardcoded into this function, but can be more generic.
- if (typeof SDL === 'object' && SDL.audio && SDL.audio.queueNewAudioData) SDL.audio.queueNewAudioData();
-
- Browser.mainLoop.scheduler();
- }
-
- if (!noSetTiming) {
- if (fps && fps > 0) _emscripten_set_main_loop_timing(0/*EM_TIMING_SETTIMEOUT*/, 1000.0 / fps);
- else _emscripten_set_main_loop_timing(1/*EM_TIMING_RAF*/, 1); // Do rAF by rendering each frame (no decimating)
-
- Browser.mainLoop.scheduler();
- }
-
- if (simulateInfiniteLoop) {
- throw 'SimulateInfiniteLoop';
- }
- }var Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function () {
- Browser.mainLoop.scheduler = null;
- Browser.mainLoop.currentlyRunningMainloop++; // Incrementing this signals the previous main loop that it's now become old, and it must return.
- },resume:function () {
- Browser.mainLoop.currentlyRunningMainloop++;
- var timingMode = Browser.mainLoop.timingMode;
- var timingValue = Browser.mainLoop.timingValue;
- var func = Browser.mainLoop.func;
- Browser.mainLoop.func = null;
- _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 */);
- _emscripten_set_main_loop_timing(timingMode, timingValue);
- Browser.mainLoop.scheduler();
- },updateStatus:function () {
- if (Module['setStatus']) {
- var message = Module['statusMessage'] || 'Please wait...';
- var remaining = Browser.mainLoop.remainingBlockers;
- var expected = Browser.mainLoop.expectedBlockers;
- if (remaining) {
- if (remaining < expected) {
- Module['setStatus'](message + ' (' + (expected - remaining) + '/' + expected + ')');
- } else {
- Module['setStatus'](message);
- }
- } else {
- Module['setStatus']('');
- }
- }
- },runIter:function (func) {
- if (ABORT) return;
- if (Module['preMainLoop']) {
- var preRet = Module['preMainLoop']();
- if (preRet === false) {
- return; // |return false| skips a frame
- }
- }
- try {
- func();
- } catch (e) {
- if (e instanceof ExitStatus) {
- return;
- } else {
- if (e && typeof e === 'object' && e.stack) Module.printErr('exception thrown: ' + [e, e.stack]);
- throw e;
- }
- }
- if (Module['postMainLoop']) Module['postMainLoop']();
- }},isFullscreen:false,pointerLock:false,moduleContextCreatedCallbacks:[],workers:[],init:function () {
- if (!Module["preloadPlugins"]) Module["preloadPlugins"] = []; // needs to exist even in workers
-
- if (Browser.initted) return;
- Browser.initted = true;
-
- try {
- new Blob();
- Browser.hasBlobConstructor = true;
- } catch(e) {
- Browser.hasBlobConstructor = false;
- console.log("warning: no blob constructor, cannot create blobs with mimetypes");
- }
- Browser.BlobBuilder = typeof MozBlobBuilder != "undefined" ? MozBlobBuilder : (typeof WebKitBlobBuilder != "undefined" ? WebKitBlobBuilder : (!Browser.hasBlobConstructor ? console.log("warning: no BlobBuilder") : null));
- Browser.URLObject = typeof window != "undefined" ? (window.URL ? window.URL : window.webkitURL) : undefined;
- if (!Module.noImageDecoding && typeof Browser.URLObject === 'undefined') {
- console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.");
- Module.noImageDecoding = true;
- }
-
- // Support for plugins that can process preloaded files. You can add more of these to
- // your app by creating and appending to Module.preloadPlugins.
- //
- // Each plugin is asked if it can handle a file based on the file's name. If it can,
- // it is given the file's raw data. When it is done, it calls a callback with the file's
- // (possibly modified) data. For example, a plugin might decompress a file, or it
- // might create some side data structure for use later (like an Image element, etc.).
-
- var imagePlugin = {};
- imagePlugin['canHandle'] = function imagePlugin_canHandle(name) {
- return !Module.noImageDecoding && /\.(jpg|jpeg|png|bmp)$/i.test(name);
- };
- imagePlugin['handle'] = function imagePlugin_handle(byteArray, name, onload, onerror) {
- var b = null;
- if (Browser.hasBlobConstructor) {
- try {
- b = new Blob([byteArray], { type: Browser.getMimetype(name) });
- if (b.size !== byteArray.length) { // Safari bug #118630
- // Safari's Blob can only take an ArrayBuffer
- b = new Blob([(new Uint8Array(byteArray)).buffer], { type: Browser.getMimetype(name) });
- }
- } catch(e) {
- Runtime.warnOnce('Blob constructor present but fails: ' + e + '; falling back to blob builder');
- }
- }
- if (!b) {
- var bb = new Browser.BlobBuilder();
- bb.append((new Uint8Array(byteArray)).buffer); // we need to pass a buffer, and must copy the array to get the right data range
- b = bb.getBlob();
- }
- var url = Browser.URLObject.createObjectURL(b);
- assert(typeof url == 'string', 'createObjectURL must return a url as a string');
- var img = new Image();
- img.onload = function img_onload() {
- assert(img.complete, 'Image ' + name + ' could not be decoded');
- var canvas = document.createElement('canvas');
- canvas.width = img.width;
- canvas.height = img.height;
- var ctx = canvas.getContext('2d');
- ctx.drawImage(img, 0, 0);
- Module["preloadedImages"][name] = canvas;
- Browser.URLObject.revokeObjectURL(url);
- if (onload) onload(byteArray);
- };
- img.onerror = function img_onerror(event) {
- console.log('Image ' + url + ' could not be decoded');
- if (onerror) onerror();
- };
- img.src = url;
- };
- Module['preloadPlugins'].push(imagePlugin);
-
- var audioPlugin = {};
- audioPlugin['canHandle'] = function audioPlugin_canHandle(name) {
- return !Module.noAudioDecoding && name.substr(-4) in { '.ogg': 1, '.wav': 1, '.mp3': 1 };
- };
- audioPlugin['handle'] = function audioPlugin_handle(byteArray, name, onload, onerror) {
- var done = false;
- function finish(audio) {
- if (done) return;
- done = true;
- Module["preloadedAudios"][name] = audio;
- if (onload) onload(byteArray);
- }
- function fail() {
- if (done) return;
- done = true;
- Module["preloadedAudios"][name] = new Audio(); // empty shim
- if (onerror) onerror();
- }
- if (Browser.hasBlobConstructor) {
- try {
- var b = new Blob([byteArray], { type: Browser.getMimetype(name) });
- } catch(e) {
- return fail();
- }
- var url = Browser.URLObject.createObjectURL(b); // XXX we never revoke this!
- assert(typeof url == 'string', 'createObjectURL must return a url as a string');
- var audio = new Audio();
- audio.addEventListener('canplaythrough', function() { finish(audio) }, false); // use addEventListener due to chromium bug 124926
- audio.onerror = function audio_onerror(event) {
- if (done) return;
- console.log('warning: browser could not fully decode audio ' + name + ', trying slower base64 approach');
- function encode64(data) {
- var BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
- var PAD = '=';
- var ret = '';
- var leftchar = 0;
- var leftbits = 0;
- for (var i = 0; i < data.length; i++) {
- leftchar = (leftchar << 8) | data[i];
- leftbits += 8;
- while (leftbits >= 6) {
- var curr = (leftchar >> (leftbits-6)) & 0x3f;
- leftbits -= 6;
- ret += BASE[curr];
- }
- }
- if (leftbits == 2) {
- ret += BASE[(leftchar&3) << 4];
- ret += PAD + PAD;
- } else if (leftbits == 4) {
- ret += BASE[(leftchar&0xf) << 2];
- ret += PAD;
- }
- return ret;
- }
- audio.src = 'data:audio/x-' + name.substr(-3) + ';base64,' + encode64(byteArray);
- finish(audio); // we don't wait for confirmation this worked - but it's worth trying
- };
- audio.src = url;
- // workaround for chrome bug 124926 - we do not always get oncanplaythrough or onerror
- Browser.safeSetTimeout(function() {
- finish(audio); // try to use it even though it is not necessarily ready to play
- }, 10000);
- } else {
- return fail();
- }
- };
- Module['preloadPlugins'].push(audioPlugin);
-
- // Canvas event setup
-
- function pointerLockChange() {
- Browser.pointerLock = document['pointerLockElement'] === Module['canvas'] ||
- document['mozPointerLockElement'] === Module['canvas'] ||
- document['webkitPointerLockElement'] === Module['canvas'] ||
- document['msPointerLockElement'] === Module['canvas'];
- }
- var canvas = Module['canvas'];
- if (canvas) {
- // forced aspect ratio can be enabled by defining 'forcedAspectRatio' on Module
- // Module['forcedAspectRatio'] = 4 / 3;
-
- canvas.requestPointerLock = canvas['requestPointerLock'] ||
- canvas['mozRequestPointerLock'] ||
- canvas['webkitRequestPointerLock'] ||
- canvas['msRequestPointerLock'] ||
- function(){};
- canvas.exitPointerLock = document['exitPointerLock'] ||
- document['mozExitPointerLock'] ||
- document['webkitExitPointerLock'] ||
- document['msExitPointerLock'] ||
- function(){}; // no-op if function does not exist
- canvas.exitPointerLock = canvas.exitPointerLock.bind(document);
-
- document.addEventListener('pointerlockchange', pointerLockChange, false);
- document.addEventListener('mozpointerlockchange', pointerLockChange, false);
- document.addEventListener('webkitpointerlockchange', pointerLockChange, false);
- document.addEventListener('mspointerlockchange', pointerLockChange, false);
-
- if (Module['elementPointerLock']) {
- canvas.addEventListener("click", function(ev) {
- if (!Browser.pointerLock && Module['canvas'].requestPointerLock) {
- Module['canvas'].requestPointerLock();
- ev.preventDefault();
- }
- }, false);
- }
- }
- },createContext:function (canvas, useWebGL, setInModule, webGLContextAttributes) {
- 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.
-
- var ctx;
- var contextHandle;
- if (useWebGL) {
- // For GLES2/desktop GL compatibility, adjust a few defaults to be different to WebGL defaults, so that they align better with the desktop defaults.
- var contextAttributes = {
- antialias: false,
- alpha: false
- };
-
- if (webGLContextAttributes) {
- for (var attribute in webGLContextAttributes) {
- contextAttributes[attribute] = webGLContextAttributes[attribute];
- }
- }
-
- contextHandle = GL.createContext(canvas, contextAttributes);
- if (contextHandle) {
- ctx = GL.getContext(contextHandle).GLctx;
- }
- } else {
- ctx = canvas.getContext('2d');
- }
-
- if (!ctx) return null;
-
- if (setInModule) {
- 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');
-
- Module.ctx = ctx;
- if (useWebGL) GL.makeContextCurrent(contextHandle);
- Module.useWebGL = useWebGL;
- Browser.moduleContextCreatedCallbacks.forEach(function(callback) { callback() });
- Browser.init();
- }
- return ctx;
- },destroyContext:function (canvas, useWebGL, setInModule) {},fullscreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullscreen:function (lockPointer, resizeCanvas, vrDevice) {
- Browser.lockPointer = lockPointer;
- Browser.resizeCanvas = resizeCanvas;
- Browser.vrDevice = vrDevice;
- if (typeof Browser.lockPointer === 'undefined') Browser.lockPointer = true;
- if (typeof Browser.resizeCanvas === 'undefined') Browser.resizeCanvas = false;
- if (typeof Browser.vrDevice === 'undefined') Browser.vrDevice = null;
-
- var canvas = Module['canvas'];
- function fullscreenChange() {
- Browser.isFullscreen = false;
- var canvasContainer = canvas.parentNode;
- if ((document['fullscreenElement'] || document['mozFullScreenElement'] ||
- document['msFullscreenElement'] || document['webkitFullscreenElement'] ||
- document['webkitCurrentFullScreenElement']) === canvasContainer) {
- canvas.exitFullscreen = document['exitFullscreen'] ||
- document['cancelFullScreen'] ||
- document['mozCancelFullScreen'] ||
- document['msExitFullscreen'] ||
- document['webkitCancelFullScreen'] ||
- function() {};
- canvas.exitFullscreen = canvas.exitFullscreen.bind(document);
- if (Browser.lockPointer) canvas.requestPointerLock();
- Browser.isFullscreen = true;
- if (Browser.resizeCanvas) Browser.setFullscreenCanvasSize();
- } else {
-
- // remove the full screen specific parent of the canvas again to restore the HTML structure from before going full screen
- canvasContainer.parentNode.insertBefore(canvas, canvasContainer);
- canvasContainer.parentNode.removeChild(canvasContainer);
-
- if (Browser.resizeCanvas) Browser.setWindowedCanvasSize();
- }
- if (Module['onFullScreen']) Module['onFullScreen'](Browser.isFullscreen);
- if (Module['onFullscreen']) Module['onFullscreen'](Browser.isFullscreen);
- Browser.updateCanvasDimensions(canvas);
- }
-
- if (!Browser.fullscreenHandlersInstalled) {
- Browser.fullscreenHandlersInstalled = true;
- document.addEventListener('fullscreenchange', fullscreenChange, false);
- document.addEventListener('mozfullscreenchange', fullscreenChange, false);
- document.addEventListener('webkitfullscreenchange', fullscreenChange, false);
- document.addEventListener('MSFullscreenChange', fullscreenChange, false);
- }
-
- // 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
- var canvasContainer = document.createElement("div");
- canvas.parentNode.insertBefore(canvasContainer, canvas);
- canvasContainer.appendChild(canvas);
-
- // use parent of canvas as full screen root to allow aspect ratio correction (Firefox stretches the root to screen size)
- canvasContainer.requestFullscreen = canvasContainer['requestFullscreen'] ||
- canvasContainer['mozRequestFullScreen'] ||
- canvasContainer['msRequestFullscreen'] ||
- (canvasContainer['webkitRequestFullscreen'] ? function() { canvasContainer['webkitRequestFullscreen'](Element['ALLOW_KEYBOARD_INPUT']) } : null) ||
- (canvasContainer['webkitRequestFullScreen'] ? function() { canvasContainer['webkitRequestFullScreen'](Element['ALLOW_KEYBOARD_INPUT']) } : null);
-
- if (vrDevice) {
- canvasContainer.requestFullscreen({ vrDisplay: vrDevice });
- } else {
- canvasContainer.requestFullscreen();
- }
- },requestFullScreen:function (lockPointer, resizeCanvas, vrDevice) {
- Module.printErr('Browser.requestFullScreen() is deprecated. Please call Browser.requestFullscreen instead.');
- Browser.requestFullScreen = function(lockPointer, resizeCanvas, vrDevice) {
- return Browser.requestFullscreen(lockPointer, resizeCanvas, vrDevice);
- }
- return Browser.requestFullscreen(lockPointer, resizeCanvas, vrDevice);
- },nextRAF:0,fakeRequestAnimationFrame:function (func) {
- // try to keep 60fps between calls to here
- var now = Date.now();
- if (Browser.nextRAF === 0) {
- Browser.nextRAF = now + 1000/60;
- } else {
- while (now + 2 >= Browser.nextRAF) { // fudge a little, to avoid timer jitter causing us to do lots of delay:0
- Browser.nextRAF += 1000/60;
- }
- }
- var delay = Math.max(Browser.nextRAF - now, 0);
- setTimeout(func, delay);
- },requestAnimationFrame:function requestAnimationFrame(func) {
- if (typeof window === 'undefined') { // Provide fallback to setTimeout if window is undefined (e.g. in Node.js)
- Browser.fakeRequestAnimationFrame(func);
- } else {
- if (!window.requestAnimationFrame) {
- window.requestAnimationFrame = window['requestAnimationFrame'] ||
- window['mozRequestAnimationFrame'] ||
- window['webkitRequestAnimationFrame'] ||
- window['msRequestAnimationFrame'] ||
- window['oRequestAnimationFrame'] ||
- Browser.fakeRequestAnimationFrame;
- }
- window.requestAnimationFrame(func);
- }
- },safeCallback:function (func) {
- return function() {
- if (!ABORT) return func.apply(null, arguments);
- };
- },allowAsyncCallbacks:true,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function () {
- Browser.allowAsyncCallbacks = false;
- },resumeAsyncCallbacks:function () { // marks future callbacks as ok to execute, and synchronously runs any remaining ones right now
- Browser.allowAsyncCallbacks = true;
- if (Browser.queuedAsyncCallbacks.length > 0) {
- var callbacks = Browser.queuedAsyncCallbacks;
- Browser.queuedAsyncCallbacks = [];
- callbacks.forEach(function(func) {
- func();
- });
- }
- },safeRequestAnimationFrame:function (func) {
- return Browser.requestAnimationFrame(function() {
- if (ABORT) return;
- if (Browser.allowAsyncCallbacks) {
- func();
- } else {
- Browser.queuedAsyncCallbacks.push(func);
- }
- });
- },safeSetTimeout:function (func, timeout) {
- Module['noExitRuntime'] = true;
- return setTimeout(function() {
- if (ABORT) return;
- if (Browser.allowAsyncCallbacks) {
- func();
- } else {
- Browser.queuedAsyncCallbacks.push(func);
- }
- }, timeout);
- },safeSetInterval:function (func, timeout) {
- Module['noExitRuntime'] = true;
- return setInterval(function() {
- if (ABORT) return;
- if (Browser.allowAsyncCallbacks) {
- func();
- } // drop it on the floor otherwise, next interval will kick in
- }, timeout);
- },getMimetype:function (name) {
- return {
- 'jpg': 'image/jpeg',
- 'jpeg': 'image/jpeg',
- 'png': 'image/png',
- 'bmp': 'image/bmp',
- 'ogg': 'audio/ogg',
- 'wav': 'audio/wav',
- 'mp3': 'audio/mpeg'
- }[name.substr(name.lastIndexOf('.')+1)];
- },getUserMedia:function (func) {
- if(!window.getUserMedia) {
- window.getUserMedia = navigator['getUserMedia'] ||
- navigator['mozGetUserMedia'];
- }
- window.getUserMedia(func);
- },getMovementX:function (event) {
- return event['movementX'] ||
- event['mozMovementX'] ||
- event['webkitMovementX'] ||
- 0;
- },getMovementY:function (event) {
- return event['movementY'] ||
- event['mozMovementY'] ||
- event['webkitMovementY'] ||
- 0;
- },getMouseWheelDelta:function (event) {
- var delta = 0;
- switch (event.type) {
- case 'DOMMouseScroll':
- delta = event.detail;
- break;
- case 'mousewheel':
- delta = event.wheelDelta;
- break;
- case 'wheel':
- delta = event['deltaY'];
- break;
- default:
- throw 'unrecognized mouse wheel event: ' + event.type;
- }
- return delta;
- },mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function (event) { // event should be mousemove, mousedown or mouseup
- if (Browser.pointerLock) {
- // When the pointer is locked, calculate the coordinates
- // based on the movement of the mouse.
- // Workaround for Firefox bug 764498
- if (event.type != 'mousemove' &&
- ('mozMovementX' in event)) {
- Browser.mouseMovementX = Browser.mouseMovementY = 0;
- } else {
- Browser.mouseMovementX = Browser.getMovementX(event);
- Browser.mouseMovementY = Browser.getMovementY(event);
- }
-
- // check if SDL is available
- if (typeof SDL != "undefined") {
- Browser.mouseX = SDL.mouseX + Browser.mouseMovementX;
- Browser.mouseY = SDL.mouseY + Browser.mouseMovementY;
- } else {
- // just add the mouse delta to the current absolut mouse position
- // FIXME: ideally this should be clamped against the canvas size and zero
- Browser.mouseX += Browser.mouseMovementX;
- Browser.mouseY += Browser.mouseMovementY;
- }
- } else {
- // Otherwise, calculate the movement based on the changes
- // in the coordinates.
- var rect = Module["canvas"].getBoundingClientRect();
- var cw = Module["canvas"].width;
- var ch = Module["canvas"].height;
-
- // Neither .scrollX or .pageXOffset are defined in a spec, but
- // we prefer .scrollX because it is currently in a spec draft.
- // (see: http://www.w3.org/TR/2013/WD-cssom-view-20131217/)
- var scrollX = ((typeof window.scrollX !== 'undefined') ? window.scrollX : window.pageXOffset);
- var scrollY = ((typeof window.scrollY !== 'undefined') ? window.scrollY : window.pageYOffset);
- // If this assert lands, it's likely because the browser doesn't support scrollX or pageXOffset
- // and we have no viable fallback.
- assert((typeof scrollX !== 'undefined') && (typeof scrollY !== 'undefined'), 'Unable to retrieve scroll position, mouse positions likely broken.');
-
- if (event.type === 'touchstart' || event.type === 'touchend' || event.type === 'touchmove') {
- var touch = event.touch;
- if (touch === undefined) {
- return; // the "touch" property is only defined in SDL
-
- }
- var adjustedX = touch.pageX - (scrollX + rect.left);
- var adjustedY = touch.pageY - (scrollY + rect.top);
-
- adjustedX = adjustedX * (cw / rect.width);
- adjustedY = adjustedY * (ch / rect.height);
-
- var coords = { x: adjustedX, y: adjustedY };
-
- if (event.type === 'touchstart') {
- Browser.lastTouches[touch.identifier] = coords;
- Browser.touches[touch.identifier] = coords;
- } else if (event.type === 'touchend' || event.type === 'touchmove') {
- var last = Browser.touches[touch.identifier];
- if (!last) last = coords;
- Browser.lastTouches[touch.identifier] = last;
- Browser.touches[touch.identifier] = coords;
- }
- return;
- }
-
- var x = event.pageX - (scrollX + rect.left);
- var y = event.pageY - (scrollY + rect.top);
-
- // the canvas might be CSS-scaled compared to its backbuffer;
- // SDL-using content will want mouse coordinates in terms
- // of backbuffer units.
- x = x * (cw / rect.width);
- y = y * (ch / rect.height);
-
- Browser.mouseMovementX = x - Browser.mouseX;
- Browser.mouseMovementY = y - Browser.mouseY;
- Browser.mouseX = x;
- Browser.mouseY = y;
- }
- },asyncLoad:function (url, onload, onerror, noRunDep) {
- var dep = !noRunDep ? getUniqueRunDependency('al ' + url) : '';
- Module['readAsync'](url, function(arrayBuffer) {
- assert(arrayBuffer, 'Loading data file "' + url + '" failed (no arrayBuffer).');
- onload(new Uint8Array(arrayBuffer));
- if (dep) removeRunDependency(dep);
- }, function(event) {
- if (onerror) {
- onerror();
- } else {
- throw 'Loading data file "' + url + '" failed.';
- }
- });
- if (dep) addRunDependency(dep);
- },resizeListeners:[],updateResizeListeners:function () {
- var canvas = Module['canvas'];
- Browser.resizeListeners.forEach(function(listener) {
- listener(canvas.width, canvas.height);
- });
- },setCanvasSize:function (width, height, noUpdates) {
- var canvas = Module['canvas'];
- Browser.updateCanvasDimensions(canvas, width, height);
- if (!noUpdates) Browser.updateResizeListeners();
- },windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function () {
- // check if SDL is available
- if (typeof SDL != "undefined") {
- var flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];
- flags = flags | 0x00800000; // set SDL_FULLSCREEN flag
- HEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags
- }
- Browser.updateResizeListeners();
- },setWindowedCanvasSize:function () {
- // check if SDL is available
- if (typeof SDL != "undefined") {
- var flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];
- flags = flags & ~0x00800000; // clear SDL_FULLSCREEN flag
- HEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags
- }
- Browser.updateResizeListeners();
- },updateCanvasDimensions:function (canvas, wNative, hNative) {
- if (wNative && hNative) {
- canvas.widthNative = wNative;
- canvas.heightNative = hNative;
- } else {
- wNative = canvas.widthNative;
- hNative = canvas.heightNative;
- }
- var w = wNative;
- var h = hNative;
- if (Module['forcedAspectRatio'] && Module['forcedAspectRatio'] > 0) {
- if (w/h < Module['forcedAspectRatio']) {
- w = Math.round(h * Module['forcedAspectRatio']);
- } else {
- h = Math.round(w / Module['forcedAspectRatio']);
- }
- }
- if (((document['fullscreenElement'] || document['mozFullScreenElement'] ||
- document['msFullscreenElement'] || document['webkitFullscreenElement'] ||
- document['webkitCurrentFullScreenElement']) === canvas.parentNode) && (typeof screen != 'undefined')) {
- var factor = Math.min(screen.width / w, screen.height / h);
- w = Math.round(w * factor);
- h = Math.round(h * factor);
- }
- if (Browser.resizeCanvas) {
- if (canvas.width != w) canvas.width = w;
- if (canvas.height != h) canvas.height = h;
- if (typeof canvas.style != 'undefined') {
- canvas.style.removeProperty( "width");
- canvas.style.removeProperty("height");
- }
- } else {
- if (canvas.width != wNative) canvas.width = wNative;
- if (canvas.height != hNative) canvas.height = hNative;
- if (typeof canvas.style != 'undefined') {
- if (w != wNative || h != hNative) {
- canvas.style.setProperty( "width", w + "px", "important");
- canvas.style.setProperty("height", h + "px", "important");
- } else {
- canvas.style.removeProperty( "width");
- canvas.style.removeProperty("height");
- }
- }
- }
- },wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:function () {
- var handle = Browser.nextWgetRequestHandle;
- Browser.nextWgetRequestHandle++;
- return handle;
- }};var GLFW={Window:function (id, width, height, title, monitor, share) {
- this.id = id;
- this.x = 0;
- this.y = 0;
- this.fullscreen = false; // Used to determine if app in fullscreen mode
- this.storedX = 0; // Used to store X before fullscreen
- this.storedY = 0; // Used to store Y before fullscreen
- this.width = width;
- this.height = height;
- this.storedWidth = width; // Used to store width before fullscreen
- this.storedHeight = height; // Used to store height before fullscreen
- this.title = title;
- this.monitor = monitor;
- this.share = share;
- this.attributes = GLFW.hints;
- this.inputModes = {
- 0x00033001:0x00034001, // GLFW_CURSOR (GLFW_CURSOR_NORMAL)
- 0x00033002:0, // GLFW_STICKY_KEYS
- 0x00033003:0, // GLFW_STICKY_MOUSE_BUTTONS
- };
- this.buttons = 0;
- this.keys = new Array();
- this.shouldClose = 0;
- this.title = null;
- this.windowPosFunc = null; // GLFWwindowposfun
- this.windowSizeFunc = null; // GLFWwindowsizefun
- this.windowCloseFunc = null; // GLFWwindowclosefun
- this.windowRefreshFunc = null; // GLFWwindowrefreshfun
- this.windowFocusFunc = null; // GLFWwindowfocusfun
- this.windowIconifyFunc = null; // GLFWwindowiconifyfun
- this.framebufferSizeFunc = null; // GLFWframebuffersizefun
- this.mouseButtonFunc = null; // GLFWmousebuttonfun
- this.cursorPosFunc = null; // GLFWcursorposfun
- this.cursorEnterFunc = null; // GLFWcursorenterfun
- this.scrollFunc = null; // GLFWscrollfun
- this.keyFunc = null; // GLFWkeyfun
- this.charFunc = null; // GLFWcharfun
- this.userptr = null;
- },WindowFromId:function (id) {
- if (id <= 0 || !GLFW.windows) return null;
- return GLFW.windows[id - 1];
- },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) {
- switch (keycode) {
- // these keycodes are only defined for GLFW3, assume they are the same for GLFW2
- case 0x20:return 32; // DOM_VK_SPACE -> GLFW_KEY_SPACE
- case 0xDE:return 39; // DOM_VK_QUOTE -> GLFW_KEY_APOSTROPHE
- case 0xBC:return 44; // DOM_VK_COMMA -> GLFW_KEY_COMMA
- case 0xAD:return 45; // DOM_VK_HYPHEN_MINUS -> GLFW_KEY_MINUS
- case 0xBD:return 45; // DOM_VK_MINUS -> GLFW_KEY_MINUS
- case 0xBE:return 46; // DOM_VK_PERIOD -> GLFW_KEY_PERIOD
- case 0xBF:return 47; // DOM_VK_SLASH -> GLFW_KEY_SLASH
- case 0x30:return 48; // DOM_VK_0 -> GLFW_KEY_0
- case 0x31:return 49; // DOM_VK_1 -> GLFW_KEY_1
- case 0x32:return 50; // DOM_VK_2 -> GLFW_KEY_2
- case 0x33:return 51; // DOM_VK_3 -> GLFW_KEY_3
- case 0x34:return 52; // DOM_VK_4 -> GLFW_KEY_4
- case 0x35:return 53; // DOM_VK_5 -> GLFW_KEY_5
- case 0x36:return 54; // DOM_VK_6 -> GLFW_KEY_6
- case 0x37:return 55; // DOM_VK_7 -> GLFW_KEY_7
- case 0x38:return 56; // DOM_VK_8 -> GLFW_KEY_8
- case 0x39:return 57; // DOM_VK_9 -> GLFW_KEY_9
- case 0x3B:return 59; // DOM_VK_SEMICOLON -> GLFW_KEY_SEMICOLON
- case 0x3D:return 61; // DOM_VK_EQUALS -> GLFW_KEY_EQUAL
- case 0xBB:return 61; // DOM_VK_EQUALS -> GLFW_KEY_EQUAL
- case 0x41:return 65; // DOM_VK_A -> GLFW_KEY_A
- case 0x42:return 66; // DOM_VK_B -> GLFW_KEY_B
- case 0x43:return 67; // DOM_VK_C -> GLFW_KEY_C
- case 0x44:return 68; // DOM_VK_D -> GLFW_KEY_D
- case 0x45:return 69; // DOM_VK_E -> GLFW_KEY_E
- case 0x46:return 70; // DOM_VK_F -> GLFW_KEY_F
- case 0x47:return 71; // DOM_VK_G -> GLFW_KEY_G
- case 0x48:return 72; // DOM_VK_H -> GLFW_KEY_H
- case 0x49:return 73; // DOM_VK_I -> GLFW_KEY_I
- case 0x4A:return 74; // DOM_VK_J -> GLFW_KEY_J
- case 0x4B:return 75; // DOM_VK_K -> GLFW_KEY_K
- case 0x4C:return 76; // DOM_VK_L -> GLFW_KEY_L
- case 0x4D:return 77; // DOM_VK_M -> GLFW_KEY_M
- case 0x4E:return 78; // DOM_VK_N -> GLFW_KEY_N
- case 0x4F:return 79; // DOM_VK_O -> GLFW_KEY_O
- case 0x50:return 80; // DOM_VK_P -> GLFW_KEY_P
- case 0x51:return 81; // DOM_VK_Q -> GLFW_KEY_Q
- case 0x52:return 82; // DOM_VK_R -> GLFW_KEY_R
- case 0x53:return 83; // DOM_VK_S -> GLFW_KEY_S
- case 0x54:return 84; // DOM_VK_T -> GLFW_KEY_T
- case 0x55:return 85; // DOM_VK_U -> GLFW_KEY_U
- case 0x56:return 86; // DOM_VK_V -> GLFW_KEY_V
- case 0x57:return 87; // DOM_VK_W -> GLFW_KEY_W
- case 0x58:return 88; // DOM_VK_X -> GLFW_KEY_X
- case 0x59:return 89; // DOM_VK_Y -> GLFW_KEY_Y
- case 0x5a:return 90; // DOM_VK_Z -> GLFW_KEY_Z
- case 0xDB:return 91; // DOM_VK_OPEN_BRACKET -> GLFW_KEY_LEFT_BRACKET
- case 0xDC:return 92; // DOM_VK_BACKSLASH -> GLFW_KEY_BACKSLASH
- case 0xDD:return 93; // DOM_VK_CLOSE_BRACKET -> GLFW_KEY_RIGHT_BRACKET
- case 0xC0:return 94; // DOM_VK_BACK_QUOTE -> GLFW_KEY_GRAVE_ACCENT
-
-
- case 0x1B:return 256; // DOM_VK_ESCAPE -> GLFW_KEY_ESCAPE
- case 0x0D:return 257; // DOM_VK_RETURN -> GLFW_KEY_ENTER
- case 0x09:return 258; // DOM_VK_TAB -> GLFW_KEY_TAB
- case 0x08:return 259; // DOM_VK_BACK -> GLFW_KEY_BACKSPACE
- case 0x2D:return 260; // DOM_VK_INSERT -> GLFW_KEY_INSERT
- case 0x2E:return 261; // DOM_VK_DELETE -> GLFW_KEY_DELETE
- case 0x27:return 262; // DOM_VK_RIGHT -> GLFW_KEY_RIGHT
- case 0x25:return 263; // DOM_VK_LEFT -> GLFW_KEY_LEFT
- case 0x28:return 264; // DOM_VK_DOWN -> GLFW_KEY_DOWN
- case 0x26:return 265; // DOM_VK_UP -> GLFW_KEY_UP
- case 0x21:return 266; // DOM_VK_PAGE_UP -> GLFW_KEY_PAGE_UP
- case 0x22:return 267; // DOM_VK_PAGE_DOWN -> GLFW_KEY_PAGE_DOWN
- case 0x24:return 268; // DOM_VK_HOME -> GLFW_KEY_HOME
- case 0x23:return 269; // DOM_VK_END -> GLFW_KEY_END
- case 0x14:return 280; // DOM_VK_CAPS_LOCK -> GLFW_KEY_CAPS_LOCK
- case 0x91:return 281; // DOM_VK_SCROLL_LOCK -> GLFW_KEY_SCROLL_LOCK
- case 0x90:return 282; // DOM_VK_NUM_LOCK -> GLFW_KEY_NUM_LOCK
- case 0x2C:return 283; // DOM_VK_SNAPSHOT -> GLFW_KEY_PRINT_SCREEN
- case 0x13:return 284; // DOM_VK_PAUSE -> GLFW_KEY_PAUSE
- case 0x70:return 290; // DOM_VK_F1 -> GLFW_KEY_F1
- case 0x71:return 291; // DOM_VK_F2 -> GLFW_KEY_F2
- case 0x72:return 292; // DOM_VK_F3 -> GLFW_KEY_F3
- case 0x73:return 293; // DOM_VK_F4 -> GLFW_KEY_F4
- case 0x74:return 294; // DOM_VK_F5 -> GLFW_KEY_F5
- case 0x75:return 295; // DOM_VK_F6 -> GLFW_KEY_F6
- case 0x76:return 296; // DOM_VK_F7 -> GLFW_KEY_F7
- case 0x77:return 297; // DOM_VK_F8 -> GLFW_KEY_F8
- case 0x78:return 298; // DOM_VK_F9 -> GLFW_KEY_F9
- case 0x79:return 299; // DOM_VK_F10 -> GLFW_KEY_F10
- case 0x7A:return 300; // DOM_VK_F11 -> GLFW_KEY_F11
- case 0x7B:return 301; // DOM_VK_F12 -> GLFW_KEY_F12
- case 0x7C:return 302; // DOM_VK_F13 -> GLFW_KEY_F13
- case 0x7D:return 303; // DOM_VK_F14 -> GLFW_KEY_F14
- case 0x7E:return 304; // DOM_VK_F15 -> GLFW_KEY_F15
- case 0x7F:return 305; // DOM_VK_F16 -> GLFW_KEY_F16
- case 0x80:return 306; // DOM_VK_F17 -> GLFW_KEY_F17
- case 0x81:return 307; // DOM_VK_F18 -> GLFW_KEY_F18
- case 0x82:return 308; // DOM_VK_F19 -> GLFW_KEY_F19
- case 0x83:return 309; // DOM_VK_F20 -> GLFW_KEY_F20
- case 0x84:return 310; // DOM_VK_F21 -> GLFW_KEY_F21
- case 0x85:return 311; // DOM_VK_F22 -> GLFW_KEY_F22
- case 0x86:return 312; // DOM_VK_F23 -> GLFW_KEY_F23
- case 0x87:return 313; // DOM_VK_F24 -> GLFW_KEY_F24
- case 0x88:return 314; // 0x88 (not used?) -> GLFW_KEY_F25
- case 0x60:return 320; // DOM_VK_NUMPAD0 -> GLFW_KEY_KP_0
- case 0x61:return 321; // DOM_VK_NUMPAD1 -> GLFW_KEY_KP_1
- case 0x62:return 322; // DOM_VK_NUMPAD2 -> GLFW_KEY_KP_2
- case 0x63:return 323; // DOM_VK_NUMPAD3 -> GLFW_KEY_KP_3
- case 0x64:return 324; // DOM_VK_NUMPAD4 -> GLFW_KEY_KP_4
- case 0x65:return 325; // DOM_VK_NUMPAD5 -> GLFW_KEY_KP_5
- case 0x66:return 326; // DOM_VK_NUMPAD6 -> GLFW_KEY_KP_6
- case 0x67:return 327; // DOM_VK_NUMPAD7 -> GLFW_KEY_KP_7
- case 0x68:return 328; // DOM_VK_NUMPAD8 -> GLFW_KEY_KP_8
- case 0x69:return 329; // DOM_VK_NUMPAD9 -> GLFW_KEY_KP_9
- case 0x6E:return 330; // DOM_VK_DECIMAL -> GLFW_KEY_KP_DECIMAL
- case 0x6F:return 331; // DOM_VK_DIVIDE -> GLFW_KEY_KP_DIVIDE
- case 0x6A:return 332; // DOM_VK_MULTIPLY -> GLFW_KEY_KP_MULTIPLY
- case 0x6D:return 333; // DOM_VK_SUBTRACT -> GLFW_KEY_KP_SUBTRACT
- case 0x6B:return 334; // DOM_VK_ADD -> GLFW_KEY_KP_ADD
- // case 0x0D:return 335; // DOM_VK_RETURN -> GLFW_KEY_KP_ENTER (DOM_KEY_LOCATION_RIGHT)
- // case 0x61:return 336; // DOM_VK_EQUALS -> GLFW_KEY_KP_EQUAL (DOM_KEY_LOCATION_RIGHT)
- case 0x10:return 340; // DOM_VK_SHIFT -> GLFW_KEY_LEFT_SHIFT
- case 0x11:return 341; // DOM_VK_CONTROL -> GLFW_KEY_LEFT_CONTROL
- case 0x12:return 342; // DOM_VK_ALT -> GLFW_KEY_LEFT_ALT
- case 0x5B:return 343; // DOM_VK_WIN -> GLFW_KEY_LEFT_SUPER
- // case 0x10:return 344; // DOM_VK_SHIFT -> GLFW_KEY_RIGHT_SHIFT (DOM_KEY_LOCATION_RIGHT)
- // case 0x11:return 345; // DOM_VK_CONTROL -> GLFW_KEY_RIGHT_CONTROL (DOM_KEY_LOCATION_RIGHT)
- // case 0x12:return 346; // DOM_VK_ALT -> GLFW_KEY_RIGHT_ALT (DOM_KEY_LOCATION_RIGHT)
- // case 0x5B:return 347; // DOM_VK_WIN -> GLFW_KEY_RIGHT_SUPER (DOM_KEY_LOCATION_RIGHT)
- case 0x5D:return 348; // DOM_VK_CONTEXT_MENU -> GLFW_KEY_MENU
- // XXX: GLFW_KEY_WORLD_1, GLFW_KEY_WORLD_2 what are these?
- default:return -1; // GLFW_KEY_UNKNOWN
- };
- },getModBits:function (win) {
- var mod = 0;
- if (win.keys[340]) mod |= 0x0001; // GLFW_MOD_SHIFT
- if (win.keys[341]) mod |= 0x0002; // GLFW_MOD_CONTROL
- if (win.keys[342]) mod |= 0x0004; // GLFW_MOD_ALT
- if (win.keys[343]) mod |= 0x0008; // GLFW_MOD_SUPER
- return mod;
- },onKeyPress:function (event) {
- if (!GLFW.active || !GLFW.active.charFunc) return;
-
- // correct unicode charCode is only available with onKeyPress event
- var charCode = event.charCode;
- if (charCode == 0 || (charCode >= 0x00 && charCode <= 0x1F)) return;
-
-
- Module['dynCall_vii'](GLFW.active.charFunc, GLFW.active.id, charCode);
- },onKeyChanged:function (event, status) {
- if (!GLFW.active) return;
-
- var key = GLFW.DOMToGLFWKeyCode(event.keyCode);
- if (key == -1) return;
-
- var repeat = status && GLFW.active.keys[key];
- GLFW.active.keys[key] = status;
- if (!GLFW.active.keyFunc) return;
-
-
- if (repeat) status = 2; // GLFW_REPEAT
- Module['dynCall_viiiii'](GLFW.active.keyFunc, GLFW.active.id, key, event.keyCode, status, GLFW.getModBits(GLFW.active));
- },onKeydown:function (event) {
- GLFW.onKeyChanged(event, 1); // GLFW_PRESS or GLFW_REPEAT
-
- // This logic comes directly from the sdl implementation. We cannot
- // call preventDefault on all keydown events otherwise onKeyPress will
- // not get called
- if (event.keyCode === 8 /* backspace */ || event.keyCode === 9 /* tab */) {
- event.preventDefault();
- }
- },onKeyup:function (event) {
- GLFW.onKeyChanged(event, 0); // GLFW_RELEASE
- },onMousemove:function (event) {
- if (!GLFW.active) return;
-
- Browser.calculateMouseEvent(event);
-
- if (event.target != Module["canvas"] || !GLFW.active.cursorPosFunc) return;
-
-
- Module['dynCall_vidd'](GLFW.active.cursorPosFunc, GLFW.active.id, Browser.mouseX, Browser.mouseY);
- },DOMToGLFWMouseButton:function (event) {
- // DOM and glfw have different button codes.
- // See http://www.w3schools.com/jsref/event_button.asp.
- var eventButton = event['button'];
- if (eventButton > 0) {
- if (eventButton == 1) {
- eventButton = 2;
- } else {
- eventButton = 1;
- }
- }
- return eventButton;
- },onMouseenter:function (event) {
- if (!GLFW.active) return;
-
- if (event.target != Module["canvas"] || !GLFW.active.cursorEnterFunc) return;
-
- Module['dynCall_vii'](GLFW.active.cursorEnterFunc, GLFW.active.id, 1);
- },onMouseleave:function (event) {
- if (!GLFW.active) return;
-
- if (event.target != Module["canvas"] || !GLFW.active.cursorEnterFunc) return;
-
- Module['dynCall_vii'](GLFW.active.cursorEnterFunc, GLFW.active.id, 0);
- },onMouseButtonChanged:function (event, status) {
- if (!GLFW.active) return;
-
- Browser.calculateMouseEvent(event);
-
- if (event.target != Module["canvas"]) return;
-
- eventButton = GLFW.DOMToGLFWMouseButton(event);
-
- if (status == 1) { // GLFW_PRESS
- GLFW.active.buttons |= (1 << eventButton);
- try {
- event.target.setCapture();
- } catch (e) {}
- } else { // GLFW_RELEASE
- GLFW.active.buttons &= ~(1 << eventButton);
- }
-
- if (!GLFW.active.mouseButtonFunc) return;
-
-
- Module['dynCall_viiii'](GLFW.active.mouseButtonFunc, GLFW.active.id, eventButton, status, GLFW.getModBits(GLFW.active));
- },onMouseButtonDown:function (event) {
- if (!GLFW.active) return;
- GLFW.onMouseButtonChanged(event, 1); // GLFW_PRESS
- },onMouseButtonUp:function (event) {
- if (!GLFW.active) return;
- GLFW.onMouseButtonChanged(event, 0); // GLFW_RELEASE
- },onMouseWheel:function (event) {
- // Note the minus sign that flips browser wheel direction (positive direction scrolls page down) to native wheel direction (positive direction is mouse wheel up)
- var delta = -Browser.getMouseWheelDelta(event);
- 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.
- GLFW.wheelPos += delta;
-
- if (!GLFW.active || !GLFW.active.scrollFunc || event.target != Module['canvas']) return;
-
-
- var sx = 0;
- var sy = 0;
- if (event.type == 'mousewheel') {
- sx = event.wheelDeltaX;
- sy = event.wheelDeltaY;
- } else {
- sx = event.deltaX;
- sy = event.deltaY;
- }
-
- Module['dynCall_vidd'](GLFW.active.scrollFunc, GLFW.active.id, sx, sy);
-
- event.preventDefault();
- },onCanvasResize:function (width, height) {
- if (!GLFW.active) return;
-
- var resizeNeeded = true;
-
- // If the client is requestiong fullscreen mode
- if (document["fullscreen"] || document["fullScreen"] || document["mozFullScreen"] || document["webkitIsFullScreen"]) {
- GLFW.active.storedX = GLFW.active.x;
- GLFW.active.storedY = GLFW.active.y;
- GLFW.active.storedWidth = GLFW.active.width;
- GLFW.active.storedHeight = GLFW.active.height;
- GLFW.active.x = GLFW.active.y = 0;
- GLFW.active.width = screen.width;
- GLFW.active.height = screen.height;
- GLFW.active.fullscreen = true;
-
- // If the client is reverting from fullscreen mode
- } else if (GLFW.active.fullscreen == true) {
- GLFW.active.x = GLFW.active.storedX;
- GLFW.active.y = GLFW.active.storedY;
- GLFW.active.width = GLFW.active.storedWidth;
- GLFW.active.height = GLFW.active.storedHeight;
- GLFW.active.fullscreen = false;
-
- // If the width/height values do not match current active window sizes
- } else if (GLFW.active.width != width || GLFW.active.height != height) {
- GLFW.active.width = width;
- GLFW.active.height = height;
- } else {
- resizeNeeded = false;
- }
-
- // If any of the above conditions were true, we need to resize the canvas
- if (resizeNeeded) {
- // resets the canvas size to counter the aspect preservation of Browser.updateCanvasDimensions
- Browser.setCanvasSize(GLFW.active.width, GLFW.active.height, true);
- // TODO: Client dimensions (clientWidth/clientHeight) vs pixel dimensions (width/height) of
- // the canvas should drive window and framebuffer size respectfully.
- GLFW.onWindowSizeChanged();
- GLFW.onFramebufferSizeChanged();
- }
- },onWindowSizeChanged:function () {
- if (!GLFW.active) return;
-
- if (!GLFW.active.windowSizeFunc) return;
-
-
- Module['dynCall_viii'](GLFW.active.windowSizeFunc, GLFW.active.id, GLFW.active.width, GLFW.active.height);
- },onFramebufferSizeChanged:function () {
- if (!GLFW.active) return;
-
- if (!GLFW.active.framebufferSizeFunc) return;
-
- Module['dynCall_viii'](GLFW.active.framebufferSizeFunc, GLFW.active.id, GLFW.active.width, GLFW.active.height);
- },requestFullscreen:function () {
- var RFS = Module["canvas"]['requestFullscreen'] ||
- Module["canvas"]['mozRequestFullScreen'] ||
- Module["canvas"]['webkitRequestFullScreen'] ||
- (function() {});
- RFS.apply(Module["canvas"], []);
- },requestFullScreen:function () {
- Module.printErr('GLFW.requestFullScreen() is deprecated. Please call GLFW.requestFullscreen instead.');
- GLFW.requestFullScreen = function() {
- return GLFW.requestFullscreen();
- }
- return GLFW.requestFullscreen();
- },exitFullscreen:function () {
- var CFS = document['exitFullscreen'] ||
- document['cancelFullScreen'] ||
- document['mozCancelFullScreen'] ||
- document['webkitCancelFullScreen'] ||
- (function() {});
- CFS.apply(document, []);
- },cancelFullScreen:function () {
- Module.printErr('GLFW.cancelFullScreen() is deprecated. Please call GLFW.exitFullscreen instead.');
- GLFW.cancelFullScreen = function() {
- return GLFW.exitFullscreen();
- }
- return GLFW.exitFullscreen();
- },getTime:function () {
- return _emscripten_get_now() / 1000;
- },setWindowTitle:function (winid, title) {
- var win = GLFW.WindowFromId(winid);
- if (!win) return;
-
- win.title = Pointer_stringify(title);
- if (GLFW.active.id == win.id) {
- document.title = win.title;
- }
- },setKeyCallback:function (winid, cbfun) {
- var win = GLFW.WindowFromId(winid);
- if (!win) return;
- win.keyFunc = cbfun;
- },setCharCallback:function (winid, cbfun) {
- var win = GLFW.WindowFromId(winid);
- if (!win) return;
- win.charFunc = cbfun;
- },setMouseButtonCallback:function (winid, cbfun) {
- var win = GLFW.WindowFromId(winid);
- if (!win) return;
- win.mouseButtonFunc = cbfun;
- },setCursorPosCallback:function (winid, cbfun) {
- var win = GLFW.WindowFromId(winid);
- if (!win) return;
- win.cursorPosFunc = cbfun;
- },setScrollCallback:function (winid, cbfun) {
- var win = GLFW.WindowFromId(winid);
- if (!win) return;
- win.scrollFunc = cbfun;
- },setWindowSizeCallback:function (winid, cbfun) {
- var win = GLFW.WindowFromId(winid);
- if (!win) return;
- win.windowSizeFunc = cbfun;
-
- },setWindowCloseCallback:function (winid, cbfun) {
- var win = GLFW.WindowFromId(winid);
- if (!win) return;
- win.windowCloseFunc = cbfun;
- },setWindowRefreshCallback:function (winid, cbfun) {
- var win = GLFW.WindowFromId(winid);
- if (!win) return;
- win.windowRefreshFunc = cbfun;
- },onClickRequestPointerLock:function (e) {
- if (!Browser.pointerLock && Module['canvas'].requestPointerLock) {
- Module['canvas'].requestPointerLock();
- e.preventDefault();
- }
- },setInputMode:function (winid, mode, value) {
- var win = GLFW.WindowFromId(winid);
- if (!win) return;
-
- switch(mode) {
- case 0x00033001: { // GLFW_CURSOR
- switch(value) {
- case 0x00034001: { // GLFW_CURSOR_NORMAL
- win.inputModes[mode] = value;
- Module['canvas'].removeEventListener('click', GLFW.onClickRequestPointerLock, true);
- Module['canvas'].exitPointerLock();
- break;
- }
- case 0x00034002: { // GLFW_CURSOR_HIDDEN
- console.log("glfwSetInputMode called with GLFW_CURSOR_HIDDEN value not implemented.");
- break;
- }
- case 0x00034003: { // GLFW_CURSOR_DISABLED
- win.inputModes[mode] = value;
- Module['canvas'].addEventListener('click', GLFW.onClickRequestPointerLock, true);
- Module['canvas'].requestPointerLock();
- break;
- }
- default: {
- console.log("glfwSetInputMode called with unknown value parameter value: " + value + ".");
- break;
- }
- }
- break;
- }
- case 0x00033002: { // GLFW_STICKY_KEYS
- console.log("glfwSetInputMode called with GLFW_STICKY_KEYS mode not implemented.");
- break;
- }
- case 0x00033003: { // GLFW_STICKY_MOUSE_BUTTONS
- console.log("glfwSetInputMode called with GLFW_STICKY_MOUSE_BUTTONS mode not implemented.");
- break;
- }
- default: {
- console.log("glfwSetInputMode called with unknown mode parameter value: " + mode + ".");
- break;
- }
- }
- },getKey:function (winid, key) {
- var win = GLFW.WindowFromId(winid);
- if (!win) return 0;
- return win.keys[key];
- },getMouseButton:function (winid, button) {
- var win = GLFW.WindowFromId(winid);
- if (!win) return 0;
- return (win.buttons & (1 << button)) > 0;
- },getCursorPos:function (winid, x, y) {
- setValue(x, Browser.mouseX, 'double');
- setValue(y, Browser.mouseY, 'double');
- },getMousePos:function (winid, x, y) {
- setValue(x, Browser.mouseX, 'i32');
- setValue(y, Browser.mouseY, 'i32');
- },setCursorPos:function (winid, x, y) {
- },getWindowPos:function (winid, x, y) {
- var wx = 0;
- var wy = 0;
-
- var win = GLFW.WindowFromId(winid);
- if (win) {
- wx = win.x;
- wy = win.y;
- }
-
- setValue(x, wx, 'i32');
- setValue(y, wy, 'i32');
- },setWindowPos:function (winid, x, y) {
- var win = GLFW.WindowFromId(winid);
- if (!win) return;
- win.x = x;
- win.y = y;
- },getWindowSize:function (winid, width, height) {
- var ww = 0;
- var wh = 0;
-
- var win = GLFW.WindowFromId(winid);
- if (win) {
- ww = win.width;
- wh = win.height;
- }
-
- setValue(width, ww, 'i32');
- setValue(height, wh, 'i32');
- },setWindowSize:function (winid, width, height) {
- var win = GLFW.WindowFromId(winid);
- if (!win) return;
-
- if (GLFW.active.id == win.id) {
- if (width == screen.width && height == screen.height) {
- GLFW.requestFullscreen();
- } else {
- GLFW.exitFullscreen();
- Browser.setCanvasSize(width, height);
- win.width = width;
- win.height = height;
- }
- }
-
- if (!win.windowSizeFunc) return;
-
-
- Module['dynCall_viii'](win.windowSizeFunc, win.id, width, height);
- },createWindow:function (width, height, title, monitor, share) {
- var i, id;
- for (i = 0; i < GLFW.windows.length && GLFW.windows[i] !== null; i++);
- if (i > 0) throw "glfwCreateWindow only supports one window at time currently";
-
- // id for window
- id = i + 1;
-
- // not valid
- if (width <= 0 || height <= 0) return 0;
-
- if (monitor) {
- GLFW.requestFullscreen();
- } else {
- Browser.setCanvasSize(width, height);
- }
-
- // Create context when there are no existing alive windows
- for (i = 0; i < GLFW.windows.length && GLFW.windows[i] == null; i++);
- if (i == GLFW.windows.length) {
- var contextAttributes = {
- antialias: (GLFW.hints[0x0002100D] > 1), // GLFW_SAMPLES
- depth: (GLFW.hints[0x00021005] > 0), // GLFW_DEPTH_BITS
- stencil: (GLFW.hints[0x00021006] > 0), // GLFW_STENCIL_BITS
- alpha: (GLFW.hints[0x00021004] > 0) // GLFW_ALPHA_BITS
- }
- Module.ctx = Browser.createContext(Module['canvas'], true, true, contextAttributes);
- }
-
- // If context creation failed, do not return a valid window
- if (!Module.ctx) return 0;
-
- // Get non alive id
- var win = new GLFW.Window(id, width, height, title, monitor, share);
-
- // Set window to array
- if (id - 1 == GLFW.windows.length) {
- GLFW.windows.push(win);
- } else {
- GLFW.windows[id - 1] = win;
- }
-
- GLFW.active = win;
- return win.id;
- },destroyWindow:function (winid) {
- var win = GLFW.WindowFromId(winid);
- if (!win) return;
-
- if (win.windowCloseFunc)
- Module['dynCall_vi'](win.windowCloseFunc, win.id);
-
- GLFW.windows[win.id - 1] = null;
- if (GLFW.active.id == win.id)
- GLFW.active = null;
-
- // Destroy context when no alive windows
- for (var i = 0; i < GLFW.windows.length; i++)
- if (GLFW.windows[i] !== null) return;
-
- Module.ctx = Browser.destroyContext(Module['canvas'], true, true);
- },swapBuffers:function (winid) {
- },GLFW2ParamToGLFW3Param:function (param) {
- table = {
- 0x00030001:0, // GLFW_MOUSE_CURSOR
- 0x00030002:0, // GLFW_STICKY_KEYS
- 0x00030003:0, // GLFW_STICKY_MOUSE_BUTTONS
- 0x00030004:0, // GLFW_SYSTEM_KEYS
- 0x00030005:0, // GLFW_KEY_REPEAT
- 0x00030006:0, // GLFW_AUTO_POLL_EVENTS
- 0x00020001:0, // GLFW_OPENED
- 0x00020002:0, // GLFW_ACTIVE
- 0x00020003:0, // GLFW_ICONIFIED
- 0x00020004:0, // GLFW_ACCELERATED
- 0x00020005:0x00021001, // GLFW_RED_BITS
- 0x00020006:0x00021002, // GLFW_GREEN_BITS
- 0x00020007:0x00021003, // GLFW_BLUE_BITS
- 0x00020008:0x00021004, // GLFW_ALPHA_BITS
- 0x00020009:0x00021005, // GLFW_DEPTH_BITS
- 0x0002000A:0x00021006, // GLFW_STENCIL_BITS
- 0x0002000B:0x0002100F, // GLFW_REFRESH_RATE
- 0x0002000C:0x00021007, // GLFW_ACCUM_RED_BITS
- 0x0002000D:0x00021008, // GLFW_ACCUM_GREEN_BITS
- 0x0002000E:0x00021009, // GLFW_ACCUM_BLUE_BITS
- 0x0002000F:0x0002100A, // GLFW_ACCUM_ALPHA_BITS
- 0x00020010:0x0002100B, // GLFW_AUX_BUFFERS
- 0x00020011:0x0002100C, // GLFW_STEREO
- 0x00020012:0, // GLFW_WINDOW_NO_RESIZE
- 0x00020013:0x0002100D, // GLFW_FSAA_SAMPLES
- 0x00020014:0x00022002, // GLFW_OPENGL_VERSION_MAJOR
- 0x00020015:0x00022003, // GLFW_OPENGL_VERSION_MINOR
- 0x00020016:0x00022006, // GLFW_OPENGL_FORWARD_COMPAT
- 0x00020017:0x00022007, // GLFW_OPENGL_DEBUG_CONTEXT
- 0x00020018:0x00022008, // GLFW_OPENGL_PROFILE
- };
- return table[param];
- }};function _glfwGetVideoModes(monitor, count) {
- setValue(count, 0, 'i32');
- return 0;
- }
- function _glLinkProgram(program) {
- GLctx.linkProgram(GL.programs[program]);
- GL.programInfos[program] = null; // uniforms no longer keep the same names after linking
- GL.populateUniformTable(program);
- }
- function _glBindTexture(target, texture) {
- GLctx.bindTexture(target, texture ? GL.textures[texture] : null);
- }
- function _emscripten_glStencilFunc(x0, x1, x2) { GLctx['stencilFunc'](x0, x1, x2) }
- function _glGetString(name_) {
- if (GL.stringCache[name_]) return GL.stringCache[name_];
- var ret;
- switch(name_) {
- case 0x1F00 /* GL_VENDOR */:
- case 0x1F01 /* GL_RENDERER */:
- case 0x9245 /* UNMASKED_VENDOR_WEBGL */:
- case 0x9246 /* UNMASKED_RENDERER_WEBGL */:
- ret = allocate(intArrayFromString(GLctx.getParameter(name_)), 'i8', ALLOC_NORMAL);
- break;
- case 0x1F02 /* GL_VERSION */:
- var glVersion = GLctx.getParameter(GLctx.VERSION);
- // return GLES version string corresponding to the version of the WebGL context
- {
- glVersion = 'OpenGL ES 2.0 (' + glVersion + ')';
- }
- ret = allocate(intArrayFromString(glVersion), 'i8', ALLOC_NORMAL);
- break;
- case 0x1F03 /* GL_EXTENSIONS */:
- var exts = GLctx.getSupportedExtensions();
- var gl_exts = [];
- for (var i = 0; i < exts.length; ++i) {
- gl_exts.push(exts[i]);
- gl_exts.push("GL_" + exts[i]);
- }
- ret = allocate(intArrayFromString(gl_exts.join(' ')), 'i8', ALLOC_NORMAL);
- break;
- case 0x8B8C /* GL_SHADING_LANGUAGE_VERSION */:
- var glslVersion = GLctx.getParameter(GLctx.SHADING_LANGUAGE_VERSION);
- // extract the version number 'N.M' from the string 'WebGL GLSL ES N.M ...'
- var ver_re = /^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/;
- var ver_num = glslVersion.match(ver_re);
- if (ver_num !== null) {
- if (ver_num[1].length == 3) ver_num[1] = ver_num[1] + '0'; // ensure minor version has 2 digits
- glslVersion = 'OpenGL ES GLSL ES ' + ver_num[1] + ' (' + glslVersion + ')';
- }
- ret = allocate(intArrayFromString(glslVersion), 'i8', ALLOC_NORMAL);
- break;
- default:
- GL.recordError(0x0500/*GL_INVALID_ENUM*/);
- return 0;
- }
- GL.stringCache[name_] = ret;
- return ret;
- }
- function _emscripten_glUniform3iv(location, count, value) {
-
-
- GLctx.uniform3iv(GL.uniforms[location], HEAP32.subarray((value)>>2,(value+count*12)>>2));
- }
- function _emscripten_glShaderSource(shader, count, string, length) {
- var source = GL.getSource(shader, count, string, length);
-
-
- GLctx.shaderSource(GL.shaders[shader], source);
- }
- function _emscripten_glReleaseShaderCompiler() {
- // NOP (as allowed by GLES 2.0 spec)
- }
- function _glDeleteProgram(id) {
- if (!id) return;
- var program = GL.programs[id];
- if (!program) { // glDeleteProgram actually signals an error when deleting a nonexisting object, unlike some other GL delete functions.
- GL.recordError(0x0501 /* GL_INVALID_VALUE */);
- return;
- }
- GLctx.deleteProgram(program);
- program.name = 0;
- GL.programs[id] = null;
- GL.programInfos[id] = null;
- }
- function _emscripten_glTexParameterf(x0, x1, x2) { GLctx['texParameterf'](x0, x1, x2) }
- function _emscripten_glTexParameteri(x0, x1, x2) { GLctx['texParameteri'](x0, x1, x2) }
- function _glCompileShader(shader) {
- GLctx.compileShader(GL.shaders[shader]);
- }
-
-
-
- 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};
-
- 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"};
-
- function ___setErrNo(value) {
- if (Module['___errno_location']) HEAP32[((Module['___errno_location']())>>2)]=value;
- else Module.printErr('failed to set errno from JS');
- return value;
- }
-
- var PATH={splitPath:function (filename) {
- var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
- return splitPathRe.exec(filename).slice(1);
- },normalizeArray:function (parts, allowAboveRoot) {
- // if the path tries to go above the root, `up` ends up > 0
- var up = 0;
- for (var i = parts.length - 1; i >= 0; i--) {
- var last = parts[i];
- if (last === '.') {
- parts.splice(i, 1);
- } else if (last === '..') {
- parts.splice(i, 1);
- up++;
- } else if (up) {
- parts.splice(i, 1);
- up--;
- }
- }
- // if the path is allowed to go above the root, restore leading ..s
- if (allowAboveRoot) {
- for (; up--; up) {
- parts.unshift('..');
- }
- }
- return parts;
- },normalize:function (path) {
- var isAbsolute = path.charAt(0) === '/',
- trailingSlash = path.substr(-1) === '/';
- // Normalize the path
- path = PATH.normalizeArray(path.split('/').filter(function(p) {
- return !!p;
- }), !isAbsolute).join('/');
- if (!path && !isAbsolute) {
- path = '.';
- }
- if (path && trailingSlash) {
- path += '/';
- }
- return (isAbsolute ? '/' : '') + path;
- },dirname:function (path) {
- var result = PATH.splitPath(path),
- root = result[0],
- dir = result[1];
- if (!root && !dir) {
- // No dirname whatsoever
- return '.';
- }
- if (dir) {
- // It has a dirname, strip trailing slash
- dir = dir.substr(0, dir.length - 1);
- }
- return root + dir;
- },basename:function (path) {
- // EMSCRIPTEN return '/'' for '/', not an empty string
- if (path === '/') return '/';
- var lastSlash = path.lastIndexOf('/');
- if (lastSlash === -1) return path;
- return path.substr(lastSlash+1);
- },extname:function (path) {
- return PATH.splitPath(path)[3];
- },join:function () {
- var paths = Array.prototype.slice.call(arguments, 0);
- return PATH.normalize(paths.join('/'));
- },join2:function (l, r) {
- return PATH.normalize(l + '/' + r);
- },resolve:function () {
- var resolvedPath = '',
- resolvedAbsolute = false;
- for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
- var path = (i >= 0) ? arguments[i] : FS.cwd();
- // Skip empty and invalid entries
- if (typeof path !== 'string') {
- throw new TypeError('Arguments to path.resolve must be strings');
- } else if (!path) {
- return ''; // an invalid portion invalidates the whole thing
- }
- resolvedPath = path + '/' + resolvedPath;
- resolvedAbsolute = path.charAt(0) === '/';
- }
- // At this point the path should be resolved to a full absolute path, but
- // handle relative paths to be safe (might happen when process.cwd() fails)
- resolvedPath = PATH.normalizeArray(resolvedPath.split('/').filter(function(p) {
- return !!p;
- }), !resolvedAbsolute).join('/');
- return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
- },relative:function (from, to) {
- from = PATH.resolve(from).substr(1);
- to = PATH.resolve(to).substr(1);
- function trim(arr) {
- var start = 0;
- for (; start < arr.length; start++) {
- if (arr[start] !== '') break;
- }
- var end = arr.length - 1;
- for (; end >= 0; end--) {
- if (arr[end] !== '') break;
- }
- if (start > end) return [];
- return arr.slice(start, end - start + 1);
- }
- var fromParts = trim(from.split('/'));
- var toParts = trim(to.split('/'));
- var length = Math.min(fromParts.length, toParts.length);
- var samePartsLength = length;
- for (var i = 0; i < length; i++) {
- if (fromParts[i] !== toParts[i]) {
- samePartsLength = i;
- break;
- }
- }
- var outputParts = [];
- for (var i = samePartsLength; i < fromParts.length; i++) {
- outputParts.push('..');
- }
- outputParts = outputParts.concat(toParts.slice(samePartsLength));
- return outputParts.join('/');
- }};
-
- var TTY={ttys:[],init:function () {
- // https://github.com/kripken/emscripten/pull/1555
- // if (ENVIRONMENT_IS_NODE) {
- // // currently, FS.init does not distinguish if process.stdin is a file or TTY
- // // device, it always assumes it's a TTY device. because of this, we're forcing
- // // process.stdin to UTF8 encoding to at least make stdin reading compatible
- // // with text files until FS.init can be refactored.
- // process['stdin']['setEncoding']('utf8');
- // }
- },shutdown:function () {
- // https://github.com/kripken/emscripten/pull/1555
- // if (ENVIRONMENT_IS_NODE) {
- // // inolen: any idea as to why node -e 'process.stdin.read()' wouldn't exit immediately (with process.stdin being a tty)?
- // // 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
- // // inolen: I thought read() in that case was a synchronous operation that just grabbed some amount of buffered data if it exists?
- // // isaacs: it is. but it also triggers a _read() call, which calls readStart() on the handle
- // // isaacs: do process.stdin.pause() and i'd think it'd probably close the pending call
- // process['stdin']['pause']();
- // }
- },register:function (dev, ops) {
- TTY.ttys[dev] = { input: [], output: [], ops: ops };
- FS.registerDevice(dev, TTY.stream_ops);
- },stream_ops:{open:function (stream) {
- var tty = TTY.ttys[stream.node.rdev];
- if (!tty) {
- throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
- }
- stream.tty = tty;
- stream.seekable = false;
- },close:function (stream) {
- // flush any pending line data
- stream.tty.ops.flush(stream.tty);
- },flush:function (stream) {
- stream.tty.ops.flush(stream.tty);
- },read:function (stream, buffer, offset, length, pos /* ignored */) {
- if (!stream.tty || !stream.tty.ops.get_char) {
- throw new FS.ErrnoError(ERRNO_CODES.ENXIO);
- }
- var bytesRead = 0;
- for (var i = 0; i < length; i++) {
- var result;
- try {
- result = stream.tty.ops.get_char(stream.tty);
- } catch (e) {
- throw new FS.ErrnoError(ERRNO_CODES.EIO);
- }
- if (result === undefined && bytesRead === 0) {
- throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
- }
- if (result === null || result === undefined) break;
- bytesRead++;
- buffer[offset+i] = result;
- }
- if (bytesRead) {
- stream.node.timestamp = Date.now();
- }
- return bytesRead;
- },write:function (stream, buffer, offset, length, pos) {
- if (!stream.tty || !stream.tty.ops.put_char) {
- throw new FS.ErrnoError(ERRNO_CODES.ENXIO);
- }
- for (var i = 0; i < length; i++) {
- try {
- stream.tty.ops.put_char(stream.tty, buffer[offset+i]);
- } catch (e) {
- throw new FS.ErrnoError(ERRNO_CODES.EIO);
- }
- }
- if (length) {
- stream.node.timestamp = Date.now();
- }
- return i;
- }},default_tty_ops:{get_char:function (tty) {
- if (!tty.input.length) {
- var result = null;
- if (ENVIRONMENT_IS_NODE) {
- // we will read data by chunks of BUFSIZE
- var BUFSIZE = 256;
- var buf = new Buffer(BUFSIZE);
- var bytesRead = 0;
-
- var isPosixPlatform = (process.platform != 'win32'); // Node doesn't offer a direct check, so test by exclusion
-
- var fd = process.stdin.fd;
- if (isPosixPlatform) {
- // Linux and Mac cannot use process.stdin.fd (which isn't set up as sync)
- var usingDevice = false;
- try {
- fd = fs.openSync('/dev/stdin', 'r');
- usingDevice = true;
- } catch (e) {}
- }
-
- try {
- bytesRead = fs.readSync(fd, buf, 0, BUFSIZE, null);
- } catch(e) {
- // Cross-platform differences: on Windows, reading EOF throws an exception, but on other OSes,
- // reading EOF returns 0. Uniformize behavior by treating the EOF exception to return 0.
- if (e.toString().indexOf('EOF') != -1) bytesRead = 0;
- else throw e;
- }
-
- if (usingDevice) { fs.closeSync(fd); }
- if (bytesRead > 0) {
- result = buf.slice(0, bytesRead).toString('utf-8');
- } else {
- result = null;
- }
-
- } else if (typeof window != 'undefined' &&
- typeof window.prompt == 'function') {
- // Browser.
- result = window.prompt('Input: '); // returns null on cancel
- if (result !== null) {
- result += '\n';
- }
- } else if (typeof readline == 'function') {
- // Command line.
- result = readline();
- if (result !== null) {
- result += '\n';
- }
- }
- if (!result) {
- return null;
- }
- tty.input = intArrayFromString(result, true);
- }
- return tty.input.shift();
- },put_char:function (tty, val) {
- if (val === null || val === 10) {
- Module['print'](UTF8ArrayToString(tty.output, 0));
- tty.output = [];
- } else {
- if (val != 0) tty.output.push(val); // val == 0 would cut text output off in the middle.
- }
- },flush:function (tty) {
- if (tty.output && tty.output.length > 0) {
- Module['print'](UTF8ArrayToString(tty.output, 0));
- tty.output = [];
- }
- }},default_tty1_ops:{put_char:function (tty, val) {
- if (val === null || val === 10) {
- Module['printErr'](UTF8ArrayToString(tty.output, 0));
- tty.output = [];
- } else {
- if (val != 0) tty.output.push(val);
- }
- },flush:function (tty) {
- if (tty.output && tty.output.length > 0) {
- Module['printErr'](UTF8ArrayToString(tty.output, 0));
- tty.output = [];
- }
- }}};
-
- var MEMFS={ops_table:null,mount:function (mount) {
- return MEMFS.createNode(null, '/', 16384 | 511 /* 0777 */, 0);
- },createNode:function (parent, name, mode, dev) {
- if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {
- // no supported
- throw new FS.ErrnoError(ERRNO_CODES.EPERM);
- }
- if (!MEMFS.ops_table) {
- MEMFS.ops_table = {
- dir: {
- node: {
- getattr: MEMFS.node_ops.getattr,
- setattr: MEMFS.node_ops.setattr,
- lookup: MEMFS.node_ops.lookup,
- mknod: MEMFS.node_ops.mknod,
- rename: MEMFS.node_ops.rename,
- unlink: MEMFS.node_ops.unlink,
- rmdir: MEMFS.node_ops.rmdir,
- readdir: MEMFS.node_ops.readdir,
- symlink: MEMFS.node_ops.symlink
- },
- stream: {
- llseek: MEMFS.stream_ops.llseek
- }
- },
- file: {
- node: {
- getattr: MEMFS.node_ops.getattr,
- setattr: MEMFS.node_ops.setattr
- },
- stream: {
- llseek: MEMFS.stream_ops.llseek,
- read: MEMFS.stream_ops.read,
- write: MEMFS.stream_ops.write,
- allocate: MEMFS.stream_ops.allocate,
- mmap: MEMFS.stream_ops.mmap,
- msync: MEMFS.stream_ops.msync
- }
- },
- link: {
- node: {
- getattr: MEMFS.node_ops.getattr,
- setattr: MEMFS.node_ops.setattr,
- readlink: MEMFS.node_ops.readlink
- },
- stream: {}
- },
- chrdev: {
- node: {
- getattr: MEMFS.node_ops.getattr,
- setattr: MEMFS.node_ops.setattr
- },
- stream: FS.chrdev_stream_ops
- }
- };
- }
- var node = FS.createNode(parent, name, mode, dev);
- if (FS.isDir(node.mode)) {
- node.node_ops = MEMFS.ops_table.dir.node;
- node.stream_ops = MEMFS.ops_table.dir.stream;
- node.contents = {};
- } else if (FS.isFile(node.mode)) {
- node.node_ops = MEMFS.ops_table.file.node;
- node.stream_ops = MEMFS.ops_table.file.stream;
- node.usedBytes = 0; // The actual number of bytes used in the typed array, as opposed to contents.length which gives the whole capacity.
- // 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
- // for performance, and used by default. However, typed arrays are not resizable like normal JS arrays are, so there is a small disk size
- // penalty involved for appending file writes that continuously grow a file similar to std::vector capacity vs used -scheme.
- node.contents = null;
- } else if (FS.isLink(node.mode)) {
- node.node_ops = MEMFS.ops_table.link.node;
- node.stream_ops = MEMFS.ops_table.link.stream;
- } else if (FS.isChrdev(node.mode)) {
- node.node_ops = MEMFS.ops_table.chrdev.node;
- node.stream_ops = MEMFS.ops_table.chrdev.stream;
- }
- node.timestamp = Date.now();
- // add the new node to the parent
- if (parent) {
- parent.contents[name] = node;
- }
- return node;
- },getFileDataAsRegularArray:function (node) {
- if (node.contents && node.contents.subarray) {
- var arr = [];
- for (var i = 0; i < node.usedBytes; ++i) arr.push(node.contents[i]);
- return arr; // Returns a copy of the original data.
- }
- return node.contents; // No-op, the file contents are already in a JS array. Return as-is.
- },getFileDataAsTypedArray:function (node) {
- if (!node.contents) return new Uint8Array;
- if (node.contents.subarray) return node.contents.subarray(0, node.usedBytes); // Make sure to not return excess unused bytes.
- return new Uint8Array(node.contents);
- },expandFileStorage:function (node, newCapacity) {
- // 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
- // instead of a typed array. This makes resizing the array more flexible because we can just .push() elements at the back to
- // increase the size.
- if (node.contents && node.contents.subarray && newCapacity > node.contents.length) {
- node.contents = MEMFS.getFileDataAsRegularArray(node);
- node.usedBytes = node.contents.length; // We might be writing to a lazy-loaded file which had overridden this property, so force-reset it.
- }
-
- 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.
- var prevCapacity = node.contents ? node.contents.length : 0;
- if (prevCapacity >= newCapacity) return; // No need to expand, the storage was already large enough.
- // Don't expand strictly to the given requested limit if it's only a very small increase, but instead geometrically grow capacity.
- // For small filesizes (<1MB), perform size*2 geometric increase, but for large sizes, do a much more conservative size*1.125 increase to
- // avoid overshooting the allocation cap by a very large margin.
- var CAPACITY_DOUBLING_MAX = 1024 * 1024;
- newCapacity = Math.max(newCapacity, (prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2.0 : 1.125)) | 0);
- if (prevCapacity != 0) newCapacity = Math.max(newCapacity, 256); // At minimum allocate 256b for each file when expanding.
- var oldContents = node.contents;
- node.contents = new Uint8Array(newCapacity); // Allocate new storage.
- if (node.usedBytes > 0) node.contents.set(oldContents.subarray(0, node.usedBytes), 0); // Copy old data over to the new storage.
- return;
- }
- // Not using a typed array to back the file storage. Use a standard JS array instead.
- if (!node.contents && newCapacity > 0) node.contents = [];
- while (node.contents.length < newCapacity) node.contents.push(0);
- },resizeFileStorage:function (node, newSize) {
- if (node.usedBytes == newSize) return;
- if (newSize == 0) {
- node.contents = null; // Fully decommit when requesting a resize to zero.
- node.usedBytes = 0;
- return;
- }
- if (!node.contents || node.contents.subarray) { // Resize a typed array if that is being used as the backing store.
- var oldContents = node.contents;
- node.contents = new Uint8Array(new ArrayBuffer(newSize)); // Allocate new storage.
- if (oldContents) {
- node.contents.set(oldContents.subarray(0, Math.min(newSize, node.usedBytes))); // Copy old data over to the new storage.
- }
- node.usedBytes = newSize;
- return;
- }
- // Backing with a JS array.
- if (!node.contents) node.contents = [];
- if (node.contents.length > newSize) node.contents.length = newSize;
- else while (node.contents.length < newSize) node.contents.push(0);
- node.usedBytes = newSize;
- },node_ops:{getattr:function (node) {
- var attr = {};
- // device numbers reuse inode numbers.
- attr.dev = FS.isChrdev(node.mode) ? node.id : 1;
- attr.ino = node.id;
- attr.mode = node.mode;
- attr.nlink = 1;
- attr.uid = 0;
- attr.gid = 0;
- attr.rdev = node.rdev;
- if (FS.isDir(node.mode)) {
- attr.size = 4096;
- } else if (FS.isFile(node.mode)) {
- attr.size = node.usedBytes;
- } else if (FS.isLink(node.mode)) {
- attr.size = node.link.length;
- } else {
- attr.size = 0;
- }
- attr.atime = new Date(node.timestamp);
- attr.mtime = new Date(node.timestamp);
- attr.ctime = new Date(node.timestamp);
- // NOTE: In our implementation, st_blocks = Math.ceil(st_size/st_blksize),
- // but this is not required by the standard.
- attr.blksize = 4096;
- attr.blocks = Math.ceil(attr.size / attr.blksize);
- return attr;
- },setattr:function (node, attr) {
- if (attr.mode !== undefined) {
- node.mode = attr.mode;
- }
- if (attr.timestamp !== undefined) {
- node.timestamp = attr.timestamp;
- }
- if (attr.size !== undefined) {
- MEMFS.resizeFileStorage(node, attr.size);
- }
- },lookup:function (parent, name) {
- throw FS.genericErrors[ERRNO_CODES.ENOENT];
- },mknod:function (parent, name, mode, dev) {
- return MEMFS.createNode(parent, name, mode, dev);
- },rename:function (old_node, new_dir, new_name) {
- // if we're overwriting a directory at new_name, make sure it's empty.
- if (FS.isDir(old_node.mode)) {
- var new_node;
- try {
- new_node = FS.lookupNode(new_dir, new_name);
- } catch (e) {
- }
- if (new_node) {
- for (var i in new_node.contents) {
- throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
- }
- }
- }
- // do the internal rewiring
- delete old_node.parent.contents[old_node.name];
- old_node.name = new_name;
- new_dir.contents[new_name] = old_node;
- old_node.parent = new_dir;
- },unlink:function (parent, name) {
- delete parent.contents[name];
- },rmdir:function (parent, name) {
- var node = FS.lookupNode(parent, name);
- for (var i in node.contents) {
- throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
- }
- delete parent.contents[name];
- },readdir:function (node) {
- var entries = ['.', '..']
- for (var key in node.contents) {
- if (!node.contents.hasOwnProperty(key)) {
- continue;
- }
- entries.push(key);
- }
- return entries;
- },symlink:function (parent, newname, oldpath) {
- var node = MEMFS.createNode(parent, newname, 511 /* 0777 */ | 40960, 0);
- node.link = oldpath;
- return node;
- },readlink:function (node) {
- if (!FS.isLink(node.mode)) {
- throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
- }
- return node.link;
- }},stream_ops:{read:function (stream, buffer, offset, length, position) {
- var contents = stream.node.contents;
- if (position >= stream.node.usedBytes) return 0;
- var size = Math.min(stream.node.usedBytes - position, length);
- assert(size >= 0);
- if (size > 8 && contents.subarray) { // non-trivial, and typed array
- buffer.set(contents.subarray(position, position + size), offset);
- } else {
- for (var i = 0; i < size; i++) buffer[offset + i] = contents[position + i];
- }
- return size;
- },write:function (stream, buffer, offset, length, position, canOwn) {
- if (!length) return 0;
- var node = stream.node;
- node.timestamp = Date.now();
-
- if (buffer.subarray && (!node.contents || node.contents.subarray)) { // This write is from a typed array to a typed array?
- if (canOwn) {
- assert(position === 0, 'canOwn must imply no weird position inside the file');
- node.contents = buffer.subarray(offset, offset + length);
- node.usedBytes = length;
- return length;
- } 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.
- node.contents = new Uint8Array(buffer.subarray(offset, offset + length));
- node.usedBytes = length;
- return length;
- } else if (position + length <= node.usedBytes) { // Writing to an already allocated and used subrange of the file?
- node.contents.set(buffer.subarray(offset, offset + length), position);
- return length;
- }
- }
-
- // Appending to an existing file and we need to reallocate, or source data did not come as a typed array.
- MEMFS.expandFileStorage(node, position+length);
- if (node.contents.subarray && buffer.subarray) node.contents.set(buffer.subarray(offset, offset + length), position); // Use typed array write if available.
- else {
- for (var i = 0; i < length; i++) {
- node.contents[position + i] = buffer[offset + i]; // Or fall back to manual write if not.
- }
- }
- node.usedBytes = Math.max(node.usedBytes, position+length);
- return length;
- },llseek:function (stream, offset, whence) {
- var position = offset;
- if (whence === 1) { // SEEK_CUR.
- position += stream.position;
- } else if (whence === 2) { // SEEK_END.
- if (FS.isFile(stream.node.mode)) {
- position += stream.node.usedBytes;
- }
- }
- if (position < 0) {
- throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
- }
- return position;
- },allocate:function (stream, offset, length) {
- MEMFS.expandFileStorage(stream.node, offset + length);
- stream.node.usedBytes = Math.max(stream.node.usedBytes, offset + length);
- },mmap:function (stream, buffer, offset, length, position, prot, flags) {
- if (!FS.isFile(stream.node.mode)) {
- throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
- }
- var ptr;
- var allocated;
- var contents = stream.node.contents;
- // Only make a new copy when MAP_PRIVATE is specified.
- if ( !(flags & 2) &&
- (contents.buffer === buffer || contents.buffer === buffer.buffer) ) {
- // We can't emulate MAP_SHARED when the file is not backed by the buffer
- // we're mapping to (e.g. the HEAP buffer).
- allocated = false;
- ptr = contents.byteOffset;
- } else {
- // Try to avoid unnecessary slices.
- if (position > 0 || position + length < stream.node.usedBytes) {
- if (contents.subarray) {
- contents = contents.subarray(position, position + length);
- } else {
- contents = Array.prototype.slice.call(contents, position, position + length);
- }
- }
- allocated = true;
- ptr = _malloc(length);
- if (!ptr) {
- throw new FS.ErrnoError(ERRNO_CODES.ENOMEM);
- }
- buffer.set(contents, ptr);
- }
- return { ptr: ptr, allocated: allocated };
- },msync:function (stream, buffer, offset, length, mmapFlags) {
- if (!FS.isFile(stream.node.mode)) {
- throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
- }
- if (mmapFlags & 2) {
- // MAP_PRIVATE calls need not to be synced back to underlying fs
- return 0;
- }
-
- var bytesWritten = MEMFS.stream_ops.write(stream, buffer, 0, length, offset, false);
- // should we check if bytesWritten and length are the same?
- return 0;
- }}};
-
- var IDBFS={dbs:{},indexedDB:function () {
- if (typeof indexedDB !== 'undefined') return indexedDB;
- var ret = null;
- if (typeof window === 'object') ret = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
- assert(ret, 'IDBFS used, but indexedDB not supported');
- return ret;
- },DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",mount:function (mount) {
- // reuse all of the core MEMFS functionality
- return MEMFS.mount.apply(null, arguments);
- },syncfs:function (mount, populate, callback) {
- IDBFS.getLocalSet(mount, function(err, local) {
- if (err) return callback(err);
-
- IDBFS.getRemoteSet(mount, function(err, remote) {
- if (err) return callback(err);
-
- var src = populate ? remote : local;
- var dst = populate ? local : remote;
-
- IDBFS.reconcile(src, dst, callback);
- });
- });
- },getDB:function (name, callback) {
- // check the cache first
- var db = IDBFS.dbs[name];
- if (db) {
- return callback(null, db);
- }
-
- var req;
- try {
- req = IDBFS.indexedDB().open(name, IDBFS.DB_VERSION);
- } catch (e) {
- return callback(e);
- }
- if (!req) {
- return callback("Unable to connect to IndexedDB");
- }
- req.onupgradeneeded = function(e) {
- var db = e.target.result;
- var transaction = e.target.transaction;
-
- var fileStore;
-
- if (db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)) {
- fileStore = transaction.objectStore(IDBFS.DB_STORE_NAME);
- } else {
- fileStore = db.createObjectStore(IDBFS.DB_STORE_NAME);
- }
-
- if (!fileStore.indexNames.contains('timestamp')) {
- fileStore.createIndex('timestamp', 'timestamp', { unique: false });
- }
- };
- req.onsuccess = function() {
- db = req.result;
-
- // add to the cache
- IDBFS.dbs[name] = db;
- callback(null, db);
- };
- req.onerror = function(e) {
- callback(this.error);
- e.preventDefault();
- };
- },getLocalSet:function (mount, callback) {
- var entries = {};
-
- function isRealDir(p) {
- return p !== '.' && p !== '..';
- };
- function toAbsolute(root) {
- return function(p) {
- return PATH.join2(root, p);
- }
- };
-
- var check = FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));
-
- while (check.length) {
- var path = check.pop();
- var stat;
-
- try {
- stat = FS.stat(path);
- } catch (e) {
- return callback(e);
- }
-
- if (FS.isDir(stat.mode)) {
- check.push.apply(check, FS.readdir(path).filter(isRealDir).map(toAbsolute(path)));
- }
-
- entries[path] = { timestamp: stat.mtime };
- }
-
- return callback(null, { type: 'local', entries: entries });
- },getRemoteSet:function (mount, callback) {
- var entries = {};
-
- IDBFS.getDB(mount.mountpoint, function(err, db) {
- if (err) return callback(err);
-
- var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readonly');
- transaction.onerror = function(e) {
- callback(this.error);
- e.preventDefault();
- };
-
- var store = transaction.objectStore(IDBFS.DB_STORE_NAME);
- var index = store.index('timestamp');
-
- index.openKeyCursor().onsuccess = function(event) {
- var cursor = event.target.result;
-
- if (!cursor) {
- return callback(null, { type: 'remote', db: db, entries: entries });
- }
-
- entries[cursor.primaryKey] = { timestamp: cursor.key };
-
- cursor.continue();
- };
- });
- },loadLocalEntry:function (path, callback) {
- var stat, node;
-
- try {
- var lookup = FS.lookupPath(path);
- node = lookup.node;
- stat = FS.stat(path);
- } catch (e) {
- return callback(e);
- }
-
- if (FS.isDir(stat.mode)) {
- return callback(null, { timestamp: stat.mtime, mode: stat.mode });
- } else if (FS.isFile(stat.mode)) {
- // Performance consideration: storing a normal JavaScript array to a IndexedDB is much slower than storing a typed array.
- // Therefore always convert the file contents to a typed array first before writing the data to IndexedDB.
- node.contents = MEMFS.getFileDataAsTypedArray(node);
- return callback(null, { timestamp: stat.mtime, mode: stat.mode, contents: node.contents });
- } else {
- return callback(new Error('node type not supported'));
- }
- },storeLocalEntry:function (path, entry, callback) {
- try {
- if (FS.isDir(entry.mode)) {
- FS.mkdir(path, entry.mode);
- } else if (FS.isFile(entry.mode)) {
- FS.writeFile(path, entry.contents, { encoding: 'binary', canOwn: true });
- } else {
- return callback(new Error('node type not supported'));
- }
-
- FS.chmod(path, entry.mode);
- FS.utime(path, entry.timestamp, entry.timestamp);
- } catch (e) {
- return callback(e);
- }
-
- callback(null);
- },removeLocalEntry:function (path, callback) {
- try {
- var lookup = FS.lookupPath(path);
- var stat = FS.stat(path);
-
- if (FS.isDir(stat.mode)) {
- FS.rmdir(path);
- } else if (FS.isFile(stat.mode)) {
- FS.unlink(path);
- }
- } catch (e) {
- return callback(e);
- }
-
- callback(null);
- },loadRemoteEntry:function (store, path, callback) {
- var req = store.get(path);
- req.onsuccess = function(event) { callback(null, event.target.result); };
- req.onerror = function(e) {
- callback(this.error);
- e.preventDefault();
- };
- },storeRemoteEntry:function (store, path, entry, callback) {
- var req = store.put(entry, path);
- req.onsuccess = function() { callback(null); };
- req.onerror = function(e) {
- callback(this.error);
- e.preventDefault();
- };
- },removeRemoteEntry:function (store, path, callback) {
- var req = store.delete(path);
- req.onsuccess = function() { callback(null); };
- req.onerror = function(e) {
- callback(this.error);
- e.preventDefault();
- };
- },reconcile:function (src, dst, callback) {
- var total = 0;
-
- var create = [];
- Object.keys(src.entries).forEach(function (key) {
- var e = src.entries[key];
- var e2 = dst.entries[key];
- if (!e2 || e.timestamp > e2.timestamp) {
- create.push(key);
- total++;
- }
- });
-
- var remove = [];
- Object.keys(dst.entries).forEach(function (key) {
- var e = dst.entries[key];
- var e2 = src.entries[key];
- if (!e2) {
- remove.push(key);
- total++;
- }
- });
-
- if (!total) {
- return callback(null);
- }
-
- var errored = false;
- var completed = 0;
- var db = src.type === 'remote' ? src.db : dst.db;
- var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readwrite');
- var store = transaction.objectStore(IDBFS.DB_STORE_NAME);
-
- function done(err) {
- if (err) {
- if (!done.errored) {
- done.errored = true;
- return callback(err);
- }
- return;
- }
- if (++completed >= total) {
- return callback(null);
- }
- };
-
- transaction.onerror = function(e) {
- done(this.error);
- e.preventDefault();
- };
-
- // sort paths in ascending order so directory entries are created
- // before the files inside them
- create.sort().forEach(function (path) {
- if (dst.type === 'local') {
- IDBFS.loadRemoteEntry(store, path, function (err, entry) {
- if (err) return done(err);
- IDBFS.storeLocalEntry(path, entry, done);
- });
- } else {
- IDBFS.loadLocalEntry(path, function (err, entry) {
- if (err) return done(err);
- IDBFS.storeRemoteEntry(store, path, entry, done);
- });
- }
- });
-
- // sort paths in descending order so files are deleted before their
- // parent directories
- remove.sort().reverse().forEach(function(path) {
- if (dst.type === 'local') {
- IDBFS.removeLocalEntry(path, done);
- } else {
- IDBFS.removeRemoteEntry(store, path, done);
- }
- });
- }};
-
- var NODEFS={isWindows:false,staticInit:function () {
- NODEFS.isWindows = !!process.platform.match(/^win/);
- },mount:function (mount) {
- assert(ENVIRONMENT_IS_NODE);
- return NODEFS.createNode(null, '/', NODEFS.getMode(mount.opts.root), 0);
- },createNode:function (parent, name, mode, dev) {
- if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) {
- throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
- }
- var node = FS.createNode(parent, name, mode);
- node.node_ops = NODEFS.node_ops;
- node.stream_ops = NODEFS.stream_ops;
- return node;
- },getMode:function (path) {
- var stat;
- try {
- stat = fs.lstatSync(path);
- if (NODEFS.isWindows) {
- // On Windows, directories return permission bits 'rw-rw-rw-', even though they have 'rwxrwxrwx', so
- // propagate write bits to execute bits.
- stat.mode = stat.mode | ((stat.mode & 146) >> 1);
- }
- } catch (e) {
- if (!e.code) throw e;
- throw new FS.ErrnoError(ERRNO_CODES[e.code]);
- }
- return stat.mode;
- },realPath:function (node) {
- var parts = [];
- while (node.parent !== node) {
- parts.push(node.name);
- node = node.parent;
- }
- parts.push(node.mount.opts.root);
- parts.reverse();
- return PATH.join.apply(null, parts);
- },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) {
- flags &= ~0x200000 /*O_PATH*/; // Ignore this flag from musl, otherwise node.js fails to open the file.
- flags &= ~0x800 /*O_NONBLOCK*/; // Ignore this flag from musl, otherwise node.js fails to open the file.
- flags &= ~0x8000 /*O_LARGEFILE*/; // Ignore this flag from musl, otherwise node.js fails to open the file.
- flags &= ~0x80000 /*O_CLOEXEC*/; // Some applications may pass it; it makes no sense for a single process.
- if (flags in NODEFS.flagsToPermissionStringMap) {
- return NODEFS.flagsToPermissionStringMap[flags];
- } else {
- throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
- }
- },node_ops:{getattr:function (node) {
- var path = NODEFS.realPath(node);
- var stat;
- try {
- stat = fs.lstatSync(path);
- } catch (e) {
- if (!e.code) throw e;
- throw new FS.ErrnoError(ERRNO_CODES[e.code]);
- }
- // node.js v0.10.20 doesn't report blksize and blocks on Windows. Fake them with default blksize of 4096.
- // See http://support.microsoft.com/kb/140365
- if (NODEFS.isWindows && !stat.blksize) {
- stat.blksize = 4096;
- }
- if (NODEFS.isWindows && !stat.blocks) {
- stat.blocks = (stat.size+stat.blksize-1)/stat.blksize|0;
- }
- return {
- dev: stat.dev,
- ino: stat.ino,
- mode: stat.mode,
- nlink: stat.nlink,
- uid: stat.uid,
- gid: stat.gid,
- rdev: stat.rdev,
- size: stat.size,
- atime: stat.atime,
- mtime: stat.mtime,
- ctime: stat.ctime,
- blksize: stat.blksize,
- blocks: stat.blocks
- };
- },setattr:function (node, attr) {
- var path = NODEFS.realPath(node);
- try {
- if (attr.mode !== undefined) {
- fs.chmodSync(path, attr.mode);
- // update the common node structure mode as well
- node.mode = attr.mode;
- }
- if (attr.timestamp !== undefined) {
- var date = new Date(attr.timestamp);
- fs.utimesSync(path, date, date);
- }
- if (attr.size !== undefined) {
- fs.truncateSync(path, attr.size);
- }
- } catch (e) {
- if (!e.code) throw e;
- throw new FS.ErrnoError(ERRNO_CODES[e.code]);
- }
- },lookup:function (parent, name) {
- var path = PATH.join2(NODEFS.realPath(parent), name);
- var mode = NODEFS.getMode(path);
- return NODEFS.createNode(parent, name, mode);
- },mknod:function (parent, name, mode, dev) {
- var node = NODEFS.createNode(parent, name, mode, dev);
- // create the backing node for this in the fs root as well
- var path = NODEFS.realPath(node);
- try {
- if (FS.isDir(node.mode)) {
- fs.mkdirSync(path, node.mode);
- } else {
- fs.writeFileSync(path, '', { mode: node.mode });
- }
- } catch (e) {
- if (!e.code) throw e;
- throw new FS.ErrnoError(ERRNO_CODES[e.code]);
- }
- return node;
- },rename:function (oldNode, newDir, newName) {
- var oldPath = NODEFS.realPath(oldNode);
- var newPath = PATH.join2(NODEFS.realPath(newDir), newName);
- try {
- fs.renameSync(oldPath, newPath);
- } catch (e) {
- if (!e.code) throw e;
- throw new FS.ErrnoError(ERRNO_CODES[e.code]);
- }
- },unlink:function (parent, name) {
- var path = PATH.join2(NODEFS.realPath(parent), name);
- try {
- fs.unlinkSync(path);
- } catch (e) {
- if (!e.code) throw e;
- throw new FS.ErrnoError(ERRNO_CODES[e.code]);
- }
- },rmdir:function (parent, name) {
- var path = PATH.join2(NODEFS.realPath(parent), name);
- try {
- fs.rmdirSync(path);
- } catch (e) {
- if (!e.code) throw e;
- throw new FS.ErrnoError(ERRNO_CODES[e.code]);
- }
- },readdir:function (node) {
- var path = NODEFS.realPath(node);
- try {
- return fs.readdirSync(path);
- } catch (e) {
- if (!e.code) throw e;
- throw new FS.ErrnoError(ERRNO_CODES[e.code]);
- }
- },symlink:function (parent, newName, oldPath) {
- var newPath = PATH.join2(NODEFS.realPath(parent), newName);
- try {
- fs.symlinkSync(oldPath, newPath);
- } catch (e) {
- if (!e.code) throw e;
- throw new FS.ErrnoError(ERRNO_CODES[e.code]);
- }
- },readlink:function (node) {
- var path = NODEFS.realPath(node);
- try {
- path = fs.readlinkSync(path);
- path = NODEJS_PATH.relative(NODEJS_PATH.resolve(node.mount.opts.root), path);
- return path;
- } catch (e) {
- if (!e.code) throw e;
- throw new FS.ErrnoError(ERRNO_CODES[e.code]);
- }
- }},stream_ops:{open:function (stream) {
- var path = NODEFS.realPath(stream.node);
- try {
- if (FS.isFile(stream.node.mode)) {
- stream.nfd = fs.openSync(path, NODEFS.flagsToPermissionString(stream.flags));
- }
- } catch (e) {
- if (!e.code) throw e;
- throw new FS.ErrnoError(ERRNO_CODES[e.code]);
- }
- },close:function (stream) {
- try {
- if (FS.isFile(stream.node.mode) && stream.nfd) {
- fs.closeSync(stream.nfd);
- }
- } catch (e) {
- if (!e.code) throw e;
- throw new FS.ErrnoError(ERRNO_CODES[e.code]);
- }
- },read:function (stream, buffer, offset, length, position) {
- if (length === 0) return 0; // node errors on 0 length reads
- // FIXME this is terrible.
- var nbuffer = new Buffer(length);
- var res;
- try {
- res = fs.readSync(stream.nfd, nbuffer, 0, length, position);
- } catch (e) {
- throw new FS.ErrnoError(ERRNO_CODES[e.code]);
- }
- if (res > 0) {
- for (var i = 0; i < res; i++) {
- buffer[offset + i] = nbuffer[i];
- }
- }
- return res;
- },write:function (stream, buffer, offset, length, position) {
- // FIXME this is terrible.
- var nbuffer = new Buffer(buffer.subarray(offset, offset + length));
- var res;
- try {
- res = fs.writeSync(stream.nfd, nbuffer, 0, length, position);
- } catch (e) {
- throw new FS.ErrnoError(ERRNO_CODES[e.code]);
- }
- return res;
- },llseek:function (stream, offset, whence) {
- var position = offset;
- if (whence === 1) { // SEEK_CUR.
- position += stream.position;
- } else if (whence === 2) { // SEEK_END.
- if (FS.isFile(stream.node.mode)) {
- try {
- var stat = fs.fstatSync(stream.nfd);
- position += stat.size;
- } catch (e) {
- throw new FS.ErrnoError(ERRNO_CODES[e.code]);
- }
- }
- }
-
- if (position < 0) {
- throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
- }
-
- return position;
- }}};
-
- var WORKERFS={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount:function (mount) {
- assert(ENVIRONMENT_IS_WORKER);
- if (!WORKERFS.reader) WORKERFS.reader = new FileReaderSync();
- var root = WORKERFS.createNode(null, '/', WORKERFS.DIR_MODE, 0);
- var createdParents = {};
- function ensureParent(path) {
- // return the parent node, creating subdirs as necessary
- var parts = path.split('/');
- var parent = root;
- for (var i = 0; i < parts.length-1; i++) {
- var curr = parts.slice(0, i+1).join('/');
- // Issue 4254: Using curr as a node name will prevent the node
- // from being found in FS.nameTable when FS.open is called on
- // a path which holds a child of this node,
- // given that all FS functions assume node names
- // are just their corresponding parts within their given path,
- // rather than incremental aggregates which include their parent's
- // directories.
- if (!createdParents[curr]) {
- createdParents[curr] = WORKERFS.createNode(parent, parts[i], WORKERFS.DIR_MODE, 0);
- }
- parent = createdParents[curr];
- }
- return parent;
- }
- function base(path) {
- var parts = path.split('/');
- return parts[parts.length-1];
- }
- // We also accept FileList here, by using Array.prototype
- Array.prototype.forEach.call(mount.opts["files"] || [], function(file) {
- WORKERFS.createNode(ensureParent(file.name), base(file.name), WORKERFS.FILE_MODE, 0, file, file.lastModifiedDate);
- });
- (mount.opts["blobs"] || []).forEach(function(obj) {
- WORKERFS.createNode(ensureParent(obj["name"]), base(obj["name"]), WORKERFS.FILE_MODE, 0, obj["data"]);
- });
- (mount.opts["packages"] || []).forEach(function(pack) {
- pack['metadata'].files.forEach(function(file) {
- var name = file.filename.substr(1); // remove initial slash
- WORKERFS.createNode(ensureParent(name), base(name), WORKERFS.FILE_MODE, 0, pack['blob'].slice(file.start, file.end));
- });
- });
- return root;
- },createNode:function (parent, name, mode, dev, contents, mtime) {
- var node = FS.createNode(parent, name, mode);
- node.mode = mode;
- node.node_ops = WORKERFS.node_ops;
- node.stream_ops = WORKERFS.stream_ops;
- node.timestamp = (mtime || new Date).getTime();
- assert(WORKERFS.FILE_MODE !== WORKERFS.DIR_MODE);
- if (mode === WORKERFS.FILE_MODE) {
- node.size = contents.size;
- node.contents = contents;
- } else {
- node.size = 4096;
- node.contents = {};
- }
- if (parent) {
- parent.contents[name] = node;
- }
- return node;
- },node_ops:{getattr:function (node) {
- return {
- dev: 1,
- ino: undefined,
- mode: node.mode,
- nlink: 1,
- uid: 0,
- gid: 0,
- rdev: undefined,
- size: node.size,
- atime: new Date(node.timestamp),
- mtime: new Date(node.timestamp),
- ctime: new Date(node.timestamp),
- blksize: 4096,
- blocks: Math.ceil(node.size / 4096),
- };
- },setattr:function (node, attr) {
- if (attr.mode !== undefined) {
- node.mode = attr.mode;
- }
- if (attr.timestamp !== undefined) {
- node.timestamp = attr.timestamp;
- }
- },lookup:function (parent, name) {
- throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
- },mknod:function (parent, name, mode, dev) {
- throw new FS.ErrnoError(ERRNO_CODES.EPERM);
- },rename:function (oldNode, newDir, newName) {
- throw new FS.ErrnoError(ERRNO_CODES.EPERM);
- },unlink:function (parent, name) {
- throw new FS.ErrnoError(ERRNO_CODES.EPERM);
- },rmdir:function (parent, name) {
- throw new FS.ErrnoError(ERRNO_CODES.EPERM);
- },readdir:function (node) {
- var entries = ['.', '..'];
- for (var key in node.contents) {
- if (!node.contents.hasOwnProperty(key)) {
- continue;
- }
- entries.push(key);
- }
- return entries;
- },symlink:function (parent, newName, oldPath) {
- throw new FS.ErrnoError(ERRNO_CODES.EPERM);
- },readlink:function (node) {
- throw new FS.ErrnoError(ERRNO_CODES.EPERM);
- }},stream_ops:{read:function (stream, buffer, offset, length, position) {
- if (position >= stream.node.size) return 0;
- var chunk = stream.node.contents.slice(position, position + length);
- var ab = WORKERFS.reader.readAsArrayBuffer(chunk);
- buffer.set(new Uint8Array(ab), offset);
- return chunk.size;
- },write:function (stream, buffer, offset, length, position) {
- throw new FS.ErrnoError(ERRNO_CODES.EIO);
- },llseek:function (stream, offset, whence) {
- var position = offset;
- if (whence === 1) { // SEEK_CUR.
- position += stream.position;
- } else if (whence === 2) { // SEEK_END.
- if (FS.isFile(stream.node.mode)) {
- position += stream.node.size;
- }
- }
- if (position < 0) {
- throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
- }
- return position;
- }}};
-
- var _stdin; if (ENVIRONMENT_IS_PTHREAD) _stdin = PthreadWorkerInit._stdin; else PthreadWorkerInit._stdin = _stdin = allocate(1, "i32*", ALLOC_STATIC);
-
- var _stdout; if (ENVIRONMENT_IS_PTHREAD) _stdout = PthreadWorkerInit._stdout; else PthreadWorkerInit._stdout = _stdout = allocate(1, "i32*", ALLOC_STATIC);
-
- 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) {
- if (!(e instanceof FS.ErrnoError)) throw e + ' : ' + stackTrace();
- return ___setErrNo(e.errno);
- },lookupPath:function (path, opts) {
- path = PATH.resolve(FS.cwd(), path);
- opts = opts || {};
-
- if (!path) return { path: '', node: null };
-
- var defaults = {
- follow_mount: true,
- recurse_count: 0
- };
- for (var key in defaults) {
- if (opts[key] === undefined) {
- opts[key] = defaults[key];
- }
- }
-
- if (opts.recurse_count > 8) { // max recursive lookup of 8
- throw new FS.ErrnoError(ERRNO_CODES.ELOOP);
- }
-
- // split the path
- var parts = PATH.normalizeArray(path.split('/').filter(function(p) {
- return !!p;
- }), false);
-
- // start at the root
- var current = FS.root;
- var current_path = '/';
-
- for (var i = 0; i < parts.length; i++) {
- var islast = (i === parts.length-1);
- if (islast && opts.parent) {
- // stop resolving
- break;
- }
-
- current = FS.lookupNode(current, parts[i]);
- current_path = PATH.join2(current_path, parts[i]);
-
- // jump to the mount's root node if this is a mountpoint
- if (FS.isMountpoint(current)) {
- if (!islast || (islast && opts.follow_mount)) {
- current = current.mounted.root;
- }
- }
-
- // by default, lookupPath will not follow a symlink if it is the final path component.
- // setting opts.follow = true will override this behavior.
- if (!islast || opts.follow) {
- var count = 0;
- while (FS.isLink(current.mode)) {
- var link = FS.readlink(current_path);
- current_path = PATH.resolve(PATH.dirname(current_path), link);
-
- var lookup = FS.lookupPath(current_path, { recurse_count: opts.recurse_count });
- current = lookup.node;
-
- if (count++ > 40) { // limit max consecutive symlinks to 40 (SYMLOOP_MAX).
- throw new FS.ErrnoError(ERRNO_CODES.ELOOP);
- }
- }
- }
- }
-
- return { path: current_path, node: current };
- },getPath:function (node) {
- var path;
- while (true) {
- if (FS.isRoot(node)) {
- var mount = node.mount.mountpoint;
- if (!path) return mount;
- return mount[mount.length-1] !== '/' ? mount + '/' + path : mount + path;
- }
- path = path ? node.name + '/' + path : node.name;
- node = node.parent;
- }
- },hashName:function (parentid, name) {
- var hash = 0;
-
-
- for (var i = 0; i < name.length; i++) {
- hash = ((hash << 5) - hash + name.charCodeAt(i)) | 0;
- }
- return ((parentid + hash) >>> 0) % FS.nameTable.length;
- },hashAddNode:function (node) {
- var hash = FS.hashName(node.parent.id, node.name);
- node.name_next = FS.nameTable[hash];
- FS.nameTable[hash] = node;
- },hashRemoveNode:function (node) {
- var hash = FS.hashName(node.parent.id, node.name);
- if (FS.nameTable[hash] === node) {
- FS.nameTable[hash] = node.name_next;
- } else {
- var current = FS.nameTable[hash];
- while (current) {
- if (current.name_next === node) {
- current.name_next = node.name_next;
- break;
- }
- current = current.name_next;
- }
- }
- },lookupNode:function (parent, name) {
- var err = FS.mayLookup(parent);
- if (err) {
- throw new FS.ErrnoError(err, parent);
- }
- var hash = FS.hashName(parent.id, name);
- for (var node = FS.nameTable[hash]; node; node = node.name_next) {
- var nodeName = node.name;
- if (node.parent.id === parent.id && nodeName === name) {
- return node;
- }
- }
- // if we failed to find it in the cache, call into the VFS
- return FS.lookup(parent, name);
- },createNode:function (parent, name, mode, rdev) {
- if (!FS.FSNode) {
- FS.FSNode = function(parent, name, mode, rdev) {
- if (!parent) {
- parent = this; // root node sets parent to itself
- }
- this.parent = parent;
- this.mount = parent.mount;
- this.mounted = null;
- this.id = FS.nextInode++;
- this.name = name;
- this.mode = mode;
- this.node_ops = {};
- this.stream_ops = {};
- this.rdev = rdev;
- };
-
- FS.FSNode.prototype = {};
-
- // compatibility
- var readMode = 292 | 73;
- var writeMode = 146;
-
- // NOTE we must use Object.defineProperties instead of individual calls to
- // Object.defineProperty in order to make closure compiler happy
- Object.defineProperties(FS.FSNode.prototype, {
- read: {
- get: function() { return (this.mode & readMode) === readMode; },
- set: function(val) { val ? this.mode |= readMode : this.mode &= ~readMode; }
- },
- write: {
- get: function() { return (this.mode & writeMode) === writeMode; },
- set: function(val) { val ? this.mode |= writeMode : this.mode &= ~writeMode; }
- },
- isFolder: {
- get: function() { return FS.isDir(this.mode); }
- },
- isDevice: {
- get: function() { return FS.isChrdev(this.mode); }
- }
- });
- }
-
- var node = new FS.FSNode(parent, name, mode, rdev);
-
- FS.hashAddNode(node);
-
- return node;
- },destroyNode:function (node) {
- FS.hashRemoveNode(node);
- },isRoot:function (node) {
- return node === node.parent;
- },isMountpoint:function (node) {
- return !!node.mounted;
- },isFile:function (mode) {
- return (mode & 61440) === 32768;
- },isDir:function (mode) {
- return (mode & 61440) === 16384;
- },isLink:function (mode) {
- return (mode & 61440) === 40960;
- },isChrdev:function (mode) {
- return (mode & 61440) === 8192;
- },isBlkdev:function (mode) {
- return (mode & 61440) === 24576;
- },isFIFO:function (mode) {
- return (mode & 61440) === 4096;
- },isSocket:function (mode) {
- return (mode & 49152) === 49152;
- },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) {
- var flags = FS.flagModes[str];
- if (typeof flags === 'undefined') {
- throw new Error('Unknown file open mode: ' + str);
- }
- return flags;
- },flagsToPermissionString:function (flag) {
- var perms = ['r', 'w', 'rw'][flag & 3];
- if ((flag & 512)) {
- perms += 'w';
- }
- return perms;
- },nodePermissions:function (node, perms) {
- if (FS.ignorePermissions) {
- return 0;
- }
- // return 0 if any user, group or owner bits are set.
- if (perms.indexOf('r') !== -1 && !(node.mode & 292)) {
- return ERRNO_CODES.EACCES;
- } else if (perms.indexOf('w') !== -1 && !(node.mode & 146)) {
- return ERRNO_CODES.EACCES;
- } else if (perms.indexOf('x') !== -1 && !(node.mode & 73)) {
- return ERRNO_CODES.EACCES;
- }
- return 0;
- },mayLookup:function (dir) {
- var err = FS.nodePermissions(dir, 'x');
- if (err) return err;
- if (!dir.node_ops.lookup) return ERRNO_CODES.EACCES;
- return 0;
- },mayCreate:function (dir, name) {
- try {
- var node = FS.lookupNode(dir, name);
- return ERRNO_CODES.EEXIST;
- } catch (e) {
- }
- return FS.nodePermissions(dir, 'wx');
- },mayDelete:function (dir, name, isdir) {
- var node;
- try {
- node = FS.lookupNode(dir, name);
- } catch (e) {
- return e.errno;
- }
- var err = FS.nodePermissions(dir, 'wx');
- if (err) {
- return err;
- }
- if (isdir) {
- if (!FS.isDir(node.mode)) {
- return ERRNO_CODES.ENOTDIR;
- }
- if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) {
- return ERRNO_CODES.EBUSY;
- }
- } else {
- if (FS.isDir(node.mode)) {
- return ERRNO_CODES.EISDIR;
- }
- }
- return 0;
- },mayOpen:function (node, flags) {
- if (!node) {
- return ERRNO_CODES.ENOENT;
- }
- if (FS.isLink(node.mode)) {
- return ERRNO_CODES.ELOOP;
- } else if (FS.isDir(node.mode)) {
- if (FS.flagsToPermissionString(flags) !== 'r' || // opening for write
- (flags & 512)) { // TODO: check for O_SEARCH? (== search for dir only)
- return ERRNO_CODES.EISDIR;
- }
- }
- return FS.nodePermissions(node, FS.flagsToPermissionString(flags));
- },MAX_OPEN_FDS:4096,nextfd:function (fd_start, fd_end) {
- fd_start = fd_start || 0;
- fd_end = fd_end || FS.MAX_OPEN_FDS;
- for (var fd = fd_start; fd <= fd_end; fd++) {
- if (!FS.streams[fd]) {
- return fd;
- }
- }
- throw new FS.ErrnoError(ERRNO_CODES.EMFILE);
- },getStream:function (fd) {
- return FS.streams[fd];
- },createStream:function (stream, fd_start, fd_end) {
- if (!FS.FSStream) {
- FS.FSStream = function(){};
- FS.FSStream.prototype = {};
- // compatibility
- Object.defineProperties(FS.FSStream.prototype, {
- object: {
- get: function() { return this.node; },
- set: function(val) { this.node = val; }
- },
- isRead: {
- get: function() { return (this.flags & 2097155) !== 1; }
- },
- isWrite: {
- get: function() { return (this.flags & 2097155) !== 0; }
- },
- isAppend: {
- get: function() { return (this.flags & 1024); }
- }
- });
- }
- // clone it, so we can return an instance of FSStream
- var newStream = new FS.FSStream();
- for (var p in stream) {
- newStream[p] = stream[p];
- }
- stream = newStream;
- var fd = FS.nextfd(fd_start, fd_end);
- stream.fd = fd;
- FS.streams[fd] = stream;
- return stream;
- },closeStream:function (fd) {
- FS.streams[fd] = null;
- },chrdev_stream_ops:{open:function (stream) {
- var device = FS.getDevice(stream.node.rdev);
- // override node's stream ops with the device's
- stream.stream_ops = device.stream_ops;
- // forward the open call
- if (stream.stream_ops.open) {
- stream.stream_ops.open(stream);
- }
- },llseek:function () {
- throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
- }},major:function (dev) {
- return ((dev) >> 8);
- },minor:function (dev) {
- return ((dev) & 0xff);
- },makedev:function (ma, mi) {
- return ((ma) << 8 | (mi));
- },registerDevice:function (dev, ops) {
- FS.devices[dev] = { stream_ops: ops };
- },getDevice:function (dev) {
- return FS.devices[dev];
- },getMounts:function (mount) {
- var mounts = [];
- var check = [mount];
-
- while (check.length) {
- var m = check.pop();
-
- mounts.push(m);
-
- check.push.apply(check, m.mounts);
- }
-
- return mounts;
- },syncfs:function (populate, callback) {
- if (typeof(populate) === 'function') {
- callback = populate;
- populate = false;
- }
-
- FS.syncFSRequests++;
-
- if (FS.syncFSRequests > 1) {
- console.log('warning: ' + FS.syncFSRequests + ' FS.syncfs operations in flight at once, probably just doing extra work');
- }
-
- var mounts = FS.getMounts(FS.root.mount);
- var completed = 0;
-
- function doCallback(err) {
- assert(FS.syncFSRequests > 0);
- FS.syncFSRequests--;
- return callback(err);
- }
-
- function done(err) {
- if (err) {
- if (!done.errored) {
- done.errored = true;
- return doCallback(err);
- }
- return;
- }
- if (++completed >= mounts.length) {
- doCallback(null);
- }
- };
-
- // sync all mounts
- mounts.forEach(function (mount) {
- if (!mount.type.syncfs) {
- return done(null);
- }
- mount.type.syncfs(mount, populate, done);
- });
- },mount:function (type, opts, mountpoint) {
- var root = mountpoint === '/';
- var pseudo = !mountpoint;
- var node;
-
- if (root && FS.root) {
- throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
- } else if (!root && !pseudo) {
- var lookup = FS.lookupPath(mountpoint, { follow_mount: false });
-
- mountpoint = lookup.path; // use the absolute path
- node = lookup.node;
-
- if (FS.isMountpoint(node)) {
- throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
- }
-
- if (!FS.isDir(node.mode)) {
- throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
- }
- }
-
- var mount = {
- type: type,
- opts: opts,
- mountpoint: mountpoint,
- mounts: []
- };
-
- // create a root node for the fs
- var mountRoot = type.mount(mount);
- mountRoot.mount = mount;
- mount.root = mountRoot;
-
- if (root) {
- FS.root = mountRoot;
- } else if (node) {
- // set as a mountpoint
- node.mounted = mount;
-
- // add the new mount to the current mount's children
- if (node.mount) {
- node.mount.mounts.push(mount);
- }
- }
-
- return mountRoot;
- },unmount:function (mountpoint) {
- var lookup = FS.lookupPath(mountpoint, { follow_mount: false });
-
- if (!FS.isMountpoint(lookup.node)) {
- throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
- }
-
- // destroy the nodes for this mount, and all its child mounts
- var node = lookup.node;
- var mount = node.mounted;
- var mounts = FS.getMounts(mount);
-
- Object.keys(FS.nameTable).forEach(function (hash) {
- var current = FS.nameTable[hash];
-
- while (current) {
- var next = current.name_next;
-
- if (mounts.indexOf(current.mount) !== -1) {
- FS.destroyNode(current);
- }
-
- current = next;
- }
- });
-
- // no longer a mountpoint
- node.mounted = null;
-
- // remove this mount from the child mounts
- var idx = node.mount.mounts.indexOf(mount);
- assert(idx !== -1);
- node.mount.mounts.splice(idx, 1);
- },lookup:function (parent, name) {
- return parent.node_ops.lookup(parent, name);
- },mknod:function (path, mode, dev) {
- var lookup = FS.lookupPath(path, { parent: true });
- var parent = lookup.node;
- var name = PATH.basename(path);
- if (!name || name === '.' || name === '..') {
- throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
- }
- var err = FS.mayCreate(parent, name);
- if (err) {
- throw new FS.ErrnoError(err);
- }
- if (!parent.node_ops.mknod) {
- throw new FS.ErrnoError(ERRNO_CODES.EPERM);
- }
- return parent.node_ops.mknod(parent, name, mode, dev);
- },create:function (path, mode) {
- mode = mode !== undefined ? mode : 438 /* 0666 */;
- mode &= 4095;
- mode |= 32768;
- return FS.mknod(path, mode, 0);
- },mkdir:function (path, mode) {
- mode = mode !== undefined ? mode : 511 /* 0777 */;
- mode &= 511 | 512;
- mode |= 16384;
- return FS.mknod(path, mode, 0);
- },mkdirTree:function (path, mode) {
- var dirs = path.split('/');
- var d = '';
- for (var i = 0; i < dirs.length; ++i) {
- if (!dirs[i]) continue;
- d += '/' + dirs[i];
- try {
- FS.mkdir(d, mode);
- } catch(e) {
- if (e.errno != ERRNO_CODES.EEXIST) throw e;
- }
- }
- },mkdev:function (path, mode, dev) {
- if (typeof(dev) === 'undefined') {
- dev = mode;
- mode = 438 /* 0666 */;
- }
- mode |= 8192;
- return FS.mknod(path, mode, dev);
- },symlink:function (oldpath, newpath) {
- if (!PATH.resolve(oldpath)) {
- throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
- }
- var lookup = FS.lookupPath(newpath, { parent: true });
- var parent = lookup.node;
- if (!parent) {
- throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
- }
- var newname = PATH.basename(newpath);
- var err = FS.mayCreate(parent, newname);
- if (err) {
- throw new FS.ErrnoError(err);
- }
- if (!parent.node_ops.symlink) {
- throw new FS.ErrnoError(ERRNO_CODES.EPERM);
- }
- return parent.node_ops.symlink(parent, newname, oldpath);
- },rename:function (old_path, new_path) {
- var old_dirname = PATH.dirname(old_path);
- var new_dirname = PATH.dirname(new_path);
- var old_name = PATH.basename(old_path);
- var new_name = PATH.basename(new_path);
- // parents must exist
- var lookup, old_dir, new_dir;
- try {
- lookup = FS.lookupPath(old_path, { parent: true });
- old_dir = lookup.node;
- lookup = FS.lookupPath(new_path, { parent: true });
- new_dir = lookup.node;
- } catch (e) {
- throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
- }
- if (!old_dir || !new_dir) throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
- // need to be part of the same mount
- if (old_dir.mount !== new_dir.mount) {
- throw new FS.ErrnoError(ERRNO_CODES.EXDEV);
- }
- // source must exist
- var old_node = FS.lookupNode(old_dir, old_name);
- // old path should not be an ancestor of the new path
- var relative = PATH.relative(old_path, new_dirname);
- if (relative.charAt(0) !== '.') {
- throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
- }
- // new path should not be an ancestor of the old path
- relative = PATH.relative(new_path, old_dirname);
- if (relative.charAt(0) !== '.') {
- throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
- }
- // see if the new path already exists
- var new_node;
- try {
- new_node = FS.lookupNode(new_dir, new_name);
- } catch (e) {
- // not fatal
- }
- // early out if nothing needs to change
- if (old_node === new_node) {
- return;
- }
- // we'll need to delete the old entry
- var isdir = FS.isDir(old_node.mode);
- var err = FS.mayDelete(old_dir, old_name, isdir);
- if (err) {
- throw new FS.ErrnoError(err);
- }
- // need delete permissions if we'll be overwriting.
- // need create permissions if new doesn't already exist.
- err = new_node ?
- FS.mayDelete(new_dir, new_name, isdir) :
- FS.mayCreate(new_dir, new_name);
- if (err) {
- throw new FS.ErrnoError(err);
- }
- if (!old_dir.node_ops.rename) {
- throw new FS.ErrnoError(ERRNO_CODES.EPERM);
- }
- if (FS.isMountpoint(old_node) || (new_node && FS.isMountpoint(new_node))) {
- throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
- }
- // if we are going to change the parent, check write permissions
- if (new_dir !== old_dir) {
- err = FS.nodePermissions(old_dir, 'w');
- if (err) {
- throw new FS.ErrnoError(err);
- }
- }
- try {
- if (FS.trackingDelegate['willMovePath']) {
- FS.trackingDelegate['willMovePath'](old_path, new_path);
- }
- } catch(e) {
- console.log("FS.trackingDelegate['willMovePath']('"+old_path+"', '"+new_path+"') threw an exception: " + e.message);
- }
- // remove the node from the lookup hash
- FS.hashRemoveNode(old_node);
- // do the underlying fs rename
- try {
- old_dir.node_ops.rename(old_node, new_dir, new_name);
- } catch (e) {
- throw e;
- } finally {
- // add the node back to the hash (in case node_ops.rename
- // changed its name)
- FS.hashAddNode(old_node);
- }
- try {
- if (FS.trackingDelegate['onMovePath']) FS.trackingDelegate['onMovePath'](old_path, new_path);
- } catch(e) {
- console.log("FS.trackingDelegate['onMovePath']('"+old_path+"', '"+new_path+"') threw an exception: " + e.message);
- }
- },rmdir:function (path) {
- var lookup = FS.lookupPath(path, { parent: true });
- var parent = lookup.node;
- var name = PATH.basename(path);
- var node = FS.lookupNode(parent, name);
- var err = FS.mayDelete(parent, name, true);
- if (err) {
- throw new FS.ErrnoError(err);
- }
- if (!parent.node_ops.rmdir) {
- throw new FS.ErrnoError(ERRNO_CODES.EPERM);
- }
- if (FS.isMountpoint(node)) {
- throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
- }
- try {
- if (FS.trackingDelegate['willDeletePath']) {
- FS.trackingDelegate['willDeletePath'](path);
- }
- } catch(e) {
- console.log("FS.trackingDelegate['willDeletePath']('"+path+"') threw an exception: " + e.message);
- }
- parent.node_ops.rmdir(parent, name);
- FS.destroyNode(node);
- try {
- if (FS.trackingDelegate['onDeletePath']) FS.trackingDelegate['onDeletePath'](path);
- } catch(e) {
- console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: " + e.message);
- }
- },readdir:function (path) {
- var lookup = FS.lookupPath(path, { follow: true });
- var node = lookup.node;
- if (!node.node_ops.readdir) {
- throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
- }
- return node.node_ops.readdir(node);
- },unlink:function (path) {
- var lookup = FS.lookupPath(path, { parent: true });
- var parent = lookup.node;
- var name = PATH.basename(path);
- var node = FS.lookupNode(parent, name);
- var err = FS.mayDelete(parent, name, false);
- if (err) {
- // According to POSIX, we should map EISDIR to EPERM, but
- // we instead do what Linux does (and we must, as we use
- // the musl linux libc).
- throw new FS.ErrnoError(err);
- }
- if (!parent.node_ops.unlink) {
- throw new FS.ErrnoError(ERRNO_CODES.EPERM);
- }
- if (FS.isMountpoint(node)) {
- throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
- }
- try {
- if (FS.trackingDelegate['willDeletePath']) {
- FS.trackingDelegate['willDeletePath'](path);
- }
- } catch(e) {
- console.log("FS.trackingDelegate['willDeletePath']('"+path+"') threw an exception: " + e.message);
- }
- parent.node_ops.unlink(parent, name);
- FS.destroyNode(node);
- try {
- if (FS.trackingDelegate['onDeletePath']) FS.trackingDelegate['onDeletePath'](path);
- } catch(e) {
- console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: " + e.message);
- }
- },readlink:function (path) {
- var lookup = FS.lookupPath(path);
- var link = lookup.node;
- if (!link) {
- throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
- }
- if (!link.node_ops.readlink) {
- throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
- }
- return PATH.resolve(FS.getPath(link.parent), link.node_ops.readlink(link));
- },stat:function (path, dontFollow) {
- var lookup = FS.lookupPath(path, { follow: !dontFollow });
- var node = lookup.node;
- if (!node) {
- throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
- }
- if (!node.node_ops.getattr) {
- throw new FS.ErrnoError(ERRNO_CODES.EPERM);
- }
- return node.node_ops.getattr(node);
- },lstat:function (path) {
- return FS.stat(path, true);
- },chmod:function (path, mode, dontFollow) {
- var node;
- if (typeof path === 'string') {
- var lookup = FS.lookupPath(path, { follow: !dontFollow });
- node = lookup.node;
- } else {
- node = path;
- }
- if (!node.node_ops.setattr) {
- throw new FS.ErrnoError(ERRNO_CODES.EPERM);
- }
- node.node_ops.setattr(node, {
- mode: (mode & 4095) | (node.mode & ~4095),
- timestamp: Date.now()
- });
- },lchmod:function (path, mode) {
- FS.chmod(path, mode, true);
- },fchmod:function (fd, mode) {
- var stream = FS.getStream(fd);
- if (!stream) {
- throw new FS.ErrnoError(ERRNO_CODES.EBADF);
- }
- FS.chmod(stream.node, mode);
- },chown:function (path, uid, gid, dontFollow) {
- var node;
- if (typeof path === 'string') {
- var lookup = FS.lookupPath(path, { follow: !dontFollow });
- node = lookup.node;
- } else {
- node = path;
- }
- if (!node.node_ops.setattr) {
- throw new FS.ErrnoError(ERRNO_CODES.EPERM);
- }
- node.node_ops.setattr(node, {
- timestamp: Date.now()
- // we ignore the uid / gid for now
- });
- },lchown:function (path, uid, gid) {
- FS.chown(path, uid, gid, true);
- },fchown:function (fd, uid, gid) {
- var stream = FS.getStream(fd);
- if (!stream) {
- throw new FS.ErrnoError(ERRNO_CODES.EBADF);
- }
- FS.chown(stream.node, uid, gid);
- },truncate:function (path, len) {
- if (len < 0) {
- throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
- }
- var node;
- if (typeof path === 'string') {
- var lookup = FS.lookupPath(path, { follow: true });
- node = lookup.node;
- } else {
- node = path;
- }
- if (!node.node_ops.setattr) {
- throw new FS.ErrnoError(ERRNO_CODES.EPERM);
- }
- if (FS.isDir(node.mode)) {
- throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
- }
- if (!FS.isFile(node.mode)) {
- throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
- }
- var err = FS.nodePermissions(node, 'w');
- if (err) {
- throw new FS.ErrnoError(err);
- }
- node.node_ops.setattr(node, {
- size: len,
- timestamp: Date.now()
- });
- },ftruncate:function (fd, len) {
- var stream = FS.getStream(fd);
- if (!stream) {
- throw new FS.ErrnoError(ERRNO_CODES.EBADF);
- }
- if ((stream.flags & 2097155) === 0) {
- throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
- }
- FS.truncate(stream.node, len);
- },utime:function (path, atime, mtime) {
- var lookup = FS.lookupPath(path, { follow: true });
- var node = lookup.node;
- node.node_ops.setattr(node, {
- timestamp: Math.max(atime, mtime)
- });
- },open:function (path, flags, mode, fd_start, fd_end) {
- if (path === "") {
- throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
- }
- flags = typeof flags === 'string' ? FS.modeStringToFlags(flags) : flags;
- mode = typeof mode === 'undefined' ? 438 /* 0666 */ : mode;
- if ((flags & 64)) {
- mode = (mode & 4095) | 32768;
- } else {
- mode = 0;
- }
- var node;
- if (typeof path === 'object') {
- node = path;
- } else {
- path = PATH.normalize(path);
- try {
- var lookup = FS.lookupPath(path, {
- follow: !(flags & 131072)
- });
- node = lookup.node;
- } catch (e) {
- // ignore
- }
- }
- // perhaps we need to create the node
- var created = false;
- if ((flags & 64)) {
- if (node) {
- // if O_CREAT and O_EXCL are set, error out if the node already exists
- if ((flags & 128)) {
- throw new FS.ErrnoError(ERRNO_CODES.EEXIST);
- }
- } else {
- // node doesn't exist, try to create it
- node = FS.mknod(path, mode, 0);
- created = true;
- }
- }
- if (!node) {
- throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
- }
- // can't truncate a device
- if (FS.isChrdev(node.mode)) {
- flags &= ~512;
- }
- // if asked only for a directory, then this must be one
- if ((flags & 65536) && !FS.isDir(node.mode)) {
- throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
- }
- // check permissions, if this is not a file we just created now (it is ok to
- // create and write to a file with read-only permissions; it is read-only
- // for later use)
- if (!created) {
- var err = FS.mayOpen(node, flags);
- if (err) {
- throw new FS.ErrnoError(err);
- }
- }
- // do truncation if necessary
- if ((flags & 512)) {
- FS.truncate(node, 0);
- }
- // we've already handled these, don't pass down to the underlying vfs
- flags &= ~(128 | 512);
-
- // register the stream with the filesystem
- var stream = FS.createStream({
- node: node,
- path: FS.getPath(node), // we want the absolute path to the node
- flags: flags,
- seekable: true,
- position: 0,
- stream_ops: node.stream_ops,
- // used by the file family libc calls (fopen, fwrite, ferror, etc.)
- ungotten: [],
- error: false
- }, fd_start, fd_end);
- // call the new stream's open function
- if (stream.stream_ops.open) {
- stream.stream_ops.open(stream);
- }
- if (Module['logReadFiles'] && !(flags & 1)) {
- if (!FS.readFiles) FS.readFiles = {};
- if (!(path in FS.readFiles)) {
- FS.readFiles[path] = 1;
- Module['printErr']('read file: ' + path);
- }
- }
- try {
- if (FS.trackingDelegate['onOpenFile']) {
- var trackingFlags = 0;
- if ((flags & 2097155) !== 1) {
- trackingFlags |= FS.tracking.openFlags.READ;
- }
- if ((flags & 2097155) !== 0) {
- trackingFlags |= FS.tracking.openFlags.WRITE;
- }
- FS.trackingDelegate['onOpenFile'](path, trackingFlags);
- }
- } catch(e) {
- console.log("FS.trackingDelegate['onOpenFile']('"+path+"', flags) threw an exception: " + e.message);
- }
- return stream;
- },close:function (stream) {
- if (stream.getdents) stream.getdents = null; // free readdir state
- try {
- if (stream.stream_ops.close) {
- stream.stream_ops.close(stream);
- }
- } catch (e) {
- throw e;
- } finally {
- FS.closeStream(stream.fd);
- }
- },llseek:function (stream, offset, whence) {
- if (!stream.seekable || !stream.stream_ops.llseek) {
- throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
- }
- stream.position = stream.stream_ops.llseek(stream, offset, whence);
- stream.ungotten = [];
- return stream.position;
- },read:function (stream, buffer, offset, length, position) {
- if (length < 0 || position < 0) {
- throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
- }
- if ((stream.flags & 2097155) === 1) {
- throw new FS.ErrnoError(ERRNO_CODES.EBADF);
- }
- if (FS.isDir(stream.node.mode)) {
- throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
- }
- if (!stream.stream_ops.read) {
- throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
- }
- var seeking = true;
- if (typeof position === 'undefined') {
- position = stream.position;
- seeking = false;
- } else if (!stream.seekable) {
- throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
- }
- var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position);
- if (!seeking) stream.position += bytesRead;
- return bytesRead;
- },write:function (stream, buffer, offset, length, position, canOwn) {
- if (length < 0 || position < 0) {
- throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
- }
- if ((stream.flags & 2097155) === 0) {
- throw new FS.ErrnoError(ERRNO_CODES.EBADF);
- }
- if (FS.isDir(stream.node.mode)) {
- throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
- }
- if (!stream.stream_ops.write) {
- throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
- }
- if (stream.flags & 1024) {
- // seek to the end before writing in append mode
- FS.llseek(stream, 0, 2);
- }
- var seeking = true;
- if (typeof position === 'undefined') {
- position = stream.position;
- seeking = false;
- } else if (!stream.seekable) {
- throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
- }
- var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn);
- if (!seeking) stream.position += bytesWritten;
- try {
- if (stream.path && FS.trackingDelegate['onWriteToFile']) FS.trackingDelegate['onWriteToFile'](stream.path);
- } catch(e) {
- console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: " + e.message);
- }
- return bytesWritten;
- },allocate:function (stream, offset, length) {
- if (offset < 0 || length <= 0) {
- throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
- }
- if ((stream.flags & 2097155) === 0) {
- throw new FS.ErrnoError(ERRNO_CODES.EBADF);
- }
- if (!FS.isFile(stream.node.mode) && !FS.isDir(node.mode)) {
- throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
- }
- if (!stream.stream_ops.allocate) {
- throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);
- }
- stream.stream_ops.allocate(stream, offset, length);
- },mmap:function (stream, buffer, offset, length, position, prot, flags) {
- // TODO if PROT is PROT_WRITE, make sure we have write access
- if ((stream.flags & 2097155) === 1) {
- throw new FS.ErrnoError(ERRNO_CODES.EACCES);
- }
- if (!stream.stream_ops.mmap) {
- throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
- }
- return stream.stream_ops.mmap(stream, buffer, offset, length, position, prot, flags);
- },msync:function (stream, buffer, offset, length, mmapFlags) {
- if (!stream || !stream.stream_ops.msync) {
- return 0;
- }
- return stream.stream_ops.msync(stream, buffer, offset, length, mmapFlags);
- },munmap:function (stream) {
- return 0;
- },ioctl:function (stream, cmd, arg) {
- if (!stream.stream_ops.ioctl) {
- throw new FS.ErrnoError(ERRNO_CODES.ENOTTY);
- }
- return stream.stream_ops.ioctl(stream, cmd, arg);
- },readFile:function (path, opts) {
- opts = opts || {};
- opts.flags = opts.flags || 'r';
- opts.encoding = opts.encoding || 'binary';
- if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {
- throw new Error('Invalid encoding type "' + opts.encoding + '"');
- }
- var ret;
- var stream = FS.open(path, opts.flags);
- var stat = FS.stat(path);
- var length = stat.size;
- var buf = new Uint8Array(length);
- FS.read(stream, buf, 0, length, 0);
- if (opts.encoding === 'utf8') {
- ret = UTF8ArrayToString(buf, 0);
- } else if (opts.encoding === 'binary') {
- ret = buf;
- }
- FS.close(stream);
- return ret;
- },writeFile:function (path, data, opts) {
- opts = opts || {};
- opts.flags = opts.flags || 'w';
- opts.encoding = opts.encoding || 'utf8';
- if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {
- throw new Error('Invalid encoding type "' + opts.encoding + '"');
- }
- var stream = FS.open(path, opts.flags, opts.mode);
- if (opts.encoding === 'utf8') {
- var buf = new Uint8Array(lengthBytesUTF8(data)+1);
- var actualNumBytes = stringToUTF8Array(data, buf, 0, buf.length);
- FS.write(stream, buf, 0, actualNumBytes, 0, opts.canOwn);
- } else if (opts.encoding === 'binary') {
- FS.write(stream, data, 0, data.length, 0, opts.canOwn);
- }
- FS.close(stream);
- },cwd:function () {
- return FS.currentPath;
- },chdir:function (path) {
- var lookup = FS.lookupPath(path, { follow: true });
- if (lookup.node === null) {
- throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
- }
- if (!FS.isDir(lookup.node.mode)) {
- throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
- }
- var err = FS.nodePermissions(lookup.node, 'x');
- if (err) {
- throw new FS.ErrnoError(err);
- }
- FS.currentPath = lookup.path;
- },createDefaultDirectories:function () {
- FS.mkdir('/tmp');
- FS.mkdir('/home');
- FS.mkdir('/home/web_user');
- },createDefaultDevices:function () {
- // create /dev
- FS.mkdir('/dev');
- // setup /dev/null
- FS.registerDevice(FS.makedev(1, 3), {
- read: function() { return 0; },
- write: function(stream, buffer, offset, length, pos) { return length; }
- });
- FS.mkdev('/dev/null', FS.makedev(1, 3));
- // setup /dev/tty and /dev/tty1
- // stderr needs to print output using Module['printErr']
- // so we register a second tty just for it.
- TTY.register(FS.makedev(5, 0), TTY.default_tty_ops);
- TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops);
- FS.mkdev('/dev/tty', FS.makedev(5, 0));
- FS.mkdev('/dev/tty1', FS.makedev(6, 0));
- // setup /dev/[u]random
- var random_device;
- if (typeof crypto !== 'undefined') {
- // for modern web browsers
- var randomBuffer = new Uint8Array(1);
- random_device = function() { crypto.getRandomValues(randomBuffer); return randomBuffer[0]; };
- } else if (ENVIRONMENT_IS_NODE) {
- // for nodejs
- random_device = function() { return require('crypto').randomBytes(1)[0]; };
- } else {
- // default for ES5 platforms
- random_device = function() { return (Math.random()*256)|0; };
- }
- FS.createDevice('/dev', 'random', random_device);
- FS.createDevice('/dev', 'urandom', random_device);
- // we're not going to emulate the actual shm device,
- // just create the tmp dirs that reside in it commonly
- FS.mkdir('/dev/shm');
- FS.mkdir('/dev/shm/tmp');
- },createSpecialDirectories:function () {
- // create /proc/self/fd which allows /proc/self/fd/6 => readlink gives the name of the stream for fd 6 (see test_unistd_ttyname)
- FS.mkdir('/proc');
- FS.mkdir('/proc/self');
- FS.mkdir('/proc/self/fd');
- FS.mount({
- mount: function() {
- var node = FS.createNode('/proc/self', 'fd', 16384 | 511 /* 0777 */, 73);
- node.node_ops = {
- lookup: function(parent, name) {
- var fd = +name;
- var stream = FS.getStream(fd);
- if (!stream) throw new FS.ErrnoError(ERRNO_CODES.EBADF);
- var ret = {
- parent: null,
- mount: { mountpoint: 'fake' },
- node_ops: { readlink: function() { return stream.path } }
- };
- ret.parent = ret; // make it look like a simple root node
- return ret;
- }
- };
- return node;
- }
- }, {}, '/proc/self/fd');
- },createStandardStreams:function () {
- // TODO deprecate the old functionality of a single
- // input / output callback and that utilizes FS.createDevice
- // and instead require a unique set of stream ops
-
- // by default, we symlink the standard streams to the
- // default tty devices. however, if the standard streams
- // have been overwritten we create a unique device for
- // them instead.
- if (Module['stdin']) {
- FS.createDevice('/dev', 'stdin', Module['stdin']);
- } else {
- FS.symlink('/dev/tty', '/dev/stdin');
- }
- if (Module['stdout']) {
- FS.createDevice('/dev', 'stdout', null, Module['stdout']);
- } else {
- FS.symlink('/dev/tty', '/dev/stdout');
- }
- if (Module['stderr']) {
- FS.createDevice('/dev', 'stderr', null, Module['stderr']);
- } else {
- FS.symlink('/dev/tty1', '/dev/stderr');
- }
-
- // open default streams for the stdin, stdout and stderr devices
- var stdin = FS.open('/dev/stdin', 'r');
- assert(stdin.fd === 0, 'invalid handle for stdin (' + stdin.fd + ')');
-
- var stdout = FS.open('/dev/stdout', 'w');
- assert(stdout.fd === 1, 'invalid handle for stdout (' + stdout.fd + ')');
-
- var stderr = FS.open('/dev/stderr', 'w');
- assert(stderr.fd === 2, 'invalid handle for stderr (' + stderr.fd + ')');
- },ensureErrnoError:function () {
- if (FS.ErrnoError) return;
- FS.ErrnoError = function ErrnoError(errno, node) {
- //Module.printErr(stackTrace()); // useful for debugging
- this.node = node;
- this.setErrno = function(errno) {
- this.errno = errno;
- for (var key in ERRNO_CODES) {
- if (ERRNO_CODES[key] === errno) {
- this.code = key;
- break;
- }
- }
- };
- this.setErrno(errno);
- this.message = ERRNO_MESSAGES[errno];
- if (this.stack) this.stack = demangleAll(this.stack);
- };
- FS.ErrnoError.prototype = new Error();
- FS.ErrnoError.prototype.constructor = FS.ErrnoError;
- // Some errors may happen quite a bit, to avoid overhead we reuse them (and suffer a lack of stack info)
- [ERRNO_CODES.ENOENT].forEach(function(code) {
- FS.genericErrors[code] = new FS.ErrnoError(code);
- FS.genericErrors[code].stack = '<generic error, no stack>';
- });
- },staticInit:function () {
- FS.ensureErrnoError();
-
- FS.nameTable = new Array(4096);
-
- FS.mount(MEMFS, {}, '/');
-
- FS.createDefaultDirectories();
- FS.createDefaultDevices();
- FS.createSpecialDirectories();
-
- FS.filesystems = {
- 'MEMFS': MEMFS,
- 'IDBFS': IDBFS,
- 'NODEFS': NODEFS,
- 'WORKERFS': WORKERFS,
- };
- },init:function (input, output, error) {
- 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)');
- FS.init.initialized = true;
-
- FS.ensureErrnoError();
-
- // Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here
- Module['stdin'] = input || Module['stdin'];
- Module['stdout'] = output || Module['stdout'];
- Module['stderr'] = error || Module['stderr'];
-
- FS.createStandardStreams();
- },quit:function () {
- FS.init.initialized = false;
- // force-flush all streams, so we get musl std streams printed out
- var fflush = Module['_fflush'];
- if (fflush) fflush(0);
- // close all of our streams
- for (var i = 0; i < FS.streams.length; i++) {
- var stream = FS.streams[i];
- if (!stream) {
- continue;
- }
- FS.close(stream);
- }
- },getMode:function (canRead, canWrite) {
- var mode = 0;
- if (canRead) mode |= 292 | 73;
- if (canWrite) mode |= 146;
- return mode;
- },joinPath:function (parts, forceRelative) {
- var path = PATH.join.apply(null, parts);
- if (forceRelative && path[0] == '/') path = path.substr(1);
- return path;
- },absolutePath:function (relative, base) {
- return PATH.resolve(base, relative);
- },standardizePath:function (path) {
- return PATH.normalize(path);
- },findObject:function (path, dontResolveLastLink) {
- var ret = FS.analyzePath(path, dontResolveLastLink);
- if (ret.exists) {
- return ret.object;
- } else {
- ___setErrNo(ret.error);
- return null;
- }
- },analyzePath:function (path, dontResolveLastLink) {
- // operate from within the context of the symlink's target
- try {
- var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });
- path = lookup.path;
- } catch (e) {
- }
- var ret = {
- isRoot: false, exists: false, error: 0, name: null, path: null, object: null,
- parentExists: false, parentPath: null, parentObject: null
- };
- try {
- var lookup = FS.lookupPath(path, { parent: true });
- ret.parentExists = true;
- ret.parentPath = lookup.path;
- ret.parentObject = lookup.node;
- ret.name = PATH.basename(path);
- lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });
- ret.exists = true;
- ret.path = lookup.path;
- ret.object = lookup.node;
- ret.name = lookup.node.name;
- ret.isRoot = lookup.path === '/';
- } catch (e) {
- ret.error = e.errno;
- };
- return ret;
- },createFolder:function (parent, name, canRead, canWrite) {
- var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
- var mode = FS.getMode(canRead, canWrite);
- return FS.mkdir(path, mode);
- },createPath:function (parent, path, canRead, canWrite) {
- parent = typeof parent === 'string' ? parent : FS.getPath(parent);
- var parts = path.split('/').reverse();
- while (parts.length) {
- var part = parts.pop();
- if (!part) continue;
- var current = PATH.join2(parent, part);
- try {
- FS.mkdir(current);
- } catch (e) {
- // ignore EEXIST
- }
- parent = current;
- }
- return current;
- },createFile:function (parent, name, properties, canRead, canWrite) {
- var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
- var mode = FS.getMode(canRead, canWrite);
- return FS.create(path, mode);
- },createDataFile:function (parent, name, data, canRead, canWrite, canOwn) {
- var path = name ? PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name) : parent;
- var mode = FS.getMode(canRead, canWrite);
- var node = FS.create(path, mode);
- if (data) {
- if (typeof data === 'string') {
- var arr = new Array(data.length);
- for (var i = 0, len = data.length; i < len; ++i) arr[i] = data.charCodeAt(i);
- data = arr;
- }
- // make sure we can write to the file
- FS.chmod(node, mode | 146);
- var stream = FS.open(node, 'w');
- FS.write(stream, data, 0, data.length, 0, canOwn);
- FS.close(stream);
- FS.chmod(node, mode);
- }
- return node;
- },createDevice:function (parent, name, input, output) {
- var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
- var mode = FS.getMode(!!input, !!output);
- if (!FS.createDevice.major) FS.createDevice.major = 64;
- var dev = FS.makedev(FS.createDevice.major++, 0);
- // Create a fake device that a set of stream ops to emulate
- // the old behavior.
- FS.registerDevice(dev, {
- open: function(stream) {
- stream.seekable = false;
- },
- close: function(stream) {
- // flush any pending line data
- if (output && output.buffer && output.buffer.length) {
- output(10);
- }
- },
- read: function(stream, buffer, offset, length, pos /* ignored */) {
- var bytesRead = 0;
- for (var i = 0; i < length; i++) {
- var result;
- try {
- result = input();
- } catch (e) {
- throw new FS.ErrnoError(ERRNO_CODES.EIO);
- }
- if (result === undefined && bytesRead === 0) {
- throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
- }
- if (result === null || result === undefined) break;
- bytesRead++;
- buffer[offset+i] = result;
- }
- if (bytesRead) {
- stream.node.timestamp = Date.now();
- }
- return bytesRead;
- },
- write: function(stream, buffer, offset, length, pos) {
- for (var i = 0; i < length; i++) {
- try {
- output(buffer[offset+i]);
- } catch (e) {
- throw new FS.ErrnoError(ERRNO_CODES.EIO);
- }
- }
- if (length) {
- stream.node.timestamp = Date.now();
- }
- return i;
- }
- });
- return FS.mkdev(path, mode, dev);
- },createLink:function (parent, name, target, canRead, canWrite) {
- var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
- return FS.symlink(target, path);
- },forceLoadFile:function (obj) {
- if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;
- var success = true;
- if (typeof XMLHttpRequest !== 'undefined') {
- 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.");
- } else if (Module['read']) {
- // Command-line.
- try {
- // WARNING: Can't read binary files in V8's d8 or tracemonkey's js, as
- // read() will try to parse UTF8.
- obj.contents = intArrayFromString(Module['read'](obj.url), true);
- obj.usedBytes = obj.contents.length;
- } catch (e) {
- success = false;
- }
- } else {
- throw new Error('Cannot load without read() or XMLHttpRequest.');
- }
- if (!success) ___setErrNo(ERRNO_CODES.EIO);
- return success;
- },createLazyFile:function (parent, name, url, canRead, canWrite) {
- // Lazy chunked Uint8Array (implements get and length from Uint8Array). Actual getting is abstracted away for eventual reuse.
- function LazyUint8Array() {
- this.lengthKnown = false;
- this.chunks = []; // Loaded chunks. Index is the chunk number
- }
- LazyUint8Array.prototype.get = function LazyUint8Array_get(idx) {
- if (idx > this.length-1 || idx < 0) {
- return undefined;
- }
- var chunkOffset = idx % this.chunkSize;
- var chunkNum = (idx / this.chunkSize)|0;
- return this.getter(chunkNum)[chunkOffset];
- }
- LazyUint8Array.prototype.setDataGetter = function LazyUint8Array_setDataGetter(getter) {
- this.getter = getter;
- }
- LazyUint8Array.prototype.cacheLength = function LazyUint8Array_cacheLength() {
- // Find length
- var xhr = new XMLHttpRequest();
- xhr.open('HEAD', url, false);
- xhr.send(null);
- if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
- var datalength = Number(xhr.getResponseHeader("Content-length"));
- var header;
- var hasByteServing = (header = xhr.getResponseHeader("Accept-Ranges")) && header === "bytes";
- var usesGzip = (header = xhr.getResponseHeader("Content-Encoding")) && header === "gzip";
-
- var chunkSize = 1024*1024; // Chunk size in bytes
-
- if (!hasByteServing) chunkSize = datalength;
-
- // Function to get a range from the remote URL.
- var doXHR = (function(from, to) {
- if (from > to) throw new Error("invalid range (" + from + ", " + to + ") or no bytes requested!");
- if (to > datalength-1) throw new Error("only " + datalength + " bytes available! programmer error!");
-
- // TODO: Use mozResponseArrayBuffer, responseStream, etc. if available.
- var xhr = new XMLHttpRequest();
- xhr.open('GET', url, false);
- if (datalength !== chunkSize) xhr.setRequestHeader("Range", "bytes=" + from + "-" + to);
-
- // Some hints to the browser that we want binary data.
- if (typeof Uint8Array != 'undefined') xhr.responseType = 'arraybuffer';
- if (xhr.overrideMimeType) {
- xhr.overrideMimeType('text/plain; charset=x-user-defined');
- }
-
- xhr.send(null);
- if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
- if (xhr.response !== undefined) {
- return new Uint8Array(xhr.response || []);
- } else {
- return intArrayFromString(xhr.responseText || '', true);
- }
- });
- var lazyArray = this;
- lazyArray.setDataGetter(function(chunkNum) {
- var start = chunkNum * chunkSize;
- var end = (chunkNum+1) * chunkSize - 1; // including this byte
- end = Math.min(end, datalength-1); // if datalength-1 is selected, this is the last block
- if (typeof(lazyArray.chunks[chunkNum]) === "undefined") {
- lazyArray.chunks[chunkNum] = doXHR(start, end);
- }
- if (typeof(lazyArray.chunks[chunkNum]) === "undefined") throw new Error("doXHR failed!");
- return lazyArray.chunks[chunkNum];
- });
-
- if (usesGzip || !datalength) {
- // if the server uses gzip or doesn't supply the length, we have to download the whole file to get the (uncompressed) length
- chunkSize = datalength = 1; // this will force getter(0)/doXHR do download the whole file
- datalength = this.getter(0).length;
- chunkSize = datalength;
- console.log("LazyFiles on gzip forces download of the whole file when length is accessed");
- }
-
- this._length = datalength;
- this._chunkSize = chunkSize;
- this.lengthKnown = true;
- }
- if (typeof XMLHttpRequest !== 'undefined') {
- if (!ENVIRONMENT_IS_WORKER) throw 'Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc';
- var lazyArray = new LazyUint8Array();
- Object.defineProperties(lazyArray, {
- length: {
- get: function() {
- if(!this.lengthKnown) {
- this.cacheLength();
- }
- return this._length;
- }
- },
- chunkSize: {
- get: function() {
- if(!this.lengthKnown) {
- this.cacheLength();
- }
- return this._chunkSize;
- }
- }
- });
-
- var properties = { isDevice: false, contents: lazyArray };
- } else {
- var properties = { isDevice: false, url: url };
- }
-
- var node = FS.createFile(parent, name, properties, canRead, canWrite);
- // This is a total hack, but I want to get this lazy file code out of the
- // core of MEMFS. If we want to keep this lazy file concept I feel it should
- // be its own thin LAZYFS proxying calls to MEMFS.
- if (properties.contents) {
- node.contents = properties.contents;
- } else if (properties.url) {
- node.contents = null;
- node.url = properties.url;
- }
- // Add a function that defers querying the file size until it is asked the first time.
- Object.defineProperties(node, {
- usedBytes: {
- get: function() { return this.contents.length; }
- }
- });
- // override each stream op with one that tries to force load the lazy file first
- var stream_ops = {};
- var keys = Object.keys(node.stream_ops);
- keys.forEach(function(key) {
- var fn = node.stream_ops[key];
- stream_ops[key] = function forceLoadLazyFile() {
- if (!FS.forceLoadFile(node)) {
- throw new FS.ErrnoError(ERRNO_CODES.EIO);
- }
- return fn.apply(null, arguments);
- };
- });
- // use a custom read function
- stream_ops.read = function stream_ops_read(stream, buffer, offset, length, position) {
- if (!FS.forceLoadFile(node)) {
- throw new FS.ErrnoError(ERRNO_CODES.EIO);
- }
- var contents = stream.node.contents;
- if (position >= contents.length)
- return 0;
- var size = Math.min(contents.length - position, length);
- assert(size >= 0);
- if (contents.slice) { // normal array
- for (var i = 0; i < size; i++) {
- buffer[offset + i] = contents[position + i];
- }
- } else {
- for (var i = 0; i < size; i++) { // LazyUint8Array from sync binary XHR
- buffer[offset + i] = contents.get(position + i);
- }
- }
- return size;
- };
- node.stream_ops = stream_ops;
- return node;
- },createPreloadedFile:function (parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn, preFinish) {
- Browser.init(); // XXX perhaps this method should move onto Browser?
- // TODO we should allow people to just pass in a complete filename instead
- // of parent and name being that we just join them anyways
- var fullname = name ? PATH.resolve(PATH.join2(parent, name)) : parent;
- var dep = getUniqueRunDependency('cp ' + fullname); // might have several active requests for the same fullname
- function processData(byteArray) {
- function finish(byteArray) {
- if (preFinish) preFinish();
- if (!dontCreateFile) {
- FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);
- }
- if (onload) onload();
- removeRunDependency(dep);
- }
- var handled = false;
- Module['preloadPlugins'].forEach(function(plugin) {
- if (handled) return;
- if (plugin['canHandle'](fullname)) {
- plugin['handle'](byteArray, fullname, finish, function() {
- if (onerror) onerror();
- removeRunDependency(dep);
- });
- handled = true;
- }
- });
- if (!handled) finish(byteArray);
- }
- addRunDependency(dep);
- if (typeof url == 'string') {
- Browser.asyncLoad(url, function(byteArray) {
- processData(byteArray);
- }, onerror);
- } else {
- processData(url);
- }
- },indexedDB:function () {
- return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
- },DB_NAME:function () {
- return 'EM_FS_' + window.location.pathname;
- },DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function (paths, onload, onerror) {
- onload = onload || function(){};
- onerror = onerror || function(){};
- var indexedDB = FS.indexedDB();
- try {
- var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);
- } catch (e) {
- return onerror(e);
- }
- openRequest.onupgradeneeded = function openRequest_onupgradeneeded() {
- console.log('creating db');
- var db = openRequest.result;
- db.createObjectStore(FS.DB_STORE_NAME);
- };
- openRequest.onsuccess = function openRequest_onsuccess() {
- var db = openRequest.result;
- var transaction = db.transaction([FS.DB_STORE_NAME], 'readwrite');
- var files = transaction.objectStore(FS.DB_STORE_NAME);
- var ok = 0, fail = 0, total = paths.length;
- function finish() {
- if (fail == 0) onload(); else onerror();
- }
- paths.forEach(function(path) {
- var putRequest = files.put(FS.analyzePath(path).object.contents, path);
- putRequest.onsuccess = function putRequest_onsuccess() { ok++; if (ok + fail == total) finish() };
- putRequest.onerror = function putRequest_onerror() { fail++; if (ok + fail == total) finish() };
- });
- transaction.onerror = onerror;
- };
- openRequest.onerror = onerror;
- },loadFilesFromDB:function (paths, onload, onerror) {
- onload = onload || function(){};
- onerror = onerror || function(){};
- var indexedDB = FS.indexedDB();
- try {
- var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);
- } catch (e) {
- return onerror(e);
- }
- openRequest.onupgradeneeded = onerror; // no database to load from
- openRequest.onsuccess = function openRequest_onsuccess() {
- var db = openRequest.result;
- try {
- var transaction = db.transaction([FS.DB_STORE_NAME], 'readonly');
- } catch(e) {
- onerror(e);
- return;
- }
- var files = transaction.objectStore(FS.DB_STORE_NAME);
- var ok = 0, fail = 0, total = paths.length;
- function finish() {
- if (fail == 0) onload(); else onerror();
- }
- paths.forEach(function(path) {
- var getRequest = files.get(path);
- getRequest.onsuccess = function getRequest_onsuccess() {
- if (FS.analyzePath(path).exists) {
- FS.unlink(path);
- }
- FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true);
- ok++;
- if (ok + fail == total) finish();
- };
- getRequest.onerror = function getRequest_onerror() { fail++; if (ok + fail == total) finish() };
- });
- transaction.onerror = onerror;
- };
- openRequest.onerror = onerror;
- }};var SYSCALLS={DEFAULT_POLLMASK:5,mappings:{},umask:511,calculateAt:function (dirfd, path) {
- if (path[0] !== '/') {
- // relative path
- var dir;
- if (dirfd === -100) {
- dir = FS.cwd();
- } else {
- var dirstream = FS.getStream(dirfd);
- if (!dirstream) throw new FS.ErrnoError(ERRNO_CODES.EBADF);
- dir = dirstream.path;
- }
- path = PATH.join2(dir, path);
- }
- return path;
- },doStat:function (func, path, buf) {
- try {
- var stat = func(path);
- } catch (e) {
- if (e && e.node && PATH.normalize(path) !== PATH.normalize(FS.getPath(e.node))) {
- // an error occurred while trying to look up the path; we should just report ENOTDIR
- return -ERRNO_CODES.ENOTDIR;
- }
- throw e;
- }
- HEAP32[((buf)>>2)]=stat.dev;
- HEAP32[(((buf)+(4))>>2)]=0;
- HEAP32[(((buf)+(8))>>2)]=stat.ino;
- HEAP32[(((buf)+(12))>>2)]=stat.mode;
- HEAP32[(((buf)+(16))>>2)]=stat.nlink;
- HEAP32[(((buf)+(20))>>2)]=stat.uid;
- HEAP32[(((buf)+(24))>>2)]=stat.gid;
- HEAP32[(((buf)+(28))>>2)]=stat.rdev;
- HEAP32[(((buf)+(32))>>2)]=0;
- HEAP32[(((buf)+(36))>>2)]=stat.size;
- HEAP32[(((buf)+(40))>>2)]=4096;
- HEAP32[(((buf)+(44))>>2)]=stat.blocks;
- HEAP32[(((buf)+(48))>>2)]=(stat.atime.getTime() / 1000)|0;
- HEAP32[(((buf)+(52))>>2)]=0;
- HEAP32[(((buf)+(56))>>2)]=(stat.mtime.getTime() / 1000)|0;
- HEAP32[(((buf)+(60))>>2)]=0;
- HEAP32[(((buf)+(64))>>2)]=(stat.ctime.getTime() / 1000)|0;
- HEAP32[(((buf)+(68))>>2)]=0;
- HEAP32[(((buf)+(72))>>2)]=stat.ino;
- return 0;
- },doMsync:function (addr, stream, len, flags) {
- var buffer = new Uint8Array(HEAPU8.subarray(addr, addr + len));
- FS.msync(stream, buffer, 0, len, flags);
- },doMkdir:function (path, mode) {
- // remove a trailing slash, if one - /a/b/ has basename of '', but
- // we want to create b in the context of this function
- path = PATH.normalize(path);
- if (path[path.length-1] === '/') path = path.substr(0, path.length-1);
- FS.mkdir(path, mode, 0);
- return 0;
- },doMknod:function (path, mode, dev) {
- // we don't want this in the JS API as it uses mknod to create all nodes.
- switch (mode & 61440) {
- case 32768:
- case 8192:
- case 24576:
- case 4096:
- case 49152:
- break;
- default: return -ERRNO_CODES.EINVAL;
- }
- FS.mknod(path, mode, dev);
- return 0;
- },doReadlink:function (path, buf, bufsize) {
- if (bufsize <= 0) return -ERRNO_CODES.EINVAL;
- var ret = FS.readlink(path);
-
- var len = Math.min(bufsize, lengthBytesUTF8(ret));
- var endChar = HEAP8[buf+len];
- stringToUTF8(ret, buf, bufsize+1);
- // readlink is one of the rare functions that write out a C string, but does never append a null to the output buffer(!)
- // stringToUTF8() always appends a null byte, so restore the character under the null byte after the write.
- HEAP8[buf+len] = endChar;
-
- return len;
- },doAccess:function (path, amode) {
- if (amode & ~7) {
- // need a valid mode
- return -ERRNO_CODES.EINVAL;
- }
- var node;
- var lookup = FS.lookupPath(path, { follow: true });
- node = lookup.node;
- var perms = '';
- if (amode & 4) perms += 'r';
- if (amode & 2) perms += 'w';
- if (amode & 1) perms += 'x';
- if (perms /* otherwise, they've just passed F_OK */ && FS.nodePermissions(node, perms)) {
- return -ERRNO_CODES.EACCES;
- }
- return 0;
- },doDup:function (path, flags, suggestFD) {
- var suggest = FS.getStream(suggestFD);
- if (suggest) FS.close(suggest);
- return FS.open(path, flags, 0, suggestFD, suggestFD).fd;
- },doReadv:function (stream, iov, iovcnt, offset) {
- var ret = 0;
- for (var i = 0; i < iovcnt; i++) {
- var ptr = HEAP32[(((iov)+(i*8))>>2)];
- var len = HEAP32[(((iov)+(i*8 + 4))>>2)];
- var curr = FS.read(stream, HEAP8,ptr, len, offset);
- if (curr < 0) return -1;
- ret += curr;
- if (curr < len) break; // nothing more to read
- }
- return ret;
- },doWritev:function (stream, iov, iovcnt, offset) {
- var ret = 0;
- for (var i = 0; i < iovcnt; i++) {
- var ptr = HEAP32[(((iov)+(i*8))>>2)];
- var len = HEAP32[(((iov)+(i*8 + 4))>>2)];
- var curr = FS.write(stream, HEAP8,ptr, len, offset);
- if (curr < 0) return -1;
- ret += curr;
- }
- return ret;
- },varargs:0,get:function (varargs) {
- SYSCALLS.varargs += 4;
- var ret = HEAP32[(((SYSCALLS.varargs)-(4))>>2)];
- return ret;
- },getStr:function () {
- var ret = Pointer_stringify(SYSCALLS.get());
- return ret;
- },getStreamFromFD:function () {
- var stream = FS.getStream(SYSCALLS.get());
- if (!stream) throw new FS.ErrnoError(ERRNO_CODES.EBADF);
- return stream;
- },getSocketFromFD:function () {
- var socket = SOCKFS.getSocket(SYSCALLS.get());
- if (!socket) throw new FS.ErrnoError(ERRNO_CODES.EBADF);
- return socket;
- },getSocketAddress:function (allowNull) {
- var addrp = SYSCALLS.get(), addrlen = SYSCALLS.get();
- if (allowNull && addrp === 0) return null;
- var info = __read_sockaddr(addrp, addrlen);
- if (info.errno) throw new FS.ErrnoError(info.errno);
- info.addr = DNS.lookup_addr(info.addr) || info.addr;
- return info;
- },get64:function () {
- var low = SYSCALLS.get(), high = SYSCALLS.get();
- if (low >= 0) assert(high === 0);
- else assert(high === -1);
- return low;
- },getZero:function () {
- assert(SYSCALLS.get() === 0);
- }};function ___syscall54(which, varargs) {if (ENVIRONMENT_IS_PTHREAD) { return _emscripten_sync_run_in_main_thread_2(138, 54, varargs) }
- SYSCALLS.varargs = varargs;
- try {
- // ioctl
- var stream = SYSCALLS.getStreamFromFD(), op = SYSCALLS.get();
- switch (op) {
- case 21505: {
- if (!stream.tty) return -ERRNO_CODES.ENOTTY;
- return 0;
- }
- case 21506: {
- if (!stream.tty) return -ERRNO_CODES.ENOTTY;
- return 0; // no-op, not actually adjusting terminal settings
- }
- case 21519: {
- if (!stream.tty) return -ERRNO_CODES.ENOTTY;
- var argp = SYSCALLS.get();
- HEAP32[((argp)>>2)]=0;
- return 0;
- }
- case 21520: {
- if (!stream.tty) return -ERRNO_CODES.ENOTTY;
- return -ERRNO_CODES.EINVAL; // not supported
- }
- case 21531: {
- var argp = SYSCALLS.get();
- return FS.ioctl(stream, op, argp);
- }
- case 21523: {
- // TODO: in theory we should write to the winsize struct that gets
- // passed in, but for now musl doesn't read anything on it
- if (!stream.tty) return -ERRNO_CODES.ENOTTY;
- return 0;
- }
- default: abort('bad ioctl syscall ' + op);
- }
- } catch (e) {
- if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) abort(e);
- return -e.errno;
- }
- }
- function _emscripten_glSampleCoverage(value, invert) {
- GLctx.sampleCoverage(value, !!invert);
- }
- function _glDeleteTextures(n, textures) {
- for (var i = 0; i < n; i++) {
- var id = HEAP32[(((textures)+(i*4))>>2)];
- var texture = GL.textures[id];
- if (!texture) continue; // GL spec: "glDeleteTextures silently ignores 0s and names that do not correspond to existing textures".
- GLctx.deleteTexture(texture);
- texture.name = 0;
- GL.textures[id] = null;
- }
- }
- function _emscripten_glFrustum() {
- Module['printErr']('missing function: emscripten_glFrustum'); abort(-1);
- }
- function _glfwSetWindowSizeCallback(winid, cbfun) {
- GLFW.setWindowSizeCallback(winid, cbfun);
- }
- function _emscripten_glGetTexParameterfv(target, pname, params) {
- if (!params) {
- // GLES2 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense
- // if p == null, issue a GL error to notify user about it.
- GL.recordError(0x0501 /* GL_INVALID_VALUE */);
- return;
- }
- HEAPF32[((params)>>2)]=GLctx.getTexParameter(target, pname);
- }
- function _emscripten_glUniform4i(location, v0, v1, v2, v3) {
- GLctx.uniform4i(GL.uniforms[location], v0, v1, v2, v3);
- }
- function _emscripten_glBindRenderbuffer(target, renderbuffer) {
- GLctx.bindRenderbuffer(target, renderbuffer ? GL.renderbuffers[renderbuffer] : null);
- }
- function _emscripten_glViewport(x0, x1, x2, x3) { GLctx['viewport'](x0, x1, x2, x3) }
-
-
- 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 () {
- if (typeof window !== 'undefined') {
- window.addEventListener("gamepadconnected", function() { ++JSEvents.numGamepadsConnected; });
- window.addEventListener("gamepaddisconnected", function() { --JSEvents.numGamepadsConnected; });
- }
- },registerRemoveEventListeners:function () {
- if (!JSEvents.removeEventListenersRegistered) {
- __ATEXIT__.push(function() {
- for(var i = JSEvents.eventHandlers.length-1; i >= 0; --i) {
- JSEvents._removeHandler(i);
- }
- });
- JSEvents.removeEventListenersRegistered = true;
- }
- },findEventTarget:function (target) {
- if (target) {
- if (typeof target == "number") {
- target = Pointer_stringify(target);
- }
- if (target == '#window') return window;
- else if (target == '#document') return document;
- else if (target == '#screen') return window.screen;
- else if (target == '#canvas') return Module['canvas'];
-
- if (typeof target == 'string') return document.getElementById(target);
- else return target;
- } else {
- // The sensible target varies between events, but use window as the default
- // since DOM events mostly can default to that. Specific callback registrations
- // override their own defaults.
- return window;
- }
- },deferredCalls:[],deferCall:function (targetFunction, precedence, argsList) {
- function arraysHaveEqualContent(arrA, arrB) {
- if (arrA.length != arrB.length) return false;
-
- for(var i in arrA) {
- if (arrA[i] != arrB[i]) return false;
- }
- return true;
- }
- // Test if the given call was already queued, and if so, don't add it again.
- for(var i in JSEvents.deferredCalls) {
- var call = JSEvents.deferredCalls[i];
- if (call.targetFunction == targetFunction && arraysHaveEqualContent(call.argsList, argsList)) {
- return;
- }
- }
- JSEvents.deferredCalls.push({
- targetFunction: targetFunction,
- precedence: precedence,
- argsList: argsList
- });
-
- JSEvents.deferredCalls.sort(function(x,y) { return x.precedence < y.precedence; });
- },removeDeferredCalls:function (targetFunction) {
- for(var i = 0; i < JSEvents.deferredCalls.length; ++i) {
- if (JSEvents.deferredCalls[i].targetFunction == targetFunction) {
- JSEvents.deferredCalls.splice(i, 1);
- --i;
- }
- }
- },canPerformEventHandlerRequests:function () {
- return JSEvents.inEventHandler && JSEvents.currentEventHandler.allowsDeferredCalls;
- },runDeferredCalls:function () {
- if (!JSEvents.canPerformEventHandlerRequests()) {
- return;
- }
- for(var i = 0; i < JSEvents.deferredCalls.length; ++i) {
- var call = JSEvents.deferredCalls[i];
- JSEvents.deferredCalls.splice(i, 1);
- --i;
- call.targetFunction.apply(this, call.argsList);
- }
- },inEventHandler:0,currentEventHandler:null,eventHandlers:[],isInternetExplorer:function () { return navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0; },removeAllHandlersOnTarget:function (target, eventTypeString) {
- for(var i = 0; i < JSEvents.eventHandlers.length; ++i) {
- if (JSEvents.eventHandlers[i].target == target &&
- (!eventTypeString || eventTypeString == JSEvents.eventHandlers[i].eventTypeString)) {
- JSEvents._removeHandler(i--);
- }
- }
- },_removeHandler:function (i) {
- var h = JSEvents.eventHandlers[i];
- h.target.removeEventListener(h.eventTypeString, h.eventListenerFunc, h.useCapture);
- JSEvents.eventHandlers.splice(i, 1);
- },registerOrRemoveHandler:function (eventHandler) {
- var jsEventHandler = function jsEventHandler(event) {
- // Increment nesting count for the event handler.
- ++JSEvents.inEventHandler;
- JSEvents.currentEventHandler = eventHandler;
- // Process any old deferred calls the user has placed.
- JSEvents.runDeferredCalls();
- // Process the actual event, calls back to user C code handler.
- eventHandler.handlerFunc(event);
- // Process any new deferred calls that were placed right now from this event handler.
- JSEvents.runDeferredCalls();
- // Out of event handler - restore nesting count.
- --JSEvents.inEventHandler;
- }
-
- if (eventHandler.callbackfunc) {
- eventHandler.eventListenerFunc = jsEventHandler;
- eventHandler.target.addEventListener(eventHandler.eventTypeString, jsEventHandler, eventHandler.useCapture);
- JSEvents.eventHandlers.push(eventHandler);
- JSEvents.registerRemoveEventListeners();
- } else {
- for(var i = 0; i < JSEvents.eventHandlers.length; ++i) {
- if (JSEvents.eventHandlers[i].target == eventHandler.target
- && JSEvents.eventHandlers[i].eventTypeString == eventHandler.eventTypeString) {
- JSEvents._removeHandler(i--);
- }
- }
- }
- },registerKeyEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
- if (!JSEvents.keyEvent) {
- JSEvents.keyEvent = _malloc( 164 );
- }
- var handlerFunc = function(event) {
- var e = event || window.event;
- stringToUTF8(e.key ? e.key : "", JSEvents.keyEvent + 0, 32);
- stringToUTF8(e.code ? e.code : "", JSEvents.keyEvent + 32, 32);
- HEAP32[(((JSEvents.keyEvent)+(64))>>2)]=e.location;
- HEAP32[(((JSEvents.keyEvent)+(68))>>2)]=e.ctrlKey;
- HEAP32[(((JSEvents.keyEvent)+(72))>>2)]=e.shiftKey;
- HEAP32[(((JSEvents.keyEvent)+(76))>>2)]=e.altKey;
- HEAP32[(((JSEvents.keyEvent)+(80))>>2)]=e.metaKey;
- HEAP32[(((JSEvents.keyEvent)+(84))>>2)]=e.repeat;
- stringToUTF8(e.locale ? e.locale : "", JSEvents.keyEvent + 88, 32);
- stringToUTF8(e.char ? e.char : "", JSEvents.keyEvent + 120, 32);
- HEAP32[(((JSEvents.keyEvent)+(152))>>2)]=e.charCode;
- HEAP32[(((JSEvents.keyEvent)+(156))>>2)]=e.keyCode;
- HEAP32[(((JSEvents.keyEvent)+(160))>>2)]=e.which;
- var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.keyEvent, userData);
- if (shouldCancel) {
- e.preventDefault();
- }
- };
-
- var eventHandler = {
- target: JSEvents.findEventTarget(target),
- allowsDeferredCalls: JSEvents.isInternetExplorer() ? false : true, // MSIE doesn't allow fullscreen and pointerlock requests from key handlers, others do.
- eventTypeString: eventTypeString,
- callbackfunc: callbackfunc,
- handlerFunc: handlerFunc,
- useCapture: useCapture
- };
- JSEvents.registerOrRemoveHandler(eventHandler);
- },getBoundingClientRectOrZeros:function (target) {
- return target.getBoundingClientRect ? target.getBoundingClientRect() : { left: 0, top: 0 };
- },fillMouseEventData:function (eventStruct, e, target) {
- HEAPF64[((eventStruct)>>3)]=JSEvents.tick();
- HEAP32[(((eventStruct)+(8))>>2)]=e.screenX;
- HEAP32[(((eventStruct)+(12))>>2)]=e.screenY;
- HEAP32[(((eventStruct)+(16))>>2)]=e.clientX;
- HEAP32[(((eventStruct)+(20))>>2)]=e.clientY;
- HEAP32[(((eventStruct)+(24))>>2)]=e.ctrlKey;
- HEAP32[(((eventStruct)+(28))>>2)]=e.shiftKey;
- HEAP32[(((eventStruct)+(32))>>2)]=e.altKey;
- HEAP32[(((eventStruct)+(36))>>2)]=e.metaKey;
- HEAP16[(((eventStruct)+(40))>>1)]=e.button;
- HEAP16[(((eventStruct)+(42))>>1)]=e.buttons;
- HEAP32[(((eventStruct)+(44))>>2)]=e["movementX"] || e["mozMovementX"] || e["webkitMovementX"] || (e.screenX-JSEvents.previousScreenX);
- HEAP32[(((eventStruct)+(48))>>2)]=e["movementY"] || e["mozMovementY"] || e["webkitMovementY"] || (e.screenY-JSEvents.previousScreenY);
-
- if (Module['canvas']) {
- var rect = Module['canvas'].getBoundingClientRect();
- HEAP32[(((eventStruct)+(60))>>2)]=e.clientX - rect.left;
- HEAP32[(((eventStruct)+(64))>>2)]=e.clientY - rect.top;
- } else { // Canvas is not initialized, return 0.
- HEAP32[(((eventStruct)+(60))>>2)]=0;
- HEAP32[(((eventStruct)+(64))>>2)]=0;
- }
- if (target) {
- var rect = JSEvents.getBoundingClientRectOrZeros(target);
- HEAP32[(((eventStruct)+(52))>>2)]=e.clientX - rect.left;
- HEAP32[(((eventStruct)+(56))>>2)]=e.clientY - rect.top;
- } else { // No specific target passed, return 0.
- HEAP32[(((eventStruct)+(52))>>2)]=0;
- HEAP32[(((eventStruct)+(56))>>2)]=0;
- }
- // wheel and mousewheel events contain wrong screenX/screenY on chrome/opera
- // https://github.com/kripken/emscripten/pull/4997
- // https://bugs.chromium.org/p/chromium/issues/detail?id=699956
- if (e.type !== 'wheel' && e.type !== 'mousewheel') {
- JSEvents.previousScreenX = e.screenX;
- JSEvents.previousScreenY = e.screenY;
- }
- },registerMouseEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
- if (!JSEvents.mouseEvent) {
- JSEvents.mouseEvent = _malloc( 72 );
- }
- target = JSEvents.findEventTarget(target);
- var handlerFunc = function(event) {
- var e = event || window.event;
- JSEvents.fillMouseEventData(JSEvents.mouseEvent, e, target);
- var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.mouseEvent, userData);
- if (shouldCancel) {
- e.preventDefault();
- }
- };
-
- var eventHandler = {
- target: target,
- allowsDeferredCalls: eventTypeString != 'mousemove' && eventTypeString != 'mouseenter' && eventTypeString != 'mouseleave', // Mouse move events do not allow fullscreen/pointer lock requests to be handled in them!
- eventTypeString: eventTypeString,
- callbackfunc: callbackfunc,
- handlerFunc: handlerFunc,
- useCapture: useCapture
- };
- // In IE, mousedown events don't either allow deferred calls to be run!
- if (JSEvents.isInternetExplorer() && eventTypeString == 'mousedown') eventHandler.allowsDeferredCalls = false;
- JSEvents.registerOrRemoveHandler(eventHandler);
- },registerWheelEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
- if (!JSEvents.wheelEvent) {
- JSEvents.wheelEvent = _malloc( 104 );
- }
- target = JSEvents.findEventTarget(target);
- // The DOM Level 3 events spec event 'wheel'
- var wheelHandlerFunc = function(event) {
- var e = event || window.event;
- JSEvents.fillMouseEventData(JSEvents.wheelEvent, e, target);
- HEAPF64[(((JSEvents.wheelEvent)+(72))>>3)]=e["deltaX"];
- HEAPF64[(((JSEvents.wheelEvent)+(80))>>3)]=e["deltaY"];
- HEAPF64[(((JSEvents.wheelEvent)+(88))>>3)]=e["deltaZ"];
- HEAP32[(((JSEvents.wheelEvent)+(96))>>2)]=e["deltaMode"];
- var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.wheelEvent, userData);
- if (shouldCancel) {
- e.preventDefault();
- }
- };
- // The 'mousewheel' event as implemented in Safari 6.0.5
- var mouseWheelHandlerFunc = function(event) {
- var e = event || window.event;
- JSEvents.fillMouseEventData(JSEvents.wheelEvent, e, target);
- HEAPF64[(((JSEvents.wheelEvent)+(72))>>3)]=e["wheelDeltaX"] || 0;
- 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. */;
- HEAPF64[(((JSEvents.wheelEvent)+(88))>>3)]=0 /* Not available */;
- HEAP32[(((JSEvents.wheelEvent)+(96))>>2)]=0 /* DOM_DELTA_PIXEL */;
- var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.wheelEvent, userData);
- if (shouldCancel) {
- e.preventDefault();
- }
- };
-
- var eventHandler = {
- target: target,
- allowsDeferredCalls: true,
- eventTypeString: eventTypeString,
- callbackfunc: callbackfunc,
- handlerFunc: (eventTypeString == 'wheel') ? wheelHandlerFunc : mouseWheelHandlerFunc,
- useCapture: useCapture
- };
- JSEvents.registerOrRemoveHandler(eventHandler);
- },pageScrollPos:function () {
- if (window.pageXOffset > 0 || window.pageYOffset > 0) {
- return [window.pageXOffset, window.pageYOffset];
- }
- if (typeof document.documentElement.scrollLeft !== 'undefined' || typeof document.documentElement.scrollTop !== 'undefined') {
- return [document.documentElement.scrollLeft, document.documentElement.scrollTop];
- }
- return [document.body.scrollLeft|0, document.body.scrollTop|0];
- },registerUiEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
- if (!JSEvents.uiEvent) {
- JSEvents.uiEvent = _malloc( 36 );
- }
-
- if (eventTypeString == "scroll" && !target) {
- target = document; // By default read scroll events on document rather than window.
- } else {
- target = JSEvents.findEventTarget(target);
- }
-
- var handlerFunc = function(event) {
- var e = event || window.event;
- if (e.target != target) {
- // Never take ui events such as scroll via a 'bubbled' route, but always from the direct element that
- // was targeted. Otherwise e.g. if app logs a message in response to a page scroll, the Emscripten log
- // message box could cause to scroll, generating a new (bubbled) scroll message, causing a new log print,
- // causing a new scroll, etc..
- return;
- }
- var scrollPos = JSEvents.pageScrollPos();
- HEAP32[((JSEvents.uiEvent)>>2)]=e.detail;
- HEAP32[(((JSEvents.uiEvent)+(4))>>2)]=document.body.clientWidth;
- HEAP32[(((JSEvents.uiEvent)+(8))>>2)]=document.body.clientHeight;
- HEAP32[(((JSEvents.uiEvent)+(12))>>2)]=window.innerWidth;
- HEAP32[(((JSEvents.uiEvent)+(16))>>2)]=window.innerHeight;
- HEAP32[(((JSEvents.uiEvent)+(20))>>2)]=window.outerWidth;
- HEAP32[(((JSEvents.uiEvent)+(24))>>2)]=window.outerHeight;
- HEAP32[(((JSEvents.uiEvent)+(28))>>2)]=scrollPos[0];
- HEAP32[(((JSEvents.uiEvent)+(32))>>2)]=scrollPos[1];
- var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.uiEvent, userData);
- if (shouldCancel) {
- e.preventDefault();
- }
- };
-
- var eventHandler = {
- target: target,
- allowsDeferredCalls: false, // Neither scroll or resize events allow running requests inside them.
- eventTypeString: eventTypeString,
- callbackfunc: callbackfunc,
- handlerFunc: handlerFunc,
- useCapture: useCapture
- };
- JSEvents.registerOrRemoveHandler(eventHandler);
- },getNodeNameForTarget:function (target) {
- if (!target) return '';
- if (target == window) return '#window';
- if (target == window.screen) return '#screen';
- return (target && target.nodeName) ? target.nodeName : '';
- },registerFocusEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
- if (!JSEvents.focusEvent) {
- JSEvents.focusEvent = _malloc( 256 );
- }
- var handlerFunc = function(event) {
- var e = event || window.event;
-
- var nodeName = JSEvents.getNodeNameForTarget(e.target);
- var id = e.target.id ? e.target.id : '';
- stringToUTF8(nodeName, JSEvents.focusEvent + 0, 128);
- stringToUTF8(id, JSEvents.focusEvent + 128, 128);
- var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.focusEvent, userData);
- if (shouldCancel) {
- e.preventDefault();
- }
- };
-
- var eventHandler = {
- target: JSEvents.findEventTarget(target),
- allowsDeferredCalls: false,
- eventTypeString: eventTypeString,
- callbackfunc: callbackfunc,
- handlerFunc: handlerFunc,
- useCapture: useCapture
- };
- JSEvents.registerOrRemoveHandler(eventHandler);
- },tick:function () {
- if (window['performance'] && window['performance']['now']) return window['performance']['now']();
- else return Date.now();
- },registerDeviceOrientationEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
- if (!JSEvents.deviceOrientationEvent) {
- JSEvents.deviceOrientationEvent = _malloc( 40 );
- }
- var handlerFunc = function(event) {
- var e = event || window.event;
-
- HEAPF64[((JSEvents.deviceOrientationEvent)>>3)]=JSEvents.tick();
- HEAPF64[(((JSEvents.deviceOrientationEvent)+(8))>>3)]=e.alpha;
- HEAPF64[(((JSEvents.deviceOrientationEvent)+(16))>>3)]=e.beta;
- HEAPF64[(((JSEvents.deviceOrientationEvent)+(24))>>3)]=e.gamma;
- HEAP32[(((JSEvents.deviceOrientationEvent)+(32))>>2)]=e.absolute;
-
- var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.deviceOrientationEvent, userData);
- if (shouldCancel) {
- e.preventDefault();
- }
- };
-
- var eventHandler = {
- target: JSEvents.findEventTarget(target),
- allowsDeferredCalls: false,
- eventTypeString: eventTypeString,
- callbackfunc: callbackfunc,
- handlerFunc: handlerFunc,
- useCapture: useCapture
- };
- JSEvents.registerOrRemoveHandler(eventHandler);
- },registerDeviceMotionEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
- if (!JSEvents.deviceMotionEvent) {
- JSEvents.deviceMotionEvent = _malloc( 80 );
- }
- var handlerFunc = function(event) {
- var e = event || window.event;
-
- HEAPF64[((JSEvents.deviceOrientationEvent)>>3)]=JSEvents.tick();
- HEAPF64[(((JSEvents.deviceMotionEvent)+(8))>>3)]=e.acceleration.x;
- HEAPF64[(((JSEvents.deviceMotionEvent)+(16))>>3)]=e.acceleration.y;
- HEAPF64[(((JSEvents.deviceMotionEvent)+(24))>>3)]=e.acceleration.z;
- HEAPF64[(((JSEvents.deviceMotionEvent)+(32))>>3)]=e.accelerationIncludingGravity.x;
- HEAPF64[(((JSEvents.deviceMotionEvent)+(40))>>3)]=e.accelerationIncludingGravity.y;
- HEAPF64[(((JSEvents.deviceMotionEvent)+(48))>>3)]=e.accelerationIncludingGravity.z;
- HEAPF64[(((JSEvents.deviceMotionEvent)+(56))>>3)]=e.rotationRate.alpha;
- HEAPF64[(((JSEvents.deviceMotionEvent)+(64))>>3)]=e.rotationRate.beta;
- HEAPF64[(((JSEvents.deviceMotionEvent)+(72))>>3)]=e.rotationRate.gamma;
-
- var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.deviceMotionEvent, userData);
- if (shouldCancel) {
- e.preventDefault();
- }
- };
-
- var eventHandler = {
- target: JSEvents.findEventTarget(target),
- allowsDeferredCalls: false,
- eventTypeString: eventTypeString,
- callbackfunc: callbackfunc,
- handlerFunc: handlerFunc,
- useCapture: useCapture
- };
- JSEvents.registerOrRemoveHandler(eventHandler);
- },screenOrientation:function () {
- if (!window.screen) return undefined;
- return window.screen.orientation || window.screen.mozOrientation || window.screen.webkitOrientation || window.screen.msOrientation;
- },fillOrientationChangeEventData:function (eventStruct, e) {
- var orientations = ["portrait-primary", "portrait-secondary", "landscape-primary", "landscape-secondary"];
- var orientations2 = ["portrait", "portrait", "landscape", "landscape"];
-
- var orientationString = JSEvents.screenOrientation();
- var orientation = orientations.indexOf(orientationString);
- if (orientation == -1) {
- orientation = orientations2.indexOf(orientationString);
- }
-
- HEAP32[((eventStruct)>>2)]=1 << orientation;
- HEAP32[(((eventStruct)+(4))>>2)]=window.orientation;
- },registerOrientationChangeEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
- if (!JSEvents.orientationChangeEvent) {
- JSEvents.orientationChangeEvent = _malloc( 8 );
- }
-
- if (!target) {
- target = window.screen; // Orientation events need to be captured from 'window.screen' instead of 'window'
- } else {
- target = JSEvents.findEventTarget(target);
- }
-
- var handlerFunc = function(event) {
- var e = event || window.event;
-
- JSEvents.fillOrientationChangeEventData(JSEvents.orientationChangeEvent, e);
-
- var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.orientationChangeEvent, userData);
- if (shouldCancel) {
- e.preventDefault();
- }
- };
-
- if (eventTypeString == "orientationchange" && window.screen.mozOrientation !== undefined) {
- eventTypeString = "mozorientationchange";
- }
-
- var eventHandler = {
- target: target,
- allowsDeferredCalls: false,
- eventTypeString: eventTypeString,
- callbackfunc: callbackfunc,
- handlerFunc: handlerFunc,
- useCapture: useCapture
- };
- JSEvents.registerOrRemoveHandler(eventHandler);
- },fullscreenEnabled:function () {
- return document.fullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled;
- },fillFullscreenChangeEventData:function (eventStruct, e) {
- var fullscreenElement = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement;
- var isFullscreen = !!fullscreenElement;
- HEAP32[((eventStruct)>>2)]=isFullscreen;
- HEAP32[(((eventStruct)+(4))>>2)]=JSEvents.fullscreenEnabled();
- // If transitioning to fullscreen, report info about the element that is now fullscreen.
- // If transitioning to windowed mode, report info about the element that just was fullscreen.
- var reportedElement = isFullscreen ? fullscreenElement : JSEvents.previousFullscreenElement;
- var nodeName = JSEvents.getNodeNameForTarget(reportedElement);
- var id = (reportedElement && reportedElement.id) ? reportedElement.id : '';
- stringToUTF8(nodeName, eventStruct + 8, 128);
- stringToUTF8(id, eventStruct + 136, 128);
- HEAP32[(((eventStruct)+(264))>>2)]=reportedElement ? reportedElement.clientWidth : 0;
- HEAP32[(((eventStruct)+(268))>>2)]=reportedElement ? reportedElement.clientHeight : 0;
- HEAP32[(((eventStruct)+(272))>>2)]=screen.width;
- HEAP32[(((eventStruct)+(276))>>2)]=screen.height;
- if (isFullscreen) {
- JSEvents.previousFullscreenElement = fullscreenElement;
- }
- },registerFullscreenChangeEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
- if (!JSEvents.fullscreenChangeEvent) {
- JSEvents.fullscreenChangeEvent = _malloc( 280 );
- }
-
- if (!target) {
- target = document; // Fullscreen change events need to be captured from 'document' by default instead of 'window'
- } else {
- target = JSEvents.findEventTarget(target);
- }
-
- var handlerFunc = function(event) {
- var e = event || window.event;
-
- JSEvents.fillFullscreenChangeEventData(JSEvents.fullscreenChangeEvent, e);
-
- var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.fullscreenChangeEvent, userData);
- if (shouldCancel) {
- e.preventDefault();
- }
- };
-
- var eventHandler = {
- target: target,
- allowsDeferredCalls: false,
- eventTypeString: eventTypeString,
- callbackfunc: callbackfunc,
- handlerFunc: handlerFunc,
- useCapture: useCapture
- };
- JSEvents.registerOrRemoveHandler(eventHandler);
- },resizeCanvasForFullscreen:function (target, strategy) {
- var restoreOldStyle = __registerRestoreOldStyle(target);
- var cssWidth = strategy.softFullscreen ? window.innerWidth : screen.width;
- var cssHeight = strategy.softFullscreen ? window.innerHeight : screen.height;
- var rect = target.getBoundingClientRect();
- var windowedCssWidth = rect.right - rect.left;
- var windowedCssHeight = rect.bottom - rect.top;
- var windowedRttWidth = target.width;
- var windowedRttHeight = target.height;
-
- if (strategy.scaleMode == 3) {
- __setLetterbox(target, (cssHeight - windowedCssHeight) / 2, (cssWidth - windowedCssWidth) / 2);
- cssWidth = windowedCssWidth;
- cssHeight = windowedCssHeight;
- } else if (strategy.scaleMode == 2) {
- if (cssWidth*windowedRttHeight < windowedRttWidth*cssHeight) {
- var desiredCssHeight = windowedRttHeight * cssWidth / windowedRttWidth;
- __setLetterbox(target, (cssHeight - desiredCssHeight) / 2, 0);
- cssHeight = desiredCssHeight;
- } else {
- var desiredCssWidth = windowedRttWidth * cssHeight / windowedRttHeight;
- __setLetterbox(target, 0, (cssWidth - desiredCssWidth) / 2);
- cssWidth = desiredCssWidth;
- }
- }
-
- // If we are adding padding, must choose a background color or otherwise Chrome will give the
- // padding a default white color. Do it only if user has not customized their own background color.
- if (!target.style.backgroundColor) target.style.backgroundColor = 'black';
- // IE11 does the same, but requires the color to be set in the document body.
- if (!document.body.style.backgroundColor) document.body.style.backgroundColor = 'black'; // IE11
- // Firefox always shows black letterboxes independent of style color.
-
- target.style.width = cssWidth + 'px';
- target.style.height = cssHeight + 'px';
-
- if (strategy.filteringMode == 1) {
- target.style.imageRendering = 'optimizeSpeed';
- target.style.imageRendering = '-moz-crisp-edges';
- target.style.imageRendering = '-o-crisp-edges';
- target.style.imageRendering = '-webkit-optimize-contrast';
- target.style.imageRendering = 'optimize-contrast';
- target.style.imageRendering = 'crisp-edges';
- target.style.imageRendering = 'pixelated';
- }
-
- var dpiScale = (strategy.canvasResolutionScaleMode == 2) ? window.devicePixelRatio : 1;
- if (strategy.canvasResolutionScaleMode != 0) {
- target.width = cssWidth * dpiScale;
- target.height = cssHeight * dpiScale;
- if (target.GLctxObject) target.GLctxObject.GLctx.viewport(0, 0, target.width, target.height);
- }
- return restoreOldStyle;
- },requestFullscreen:function (target, strategy) {
- // EMSCRIPTEN_FULLSCREEN_SCALE_DEFAULT + EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_NONE is a mode where no extra logic is performed to the DOM elements.
- if (strategy.scaleMode != 0 || strategy.canvasResolutionScaleMode != 0) {
- JSEvents.resizeCanvasForFullscreen(target, strategy);
- }
-
- if (target.requestFullscreen) {
- target.requestFullscreen();
- } else if (target.msRequestFullscreen) {
- target.msRequestFullscreen();
- } else if (target.mozRequestFullScreen) {
- target.mozRequestFullScreen();
- } else if (target.mozRequestFullscreen) {
- target.mozRequestFullscreen();
- } else if (target.webkitRequestFullscreen) {
- target.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
- } else {
- if (typeof JSEvents.fullscreenEnabled() === 'undefined') {
- return -1;
- } else {
- return -3;
- }
- }
-
- if (strategy.canvasResizedCallback) {
- Module['dynCall_iiii'](strategy.canvasResizedCallback, 37, 0, strategy.canvasResizedCallbackUserData);
- }
-
- return 0;
- },fillPointerlockChangeEventData:function (eventStruct, e) {
- var pointerLockElement = document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement || document.msPointerLockElement;
- var isPointerlocked = !!pointerLockElement;
- HEAP32[((eventStruct)>>2)]=isPointerlocked;
- var nodeName = JSEvents.getNodeNameForTarget(pointerLockElement);
- var id = (pointerLockElement && pointerLockElement.id) ? pointerLockElement.id : '';
- stringToUTF8(nodeName, eventStruct + 4, 128);
- stringToUTF8(id, eventStruct + 132, 128);
- },registerPointerlockChangeEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
- if (!JSEvents.pointerlockChangeEvent) {
- JSEvents.pointerlockChangeEvent = _malloc( 260 );
- }
-
- if (!target) {
- target = document; // Pointer lock change events need to be captured from 'document' by default instead of 'window'
- } else {
- target = JSEvents.findEventTarget(target);
- }
-
- var handlerFunc = function(event) {
- var e = event || window.event;
-
- JSEvents.fillPointerlockChangeEventData(JSEvents.pointerlockChangeEvent, e);
-
- var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.pointerlockChangeEvent, userData);
- if (shouldCancel) {
- e.preventDefault();
- }
- };
-
- var eventHandler = {
- target: target,
- allowsDeferredCalls: false,
- eventTypeString: eventTypeString,
- callbackfunc: callbackfunc,
- handlerFunc: handlerFunc,
- useCapture: useCapture
- };
- JSEvents.registerOrRemoveHandler(eventHandler);
- },registerPointerlockErrorEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
- if (!target) {
- target = document; // Pointer lock events need to be captured from 'document' by default instead of 'window'
- } else {
- target = JSEvents.findEventTarget(target);
- }
-
- var handlerFunc = function(event) {
- var e = event || window.event;
-
- var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, 0, userData);
- if (shouldCancel) {
- e.preventDefault();
- }
- };
-
- var eventHandler = {
- target: target,
- allowsDeferredCalls: false,
- eventTypeString: eventTypeString,
- callbackfunc: callbackfunc,
- handlerFunc: handlerFunc,
- useCapture: useCapture
- };
- JSEvents.registerOrRemoveHandler(eventHandler);
- },requestPointerLock:function (target) {
- if (target.requestPointerLock) {
- target.requestPointerLock();
- } else if (target.mozRequestPointerLock) {
- target.mozRequestPointerLock();
- } else if (target.webkitRequestPointerLock) {
- target.webkitRequestPointerLock();
- } else if (target.msRequestPointerLock) {
- target.msRequestPointerLock();
- } else {
- // document.body is known to accept pointer lock, so use that to differentiate if the user passed a bad element,
- // or if the whole browser just doesn't support the feature.
- if (document.body.requestPointerLock || document.body.mozRequestPointerLock || document.body.webkitRequestPointerLock || document.body.msRequestPointerLock) {
- return -3;
- } else {
- return -1;
- }
- }
- return 0;
- },fillVisibilityChangeEventData:function (eventStruct, e) {
- var visibilityStates = [ "hidden", "visible", "prerender", "unloaded" ];
- var visibilityState = visibilityStates.indexOf(document.visibilityState);
-
- HEAP32[((eventStruct)>>2)]=document.hidden;
- HEAP32[(((eventStruct)+(4))>>2)]=visibilityState;
- },registerVisibilityChangeEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
- if (!JSEvents.visibilityChangeEvent) {
- JSEvents.visibilityChangeEvent = _malloc( 8 );
- }
-
- if (!target) {
- target = document; // Visibility change events need to be captured from 'document' by default instead of 'window'
- } else {
- target = JSEvents.findEventTarget(target);
- }
-
- var handlerFunc = function(event) {
- var e = event || window.event;
-
- JSEvents.fillVisibilityChangeEventData(JSEvents.visibilityChangeEvent, e);
-
- var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.visibilityChangeEvent, userData);
- if (shouldCancel) {
- e.preventDefault();
- }
- };
-
- var eventHandler = {
- target: target,
- allowsDeferredCalls: false,
- eventTypeString: eventTypeString,
- callbackfunc: callbackfunc,
- handlerFunc: handlerFunc,
- useCapture: useCapture
- };
- JSEvents.registerOrRemoveHandler(eventHandler);
- },registerTouchEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
- if (!JSEvents.touchEvent) {
- JSEvents.touchEvent = _malloc( 1684 );
- }
-
- target = JSEvents.findEventTarget(target);
-
- var handlerFunc = function(event) {
- var e = event || window.event;
-
- var touches = {};
- for(var i = 0; i < e.touches.length; ++i) {
- var touch = e.touches[i];
- touches[touch.identifier] = touch;
- }
- for(var i = 0; i < e.changedTouches.length; ++i) {
- var touch = e.changedTouches[i];
- touches[touch.identifier] = touch;
- touch.changed = true;
- }
- for(var i = 0; i < e.targetTouches.length; ++i) {
- var touch = e.targetTouches[i];
- touches[touch.identifier].onTarget = true;
- }
-
- var ptr = JSEvents.touchEvent;
- HEAP32[(((ptr)+(4))>>2)]=e.ctrlKey;
- HEAP32[(((ptr)+(8))>>2)]=e.shiftKey;
- HEAP32[(((ptr)+(12))>>2)]=e.altKey;
- HEAP32[(((ptr)+(16))>>2)]=e.metaKey;
- ptr += 20; // Advance to the start of the touch array.
- var canvasRect = Module['canvas'] ? Module['canvas'].getBoundingClientRect() : undefined;
- var targetRect = JSEvents.getBoundingClientRectOrZeros(target);
- var numTouches = 0;
- for(var i in touches) {
- var t = touches[i];
- HEAP32[((ptr)>>2)]=t.identifier;
- HEAP32[(((ptr)+(4))>>2)]=t.screenX;
- HEAP32[(((ptr)+(8))>>2)]=t.screenY;
- HEAP32[(((ptr)+(12))>>2)]=t.clientX;
- HEAP32[(((ptr)+(16))>>2)]=t.clientY;
- HEAP32[(((ptr)+(20))>>2)]=t.pageX;
- HEAP32[(((ptr)+(24))>>2)]=t.pageY;
- HEAP32[(((ptr)+(28))>>2)]=t.changed;
- HEAP32[(((ptr)+(32))>>2)]=t.onTarget;
- if (canvasRect) {
- HEAP32[(((ptr)+(44))>>2)]=t.clientX - canvasRect.left;
- HEAP32[(((ptr)+(48))>>2)]=t.clientY - canvasRect.top;
- } else {
- HEAP32[(((ptr)+(44))>>2)]=0;
- HEAP32[(((ptr)+(48))>>2)]=0;
- }
- HEAP32[(((ptr)+(36))>>2)]=t.clientX - targetRect.left;
- HEAP32[(((ptr)+(40))>>2)]=t.clientY - targetRect.top;
-
- ptr += 52;
-
- if (++numTouches >= 32) {
- break;
- }
- }
- HEAP32[((JSEvents.touchEvent)>>2)]=numTouches;
-
- var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.touchEvent, userData);
- if (shouldCancel) {
- e.preventDefault();
- }
- };
-
- var eventHandler = {
- target: target,
- allowsDeferredCalls: false, // XXX Currently disabled, see bug https://bugzilla.mozilla.org/show_bug.cgi?id=966493
- // Once the above bug is resolved, enable the following condition if possible:
- // allowsDeferredCalls: eventTypeString == 'touchstart',
- eventTypeString: eventTypeString,
- callbackfunc: callbackfunc,
- handlerFunc: handlerFunc,
- useCapture: useCapture
- };
- JSEvents.registerOrRemoveHandler(eventHandler);
- },fillGamepadEventData:function (eventStruct, e) {
- HEAPF64[((eventStruct)>>3)]=e.timestamp;
- for(var i = 0; i < e.axes.length; ++i) {
- HEAPF64[(((eventStruct+i*8)+(16))>>3)]=e.axes[i];
- }
- for(var i = 0; i < e.buttons.length; ++i) {
- if (typeof(e.buttons[i]) === 'object') {
- HEAPF64[(((eventStruct+i*8)+(528))>>3)]=e.buttons[i].value;
- } else {
- HEAPF64[(((eventStruct+i*8)+(528))>>3)]=e.buttons[i];
- }
- }
- for(var i = 0; i < e.buttons.length; ++i) {
- if (typeof(e.buttons[i]) === 'object') {
- HEAP32[(((eventStruct+i*4)+(1040))>>2)]=e.buttons[i].pressed;
- } else {
- HEAP32[(((eventStruct+i*4)+(1040))>>2)]=e.buttons[i] == 1.0;
- }
- }
- HEAP32[(((eventStruct)+(1296))>>2)]=e.connected;
- HEAP32[(((eventStruct)+(1300))>>2)]=e.index;
- HEAP32[(((eventStruct)+(8))>>2)]=e.axes.length;
- HEAP32[(((eventStruct)+(12))>>2)]=e.buttons.length;
- stringToUTF8(e.id, eventStruct + 1304, 64);
- stringToUTF8(e.mapping, eventStruct + 1368, 64);
- },registerGamepadEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
- if (!JSEvents.gamepadEvent) {
- JSEvents.gamepadEvent = _malloc( 1432 );
- }
-
- var handlerFunc = function(event) {
- var e = event || window.event;
-
- JSEvents.fillGamepadEventData(JSEvents.gamepadEvent, e.gamepad);
-
- var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.gamepadEvent, userData);
- if (shouldCancel) {
- e.preventDefault();
- }
- };
-
- var eventHandler = {
- target: JSEvents.findEventTarget(target),
- allowsDeferredCalls: true,
- eventTypeString: eventTypeString,
- callbackfunc: callbackfunc,
- handlerFunc: handlerFunc,
- useCapture: useCapture
- };
- JSEvents.registerOrRemoveHandler(eventHandler);
- },registerBeforeUnloadEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
- var handlerFunc = function(event) {
- var e = event || window.event;
-
- var confirmationMessage = Module['dynCall_iiii'](callbackfunc, eventTypeId, 0, userData);
-
- if (confirmationMessage) {
- confirmationMessage = Pointer_stringify(confirmationMessage);
- }
- if (confirmationMessage) {
- e.preventDefault();
- e.returnValue = confirmationMessage;
- return confirmationMessage;
- }
- };
-
- var eventHandler = {
- target: JSEvents.findEventTarget(target),
- allowsDeferredCalls: false,
- eventTypeString: eventTypeString,
- callbackfunc: callbackfunc,
- handlerFunc: handlerFunc,
- useCapture: useCapture
- };
- JSEvents.registerOrRemoveHandler(eventHandler);
- },battery:function () { return navigator.battery || navigator.mozBattery || navigator.webkitBattery; },fillBatteryEventData:function (eventStruct, e) {
- HEAPF64[((eventStruct)>>3)]=e.chargingTime;
- HEAPF64[(((eventStruct)+(8))>>3)]=e.dischargingTime;
- HEAPF64[(((eventStruct)+(16))>>3)]=e.level;
- HEAP32[(((eventStruct)+(24))>>2)]=e.charging;
- },registerBatteryEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
- if (!JSEvents.batteryEvent) {
- JSEvents.batteryEvent = _malloc( 32 );
- }
-
- var handlerFunc = function(event) {
- var e = event || window.event;
-
- JSEvents.fillBatteryEventData(JSEvents.batteryEvent, JSEvents.battery());
-
- var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, JSEvents.batteryEvent, userData);
- if (shouldCancel) {
- e.preventDefault();
- }
- };
-
- var eventHandler = {
- target: JSEvents.findEventTarget(target),
- allowsDeferredCalls: false,
- eventTypeString: eventTypeString,
- callbackfunc: callbackfunc,
- handlerFunc: handlerFunc,
- useCapture: useCapture
- };
- JSEvents.registerOrRemoveHandler(eventHandler);
- },registerWebGlEventCallback:function (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
- if (!target) {
- target = Module['canvas'];
- }
- var handlerFunc = function(event) {
- var e = event || window.event;
-
- var shouldCancel = Module['dynCall_iiii'](callbackfunc, eventTypeId, 0, userData);
- if (shouldCancel) {
- e.preventDefault();
- }
- };
-
- var eventHandler = {
- target: JSEvents.findEventTarget(target),
- allowsDeferredCalls: false,
- eventTypeString: eventTypeString,
- callbackfunc: callbackfunc,
- handlerFunc: handlerFunc,
- useCapture: useCapture
- };
- JSEvents.registerOrRemoveHandler(eventHandler);
- }};function __emscripten_sample_gamepad_data() {
- // Polling gamepads generates garbage, so don't do it when we know there are no gamepads connected.
- if (!JSEvents.numGamepadsConnected) return;
-
- // 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.
- if (Browser.mainLoop.currentFrameNumber !== JSEvents.lastGamepadStateFrame || !Browser.mainLoop.currentFrameNumber) {
- JSEvents.lastGamepadState = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads : null);
- JSEvents.lastGamepadStateFrame = Browser.mainLoop.currentFrameNumber;
- }
- }function _emscripten_get_gamepad_status(index, gamepadState) {
- __emscripten_sample_gamepad_data();
- if (!JSEvents.lastGamepadState) return -1;
-
- // INVALID_PARAM is returned on a Gamepad index that never was there.
- if (index < 0 || index >= JSEvents.lastGamepadState.length) return -5;
-
- // NO_DATA is returned on a Gamepad index that was removed.
- // For previously disconnected gamepads there should be an empty slot (null/undefined/false) at the index.
- // This is because gamepads must keep their original position in the array.
- // For example, removing the first of two gamepads produces [null/undefined/false, gamepad].
- if (!JSEvents.lastGamepadState[index]) return -7;
-
- JSEvents.fillGamepadEventData(gamepadState, JSEvents.lastGamepadState[index]);
- return 0;
- }
- function _utime(path, times) {
- if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_2(12, path, times);
- // int utime(const char *path, const struct utimbuf *times);
- // http://pubs.opengroup.org/onlinepubs/009695399/basedefs/utime.h.html
- var time;
- if (times) {
- // NOTE: We don't keep track of access timestamps.
- var offset = 4;
- time = HEAP32[(((times)+(offset))>>2)];
- time *= 1000;
- } else {
- time = Date.now();
- }
- path = Pointer_stringify(path);
- try {
- FS.utime(path, time, time);
- return 0;
- } catch (e) {
- FS.handleFSError(e);
- return -1;
- }
- }
- function _emscripten_glCopyTexImage2D(x0, x1, x2, x3, x4, x5, x6, x7) { GLctx['copyTexImage2D'](x0, x1, x2, x3, x4, x5, x6, x7) }
- function _emscripten_glTexParameterfv(target, pname, params) {
- var param = HEAPF32[((params)>>2)];
- GLctx.texParameterf(target, pname, param);
- }
-
-
-
- var PROCINFO={ppid:1,pid:42,sid:42,pgid:42};
-
-
- var __pthread_ptr=0;
-
- var __pthread_is_main_browser_thread=0;function __register_pthread_ptr(pthreadPtr, isMainBrowserThread, isMainRuntimeThread) {
- pthreadPtr = pthreadPtr|0;
- isMainBrowserThread = isMainBrowserThread|0;
- isMainRuntimeThread = isMainRuntimeThread|0;
- __pthread_ptr = pthreadPtr;
- __pthread_is_main_browser_thread = isMainBrowserThread;
- __pthread_is_main_runtime_thread = isMainRuntimeThread;
- }
-
- var _emscripten_main_thread_process_queued_calls=undefined;var PThread={MAIN_THREAD_ID:1,mainThreadInfo:{schedPolicy:0,schedPrio:0},unusedWorkerPool:[],runningWorkers:[],initMainThreadBlock:function () {
- if (ENVIRONMENT_IS_PTHREAD) return undefined;
- PThread.mainThreadBlock = allocate(244, "i32*", ALLOC_STATIC);
- __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.
-
- for (var i = 0; i < 244/4; ++i) HEAPU32[PThread.mainThreadBlock/4+i] = 0;
-
- // The pthread struct has a field that points to itself - this is used as a magic ID to detect whether the pthread_t
- // structure is 'alive'.
- HEAP32[(((PThread.mainThreadBlock)+(24))>>2)]=PThread.mainThreadBlock;
-
- // Allocate memory for thread-local storage.
- var tlsMemory = allocate(128 * 4, "i32*", ALLOC_STATIC);
- for (var i = 0; i < 128; ++i) HEAPU32[tlsMemory/4+i] = 0;
- Atomics.store(HEAPU32, (PThread.mainThreadBlock + 116 ) >> 2, tlsMemory); // Init thread-local-storage memory array.
- Atomics.store(HEAPU32, (PThread.mainThreadBlock + 52 ) >> 2, PThread.mainThreadBlock); // Main thread ID.
- Atomics.store(HEAPU32, (PThread.mainThreadBlock + 56 ) >> 2, PROCINFO.pid); // Process ID.
-
- },pthreads:{},pthreadIdCounter:2,exitHandlers:null,setThreadStatus:function () {},runExitHandlers:function () {
- if (PThread.exitHandlers !== null) {
- while (PThread.exitHandlers.length > 0) {
- PThread.exitHandlers.pop()();
- }
- PThread.exitHandlers = null;
- }
-
- // Call into the musl function that runs destructors of all thread-specific data.
- if (ENVIRONMENT_IS_PTHREAD && threadInfoStruct) ___pthread_tsd_run_dtors();
- },threadExit:function (exitCode) {
- var tb = _pthread_self();
- if (tb) { // If we haven't yet exited?
- Atomics.store(HEAPU32, (tb + 4 ) >> 2, exitCode);
- // When we publish this, the main thread is free to deallocate the thread object and we are done.
- // Therefore set threadInfoStruct = 0; above to 'release' the object in this worker thread.
- Atomics.store(HEAPU32, (tb + 0 ) >> 2, 1);
-
- // Disable all cancellation so that executing the cleanup handlers won't trigger another JS
- // canceled exception to be thrown.
- Atomics.store(HEAPU32, (tb + 72 ) >> 2, 1/*PTHREAD_CANCEL_DISABLE*/);
- Atomics.store(HEAPU32, (tb + 76 ) >> 2, 0/*PTHREAD_CANCEL_DEFERRED*/);
- PThread.runExitHandlers();
-
- _emscripten_futex_wake(tb + 0, 2147483647);
- __register_pthread_ptr(0, 0, 0); // Unregister the thread block also inside the asm.js scope.
- threadInfoStruct = 0;
- if (ENVIRONMENT_IS_PTHREAD) {
- // This worker no longer owns any WebGL OffscreenCanvases, so transfer them back to parent thread.
- var transferList = [];
-
-
- postMessage({ cmd: 'exit' });
- }
- }
- },threadCancel:function () {
- PThread.runExitHandlers();
- Atomics.store(HEAPU32, (threadInfoStruct + 4 ) >> 2, -1/*PTHREAD_CANCELED*/);
- Atomics.store(HEAPU32, (threadInfoStruct + 0 ) >> 2, 1); // Mark the thread as no longer running.
- _emscripten_futex_wake(threadInfoStruct + 0, 2147483647); // wake all threads
- threadInfoStruct = selfThreadId = 0; // Not hosting a pthread anymore in this worker, reset the info structures to null.
- __register_pthread_ptr(0, 0, 0); // Unregister the thread block also inside the asm.js scope.
- postMessage({ cmd: 'cancelDone' });
- },terminateAllThreads:function () {
- for (var t in PThread.pthreads) {
- var pthread = PThread.pthreads[t];
- if (pthread) {
- PThread.freeThreadData(pthread);
- if (pthread.worker) pthread.worker.terminate();
- }
- }
- PThread.pthreads = {};
- for (var t in PThread.unusedWorkerPool) {
- var pthread = PThread.unusedWorkerPool[t];
- if (pthread) {
- PThread.freeThreadData(pthread);
- if (pthread.worker) pthread.worker.terminate();
- }
- }
- PThread.unusedWorkerPool = [];
- for (var t in PThread.runningWorkers) {
- var pthread = PThread.runningWorkers[t];
- if (pthread) {
- PThread.freeThreadData(pthread);
- if (pthread.worker) pthread.worker.terminate();
- }
- }
- PThread.runningWorkers = [];
- },freeThreadData:function (pthread) {
- if (!pthread) return;
- if (pthread.threadInfoStruct) {
- var tlsMemory = HEAP32[(((pthread.threadInfoStruct)+(116))>>2)];
- HEAP32[(((pthread.threadInfoStruct)+(116))>>2)]=0;
- _free(pthread.tlsMemory);
- _free(pthread.threadInfoStruct);
- }
- pthread.threadInfoStruct = 0;
- if (pthread.allocatedOwnStack && pthread.stackBase) _free(pthread.stackBase);
- pthread.stackBase = 0;
- if (pthread.worker) pthread.worker.pthread = null;
- },receiveObjectTransfer:function (data) {
- },allocateUnusedWorkers:function (numWorkers, onFinishedLoading) {
- if (typeof SharedArrayBuffer === 'undefined') return; // No multithreading support, no-op.
- Module['print']('Preallocating ' + numWorkers + ' workers for a pthread spawn pool.');
-
- var numWorkersLoaded = 0;
- for (var i = 0; i < numWorkers; ++i) {
- var pthreadMainJs = 'pthread-main.js';
- // Allow HTML module to configure the location where the 'pthread-main.js' file will be loaded from,
- // either via Module.locateFile() function, or via Module.pthreadMainPrefixURL string. If neither
- // of these are passed, then the default URL 'pthread-main.js' relative to the main html file is loaded.
- if (typeof Module['locateFile'] === 'function') pthreadMainJs = Module['locateFile'](pthreadMainJs);
- else if (Module['pthreadMainPrefixURL']) pthreadMainJs = Module['pthreadMainPrefixURL'] + pthreadMainJs;
- var worker = new Worker(pthreadMainJs);
-
- worker.onmessage = function(e) {
- // If this message is intended to a recipient that is not the main thread, forward it to the target thread.
- if (e.data.targetThread && e.data.targetThread != _pthread_self()) {
- var thread = PThread.pthreads[e.data.targetThread];
- if (thread) {
- thread.worker.postMessage(e.data, e.data.transferList);
- } else {
- console.error('Internal error! Worker sent a message "' + e.data.cmd + '" to target pthread ' + e.data.targetThread + ', but that thread no longer exists!');
- }
- return;
- }
-
- if (e.data.cmd === 'processQueuedMainThreadWork') {
- // TODO: Must post message to main Emscripten thread in PROXY_TO_WORKER mode.
- _emscripten_main_thread_process_queued_calls();
- } else if (e.data.cmd === 'spawnThread') {
- __spawn_thread(e.data);
- } else if (e.data.cmd === 'cleanupThread') {
- __cleanup_thread(e.data.thread);
- } else if (e.data.cmd === 'killThread') {
- __kill_thread(e.data.thread);
- } else if (e.data.cmd === 'cancelThread') {
- __cancel_thread(e.data.thread);
- } else if (e.data.cmd === 'loaded') {
- ++numWorkersLoaded;
- if (numWorkersLoaded === numWorkers && onFinishedLoading) {
- onFinishedLoading();
- }
- } else if (e.data.cmd === 'print') {
- Module['print']('Thread ' + e.data.threadId + ': ' + e.data.text);
- } else if (e.data.cmd === 'printErr') {
- Module['printErr']('Thread ' + e.data.threadId + ': ' + e.data.text);
- } else if (e.data.cmd === 'alert') {
- alert('Thread ' + e.data.threadId + ': ' + e.data.text);
- } else if (e.data.cmd === 'exit') {
- // currently no-op
- } else if (e.data.cmd === 'cancelDone') {
- PThread.freeThreadData(worker.pthread);
- worker.pthread = undefined; // Detach the worker from the pthread object, and return it to the worker pool as an unused worker.
- PThread.unusedWorkerPool.push(worker);
- // TODO: Free if detached.
- PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker.pthread), 1); // Not a running Worker anymore.
- } else if (e.data.cmd === 'objectTransfer') {
- PThread.receiveObjectTransfer(e.data);
- } else {
- Module['printErr']("worker sent an unknown command " + e.data.cmd);
- }
- };
-
- worker.onerror = function(e) {
- Module['printErr']('pthread sent an error! ' + e.filename + ':' + e.lineno + ': ' + e.message);
- };
-
- // Allocate tempDoublePtr for the worker. This is done here on the worker's behalf, since we may need to do this statically
- // if the runtime has not been loaded yet, etc. - so we just use getMemory, which is main-thread only.
- var tempDoublePtr = getMemory(8); // TODO: leaks. Cleanup after worker terminates.
-
- // Ask the new worker to load up the Emscripten-compiled page. This is a heavy operation.
- worker.postMessage({
- cmd: 'load',
- url: currentScriptUrl,
- buffer: HEAPU8.buffer,
- tempDoublePtr: tempDoublePtr,
- TOTAL_MEMORY: TOTAL_MEMORY,
- STATICTOP: STATICTOP,
- DYNAMIC_BASE: DYNAMIC_BASE,
- DYNAMICTOP_PTR: DYNAMICTOP_PTR,
- PthreadWorkerInit: PthreadWorkerInit
- });
- PThread.unusedWorkerPool.push(worker);
- }
- },getNewWorker:function () {
- if (PThread.unusedWorkerPool.length == 0) PThread.allocateUnusedWorkers(1);
- if (PThread.unusedWorkerPool.length > 0) return PThread.unusedWorkerPool.pop();
- else return null;
- },busySpinWait:function (msecs) {
- var t = performance.now() + msecs;
- while(performance.now() < t) {
- ;
- }
- }};var __pthread_is_main_runtime_thread=0;function _emscripten_is_main_runtime_thread() {
- return __pthread_is_main_runtime_thread|0; // Semantically the same as testing "!ENVIRONMENT_IS_PTHREAD" outside the asm.js scope
- }
- function _emscripten_glLinkProgram(program) {
- GLctx.linkProgram(GL.programs[program]);
- GL.programInfos[program] = null; // uniforms no longer keep the same names after linking
- GL.populateUniformTable(program);
- }
- function _emscripten_glUniform3f(location, v0, v1, v2) {
- GLctx.uniform3f(GL.uniforms[location], v0, v1, v2);
- }
- function _emscripten_glGetObjectParameterivARB() {
- Module['printErr']('missing function: emscripten_glGetObjectParameterivARB'); abort(-1);
- }
- function _emscripten_glBlendFunc(x0, x1) { GLctx['blendFunc'](x0, x1) }
- function _emscripten_glUniform3i(location, v0, v1, v2) {
- GLctx.uniform3i(GL.uniforms[location], v0, v1, v2);
- }
- function _emscripten_glStencilOp(x0, x1, x2) { GLctx['stencilOp'](x0, x1, x2) }
- function _glCreateShader(shaderType) {
- var id = GL.getNewId(GL.shaders);
- GL.shaders[id] = GLctx.createShader(shaderType);
- return id;
- }
- function _glUniform1i(location, v0) {
- GLctx.uniform1i(GL.uniforms[location], v0);
- }
- function _emscripten_glBindAttribLocation(program, index, name) {
- name = Pointer_stringify(name);
- GLctx.bindAttribLocation(GL.programs[program], index, name);
- }
- function _glCompressedTexImage2D(target, level, internalFormat, width, height, border, imageSize, data) {
- GLctx['compressedTexImage2D'](target, level, internalFormat, width, height, border, data ? HEAPU8.subarray((data),(data+imageSize)) : null);
- }
- function _glDisable(x0) { GLctx['disable'](x0) }
- function _emscripten_glEnableVertexAttribArray(index) {
- GLctx.enableVertexAttribArray(index);
- }
-
- Module["_memset"] = _memset;
- function _atexit(func, arg) {
- if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_2(110, func, arg);
- __ATEXIT__.unshift({ func: func, arg: arg });
- }
- function _glfwMakeContextCurrent(winid) {}
- function _emscripten_set_touchcancel_callback(target, userData, useCapture, callbackfunc) {
- JSEvents.registerTouchEventCallback(target, userData, useCapture, callbackfunc, 25, "touchcancel");
- return 0;
- }
- function ___lock() {}
- function _emscripten_glBlendFuncSeparate(x0, x1, x2, x3) { GLctx['blendFuncSeparate'](x0, x1, x2, x3) }
- function _glCullFace(x0) { GLctx['cullFace'](x0) }
- function _emscripten_glGetVertexAttribPointerv(index, pname, pointer) {
- if (!pointer) {
- // GLES2 specification does not specify how to behave if pointer is a null pointer. Since calling this function does not make sense
- // if pointer == null, issue a GL error to notify user about it.
- GL.recordError(0x0501 /* GL_INVALID_VALUE */);
- return;
- }
- HEAP32[((pointer)>>2)]=GLctx.getVertexAttribOffset(index, pname);
- }
- function _emscripten_glVertexAttrib3f(x0, x1, x2, x3) { GLctx['vertexAttrib3f'](x0, x1, x2, x3) }
- function _emscripten_glEnable(x0) { GLctx['enable'](x0) }
- function _emscripten_glNormalPointer() {
- Module['printErr']('missing function: emscripten_glNormalPointer'); abort(-1);
- }
-
- var _emscripten_GetProcAddress=undefined;
- Module["_emscripten_GetProcAddress"] = _emscripten_GetProcAddress;
-
- var EGL={errorCode:12288,defaultDisplayInitialized:false,currentContext:0,currentReadSurface:0,currentDrawSurface:0,stringCache:{},setErrorCode:function (code) {
- EGL.errorCode = code;
- },chooseConfig:function (display, attribList, config, config_size, numConfigs) {
- if (display != 62000 /* Magic ID for Emscripten 'default display' */) {
- EGL.setErrorCode(0x3008 /* EGL_BAD_DISPLAY */);
- return 0;
- }
- // TODO: read attribList.
- if ((!config || !config_size) && !numConfigs) {
- EGL.setErrorCode(0x300C /* EGL_BAD_PARAMETER */);
- return 0;
- }
- if (numConfigs) {
- HEAP32[((numConfigs)>>2)]=1; // Total number of supported configs: 1.
- }
- if (config && config_size > 0) {
- HEAP32[((config)>>2)]=62002;
- }
-
- EGL.setErrorCode(0x3000 /* EGL_SUCCESS */);
- return 1;
- }};function _eglGetProcAddress(name_) {
- return _emscripten_GetProcAddress(name_);
- }
- function _glfwSetScrollCallback(winid, cbfun) {
- GLFW.setScrollCallback(winid, cbfun);
- }
- function _emscripten_get_pointerlock_status(pointerlockStatus) {
- if (pointerlockStatus) JSEvents.fillPointerlockChangeEventData(pointerlockStatus);
- if (!document.body || (!document.body.requestPointerLock && !document.body.mozRequestPointerLock && !document.body.webkitRequestPointerLock && !document.body.msRequestPointerLock)) {
- return -1;
- }
- return 0;
- }
- function _glAttachShader(program, shader) {
- GLctx.attachShader(GL.programs[program],
- GL.shaders[shader]);
- }
- function _glfwGetPrimaryMonitor() {
- return 1;
- }
-
- function emscriptenWebGLGetVertexAttrib(index, pname, params, type) {
- if (!params) {
- // GLES2 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense
- // if params == null, issue a GL error to notify user about it.
- GL.recordError(0x0501 /* GL_INVALID_VALUE */);
- return;
- }
- var data = GLctx.getVertexAttrib(index, pname);
- if (pname == 0x889F/*VERTEX_ATTRIB_ARRAY_BUFFER_BINDING*/) {
- HEAP32[((params)>>2)]=data["name"];
- } else if (typeof data == 'number' || typeof data == 'boolean') {
- switch (type) {
- case 'Integer': HEAP32[((params)>>2)]=data; break;
- case 'Float': HEAPF32[((params)>>2)]=data; break;
- case 'FloatToInteger': HEAP32[((params)>>2)]=Math.fround(data); break;
- default: throw 'internal emscriptenWebGLGetVertexAttrib() error, bad type: ' + type;
- }
- } else {
- for (var i = 0; i < data.length; i++) {
- switch (type) {
- case 'Integer': HEAP32[(((params)+(i))>>2)]=data[i]; break;
- case 'Float': HEAPF32[(((params)+(i))>>2)]=data[i]; break;
- case 'FloatToInteger': HEAP32[(((params)+(i))>>2)]=Math.fround(data[i]); break;
- default: throw 'internal emscriptenWebGLGetVertexAttrib() error, bad type: ' + type;
- }
- }
- }
- }function _emscripten_glGetVertexAttribfv(index, pname, params) {
- // N.B. This function may only be called if the vertex attribute was specified using the function glVertexAttrib*f(),
- // otherwise the results are undefined. (GLES3 spec 6.1.12)
- emscriptenWebGLGetVertexAttrib(index, pname, params, 'Float');
- }
- function _emscripten_set_touchstart_callback(target, userData, useCapture, callbackfunc) {
- JSEvents.registerTouchEventCallback(target, userData, useCapture, callbackfunc, 22, "touchstart");
- return 0;
- }
- function _emscripten_glDeleteShader(id) {
- if (!id) return;
- var shader = GL.shaders[id];
- if (!shader) { // glDeleteShader actually signals an error when deleting a nonexisting object, unlike some other GL delete functions.
- GL.recordError(0x0501 /* GL_INVALID_VALUE */);
- return;
- }
- GLctx.deleteShader(shader);
- GL.shaders[id] = null;
- }
- 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.'; }
- function _emscripten_glDeleteBuffers(n, buffers) {
- for (var i = 0; i < n; i++) {
- var id = HEAP32[(((buffers)+(i*4))>>2)];
- var buffer = GL.buffers[id];
-
- // From spec: "glDeleteBuffers silently ignores 0's and names that do not
- // correspond to existing buffer objects."
- if (!buffer) continue;
-
- GLctx.deleteBuffer(buffer);
- buffer.name = 0;
- GL.buffers[id] = null;
-
- if (id == GL.currArrayBuffer) GL.currArrayBuffer = 0;
- if (id == GL.currElementArrayBuffer) GL.currElementArrayBuffer = 0;
- }
- }
- function _emscripten_glTexParameteriv(target, pname, params) {
- var param = HEAP32[((params)>>2)];
- GLctx.texParameteri(target, pname, param);
- }
- function _glDrawElements(mode, count, type, indices) {
-
- GLctx.drawElements(mode, count, type, indices);
-
- }
- function _glfwTerminate() {
- window.removeEventListener("keydown", GLFW.onKeydown, true);
- window.removeEventListener("keypress", GLFW.onKeyPress, true);
- window.removeEventListener("keyup", GLFW.onKeyup, true);
- Module["canvas"].removeEventListener("mousemove", GLFW.onMousemove, true);
- Module["canvas"].removeEventListener("mousedown", GLFW.onMouseButtonDown, true);
- Module["canvas"].removeEventListener("mouseup", GLFW.onMouseButtonUp, true);
- Module["canvas"].removeEventListener('wheel', GLFW.onMouseWheel, true);
- Module["canvas"].removeEventListener('mousewheel', GLFW.onMouseWheel, true);
- Module["canvas"].removeEventListener('mouseenter', GLFW.onMouseenter, true);
- Module["canvas"].removeEventListener('mouseleave', GLFW.onMouseleave, true);
- Module["canvas"].width = Module["canvas"].height = 1;
- GLFW.windows = null;
- GLFW.active = null;
- }
- function _emscripten_glUniformMatrix2fv(location, count, transpose, value) {
-
-
- var view;
- if (4*count <= GL.MINI_TEMP_BUFFER_SIZE) {
- // avoid allocation when uploading few enough uniforms
- view = GL.miniTempBufferViews[4*count-1];
- for (var i = 0; i < 4*count; i += 4) {
- view[i] = HEAPF32[(((value)+(4*i))>>2)];
- view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)];
- view[i+2] = HEAPF32[(((value)+(4*i+8))>>2)];
- view[i+3] = HEAPF32[(((value)+(4*i+12))>>2)];
- }
- } else {
- view = HEAPF32.subarray((value)>>2,(value+count*16)>>2);
- }
- GLctx.uniformMatrix2fv(GL.uniforms[location], !!transpose, view);
- }
- function ___syscall6(which, varargs) {if (ENVIRONMENT_IS_PTHREAD) { return _emscripten_sync_run_in_main_thread_2(138, 6, varargs) }
- SYSCALLS.varargs = varargs;
- try {
- // close
- var stream = SYSCALLS.getStreamFromFD();
- FS.close(stream);
- return 0;
- } catch (e) {
- if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) abort(e);
- return -e.errno;
- }
- }
- function _llvm_stacksave() {
- var self = _llvm_stacksave;
- if (!self.LLVM_SAVEDSTACKS) {
- self.LLVM_SAVEDSTACKS = [];
- }
- self.LLVM_SAVEDSTACKS.push(Runtime.stackSave());
- return self.LLVM_SAVEDSTACKS.length-1;
- }
- function _emscripten_glGetVertexAttribiv(index, pname, params) {
- // N.B. This function may only be called if the vertex attribute was specified using the function glVertexAttrib*f(),
- // otherwise the results are undefined. (GLES3 spec 6.1.12)
- emscriptenWebGLGetVertexAttrib(index, pname, params, 'FloatToInteger');
- }
- function _emscripten_glUniformMatrix4fv(location, count, transpose, value) {
-
-
- var view;
- if (16*count <= GL.MINI_TEMP_BUFFER_SIZE) {
- // avoid allocation when uploading few enough uniforms
- view = GL.miniTempBufferViews[16*count-1];
- for (var i = 0; i < 16*count; i += 16) {
- view[i] = HEAPF32[(((value)+(4*i))>>2)];
- view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)];
- view[i+2] = HEAPF32[(((value)+(4*i+8))>>2)];
- view[i+3] = HEAPF32[(((value)+(4*i+12))>>2)];
- view[i+4] = HEAPF32[(((value)+(4*i+16))>>2)];
- view[i+5] = HEAPF32[(((value)+(4*i+20))>>2)];
- view[i+6] = HEAPF32[(((value)+(4*i+24))>>2)];
- view[i+7] = HEAPF32[(((value)+(4*i+28))>>2)];
- view[i+8] = HEAPF32[(((value)+(4*i+32))>>2)];
- view[i+9] = HEAPF32[(((value)+(4*i+36))>>2)];
- view[i+10] = HEAPF32[(((value)+(4*i+40))>>2)];
- view[i+11] = HEAPF32[(((value)+(4*i+44))>>2)];
- view[i+12] = HEAPF32[(((value)+(4*i+48))>>2)];
- view[i+13] = HEAPF32[(((value)+(4*i+52))>>2)];
- view[i+14] = HEAPF32[(((value)+(4*i+56))>>2)];
- view[i+15] = HEAPF32[(((value)+(4*i+60))>>2)];
- }
- } else {
- view = HEAPF32.subarray((value)>>2,(value+count*64)>>2);
- }
- GLctx.uniformMatrix4fv(GL.uniforms[location], !!transpose, view);
- }
- function _emscripten_glDrawArraysInstanced(mode, first, count, primcount) {
- GLctx['drawArraysInstanced'](mode, first, count, primcount);
- }
- function _emscripten_glEnableClientState() {
- Module['printErr']('missing function: emscripten_glEnableClientState'); abort(-1);
- }
- function _emscripten_glGetPointerv() {
- Module['printErr']('missing function: emscripten_glGetPointerv'); abort(-1);
- }
- function ___syscall140(which, varargs) {if (ENVIRONMENT_IS_PTHREAD) { return _emscripten_sync_run_in_main_thread_2(138, 140, varargs) }
- SYSCALLS.varargs = varargs;
- try {
- // llseek
- var stream = SYSCALLS.getStreamFromFD(), offset_high = SYSCALLS.get(), offset_low = SYSCALLS.get(), result = SYSCALLS.get(), whence = SYSCALLS.get();
- var offset = offset_low;
- assert(offset_high === 0);
- FS.llseek(stream, offset, whence);
- HEAP32[((result)>>2)]=stream.position;
- if (stream.getdents && offset === 0 && whence === 0) stream.getdents = null; // reset readdir state
- return 0;
- } catch (e) {
- if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) abort(e);
- return -e.errno;
- }
- }
- function ___syscall146(which, varargs) {if (ENVIRONMENT_IS_PTHREAD) { return _emscripten_sync_run_in_main_thread_2(138, 146, varargs) }
- SYSCALLS.varargs = varargs;
- try {
- // writev
- var stream = SYSCALLS.getStreamFromFD(), iov = SYSCALLS.get(), iovcnt = SYSCALLS.get();
- return SYSCALLS.doWritev(stream, iov, iovcnt);
- } catch (e) {
- if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) abort(e);
- return -e.errno;
- }
- }
- function _emscripten_glUniform1i(location, v0) {
- GLctx.uniform1i(GL.uniforms[location], v0);
- }
- function _emscripten_glStencilMask(x0) { GLctx['stencilMask'](x0) }
- function _emscripten_glStencilFuncSeparate(x0, x1, x2, x3) { GLctx['stencilFuncSeparate'](x0, x1, x2, x3) }
-
- var _tzname; if (ENVIRONMENT_IS_PTHREAD) _tzname = PthreadWorkerInit._tzname; else PthreadWorkerInit._tzname = _tzname = allocate(8, "i32*", ALLOC_STATIC);
-
- var _daylight; if (ENVIRONMENT_IS_PTHREAD) _daylight = PthreadWorkerInit._daylight; else PthreadWorkerInit._daylight = _daylight = allocate(1, "i32*", ALLOC_STATIC);
-
- var _timezone; if (ENVIRONMENT_IS_PTHREAD) _timezone = PthreadWorkerInit._timezone; else PthreadWorkerInit._timezone = _timezone = allocate(1, "i32*", ALLOC_STATIC);function _tzset() {
- if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_0(119);
- // TODO: Use (malleable) environment variables instead of system settings.
- if (_tzset.called) return;
- _tzset.called = true;
-
- HEAP32[((_timezone)>>2)]=-(new Date()).getTimezoneOffset() * 60;
-
- var winter = new Date(2000, 0, 1);
- var summer = new Date(2000, 6, 1);
- HEAP32[((_daylight)>>2)]=Number(winter.getTimezoneOffset() != summer.getTimezoneOffset());
-
- function extractZone(date) {
- var match = date.toTimeString().match(/\(([A-Za-z ]+)\)$/);
- return match ? match[1] : "GMT";
- };
- var winterName = extractZone(winter);
- var summerName = extractZone(summer);
- var winterNamePtr = allocate(intArrayFromString(winterName), 'i8', ALLOC_NORMAL);
- var summerNamePtr = allocate(intArrayFromString(summerName), 'i8', ALLOC_NORMAL);
- if (summer.getTimezoneOffset() < winter.getTimezoneOffset()) {
- // Northern hemisphere
- HEAP32[((_tzname)>>2)]=winterNamePtr;
- HEAP32[(((_tzname)+(4))>>2)]=summerNamePtr;
- } else {
- HEAP32[((_tzname)>>2)]=summerNamePtr;
- HEAP32[(((_tzname)+(4))>>2)]=winterNamePtr;
- }
- }
-
- Module["_i64Subtract"] = _i64Subtract;
-
- Module["_i64Add"] = _i64Add;
- function _emscripten_set_touchend_callback(target, userData, useCapture, callbackfunc) {
- JSEvents.registerTouchEventCallback(target, userData, useCapture, callbackfunc, 23, "touchend");
- return 0;
- }
- function _glUseProgram(program) {
- GLctx.useProgram(program ? GL.programs[program] : null);
- }
- function _emscripten_glDisableVertexAttribArray(index) {
- GLctx.disableVertexAttribArray(index);
- }
- function _emscripten_glVertexAttrib1f(x0, x1) { GLctx['vertexAttrib1f'](x0, x1) }
- function _emscripten_glFinish() { GLctx['finish']() }
- function _glDrawArrays(mode, first, count) {
-
- GLctx.drawArrays(mode, first, count);
-
- }
- function _emscripten_glDepthFunc(x0) { GLctx['depthFunc'](x0) }
- function _emscripten_get_num_gamepads() {
- // Polling gamepads generates garbage, so don't do it when we know there are no gamepads connected.
- if (!JSEvents.numGamepadsConnected) return 0;
-
- __emscripten_sample_gamepad_data();
- if (!JSEvents.lastGamepadState) return -1;
- return JSEvents.lastGamepadState.length;
- }
- function _sysconf(name) {
- if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_1(72, name);
- // long sysconf(int name);
- // http://pubs.opengroup.org/onlinepubs/009695399/functions/sysconf.html
- switch(name) {
- case 30: return PAGE_SIZE;
- case 85:
- var maxHeapSize = 2*1024*1024*1024 - 16777216;
- maxHeapSize = HEAPU8.length;
- return maxHeapSize / PAGE_SIZE;
- case 132:
- case 133:
- case 12:
- case 137:
- case 138:
- case 15:
- case 235:
- case 16:
- case 17:
- case 18:
- case 19:
- case 20:
- case 149:
- case 13:
- case 10:
- case 236:
- case 153:
- case 9:
- case 21:
- case 22:
- case 159:
- case 154:
- case 14:
- case 77:
- case 78:
- case 139:
- case 80:
- case 81:
- case 82:
- case 68:
- case 67:
- case 164:
- case 11:
- case 29:
- case 47:
- case 48:
- case 95:
- case 52:
- case 51:
- case 46:
- return 200809;
- case 79:
- return 0;
- case 27:
- case 246:
- case 127:
- case 128:
- case 23:
- case 24:
- case 160:
- case 161:
- case 181:
- case 182:
- case 242:
- case 183:
- case 184:
- case 243:
- case 244:
- case 245:
- case 165:
- case 178:
- case 179:
- case 49:
- case 50:
- case 168:
- case 169:
- case 175:
- case 170:
- case 171:
- case 172:
- case 97:
- case 76:
- case 32:
- case 173:
- case 35:
- return -1;
- case 176:
- case 177:
- case 7:
- case 155:
- case 8:
- case 157:
- case 125:
- case 126:
- case 92:
- case 93:
- case 129:
- case 130:
- case 131:
- case 94:
- case 91:
- return 1;
- case 74:
- case 60:
- case 69:
- case 70:
- case 4:
- return 1024;
- case 31:
- case 42:
- case 72:
- return 32;
- case 87:
- case 26:
- case 33:
- return 2147483647;
- case 34:
- case 1:
- return 47839;
- case 38:
- case 36:
- return 99;
- case 43:
- case 37:
- return 2048;
- case 0: return 2097152;
- case 3: return 65536;
- case 28: return 32768;
- case 44: return 32767;
- case 75: return 16384;
- case 39: return 1000;
- case 89: return 700;
- case 71: return 256;
- case 40: return 255;
- case 2: return 100;
- case 180: return 64;
- case 25: return 20;
- case 5: return 16;
- case 6: return 6;
- case 73: return 4;
- case 84: {
- if (typeof navigator === 'object') return navigator['hardwareConcurrency'] || 1;
- return 1;
- }
- }
- ___setErrNo(ERRNO_CODES.EINVAL);
- return -1;
- }
- function _emscripten_glUniform4iv(location, count, value) {
-
-
- GLctx.uniform4iv(GL.uniforms[location], HEAP32.subarray((value)>>2,(value+count*16)>>2));
- }
- function _glClear(x0) { GLctx['clear'](x0) }
- 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.'; }
- function _emscripten_glUniform3fv(location, count, value) {
-
-
- var view;
- if (3*count <= GL.MINI_TEMP_BUFFER_SIZE) {
- // avoid allocation when uploading few enough uniforms
- view = GL.miniTempBufferViews[3*count-1];
- for (var i = 0; i < 3*count; i += 3) {
- view[i] = HEAPF32[(((value)+(4*i))>>2)];
- view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)];
- view[i+2] = HEAPF32[(((value)+(4*i+8))>>2)];
- }
- } else {
- view = HEAPF32.subarray((value)>>2,(value+count*12)>>2);
- }
- GLctx.uniform3fv(GL.uniforms[location], view);
- }
- function _emscripten_glIsTexture(texture) {
- var texture = GL.textures[texture];
- if (!texture) return 0;
- return GLctx.isTexture(texture);
- }
- function _glEnableVertexAttribArray(index) {
- GLctx.enableVertexAttribArray(index);
- }
- function _emscripten_glAttachShader(program, shader) {
- GLctx.attachShader(GL.programs[program],
- GL.shaders[shader]);
- }
- function _glUniform4f(location, v0, v1, v2, v3) {
- GLctx.uniform4f(GL.uniforms[location], v0, v1, v2, v3);
- }
- function _emscripten_request_pointerlock(target, deferUntilInEventHandler) {
- if (!target) target = '#canvas';
- target = JSEvents.findEventTarget(target);
- if (!target) return -4;
- if (!target.requestPointerLock && !target.mozRequestPointerLock && !target.webkitRequestPointerLock && !target.msRequestPointerLock) {
- return -1;
- }
-
- var canPerformRequests = JSEvents.canPerformEventHandlerRequests();
-
- // Queue this function call if we're not currently in an event handler and the user saw it appropriate to do so.
- if (!canPerformRequests) {
- if (deferUntilInEventHandler) {
- JSEvents.deferCall(JSEvents.requestPointerLock, 2 /* priority below fullscreen */, [target]);
- return 1;
- } else {
- return -2;
- }
- }
-
- return JSEvents.requestPointerLock(target);
- }
- function _emscripten_glVertexAttrib2f(x0, x1, x2) { GLctx['vertexAttrib2f'](x0, x1, x2) }
- function _glfwCreateWindow(width, height, title, monitor, share) {
- return GLFW.createWindow(width, height, title, monitor, share);
- }
- function _glfwDefaultWindowHints() {
- GLFW.hints = GLFW.defaultHints;
- }
- function _gettimeofday(ptr) {
- var now = Date.now();
- HEAP32[((ptr)>>2)]=(now/1000)|0; // seconds
- HEAP32[(((ptr)+(4))>>2)]=((now % 1000)*1000)|0; // microseconds
- return 0;
- }
- function _emscripten_glClearStencil(x0) { GLctx['clearStencil'](x0) }
- function _emscripten_glDetachShader(program, shader) {
- GLctx.detachShader(GL.programs[program],
- GL.shaders[shader]);
- }
- function _emscripten_glDeleteVertexArrays(n, vaos) {
- for (var i = 0; i < n; i++) {
- var id = HEAP32[(((vaos)+(i*4))>>2)];
- GLctx['deleteVertexArray'](GL.vaos[id]);
- GL.vaos[id] = null;
- }
- }
- function _glfwInit() {
- if (GLFW.windows) return 1; // GL_TRUE
-
- GLFW.initialTime = GLFW.getTime();
- GLFW.hints = GLFW.defaultHints;
- GLFW.windows = new Array()
- GLFW.active = null;
-
- window.addEventListener("keydown", GLFW.onKeydown, true);
- window.addEventListener("keypress", GLFW.onKeyPress, true);
- window.addEventListener("keyup", GLFW.onKeyup, true);
- Module["canvas"].addEventListener("mousemove", GLFW.onMousemove, true);
- Module["canvas"].addEventListener("mousedown", GLFW.onMouseButtonDown, true);
- Module["canvas"].addEventListener("mouseup", GLFW.onMouseButtonUp, true);
- Module["canvas"].addEventListener('wheel', GLFW.onMouseWheel, true);
- Module["canvas"].addEventListener('mousewheel', GLFW.onMouseWheel, true);
- Module["canvas"].addEventListener('mouseenter', GLFW.onMouseenter, true);
- Module["canvas"].addEventListener('mouseleave', GLFW.onMouseleave, true);
-
- Browser.resizeListeners.push(function(width, height) {
- GLFW.onCanvasResize(width, height);
- });
- return 1; // GL_TRUE
- }
- function _emscripten_glGetTexParameteriv(target, pname, params) {
- if (!params) {
- // GLES2 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense
- // if p == null, issue a GL error to notify user about it.
- GL.recordError(0x0501 /* GL_INVALID_VALUE */);
- return;
- }
- HEAP32[((params)>>2)]=GLctx.getTexParameter(target, pname);
- }
- function _glfwSwapBuffers(winid) {
- GLFW.swapBuffers(winid);
- }
- function _emscripten_glGenerateMipmap(x0) { GLctx['generateMipmap'](x0) }
-
-
-
-
- var _environ; if (ENVIRONMENT_IS_PTHREAD) _environ = PthreadWorkerInit._environ; else PthreadWorkerInit._environ = _environ = allocate(1, "i32*", ALLOC_STATIC);var ___environ=_environ;function ___buildEnvironment(env) {
- // WARNING: Arbitrary limit!
- var MAX_ENV_VALUES = 64;
- var TOTAL_ENV_SIZE = 1024;
-
- // Statically allocate memory for the environment.
- var poolPtr;
- var envPtr;
- if (!___buildEnvironment.called) {
- ___buildEnvironment.called = true;
- // Set default values. Use string keys for Closure Compiler compatibility.
- ENV['USER'] = ENV['LOGNAME'] = 'web_user';
- ENV['PATH'] = '/';
- ENV['PWD'] = '/';
- ENV['HOME'] = '/home/web_user';
- ENV['LANG'] = 'C';
- ENV['_'] = Module['thisProgram'];
- // Allocate memory.
- poolPtr = allocate(TOTAL_ENV_SIZE, 'i8', ALLOC_STATIC);
- envPtr = allocate(MAX_ENV_VALUES * 4,
- 'i8*', ALLOC_STATIC);
- HEAP32[((envPtr)>>2)]=poolPtr;
- HEAP32[((_environ)>>2)]=envPtr;
- } else {
- envPtr = HEAP32[((_environ)>>2)];
- poolPtr = HEAP32[((envPtr)>>2)];
- }
-
- // Collect key=value lines.
- var strings = [];
- var totalSize = 0;
- for (var key in env) {
- if (typeof env[key] === 'string') {
- var line = key + '=' + env[key];
- strings.push(line);
- totalSize += line.length;
- }
- }
- if (totalSize > TOTAL_ENV_SIZE) {
- throw new Error('Environment size exceeded TOTAL_ENV_SIZE!');
- }
-
- // Make new.
- var ptrSize = 4;
- for (var i = 0; i < strings.length; i++) {
- var line = strings[i];
- writeAsciiToMemory(line, poolPtr);
- HEAP32[(((envPtr)+(i * ptrSize))>>2)]=poolPtr;
- poolPtr += line.length + 1;
- }
- HEAP32[(((envPtr)+(strings.length * ptrSize))>>2)]=0;
- }var ENV={};function _clearenv(name) {
- if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_1(112, name);
- // int clearenv (void);
- // http://www.gnu.org/s/hello/manual/libc/Environment-Access.html#index-clearenv-3107
- ENV = {};
- ___buildEnvironment(ENV);
- return 0;
- }
- function _emscripten_glCullFace(x0) { GLctx['cullFace'](x0) }
- function _emscripten_glUniform4f(location, v0, v1, v2, v3) {
- GLctx.uniform4f(GL.uniforms[location], v0, v1, v2, v3);
- }
- function _glDisableVertexAttribArray(index) {
- GLctx.disableVertexAttribArray(index);
- }
- function _emscripten_glUseProgram(program) {
- GLctx.useProgram(program ? GL.programs[program] : null);
- }
- function _emscripten_glHint(x0, x1) { GLctx['hint'](x0, x1) }
- function _emscripten_glUniform2fv(location, count, value) {
-
-
- var view;
- if (2*count <= GL.MINI_TEMP_BUFFER_SIZE) {
- // avoid allocation when uploading few enough uniforms
- view = GL.miniTempBufferViews[2*count-1];
- for (var i = 0; i < 2*count; i += 2) {
- view[i] = HEAPF32[(((value)+(4*i))>>2)];
- view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)];
- }
- } else {
- view = HEAPF32.subarray((value)>>2,(value+count*8)>>2);
- }
- GLctx.uniform2fv(GL.uniforms[location], view);
- }
- function _glfwSwapInterval(interval) {
- 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.
- if (interval == 0) _emscripten_set_main_loop_timing(0/*EM_TIMING_SETTIMEOUT*/, 0);
- else _emscripten_set_main_loop_timing(1/*EM_TIMING_RAF*/, interval);
- }
- function _glGetShaderInfoLog(shader, maxLength, length, infoLog) {
- var log = GLctx.getShaderInfoLog(GL.shaders[shader]);
- if (log === null) log = '(unknown error)';
- if (maxLength > 0 && infoLog) {
- var numBytesWrittenExclNull = stringToUTF8(log, infoLog, maxLength);
- if (length) HEAP32[((length)>>2)]=numBytesWrittenExclNull;
- } else {
- if (length) HEAP32[((length)>>2)]=0;
- }
- }
- 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.'; }
- function _abort() {
- Module['abort']();
- }
- function _emscripten_glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer) {
- GLctx.framebufferRenderbuffer(target, attachment, renderbuffertarget,
- GL.renderbuffers[renderbuffer]);
- }
- function _emscripten_glDeleteFramebuffers(n, framebuffers) {
- for (var i = 0; i < n; ++i) {
- var id = HEAP32[(((framebuffers)+(i*4))>>2)];
- var framebuffer = GL.framebuffers[id];
- if (!framebuffer) continue; // GL spec: "glDeleteFramebuffers silently ignores 0s and names that do not correspond to existing framebuffer objects".
- GLctx.deleteFramebuffer(framebuffer);
- framebuffer.name = 0;
- GL.framebuffers[id] = null;
- }
- }
- function _emscripten_glIsBuffer(buffer) {
- var b = GL.buffers[buffer];
- if (!b) return 0;
- return GLctx.isBuffer(b);
- }
- function _emscripten_glUniform2iv(location, count, value) {
-
-
- GLctx.uniform2iv(GL.uniforms[location], HEAP32.subarray((value)>>2,(value+count*8)>>2));
- }
- var _emscripten_asm_const=true;
- function _chroot(path) {
- if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_1(37, path);
- // int chroot(const char *path);
- // http://pubs.opengroup.org/onlinepubs/7908799/xsh/chroot.html
- ___setErrNo(ERRNO_CODES.EACCES);
- return -1;
- }
- function _glEnable(x0) { GLctx['enable'](x0) }
-
-
- function emscriptenWebGLComputeImageSize(width, height, sizePerPixel, alignment) {
- function roundedToNextMultipleOf(x, y) {
- return Math.floor((x + y - 1) / y) * y
- }
- var plainRowSize = width * sizePerPixel;
- var alignedRowSize = roundedToNextMultipleOf(plainRowSize, alignment);
- return (height <= 0) ? 0 :
- ((height - 1) * alignedRowSize + plainRowSize);
- }function emscriptenWebGLGetTexPixelData(type, format, width, height, pixels, internalFormat) {
- var sizePerPixel;
- var numChannels;
- switch(format) {
- case 0x1906 /* GL_ALPHA */:
- case 0x1909 /* GL_LUMINANCE */:
- case 0x1902 /* GL_DEPTH_COMPONENT */:
- numChannels = 1;
- break;
- case 0x190A /* GL_LUMINANCE_ALPHA */:
- numChannels = 2;
- break;
- case 0x1907 /* GL_RGB */:
- case 0x8C40 /* GL_SRGB_EXT */:
- numChannels = 3;
- break;
- case 0x1908 /* GL_RGBA */:
- case 0x8C42 /* GL_SRGB_ALPHA_EXT */:
- numChannels = 4;
- break;
- default:
- GL.recordError(0x0500); // GL_INVALID_ENUM
- return null;
- }
- switch (type) {
- case 0x1401 /* GL_UNSIGNED_BYTE */:
- sizePerPixel = numChannels*1;
- break;
- case 0x1403 /* GL_UNSIGNED_SHORT */:
- case 0x8D61 /* GL_HALF_FLOAT_OES */:
- sizePerPixel = numChannels*2;
- break;
- case 0x1405 /* GL_UNSIGNED_INT */:
- case 0x1406 /* GL_FLOAT */:
- sizePerPixel = numChannels*4;
- break;
- case 0x84FA /* GL_UNSIGNED_INT_24_8_WEBGL/GL_UNSIGNED_INT_24_8 */:
- sizePerPixel = 4;
- break;
- case 0x8363 /* GL_UNSIGNED_SHORT_5_6_5 */:
- case 0x8033 /* GL_UNSIGNED_SHORT_4_4_4_4 */:
- case 0x8034 /* GL_UNSIGNED_SHORT_5_5_5_1 */:
- sizePerPixel = 2;
- break;
- default:
- GL.recordError(0x0500); // GL_INVALID_ENUM
- return null;
- }
- var bytes = emscriptenWebGLComputeImageSize(width, height, sizePerPixel, GL.unpackAlignment);
- switch(type) {
- case 0x1401 /* GL_UNSIGNED_BYTE */:
- return HEAPU8.subarray((pixels),(pixels+bytes));
- case 0x1406 /* GL_FLOAT */:
- return HEAPF32.subarray((pixels)>>2,(pixels+bytes)>>2);
- case 0x1405 /* GL_UNSIGNED_INT */:
- case 0x84FA /* GL_UNSIGNED_INT_24_8_WEBGL/GL_UNSIGNED_INT_24_8 */:
- return HEAPU32.subarray((pixels)>>2,(pixels+bytes)>>2);
- case 0x1403 /* GL_UNSIGNED_SHORT */:
- case 0x8363 /* GL_UNSIGNED_SHORT_5_6_5 */:
- case 0x8033 /* GL_UNSIGNED_SHORT_4_4_4_4 */:
- case 0x8034 /* GL_UNSIGNED_SHORT_5_5_5_1 */:
- case 0x8D61 /* GL_HALF_FLOAT_OES */:
- return HEAPU16.subarray((pixels)>>1,(pixels+bytes)>>1);
- default:
- GL.recordError(0x0500); // GL_INVALID_ENUM
- return null;
- }
- }function _emscripten_glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels) {
- var pixelData = null;
- if (pixels) pixelData = emscriptenWebGLGetTexPixelData(type, format, width, height, pixels, 0);
- GLctx.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixelData);
- }
- function _emscripten_glPolygonOffset(x0, x1) { GLctx['polygonOffset'](x0, x1) }
- var _emscripten_asm_const_int=true;
- function _emscripten_glUniform2f(location, v0, v1) {
- GLctx.uniform2f(GL.uniforms[location], v0, v1);
- }
- function _glGetAttribLocation(program, name) {
- program = GL.programs[program];
- name = Pointer_stringify(name);
- return GLctx.getAttribLocation(program, name);
- }
- function _glfwWindowHint(target, hint) {
- GLFW.hints[target] = hint;
- }
- function _emscripten_glUniform2i(location, v0, v1) {
- GLctx.uniform2i(GL.uniforms[location], v0, v1);
- }
- function _glBlendFunc(x0, x1) { GLctx['blendFunc'](x0, x1) }
- function _glCreateProgram() {
- var id = GL.getNewId(GL.programs);
- var program = GLctx.createProgram();
- program.name = id;
- GL.programs[id] = program;
- return id;
- }
- function _emscripten_glDeleteRenderbuffers(n, renderbuffers) {
- for (var i = 0; i < n; i++) {
- var id = HEAP32[(((renderbuffers)+(i*4))>>2)];
- var renderbuffer = GL.renderbuffers[id];
- if (!renderbuffer) continue; // GL spec: "glDeleteRenderbuffers silently ignores 0s and names that do not correspond to existing renderbuffer objects".
- GLctx.deleteRenderbuffer(renderbuffer);
- renderbuffer.name = 0;
- GL.renderbuffers[id] = null;
- }
- }
- function _emscripten_glGetBufferParameteriv(target, value, data) {
- if (!data) {
- // GLES2 specification does not specify how to behave if data is a null pointer. Since calling this function does not make sense
- // if data == null, issue a GL error to notify user about it.
- GL.recordError(0x0501 /* GL_INVALID_VALUE */);
- return;
- }
- HEAP32[((data)>>2)]=GLctx.getBufferParameter(target, value);
- }
-
- function emscriptenWebGLGetUniform(program, location, params, type) {
- if (!params) {
- // GLES2 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense
- // if params == null, issue a GL error to notify user about it.
- GL.recordError(0x0501 /* GL_INVALID_VALUE */);
- return;
- }
- var data = GLctx.getUniform(GL.programs[program], GL.uniforms[location]);
- if (typeof data == 'number' || typeof data == 'boolean') {
- switch (type) {
- case 'Integer': HEAP32[((params)>>2)]=data; break;
- case 'Float': HEAPF32[((params)>>2)]=data; break;
- default: throw 'internal emscriptenWebGLGetUniform() error, bad type: ' + type;
- }
- } else {
- for (var i = 0; i < data.length; i++) {
- switch (type) {
- case 'Integer': HEAP32[(((params)+(i))>>2)]=data[i]; break;
- case 'Float': HEAPF32[(((params)+(i))>>2)]=data[i]; break;
- default: throw 'internal emscriptenWebGLGetUniform() error, bad type: ' + type;
- }
- }
- }
- }function _emscripten_glGetUniformiv(program, location, params) {
- emscriptenWebGLGetUniform(program, location, params, 'Integer');
- }
- function _unsetenv(name) {
- if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_1(114, name);
- // int unsetenv(const char *name);
- // http://pubs.opengroup.org/onlinepubs/009695399/functions/unsetenv.html
- if (name === 0) {
- ___setErrNo(ERRNO_CODES.EINVAL);
- return -1;
- }
- name = Pointer_stringify(name);
- if (name === '' || name.indexOf('=') !== -1) {
- ___setErrNo(ERRNO_CODES.EINVAL);
- return -1;
- }
- if (ENV.hasOwnProperty(name)) {
- delete ENV[name];
- ___buildEnvironment(ENV);
- }
- return 0;
- }
- function _emscripten_glDepthMask(flag) {
- GLctx.depthMask(!!flag);
- }
- function _emscripten_glDepthRangef(x0, x1) { GLctx['depthRange'](x0, x1) }
-
-
- function _emscripten_get_now_is_monotonic() {
- // return whether emscripten_get_now is guaranteed monotonic; the Date.now
- // implementation is not :(
- return ENVIRONMENT_IS_NODE || (typeof dateNow !== 'undefined') ||
- ((ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && self['performance'] && self['performance']['now']);
- }function _clock_gettime(clk_id, tp) {
- // int clock_gettime(clockid_t clk_id, struct timespec *tp);
- var now;
- if (clk_id === 0) {
- now = Date.now();
- } else if (clk_id === 1 && _emscripten_get_now_is_monotonic()) {
- now = _emscripten_get_now();
- } else {
- ___setErrNo(ERRNO_CODES.EINVAL);
- return -1;
- }
- HEAP32[((tp)>>2)]=(now/1000)|0; // seconds
- HEAP32[(((tp)+(4))>>2)]=((now % 1000)*1000*1000)|0; // nanoseconds
- return 0;
- }function ___clock_gettime() {
- return _clock_gettime.apply(null, arguments)
- }
- function _emscripten_set_fullscreenchange_callback(target, userData, useCapture, callbackfunc) {
- if (typeof JSEvents.fullscreenEnabled() === 'undefined') return -1;
- if (!target) target = document;
- else {
- target = JSEvents.findEventTarget(target);
- if (!target) return -4;
- }
- JSEvents.registerFullscreenChangeEventCallback(target, userData, useCapture, callbackfunc, 19, "fullscreenchange");
- JSEvents.registerFullscreenChangeEventCallback(target, userData, useCapture, callbackfunc, 19, "mozfullscreenchange");
- JSEvents.registerFullscreenChangeEventCallback(target, userData, useCapture, callbackfunc, 19, "webkitfullscreenchange");
- JSEvents.registerFullscreenChangeEventCallback(target, userData, useCapture, callbackfunc, 19, "msfullscreenchange");
- return 0;
- }
- function _emscripten_glVertexAttrib1fv(index, v) {
-
- GLctx.vertexAttrib1f(index, HEAPF32[v>>2]);
- }
-
- function __cleanup_thread(pthread_ptr) {
- if (ENVIRONMENT_IS_PTHREAD) throw 'Internal Error! _cleanup_thread() can only ever be called from main application thread!';
- if (!pthread_ptr) throw 'Internal Error! Null pthread_ptr in _cleanup_thread!';
- HEAP32[(((pthread_ptr)+(24))>>2)]=0;
- var pthread = PThread.pthreads[pthread_ptr];
- var worker = pthread.worker;
- PThread.freeThreadData(pthread);
- worker.pthread = undefined; // Detach the worker from the pthread object, and return it to the worker pool as an unused worker.
- PThread.unusedWorkerPool.push(worker);
- PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker.pthread), 1); // Not a running Worker anymore.
- }
-
- function __pthread_testcancel_js() {
- if (!ENVIRONMENT_IS_PTHREAD) return;
- if (!threadInfoStruct) return;
- var cancelDisabled = Atomics.load(HEAPU32, (threadInfoStruct + 72 ) >> 2);
- if (cancelDisabled) return;
- var canceled = Atomics.load(HEAPU32, (threadInfoStruct + 0 ) >> 2);
- if (canceled == 2) throw 'Canceled!';
- }function _pthread_join(thread, status) {
- if (!thread) {
- Module['printErr']('pthread_join attempted on a null thread pointer!');
- return ERRNO_CODES.ESRCH;
- }
- if (ENVIRONMENT_IS_PTHREAD && selfThreadId == thread) {
- Module['printErr']('PThread ' + thread + ' is attempting to join to itself!');
- return ERRNO_CODES.EDEADLK;
- }
- else if (!ENVIRONMENT_IS_PTHREAD && PThread.mainThreadBlock == thread) {
- Module['printErr']('Main thread ' + thread + ' is attempting to join to itself!');
- return ERRNO_CODES.EDEADLK;
- }
- var self = HEAP32[(((thread)+(24))>>2)];
- if (self != thread) {
- Module['printErr']('pthread_join attempted on thread ' + thread + ', which does not point to a valid thread, or does not exist anymore!');
- return ERRNO_CODES.ESRCH;
- }
-
- var detached = Atomics.load(HEAPU32, (thread + 80 ) >> 2);
- if (detached) {
- Module['printErr']('Attempted to join thread ' + thread + ', which was already detached!');
- return ERRNO_CODES.EINVAL; // The thread is already detached, can no longer join it!
- }
- for (;;) {
- var threadStatus = Atomics.load(HEAPU32, (thread + 0 ) >> 2);
- if (threadStatus == 1) { // Exited?
- var threadExitCode = Atomics.load(HEAPU32, (thread + 4 ) >> 2);
- if (status) HEAP32[((status)>>2)]=threadExitCode;
- Atomics.store(HEAPU32, (thread + 80 ) >> 2, 1); // Mark the thread as detached.
-
- if (!ENVIRONMENT_IS_PTHREAD) __cleanup_thread(thread);
- else postMessage({ cmd: 'cleanupThread', thread: thread});
- return 0;
- }
- // TODO HACK! Replace the _js variant with just _pthread_testcancel:
- //_pthread_testcancel();
- __pthread_testcancel_js();
- // In main runtime thread (the thread that initialized the Emscripten C runtime and launched main()), assist pthreads in performing operations
- // that they need to access the Emscripten main runtime for.
- if (!ENVIRONMENT_IS_PTHREAD) _emscripten_main_thread_process_queued_calls();
- _emscripten_futex_wait(thread + 0, threadStatus, ENVIRONMENT_IS_PTHREAD ? 100 : 1);
- }
- }
-
-
- Module["___muldsi3"] = ___muldsi3;
- Module["___muldi3"] = ___muldi3;
- function _emscripten_glGetShaderPrecisionFormat(shaderType, precisionType, range, precision) {
- var result = GLctx.getShaderPrecisionFormat(shaderType, precisionType);
- HEAP32[((range)>>2)]=result.rangeMin;
- HEAP32[(((range)+(4))>>2)]=result.rangeMax;
- HEAP32[((precision)>>2)]=result.precision;
- }
- function _emscripten_glUniform1fv(location, count, value) {
-
-
- var view;
- if (count <= GL.MINI_TEMP_BUFFER_SIZE) {
- // avoid allocation when uploading few enough uniforms
- view = GL.miniTempBufferViews[count-1];
- for (var i = 0; i < count; ++i) {
- view[i] = HEAPF32[(((value)+(4*i))>>2)];
- }
- } else {
- view = HEAPF32.subarray((value)>>2,(value+count*4)>>2);
- }
- GLctx.uniform1fv(GL.uniforms[location], view);
- }
- function _glDeleteBuffers(n, buffers) {
- for (var i = 0; i < n; i++) {
- var id = HEAP32[(((buffers)+(i*4))>>2)];
- var buffer = GL.buffers[id];
-
- // From spec: "glDeleteBuffers silently ignores 0's and names that do not
- // correspond to existing buffer objects."
- if (!buffer) continue;
-
- GLctx.deleteBuffer(buffer);
- buffer.name = 0;
- GL.buffers[id] = null;
-
- if (id == GL.currArrayBuffer) GL.currArrayBuffer = 0;
- if (id == GL.currElementArrayBuffer) GL.currElementArrayBuffer = 0;
- }
- }
- function _emscripten_set_gamepaddisconnected_callback(userData, useCapture, callbackfunc) {
- if (!navigator.getGamepads && !navigator.webkitGetGamepads) return -1;
- JSEvents.registerGamepadEventCallback(window, userData, useCapture, callbackfunc, 27, "gamepaddisconnected");
- return 0;
- }
- function _emscripten_glBindProgramARB() {
- Module['printErr']('missing function: emscripten_glBindProgramARB'); abort(-1);
- }
- function _emscripten_glBindTexture(target, texture) {
- GLctx.bindTexture(target, texture ? GL.textures[texture] : null);
- }
- function _emscripten_glCheckFramebufferStatus(x0) { return GLctx['checkFramebufferStatus'](x0) }
- function _emscripten_glDeleteProgram(id) {
- if (!id) return;
- var program = GL.programs[id];
- if (!program) { // glDeleteProgram actually signals an error when deleting a nonexisting object, unlike some other GL delete functions.
- GL.recordError(0x0501 /* GL_INVALID_VALUE */);
- return;
- }
- GLctx.deleteProgram(program);
- program.name = 0;
- GL.programs[id] = null;
- GL.programInfos[id] = null;
- }
- function _emscripten_glDisable(x0) { GLctx['disable'](x0) }
- function _emscripten_glVertexAttrib3fv(index, v) {
-
- GLctx.vertexAttrib3f(index, HEAPF32[v>>2], HEAPF32[v+4>>2], HEAPF32[v+8>>2]);
- }
- function _glClearColor(x0, x1, x2, x3) { GLctx['clearColor'](x0, x1, x2, x3) }
- function _emscripten_glGetActiveAttrib(program, index, bufSize, length, size, type, name) {
- program = GL.programs[program];
- var info = GLctx.getActiveAttrib(program, index);
- if (!info) return; // If an error occurs, nothing will be written to length, size and type and name.
-
- if (bufSize > 0 && name) {
- var numBytesWrittenExclNull = stringToUTF8(info.name, name, bufSize);
- if (length) HEAP32[((length)>>2)]=numBytesWrittenExclNull;
- } else {
- if (length) HEAP32[((length)>>2)]=0;
- }
-
- if (size) HEAP32[((size)>>2)]=info.size;
- if (type) HEAP32[((type)>>2)]=info.type;
- }
- function _emscripten_glIsFramebuffer(framebuffer) {
- var fb = GL.framebuffers[framebuffer];
- if (!fb) return 0;
- return GLctx.isFramebuffer(fb);
- }
- function _emscripten_glLineWidth(x0) { GLctx['lineWidth'](x0) }
- function _glfwGetCursorPos(winid, x, y) {
- GLFW.getCursorPos(winid, x, y);
- }
- function _emscripten_glGetString(name_) {
- if (GL.stringCache[name_]) return GL.stringCache[name_];
- var ret;
- switch(name_) {
- case 0x1F00 /* GL_VENDOR */:
- case 0x1F01 /* GL_RENDERER */:
- case 0x9245 /* UNMASKED_VENDOR_WEBGL */:
- case 0x9246 /* UNMASKED_RENDERER_WEBGL */:
- ret = allocate(intArrayFromString(GLctx.getParameter(name_)), 'i8', ALLOC_NORMAL);
- break;
- case 0x1F02 /* GL_VERSION */:
- var glVersion = GLctx.getParameter(GLctx.VERSION);
- // return GLES version string corresponding to the version of the WebGL context
- {
- glVersion = 'OpenGL ES 2.0 (' + glVersion + ')';
- }
- ret = allocate(intArrayFromString(glVersion), 'i8', ALLOC_NORMAL);
- break;
- case 0x1F03 /* GL_EXTENSIONS */:
- var exts = GLctx.getSupportedExtensions();
- var gl_exts = [];
- for (var i = 0; i < exts.length; ++i) {
- gl_exts.push(exts[i]);
- gl_exts.push("GL_" + exts[i]);
- }
- ret = allocate(intArrayFromString(gl_exts.join(' ')), 'i8', ALLOC_NORMAL);
- break;
- case 0x8B8C /* GL_SHADING_LANGUAGE_VERSION */:
- var glslVersion = GLctx.getParameter(GLctx.SHADING_LANGUAGE_VERSION);
- // extract the version number 'N.M' from the string 'WebGL GLSL ES N.M ...'
- var ver_re = /^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/;
- var ver_num = glslVersion.match(ver_re);
- if (ver_num !== null) {
- if (ver_num[1].length == 3) ver_num[1] = ver_num[1] + '0'; // ensure minor version has 2 digits
- glslVersion = 'OpenGL ES GLSL ES ' + ver_num[1] + ' (' + glslVersion + ')';
- }
- ret = allocate(intArrayFromString(glslVersion), 'i8', ALLOC_NORMAL);
- break;
- default:
- GL.recordError(0x0500/*GL_INVALID_ENUM*/);
- return 0;
- }
- GL.stringCache[name_] = ret;
- return ret;
- }
- function _emscripten_glGetAttribLocation(program, name) {
- program = GL.programs[program];
- name = Pointer_stringify(name);
- return GLctx.getAttribLocation(program, name);
- }
- function _emscripten_glRotatef() {
- Module['printErr']('missing function: emscripten_glRotatef'); abort(-1);
- }
-
- function emscriptenWebGLGet(name_, p, type) {
- // Guard against user passing a null pointer.
- // Note that GLES2 spec does not say anything about how passing a null pointer should be treated.
- // Testing on desktop core GL 3, the application crashes on glGetIntegerv to a null pointer, but
- // better to report an error instead of doing anything random.
- if (!p) {
- GL.recordError(0x0501 /* GL_INVALID_VALUE */);
- return;
- }
- var ret = undefined;
- switch(name_) { // Handle a few trivial GLES values
- case 0x8DFA: // GL_SHADER_COMPILER
- ret = 1;
- break;
- case 0x8DF8: // GL_SHADER_BINARY_FORMATS
- if (type !== 'Integer' && type !== 'Integer64') {
- GL.recordError(0x0500); // GL_INVALID_ENUM
- }
- return; // Do not write anything to the out pointer, since no binary formats are supported.
- case 0x8DF9: // GL_NUM_SHADER_BINARY_FORMATS
- ret = 0;
- break;
- case 0x86A2: // GL_NUM_COMPRESSED_TEXTURE_FORMATS
- // 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),
- // so implement it ourselves to allow C++ GLES2 code get the length.
- var formats = GLctx.getParameter(0x86A3 /*GL_COMPRESSED_TEXTURE_FORMATS*/);
- ret = formats.length;
- break;
- }
-
- if (ret === undefined) {
- var result = GLctx.getParameter(name_);
- switch (typeof(result)) {
- case "number":
- ret = result;
- break;
- case "boolean":
- ret = result ? 1 : 0;
- break;
- case "string":
- GL.recordError(0x0500); // GL_INVALID_ENUM
- return;
- case "object":
- if (result === null) {
- // null is a valid result for some (e.g., which buffer is bound - perhaps nothing is bound), but otherwise
- // can mean an invalid name_, which we need to report as an error
- switch(name_) {
- case 0x8894: // ARRAY_BUFFER_BINDING
- case 0x8B8D: // CURRENT_PROGRAM
- case 0x8895: // ELEMENT_ARRAY_BUFFER_BINDING
- case 0x8CA6: // FRAMEBUFFER_BINDING
- case 0x8CA7: // RENDERBUFFER_BINDING
- case 0x8069: // TEXTURE_BINDING_2D
- case 0x8514: { // TEXTURE_BINDING_CUBE_MAP
- ret = 0;
- break;
- }
- default: {
- GL.recordError(0x0500); // GL_INVALID_ENUM
- return;
- }
- }
- } else if (result instanceof Float32Array ||
- result instanceof Uint32Array ||
- result instanceof Int32Array ||
- result instanceof Array) {
- for (var i = 0; i < result.length; ++i) {
- switch (type) {
- case 'Integer': HEAP32[(((p)+(i*4))>>2)]=result[i]; break;
- case 'Float': HEAPF32[(((p)+(i*4))>>2)]=result[i]; break;
- case 'Boolean': HEAP8[(((p)+(i))>>0)]=result[i] ? 1 : 0; break;
- default: throw 'internal glGet error, bad type: ' + type;
- }
- }
- return;
- } else if (result instanceof WebGLBuffer ||
- result instanceof WebGLProgram ||
- result instanceof WebGLFramebuffer ||
- result instanceof WebGLRenderbuffer ||
- result instanceof WebGLTexture) {
- ret = result.name | 0;
- } else {
- GL.recordError(0x0500); // GL_INVALID_ENUM
- return;
- }
- break;
- default:
- GL.recordError(0x0500); // GL_INVALID_ENUM
- return;
- }
- }
-
- switch (type) {
- 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;
- case 'Integer': HEAP32[((p)>>2)]=ret; break;
- case 'Float': HEAPF32[((p)>>2)]=ret; break;
- case 'Boolean': HEAP8[((p)>>0)]=ret ? 1 : 0; break;
- default: throw 'internal glGet error, bad type: ' + type;
- }
- }function _emscripten_glGetIntegerv(name_, p) {
- emscriptenWebGLGet(name_, p, 'Integer');
- }
- function _emscripten_glGetFramebufferAttachmentParameteriv(target, attachment, pname, params) {
- var result = GLctx.getFramebufferAttachmentParameter(target, attachment, pname);
- HEAP32[((params)>>2)]=result;
- }
- function _llvm_stackrestore(p) {
- var self = _llvm_stacksave;
- var ret = self.LLVM_SAVEDSTACKS[p];
- self.LLVM_SAVEDSTACKS.splice(p, 1);
- Runtime.stackRestore(ret);
- }
- function _glfwSetWindowShouldClose(winid, value) {
- var win = GLFW.WindowFromId(winid);
- if (!win) return;
- win.shouldClose = value;
- }
- function _emscripten_glClientActiveTexture() {
- Module['printErr']('missing function: emscripten_glClientActiveTexture'); abort(-1);
- }
- function _glGenBuffers(n, buffers) {
- for (var i = 0; i < n; i++) {
- var buffer = GLctx.createBuffer();
- if (!buffer) {
- GL.recordError(0x0502 /* GL_INVALID_OPERATION */);
- while(i < n) HEAP32[(((buffers)+(i++*4))>>2)]=0;
- return;
- }
- var id = GL.getNewId(GL.buffers);
- buffer.name = id;
- GL.buffers[id] = buffer;
- HEAP32[(((buffers)+(i*4))>>2)]=id;
- }
- }
-
- function _emscripten_memcpy_big(dest, src, num) {
- HEAPU8.set(HEAPU8.subarray(src, src+num), dest);
- return dest;
- }
- Module["_memcpy"] = _memcpy;
- function _emscripten_glGetShaderInfoLog(shader, maxLength, length, infoLog) {
- var log = GLctx.getShaderInfoLog(GL.shaders[shader]);
- if (log === null) log = '(unknown error)';
- if (maxLength > 0 && infoLog) {
- var numBytesWrittenExclNull = stringToUTF8(log, infoLog, maxLength);
- if (length) HEAP32[((length)>>2)]=numBytesWrittenExclNull;
- } else {
- if (length) HEAP32[((length)>>2)]=0;
- }
- }
- function _glfwGetTime() {
- return GLFW.getTime() - GLFW.initialTime;
- }
- function _emscripten_glGetRenderbufferParameteriv(target, pname, params) {
- if (!params) {
- // GLES2 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense
- // if params == null, issue a GL error to notify user about it.
- GL.recordError(0x0501 /* GL_INVALID_VALUE */);
- return;
- }
- HEAP32[((params)>>2)]=GLctx.getRenderbufferParameter(target, pname);
- }
- function _emscripten_glStencilOpSeparate(x0, x1, x2, x3) { GLctx['stencilOpSeparate'](x0, x1, x2, x3) }
- function _emscripten_glReadPixels(x, y, width, height, format, type, pixels) {
- var pixelData = emscriptenWebGLGetTexPixelData(type, format, width, height, pixels, format);
- if (!pixelData) {
- GL.recordError(0x0500/*GL_INVALID_ENUM*/);
- return;
- }
- GLctx.readPixels(x, y, width, height, format, type, pixelData);
- }
- function _emscripten_glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data) {
- GLctx['compressedTexSubImage2D'](target, level, xoffset, yoffset, width, height, format, data ? HEAPU8.subarray((data),(data+imageSize)) : null);
- }
- function _emscripten_glGetError() {
- // First return any GL error generated by the emscripten library_gl.js interop layer.
- if (GL.lastError) {
- var error = GL.lastError;
- GL.lastError = 0/*GL_NO_ERROR*/;
- return error;
- } else { // If there were none, return the GL error from the browser GL context.
- return GLctx.getError();
- }
- }
- function _emscripten_glFramebufferTexture2D(target, attachment, textarget, texture, level) {
- GLctx.framebufferTexture2D(target, attachment, textarget,
- GL.textures[texture], level);
- }
- function _emscripten_glIsEnabled(x0) { return GLctx['isEnabled'](x0) }
- function _glClearDepthf(x0) { GLctx['clearDepth'](x0) }
-
- Module["_memmove"] = _memmove;
- function _glGenTextures(n, textures) {
- for (var i = 0; i < n; i++) {
- var texture = GLctx.createTexture();
- if (!texture) {
- 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.
- while(i < n) HEAP32[(((textures)+(i++*4))>>2)]=0;
- return;
- }
- var id = GL.getNewId(GL.textures);
- texture.name = id;
- GL.textures[id] = texture;
- HEAP32[(((textures)+(i*4))>>2)]=id;
- }
- }
- function _emscripten_glVertexAttrib4f(x0, x1, x2, x3, x4) { GLctx['vertexAttrib4f'](x0, x1, x2, x3, x4) }
- function _glDepthFunc(x0) { GLctx['depthFunc'](x0) }
-
- 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) {
- if (addr <= 0 || addr > HEAP8.length || addr&3 != 0) return -22;
- // dump('futex_wait addr:' + addr + ' by thread: ' + _pthread_self() + (ENVIRONMENT_IS_PTHREAD?'(pthread)':'') + '\n');
- if (ENVIRONMENT_IS_WORKER) {
- var ret = Atomics.wait(HEAP32, addr >> 2, val, timeout);
- // dump('futex_wait done by thread: ' + _pthread_self() + (ENVIRONMENT_IS_PTHREAD?'(pthread)':'') + '\n');
- if (ret === 'timed-out') return -110;
- if (ret === 'not-equal') return -11;
- if (ret === 'ok') return 0;
- throw 'Atomics.wait returned an unexpected value ' + ret;
- } else {
- // Atomics.wait is not available in the main browser thread, so simulate it via busy spinning.
- var loadedVal = Atomics.load(HEAP32, addr >> 2);
- if (val != loadedVal) return -11;
-
- var tNow = performance.now();
- var tEnd = tNow + timeout;
-
-
- // Register globally which address the main thread is simulating to be waiting on. When zero, main thread is not waiting on anything,
- // 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.
- Atomics.store(HEAP32, __main_thread_futex_wait_address >> 2, addr);
- 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.
- while (addr == ourWaitAddress) {
- tNow = performance.now();
- if (tNow > tEnd) {
- return -110;
- }
- _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.
- addr = Atomics.load(HEAP32, __main_thread_futex_wait_address >> 2); // Look for a worker thread waking us up.
- }
- return 0;
- }
- }
- function _emscripten_glClearDepthf(x0) { GLctx['clearDepth'](x0) }
- function _emscripten_glClear(x0) { GLctx['clear'](x0) }
- function _emscripten_glBindBuffer(target, buffer) {
- var bufferObj = buffer ? GL.buffers[buffer] : null;
-
-
- GLctx.bindBuffer(target, bufferObj);
- }
- function _emscripten_glGetUniformfv(program, location, params) {
- emscriptenWebGLGetUniform(program, location, params, 'Float');
- }
- function _glGetProgramiv(program, pname, p) {
- if (!p) {
- // GLES2 specification does not specify how to behave if p is a null pointer. Since calling this function does not make sense
- // if p == null, issue a GL error to notify user about it.
- GL.recordError(0x0501 /* GL_INVALID_VALUE */);
- return;
- }
-
- if (program >= GL.counter) {
- GL.recordError(0x0501 /* GL_INVALID_VALUE */);
- return;
- }
-
- var ptable = GL.programInfos[program];
- if (!ptable) {
- GL.recordError(0x0502 /* GL_INVALID_OPERATION */);
- return;
- }
-
- if (pname == 0x8B84) { // GL_INFO_LOG_LENGTH
- var log = GLctx.getProgramInfoLog(GL.programs[program]);
- if (log === null) log = '(unknown error)';
- HEAP32[((p)>>2)]=log.length + 1;
- } else if (pname == 0x8B87 /* GL_ACTIVE_UNIFORM_MAX_LENGTH */) {
- HEAP32[((p)>>2)]=ptable.maxUniformLength;
- } else if (pname == 0x8B8A /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */) {
- if (ptable.maxAttributeLength == -1) {
- var program = GL.programs[program];
- var numAttribs = GLctx.getProgramParameter(program, GLctx.ACTIVE_ATTRIBUTES);
- ptable.maxAttributeLength = 0; // Spec says if there are no active attribs, 0 must be returned.
- for (var i = 0; i < numAttribs; ++i) {
- var activeAttrib = GLctx.getActiveAttrib(program, i);
- ptable.maxAttributeLength = Math.max(ptable.maxAttributeLength, activeAttrib.name.length+1);
- }
- }
- HEAP32[((p)>>2)]=ptable.maxAttributeLength;
- } else if (pname == 0x8A35 /* GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */) {
- if (ptable.maxUniformBlockNameLength == -1) {
- var program = GL.programs[program];
- var numBlocks = GLctx.getProgramParameter(program, GLctx.ACTIVE_UNIFORM_BLOCKS);
- ptable.maxUniformBlockNameLength = 0;
- for (var i = 0; i < numBlocks; ++i) {
- var activeBlockName = GLctx.getActiveUniformBlockName(program, i);
- ptable.maxUniformBlockNameLength = Math.max(ptable.maxUniformBlockNameLength, activeBlockName.length+1);
- }
- }
- HEAP32[((p)>>2)]=ptable.maxUniformBlockNameLength;
- } else {
- HEAP32[((p)>>2)]=GLctx.getProgramParameter(GL.programs[program], pname);
- }
- }
- function _glVertexAttribPointer(index, size, type, normalized, stride, ptr) {
- GLctx.vertexAttribPointer(index, size, type, !!normalized, stride, ptr);
- }
- function _emscripten_exit_pointerlock() {
- // Make sure no queued up calls will fire after this.
- JSEvents.removeDeferredCalls(JSEvents.requestPointerLock);
-
- if (document.exitPointerLock) {
- document.exitPointerLock();
- } else if (document.msExitPointerLock) {
- document.msExitPointerLock();
- } else if (document.mozExitPointerLock) {
- document.mozExitPointerLock();
- } else if (document.webkitExitPointerLock) {
- document.webkitExitPointerLock();
- } else {
- return -1;
- }
- return 0;
- }
-
-
- 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);
- Module["_llvm_cttz_i32"] = _llvm_cttz_i32;
- Module["___udivmoddi4"] = ___udivmoddi4;
- Module["___uremdi3"] = ___uremdi3;
- function _glGetUniformLocation(program, name) {
- name = Pointer_stringify(name);
-
- var arrayOffset = 0;
- // If user passed an array accessor "[index]", parse the array index off the accessor.
- if (name.indexOf(']', name.length-1) !== -1) {
- var ls = name.lastIndexOf('[');
- var arrayIndex = name.slice(ls+1, -1);
- if (arrayIndex.length > 0) {
- arrayOffset = parseInt(arrayIndex);
- if (arrayOffset < 0) {
- return -1;
- }
- }
- name = name.slice(0, ls);
- }
-
- var ptable = GL.programInfos[program];
- if (!ptable) {
- return -1;
- }
- var utable = ptable.uniforms;
- var uniformInfo = utable[name]; // returns pair [ dimension_of_uniform_array, uniform_location ]
- 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.
- return uniformInfo[1]+arrayOffset;
- } else {
- return -1;
- }
- }
- function _emscripten_glGetAttachedShaders(program, maxCount, count, shaders) {
- var result = GLctx.getAttachedShaders(GL.programs[program]);
- var len = result.length;
- if (len > maxCount) {
- len = maxCount;
- }
- HEAP32[((count)>>2)]=len;
- for (var i = 0; i < len; ++i) {
- var id = GL.shaders.indexOf(result[i]);
- assert(id !== -1, 'shader not bound to local id');
- HEAP32[(((shaders)+(i*4))>>2)]=id;
- }
- }
- function _emscripten_glGenRenderbuffers(n, renderbuffers) {
- for (var i = 0; i < n; i++) {
- var renderbuffer = GLctx.createRenderbuffer();
- if (!renderbuffer) {
- GL.recordError(0x0502 /* GL_INVALID_OPERATION */);
- while(i < n) HEAP32[(((renderbuffers)+(i++*4))>>2)]=0;
- return;
- }
- var id = GL.getNewId(GL.renderbuffers);
- renderbuffer.name = id;
- GL.renderbuffers[id] = renderbuffer;
- HEAP32[(((renderbuffers)+(i*4))>>2)]=id;
- }
- }
- function _emscripten_glFrontFace(x0) { GLctx['frontFace'](x0) }
- function _emscripten_glActiveTexture(x0) { GLctx['activeTexture'](x0) }
- function _emscripten_glUniform1iv(location, count, value) {
-
-
- GLctx.uniform1iv(GL.uniforms[location], HEAP32.subarray((value)>>2,(value+count*4)>>2));
- }
- function _emscripten_glTexCoordPointer() {
- Module['printErr']('missing function: emscripten_glTexCoordPointer'); abort(-1);
- }
- function _emscripten_glGetInfoLogARB() {
- Module['printErr']('missing function: emscripten_glGetInfoLogARB'); abort(-1);
- }
-
- function __exit(status) {
- // void _exit(int status);
- // http://pubs.opengroup.org/onlinepubs/000095399/functions/exit.html
- Module['exit'](status);
- }function _exit(status) {
- __exit(status);
- }
- function _emscripten_glRenderbufferStorage(x0, x1, x2, x3) { GLctx['renderbufferStorage'](x0, x1, x2, x3) }
- function _emscripten_glCopyTexSubImage2D(x0, x1, x2, x3, x4, x5, x6, x7) { GLctx['copyTexSubImage2D'](x0, x1, x2, x3, x4, x5, x6, x7) }
- function _glfwSetCursorPosCallback(winid, cbfun) {
- GLFW.setCursorPosCallback(winid, cbfun);
- }
- function _emscripten_glDepthRange(x0, x1) { GLctx['depthRange'](x0, x1) }
- function _glBindAttribLocation(program, index, name) {
- name = Pointer_stringify(name);
- GLctx.bindAttribLocation(GL.programs[program], index, name);
- }
- function _emscripten_glShaderBinary() {
- GL.recordError(0x0500/*GL_INVALID_ENUM*/);
- }
- function _emscripten_glIsProgram(program) {
- var program = GL.programs[program];
- if (!program) return 0;
- return GLctx.isProgram(program);
- }
- function _emscripten_glBlendColor(x0, x1, x2, x3) { GLctx['blendColor'](x0, x1, x2, x3) }
- function _emscripten_glGetShaderiv(shader, pname, p) {
- if (!p) {
- // GLES2 specification does not specify how to behave if p is a null pointer. Since calling this function does not make sense
- // if p == null, issue a GL error to notify user about it.
- GL.recordError(0x0501 /* GL_INVALID_VALUE */);
- return;
- }
- if (pname == 0x8B84) { // GL_INFO_LOG_LENGTH
- var log = GLctx.getShaderInfoLog(GL.shaders[shader]);
- if (log === null) log = '(unknown error)';
- HEAP32[((p)>>2)]=log.length + 1;
- } else {
- HEAP32[((p)>>2)]=GLctx.getShaderParameter(GL.shaders[shader], pname);
- }
- }
- function _emscripten_glUniformMatrix3fv(location, count, transpose, value) {
-
-
- var view;
- if (9*count <= GL.MINI_TEMP_BUFFER_SIZE) {
- // avoid allocation when uploading few enough uniforms
- view = GL.miniTempBufferViews[9*count-1];
- for (var i = 0; i < 9*count; i += 9) {
- view[i] = HEAPF32[(((value)+(4*i))>>2)];
- view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)];
- view[i+2] = HEAPF32[(((value)+(4*i+8))>>2)];
- view[i+3] = HEAPF32[(((value)+(4*i+12))>>2)];
- view[i+4] = HEAPF32[(((value)+(4*i+16))>>2)];
- view[i+5] = HEAPF32[(((value)+(4*i+20))>>2)];
- view[i+6] = HEAPF32[(((value)+(4*i+24))>>2)];
- view[i+7] = HEAPF32[(((value)+(4*i+28))>>2)];
- view[i+8] = HEAPF32[(((value)+(4*i+32))>>2)];
- }
- } else {
- view = HEAPF32.subarray((value)>>2,(value+count*36)>>2);
- }
- GLctx.uniformMatrix3fv(GL.uniforms[location], !!transpose, view);
- }
-
- Module["___udivdi3"] = ___udivdi3;
- function _emscripten_glUniform4fv(location, count, value) {
-
-
- var view;
- if (4*count <= GL.MINI_TEMP_BUFFER_SIZE) {
- // avoid allocation when uploading few enough uniforms
- view = GL.miniTempBufferViews[4*count-1];
- for (var i = 0; i < 4*count; i += 4) {
- view[i] = HEAPF32[(((value)+(4*i))>>2)];
- view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)];
- view[i+2] = HEAPF32[(((value)+(4*i+8))>>2)];
- view[i+3] = HEAPF32[(((value)+(4*i+12))>>2)];
- }
- } else {
- view = HEAPF32.subarray((value)>>2,(value+count*16)>>2);
- }
- GLctx.uniform4fv(GL.uniforms[location], view);
- }
- function _glBufferSubData(target, offset, size, data) {
- GLctx.bufferSubData(target, offset, HEAPU8.subarray(data, data+size));
- }
- function _emscripten_futex_wake(addr, count) {
- if (addr <= 0 || addr > HEAP8.length || addr&3 != 0 || count < 0) return -22;
- if (count == 0) return 0;
- // dump('futex_wake addr:' + addr + ' by thread: ' + _pthread_self() + (ENVIRONMENT_IS_PTHREAD?'(pthread)':'') + '\n');
-
- // See if main thread is waiting on this address? If so, wake it up by resetting its wake location to zero.
- // Note that this is not a fair procedure, since we always wake main thread first before any workers, so
- // this scheme does not adhere to real queue-based waiting.
- var mainThreadWaitAddress = Atomics.load(HEAP32, __main_thread_futex_wait_address >> 2);
- var mainThreadWoken = 0;
- if (mainThreadWaitAddress == addr) {
- var loadedAddr = Atomics.compareExchange(HEAP32, __main_thread_futex_wait_address >> 2, mainThreadWaitAddress, 0);
- if (loadedAddr == mainThreadWaitAddress) {
- --count;
- mainThreadWoken = 1;
- if (count <= 0) return 1;
- }
- }
-
- // Wake any workers waiting on this address.
- var ret = Atomics.wake(HEAP32, addr >> 2, count);
- if (ret >= 0) return ret + mainThreadWoken;
- throw 'Atomics.wake returned an unexpected value ' + ret;
- }
- function _glGetProgramInfoLog(program, maxLength, length, infoLog) {
- var log = GLctx.getProgramInfoLog(GL.programs[program]);
- if (log === null) log = '(unknown error)';
-
- if (maxLength > 0 && infoLog) {
- var numBytesWrittenExclNull = stringToUTF8(log, infoLog, maxLength);
- if (length) HEAP32[((length)>>2)]=numBytesWrittenExclNull;
- } else {
- if (length) HEAP32[((length)>>2)]=0;
- }
- }
- function _emscripten_glGenFramebuffers(n, ids) {
- for (var i = 0; i < n; ++i) {
- var framebuffer = GLctx.createFramebuffer();
- if (!framebuffer) {
- GL.recordError(0x0502 /* GL_INVALID_OPERATION */);
- while(i < n) HEAP32[(((ids)+(i++*4))>>2)]=0;
- return;
- }
- var id = GL.getNewId(GL.framebuffers);
- framebuffer.name = id;
- GL.framebuffers[id] = framebuffer;
- HEAP32[(((ids)+(i*4))>>2)]=id;
- }
- }
- function _glGetShaderiv(shader, pname, p) {
- if (!p) {
- // GLES2 specification does not specify how to behave if p is a null pointer. Since calling this function does not make sense
- // if p == null, issue a GL error to notify user about it.
- GL.recordError(0x0501 /* GL_INVALID_VALUE */);
- return;
- }
- if (pname == 0x8B84) { // GL_INFO_LOG_LENGTH
- var log = GLctx.getShaderInfoLog(GL.shaders[shader]);
- if (log === null) log = '(unknown error)';
- HEAP32[((p)>>2)]=log.length + 1;
- } else {
- HEAP32[((p)>>2)]=GLctx.getShaderParameter(GL.shaders[shader], pname);
- }
- }
- function _emscripten_glBlendEquationSeparate(x0, x1) { GLctx['blendEquationSeparate'](x0, x1) }
- function _glfwSetWindowIconifyCallback(winid, cbfun) {
- var win = GLFW.WindowFromId(winid);
- if (!win) return;
- win.windowIconifyFunc = cbfun;
- }
- function _emscripten_glDrawRangeElements() {
- Module['printErr']('missing function: emscripten_glDrawRangeElements'); abort(-1);
- }
- function _emscripten_glGenTextures(n, textures) {
- for (var i = 0; i < n; i++) {
- var texture = GLctx.createTexture();
- if (!texture) {
- 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.
- while(i < n) HEAP32[(((textures)+(i++*4))>>2)]=0;
- return;
- }
- var id = GL.getNewId(GL.textures);
- texture.name = id;
- GL.textures[id] = texture;
- HEAP32[(((textures)+(i*4))>>2)]=id;
- }
- }
- function _emscripten_glVertexAttrib2fv(index, v) {
-
- GLctx.vertexAttrib2f(index, HEAPF32[v>>2], HEAPF32[v+4>>2]);
- }
- function _emscripten_glGetActiveUniform(program, index, bufSize, length, size, type, name) {
- program = GL.programs[program];
- var info = GLctx.getActiveUniform(program, index);
- if (!info) return; // If an error occurs, nothing will be written to length, size, type and name.
-
- if (bufSize > 0 && name) {
- var numBytesWrittenExclNull = stringToUTF8(info.name, name, bufSize);
- if (length) HEAP32[((length)>>2)]=numBytesWrittenExclNull;
- } else {
- if (length) HEAP32[((length)>>2)]=0;
- }
-
- if (size) HEAP32[((size)>>2)]=info.size;
- if (type) HEAP32[((type)>>2)]=info.type;
- }
-
- Module["_roundf"] = _roundf;
- function _emscripten_glDeleteObjectARB() {
- Module['printErr']('missing function: emscripten_glDeleteObjectARB'); abort(-1);
- }
- function _emscripten_set_touchmove_callback(target, userData, useCapture, callbackfunc) {
- JSEvents.registerTouchEventCallback(target, userData, useCapture, callbackfunc, 24, "touchmove");
- return 0;
- }
- function _emscripten_glUniform1f(location, v0) {
- GLctx.uniform1f(GL.uniforms[location], v0);
- }
- function _emscripten_glVertexAttribPointer(index, size, type, normalized, stride, ptr) {
- GLctx.vertexAttribPointer(index, size, type, !!normalized, stride, ptr);
- }
- function _glShaderSource(shader, count, string, length) {
- var source = GL.getSource(shader, count, string, length);
-
-
- GLctx.shaderSource(GL.shaders[shader], source);
- }
-
- function __spawn_thread(threadParams) {
- if (ENVIRONMENT_IS_PTHREAD) throw 'Internal Error! _spawn_thread() can only ever be called from main application thread!';
-
- var worker = PThread.getNewWorker();
- if (worker.pthread !== undefined) throw 'Internal error!';
- if (!threadParams.pthread_ptr) throw 'Internal error, no pthread ptr!';
- PThread.runningWorkers.push(worker);
-
- // Allocate memory for thread-local storage and initialize it to zero.
- var tlsMemory = _malloc(128 * 4);
- for (var i = 0; i < 128; ++i) {
- HEAP32[(((tlsMemory)+(i*4))>>2)]=0;
- }
-
- var pthread = PThread.pthreads[threadParams.pthread_ptr] = { // Create a pthread info object to represent this thread.
- worker: worker,
- stackBase: threadParams.stackBase,
- stackSize: threadParams.stackSize,
- allocatedOwnStack: threadParams.allocatedOwnStack,
- thread: threadParams.pthread_ptr,
- threadInfoStruct: threadParams.pthread_ptr // Info area for this thread in Emscripten HEAP (shared)
- };
- Atomics.store(HEAPU32, (pthread.threadInfoStruct + 0 ) >> 2, 0); // threadStatus <- 0, meaning not yet exited.
- Atomics.store(HEAPU32, (pthread.threadInfoStruct + 4 ) >> 2, 0); // threadExitCode <- 0.
- Atomics.store(HEAPU32, (pthread.threadInfoStruct + 20 ) >> 2, 0); // profilerBlock <- 0.
- Atomics.store(HEAPU32, (pthread.threadInfoStruct + 80 ) >> 2, threadParams.detached);
- Atomics.store(HEAPU32, (pthread.threadInfoStruct + 116 ) >> 2, tlsMemory); // Init thread-local-storage memory array.
- Atomics.store(HEAPU32, (pthread.threadInfoStruct + 60 ) >> 2, 0); // Mark initial status to unused.
- Atomics.store(HEAPU32, (pthread.threadInfoStruct + 52 ) >> 2, pthread.threadInfoStruct); // Main thread ID.
- Atomics.store(HEAPU32, (pthread.threadInfoStruct + 56 ) >> 2, PROCINFO.pid); // Process ID.
-
- Atomics.store(HEAPU32, (pthread.threadInfoStruct + 120) >> 2, threadParams.stackSize);
- Atomics.store(HEAPU32, (pthread.threadInfoStruct + 96) >> 2, threadParams.stackSize);
- Atomics.store(HEAPU32, (pthread.threadInfoStruct + 92) >> 2, threadParams.stackBase);
- Atomics.store(HEAPU32, (pthread.threadInfoStruct + 120 + 8) >> 2, threadParams.stackBase);
- Atomics.store(HEAPU32, (pthread.threadInfoStruct + 120 + 12) >> 2, threadParams.detached);
- Atomics.store(HEAPU32, (pthread.threadInfoStruct + 120 + 20) >> 2, threadParams.schedPolicy);
- Atomics.store(HEAPU32, (pthread.threadInfoStruct + 120 + 24) >> 2, threadParams.schedPrio);
-
- var global_libc = _emscripten_get_global_libc();
- var global_locale = global_libc + 40;
- Atomics.store(HEAPU32, (pthread.threadInfoStruct + 188) >> 2, global_locale);
-
-
- worker.pthread = pthread;
-
- // Ask the worker to start executing its pthread entry point function.
- worker.postMessage({
- cmd: 'run',
- start_routine: threadParams.startRoutine,
- arg: threadParams.arg,
- threadInfoStruct: threadParams.pthread_ptr,
- selfThreadId: threadParams.pthread_ptr, // TODO: Remove this since thread ID is now the same as the thread address.
- parentThreadId: threadParams.parent_pthread_ptr,
- stackBase: threadParams.stackBase,
- stackSize: threadParams.stackSize,
- }, threadParams.transferList);
- }
-
- function _pthread_getschedparam(thread, policy, schedparam) {
- if (!policy && !schedparam) return ERRNO_CODES.EINVAL;
-
- if (!thread) {
- Module['printErr']('pthread_getschedparam called with a null thread pointer!');
- return ERRNO_CODES.ESRCH;
- }
- var self = HEAP32[(((thread)+(24))>>2)];
- if (self != thread) {
- Module['printErr']('pthread_getschedparam attempted on thread ' + thread + ', which does not point to a valid thread, or does not exist anymore!');
- return ERRNO_CODES.ESRCH;
- }
-
- var schedPolicy = Atomics.load(HEAPU32, (thread + 120 + 20 ) >> 2);
- var schedPrio = Atomics.load(HEAPU32, (thread + 120 + 24 ) >> 2);
-
- if (policy) HEAP32[((policy)>>2)]=schedPolicy;
- if (schedparam) HEAP32[((schedparam)>>2)]=schedPrio;
- return 0;
- }
-
- function _pthread_self() {
- return __pthread_ptr|0;
- }function _pthread_create(pthread_ptr, attr, start_routine, arg) {
- if (typeof SharedArrayBuffer === 'undefined') {
- Module['printErr']('Current environment does not support SharedArrayBuffer, pthreads are not available!');
- return 11;
- }
- if (!pthread_ptr) {
- Module['printErr']('pthread_create called with a null thread pointer!');
- return 22;
- }
-
- var transferList = []; // List of JS objects that will transfer ownership to the Worker hosting the thread
-
-
- // Synchronously proxy the thread creation to main thread if possible. If we need to transfer ownership of objects, then
- // proxy asynchronously via postMessage.
- if (ENVIRONMENT_IS_PTHREAD && transferList.length == 0) {
- return _emscripten_sync_run_in_main_thread_4(137, pthread_ptr, attr, start_routine, arg);
- }
-
- var stackSize = 0;
- var stackBase = 0;
- var detached = 0; // Default thread attr is PTHREAD_CREATE_JOINABLE, i.e. start as not detached.
- var schedPolicy = 0; /*SCHED_OTHER*/
- var schedPrio = 0;
- if (attr) {
- stackSize = HEAP32[((attr)>>2)];
- stackBase = HEAP32[(((attr)+(8))>>2)];
- detached = HEAP32[(((attr)+(12))>>2)] != 0/*PTHREAD_CREATE_JOINABLE*/;
- var inheritSched = HEAP32[(((attr)+(16))>>2)] == 0/*PTHREAD_INHERIT_SCHED*/;
- if (inheritSched) {
- var prevSchedPolicy = HEAP32[(((attr)+(20))>>2)];
- var prevSchedPrio = HEAP32[(((attr)+(24))>>2)];
- _pthread_getschedparam(_pthread_self(), attr + 20, attr + 24);
- schedPolicy = HEAP32[(((attr)+(20))>>2)];
- schedPrio = HEAP32[(((attr)+(24))>>2)];
- HEAP32[(((attr)+(20))>>2)]=prevSchedPolicy;
- HEAP32[(((attr)+(24))>>2)]=prevSchedPrio;
- } else {
- schedPolicy = HEAP32[(((attr)+(20))>>2)];
- schedPrio = HEAP32[(((attr)+(24))>>2)];
- }
- }
- stackSize += 81920 /*DEFAULT_STACK_SIZE*/;
- var allocatedOwnStack = stackBase == 0; // If allocatedOwnStack == true, then the pthread impl maintains the stack allocation.
- if (allocatedOwnStack) {
- stackBase = _malloc(stackSize); // Allocate a stack if the user doesn't want to place the stack in a custom memory area.
- } else {
- // Musl stores the stack base address assuming stack grows downwards, so adjust it to Emscripten convention that the
- // stack grows upwards instead.
- stackBase -= stackSize;
- assert(stackBase > 0);
- }
-
- // Allocate thread block (pthread_t structure).
- var threadInfoStruct = _malloc(244);
- for (var i = 0; i < 244 >> 2; ++i) HEAPU32[(threadInfoStruct>>2) + i] = 0; // zero-initialize thread structure.
- HEAP32[((pthread_ptr)>>2)]=threadInfoStruct;
-
- // The pthread struct has a field that points to itself - this is used as a magic ID to detect whether the pthread_t
- // structure is 'alive'.
- HEAP32[(((threadInfoStruct)+(24))>>2)]=threadInfoStruct;
-
- // pthread struct robust_list head should point to itself.
- var headPtr = threadInfoStruct + 168;
- HEAP32[((headPtr)>>2)]=headPtr;
-
- var threadParams = {
- stackBase: stackBase,
- stackSize: stackSize,
- allocatedOwnStack: allocatedOwnStack,
- schedPolicy: schedPolicy,
- schedPrio: schedPrio,
- detached: detached,
- startRoutine: start_routine,
- pthread_ptr: threadInfoStruct,
- parent_pthread_ptr: _pthread_self(),
- arg: arg,
- transferList: transferList
- };
-
- if (ENVIRONMENT_IS_PTHREAD) {
- // The prepopulated pool of web workers that can host pthreads is stored in the main JS thread. Therefore if a
- // pthread is attempting to spawn a new thread, the thread creation must be deferred to the main JS thread.
- threadParams.cmd = 'spawnThread';
- postMessage(threadParams, transferList);
- } else {
- // We are the main thread, so we have the pthread warmup pool in this thread and can fire off JS thread creation
- // directly ourselves.
- __spawn_thread(threadParams);
- }
-
- return 0;
- }
- function _emscripten_glDrawArrays(mode, first, count) {
-
- GLctx.drawArrays(mode, first, count);
-
- }
- function _emscripten_glGenBuffers(n, buffers) {
- for (var i = 0; i < n; i++) {
- var buffer = GLctx.createBuffer();
- if (!buffer) {
- GL.recordError(0x0502 /* GL_INVALID_OPERATION */);
- while(i < n) HEAP32[(((buffers)+(i++*4))>>2)]=0;
- return;
- }
- var id = GL.getNewId(GL.buffers);
- buffer.name = id;
- GL.buffers[id] = buffer;
- HEAP32[(((buffers)+(i*4))>>2)]=id;
- }
- }
- function _emscripten_glClearDepth(x0) { GLctx['clearDepth'](x0) }
- function _emscripten_set_keypress_callback(target, userData, useCapture, callbackfunc) {
- JSEvents.registerKeyEventCallback(target, userData, useCapture, callbackfunc, 1, "keypress");
- return 0;
- }
- function _glfwSetCharCallback(winid, cbfun) {
- GLFW.setCharCallback(winid, cbfun);
- }
- function _glfwGetKey(winid, key) {
- return GLFW.getKey(winid, key);
- }
- function _emscripten_glGetUniformLocation(program, name) {
- name = Pointer_stringify(name);
-
- var arrayOffset = 0;
- // If user passed an array accessor "[index]", parse the array index off the accessor.
- if (name.indexOf(']', name.length-1) !== -1) {
- var ls = name.lastIndexOf('[');
- var arrayIndex = name.slice(ls+1, -1);
- if (arrayIndex.length > 0) {
- arrayOffset = parseInt(arrayIndex);
- if (arrayOffset < 0) {
- return -1;
- }
- }
- name = name.slice(0, ls);
- }
-
- var ptable = GL.programInfos[program];
- if (!ptable) {
- return -1;
- }
- var utable = ptable.uniforms;
- var uniformInfo = utable[name]; // returns pair [ dimension_of_uniform_array, uniform_location ]
- 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.
- return uniformInfo[1]+arrayOffset;
- } else {
- return -1;
- }
- }
- function _glBindBuffer(target, buffer) {
- var bufferObj = buffer ? GL.buffers[buffer] : null;
-
-
- GLctx.bindBuffer(target, bufferObj);
- }
-
- function _emscripten_set_current_thread_status_js(newStatus) {
- }
- Module["_emscripten_set_current_thread_status"] = _emscripten_set_current_thread_status;
- function _emscripten_glVertexAttrib4fv(index, v) {
-
- GLctx.vertexAttrib4f(index, HEAPF32[v>>2], HEAPF32[v+4>>2], HEAPF32[v+8>>2], HEAPF32[v+12>>2]);
- }
- function _emscripten_glScissor(x0, x1, x2, x3) { GLctx['scissor'](x0, x1, x2, x3) }
- function _glfwSetCursorEnterCallback(winid, cbfun) {
- var win = GLFW.WindowFromId(winid);
- if (!win) return;
- win.cursorEnterFunc = cbfun;
- }
-
- Module["_bitshift64Lshr"] = _bitshift64Lshr;
- function _confstr(name, buf, len) {
- if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_3(68, name, buf, len);
- // size_t confstr(int name, char *buf, size_t len);
- // http://pubs.opengroup.org/onlinepubs/000095399/functions/confstr.html
- var value;
- switch (name) {
- case 0:
- value = ENV['PATH'] || '/';
- break;
- case 1:
- // Mimicking glibc.
- value = 'POSIX_V6_ILP32_OFF32\nPOSIX_V6_ILP32_OFFBIG';
- break;
- case 2:
- // This JS implementation was tested against this glibc version.
- value = 'glibc 2.14';
- break;
- case 3:
- // We don't support pthreads.
- value = '';
- break;
- case 1118:
- case 1122:
- case 1124:
- case 1125:
- case 1126:
- case 1128:
- case 1129:
- case 1130:
- value = '';
- break;
- case 1116:
- case 1117:
- case 1121:
- value = '-m32';
- break;
- case 1120:
- value = '-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64';
- break;
- default:
- ___setErrNo(ERRNO_CODES.EINVAL);
- return 0;
- }
- if (len == 0 || buf == 0) {
- return value.length + 1;
- } else {
- var length = Math.min(len, value.length);
- for (var i = 0; i < length; i++) {
- HEAP8[(((buf)+(i))>>0)]=value.charCodeAt(i);
- }
- if (len > length) HEAP8[(((buf)+(i++))>>0)]=0;
- return i;
- }
- }
- function _glBufferData(target, size, data, usage) {
- if (!data) {
- GLctx.bufferData(target, size, usage);
- } else {
- GLctx.bufferData(target, HEAPU8.subarray(data, data+size), usage);
- }
- }
- function _emscripten_glIsShader(shader) {
- var s = GL.shaders[shader];
- if (!s) return 0;
- return GLctx.isShader(s);
- }
- function _getenv(name) {
- if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_1(111, name);
- // char *getenv(const char *name);
- // http://pubs.opengroup.org/onlinepubs/009695399/functions/getenv.html
- if (name === 0) return 0;
- name = Pointer_stringify(name);
- if (!ENV.hasOwnProperty(name)) return 0;
-
- if (_getenv.ret) _free(_getenv.ret);
- _getenv.ret = allocate(intArrayFromString(ENV[name]), 'i8', ALLOC_NORMAL);
- return _getenv.ret;
- }
-
- function _emscripten_conditional_set_current_thread_status_js(expectedStatus, newStatus) {
- }
- Module["_emscripten_conditional_set_current_thread_status"] = _emscripten_conditional_set_current_thread_status;
- function _emscripten_glDrawBuffers(n, bufs) {
-
- var bufArray = GL.tempFixedLengthArray[n];
- for (var i = 0; i < n; i++) {
- bufArray[i] = HEAP32[(((bufs)+(i*4))>>2)];
- }
-
- GLctx['drawBuffers'](bufArray);
- }
- function _glGetFloatv(name_, p) {
- emscriptenWebGLGet(name_, p, 'Float');
- }
- function _emscripten_glBindFramebuffer(target, framebuffer) {
- GLctx.bindFramebuffer(target, framebuffer ? GL.framebuffers[framebuffer] : null);
- }
- function _emscripten_glBlendEquation(x0) { GLctx['blendEquation'](x0) }
- function _emscripten_glBufferSubData(target, offset, size, data) {
- GLctx.bufferSubData(target, offset, HEAPU8.subarray(data, data+size));
- }
- function _emscripten_glBufferData(target, size, data, usage) {
- if (!data) {
- GLctx.bufferData(target, size, usage);
- } else {
- GLctx.bufferData(target, HEAPU8.subarray(data, data+size), usage);
- }
- }
-
- Module["_sbrk"] = _sbrk;
-
- Module["_bitshift64Shl"] = _bitshift64Shl;
- function _emscripten_glGetShaderSource(shader, bufSize, length, source) {
- var result = GLctx.getShaderSource(GL.shaders[shader]);
- if (!result) return; // If an error occurs, nothing will be written to length or source.
- if (bufSize > 0 && source) {
- var numBytesWrittenExclNull = stringToUTF8(result, source, bufSize);
- if (length) HEAP32[((length)>>2)]=numBytesWrittenExclNull;
- } else {
- if (length) HEAP32[((length)>>2)]=0;
- }
- }
-
- Module["_llvm_bswap_i32"] = _llvm_bswap_i32;
- function _glTexParameteri(x0, x1, x2) { GLctx['texParameteri'](x0, x1, x2) }
- function _glfwSetKeyCallback(winid, cbfun) {
- GLFW.setKeyCallback(winid, cbfun);
- }
- function _emscripten_set_gamepadconnected_callback(userData, useCapture, callbackfunc) {
- if (!navigator.getGamepads && !navigator.webkitGetGamepads) return -1;
- JSEvents.registerGamepadEventCallback(window, userData, useCapture, callbackfunc, 26, "gamepadconnected");
- return 0;
- }
- function _emscripten_glGetFloatv(name_, p) {
- emscriptenWebGLGet(name_, p, 'Float');
- }
- function _glTexImage2D(target, level, internalFormat, width, height, border, format, type, pixels) {
-
- var pixelData = null;
- if (pixels) pixelData = emscriptenWebGLGetTexPixelData(type, format, width, height, pixels, internalFormat);
- GLctx.texImage2D(target, level, internalFormat, width, height, border, format, type, pixelData);
- }
- function ___assert_fail(condition, filename, line, func) {
- ABORT = true;
- throw 'Assertion failed: ' + Pointer_stringify(condition) + ', at: ' + [filename ? Pointer_stringify(filename) : 'unknown filename', line, func ? Pointer_stringify(func) : 'unknown function'] + ' at ' + stackTrace();
- }
- function _emscripten_glVertexAttribDivisor(index, divisor) {
- GLctx['vertexAttribDivisor'](index, divisor);
- }
- function _emscripten_glDrawElementsInstanced(mode, count, type, indices, primcount) {
- GLctx['drawElementsInstanced'](mode, count, type, indices, primcount);
- }
- function _emscripten_glDrawElements(mode, count, type, indices) {
-
- GLctx.drawElements(mode, count, type, indices);
-
- }
- function _glfwSetMouseButtonCallback(winid, cbfun) {
- GLFW.setMouseButtonCallback(winid, cbfun);
- }
- function _emscripten_glCreateProgram() {
- var id = GL.getNewId(GL.programs);
- var program = GLctx.createProgram();
- program.name = id;
- GL.programs[id] = program;
- return id;
- }
- function _emscripten_glCompressedTexImage2D(target, level, internalFormat, width, height, border, imageSize, data) {
- GLctx['compressedTexImage2D'](target, level, internalFormat, width, height, border, data ? HEAPU8.subarray((data),(data+imageSize)) : null);
- }
- function _emscripten_glClearColor(x0, x1, x2, x3) { GLctx['clearColor'](x0, x1, x2, x3) }
- function _emscripten_glBindVertexArray(vao) {
- GLctx['bindVertexArray'](GL.vaos[vao]);
- }
- function _setenv(envname, envval, overwrite) {
- if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_3(113, envname, envval, overwrite);
- // int setenv(const char *envname, const char *envval, int overwrite);
- // http://pubs.opengroup.org/onlinepubs/009695399/functions/setenv.html
- if (envname === 0) {
- ___setErrNo(ERRNO_CODES.EINVAL);
- return -1;
- }
- var name = Pointer_stringify(envname);
- var val = Pointer_stringify(envval);
- if (name === '' || name.indexOf('=') !== -1) {
- ___setErrNo(ERRNO_CODES.EINVAL);
- return -1;
- }
- if (ENV.hasOwnProperty(name) && !overwrite) return 0;
- ENV[name] = val;
- ___buildEnvironment(ENV);
- return 0;
- }
- function _emscripten_glLoadMatrixf() {
- Module['printErr']('missing function: emscripten_glLoadMatrixf'); abort(-1);
- }
- function _glDeleteShader(id) {
- if (!id) return;
- var shader = GL.shaders[id];
- if (!shader) { // glDeleteShader actually signals an error when deleting a nonexisting object, unlike some other GL delete functions.
- GL.recordError(0x0501 /* GL_INVALID_VALUE */);
- return;
- }
- GLctx.deleteShader(shader);
- GL.shaders[id] = null;
- }
- function _emscripten_glGetProgramiv(program, pname, p) {
- if (!p) {
- // GLES2 specification does not specify how to behave if p is a null pointer. Since calling this function does not make sense
- // if p == null, issue a GL error to notify user about it.
- GL.recordError(0x0501 /* GL_INVALID_VALUE */);
- return;
- }
-
- if (program >= GL.counter) {
- GL.recordError(0x0501 /* GL_INVALID_VALUE */);
- return;
- }
-
- var ptable = GL.programInfos[program];
- if (!ptable) {
- GL.recordError(0x0502 /* GL_INVALID_OPERATION */);
- return;
- }
-
- if (pname == 0x8B84) { // GL_INFO_LOG_LENGTH
- var log = GLctx.getProgramInfoLog(GL.programs[program]);
- if (log === null) log = '(unknown error)';
- HEAP32[((p)>>2)]=log.length + 1;
- } else if (pname == 0x8B87 /* GL_ACTIVE_UNIFORM_MAX_LENGTH */) {
- HEAP32[((p)>>2)]=ptable.maxUniformLength;
- } else if (pname == 0x8B8A /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */) {
- if (ptable.maxAttributeLength == -1) {
- var program = GL.programs[program];
- var numAttribs = GLctx.getProgramParameter(program, GLctx.ACTIVE_ATTRIBUTES);
- ptable.maxAttributeLength = 0; // Spec says if there are no active attribs, 0 must be returned.
- for (var i = 0; i < numAttribs; ++i) {
- var activeAttrib = GLctx.getActiveAttrib(program, i);
- ptable.maxAttributeLength = Math.max(ptable.maxAttributeLength, activeAttrib.name.length+1);
- }
- }
- HEAP32[((p)>>2)]=ptable.maxAttributeLength;
- } else if (pname == 0x8A35 /* GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */) {
- if (ptable.maxUniformBlockNameLength == -1) {
- var program = GL.programs[program];
- var numBlocks = GLctx.getProgramParameter(program, GLctx.ACTIVE_UNIFORM_BLOCKS);
- ptable.maxUniformBlockNameLength = 0;
- for (var i = 0; i < numBlocks; ++i) {
- var activeBlockName = GLctx.getActiveUniformBlockName(program, i);
- ptable.maxUniformBlockNameLength = Math.max(ptable.maxUniformBlockNameLength, activeBlockName.length+1);
- }
- }
- HEAP32[((p)>>2)]=ptable.maxUniformBlockNameLength;
- } else {
- HEAP32[((p)>>2)]=GLctx.getProgramParameter(GL.programs[program], pname);
- }
- }
- function _emscripten_glGetProgramInfoLog(program, maxLength, length, infoLog) {
- var log = GLctx.getProgramInfoLog(GL.programs[program]);
- if (log === null) log = '(unknown error)';
-
- if (maxLength > 0 && infoLog) {
- var numBytesWrittenExclNull = stringToUTF8(log, infoLog, maxLength);
- if (length) HEAP32[((length)>>2)]=numBytesWrittenExclNull;
- } else {
- if (length) HEAP32[((length)>>2)]=0;
- }
- }
- function _emscripten_glTexImage2D(target, level, internalFormat, width, height, border, format, type, pixels) {
-
- var pixelData = null;
- if (pixels) pixelData = emscriptenWebGLGetTexPixelData(type, format, width, height, pixels, internalFormat);
- GLctx.texImage2D(target, level, internalFormat, width, height, border, format, type, pixelData);
- }
- function _glPixelStorei(pname, param) {
- if (pname == 0x0D05 /* GL_PACK_ALIGNMENT */) {
- GL.packAlignment = param;
- } else if (pname == 0x0cf5 /* GL_UNPACK_ALIGNMENT */) {
- GL.unpackAlignment = param;
- }
- GLctx.pixelStorei(pname, param);
- }
- function ___unlock() {}
- function _emscripten_glColorPointer() {
- Module['printErr']('missing function: emscripten_glColorPointer'); abort(-1);
- }
- function _glViewport(x0, x1, x2, x3) { GLctx['viewport'](x0, x1, x2, x3) }
- function _glfwDestroyWindow(winid) {
- return GLFW.destroyWindow(winid);
- }
- function _emscripten_glFlush() { GLctx['flush']() }
- function _glfwSetErrorCallback(cbfun) {
- GLFW.errorFunc = cbfun;
- }
- function _emscripten_glCreateShader(shaderType) {
- var id = GL.getNewId(GL.shaders);
- GL.shaders[id] = GLctx.createShader(shaderType);
- return id;
- }
- function _glUniformMatrix4fv(location, count, transpose, value) {
-
-
- var view;
- if (16*count <= GL.MINI_TEMP_BUFFER_SIZE) {
- // avoid allocation when uploading few enough uniforms
- view = GL.miniTempBufferViews[16*count-1];
- for (var i = 0; i < 16*count; i += 16) {
- view[i] = HEAPF32[(((value)+(4*i))>>2)];
- view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)];
- view[i+2] = HEAPF32[(((value)+(4*i+8))>>2)];
- view[i+3] = HEAPF32[(((value)+(4*i+12))>>2)];
- view[i+4] = HEAPF32[(((value)+(4*i+16))>>2)];
- view[i+5] = HEAPF32[(((value)+(4*i+20))>>2)];
- view[i+6] = HEAPF32[(((value)+(4*i+24))>>2)];
- view[i+7] = HEAPF32[(((value)+(4*i+28))>>2)];
- view[i+8] = HEAPF32[(((value)+(4*i+32))>>2)];
- view[i+9] = HEAPF32[(((value)+(4*i+36))>>2)];
- view[i+10] = HEAPF32[(((value)+(4*i+40))>>2)];
- view[i+11] = HEAPF32[(((value)+(4*i+44))>>2)];
- view[i+12] = HEAPF32[(((value)+(4*i+48))>>2)];
- view[i+13] = HEAPF32[(((value)+(4*i+52))>>2)];
- view[i+14] = HEAPF32[(((value)+(4*i+56))>>2)];
- view[i+15] = HEAPF32[(((value)+(4*i+60))>>2)];
- }
- } else {
- view = HEAPF32.subarray((value)>>2,(value+count*64)>>2);
- }
- GLctx.uniformMatrix4fv(GL.uniforms[location], !!transpose, view);
- }
- function _emscripten_glValidateProgram(program) {
- GLctx.validateProgram(GL.programs[program]);
- }
- function _emscripten_syscall(which, varargs) {
- switch (which) {
- case 54: return ___syscall54(which, varargs);
- case 6: return ___syscall6(which, varargs);
- case 140: return ___syscall140(which, varargs);
- case 146: return ___syscall146(which, varargs);
- default: throw "surprising proxied syscall: " + which;
- }
- }
- function _emscripten_set_click_callback(target, userData, useCapture, callbackfunc) {
- JSEvents.registerMouseEventCallback(target, userData, useCapture, callbackfunc, 4, "click");
- return 0;
- }
- function _glFrontFace(x0) { GLctx['frontFace'](x0) }
- function _emscripten_glColorMask(red, green, blue, alpha) {
- GLctx.colorMask(!!red, !!green, !!blue, !!alpha);
- }
- function _emscripten_glPixelStorei(pname, param) {
- if (pname == 0x0D05 /* GL_PACK_ALIGNMENT */) {
- GL.packAlignment = param;
- } else if (pname == 0x0cf5 /* GL_UNPACK_ALIGNMENT */) {
- GL.unpackAlignment = param;
- }
- GLctx.pixelStorei(pname, param);
- }
- function _emscripten_glDeleteTextures(n, textures) {
- for (var i = 0; i < n; i++) {
- var id = HEAP32[(((textures)+(i*4))>>2)];
- var texture = GL.textures[id];
- if (!texture) continue; // GL spec: "glDeleteTextures silently ignores 0s and names that do not correspond to existing textures".
- GLctx.deleteTexture(texture);
- texture.name = 0;
- GL.textures[id] = null;
- }
- }
- function _fpathconf(fildes, name) {
- if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_2(46, fildes, name);
- // long fpathconf(int fildes, int name);
- // http://pubs.opengroup.org/onlinepubs/000095399/functions/encrypt.html
- // NOTE: The first parameter is ignored, so pathconf == fpathconf.
- // The constants here aren't real values. Just mimicking glibc.
- switch (name) {
- case 0:
- return 32000;
- case 1:
- case 2:
- case 3:
- return 255;
- case 4:
- case 5:
- case 16:
- case 17:
- case 18:
- return 4096;
- case 6:
- case 7:
- case 20:
- return 1;
- case 8:
- return 0;
- case 9:
- case 10:
- case 11:
- case 12:
- case 14:
- case 15:
- case 19:
- return -1;
- case 13:
- return 64;
- }
- ___setErrNo(ERRNO_CODES.EINVAL);
- return -1;
- }
- function _putenv(string) {
- if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_1(115, string);
- // int putenv(char *string);
- // http://pubs.opengroup.org/onlinepubs/009695399/functions/putenv.html
- // WARNING: According to the standard (and the glibc implementation), the
- // string is taken by reference so future changes are reflected.
- // We copy it instead, possibly breaking some uses.
- if (string === 0) {
- ___setErrNo(ERRNO_CODES.EINVAL);
- return -1;
- }
- string = Pointer_stringify(string);
- var splitPoint = string.indexOf('=')
- if (string === '' || string.indexOf('=') === -1) {
- ___setErrNo(ERRNO_CODES.EINVAL);
- return -1;
- }
- var name = string.slice(0, splitPoint);
- var value = string.slice(splitPoint + 1);
- if (!(name in ENV) || ENV[name] !== value) {
- ENV[name] = value;
- ___buildEnvironment(ENV);
- }
- return 0;
- }
- function _emscripten_glGenVertexArrays(n, arrays) {
-
- for (var i = 0; i < n; i++) {
- var vao = GLctx['createVertexArray']();
- if (!vao) {
- GL.recordError(0x0502 /* GL_INVALID_OPERATION */);
- while(i < n) HEAP32[(((arrays)+(i++*4))>>2)]=0;
- return;
- }
- var id = GL.getNewId(GL.vaos);
- vao.name = id;
- GL.vaos[id] = vao;
- HEAP32[(((arrays)+(i*4))>>2)]=id;
- }
- }
- function _time(ptr) {
- var ret = (Date.now()/1000)|0;
- if (ptr) {
- HEAP32[((ptr)>>2)]=ret;
- }
- return ret;
- }
- function _emscripten_glGetBooleanv(name_, p) {
- emscriptenWebGLGet(name_, p, 'Boolean');
- }
- function _utimes(path, times) {
- if (ENVIRONMENT_IS_PTHREAD) return _emscripten_sync_run_in_main_thread_2(13, path, times);
- var time;
- if (times) {
- var offset = 8 + 0;
- time = HEAP32[(((times)+(offset))>>2)] * 1000;
- offset = 8 + 4;
- time += HEAP32[(((times)+(offset))>>2)] / 1000;
- } else {
- time = Date.now();
- }
- path = Pointer_stringify(path);
- try {
- FS.utime(path, time, time);
- return 0;
- } catch (e) {
- FS.handleFSError(e);
- return -1;
- }
- }
- function _emscripten_glCompileShader(shader) {
- GLctx.compileShader(GL.shaders[shader]);
- }
- var GLctx; GL.init();
- if (ENVIRONMENT_IS_NODE) {
- _emscripten_get_now = function _emscripten_get_now_actual() {
- var t = process['hrtime']();
- return t[0] * 1e3 + t[1] / 1e6;
- };
- } else if (typeof dateNow !== 'undefined') {
- _emscripten_get_now = dateNow;
- } else if (typeof self === 'object' && self['performance'] && typeof self['performance']['now'] === 'function') {
- _emscripten_get_now = function() { return self['performance']['now'](); };
- } else if (typeof performance === 'object' && typeof performance['now'] === 'function') {
- _emscripten_get_now = function() { return performance['now'](); };
- } else {
- _emscripten_get_now = Date.now;
- };
- 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) };
- Module["requestFullscreen"] = function Module_requestFullscreen(lockPointer, resizeCanvas, vrDevice) { Browser.requestFullscreen(lockPointer, resizeCanvas, vrDevice) };
- Module["requestAnimationFrame"] = function Module_requestAnimationFrame(func) { Browser.requestAnimationFrame(func) };
- Module["setCanvasSize"] = function Module_setCanvasSize(width, height, noUpdates) { Browser.setCanvasSize(width, height, noUpdates) };
- Module["pauseMainLoop"] = function Module_pauseMainLoop() { Browser.mainLoop.pause() };
- Module["resumeMainLoop"] = function Module_resumeMainLoop() { Browser.mainLoop.resume() };
- Module["getUserMedia"] = function Module_getUserMedia() { Browser.getUserMedia() }
- Module["createContext"] = function Module_createContext(canvas, useWebGL, setInModule, webGLContextAttributes) { return Browser.createContext(canvas, useWebGL, setInModule, webGLContextAttributes) };
- 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;;
- __ATINIT__.unshift(function() { TTY.init() });__ATEXIT__.push(function() { TTY.shutdown() });;
- if (ENVIRONMENT_IS_NODE) { var fs = require("fs"); var NODEJS_PATH = require("path"); NODEFS.staticInit(); };
- JSEvents.staticInit();;
- if (!ENVIRONMENT_IS_PTHREAD) PThread.initMainThreadBlock();;
- if (!ENVIRONMENT_IS_PTHREAD) ___buildEnvironment(ENV);;
- if (!ENVIRONMENT_IS_PTHREAD) {
- // Only main thread initializes these, pthreads copy them over at thread worker init time (in pthread-main.js)
- DYNAMICTOP_PTR = allocate(1, "i32", ALLOC_STATIC);
- STACK_BASE = STACKTOP = Runtime.alignMemory(STATICTOP);
- STACK_MAX = STACK_BASE + TOTAL_STACK;
- DYNAMIC_BASE = Runtime.alignMemory(STACK_MAX);
- HEAP32[DYNAMICTOP_PTR>>2] = DYNAMIC_BASE;
- staticSealed = true; // seal the static portion of memory
- assert(DYNAMIC_BASE < TOTAL_MEMORY, "TOTAL_MEMORY not big enough for stack");
- }
- 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) }
- 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) }
- 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) }
- 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) }
- 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) }
- 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) }
- 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) }
- 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) }
- 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) }
- 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) }
- 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) }
- 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) }
- 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) }
- 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) }
- 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) }
- 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) }
- 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) }
- 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) }
- 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) }
- 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) }
- 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) }
- 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) }
- 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) }
- 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) }
- function invoke_viiiii(index,a1,a2,a3,a4,a5) {
- try {
- Module["dynCall_viiiii"](index,a1,a2,a3,a4,a5);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_vd(index,a1) {
- try {
- Module["dynCall_vd"](index,a1);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_vid(index,a1,a2) {
- try {
- Module["dynCall_vid"](index,a1,a2);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_vi(index,a1) {
- try {
- Module["dynCall_vi"](index,a1);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_vii(index,a1,a2) {
- try {
- Module["dynCall_vii"](index,a1,a2);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_ii(index,a1) {
- try {
- return Module["dynCall_ii"](index,a1);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_viddd(index,a1,a2,a3,a4) {
- try {
- Module["dynCall_viddd"](index,a1,a2,a3,a4);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_vidd(index,a1,a2,a3) {
- try {
- Module["dynCall_vidd"](index,a1,a2,a3);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_iiii(index,a1,a2,a3) {
- try {
- return Module["dynCall_iiii"](index,a1,a2,a3);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8) {
- try {
- Module["dynCall_viiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6) {
- try {
- Module["dynCall_viiiiii"](index,a1,a2,a3,a4,a5,a6);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_viii(index,a1,a2,a3) {
- try {
- Module["dynCall_viii"](index,a1,a2,a3);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_vidddd(index,a1,a2,a3,a4,a5) {
- try {
- Module["dynCall_vidddd"](index,a1,a2,a3,a4,a5);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_vdi(index,a1,a2) {
- try {
- Module["dynCall_vdi"](index,a1,a2);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7) {
- try {
- Module["dynCall_viiiiiii"](index,a1,a2,a3,a4,a5,a6,a7);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9) {
- try {
- Module["dynCall_viiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_iii(index,a1,a2) {
- try {
- return Module["dynCall_iii"](index,a1,a2);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_i(index) {
- try {
- return Module["dynCall_i"](index);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_vdddddd(index,a1,a2,a3,a4,a5,a6) {
- try {
- Module["dynCall_vdddddd"](index,a1,a2,a3,a4,a5,a6);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_vdddd(index,a1,a2,a3,a4) {
- try {
- Module["dynCall_vdddd"](index,a1,a2,a3,a4);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_vdd(index,a1,a2) {
- try {
- Module["dynCall_vdd"](index,a1,a2);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_v(index) {
- try {
- Module["dynCall_v"](index);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_viid(index,a1,a2,a3) {
- try {
- Module["dynCall_viid"](index,a1,a2,a3);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- function invoke_viiii(index,a1,a2,a3,a4) {
- try {
- Module["dynCall_viiii"](index,a1,a2,a3,a4);
- } catch(e) {
- if (typeof e !== 'number' && e !== 'longjmp') throw e;
- Module["setThrew"](1, 0);
- }
- }
- Module.asmGlobalArg = { "Math": Math, "Int8Array": Int8Array, "Int16Array": Int16Array, "Int32Array": Int32Array, "Uint8Array": Uint8Array, "Uint16Array": Uint16Array, "Uint32Array": Uint32Array, "Float32Array": Float32Array, "Float64Array": Float64Array, "NaN": NaN, "Infinity": Infinity };
- Module.asmGlobalArg['Atomics'] = Atomics;
- 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_glReadPixels": _emscripten_glReadPixels, "_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_glUniform3f": _emscripten_glUniform3f, "_emscripten_glUniform3i": _emscripten_glUniform3i, "_emscripten_glGenRenderbuffers": _emscripten_glGenRenderbuffers, "_emscripten_glRotatef": _emscripten_glRotatef, "_emscripten_glDeleteShader": _emscripten_glDeleteShader, "_glEnable": _glEnable, "_emscripten_glGetShaderiv": _emscripten_glGetShaderiv, "_glGenTextures": _glGenTextures, "_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_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, "_glfwGetKey": _glfwGetKey, "_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, "_emscripten_glFrustum": _emscripten_glFrustum, "_emscripten_glDisable": _emscripten_glDisable, "_emscripten_glDepthRangef": _emscripten_glDepthRangef, "__exit": __exit, "_emscripten_glLineWidth": _emscripten_glLineWidth, "_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_glBindRenderbuffer": _emscripten_glBindRenderbuffer, "_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, "_emscripten_glBufferData": _emscripten_glBufferData, "_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 };
- // EMSCRIPTEN_START_ASM
- var asm = (function(global, env, buffer) {
- 'use asm';
-
-
- var HEAP8 = new global.Int8Array(buffer);
- var HEAP16 = new global.Int16Array(buffer);
- var HEAP32 = new global.Int32Array(buffer);
- var HEAPU8 = new global.Uint8Array(buffer);
- var HEAPU16 = new global.Uint16Array(buffer);
- var HEAPU32 = new global.Uint32Array(buffer);
- var HEAPF32 = new global.Float32Array(buffer);
- var HEAPF64 = new global.Float64Array(buffer);
- var DYNAMICTOP_PTR=env.DYNAMICTOP_PTR|0;
- var tempDoublePtr=env.tempDoublePtr|0;
- var ABORT=env.ABORT|0;
- var STACKTOP=env.STACKTOP|0;
- var STACK_MAX=env.STACK_MAX|0;
- var cttz_i8=env.cttz_i8|0;
- var __THREW__ = 0;
- var threwValue = 0;
- var setjmpId = 0;
- var undef = 0;
- var nan = global.NaN, inf = global.Infinity;
- var tempInt = 0, tempBigInt = 0, tempBigIntP = 0, tempBigIntS = 0, tempBigIntR = 0.0, tempBigIntI = 0, tempBigIntD = 0, tempValue = 0, tempDouble = 0.0;
- var tempRet0 = 0;
- var Math_floor=global.Math.floor;
- var Math_abs=global.Math.abs;
- var Math_sqrt=global.Math.sqrt;
- var Math_pow=global.Math.pow;
- var Math_cos=global.Math.cos;
- var Math_sin=global.Math.sin;
- var Math_tan=global.Math.tan;
- var Math_acos=global.Math.acos;
- var Math_asin=global.Math.asin;
- var Math_atan=global.Math.atan;
- var Math_atan2=global.Math.atan2;
- var Math_exp=global.Math.exp;
- var Math_log=global.Math.log;
- var Math_ceil=global.Math.ceil;
- var Math_imul=global.Math.imul;
- var Math_min=global.Math.min;
- var Math_max=global.Math.max;
- var Math_clz32=global.Math.clz32;
- var abort=env.abort;
- var assert=env.assert;
- var enlargeMemory=env.enlargeMemory;
- var getTotalMemory=env.getTotalMemory;
- var abortOnCannotGrowMemory=env.abortOnCannotGrowMemory;
- var abortStackOverflow=env.abortStackOverflow;
- var nullFunc_viiiii=env.nullFunc_viiiii;
- var nullFunc_vd=env.nullFunc_vd;
- var nullFunc_vid=env.nullFunc_vid;
- var nullFunc_vi=env.nullFunc_vi;
- var nullFunc_vii=env.nullFunc_vii;
- var nullFunc_ii=env.nullFunc_ii;
- var nullFunc_viddd=env.nullFunc_viddd;
- var nullFunc_vidd=env.nullFunc_vidd;
- var nullFunc_iiii=env.nullFunc_iiii;
- var nullFunc_viiiiiiii=env.nullFunc_viiiiiiii;
- var nullFunc_viiiiii=env.nullFunc_viiiiii;
- var nullFunc_viii=env.nullFunc_viii;
- var nullFunc_vidddd=env.nullFunc_vidddd;
- var nullFunc_vdi=env.nullFunc_vdi;
- var nullFunc_viiiiiii=env.nullFunc_viiiiiii;
- var nullFunc_viiiiiiiii=env.nullFunc_viiiiiiiii;
- var nullFunc_iii=env.nullFunc_iii;
- var nullFunc_i=env.nullFunc_i;
- var nullFunc_vdddddd=env.nullFunc_vdddddd;
- var nullFunc_vdddd=env.nullFunc_vdddd;
- var nullFunc_vdd=env.nullFunc_vdd;
- var nullFunc_v=env.nullFunc_v;
- var nullFunc_viid=env.nullFunc_viid;
- var nullFunc_viiii=env.nullFunc_viiii;
- var invoke_viiiii=env.invoke_viiiii;
- var invoke_vd=env.invoke_vd;
- var invoke_vid=env.invoke_vid;
- var invoke_vi=env.invoke_vi;
- var invoke_vii=env.invoke_vii;
- var invoke_ii=env.invoke_ii;
- var invoke_viddd=env.invoke_viddd;
- var invoke_vidd=env.invoke_vidd;
- var invoke_iiii=env.invoke_iiii;
- var invoke_viiiiiiii=env.invoke_viiiiiiii;
- var invoke_viiiiii=env.invoke_viiiiii;
- var invoke_viii=env.invoke_viii;
- var invoke_vidddd=env.invoke_vidddd;
- var invoke_vdi=env.invoke_vdi;
- var invoke_viiiiiii=env.invoke_viiiiiii;
- var invoke_viiiiiiiii=env.invoke_viiiiiiiii;
- var invoke_iii=env.invoke_iii;
- var invoke_i=env.invoke_i;
- var invoke_vdddddd=env.invoke_vdddddd;
- var invoke_vdddd=env.invoke_vdddd;
- var invoke_vdd=env.invoke_vdd;
- var invoke_v=env.invoke_v;
- var invoke_viid=env.invoke_viid;
- var invoke_viiii=env.invoke_viiii;
- var _emscripten_glGetTexParameterfv=env._emscripten_glGetTexParameterfv;
- var _glUseProgram=env._glUseProgram;
- var _glfwCreateWindow=env._glfwCreateWindow;
- var _emscripten_glReleaseShaderCompiler=env._emscripten_glReleaseShaderCompiler;
- var _emscripten_glBlendFuncSeparate=env._emscripten_glBlendFuncSeparate;
- var _emscripten_glVertexAttribPointer=env._emscripten_glVertexAttribPointer;
- var _emscripten_glGetIntegerv=env._emscripten_glGetIntegerv;
- var _emscripten_glCullFace=env._emscripten_glCullFace;
- var _emscripten_glIsProgram=env._emscripten_glIsProgram;
- var _emscripten_glStencilMaskSeparate=env._emscripten_glStencilMaskSeparate;
- var _emscripten_glViewport=env._emscripten_glViewport;
- var _emscripten_glFrontFace=env._emscripten_glFrontFace;
- var ___assert_fail=env.___assert_fail;
- var _glDeleteProgram=env._glDeleteProgram;
- var _emscripten_glUniform3fv=env._emscripten_glUniform3fv;
- var _emscripten_glPolygonOffset=env._emscripten_glPolygonOffset;
- var _emscripten_glUseProgram=env._emscripten_glUseProgram;
- var _emscripten_glBlendColor=env._emscripten_glBlendColor;
- var _glBindBuffer=env._glBindBuffer;
- var _emscripten_glDepthFunc=env._emscripten_glDepthFunc;
- var _glGetShaderInfoLog=env._glGetShaderInfoLog;
- var _clock_gettime=env._clock_gettime;
- var _emscripten_set_fullscreenchange_callback=env._emscripten_set_fullscreenchange_callback;
- var _emscripten_set_touchmove_callback=env._emscripten_set_touchmove_callback;
- var _emscripten_set_main_loop_timing=env._emscripten_set_main_loop_timing;
- var _glDisable=env._glDisable;
- var _glBlendFunc=env._glBlendFunc;
- var _emscripten_glDisableVertexAttribArray=env._emscripten_glDisableVertexAttribArray;
- var _glGetAttribLocation=env._glGetAttribLocation;
- var _glDisableVertexAttribArray=env._glDisableVertexAttribArray;
- var _glCreateShader=env._glCreateShader;
- var _emscripten_glReadPixels=env._emscripten_glReadPixels;
- var _emscripten_glCompileShader=env._emscripten_glCompileShader;
- var _sysconf=env._sysconf;
- var _utime=env._utime;
- var _emscripten_glSampleCoverage=env._emscripten_glSampleCoverage;
- var _emscripten_glVertexPointer=env._emscripten_glVertexPointer;
- var _emscripten_set_touchstart_callback=env._emscripten_set_touchstart_callback;
- var emscriptenWebGLComputeImageSize=env.emscriptenWebGLComputeImageSize;
- var _emscripten_glGetBooleanv=env._emscripten_glGetBooleanv;
- var _emscripten_glGetShaderSource=env._emscripten_glGetShaderSource;
- var _chroot=env._chroot;
- var _glUniform4f=env._glUniform4f;
- var _llvm_stacksave=env._llvm_stacksave;
- var _emscripten_glUniform1i=env._emscripten_glUniform1i;
- var _emscripten_glLoadMatrixf=env._emscripten_glLoadMatrixf;
- var _emscripten_glGenBuffers=env._emscripten_glGenBuffers;
- var _emscripten_glDeleteObjectARB=env._emscripten_glDeleteObjectARB;
- var _glfwSetWindowSizeCallback=env._glfwSetWindowSizeCallback;
- var _emscripten_glGetShaderPrecisionFormat=env._emscripten_glGetShaderPrecisionFormat;
- var _glfwInit=env._glfwInit;
- var _glGenBuffers=env._glGenBuffers;
- var _glShaderSource=env._glShaderSource;
- var _emscripten_glGetString=env._emscripten_glGetString;
- var _emscripten_glIsFramebuffer=env._emscripten_glIsFramebuffer;
- var _emscripten_glIsEnabled=env._emscripten_glIsEnabled;
- var _emscripten_glScissor=env._emscripten_glScissor;
- var __pthread_testcancel_js=env.__pthread_testcancel_js;
- var _emscripten_glVertexAttrib4fv=env._emscripten_glVertexAttrib4fv;
- var _emscripten_glFramebufferTexture2D=env._emscripten_glFramebufferTexture2D;
- var _emscripten_glTexParameteriv=env._emscripten_glTexParameteriv;
- var _unsetenv=env._unsetenv;
- var _emscripten_glBindProgramARB=env._emscripten_glBindProgramARB;
- var _emscripten_glStencilOpSeparate=env._emscripten_glStencilOpSeparate;
- var _emscripten_glFramebufferRenderbuffer=env._emscripten_glFramebufferRenderbuffer;
- var ___syscall140=env.___syscall140;
- var _glfwSetErrorCallback=env._glfwSetErrorCallback;
- var _glfwDefaultWindowHints=env._glfwDefaultWindowHints;
- var _glfwDestroyWindow=env._glfwDestroyWindow;
- var ___syscall146=env.___syscall146;
- var _emscripten_glGetActiveAttrib=env._emscripten_glGetActiveAttrib;
- var _emscripten_glAttachShader=env._emscripten_glAttachShader;
- var _emscripten_get_now_is_monotonic=env._emscripten_get_now_is_monotonic;
- var _emscripten_glUniform2i=env._emscripten_glUniform2i;
- var _emscripten_glUniform2f=env._emscripten_glUniform2f;
- var _emscripten_glTexParameterfv=env._emscripten_glTexParameterfv;
- var _emscripten_glIsBuffer=env._emscripten_glIsBuffer;
- var _emscripten_glUniformMatrix2fv=env._emscripten_glUniformMatrix2fv;
- var _glGetProgramInfoLog=env._glGetProgramInfoLog;
- var _glfwSetScrollCallback=env._glfwSetScrollCallback;
- var _emscripten_glTexParameterf=env._emscripten_glTexParameterf;
- var _emscripten_glGetAttachedShaders=env._emscripten_glGetAttachedShaders;
- var _emscripten_glGenTextures=env._emscripten_glGenTextures;
- var _emscripten_glTexParameteri=env._emscripten_glTexParameteri;
- var _llvm_stackrestore=env._llvm_stackrestore;
- var _glfwMakeContextCurrent=env._glfwMakeContextCurrent;
- var _emscripten_glClear=env._emscripten_glClear;
- var _glDrawElements=env._glDrawElements;
- var _glBufferSubData=env._glBufferSubData;
- var _emscripten_glValidateProgram=env._emscripten_glValidateProgram;
- var _emscripten_glVertexAttrib2fv=env._emscripten_glVertexAttrib2fv;
- var _glViewport=env._glViewport;
- var _emscripten_glUniform4iv=env._emscripten_glUniform4iv;
- var _emscripten_glGetTexParameteriv=env._emscripten_glGetTexParameteriv;
- var ___setErrNo=env.___setErrNo;
- var _eglGetProcAddress=env._eglGetProcAddress;
- var _emscripten_glBindAttribLocation=env._emscripten_glBindAttribLocation;
- var _glDeleteTextures=env._glDeleteTextures;
- var _glDepthFunc=env._glDepthFunc;
- var _emscripten_glClientActiveTexture=env._emscripten_glClientActiveTexture;
- var _emscripten_glVertexAttrib2f=env._emscripten_glVertexAttrib2f;
- var _emscripten_asm_const_v=env._emscripten_asm_const_v;
- var _emscripten_glFlush=env._emscripten_glFlush;
- var _emscripten_glBlendFunc=env._emscripten_glBlendFunc;
- var _emscripten_glCheckFramebufferStatus=env._emscripten_glCheckFramebufferStatus;
- var _emscripten_glGenerateMipmap=env._emscripten_glGenerateMipmap;
- var _emscripten_glGetError=env._emscripten_glGetError;
- var _emscripten_glClearDepthf=env._emscripten_glClearDepthf;
- var _pthread_self=env._pthread_self;
- var _emscripten_glUniform3f=env._emscripten_glUniform3f;
- var _emscripten_glUniform3i=env._emscripten_glUniform3i;
- var _emscripten_glGenRenderbuffers=env._emscripten_glGenRenderbuffers;
- var _emscripten_glRotatef=env._emscripten_glRotatef;
- var _emscripten_glDeleteShader=env._emscripten_glDeleteShader;
- var _glEnable=env._glEnable;
- var _emscripten_glGetShaderiv=env._emscripten_glGetShaderiv;
- var _glGenTextures=env._glGenTextures;
- var _emscripten_glMatrixMode=env._emscripten_glMatrixMode;
- var _glGetString=env._glGetString;
- var _emscripten_glClearStencil=env._emscripten_glClearStencil;
- var _emscripten_glGetUniformLocation=env._emscripten_glGetUniformLocation;
- var emscriptenWebGLGet=env.emscriptenWebGLGet;
- var _emscripten_glEnableVertexAttribArray=env._emscripten_glEnableVertexAttribArray;
- var __register_pthread_ptr=env.__register_pthread_ptr;
- var _emscripten_get_now=env._emscripten_get_now;
- var _emscripten_glNormalPointer=env._emscripten_glNormalPointer;
- var _glAttachShader=env._glAttachShader;
- var _emscripten_glTexCoordPointer=env._emscripten_glTexCoordPointer;
- var _emscripten_glEnable=env._emscripten_glEnable;
- var _glCreateProgram=env._glCreateProgram;
- var _glUniformMatrix4fv=env._glUniformMatrix4fv;
- var _emscripten_glClearDepth=env._emscripten_glClearDepth;
- var ___lock=env.___lock;
- var emscriptenWebGLGetTexPixelData=env.emscriptenWebGLGetTexPixelData;
- var ___syscall6=env.___syscall6;
- var _emscripten_glStencilFuncSeparate=env._emscripten_glStencilFuncSeparate;
- var _emscripten_glVertexAttrib3f=env._emscripten_glVertexAttrib3f;
- var _time=env._time;
- var _gettimeofday=env._gettimeofday;
- var _emscripten_glVertexAttrib1f=env._emscripten_glVertexAttrib1f;
- var _emscripten_glGetFramebufferAttachmentParameteriv=env._emscripten_glGetFramebufferAttachmentParameteriv;
- var _emscripten_glBlendEquationSeparate=env._emscripten_glBlendEquationSeparate;
- var _exit=env._exit;
- var _emscripten_glEnableClientState=env._emscripten_glEnableClientState;
- var __spawn_thread=env.__spawn_thread;
- var _emscripten_glUniform4i=env._emscripten_glUniform4i;
- var _emscripten_conditional_set_current_thread_status_js=env._emscripten_conditional_set_current_thread_status_js;
- var _putenv=env._putenv;
- var _pthread_join=env._pthread_join;
- var _glCullFace=env._glCullFace;
- var _emscripten_glGetPointerv=env._emscripten_glGetPointerv;
- var _emscripten_set_keypress_callback=env._emscripten_set_keypress_callback;
- var __emscripten_sample_gamepad_data=env.__emscripten_sample_gamepad_data;
- var _fpathconf=env._fpathconf;
- var _emscripten_get_gamepad_status=env._emscripten_get_gamepad_status;
- var _emscripten_glUniform4f=env._emscripten_glUniform4f;
- var _emscripten_glUniform2fv=env._emscripten_glUniform2fv;
- var _glfwGetVideoModes=env._glfwGetVideoModes;
- var ___unlock=env.___unlock;
- var _emscripten_set_click_callback=env._emscripten_set_click_callback;
- var _emscripten_is_main_runtime_thread=env._emscripten_is_main_runtime_thread;
- var _emscripten_glShaderBinary=env._emscripten_glShaderBinary;
- var _emscripten_glDrawElements=env._emscripten_glDrawElements;
- var _glVertexAttribPointer=env._glVertexAttribPointer;
- var _emscripten_get_num_gamepads=env._emscripten_get_num_gamepads;
- var ___buildEnvironment=env.___buildEnvironment;
- var _glCompressedTexImage2D=env._glCompressedTexImage2D;
- var _utimes=env._utimes;
- var _emscripten_glUniform1iv=env._emscripten_glUniform1iv;
- var _emscripten_glGetVertexAttribPointerv=env._emscripten_glGetVertexAttribPointerv;
- var _glClearDepthf=env._glClearDepthf;
- var _emscripten_glCompressedTexSubImage2D=env._emscripten_glCompressedTexSubImage2D;
- var emscriptenWebGLGetUniform=env.emscriptenWebGLGetUniform;
- var _tzset=env._tzset;
- var _emscripten_glDeleteVertexArrays=env._emscripten_glDeleteVertexArrays;
- var _glfwSetWindowShouldClose=env._glfwSetWindowShouldClose;
- var _emscripten_glUniform1fv=env._emscripten_glUniform1fv;
- var _emscripten_glGetActiveUniform=env._emscripten_glGetActiveUniform;
- var _glBindTexture=env._glBindTexture;
- var _emscripten_glUniform3iv=env._emscripten_glUniform3iv;
- var _emscripten_glUniform2iv=env._emscripten_glUniform2iv;
- var _emscripten_glHint=env._emscripten_glHint;
- var _glfwSetCharCallback=env._glfwSetCharCallback;
- var emscriptenWebGLGetVertexAttrib=env.emscriptenWebGLGetVertexAttrib;
- var _glGetFloatv=env._glGetFloatv;
- var _emscripten_glDeleteProgram=env._emscripten_glDeleteProgram;
- var _emscripten_glDeleteRenderbuffers=env._emscripten_glDeleteRenderbuffers;
- var ___clock_gettime=env.___clock_gettime;
- var _emscripten_glDrawElementsInstanced=env._emscripten_glDrawElementsInstanced;
- var _emscripten_glVertexAttrib4f=env._emscripten_glVertexAttrib4f;
- var _glDrawArrays=env._glDrawArrays;
- var _emscripten_glTexSubImage2D=env._emscripten_glTexSubImage2D;
- var _clearenv=env._clearenv;
- var _emscripten_glPixelStorei=env._emscripten_glPixelStorei;
- var _glCompileShader=env._glCompileShader;
- var _emscripten_get_pointerlock_status=env._emscripten_get_pointerlock_status;
- var _emscripten_memcpy_big=env._emscripten_memcpy_big;
- var _emscripten_glUniformMatrix3fv=env._emscripten_glUniformMatrix3fv;
- var _emscripten_glColorPointer=env._emscripten_glColorPointer;
- var _getenv=env._getenv;
- var _emscripten_glDepthRange=env._emscripten_glDepthRange;
- var _emscripten_glGetBufferParameteriv=env._emscripten_glGetBufferParameteriv;
- var _emscripten_glFinish=env._emscripten_glFinish;
- var _emscripten_glRenderbufferStorage=env._emscripten_glRenderbufferStorage;
- var _emscripten_set_gamepaddisconnected_callback=env._emscripten_set_gamepaddisconnected_callback;
- var _emscripten_asm_const_iii=env._emscripten_asm_const_iii;
- var _emscripten_glDepthMask=env._emscripten_glDepthMask;
- var _glfwSetWindowIconifyCallback=env._glfwSetWindowIconifyCallback;
- var _emscripten_glDrawBuffers=env._emscripten_glDrawBuffers;
- var _glfwTerminate=env._glfwTerminate;
- var _emscripten_futex_wake=env._emscripten_futex_wake;
- var _glFrontFace=env._glFrontFace;
- var _emscripten_glGetObjectParameterivARB=env._emscripten_glGetObjectParameterivARB;
- var _emscripten_exit_pointerlock=env._emscripten_exit_pointerlock;
- var _glfwSwapInterval=env._glfwSwapInterval;
- var _glUniform1i=env._glUniform1i;
- var _glEnableVertexAttribArray=env._glEnableVertexAttribArray;
- var _emscripten_glStencilFunc=env._emscripten_glStencilFunc;
- var _abort=env._abort;
- var _emscripten_glGetUniformiv=env._emscripten_glGetUniformiv;
- var __cleanup_thread=env.__cleanup_thread;
- var _glDeleteBuffers=env._glDeleteBuffers;
- var _glBufferData=env._glBufferData;
- var _glTexImage2D=env._glTexImage2D;
- var _emscripten_set_current_thread_status_js=env._emscripten_set_current_thread_status_js;
- var _glfwSetKeyCallback=env._glfwSetKeyCallback;
- var _emscripten_glGenFramebuffers=env._emscripten_glGenFramebuffers;
- var _emscripten_glUniformMatrix4fv=env._emscripten_glUniformMatrix4fv;
- var _emscripten_glLoadIdentity=env._emscripten_glLoadIdentity;
- var _glDeleteShader=env._glDeleteShader;
- var _emscripten_glUniform1f=env._emscripten_glUniform1f;
- var _glGetProgramiv=env._glGetProgramiv;
- var _emscripten_glBindFramebuffer=env._emscripten_glBindFramebuffer;
- var _emscripten_glIsRenderbuffer=env._emscripten_glIsRenderbuffer;
- var _glfwGetTime=env._glfwGetTime;
- var _emscripten_glShaderSource=env._emscripten_glShaderSource;
- var _emscripten_set_gamepadconnected_callback=env._emscripten_set_gamepadconnected_callback;
- var _emscripten_syscall=env._emscripten_syscall;
- var _emscripten_glGetVertexAttribiv=env._emscripten_glGetVertexAttribiv;
- var _emscripten_glBindVertexArray=env._emscripten_glBindVertexArray;
- var _emscripten_glDrawArraysInstanced=env._emscripten_glDrawArraysInstanced;
- var _emscripten_set_touchcancel_callback=env._emscripten_set_touchcancel_callback;
- var _emscripten_glCreateShader=env._emscripten_glCreateShader;
- var _emscripten_glStencilMask=env._emscripten_glStencilMask;
- var _emscripten_glDeleteTextures=env._emscripten_glDeleteTextures;
- var _glfwGetKey=env._glfwGetKey;
- var _glfwGetPrimaryMonitor=env._glfwGetPrimaryMonitor;
- var _glLinkProgram=env._glLinkProgram;
- var _emscripten_glVertexAttribDivisor=env._emscripten_glVertexAttribDivisor;
- var _emscripten_set_touchend_callback=env._emscripten_set_touchend_callback;
- var _emscripten_glGetUniformfv=env._emscripten_glGetUniformfv;
- var _emscripten_glGetVertexAttribfv=env._emscripten_glGetVertexAttribfv;
- var _emscripten_glGetRenderbufferParameteriv=env._emscripten_glGetRenderbufferParameteriv;
- var _emscripten_futex_wait=env._emscripten_futex_wait;
- var _emscripten_glDeleteFramebuffers=env._emscripten_glDeleteFramebuffers;
- var _glGetShaderiv=env._glGetShaderiv;
- var _emscripten_glVertexAttrib3fv=env._emscripten_glVertexAttrib3fv;
- var _glGetUniformLocation=env._glGetUniformLocation;
- var _emscripten_glGetInfoLogARB=env._emscripten_glGetInfoLogARB;
- var _emscripten_request_pointerlock=env._emscripten_request_pointerlock;
- var _glClear=env._glClear;
- var _emscripten_glFrustum=env._emscripten_glFrustum;
- var _emscripten_glDisable=env._emscripten_glDisable;
- var _emscripten_glDepthRangef=env._emscripten_glDepthRangef;
- var __exit=env.__exit;
- var _emscripten_glLineWidth=env._emscripten_glLineWidth;
- var _emscripten_glGetShaderInfoLog=env._emscripten_glGetShaderInfoLog;
- var _emscripten_glStencilOp=env._emscripten_glStencilOp;
- var ___pthread_setcancelstate=env.___pthread_setcancelstate;
- var _glBindAttribLocation=env._glBindAttribLocation;
- var _glPixelStorei=env._glPixelStorei;
- var _emscripten_glColorMask=env._emscripten_glColorMask;
- var _emscripten_glLinkProgram=env._emscripten_glLinkProgram;
- var _emscripten_glBlendEquation=env._emscripten_glBlendEquation;
- var _emscripten_glIsTexture=env._emscripten_glIsTexture;
- var _confstr=env._confstr;
- var _emscripten_glGetProgramiv=env._emscripten_glGetProgramiv;
- var _emscripten_glVertexAttrib1fv=env._emscripten_glVertexAttrib1fv;
- var _emscripten_glBindTexture=env._emscripten_glBindTexture;
- var _glfwSetMouseButtonCallback=env._glfwSetMouseButtonCallback;
- var _glfwGetCursorPos=env._glfwGetCursorPos;
- var _emscripten_glActiveTexture=env._emscripten_glActiveTexture;
- var _emscripten_glDrawRangeElements=env._emscripten_glDrawRangeElements;
- var ___syscall54=env.___syscall54;
- var _emscripten_glDeleteBuffers=env._emscripten_glDeleteBuffers;
- var _emscripten_glBufferSubData=env._emscripten_glBufferSubData;
- var _glfwSwapBuffers=env._glfwSwapBuffers;
- var _pthread_create=env._pthread_create;
- var _emscripten_set_main_loop=env._emscripten_set_main_loop;
- var _emscripten_glBindRenderbuffer=env._emscripten_glBindRenderbuffer;
- var _emscripten_glGetProgramInfoLog=env._emscripten_glGetProgramInfoLog;
- var _glfwWindowHint=env._glfwWindowHint;
- var _pthread_getschedparam=env._pthread_getschedparam;
- var _emscripten_glIsShader=env._emscripten_glIsShader;
- var _emscripten_glUniform4fv=env._emscripten_glUniform4fv;
- var _emscripten_glGenVertexArrays=env._emscripten_glGenVertexArrays;
- var _emscripten_glDrawArrays=env._emscripten_glDrawArrays;
- var _emscripten_glCompressedTexImage2D=env._emscripten_glCompressedTexImage2D;
- var _emscripten_glClearColor=env._emscripten_glClearColor;
- var _emscripten_glBufferData=env._emscripten_glBufferData;
- var _glfwSetCursorEnterCallback=env._glfwSetCursorEnterCallback;
- var _emscripten_glCreateProgram=env._emscripten_glCreateProgram;
- var _emscripten_glCopyTexSubImage2D=env._emscripten_glCopyTexSubImage2D;
- var _emscripten_glGetAttribLocation=env._emscripten_glGetAttribLocation;
- var _glTexParameteri=env._glTexParameteri;
- var _emscripten_glBindBuffer=env._emscripten_glBindBuffer;
- var _atexit=env._atexit;
- var _emscripten_glGetFloatv=env._emscripten_glGetFloatv;
- var _emscripten_glDetachShader=env._emscripten_glDetachShader;
- var _glClearColor=env._glClearColor;
- var _glfwSetCursorPosCallback=env._glfwSetCursorPosCallback;
- var _setenv=env._setenv;
- var _emscripten_glCopyTexImage2D=env._emscripten_glCopyTexImage2D;
- var _emscripten_glTexImage2D=env._emscripten_glTexImage2D;
- var Atomics_load=global.Atomics.load;
- var Atomics_store=global.Atomics.store;
- var Atomics_exchange=global.Atomics.exchange;
- var Atomics_compareExchange=global.Atomics.compareExchange;
- var Atomics_add=global.Atomics.add;
- var Atomics_sub=global.Atomics.sub;
- var Atomics_and=global.Atomics.and;
- var Atomics_or=global.Atomics.or;
- var Atomics_xor=global.Atomics.xor;
- var tempFloat = 0.0;
- // EMSCRIPTEN_START_FUNCS
- function stackAlloc(size) {
- size = size|0;
- var ret = 0;
- ret = STACKTOP;
- STACKTOP = (STACKTOP + size)|0;
- STACKTOP = (STACKTOP + 15)&-16;
- if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(size|0);
- return ret|0;
- }
- function stackSave() {
- return STACKTOP|0;
- }
- function stackRestore(top) {
- top = top|0;
- STACKTOP = top;
- }
- function establishStackSpace(stackBase, stackMax) {
- stackBase = stackBase|0;
- stackMax = stackMax|0;
- STACKTOP = stackBase;
- STACK_MAX = stackMax;
- }
- function setThrew(threw, value) {
- threw = threw|0;
- value = value|0;
- if ((__THREW__|0) == 0) {
- __THREW__ = threw;
- threwValue = value;
- }
- }
- function setTempRet0(value) {
- value = value|0;
- tempRet0 = value;
- }
- function getTempRet0() {
- return tempRet0|0;
- }
- function _InitPhysics() {
- var label = 0, sp = 0;
- sp = STACKTOP;
- (_pthread_create((14272|0),(0|0),(2|0),(0|0))|0);
- return;
- }
- function _PhysicsLoop($0) {
- $0 = $0|0;
- 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;
- 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;
- sp = STACKTOP;
- HEAP32[3569] = 1;
- HEAPF64[1746] = 0.0;
- _InitTimer();
- $1 = HEAP32[3569]|0;
- $2 = ($1|0)==(0);
- if (!($2)) {
- while(1) {
- $3 = (+_GetCurrentTime());
- HEAPF64[1747] = $3;
- $4 = +HEAPF64[1748];
- $5 = $3 - $4;
- HEAPF64[1749] = $5;
- $6 = +HEAPF64[1746];
- $7 = $5 + $6;
- HEAPF64[1746] = $7;
- _MathClamp();
- $$pr = +HEAPF64[1746];
- $8 = !($$pr >= 0.016666666666666666);
- if (!($8)) {
- while(1) {
- _PhysicsStep();
- $9 = +HEAPF64[1749];
- $10 = +HEAPF64[1746];
- $11 = $10 - $9;
- HEAPF64[1746] = $11;
- $12 = !($11 >= 0.016666666666666666);
- if ($12) {
- break;
- }
- }
- }
- $13 = +HEAPF64[1747];
- HEAPF64[1748] = $13;
- $14 = HEAP32[3569]|0;
- $15 = ($14|0)==(0);
- if ($15) {
- break;
- }
- }
- }
- $16 = HEAP32[3636]|0;
- $$0912 = (($16) + -1)|0;
- $17 = ($$0912|0)>(-1);
- if ($17) {
- $$0913 = $$0912;
- while(1) {
- $20 = (14548 + ($$0913<<2)|0);
- $21 = HEAP32[$20>>2]|0;
- _DestroyPhysicsManifold($21);
- $$09 = (($$0913) + -1)|0;
- $22 = ($$09|0)>(-1);
- if ($22) {
- $$0913 = $$09;
- } else {
- break;
- }
- }
- }
- $18 = HEAP32[3571]|0;
- $$010 = (($18) + -1)|0;
- $19 = ($$010|0)>(-1);
- if ($19) {
- $$011 = $$010;
- } else {
- return (0|0);
- }
- while(1) {
- $23 = (14288 + ($$011<<2)|0);
- $24 = HEAP32[$23>>2]|0;
- _DestroyPhysicsBody($24);
- $$0 = (($$011) + -1)|0;
- $25 = ($$0|0)>(-1);
- if ($25) {
- $$011 = $$0;
- } else {
- break;
- }
- }
- return (0|0);
- }
- function _CreatePhysicsBodyRectangle($0,$1,$2,$3) {
- $0 = $0|0;
- $1 = +$1;
- $2 = +$2;
- $3 = +$3;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- var $exitcond = 0, $tmpcast$byval_copy = 0, $tmpcast123$byval_copy = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 448|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(448|0);
- $tmpcast123$byval_copy = sp + 440|0;
- $tmpcast$byval_copy = sp + 432|0;
- $4 = sp + 424|0;
- $5 = sp + 16|0;
- $6 = sp + 8|0;
- $7 = sp;
- $8 = (_malloc(500)|0);
- $9 = HEAP32[3570]|0;
- $10 = (($9) + 500)|0;
- HEAP32[3570] = $10;
- $11 = HEAP32[3571]|0;
- $12 = ($11|0)==(0);
- $$0116149 = 0;
- L1: while(1) {
- if ($12) {
- $$0116149158159 = 0;
- break;
- } else {
- $$0119144 = 0;
- }
- while(1) {
- $15 = (14288 + ($$0119144<<2)|0);
- $16 = HEAP32[$15>>2]|0;
- $17 = HEAP32[$16>>2]|0;
- $18 = ($17|0)==($$0116149|0);
- $14 = (($$0119144) + 1)|0;
- if ($18) {
- break;
- }
- $13 = ($14>>>0)<($11>>>0);
- if ($13) {
- $$0119144 = $14;
- } else {
- label = 6;
- break L1;
- }
- }
- $19 = (($$0116149) + 1)|0;
- $20 = ($19|0)<(64);
- if ($20) {
- $$0116149 = $19;
- } else {
- label = 14;
- break;
- }
- }
- if ((label|0) == 14) {
- STACKTOP = sp;return ($8|0);
- }
- if ((label|0) == 6) {
- $21 = ($$0116149|0)==(-1);
- if ($21) {
- STACKTOP = sp;return ($8|0);
- } else {
- $$0116149158159 = $$0116149;
- }
- }
- HEAP32[$8>>2] = $$0116149158159;
- $22 = ((($8)) + 4|0);
- HEAP32[$22>>2] = 1;
- $23 = ((($8)) + 8|0);
- $24 = $0;
- $25 = $24;
- $26 = HEAP32[$25>>2]|0;
- $27 = (($24) + 4)|0;
- $28 = $27;
- $29 = HEAP32[$28>>2]|0;
- $30 = $23;
- $31 = $30;
- HEAP32[$31>>2] = $26;
- $32 = (($30) + 4)|0;
- $33 = $32;
- HEAP32[$33>>2] = $29;
- $$sroa$049$0$$sroa_idx = ((($8)) + 16|0);
- $34 = ((($8)) + 84|0);
- ;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;
- HEAP32[$34>>2] = 1;
- $35 = ((($8)) + 88|0);
- HEAP32[$35>>2] = $8;
- $36 = ((($8)) + 96|0);
- HEAPF32[$4>>2] = $1;
- $37 = ((($4)) + 4|0);
- HEAPF32[$37>>2] = $2;
- ;HEAP32[$tmpcast$byval_copy>>2]=HEAP32[$0>>2]|0;HEAP32[$tmpcast$byval_copy+4>>2]=HEAP32[$0+4>>2]|0;
- ;HEAP32[$tmpcast123$byval_copy>>2]=HEAP32[$4>>2]|0;HEAP32[$tmpcast123$byval_copy+4>>2]=HEAP32[$4+4>>2]|0;
- _CreateRectanglePolygon($5,$tmpcast$byval_copy,$tmpcast123$byval_copy);
- _memcpy(($36|0),($5|0),404)|0;
- $38 = HEAP32[$36>>2]|0;
- $39 = ($38|0)==(0);
- if ($39) {
- $$0121$lcssa161 = 0.0;$$0122$lcssa160 = 0.0;
- } else {
- $40 = ((($8)) + 100|0);
- $41 = ((($6)) + 4|0);
- $42 = ((($7)) + 4|0);
- $$0120136 = 0;$$0121134 = 0.0;$$0122133 = 0.0;$$sroa$0$0132 = 0.0;$$sroa$8$0135 = 0.0;
- while(1) {
- $52 = (($40) + ($$0120136<<3)|0);
- $53 = $52;
- $54 = $53;
- $55 = HEAP32[$54>>2]|0;
- $56 = (($53) + 4)|0;
- $57 = $56;
- $58 = HEAP32[$57>>2]|0;
- $59 = $6;
- $60 = $59;
- HEAP32[$60>>2] = $55;
- $61 = (($59) + 4)|0;
- $62 = $61;
- HEAP32[$62>>2] = $58;
- $63 = (($$0120136) + 1)|0;
- $64 = HEAP32[$36>>2]|0;
- $65 = ($63>>>0)<($64>>>0);
- $66 = $65 ? $63 : 0;
- $67 = (($40) + ($66<<3)|0);
- $68 = $67;
- $69 = $68;
- $70 = HEAP32[$69>>2]|0;
- $71 = (($68) + 4)|0;
- $72 = $71;
- $73 = HEAP32[$72>>2]|0;
- $74 = $7;
- $75 = $74;
- HEAP32[$75>>2] = $70;
- $76 = (($74) + 4)|0;
- $77 = $76;
- HEAP32[$77>>2] = $73;
- ;HEAP32[$tmpcast$byval_copy>>2]=HEAP32[$6>>2]|0;HEAP32[$tmpcast$byval_copy+4>>2]=HEAP32[$6+4>>2]|0;
- ;HEAP32[$tmpcast123$byval_copy>>2]=HEAP32[$7>>2]|0;HEAP32[$tmpcast123$byval_copy+4>>2]=HEAP32[$7+4>>2]|0;
- $78 = (+_MathCrossVector2($tmpcast$byval_copy,$tmpcast123$byval_copy));
- $79 = $78 * 0.5;
- $44 = $$0122133 + $79;
- $80 = $79 * 0.3333333432674408;
- $81 = +HEAPF32[$6>>2];
- $82 = +HEAPF32[$7>>2];
- $83 = $81 + $82;
- $84 = $80 * $83;
- $46 = $$sroa$0$0132 + $84;
- $85 = +HEAPF32[$41>>2];
- $86 = +HEAPF32[$42>>2];
- $87 = $85 + $86;
- $88 = $80 * $87;
- $48 = $$sroa$8$0135 + $88;
- $89 = $81 * $81;
- $90 = $81 * $82;
- $91 = $89 + $90;
- $92 = $82 * $82;
- $93 = $92 + $91;
- $94 = $85 * $85;
- $95 = $85 * $86;
- $96 = $94 + $95;
- $97 = $86 * $86;
- $98 = $97 + $96;
- $99 = $78 * 0.083333335816860198;
- $100 = $93 + $98;
- $101 = $99 * $100;
- $102 = $$0121134 + $101;
- $50 = HEAP32[$36>>2]|0;
- $103 = ($63>>>0)<($50>>>0);
- if ($103) {
- $$0120136 = $63;$$0121134 = $102;$$0122133 = $44;$$sroa$0$0132 = $46;$$sroa$8$0135 = $48;
- } else {
- break;
- }
- }
- $43 = 1.0 / $44;
- $45 = $46 * $43;
- $47 = $43 * $48;
- $49 = ($50|0)==(0);
- if ($49) {
- $$0121$lcssa161 = $102;$$0122$lcssa160 = $44;
- } else {
- $51 = ((($8)) + 100|0);
- $$0131 = 0;
- while(1) {
- $125 = (($51) + ($$0131<<3)|0);
- $126 = +HEAPF32[$125>>2];
- $127 = $126 - $45;
- HEAPF32[$125>>2] = $127;
- $128 = (((($51) + ($$0131<<3)|0)) + 4|0);
- $129 = +HEAPF32[$128>>2];
- $130 = $129 - $47;
- HEAPF32[$128>>2] = $130;
- $131 = (($$0131) + 1)|0;
- $exitcond = ($131|0)==($50|0);
- if ($exitcond) {
- $$0121$lcssa161 = $102;$$0122$lcssa160 = $44;
- break;
- } else {
- $$0131 = $131;
- }
- }
- }
- }
- $104 = $$0122$lcssa160 * $3;
- $105 = ((($8)) + 52|0);
- HEAPF32[$105>>2] = $104;
- $106 = $104 != 0.0;
- $107 = 1.0 / $104;
- $108 = $106 ? $107 : 0.0;
- $109 = ((($8)) + 56|0);
- HEAPF32[$109>>2] = $108;
- $110 = $$0121$lcssa161 * $3;
- $111 = ((($8)) + 44|0);
- HEAPF32[$111>>2] = $110;
- $112 = $110 != 0.0;
- $113 = 1.0 / $110;
- $114 = $112 ? $113 : 0.0;
- $115 = ((($8)) + 48|0);
- HEAPF32[$115>>2] = $114;
- $116 = ((($8)) + 60|0);
- HEAPF32[$116>>2] = 0.40000000596046448;
- $117 = ((($8)) + 64|0);
- HEAPF32[$117>>2] = 0.20000000298023224;
- $118 = ((($8)) + 68|0);
- HEAPF32[$118>>2] = 0.0;
- $119 = ((($8)) + 72|0);
- HEAP32[$119>>2] = 1;
- $120 = ((($8)) + 76|0);
- HEAP32[$120>>2] = 0;
- $121 = ((($8)) + 80|0);
- HEAP32[$121>>2] = 0;
- $122 = HEAP32[3571]|0;
- $123 = (14288 + ($122<<2)|0);
- HEAP32[$123>>2] = $8;
- $124 = (($122) + 1)|0;
- HEAP32[3571] = $124;
- STACKTOP = sp;return ($8|0);
- }
- function _CreateRectanglePolygon($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- 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;
- 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;
- var $55 = 0, $56 = 0, $6 = 0, $7 = 0, $8 = 0.0, $9 = 0.0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 448|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(448|0);
- $$byval_copy1 = sp + 440|0;
- $$byval_copy = sp + 432|0;
- $3 = sp + 24|0;
- $4 = sp;
- $5 = sp + 16|0;
- $6 = ((($3)) + 36|0);
- _memset(($6|0),0,368)|0;
- HEAP32[$3>>2] = 4;
- $7 = ((($3)) + 388|0);
- _Mat2Radians($4,0.0);
- ;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;
- $8 = +HEAPF32[$1>>2];
- $9 = +HEAPF32[$2>>2];
- $10 = $9 * 0.5;
- $11 = $8 + $10;
- $12 = ((($1)) + 4|0);
- $13 = +HEAPF32[$12>>2];
- $14 = ((($2)) + 4|0);
- $15 = +HEAPF32[$14>>2];
- $16 = $15 * 0.5;
- $17 = $13 - $16;
- $$sroa$021$0$$sroa_idx = ((($3)) + 4|0);
- HEAPF32[$$sroa$021$0$$sroa_idx>>2] = $11;
- $$sroa$222$0$$sroa_idx23 = ((($3)) + 8|0);
- HEAPF32[$$sroa$222$0$$sroa_idx23>>2] = $17;
- $18 = +HEAPF32[$1>>2];
- $19 = +HEAPF32[$2>>2];
- $20 = $19 * 0.5;
- $21 = $18 + $20;
- $22 = +HEAPF32[$12>>2];
- $23 = +HEAPF32[$14>>2];
- $24 = $23 * 0.5;
- $25 = $22 + $24;
- $$sroa$018$0$$sroa_idx = ((($3)) + 12|0);
- HEAPF32[$$sroa$018$0$$sroa_idx>>2] = $21;
- $$sroa$219$0$$sroa_idx20 = ((($3)) + 16|0);
- HEAPF32[$$sroa$219$0$$sroa_idx20>>2] = $25;
- $26 = +HEAPF32[$1>>2];
- $27 = +HEAPF32[$2>>2];
- $28 = $27 * 0.5;
- $29 = $26 - $28;
- $30 = +HEAPF32[$12>>2];
- $31 = +HEAPF32[$14>>2];
- $32 = $31 * 0.5;
- $33 = $30 + $32;
- $$sroa$015$0$$sroa_idx = ((($3)) + 20|0);
- HEAPF32[$$sroa$015$0$$sroa_idx>>2] = $29;
- $$sroa$216$0$$sroa_idx17 = ((($3)) + 24|0);
- HEAPF32[$$sroa$216$0$$sroa_idx17>>2] = $33;
- $34 = +HEAPF32[$1>>2];
- $35 = +HEAPF32[$2>>2];
- $36 = $35 * 0.5;
- $37 = $34 - $36;
- $38 = +HEAPF32[$12>>2];
- $39 = +HEAPF32[$14>>2];
- $40 = $39 * 0.5;
- $41 = $38 - $40;
- $$sroa$012$0$$sroa_idx = ((($3)) + 28|0);
- HEAPF32[$$sroa$012$0$$sroa_idx>>2] = $37;
- $$sroa$213$0$$sroa_idx14 = ((($3)) + 32|0);
- HEAPF32[$$sroa$213$0$$sroa_idx14>>2] = $41;
- $42 = HEAP32[$3>>2]|0;
- $43 = ($42|0)==(0);
- if ($43) {
- _memcpy(($0|0),($3|0),404)|0;
- STACKTOP = sp;return;
- }
- $44 = ((($5)) + 4|0);
- $$024 = 0;$47 = $42;
- while(1) {
- $45 = (($$024) + 1)|0;
- $46 = ($45>>>0)<($47>>>0);
- $48 = $46 ? $45 : 0;
- $49 = (((($3)) + 4|0) + ($48<<3)|0);
- $50 = (((($3)) + 4|0) + ($$024<<3)|0);
- ;HEAP32[$$byval_copy>>2]=HEAP32[$49>>2]|0;HEAP32[$$byval_copy+4>>2]=HEAP32[$49+4>>2]|0;
- ;HEAP32[$$byval_copy1>>2]=HEAP32[$50>>2]|0;HEAP32[$$byval_copy1+4>>2]=HEAP32[$50+4>>2]|0;
- _Vector2Subtract_4($5,$$byval_copy,$$byval_copy1);
- $51 = (((($3)) + 196|0) + ($$024<<3)|0);
- $52 = HEAP32[$44>>2]|0;
- $53 = +HEAPF32[$5>>2];
- $54 = -$53;
- HEAP32[$51>>2] = $52;
- $$sroa$2$0$$sroa_idx1 = (((((($3)) + 196|0) + ($$024<<3)|0)) + 4|0);
- HEAPF32[$$sroa$2$0$$sroa_idx1>>2] = $54;
- _MathNormalize($51);
- $55 = HEAP32[$3>>2]|0;
- $56 = ($45>>>0)<($55>>>0);
- if ($56) {
- $$024 = $45;$47 = $55;
- } else {
- break;
- }
- }
- _memcpy(($0|0),($3|0),404)|0;
- STACKTOP = sp;return;
- }
- function _MathCrossVector2($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- sp = STACKTOP;
- $2 = +HEAPF32[$0>>2];
- $3 = ((($1)) + 4|0);
- $4 = +HEAPF32[$3>>2];
- $5 = $2 * $4;
- $6 = ((($0)) + 4|0);
- $7 = +HEAPF32[$6>>2];
- $8 = +HEAPF32[$1>>2];
- $9 = $7 * $8;
- $10 = $5 - $9;
- return (+$10);
- }
- function _Vector2Add_2($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- sp = STACKTOP;
- $3 = +HEAPF32[$1>>2];
- $4 = +HEAPF32[$2>>2];
- $5 = $3 + $4;
- HEAPF32[$0>>2] = $5;
- $6 = ((($0)) + 4|0);
- $7 = ((($1)) + 4|0);
- $8 = +HEAPF32[$7>>2];
- $9 = ((($2)) + 4|0);
- $10 = +HEAPF32[$9>>2];
- $11 = $8 + $10;
- HEAPF32[$6>>2] = $11;
- return;
- }
- function _Mat2MultiplyVector2($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- sp = STACKTOP;
- $3 = +HEAPF32[$1>>2];
- $4 = +HEAPF32[$2>>2];
- $5 = $3 * $4;
- $6 = ((($1)) + 4|0);
- $7 = +HEAPF32[$6>>2];
- $8 = ((($2)) + 4|0);
- $9 = +HEAPF32[$8>>2];
- $10 = $7 * $9;
- $11 = $5 + $10;
- HEAPF32[$0>>2] = $11;
- $12 = ((($0)) + 4|0);
- $13 = ((($1)) + 8|0);
- $14 = +HEAPF32[$13>>2];
- $15 = $4 * $14;
- $16 = ((($1)) + 12|0);
- $17 = +HEAPF32[$16>>2];
- $18 = $9 * $17;
- $19 = $15 + $18;
- HEAPF32[$12>>2] = $19;
- return;
- }
- function _DestroyPhysicsBody($0) {
- $0 = $0|0;
- 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;
- 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;
- sp = STACKTOP;
- $1 = ($0|0)==(0|0);
- if ($1) {
- return;
- }
- $2 = HEAP32[$0>>2]|0;
- $3 = HEAP32[3571]|0;
- $4 = ($3|0)==(0);
- L4: do {
- if ($4) {
- $$021 = -1;
- } else {
- $5 = HEAP32[3571]|0;
- $$02023 = 0;
- while(1) {
- $6 = (14288 + ($$02023<<2)|0);
- $7 = HEAP32[$6>>2]|0;
- $8 = HEAP32[$7>>2]|0;
- $9 = ($8|0)==($2|0);
- if ($9) {
- $$021 = $$02023;
- break L4;
- }
- $10 = (($$02023) + 1)|0;
- $11 = ($10>>>0)<($5>>>0);
- if ($11) {
- $$02023 = $10;
- } else {
- $$021 = -1;
- break;
- }
- }
- }
- } while(0);
- $12 = (14288 + ($$021<<2)|0);
- $13 = HEAP32[$12>>2]|0;
- _free($13);
- $14 = HEAP32[3570]|0;
- $15 = (($14) + -500)|0;
- HEAP32[3570] = $15;
- HEAP32[$12>>2] = 0;
- $16 = HEAP32[3571]|0;
- $17 = ($$021>>>0)<($16>>>0);
- if ($17) {
- $18 = HEAP32[3571]|0;
- $$022 = $$021;$22 = $16;
- while(1) {
- $20 = (($$022) + 1)|0;
- $21 = ($20>>>0)<($22>>>0);
- if ($21) {
- $24 = (14288 + ($$022<<2)|0);
- $25 = (14288 + ($20<<2)|0);
- $26 = HEAP32[$25>>2]|0;
- HEAP32[$24>>2] = $26;
- }
- $23 = ($20>>>0)<($18>>>0);
- if ($23) {
- $$022 = $20;$22 = $18;
- } else {
- $$lcssa = $18;
- break;
- }
- }
- } else {
- $$lcssa = $16;
- }
- $19 = (($$lcssa) + -1)|0;
- HEAP32[3571] = $19;
- return;
- }
- function _Vector2Subtract_4($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- sp = STACKTOP;
- $3 = +HEAPF32[$1>>2];
- $4 = +HEAPF32[$2>>2];
- $5 = $3 - $4;
- HEAPF32[$0>>2] = $5;
- $6 = ((($0)) + 4|0);
- $7 = ((($1)) + 4|0);
- $8 = +HEAPF32[$7>>2];
- $9 = ((($2)) + 4|0);
- $10 = +HEAPF32[$9>>2];
- $11 = $8 - $10;
- HEAPF32[$6>>2] = $11;
- return;
- }
- function _MathNormalize($0) {
- $0 = $0|0;
- 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;
- sp = STACKTOP;
- $$sroa$0$0$copyload = +HEAPF32[$0>>2];
- $$sroa$5$0$$sroa_idx3 = ((($0)) + 4|0);
- $$sroa$5$0$copyload = +HEAPF32[$$sroa$5$0$$sroa_idx3>>2];
- $1 = $$sroa$0$0$copyload * $$sroa$0$0$copyload;
- $2 = $$sroa$5$0$copyload * $$sroa$5$0$copyload;
- $3 = $1 + $2;
- $4 = (+Math_sqrt((+$3)));
- $5 = $4 == 0.0;
- $$op = 1.0 / $4;
- $6 = $5 ? 1.0 : $$op;
- $7 = $$sroa$0$0$copyload * $6;
- HEAPF32[$0>>2] = $7;
- $8 = $$sroa$5$0$copyload * $6;
- HEAPF32[$$sroa$5$0$$sroa_idx3>>2] = $8;
- return;
- }
- function _GetPhysicsBodiesCount() {
- var $0 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = HEAP32[3571]|0;
- return ($0|0);
- }
- function _GetPhysicsBody($0) {
- $0 = $0|0;
- var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = HEAP32[3571]|0;
- $2 = ($1>>>0)>($0>>>0);
- if (!($2)) {
- $$0 = 0;
- return ($$0|0);
- }
- $3 = (14288 + ($0<<2)|0);
- $4 = HEAP32[$3>>2]|0;
- $$0 = $4;
- return ($$0|0);
- }
- function _GetPhysicsShapeVerticesCount($0) {
- $0 = $0|0;
- 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;
- sp = STACKTOP;
- $1 = HEAP32[3571]|0;
- $2 = ($1>>>0)>($0>>>0);
- L1: do {
- if ($2) {
- $3 = (14288 + ($0<<2)|0);
- $4 = HEAP32[$3>>2]|0;
- $5 = ($4|0)==(0|0);
- if ($5) {
- $$1 = 0;
- } else {
- $6 = ((($4)) + 84|0);
- $7 = HEAP32[$6>>2]|0;
- switch ($7|0) {
- case 0: {
- $$1 = 24;
- break L1;
- break;
- }
- case 1: {
- $8 = ((($4)) + 96|0);
- $9 = HEAP32[$8>>2]|0;
- $$1 = $9;
- break L1;
- break;
- }
- default: {
- $$1 = 0;
- break L1;
- }
- }
- }
- } else {
- $$1 = 0;
- }
- } while(0);
- return ($$1|0);
- }
- function _GetPhysicsShapeVertex($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 448|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(448|0);
- $$byval_copy3 = sp + 440|0;
- $$byval_copy2 = sp + 424|0;
- $3 = sp;
- $4 = sp + 416|0;
- $5 = sp + 408|0;
- $6 = ($1|0)==(0|0);
- L1: do {
- if ($6) {
- $$sroa$0$0 = 0.0;$$sroa$6$0 = 0.0;
- } else {
- $7 = ((($1)) + 84|0);
- $8 = HEAP32[$7>>2]|0;
- switch ($8|0) {
- case 0: {
- $9 = ((($1)) + 8|0);
- $10 = +HEAPF32[$9>>2];
- $11 = ($2*15)|0;
- $12 = (+($11|0));
- $13 = $12 * 0.017453292519943295;
- $14 = $13;
- $15 = (+Math_cos((+$14)));
- $16 = ((($1)) + 92|0);
- $17 = +HEAPF32[$16>>2];
- $18 = $15 * $17;
- $19 = $10 + $18;
- $20 = ((($1)) + 12|0);
- $21 = +HEAPF32[$20>>2];
- $22 = (+Math_sin((+$14)));
- $23 = $17 * $22;
- $24 = $21 + $23;
- $$sroa$0$0 = $19;$$sroa$6$0 = $24;
- break L1;
- break;
- }
- case 1: {
- $25 = ((($1)) + 96|0);
- _memcpy(($3|0),($25|0),404)|0;
- $26 = ((($1)) + 8|0);
- $27 = ((($3)) + 388|0);
- $28 = (((($3)) + 4|0) + ($2<<3)|0);
- ;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;
- ;HEAP32[$$byval_copy3>>2]=HEAP32[$28>>2]|0;HEAP32[$$byval_copy3+4>>2]=HEAP32[$28+4>>2]|0;
- _Mat2MultiplyVector2($4,$$byval_copy2,$$byval_copy3);
- ;HEAP32[$$byval_copy2>>2]=HEAP32[$26>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$26+4>>2]|0;
- ;HEAP32[$$byval_copy3>>2]=HEAP32[$4>>2]|0;HEAP32[$$byval_copy3+4>>2]=HEAP32[$4+4>>2]|0;
- _Vector2Add_2($5,$$byval_copy2,$$byval_copy3);
- $$sroa$0$0$copyload = +HEAPF32[$5>>2];
- $$sroa$6$0$$sroa_idx4 = ((($5)) + 4|0);
- $$sroa$6$0$copyload = +HEAPF32[$$sroa$6$0$$sroa_idx4>>2];
- $$sroa$0$0 = $$sroa$0$0$copyload;$$sroa$6$0 = $$sroa$6$0$copyload;
- break L1;
- break;
- }
- default: {
- $$sroa$0$0 = 0.0;$$sroa$6$0 = 0.0;
- break L1;
- }
- }
- }
- } while(0);
- HEAPF32[$0>>2] = $$sroa$0$0;
- $$sroa$6$0$$sroa_idx5 = ((($0)) + 4|0);
- HEAPF32[$$sroa$6$0$$sroa_idx5>>2] = $$sroa$6$0;
- STACKTOP = sp;return;
- }
- function _SetPhysicsBodyRotation($0,$1) {
- $0 = $0|0;
- $1 = +$1;
- var $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $2 = sp;
- $3 = ($0|0)==(0|0);
- if ($3) {
- STACKTOP = sp;return;
- }
- $4 = ((($0)) + 40|0);
- HEAPF32[$4>>2] = $1;
- $5 = ((($0)) + 84|0);
- $6 = HEAP32[$5>>2]|0;
- $7 = ($6|0)==(1);
- if (!($7)) {
- STACKTOP = sp;return;
- }
- $8 = ((($0)) + 484|0);
- _Mat2Radians($2,$1);
- ;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;
- STACKTOP = sp;return;
- }
- function _Mat2Radians($0,$1) {
- $0 = $0|0;
- $1 = +$1;
- var $2 = 0.0, $3 = 0.0, $4 = 0, $5 = 0.0, $6 = 0, $7 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $2 = (+Math_cos((+$1)));
- $3 = (+Math_sin((+$1)));
- HEAPF32[$0>>2] = $2;
- $4 = ((($0)) + 4|0);
- $5 = -$3;
- HEAPF32[$4>>2] = $5;
- $6 = ((($0)) + 8|0);
- HEAPF32[$6>>2] = $3;
- $7 = ((($0)) + 12|0);
- HEAPF32[$7>>2] = $2;
- return;
- }
- function _ClosePhysics() {
- var $0 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- HEAP32[3569] = 0;
- $0 = HEAP32[3568]|0;
- (_pthread_join(($0|0),(0|0))|0);
- return;
- }
- function _main() {
- 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.0, $23 = 0.0, $24 = 0, $25 = 0;
- var $26 = 0.0, $27 = 0.0, $28 = 0, $29 = 0.0, $3 = 0, $30 = 0.0, $31 = 0, $32 = 0, $33 = 0.0, $34 = 0.0, $35 = 0, $36 = 0, $37 = 0.0, $38 = 0.0, $39 = 0, $4 = 0, $40 = 0.0, $41 = 0.0, $42 = 0, $43 = 0;
- var $44 = 0, $45 = 0, $46 = 0.0, $47 = 0.0, $48 = 0, $49 = 0, $5 = 0, $50 = 0, $51 = 0.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;
- var $62 = 0, $63 = 0, $64 = 0, $65 = 0.0, $66 = 0, $67 = 0, $68 = 0, $69 = 0.0, $7 = 0, $70 = 0, $71 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
- $$byval_copy5 = sp + 48|0;
- $0 = sp + 40|0;
- $1 = sp + 32|0;
- $2 = sp + 24|0;
- $3 = sp + 16|0;
- $4 = sp + 8|0;
- $5 = sp;
- _SetConfigFlags(32);
- $6 = HEAP32[2]|0;
- $7 = HEAP32[3]|0;
- _InitWindow($6,$7,3248);
- $8 = HEAP32[2]|0;
- $9 = (_MeasureText(3283,30)|0);
- $10 = (($8) + -10)|0;
- $11 = (($10) - ($9))|0;
- HEAP32[7733] = $11;
- _InitPhysics();
- $12 = HEAP32[2]|0;
- $13 = (($12|0) / 2)&-1;
- $14 = (+($13|0));
- HEAPF32[$0>>2] = $14;
- $15 = ((($0)) + 4|0);
- $16 = HEAP32[3]|0;
- $17 = (+($16|0));
- HEAPF32[$15>>2] = $17;
- $18 = HEAP32[2]|0;
- $19 = (+($18|0));
- ;HEAP32[$$byval_copy5>>2]=HEAP32[$0>>2]|0;HEAP32[$$byval_copy5+4>>2]=HEAP32[$0+4>>2]|0;
- $20 = (_CreatePhysicsBodyRectangle($$byval_copy5,$19,100.0,10.0)|0);
- $21 = HEAP32[2]|0;
- $22 = (+($21|0));
- $23 = $22 * 0.25;
- HEAPF32[$1>>2] = $23;
- $24 = ((($1)) + 4|0);
- $25 = HEAP32[3]|0;
- $26 = (+($25|0));
- $27 = $26 * 0.60000002384185791;
- HEAPF32[$24>>2] = $27;
- $28 = HEAP32[2]|0;
- $29 = (+($28|0));
- $30 = $29 * 0.25;
- ;HEAP32[$$byval_copy5>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy5+4>>2]=HEAP32[$1+4>>2]|0;
- $31 = (_CreatePhysicsBodyRectangle($$byval_copy5,$30,10.0,10.0)|0);
- $32 = HEAP32[2]|0;
- $33 = (+($32|0));
- $34 = $33 * 0.75;
- HEAPF32[$2>>2] = $34;
- $35 = ((($2)) + 4|0);
- $36 = HEAP32[3]|0;
- $37 = (+($36|0));
- $38 = $37 * 0.60000002384185791;
- HEAPF32[$35>>2] = $38;
- $39 = HEAP32[2]|0;
- $40 = (+($39|0));
- $41 = $40 * 0.25;
- ;HEAP32[$$byval_copy5>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy5+4>>2]=HEAP32[$2+4>>2]|0;
- $42 = (_CreatePhysicsBodyRectangle($$byval_copy5,$41,10.0,10.0)|0);
- HEAPF32[$3>>2] = -5.0;
- $43 = ((($3)) + 4|0);
- $44 = HEAP32[3]|0;
- $45 = (($44|0) / 2)&-1;
- $46 = (+($45|0));
- HEAPF32[$43>>2] = $46;
- $47 = (+($44|0));
- ;HEAP32[$$byval_copy5>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy5+4>>2]=HEAP32[$3+4>>2]|0;
- $48 = (_CreatePhysicsBodyRectangle($$byval_copy5,10.0,$47,10.0)|0);
- $49 = HEAP32[2]|0;
- $50 = (($49) + 5)|0;
- $51 = (+($50|0));
- HEAPF32[$4>>2] = $51;
- $52 = ((($4)) + 4|0);
- $53 = HEAP32[3]|0;
- $54 = (($53|0) / 2)&-1;
- $55 = (+($54|0));
- HEAPF32[$52>>2] = $55;
- $56 = (+($53|0));
- ;HEAP32[$$byval_copy5>>2]=HEAP32[$4>>2]|0;HEAP32[$$byval_copy5+4>>2]=HEAP32[$4+4>>2]|0;
- $57 = (_CreatePhysicsBodyRectangle($$byval_copy5,10.0,$56,10.0)|0);
- $58 = ((($20)) + 4|0);
- HEAP32[$58>>2] = 0;
- $59 = ((($31)) + 4|0);
- HEAP32[$59>>2] = 0;
- $60 = ((($42)) + 4|0);
- HEAP32[$60>>2] = 0;
- $61 = ((($48)) + 4|0);
- HEAP32[$61>>2] = 0;
- $62 = ((($57)) + 4|0);
- HEAP32[$62>>2] = 0;
- $63 = HEAP32[2]|0;
- $64 = (($63|0) / 2)&-1;
- $65 = (+($64|0));
- HEAPF32[$5>>2] = $65;
- $66 = ((($5)) + 4|0);
- $67 = HEAP32[3]|0;
- $68 = (($67|0) / 2)&-1;
- $69 = (+($68|0));
- HEAPF32[$66>>2] = $69;
- ;HEAP32[$$byval_copy5>>2]=HEAP32[$5>>2]|0;HEAP32[$$byval_copy5+4>>2]=HEAP32[$5+4>>2]|0;
- $70 = (_CreatePhysicsBodyRectangle($$byval_copy5,50.0,50.0,1.0)|0);
- HEAP32[7734] = $70;
- $71 = ((($70)) + 80|0);
- HEAP32[$71>>2] = 1;
- _emscripten_set_main_loop((1|0),0,1);
- _ClosePhysics();
- _CloseWindow();
- STACKTOP = sp;return 0;
- }
- function _UpdateDrawFrame() {
- var $$03233 = 0, $$034 = 0, $$byval_copy1 = 0, $$byval_copy2 = 0, $$byval_copy3 = 0, $$sink = 0.0, $$sroa$0$0$$sroa_idx = 0, $$sroa$029$0$$sroa_idx = 0, $$sroa$2$0$$sroa_idx28 = 0, $$sroa$230$0$$sroa_idx31 = 0, $0 = 0, $1 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0.0, $14 = 0, $15 = 0, $16 = 0.0, $17 = 0;
- var $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, $35 = 0;
- var $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, $53 = 0;
- var $54 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $exitcond = 0, $exitcond38 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
- $$byval_copy3 = sp + 56|0;
- $$byval_copy2 = sp + 40|0;
- $$byval_copy1 = sp + 32|0;
- $0 = sp + 52|0;
- $1 = sp + 16|0;
- $2 = sp + 8|0;
- $3 = sp + 48|0;
- $4 = sp + 28|0;
- $5 = sp + 24|0;
- $6 = sp + 4|0;
- $7 = sp;
- $8 = (_IsKeyPressed(82)|0);
- $9 = ($8|0)==(0);
- if (!($9)) {
- $10 = HEAP32[7734]|0;
- $11 = HEAP32[2]|0;
- $12 = (($11|0) / 2)&-1;
- $13 = (+($12|0));
- $14 = HEAP32[3]|0;
- $15 = (($14|0) / 2)&-1;
- $16 = (+($15|0));
- $$sroa$029$0$$sroa_idx = ((($10)) + 8|0);
- HEAPF32[$$sroa$029$0$$sroa_idx>>2] = $13;
- $$sroa$230$0$$sroa_idx31 = ((($10)) + 12|0);
- HEAPF32[$$sroa$230$0$$sroa_idx31>>2] = $16;
- $$sroa$0$0$$sroa_idx = ((($10)) + 16|0);
- HEAPF32[$$sroa$0$0$$sroa_idx>>2] = 0.0;
- $$sroa$2$0$$sroa_idx28 = ((($10)) + 20|0);
- HEAPF32[$$sroa$2$0$$sroa_idx28>>2] = 0.0;
- _SetPhysicsBodyRotation($10,0.0);
- }
- $17 = (_IsKeyDown(262)|0);
- $18 = ($17|0)==(0);
- if ($18) {
- $19 = (_IsKeyDown(263)|0);
- $20 = ($19|0)==(0);
- if (!($20)) {
- $$sink = -0.5;
- label = 5;
- }
- } else {
- $$sink = 0.5;
- label = 5;
- }
- if ((label|0) == 5) {
- $21 = HEAP32[7734]|0;
- $22 = ((($21)) + 16|0);
- HEAPF32[$22>>2] = $$sink;
- }
- $23 = (_IsKeyDown(265)|0);
- $24 = ($23|0)==(0);
- if (!($24)) {
- $25 = HEAP32[7734]|0;
- $26 = ((($25)) + 76|0);
- $27 = HEAP32[$26>>2]|0;
- $28 = ($27|0)==(0);
- if (!($28)) {
- $29 = ((($25)) + 20|0);
- HEAPF32[$29>>2] = -2.0;
- }
- }
- _BeginDrawing();
- HEAP8[$0>>0] = 0;
- $30 = ((($0)) + 1|0);
- HEAP8[$30>>0] = 0;
- $31 = ((($0)) + 2|0);
- HEAP8[$31>>0] = 0;
- $32 = ((($0)) + 3|0);
- HEAP8[$32>>0] = -1;
- ;HEAP8[$$byval_copy3>>0]=HEAP8[$0>>0]|0;HEAP8[$$byval_copy3+1>>0]=HEAP8[$0+1>>0]|0;HEAP8[$$byval_copy3+2>>0]=HEAP8[$0+2>>0]|0;HEAP8[$$byval_copy3+3>>0]=HEAP8[$0+3>>0]|0;
- _ClearBackground($$byval_copy3);
- $33 = HEAP32[2]|0;
- $34 = (($33) + -90)|0;
- $35 = HEAP32[3]|0;
- $36 = (($35) + -30)|0;
- _DrawFPS($34,$36);
- $37 = (_GetPhysicsBodiesCount()|0);
- $38 = ($37|0)>(0);
- if ($38) {
- $39 = ((($3)) + 1|0);
- $40 = ((($3)) + 2|0);
- $41 = ((($3)) + 3|0);
- $$034 = 0;
- while(1) {
- $48 = (_GetPhysicsBody($$034)|0);
- $49 = (_GetPhysicsShapeVerticesCount($$034)|0);
- $50 = ($49|0)>(0);
- if ($50) {
- $$03233 = 0;
- while(1) {
- _GetPhysicsShapeVertex($1,$48,$$03233);
- $52 = (($$03233) + 1)|0;
- $53 = ($52|0)<($49|0);
- $54 = $53 ? $52 : 0;
- _GetPhysicsShapeVertex($2,$48,$54);
- HEAP8[$3>>0] = 0;
- HEAP8[$39>>0] = -28;
- HEAP8[$40>>0] = 48;
- HEAP8[$41>>0] = -1;
- ;HEAP32[$$byval_copy1>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy1+4>>2]=HEAP32[$1+4>>2]|0;
- ;HEAP32[$$byval_copy2>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$2+4>>2]|0;
- ;HEAP8[$$byval_copy3>>0]=HEAP8[$3>>0]|0;HEAP8[$$byval_copy3+1>>0]=HEAP8[$3+1>>0]|0;HEAP8[$$byval_copy3+2>>0]=HEAP8[$3+2>>0]|0;HEAP8[$$byval_copy3+3>>0]=HEAP8[$3+3>>0]|0;
- _DrawLineV($$byval_copy1,$$byval_copy2,$$byval_copy3);
- $exitcond = ($52|0)==($49|0);
- if ($exitcond) {
- break;
- } else {
- $$03233 = $52;
- }
- }
- }
- $51 = (($$034) + 1)|0;
- $exitcond38 = ($51|0)==($37|0);
- if ($exitcond38) {
- break;
- } else {
- $$034 = $51;
- }
- }
- }
- HEAP32[$4>>2] = -1;
- ;HEAP8[$$byval_copy3>>0]=HEAP8[$4>>0]|0;HEAP8[$$byval_copy3+1>>0]=HEAP8[$4+1>>0]|0;HEAP8[$$byval_copy3+2>>0]=HEAP8[$4+2>>0]|0;HEAP8[$$byval_copy3+3>>0]=HEAP8[$4+3>>0]|0;
- _DrawText(3290,10,10,10,$$byval_copy3);
- HEAP32[$5>>2] = -1;
- ;HEAP8[$$byval_copy3>>0]=HEAP8[$5>>0]|0;HEAP8[$$byval_copy3+1>>0]=HEAP8[$5+1>>0]|0;HEAP8[$$byval_copy3+2>>0]=HEAP8[$5+2>>0]|0;HEAP8[$$byval_copy3+3>>0]=HEAP8[$5+3>>0]|0;
- _DrawText(3318,10,30,10,$$byval_copy3);
- $42 = HEAP32[7733]|0;
- $43 = HEAP32[4]|0;
- HEAP32[$6>>2] = -1;
- ;HEAP8[$$byval_copy3>>0]=HEAP8[$6>>0]|0;HEAP8[$$byval_copy3+1>>0]=HEAP8[$6+1>>0]|0;HEAP8[$$byval_copy3+2>>0]=HEAP8[$6+2>>0]|0;HEAP8[$$byval_copy3+3>>0]=HEAP8[$6+3>>0]|0;
- _DrawText(3283,$42,$43,30,$$byval_copy3);
- $44 = HEAP32[7733]|0;
- $45 = (($44) + 50)|0;
- $46 = HEAP32[4]|0;
- $47 = (($46) + -7)|0;
- HEAP32[$7>>2] = -1;
- ;HEAP8[$$byval_copy3>>0]=HEAP8[$7>>0]|0;HEAP8[$$byval_copy3+1>>0]=HEAP8[$7+1>>0]|0;HEAP8[$$byval_copy3+2>>0]=HEAP8[$7+2>>0]|0;HEAP8[$$byval_copy3+3>>0]=HEAP8[$7+3>>0]|0;
- _DrawText(3345,$45,$47,10,$$byval_copy3);
- _EndDrawing();
- STACKTOP = sp;return;
- }
- function _InitTimer() {
- var $0 = 0, $1 = 0.0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = (_time((0|0))|0);
- _srand($0);
- $1 = (+_GetCurrentTime());
- HEAPF64[1748] = $1;
- return;
- }
- function _GetCurrentTime() {
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $0 = sp;
- (_clock_gettime(1,($0|0))|0);
- $1 = HEAP32[$0>>2]|0;
- $2 = ($1|0)<(0);
- $3 = $2 << 31 >> 31;
- $4 = (___muldi3(($1|0),($3|0),1000000000,0)|0);
- $5 = tempRet0;
- $6 = ((($0)) + 4|0);
- $7 = HEAP32[$6>>2]|0;
- $8 = ($7|0)<(0);
- $9 = $8 << 31 >> 31;
- $10 = (_i64Add(($4|0),($5|0),($7|0),($9|0))|0);
- $11 = tempRet0;
- $12 = (+($10>>>0)) + (4294967296.0*(+($11>>>0)));
- $13 = $12 * 9.9999999999999995E-7;
- STACKTOP = sp;return (+$13);
- }
- function _MathClamp() {
- var $$sink = 0.0, $0 = 0.0, $1 = 0, $2 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = +HEAPF64[1746];
- $1 = $0 < 0.0;
- if ($1) {
- $$sink = 0.0;
- } else {
- $2 = $0 > 0.02;
- if ($2) {
- $$sink = 0.02;
- } else {
- return;
- }
- }
- HEAPF64[1746] = $$sink;
- return;
- }
- function _PhysicsStep() {
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- var $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $exitcond = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = HEAP32[7735]|0;
- $1 = (($0) + 1)|0;
- HEAP32[7735] = $1;
- $2 = HEAP32[3636]|0;
- $$0167 = (($2) + -1)|0;
- $3 = ($$0167|0)>(-1);
- if ($3) {
- $$0168 = $$0167;
- while(1) {
- $6 = (14548 + ($$0168<<2)|0);
- $7 = HEAP32[$6>>2]|0;
- $8 = ($7|0)==(0|0);
- if (!($8)) {
- _DestroyPhysicsManifold($7);
- }
- $$0 = (($$0168) + -1)|0;
- $9 = ($$0|0)>(-1);
- if ($9) {
- $$0168 = $$0;
- } else {
- break;
- }
- }
- }
- $4 = HEAP32[3571]|0;
- $5 = ($4|0)==(0);
- if ($5) {
- $17 = $4;
- label = 8;
- } else {
- $$0125165 = 0;
- while(1) {
- $11 = (14288 + ($$0125165<<2)|0);
- $12 = HEAP32[$11>>2]|0;
- $13 = ((($12)) + 76|0);
- HEAP32[$13>>2] = 0;
- $14 = (($$0125165) + 1)|0;
- $15 = ($14>>>0)<($4>>>0);
- if ($15) {
- $$0125165 = $14;
- } else {
- break;
- }
- }
- $$pr = HEAP32[3571]|0;
- $10 = ($$pr|0)==(0);
- if (!($10)) {
- $$0126163 = 0;
- while(1) {
- $19 = (14288 + ($$0126163<<2)|0);
- $20 = HEAP32[$19>>2]|0;
- $21 = ($20|0)==(0|0);
- if (!($21)) {
- $$0130160 = (($$0126163) + 1)|0;
- $22 = HEAP32[3571]|0;
- $23 = ($$0130160>>>0)<($22>>>0);
- if ($23) {
- $24 = ((($20)) + 56|0);
- $25 = ((($20)) + 84|0);
- $$0130161 = $$0130160;
- while(1) {
- $26 = (14288 + ($$0130161<<2)|0);
- $27 = HEAP32[$26>>2]|0;
- $28 = ($27|0)==(0|0);
- do {
- if (!($28)) {
- $31 = +HEAPF32[$24>>2];
- $32 = $31 == 0.0;
- if ($32) {
- $33 = ((($27)) + 56|0);
- $34 = +HEAPF32[$33>>2];
- $35 = $34 == 0.0;
- if ($35) {
- break;
- }
- }
- $36 = HEAP32[$25>>2]|0;
- $37 = ($36|0)==(1);
- if ($37) {
- $38 = ((($27)) + 84|0);
- $39 = HEAP32[$38>>2]|0;
- $40 = ($39|0)==(0);
- if ($40) {
- $41 = (_CreatePhysicsManifold($27,$20)|0);
- $$0132 = $41;
- } else {
- label = 20;
- }
- } else {
- label = 20;
- }
- if ((label|0) == 20) {
- label = 0;
- $42 = (_CreatePhysicsManifold($20,$27)|0);
- $$0132 = $42;
- }
- _SolvePhysicsManifold($$0132);
- $43 = ((($$0132)) + 40|0);
- $44 = HEAP32[$43>>2]|0;
- $45 = ($44|0)==(0);
- if (!($45)) {
- $46 = (_CreatePhysicsManifold($20,$27)|0);
- $47 = ((($$0132)) + 12|0);
- $48 = HEAP32[$47>>2]|0;
- $49 = ((($46)) + 12|0);
- HEAP32[$49>>2] = $48;
- $50 = ((($46)) + 16|0);
- $51 = ((($$0132)) + 16|0);
- $52 = $51;
- $53 = $52;
- $54 = HEAP32[$53>>2]|0;
- $55 = (($52) + 4)|0;
- $56 = $55;
- $57 = HEAP32[$56>>2]|0;
- $58 = $50;
- $59 = $58;
- HEAP32[$59>>2] = $54;
- $60 = (($58) + 4)|0;
- $61 = $60;
- HEAP32[$61>>2] = $57;
- $62 = ((($46)) + 24|0);
- $63 = ((($$0132)) + 24|0);
- $64 = $63;
- $65 = $64;
- $66 = HEAP32[$65>>2]|0;
- $67 = (($64) + 4)|0;
- $68 = $67;
- $69 = HEAP32[$68>>2]|0;
- $70 = $62;
- $71 = $70;
- HEAP32[$71>>2] = $66;
- $72 = (($70) + 4)|0;
- $73 = $72;
- HEAP32[$73>>2] = $69;
- $74 = ((($46)) + 32|0);
- $75 = ((($$0132)) + 32|0);
- $76 = $75;
- $77 = $76;
- $78 = HEAP32[$77>>2]|0;
- $79 = (($76) + 4)|0;
- $80 = $79;
- $81 = HEAP32[$80>>2]|0;
- $82 = $74;
- $83 = $82;
- HEAP32[$83>>2] = $78;
- $84 = (($82) + 4)|0;
- $85 = $84;
- HEAP32[$85>>2] = $81;
- $86 = HEAP32[$43>>2]|0;
- $87 = ((($46)) + 40|0);
- HEAP32[$87>>2] = $86;
- $88 = ((($$0132)) + 44|0);
- $89 = HEAP32[$88>>2]|0;
- $90 = ((($46)) + 44|0);
- HEAP32[$90>>2] = $89;
- $91 = ((($$0132)) + 48|0);
- $92 = HEAP32[$91>>2]|0;
- $93 = ((($46)) + 48|0);
- HEAP32[$93>>2] = $92;
- $94 = ((($$0132)) + 52|0);
- $95 = HEAP32[$94>>2]|0;
- $96 = ((($46)) + 52|0);
- HEAP32[$96>>2] = $95;
- }
- }
- } while(0);
- $$0130 = (($$0130161) + 1)|0;
- $29 = HEAP32[3571]|0;
- $30 = ($$0130>>>0)<($29>>>0);
- if ($30) {
- $$0130161 = $$0130;
- } else {
- break;
- }
- }
- }
- }
- $97 = (($$0126163) + 1)|0;
- $98 = HEAP32[3571]|0;
- $99 = ($97>>>0)<($98>>>0);
- if ($99) {
- $$0126163 = $97;
- } else {
- $17 = $98;
- label = 8;
- break;
- }
- }
- }
- }
- if ((label|0) == 8) {
- $16 = ($17|0)==(0);
- if (!($16)) {
- $18 = HEAP32[3571]|0;
- $$0135158 = 0;
- while(1) {
- $103 = (14288 + ($$0135158<<2)|0);
- $104 = HEAP32[$103>>2]|0;
- $105 = ($104|0)==(0|0);
- if (!($105)) {
- _IntegratePhysicsForces($104);
- }
- $106 = (($$0135158) + 1)|0;
- $107 = ($106>>>0)<($18>>>0);
- if ($107) {
- $$0135158 = $106;
- } else {
- break;
- }
- }
- }
- }
- $100 = HEAP32[3636]|0;
- $101 = ($100|0)==(0);
- if ($101) {
- $$0134155 = 0;$114 = 0;
- } else {
- $102 = HEAP32[3636]|0;
- $$0136156 = 0;
- while(1) {
- $108 = (14548 + ($$0136156<<2)|0);
- $109 = HEAP32[$108>>2]|0;
- $110 = ($109|0)==(0|0);
- if (!($110)) {
- _InitializePhysicsManifolds($109);
- }
- $111 = (($$0136156) + 1)|0;
- $112 = ($111>>>0)<($102>>>0);
- if ($112) {
- $$0136156 = $111;
- } else {
- $$0134155$ph = 0;
- label = 32;
- break;
- }
- }
- }
- while(1) {
- if ((label|0) == 32) {
- label = 0;
- $$pr172 = HEAP32[3636]|0;
- $$0134155 = $$0134155$ph;$114 = $$pr172;
- }
- $113 = ($114|0)==(0);
- if (!($113)) {
- $115 = (14548 + ($$0134155<<2)|0);
- $$0133152 = 0;
- while(1) {
- $120 = HEAP32[$115>>2]|0;
- $121 = ($120|0)==(0|0);
- if (!($121)) {
- _IntegratePhysicsImpulses($120);
- }
- $122 = (($$0133152) + 1)|0;
- $123 = HEAP32[3636]|0;
- $124 = ($122>>>0)<($123>>>0);
- if ($124) {
- $$0133152 = $122;
- } else {
- break;
- }
- }
- }
- $119 = (($$0134155) + 1)|0;
- $exitcond = ($119|0)==(100);
- if ($exitcond) {
- break;
- } else {
- $$0134155$ph = $119;
- label = 32;
- }
- }
- $116 = HEAP32[3571]|0;
- $117 = ($116|0)==(0);
- if (!($117)) {
- $118 = HEAP32[3571]|0;
- $$0131150 = 0;
- while(1) {
- $128 = (14288 + ($$0131150<<2)|0);
- $129 = HEAP32[$128>>2]|0;
- $130 = ($129|0)==(0|0);
- if (!($130)) {
- _IntegratePhysicsVelocity($129);
- }
- $131 = (($$0131150) + 1)|0;
- $132 = ($131>>>0)<($118>>>0);
- if ($132) {
- $$0131150 = $131;
- } else {
- break;
- }
- }
- }
- $125 = HEAP32[3636]|0;
- $126 = ($125|0)==(0);
- if (!($126)) {
- $127 = HEAP32[3636]|0;
- $$0129148 = 0;
- while(1) {
- $136 = (14548 + ($$0129148<<2)|0);
- $137 = HEAP32[$136>>2]|0;
- $138 = ($137|0)==(0|0);
- if (!($138)) {
- _CorrectPhysicsPositions($137);
- }
- $139 = (($$0129148) + 1)|0;
- $140 = ($139>>>0)<($127>>>0);
- if ($140) {
- $$0129148 = $139;
- } else {
- break;
- }
- }
- }
- $133 = HEAP32[3571]|0;
- $134 = ($133|0)==(0);
- if ($134) {
- return;
- }
- $135 = HEAP32[3571]|0;
- $$0127147 = 0;
- while(1) {
- $141 = (14288 + ($$0127147<<2)|0);
- $142 = HEAP32[$141>>2]|0;
- $143 = ($142|0)==(0|0);
- if (!($143)) {
- $$sroa$0$0$$sroa_idx = ((($142)) + 24|0);
- HEAPF32[$$sroa$0$0$$sroa_idx>>2] = 0.0;
- $$sroa$2$0$$sroa_idx1 = ((($142)) + 28|0);
- HEAPF32[$$sroa$2$0$$sroa_idx1>>2] = 0.0;
- $144 = ((($142)) + 36|0);
- HEAPF32[$144>>2] = 0.0;
- }
- $145 = (($$0127147) + 1)|0;
- $146 = ($145>>>0)<($135>>>0);
- if ($146) {
- $$0127147 = $145;
- } else {
- break;
- }
- }
- return;
- }
- function _DestroyPhysicsManifold($0) {
- $0 = $0|0;
- 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;
- 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;
- sp = STACKTOP;
- $1 = ($0|0)==(0|0);
- if ($1) {
- return;
- }
- $2 = HEAP32[$0>>2]|0;
- $3 = HEAP32[3636]|0;
- $4 = ($3|0)==(0);
- L4: do {
- if ($4) {
- $$021 = -1;
- } else {
- $5 = HEAP32[3636]|0;
- $$02023 = 0;
- while(1) {
- $6 = (14548 + ($$02023<<2)|0);
- $7 = HEAP32[$6>>2]|0;
- $8 = HEAP32[$7>>2]|0;
- $9 = ($8|0)==($2|0);
- if ($9) {
- $$021 = $$02023;
- break L4;
- }
- $10 = (($$02023) + 1)|0;
- $11 = ($10>>>0)<($5>>>0);
- if ($11) {
- $$02023 = $10;
- } else {
- $$021 = -1;
- break;
- }
- }
- }
- } while(0);
- $12 = (14548 + ($$021<<2)|0);
- $13 = HEAP32[$12>>2]|0;
- _free($13);
- $14 = HEAP32[3570]|0;
- $15 = (($14) + -56)|0;
- HEAP32[3570] = $15;
- HEAP32[$12>>2] = 0;
- $16 = HEAP32[3636]|0;
- $17 = ($$021>>>0)<($16>>>0);
- if ($17) {
- $18 = HEAP32[3636]|0;
- $$022 = $$021;$22 = $16;
- while(1) {
- $20 = (($$022) + 1)|0;
- $21 = ($20>>>0)<($22>>>0);
- if ($21) {
- $24 = (14548 + ($$022<<2)|0);
- $25 = (14548 + ($20<<2)|0);
- $26 = HEAP32[$25>>2]|0;
- HEAP32[$24>>2] = $26;
- }
- $23 = ($20>>>0)<($18>>>0);
- if ($23) {
- $$022 = $20;$22 = $18;
- } else {
- $$lcssa = $18;
- break;
- }
- }
- } else {
- $$lcssa = $16;
- }
- $19 = (($$lcssa) + -1)|0;
- HEAP32[3636] = $19;
- return;
- }
- function _CreatePhysicsManifold($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- var $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, stop = 0;
- sp = STACKTOP;
- $2 = (_malloc(56)|0);
- $3 = HEAP32[3570]|0;
- $4 = (($3) + 56)|0;
- HEAP32[3570] = $4;
- $5 = HEAP32[3636]|0;
- $6 = ($5|0)==(0);
- $$04457 = 0;
- L1: while(1) {
- if ($6) {
- $$044576162 = 0;
- break;
- } else {
- $$04755 = 0;
- }
- while(1) {
- $9 = (14548 + ($$04755<<2)|0);
- $10 = HEAP32[$9>>2]|0;
- $11 = HEAP32[$10>>2]|0;
- $12 = ($11|0)==($$04457|0);
- $8 = (($$04755) + 1)|0;
- if ($12) {
- break;
- }
- $7 = ($8>>>0)<($5>>>0);
- if ($7) {
- $$04755 = $8;
- } else {
- label = 6;
- break L1;
- }
- }
- $13 = (($$04457) + 1)|0;
- $14 = ($13|0)<(4096);
- if ($14) {
- $$04457 = $13;
- } else {
- label = 8;
- break;
- }
- }
- if ((label|0) == 8) {
- return ($2|0);
- }
- if ((label|0) == 6) {
- $15 = ($$04457|0)==(-1);
- if ($15) {
- return ($2|0);
- } else {
- $$044576162 = $$04457;
- }
- }
- HEAP32[$2>>2] = $$044576162;
- $16 = ((($2)) + 4|0);
- HEAP32[$16>>2] = $0;
- $17 = ((($2)) + 8|0);
- HEAP32[$17>>2] = $1;
- $18 = ((($2)) + 12|0);
- dest=$18; stop=dest+44|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
- $19 = HEAP32[3636]|0;
- $20 = (14548 + ($19<<2)|0);
- HEAP32[$20>>2] = $2;
- $21 = (($19) + 1)|0;
- HEAP32[3636] = $21;
- return ($2|0);
- }
- function _SolvePhysicsManifold($0) {
- $0 = $0|0;
- 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;
- var $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = ((($0)) + 4|0);
- $2 = HEAP32[$1>>2]|0;
- $3 = ((($2)) + 84|0);
- $4 = HEAP32[$3>>2]|0;
- L1: do {
- switch ($4|0) {
- case 0: {
- $5 = ((($0)) + 8|0);
- $6 = HEAP32[$5>>2]|0;
- $7 = ((($6)) + 84|0);
- $8 = HEAP32[$7>>2]|0;
- switch ($8|0) {
- case 0: {
- _SolveCircleToCircle($0);
- break L1;
- break;
- }
- case 1: {
- _SolveCircleToPolygon($0);
- break L1;
- break;
- }
- default: {
- break L1;
- }
- }
- break;
- }
- case 1: {
- $9 = ((($0)) + 8|0);
- $10 = HEAP32[$9>>2]|0;
- $11 = ((($10)) + 84|0);
- $12 = HEAP32[$11>>2]|0;
- switch ($12|0) {
- case 0: {
- _SolvePolygonToCircle($0);
- break L1;
- break;
- }
- case 1: {
- _SolvePolygonToPolygon($0);
- break L1;
- break;
- }
- default: {
- break L1;
- }
- }
- break;
- }
- default: {
- }
- }
- } while(0);
- $13 = ((($0)) + 8|0);
- $14 = HEAP32[$13>>2]|0;
- $15 = ((($14)) + 76|0);
- $16 = HEAP32[$15>>2]|0;
- $17 = ($16|0)==(0);
- if (!($17)) {
- return;
- }
- $18 = ((($0)) + 20|0);
- $19 = +HEAPF32[$18>>2];
- $20 = $19 < 0.0;
- $21 = $20&1;
- HEAP32[$15>>2] = $21;
- return;
- }
- function _IntegratePhysicsForces($0) {
- $0 = $0|0;
- 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;
- 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;
- 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;
- var label = 0, sp = 0;
- sp = STACKTOP;
- $1 = ((($0)) + 56|0);
- $2 = +HEAPF32[$1>>2];
- $3 = $2 == 0.0;
- if ($3) {
- return;
- }
- $4 = ((($0)) + 4|0);
- $5 = HEAP32[$4>>2]|0;
- $6 = ($5|0)==(0);
- if ($6) {
- return;
- }
- $7 = ((($0)) + 24|0);
- $8 = +HEAPF32[$7>>2];
- $9 = $2 * $8;
- $10 = $9;
- $11 = +HEAPF64[1749];
- $12 = $11 * 0.5;
- $13 = $10 * $12;
- $14 = ((($0)) + 16|0);
- $15 = +HEAPF32[$14>>2];
- $16 = $15;
- $17 = $16 + $13;
- $18 = $17;
- HEAPF32[$14>>2] = $18;
- $19 = ((($0)) + 28|0);
- $20 = +HEAPF32[$19>>2];
- $21 = $2 * $20;
- $22 = $21;
- $23 = $12 * $22;
- $24 = ((($0)) + 20|0);
- $25 = +HEAPF32[$24>>2];
- $26 = $25;
- $27 = $26 + $23;
- $28 = $27;
- HEAPF32[$24>>2] = $28;
- $29 = ((($0)) + 72|0);
- $30 = HEAP32[$29>>2]|0;
- $31 = ($30|0)==(0);
- if (!($31)) {
- $32 = +HEAPF32[7736];
- $33 = $32;
- $34 = $12 * $33;
- $35 = +HEAPF32[$14>>2];
- $36 = $35;
- $37 = $36 + $34;
- $38 = $37;
- HEAPF32[$14>>2] = $38;
- $39 = +HEAPF32[5];
- $40 = $39;
- $41 = $12 * $40;
- $42 = +HEAPF32[$24>>2];
- $43 = $42;
- $44 = $43 + $41;
- $45 = $44;
- HEAPF32[$24>>2] = $45;
- }
- $46 = ((($0)) + 80|0);
- $47 = HEAP32[$46>>2]|0;
- $48 = ($47|0)==(0);
- if (!($48)) {
- return;
- }
- $49 = ((($0)) + 36|0);
- $50 = +HEAPF32[$49>>2];
- $51 = ((($0)) + 48|0);
- $52 = +HEAPF32[$51>>2];
- $53 = $50 * $52;
- $54 = $53;
- $55 = $12 * $54;
- $56 = ((($0)) + 32|0);
- $57 = +HEAPF32[$56>>2];
- $58 = $57;
- $59 = $58 + $55;
- $60 = $59;
- HEAPF32[$56>>2] = $60;
- return;
- }
- function _InitializePhysicsManifolds($0) {
- $0 = $0|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
- $$byval_copy14 = sp + 48|0;
- $$byval_copy9 = sp + 40|0;
- $1 = sp + 24|0;
- $2 = sp + 16|0;
- $3 = sp + 8|0;
- $4 = sp;
- $5 = sp + 32|0;
- $6 = ((($0)) + 4|0);
- $7 = HEAP32[$6>>2]|0;
- $8 = ((($0)) + 8|0);
- $9 = HEAP32[$8>>2]|0;
- $10 = ((($7)) + 68|0);
- $11 = +HEAPF32[$10>>2];
- $12 = ((($9)) + 68|0);
- $13 = +HEAPF32[$12>>2];
- $14 = $11 * $13;
- $15 = (+Math_sqrt((+$14)));
- $16 = ((($0)) + 44|0);
- HEAPF32[$16>>2] = $15;
- $17 = ((($7)) + 60|0);
- $18 = +HEAPF32[$17>>2];
- $19 = ((($9)) + 60|0);
- $20 = +HEAPF32[$19>>2];
- $21 = $18 * $20;
- $22 = (+Math_sqrt((+$21)));
- $23 = ((($0)) + 52|0);
- HEAPF32[$23>>2] = $22;
- $24 = ((($7)) + 64|0);
- $25 = +HEAPF32[$24>>2];
- $26 = ((($9)) + 64|0);
- $27 = +HEAPF32[$26>>2];
- $28 = $25 * $27;
- $29 = (+Math_sqrt((+$28)));
- $30 = ((($0)) + 48|0);
- HEAPF32[$30>>2] = $29;
- $31 = ((($7)) + 8|0);
- $32 = ((($9)) + 8|0);
- $33 = ((($7)) + 32|0);
- $34 = ((($9)) + 32|0);
- $35 = ((($9)) + 16|0);
- $36 = ((($7)) + 16|0);
- $37 = ((($9)) + 20|0);
- $38 = ((($3)) + 4|0);
- $39 = ((($7)) + 20|0);
- $40 = ((($$byval_copy9)) + 4|0);
- $41 = ((($4)) + 4|0);
- $42 = +HEAPF32[7736];
- $43 = $42;
- $44 = +HEAPF64[1749];
- $45 = $43 * $44;
- $46 = $45;
- $47 = ((($5)) + 4|0);
- $48 = +HEAPF32[5];
- $49 = $48;
- $50 = $49 * $44;
- $51 = $50;
- $52 = ((($0)) + 24|0);
- ;HEAP32[$$byval_copy9>>2]=HEAP32[$52>>2]|0;HEAP32[$$byval_copy9+4>>2]=HEAP32[$52+4>>2]|0;
- ;HEAP32[$$byval_copy14>>2]=HEAP32[$31>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$31+4>>2]|0;
- _Vector2Subtract_4($1,$$byval_copy9,$$byval_copy14);
- ;HEAP32[$$byval_copy9>>2]=HEAP32[$52>>2]|0;HEAP32[$$byval_copy9+4>>2]=HEAP32[$52+4>>2]|0;
- ;HEAP32[$$byval_copy14>>2]=HEAP32[$32>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$32+4>>2]|0;
- _Vector2Subtract_4($2,$$byval_copy9,$$byval_copy14);
- $53 = +HEAPF32[$33>>2];
- ;HEAP32[$$byval_copy14>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$1+4>>2]|0;
- _MathCross($$byval_copy9,$53,$$byval_copy14);
- $54 = +HEAPF32[$34>>2];
- ;HEAP32[$$byval_copy14>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$2+4>>2]|0;
- _MathCross($3,$54,$$byval_copy14);
- $55 = +HEAPF32[$35>>2];
- $56 = +HEAPF32[$3>>2];
- $57 = $55 + $56;
- $58 = +HEAPF32[$36>>2];
- $59 = $57 - $58;
- $60 = +HEAPF32[$$byval_copy9>>2];
- $61 = $59 - $60;
- HEAPF32[$4>>2] = $61;
- $62 = +HEAPF32[$37>>2];
- $63 = +HEAPF32[$38>>2];
- $64 = $62 + $63;
- $65 = +HEAPF32[$39>>2];
- $66 = $64 - $65;
- $67 = +HEAPF32[$40>>2];
- $68 = $66 - $67;
- HEAPF32[$41>>2] = $68;
- ;HEAP32[$$byval_copy14>>2]=HEAP32[$4>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$4+4>>2]|0;
- $69 = (+_MathLenSqr($$byval_copy14));
- HEAPF32[$5>>2] = $46;
- HEAPF32[$47>>2] = $51;
- ;HEAP32[$$byval_copy14>>2]=HEAP32[$5>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$5+4>>2]|0;
- $70 = (+_MathLenSqr($$byval_copy14));
- $71 = $70 + 9.9999999747524271E-7;
- $72 = $69 < $71;
- if ($72) {
- HEAPF32[$16>>2] = 0.0;
- }
- $73 = ((($0)) + 32|0);
- ;HEAP32[$$byval_copy9>>2]=HEAP32[$73>>2]|0;HEAP32[$$byval_copy9+4>>2]=HEAP32[$73+4>>2]|0;
- ;HEAP32[$$byval_copy14>>2]=HEAP32[$31>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$31+4>>2]|0;
- _Vector2Subtract_4($1,$$byval_copy9,$$byval_copy14);
- ;HEAP32[$$byval_copy9>>2]=HEAP32[$73>>2]|0;HEAP32[$$byval_copy9+4>>2]=HEAP32[$73+4>>2]|0;
- ;HEAP32[$$byval_copy14>>2]=HEAP32[$32>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$32+4>>2]|0;
- _Vector2Subtract_4($2,$$byval_copy9,$$byval_copy14);
- $74 = +HEAPF32[$33>>2];
- ;HEAP32[$$byval_copy14>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$1+4>>2]|0;
- _MathCross($$byval_copy9,$74,$$byval_copy14);
- $75 = +HEAPF32[$34>>2];
- ;HEAP32[$$byval_copy14>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$2+4>>2]|0;
- _MathCross($3,$75,$$byval_copy14);
- $76 = +HEAPF32[$35>>2];
- $77 = +HEAPF32[$3>>2];
- $78 = $76 + $77;
- $79 = +HEAPF32[$36>>2];
- $80 = $78 - $79;
- $81 = +HEAPF32[$$byval_copy9>>2];
- $82 = $80 - $81;
- HEAPF32[$4>>2] = $82;
- $83 = +HEAPF32[$37>>2];
- $84 = +HEAPF32[$38>>2];
- $85 = $83 + $84;
- $86 = +HEAPF32[$39>>2];
- $87 = $85 - $86;
- $88 = +HEAPF32[$40>>2];
- $89 = $87 - $88;
- HEAPF32[$41>>2] = $89;
- ;HEAP32[$$byval_copy14>>2]=HEAP32[$4>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$4+4>>2]|0;
- $90 = (+_MathLenSqr($$byval_copy14));
- HEAPF32[$5>>2] = $46;
- HEAPF32[$47>>2] = $51;
- ;HEAP32[$$byval_copy14>>2]=HEAP32[$5>>2]|0;HEAP32[$$byval_copy14+4>>2]=HEAP32[$5+4>>2]|0;
- $91 = (+_MathLenSqr($$byval_copy14));
- $92 = $91 + 9.9999999747524271E-7;
- $93 = $90 < $92;
- if (!($93)) {
- STACKTOP = sp;return;
- }
- HEAPF32[$16>>2] = 0.0;
- STACKTOP = sp;return;
- }
- function _IntegratePhysicsImpulses($0) {
- $0 = $0|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 144|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(144|0);
- $tmpcast137$byval_copy = sp + 136|0;
- $$byval_copy29 = sp + 128|0;
- $1 = sp + 40|0;
- $2 = sp + 32|0;
- $3 = sp + 8|0;
- $4 = sp + 120|0;
- $5 = sp + 112|0;
- $6 = sp + 104|0;
- $7 = sp + 96|0;
- $8 = sp + 24|0;
- $9 = sp + 88|0;
- $10 = sp + 80|0;
- $11 = sp + 72|0;
- $12 = sp + 64|0;
- $13 = sp + 56|0;
- $14 = sp + 16|0;
- $15 = sp;
- $16 = sp + 48|0;
- $17 = ((($0)) + 4|0);
- $18 = HEAP32[$17>>2]|0;
- $19 = ((($0)) + 8|0);
- $20 = HEAP32[$19>>2]|0;
- $21 = ((($18)) + 56|0);
- $22 = +HEAPF32[$21>>2];
- $23 = ((($20)) + 56|0);
- $24 = +HEAPF32[$23>>2];
- $25 = $22 + $24;
- $fabsf = (+Math_abs((+$25)));
- $26 = !($fabsf <= 9.9999999747524271E-7);
- if (!($26)) {
- $$sroa$050$0$$sroa_idx = ((($18)) + 16|0);
- HEAPF32[$$sroa$050$0$$sroa_idx>>2] = 0.0;
- $$sroa$251$0$$sroa_idx52 = ((($18)) + 20|0);
- HEAPF32[$$sroa$251$0$$sroa_idx52>>2] = 0.0;
- $$sroa$047$0$$sroa_idx = ((($20)) + 16|0);
- HEAPF32[$$sroa$047$0$$sroa_idx>>2] = 0.0;
- $$sroa$248$0$$sroa_idx49 = ((($20)) + 20|0);
- HEAPF32[$$sroa$248$0$$sroa_idx49>>2] = 0.0;
- STACKTOP = sp;return;
- }
- $27 = ((($0)) + 40|0);
- $28 = HEAP32[$27>>2]|0;
- $29 = ($28|0)==(0);
- if ($29) {
- STACKTOP = sp;return;
- }
- $30 = ((($18)) + 8|0);
- $31 = ((($20)) + 8|0);
- $32 = ((($20)) + 16|0);
- $33 = ((($20)) + 32|0);
- $34 = ((($18)) + 16|0);
- $35 = ((($18)) + 32|0);
- $36 = ((($20)) + 20|0);
- $37 = ((($6)) + 4|0);
- $38 = ((($18)) + 20|0);
- $39 = ((($7)) + 4|0);
- $40 = ((($3)) + 4|0);
- $41 = ((($0)) + 16|0);
- $42 = ((($18)) + 48|0);
- $43 = ((($20)) + 48|0);
- $44 = ((($0)) + 44|0);
- $45 = ((($8)) + 4|0);
- $46 = ((($0)) + 20|0);
- $47 = ((($18)) + 4|0);
- $48 = ((($20)) + 4|0);
- $49 = ((($12)) + 4|0);
- $50 = ((($13)) + 4|0);
- $51 = ((($14)) + 4|0);
- $52 = ((($0)) + 52|0);
- $$sroa$2$0$$sroa_idx2 = ((($15)) + 4|0);
- $53 = ((($20)) + 80|0);
- $54 = ((($18)) + 80|0);
- $55 = ((($16)) + 4|0);
- $56 = ((($0)) + 48|0);
- $57 = ((($20)) + 80|0);
- $58 = ((($18)) + 80|0);
- $59 = ((($9)) + 4|0);
- $$0135139 = 0;
- while(1) {
- $63 = (((($0)) + 24|0) + ($$0135139<<3)|0);
- ;HEAP32[$$byval_copy29>>2]=HEAP32[$63>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$63+4>>2]|0;
- ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$30>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$30+4>>2]|0;
- _Vector2Subtract_4($1,$$byval_copy29,$tmpcast137$byval_copy);
- ;HEAP32[$$byval_copy29>>2]=HEAP32[$63>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$63+4>>2]|0;
- ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$31>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$31+4>>2]|0;
- _Vector2Subtract_4($2,$$byval_copy29,$tmpcast137$byval_copy);
- $64 = +HEAPF32[$32>>2];
- $65 = +HEAPF32[$33>>2];
- ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$2>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$2+4>>2]|0;
- _MathCross($4,$65,$tmpcast137$byval_copy);
- $66 = +HEAPF32[$4>>2];
- $67 = $64 + $66;
- $68 = +HEAPF32[$34>>2];
- $69 = $67 - $68;
- $70 = +HEAPF32[$35>>2];
- ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$1+4>>2]|0;
- _MathCross($5,$70,$tmpcast137$byval_copy);
- $71 = +HEAPF32[$5>>2];
- $72 = $69 - $71;
- HEAPF32[$3>>2] = $72;
- $73 = +HEAPF32[$36>>2];
- $74 = +HEAPF32[$33>>2];
- ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$2>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$2+4>>2]|0;
- _MathCross($6,$74,$tmpcast137$byval_copy);
- $75 = +HEAPF32[$37>>2];
- $76 = $73 + $75;
- $77 = +HEAPF32[$38>>2];
- $78 = $76 - $77;
- $79 = +HEAPF32[$35>>2];
- ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$1+4>>2]|0;
- _MathCross($7,$79,$tmpcast137$byval_copy);
- $80 = +HEAPF32[$39>>2];
- $81 = $78 - $80;
- HEAPF32[$40>>2] = $81;
- ;HEAP32[$$byval_copy29>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$3+4>>2]|0;
- ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$41>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$41+4>>2]|0;
- $82 = (+_MathDot($$byval_copy29,$tmpcast137$byval_copy));
- $83 = $82 > 0.0;
- if ($83) {
- $$1 = 1;
- } else {
- ;HEAP32[$$byval_copy29>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$1+4>>2]|0;
- ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$41>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$41+4>>2]|0;
- $84 = (+_MathCrossVector2($$byval_copy29,$tmpcast137$byval_copy));
- ;HEAP32[$$byval_copy29>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$2+4>>2]|0;
- ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$41>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$41+4>>2]|0;
- $85 = (+_MathCrossVector2($$byval_copy29,$tmpcast137$byval_copy));
- $86 = +HEAPF32[$21>>2];
- $87 = +HEAPF32[$23>>2];
- $88 = $86 + $87;
- $89 = $84 * $84;
- $90 = +HEAPF32[$42>>2];
- $91 = $89 * $90;
- $92 = $88 + $91;
- $93 = $85 * $85;
- $94 = +HEAPF32[$43>>2];
- $95 = $93 * $94;
- $96 = $92 + $95;
- $97 = +HEAPF32[$44>>2];
- $98 = $97 + 1.0;
- $99 = $82 * $98;
- $100 = -$99;
- $101 = $100 / $96;
- $102 = HEAP32[$27>>2]|0;
- $103 = (+($102>>>0));
- $104 = $101 / $103;
- $105 = +HEAPF32[$41>>2];
- $106 = $105 * $104;
- HEAPF32[$8>>2] = $106;
- $107 = +HEAPF32[$46>>2];
- $108 = $104 * $107;
- HEAPF32[$45>>2] = $108;
- $109 = HEAP32[$47>>2]|0;
- $110 = ($109|0)==(0);
- if (!($110)) {
- $111 = +HEAPF32[$21>>2];
- $112 = +HEAPF32[$8>>2];
- $113 = $111 * $112;
- $114 = +HEAPF32[$34>>2];
- $115 = $114 - $113;
- HEAPF32[$34>>2] = $115;
- $116 = +HEAPF32[$45>>2];
- $117 = $111 * $116;
- $118 = +HEAPF32[$38>>2];
- $119 = $118 - $117;
- HEAPF32[$38>>2] = $119;
- $120 = HEAP32[$58>>2]|0;
- $121 = ($120|0)==(0);
- if ($121) {
- $122 = +HEAPF32[$42>>2];
- $123 = +HEAPF32[$8>>2];
- $124 = -$123;
- HEAPF32[$9>>2] = $124;
- $125 = +HEAPF32[$45>>2];
- $126 = -$125;
- HEAPF32[$59>>2] = $126;
- ;HEAP32[$$byval_copy29>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$1+4>>2]|0;
- ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$9>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$9+4>>2]|0;
- $127 = (+_MathCrossVector2($$byval_copy29,$tmpcast137$byval_copy));
- $128 = $122 * $127;
- $129 = +HEAPF32[$35>>2];
- $130 = $129 + $128;
- HEAPF32[$35>>2] = $130;
- }
- }
- $131 = HEAP32[$48>>2]|0;
- $132 = ($131|0)==(0);
- if (!($132)) {
- $133 = +HEAPF32[$23>>2];
- $134 = +HEAPF32[$8>>2];
- $135 = $133 * $134;
- $136 = +HEAPF32[$32>>2];
- $137 = $136 + $135;
- HEAPF32[$32>>2] = $137;
- $138 = +HEAPF32[$45>>2];
- $139 = $133 * $138;
- $140 = +HEAPF32[$36>>2];
- $141 = $140 + $139;
- HEAPF32[$36>>2] = $141;
- $142 = HEAP32[$57>>2]|0;
- $143 = ($142|0)==(0);
- if ($143) {
- $144 = +HEAPF32[$43>>2];
- ;HEAP32[$$byval_copy29>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$2+4>>2]|0;
- ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$8>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$8+4>>2]|0;
- $145 = (+_MathCrossVector2($$byval_copy29,$tmpcast137$byval_copy));
- $146 = $144 * $145;
- $147 = +HEAPF32[$33>>2];
- $148 = $147 + $146;
- HEAPF32[$33>>2] = $148;
- }
- }
- $149 = +HEAPF32[$32>>2];
- $150 = +HEAPF32[$33>>2];
- ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$2>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$2+4>>2]|0;
- _MathCross($10,$150,$tmpcast137$byval_copy);
- $151 = +HEAPF32[$10>>2];
- $152 = $149 + $151;
- $153 = +HEAPF32[$34>>2];
- $154 = $152 - $153;
- $155 = +HEAPF32[$35>>2];
- ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$1+4>>2]|0;
- _MathCross($11,$155,$tmpcast137$byval_copy);
- $156 = +HEAPF32[$11>>2];
- $157 = $154 - $156;
- HEAPF32[$3>>2] = $157;
- $158 = +HEAPF32[$36>>2];
- $159 = +HEAPF32[$33>>2];
- ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$2>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$2+4>>2]|0;
- _MathCross($12,$159,$tmpcast137$byval_copy);
- $160 = +HEAPF32[$49>>2];
- $161 = $158 + $160;
- $162 = +HEAPF32[$38>>2];
- $163 = $161 - $162;
- $164 = +HEAPF32[$35>>2];
- ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$1+4>>2]|0;
- _MathCross($13,$164,$tmpcast137$byval_copy);
- $165 = +HEAPF32[$50>>2];
- $166 = $163 - $165;
- HEAPF32[$40>>2] = $166;
- $167 = +HEAPF32[$3>>2];
- $168 = +HEAPF32[$41>>2];
- ;HEAP32[$$byval_copy29>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$3+4>>2]|0;
- ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$41>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$41+4>>2]|0;
- $169 = (+_MathDot($$byval_copy29,$tmpcast137$byval_copy));
- $170 = $168 * $169;
- $171 = $167 - $170;
- HEAPF32[$14>>2] = $171;
- $172 = +HEAPF32[$40>>2];
- $173 = +HEAPF32[$46>>2];
- ;HEAP32[$$byval_copy29>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$3+4>>2]|0;
- ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$41>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$41+4>>2]|0;
- $174 = (+_MathDot($$byval_copy29,$tmpcast137$byval_copy));
- $175 = $173 * $174;
- $176 = $172 - $175;
- HEAPF32[$51>>2] = $176;
- _MathNormalize($14);
- ;HEAP32[$$byval_copy29>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$3+4>>2]|0;
- ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$14>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$14+4>>2]|0;
- $177 = (+_MathDot($$byval_copy29,$tmpcast137$byval_copy));
- $178 = -$177;
- $179 = $178 / $96;
- $180 = HEAP32[$27>>2]|0;
- $181 = (+($180>>>0));
- $182 = $179 / $181;
- $fabsf136 = (+Math_abs((+$182)));
- $183 = !($fabsf136 <= 9.9999999747524271E-7);
- if ($183) {
- $184 = $15;
- $185 = $184;
- HEAP32[$185>>2] = 0;
- $186 = (($184) + 4)|0;
- $187 = $186;
- HEAP32[$187>>2] = 0;
- $188 = +HEAPF32[$52>>2];
- $189 = $104 * $188;
- $190 = $fabsf136 < $189;
- $191 = +HEAPF32[$14>>2];
- $192 = +HEAPF32[$51>>2];
- if ($190) {
- $193 = $182 * $191;
- $194 = $182 * $192;
- $$sink = $194;$$sink138 = $193;
- } else {
- $195 = -$104;
- $196 = $191 * $195;
- $197 = +HEAPF32[$56>>2];
- $198 = $196 * $197;
- $199 = $192 * $195;
- $200 = $199 * $197;
- $$sink = $200;$$sink138 = $198;
- }
- HEAPF32[$15>>2] = $$sink138;
- HEAPF32[$$sroa$2$0$$sroa_idx2>>2] = $$sink;
- $201 = HEAP32[$47>>2]|0;
- $202 = ($201|0)==(0);
- if (!($202)) {
- $203 = +HEAPF32[$21>>2];
- $204 = +HEAPF32[$15>>2];
- $205 = $203 * $204;
- $206 = +HEAPF32[$34>>2];
- $207 = $206 - $205;
- HEAPF32[$34>>2] = $207;
- $208 = +HEAPF32[$$sroa$2$0$$sroa_idx2>>2];
- $209 = $203 * $208;
- $210 = +HEAPF32[$38>>2];
- $211 = $210 - $209;
- HEAPF32[$38>>2] = $211;
- $212 = HEAP32[$54>>2]|0;
- $213 = ($212|0)==(0);
- if ($213) {
- $214 = +HEAPF32[$42>>2];
- $215 = +HEAPF32[$15>>2];
- $216 = -$215;
- HEAPF32[$16>>2] = $216;
- $217 = +HEAPF32[$$sroa$2$0$$sroa_idx2>>2];
- $218 = -$217;
- HEAPF32[$55>>2] = $218;
- ;HEAP32[$$byval_copy29>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$1+4>>2]|0;
- ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$16>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$16+4>>2]|0;
- $219 = (+_MathCrossVector2($$byval_copy29,$tmpcast137$byval_copy));
- $220 = $214 * $219;
- $221 = +HEAPF32[$35>>2];
- $222 = $221 + $220;
- HEAPF32[$35>>2] = $222;
- }
- }
- $223 = HEAP32[$48>>2]|0;
- $224 = ($223|0)==(0);
- if (!($224)) {
- $225 = +HEAPF32[$23>>2];
- $226 = +HEAPF32[$15>>2];
- $227 = $225 * $226;
- $228 = +HEAPF32[$32>>2];
- $229 = $228 + $227;
- HEAPF32[$32>>2] = $229;
- $230 = +HEAPF32[$$sroa$2$0$$sroa_idx2>>2];
- $231 = $225 * $230;
- $232 = +HEAPF32[$36>>2];
- $233 = $232 + $231;
- HEAPF32[$36>>2] = $233;
- $234 = HEAP32[$53>>2]|0;
- $235 = ($234|0)==(0);
- if ($235) {
- $236 = +HEAPF32[$43>>2];
- ;HEAP32[$$byval_copy29>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy29+4>>2]=HEAP32[$2+4>>2]|0;
- ;HEAP32[$tmpcast137$byval_copy>>2]=HEAP32[$15>>2]|0;HEAP32[$tmpcast137$byval_copy+4>>2]=HEAP32[$15+4>>2]|0;
- $237 = (+_MathCrossVector2($$byval_copy29,$tmpcast137$byval_copy));
- $238 = $236 * $237;
- $239 = +HEAPF32[$33>>2];
- $240 = $239 + $238;
- HEAPF32[$33>>2] = $240;
- }
- }
- $$0 = 0;
- } else {
- $$0 = 1;
- }
- $$1 = $$0;
- }
- $cond1 = ($$1|0)==(0);
- $62 = (($$0135139) + 1)|0;
- if (!($cond1)) {
- label = 26;
- break;
- }
- $60 = HEAP32[$27>>2]|0;
- $61 = ($62>>>0)<($60>>>0);
- if ($61) {
- $$0135139 = $62;
- } else {
- label = 26;
- break;
- }
- }
- if ((label|0) == 26) {
- STACKTOP = sp;return;
- }
- }
- function _IntegratePhysicsVelocity($0) {
- $0 = $0|0;
- 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;
- 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;
- sp = STACKTOP;
- $1 = ((($0)) + 4|0);
- $2 = HEAP32[$1>>2]|0;
- $3 = ($2|0)==(0);
- if ($3) {
- return;
- }
- $4 = ((($0)) + 16|0);
- $5 = +HEAPF32[$4>>2];
- $6 = $5;
- $7 = +HEAPF64[1749];
- $8 = $6 * $7;
- $9 = ((($0)) + 8|0);
- $10 = +HEAPF32[$9>>2];
- $11 = $10;
- $12 = $8 + $11;
- $13 = $12;
- HEAPF32[$9>>2] = $13;
- $14 = ((($0)) + 20|0);
- $15 = +HEAPF32[$14>>2];
- $16 = $15;
- $17 = $7 * $16;
- $18 = ((($0)) + 12|0);
- $19 = +HEAPF32[$18>>2];
- $20 = $19;
- $21 = $20 + $17;
- $22 = $21;
- HEAPF32[$18>>2] = $22;
- $23 = ((($0)) + 80|0);
- $24 = HEAP32[$23>>2]|0;
- $25 = ($24|0)==(0);
- if ($25) {
- $26 = ((($0)) + 32|0);
- $27 = +HEAPF32[$26>>2];
- $28 = $27;
- $29 = $7 * $28;
- $30 = ((($0)) + 40|0);
- $31 = +HEAPF32[$30>>2];
- $32 = $31;
- $33 = $32 + $29;
- $34 = $33;
- HEAPF32[$30>>2] = $34;
- }
- $35 = ((($0)) + 484|0);
- $36 = ((($0)) + 40|0);
- $37 = +HEAPF32[$36>>2];
- _Mat2Set($35,$37);
- _IntegratePhysicsForces($0);
- return;
- }
- function _CorrectPhysicsPositions($0) {
- $0 = $0|0;
- 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;
- 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;
- var $46 = 0.0, $5 = 0, $6 = 0.0, $7 = 0.0, $8 = 0, $9 = 0.0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = ((($0)) + 4|0);
- $2 = HEAP32[$1>>2]|0;
- $3 = ((($0)) + 8|0);
- $4 = HEAP32[$3>>2]|0;
- $5 = ((($0)) + 12|0);
- $6 = +HEAPF32[$5>>2];
- $7 = $6 + -0.05000000074505806;
- $8 = $7 > 0.0;
- $9 = $8 ? $7 : 0.0;
- $10 = ((($2)) + 56|0);
- $11 = +HEAPF32[$10>>2];
- $12 = ((($4)) + 56|0);
- $13 = +HEAPF32[$12>>2];
- $14 = $11 + $13;
- $15 = $9 / $14;
- $16 = ((($0)) + 16|0);
- $17 = +HEAPF32[$16>>2];
- $18 = $17 * $15;
- $19 = $18 * 0.40000000596046448;
- $20 = ((($0)) + 20|0);
- $21 = +HEAPF32[$20>>2];
- $22 = $15 * $21;
- $23 = $22 * 0.40000000596046448;
- $24 = ((($2)) + 4|0);
- $25 = HEAP32[$24>>2]|0;
- $26 = ($25|0)==(0);
- if (!($26)) {
- $27 = $11 * $19;
- $28 = ((($2)) + 8|0);
- $29 = +HEAPF32[$28>>2];
- $30 = $29 - $27;
- HEAPF32[$28>>2] = $30;
- $31 = $11 * $23;
- $32 = ((($2)) + 12|0);
- $33 = +HEAPF32[$32>>2];
- $34 = $33 - $31;
- HEAPF32[$32>>2] = $34;
- }
- $35 = ((($4)) + 4|0);
- $36 = HEAP32[$35>>2]|0;
- $37 = ($36|0)==(0);
- if ($37) {
- return;
- }
- $38 = +HEAPF32[$12>>2];
- $39 = $19 * $38;
- $40 = ((($4)) + 8|0);
- $41 = +HEAPF32[$40>>2];
- $42 = $41 + $39;
- HEAPF32[$40>>2] = $42;
- $43 = $23 * $38;
- $44 = ((($4)) + 12|0);
- $45 = +HEAPF32[$44>>2];
- $46 = $43 + $45;
- HEAPF32[$44>>2] = $46;
- return;
- }
- function _SolveCircleToCircle($0) {
- $0 = $0|0;
- 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;
- 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;
- 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;
- var $8 = 0.0, $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
- $$byval_copy2 = sp + 16|0;
- $$byval_copy = sp + 8|0;
- $1 = sp;
- $2 = ((($0)) + 4|0);
- $3 = HEAP32[$2>>2]|0;
- $4 = ((($0)) + 8|0);
- $5 = HEAP32[$4>>2]|0;
- $6 = ((($5)) + 8|0);
- $7 = ((($3)) + 8|0);
- ;HEAP32[$$byval_copy>>2]=HEAP32[$6>>2]|0;HEAP32[$$byval_copy+4>>2]=HEAP32[$6+4>>2]|0;
- ;HEAP32[$$byval_copy2>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$7+4>>2]|0;
- _Vector2Subtract_4($1,$$byval_copy,$$byval_copy2);
- ;HEAP32[$$byval_copy2>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$1+4>>2]|0;
- $8 = (+_MathLenSqr($$byval_copy2));
- $9 = ((($3)) + 92|0);
- $10 = +HEAPF32[$9>>2];
- $11 = ((($5)) + 92|0);
- $12 = +HEAPF32[$11>>2];
- $13 = $10 + $12;
- $14 = $13 * $13;
- $15 = !($8 >= $14);
- if (!($15)) {
- $16 = ((($0)) + 40|0);
- HEAP32[$16>>2] = 0;
- STACKTOP = sp;return;
- }
- $17 = (+Math_sqrt((+$8)));
- $18 = ((($0)) + 40|0);
- HEAP32[$18>>2] = 1;
- $19 = $17 == 0.0;
- if ($19) {
- $20 = HEAP32[$9>>2]|0;
- $21 = ((($0)) + 12|0);
- HEAP32[$21>>2] = $20;
- $$sroa$05$0$$sroa_idx = ((($0)) + 16|0);
- HEAPF32[$$sroa$05$0$$sroa_idx>>2] = 1.0;
- $$sroa$26$0$$sroa_idx7 = ((($0)) + 20|0);
- HEAPF32[$$sroa$26$0$$sroa_idx7>>2] = 0.0;
- $22 = ((($0)) + 24|0);
- $23 = $7;
- $24 = $23;
- $25 = HEAP32[$24>>2]|0;
- $26 = (($23) + 4)|0;
- $27 = $26;
- $28 = HEAP32[$27>>2]|0;
- $29 = $22;
- $30 = $29;
- HEAP32[$30>>2] = $25;
- $31 = (($29) + 4)|0;
- $32 = $31;
- HEAP32[$32>>2] = $28;
- } else {
- $33 = $13 - $17;
- $34 = ((($0)) + 12|0);
- HEAPF32[$34>>2] = $33;
- $35 = +HEAPF32[$1>>2];
- $36 = $35 / $17;
- $37 = ((($1)) + 4|0);
- $38 = +HEAPF32[$37>>2];
- $39 = $38 / $17;
- $$sroa$02$0$$sroa_idx = ((($0)) + 16|0);
- HEAPF32[$$sroa$02$0$$sroa_idx>>2] = $36;
- $$sroa$23$0$$sroa_idx4 = ((($0)) + 20|0);
- HEAPF32[$$sroa$23$0$$sroa_idx4>>2] = $39;
- $40 = +HEAPF32[$9>>2];
- $41 = $36 * $40;
- $42 = +HEAPF32[$7>>2];
- $43 = $41 + $42;
- $44 = $39 * $40;
- $45 = ((($3)) + 12|0);
- $46 = +HEAPF32[$45>>2];
- $47 = $44 + $46;
- $$sroa$0$0$$sroa_idx = ((($0)) + 24|0);
- HEAPF32[$$sroa$0$0$$sroa_idx>>2] = $43;
- $$sroa$2$0$$sroa_idx1 = ((($0)) + 28|0);
- HEAPF32[$$sroa$2$0$$sroa_idx1>>2] = $47;
- }
- $48 = ((($3)) + 76|0);
- $49 = HEAP32[$48>>2]|0;
- $50 = ($49|0)==(0);
- if (!($50)) {
- STACKTOP = sp;return;
- }
- $51 = ((($0)) + 20|0);
- $52 = +HEAPF32[$51>>2];
- $53 = $52 < 0.0;
- $54 = $53&1;
- HEAP32[$48>>2] = $54;
- STACKTOP = sp;return;
- }
- function _SolveCircleToPolygon($0) {
- $0 = $0|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- var $tmpcast104$byval_copy42 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 608|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(608|0);
- $tmpcast104$byval_copy42 = sp + 584|0;
- $$byval_copy41 = sp + 568|0;
- $1 = sp + 24|0;
- $2 = sp + 552|0;
- $3 = sp + 544|0;
- $4 = sp + 88|0;
- $5 = sp + 536|0;
- $6 = sp + 16|0;
- $7 = sp + 8|0;
- $8 = sp;
- $9 = sp + 528|0;
- $10 = sp + 520|0;
- $11 = sp + 512|0;
- $12 = sp + 504|0;
- $13 = sp + 80|0;
- $14 = sp + 72|0;
- $15 = sp + 64|0;
- $16 = sp + 56|0;
- $17 = sp + 48|0;
- $18 = sp + 40|0;
- $19 = sp + 496|0;
- $20 = sp + 32|0;
- $21 = ((($0)) + 4|0);
- $22 = HEAP32[$21>>2]|0;
- $23 = ((($0)) + 8|0);
- $24 = HEAP32[$23>>2]|0;
- $25 = ((($0)) + 40|0);
- HEAP32[$25>>2] = 0;
- $26 = ((($22)) + 8|0);
- $27 = $26;
- $28 = $27;
- $29 = HEAP32[$28>>2]|0;
- $30 = (($27) + 4)|0;
- $31 = $30;
- $32 = HEAP32[$31>>2]|0;
- $33 = $1;
- $34 = $33;
- HEAP32[$34>>2] = $29;
- $35 = (($33) + 4)|0;
- $36 = $35;
- HEAP32[$36>>2] = $32;
- $37 = ((($24)) + 96|0);
- $38 = ((($24)) + 484|0);
- ;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;
- _Mat2Transpose($2,$tmpcast104$byval_copy42);
- $39 = ((($24)) + 8|0);
- ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$39>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$39+4>>2]|0;
- _Vector2Subtract_4($3,$$byval_copy41,$tmpcast104$byval_copy42);
- ;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;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$3>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$3+4>>2]|0;
- _Mat2MultiplyVector2($1,$$byval_copy41,$tmpcast104$byval_copy42);
- _memcpy(($4|0),($37|0),404)|0;
- $40 = HEAP32[$4>>2]|0;
- $41 = ($40|0)==(0);
- L1: do {
- if ($41) {
- $$0$lcssa = -3.4028234663852886E+38;$$093$lcssa = 0;
- } else {
- $42 = ((($22)) + 92|0);
- $$0125 = -3.4028234663852886E+38;$$093124 = 0;$$097123 = 0;
- while(1) {
- $43 = (((($4)) + 196|0) + ($$097123<<3)|0);
- $44 = (((($4)) + 4|0) + ($$097123<<3)|0);
- ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$44>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$44+4>>2]|0;
- _Vector2Subtract_4($5,$$byval_copy41,$tmpcast104$byval_copy42);
- ;HEAP32[$$byval_copy41>>2]=HEAP32[$43>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$43+4>>2]|0;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$5>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$5+4>>2]|0;
- $45 = (+_MathDot($$byval_copy41,$tmpcast104$byval_copy42));
- $46 = +HEAPF32[$42>>2];
- $47 = $45 > $46;
- $48 = $45 > $$0125;
- if ($47) {
- break;
- }
- $$1 = $48 ? $45 : $$0125;
- $$194 = $48 ? $$097123 : $$093124;
- $49 = (($$097123) + 1)|0;
- $50 = HEAP32[$4>>2]|0;
- $51 = ($49>>>0)<($50>>>0);
- if ($51) {
- $$0125 = $$1;$$093124 = $$194;$$097123 = $49;
- } else {
- $$0$lcssa = $$1;$$093$lcssa = $$194;
- break L1;
- }
- }
- STACKTOP = sp;return;
- }
- } while(0);
- $52 = (((($4)) + 4|0) + ($$093$lcssa<<3)|0);
- $53 = $52;
- $54 = $53;
- $55 = HEAP32[$54>>2]|0;
- $56 = (($53) + 4)|0;
- $57 = $56;
- $58 = HEAP32[$57>>2]|0;
- $59 = $6;
- $60 = $59;
- HEAP32[$60>>2] = $55;
- $61 = (($59) + 4)|0;
- $62 = $61;
- HEAP32[$62>>2] = $58;
- $63 = (($$093$lcssa) + 1)|0;
- $64 = HEAP32[$4>>2]|0;
- $65 = ($63>>>0)<($64>>>0);
- $66 = $65 ? $63 : 0;
- $67 = (((($4)) + 4|0) + ($66<<3)|0);
- $68 = $67;
- $69 = $68;
- $70 = HEAP32[$69>>2]|0;
- $71 = (($68) + 4)|0;
- $72 = $71;
- $73 = HEAP32[$72>>2]|0;
- $74 = $7;
- $75 = $74;
- HEAP32[$75>>2] = $70;
- $76 = (($74) + 4)|0;
- $77 = $76;
- HEAP32[$77>>2] = $73;
- $78 = $$0$lcssa < 9.9999999747524271E-7;
- do {
- if ($78) {
- HEAP32[$25>>2] = 1;
- $79 = ((($4)) + 388|0);
- $80 = (((($4)) + 196|0) + ($$093$lcssa<<3)|0);
- ;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;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$80>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$80+4>>2]|0;
- _Mat2MultiplyVector2($8,$$byval_copy41,$tmpcast104$byval_copy42);
- $81 = +HEAPF32[$8>>2];
- $82 = -$81;
- $83 = ((($8)) + 4|0);
- $84 = +HEAPF32[$83>>2];
- $85 = -$84;
- $$sroa$014$0$$sroa_idx = ((($0)) + 16|0);
- HEAPF32[$$sroa$014$0$$sroa_idx>>2] = $82;
- $$sroa$215$0$$sroa_idx16 = ((($0)) + 20|0);
- HEAPF32[$$sroa$215$0$$sroa_idx16>>2] = $85;
- $86 = ((($22)) + 92|0);
- $87 = +HEAPF32[$86>>2];
- $88 = $87 * $82;
- $89 = +HEAPF32[$26>>2];
- $90 = $88 + $89;
- $91 = $87 * $85;
- $92 = ((($22)) + 12|0);
- $93 = +HEAPF32[$92>>2];
- $94 = $91 + $93;
- $$sroa$011$0$$sroa_idx = ((($0)) + 24|0);
- HEAPF32[$$sroa$011$0$$sroa_idx>>2] = $90;
- $$sroa$212$0$$sroa_idx13 = ((($0)) + 28|0);
- HEAPF32[$$sroa$212$0$$sroa_idx13>>2] = $94;
- $95 = HEAP32[$86>>2]|0;
- $96 = ((($0)) + 12|0);
- HEAP32[$96>>2] = $95;
- } else {
- ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$6>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$6+4>>2]|0;
- _Vector2Subtract_4($9,$$byval_copy41,$tmpcast104$byval_copy42);
- ;HEAP32[$$byval_copy41>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$7+4>>2]|0;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$6>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$6+4>>2]|0;
- _Vector2Subtract_4($10,$$byval_copy41,$tmpcast104$byval_copy42);
- ;HEAP32[$$byval_copy41>>2]=HEAP32[$9>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$9+4>>2]|0;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$10>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$10+4>>2]|0;
- $97 = (+_MathDot($$byval_copy41,$tmpcast104$byval_copy42));
- ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$7>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$7+4>>2]|0;
- _Vector2Subtract_4($11,$$byval_copy41,$tmpcast104$byval_copy42);
- ;HEAP32[$$byval_copy41>>2]=HEAP32[$6>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$6+4>>2]|0;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$7>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$7+4>>2]|0;
- _Vector2Subtract_4($12,$$byval_copy41,$tmpcast104$byval_copy42);
- ;HEAP32[$$byval_copy41>>2]=HEAP32[$11>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$11+4>>2]|0;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$12>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$12+4>>2]|0;
- $98 = (+_MathDot($$byval_copy41,$tmpcast104$byval_copy42));
- $99 = ((($22)) + 92|0);
- $100 = +HEAPF32[$99>>2];
- $101 = $100 - $$0$lcssa;
- $102 = ((($0)) + 12|0);
- HEAPF32[$102>>2] = $101;
- $103 = !($97 <= 0.0);
- if (!($103)) {
- ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$6>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$6+4>>2]|0;
- $104 = (+_DistSqr($$byval_copy41,$tmpcast104$byval_copy42));
- $105 = +HEAPF32[$99>>2];
- $106 = $105 * $105;
- $107 = $104 > $106;
- if ($107) {
- break;
- }
- HEAP32[$25>>2] = 1;
- ;HEAP32[$$byval_copy41>>2]=HEAP32[$6>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$6+4>>2]|0;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$1+4>>2]|0;
- _Vector2Subtract_4($8,$$byval_copy41,$tmpcast104$byval_copy42);
- $108 = ((($4)) + 388|0);
- ;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;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$8>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$8+4>>2]|0;
- _Mat2MultiplyVector2($13,$$byval_copy41,$tmpcast104$byval_copy42);
- $109 = $13;
- $110 = $109;
- $111 = HEAP32[$110>>2]|0;
- $112 = (($109) + 4)|0;
- $113 = $112;
- $114 = HEAP32[$113>>2]|0;
- $115 = $8;
- $116 = $115;
- HEAP32[$116>>2] = $111;
- $117 = (($115) + 4)|0;
- $118 = $117;
- HEAP32[$118>>2] = $114;
- _MathNormalize($8);
- $119 = ((($0)) + 16|0);
- $120 = $8;
- $121 = $120;
- $122 = HEAP32[$121>>2]|0;
- $123 = (($120) + 4)|0;
- $124 = $123;
- $125 = HEAP32[$124>>2]|0;
- $126 = $119;
- $127 = $126;
- HEAP32[$127>>2] = $122;
- $128 = (($126) + 4)|0;
- $129 = $128;
- HEAP32[$129>>2] = $125;
- ;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;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$6>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$6+4>>2]|0;
- _Mat2MultiplyVector2($14,$$byval_copy41,$tmpcast104$byval_copy42);
- $130 = $14;
- $131 = $130;
- $132 = HEAP32[$131>>2]|0;
- $133 = (($130) + 4)|0;
- $134 = $133;
- $135 = HEAP32[$134>>2]|0;
- $136 = $6;
- $137 = $136;
- HEAP32[$137>>2] = $132;
- $138 = (($136) + 4)|0;
- $139 = $138;
- HEAP32[$139>>2] = $135;
- ;HEAP32[$$byval_copy41>>2]=HEAP32[$6>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$6+4>>2]|0;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$39>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$39+4>>2]|0;
- _Vector2Add_2($15,$$byval_copy41,$tmpcast104$byval_copy42);
- $140 = $15;
- $141 = $140;
- $142 = HEAP32[$141>>2]|0;
- $143 = (($140) + 4)|0;
- $144 = $143;
- $145 = HEAP32[$144>>2]|0;
- $146 = $6;
- $147 = $146;
- HEAP32[$147>>2] = $142;
- $148 = (($146) + 4)|0;
- $149 = $148;
- HEAP32[$149>>2] = $145;
- $150 = ((($0)) + 24|0);
- $151 = $150;
- $152 = $151;
- HEAP32[$152>>2] = $142;
- $153 = (($151) + 4)|0;
- $154 = $153;
- HEAP32[$154>>2] = $145;
- break;
- }
- $155 = !($98 <= 0.0);
- if (!($155)) {
- ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$7>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$7+4>>2]|0;
- $156 = (+_DistSqr($$byval_copy41,$tmpcast104$byval_copy42));
- $157 = +HEAPF32[$99>>2];
- $158 = $157 * $157;
- $159 = $156 > $158;
- if ($159) {
- break;
- }
- HEAP32[$25>>2] = 1;
- ;HEAP32[$$byval_copy41>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$7+4>>2]|0;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$1+4>>2]|0;
- _Vector2Subtract_4($8,$$byval_copy41,$tmpcast104$byval_copy42);
- $160 = ((($4)) + 388|0);
- ;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;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$7>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$7+4>>2]|0;
- _Mat2MultiplyVector2($16,$$byval_copy41,$tmpcast104$byval_copy42);
- $161 = $16;
- $162 = $161;
- $163 = HEAP32[$162>>2]|0;
- $164 = (($161) + 4)|0;
- $165 = $164;
- $166 = HEAP32[$165>>2]|0;
- $167 = $7;
- $168 = $167;
- HEAP32[$168>>2] = $163;
- $169 = (($167) + 4)|0;
- $170 = $169;
- HEAP32[$170>>2] = $166;
- ;HEAP32[$$byval_copy41>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$7+4>>2]|0;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$39>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$39+4>>2]|0;
- _Vector2Add_2($17,$$byval_copy41,$tmpcast104$byval_copy42);
- $171 = $17;
- $172 = $171;
- $173 = HEAP32[$172>>2]|0;
- $174 = (($171) + 4)|0;
- $175 = $174;
- $176 = HEAP32[$175>>2]|0;
- $177 = $7;
- $178 = $177;
- HEAP32[$178>>2] = $173;
- $179 = (($177) + 4)|0;
- $180 = $179;
- HEAP32[$180>>2] = $176;
- $181 = ((($0)) + 24|0);
- $182 = $181;
- $183 = $182;
- HEAP32[$183>>2] = $173;
- $184 = (($182) + 4)|0;
- $185 = $184;
- HEAP32[$185>>2] = $176;
- ;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;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$8>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$8+4>>2]|0;
- _Mat2MultiplyVector2($18,$$byval_copy41,$tmpcast104$byval_copy42);
- $186 = $18;
- $187 = $186;
- $188 = HEAP32[$187>>2]|0;
- $189 = (($186) + 4)|0;
- $190 = $189;
- $191 = HEAP32[$190>>2]|0;
- $192 = $8;
- $193 = $192;
- HEAP32[$193>>2] = $188;
- $194 = (($192) + 4)|0;
- $195 = $194;
- HEAP32[$195>>2] = $191;
- _MathNormalize($8);
- $196 = ((($0)) + 16|0);
- $197 = $8;
- $198 = $197;
- $199 = HEAP32[$198>>2]|0;
- $200 = (($197) + 4)|0;
- $201 = $200;
- $202 = HEAP32[$201>>2]|0;
- $203 = $196;
- $204 = $203;
- HEAP32[$204>>2] = $199;
- $205 = (($203) + 4)|0;
- $206 = $205;
- HEAP32[$206>>2] = $202;
- break;
- }
- $207 = (((($4)) + 196|0) + ($$093$lcssa<<3)|0);
- $208 = $207;
- $209 = $208;
- $210 = HEAP32[$209>>2]|0;
- $211 = (($208) + 4)|0;
- $212 = $211;
- $213 = HEAP32[$212>>2]|0;
- $214 = $8;
- $215 = $214;
- HEAP32[$215>>2] = $210;
- $216 = (($214) + 4)|0;
- $217 = $216;
- HEAP32[$217>>2] = $213;
- ;HEAP32[$$byval_copy41>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$1+4>>2]|0;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$6>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$6+4>>2]|0;
- _Vector2Subtract_4($19,$$byval_copy41,$tmpcast104$byval_copy42);
- ;HEAP32[$$byval_copy41>>2]=HEAP32[$19>>2]|0;HEAP32[$$byval_copy41+4>>2]=HEAP32[$19+4>>2]|0;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$8>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$8+4>>2]|0;
- $218 = (+_MathDot($$byval_copy41,$tmpcast104$byval_copy42));
- $219 = +HEAPF32[$99>>2];
- $220 = $218 > $219;
- if ($220) {
- break;
- } else {
- $221 = ((($4)) + 388|0);
- ;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;
- ;HEAP32[$tmpcast104$byval_copy42>>2]=HEAP32[$8>>2]|0;HEAP32[$tmpcast104$byval_copy42+4>>2]=HEAP32[$8+4>>2]|0;
- _Mat2MultiplyVector2($20,$$byval_copy41,$tmpcast104$byval_copy42);
- $222 = $20;
- $223 = $222;
- $224 = HEAP32[$223>>2]|0;
- $225 = (($222) + 4)|0;
- $226 = $225;
- $227 = HEAP32[$226>>2]|0;
- $228 = $8;
- $229 = $228;
- HEAP32[$229>>2] = $224;
- $230 = (($228) + 4)|0;
- $231 = $230;
- HEAP32[$231>>2] = $227;
- $232 = +HEAPF32[$8>>2];
- $233 = -$232;
- $234 = ((($8)) + 4|0);
- $235 = +HEAPF32[$234>>2];
- $236 = -$235;
- $$sroa$04$0$$sroa_idx = ((($0)) + 16|0);
- HEAPF32[$$sroa$04$0$$sroa_idx>>2] = $233;
- $$sroa$25$0$$sroa_idx6 = ((($0)) + 20|0);
- HEAPF32[$$sroa$25$0$$sroa_idx6>>2] = $236;
- $237 = +HEAPF32[$99>>2];
- $238 = $237 * $233;
- $239 = +HEAPF32[$26>>2];
- $240 = $238 + $239;
- $241 = $237 * $236;
- $242 = ((($22)) + 12|0);
- $243 = +HEAPF32[$242>>2];
- $244 = $241 + $243;
- $$sroa$0$0$$sroa_idx = ((($0)) + 24|0);
- HEAPF32[$$sroa$0$0$$sroa_idx>>2] = $240;
- $$sroa$2$0$$sroa_idx3 = ((($0)) + 28|0);
- HEAPF32[$$sroa$2$0$$sroa_idx3>>2] = $244;
- HEAP32[$25>>2] = 1;
- break;
- }
- }
- } while(0);
- STACKTOP = sp;return;
- }
- function _SolvePolygonToCircle($0) {
- $0 = $0|0;
- 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;
- sp = STACKTOP;
- $1 = ((($0)) + 4|0);
- $2 = HEAP32[$1>>2]|0;
- $3 = ((($0)) + 8|0);
- $4 = HEAP32[$3>>2]|0;
- HEAP32[$1>>2] = $4;
- HEAP32[$3>>2] = $2;
- _SolveCircleToPolygon($0);
- $5 = ((($0)) + 16|0);
- $6 = +HEAPF32[$5>>2];
- $7 = -$6;
- HEAPF32[$5>>2] = $7;
- $8 = ((($0)) + 20|0);
- $9 = +HEAPF32[$8>>2];
- $10 = -$9;
- HEAPF32[$8>>2] = $10;
- return;
- }
- function _SolvePolygonToPolygon($0) {
- $0 = $0|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- var $98 = 0, $99 = 0, $tmpcast58$byval_copy23 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 3008|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(3008|0);
- $$byval_copy24 = sp + 2584|0;
- $tmpcast58$byval_copy23 = sp + 2168|0;
- $1 = sp + 1744|0;
- $2 = sp + 1328|0;
- $3 = sp + 1324|0;
- $4 = sp + 1320|0;
- $5 = sp + 904|0;
- $6 = sp + 488|0;
- $7 = sp + 24|0;
- $8 = sp + 80|0;
- $9 = sp + 16|0;
- $10 = sp + 8|0;
- $11 = sp + 64|0;
- $12 = sp + 56|0;
- $13 = sp + 48|0;
- $14 = sp + 40|0;
- $15 = sp + 72|0;
- $16 = sp;
- $17 = sp + 2160|0;
- $18 = ((($0)) + 4|0);
- $19 = HEAP32[$18>>2]|0;
- $20 = ((($19)) + 84|0);
- _memcpy(($1|0),($20|0),416)|0;
- $21 = ((($0)) + 8|0);
- $22 = HEAP32[$21>>2]|0;
- $23 = ((($22)) + 84|0);
- _memcpy(($2|0),($23|0),416)|0;
- $24 = ((($0)) + 40|0);
- HEAP32[$24>>2] = 0;
- HEAP32[$3>>2] = 0;
- _memcpy(($tmpcast58$byval_copy23|0),($1|0),416)|0;
- _memcpy(($$byval_copy24|0),($2|0),416)|0;
- $25 = (+_FindAxisLeastPenetration($3,$tmpcast58$byval_copy23,$$byval_copy24));
- $26 = !($25 >= 0.0);
- if (!($26)) {
- STACKTOP = sp;return;
- }
- HEAP32[$4>>2] = 0;
- _memcpy(($tmpcast58$byval_copy23|0),($2|0),416)|0;
- _memcpy(($$byval_copy24|0),($1|0),416)|0;
- $27 = (+_FindAxisLeastPenetration($4,$tmpcast58$byval_copy23,$$byval_copy24));
- $28 = !($27 >= 0.0);
- if ($28) {
- $29 = (_BiasGreaterThan($25,$27)|0);
- $30 = ($29|0)==(0);
- if ($30) {
- _memcpy(($5|0),($2|0),416)|0;
- _memcpy(($6|0),($1|0),416)|0;
- $$051$in = $4;$$052 = 1;
- } else {
- _memcpy(($5|0),($1|0),416)|0;
- _memcpy(($6|0),($2|0),416)|0;
- $$051$in = $3;$$052 = 0;
- }
- $$051 = HEAP32[$$051$in>>2]|0;
- $31 = ((($7)) + 8|0);
- _memcpy(($tmpcast58$byval_copy23|0),($5|0),416)|0;
- _memcpy(($$byval_copy24|0),($6|0),416)|0;
- _FindIncidentFace($7,$31,$tmpcast58$byval_copy23,$$byval_copy24,$$051);
- $32 = ((($5)) + 12|0);
- _memcpy(($8|0),($32|0),404)|0;
- $33 = (((($8)) + 4|0) + ($$051<<3)|0);
- $34 = $33;
- $35 = $34;
- $36 = HEAP32[$35>>2]|0;
- $37 = (($34) + 4)|0;
- $38 = $37;
- $39 = HEAP32[$38>>2]|0;
- $40 = $9;
- $41 = $40;
- HEAP32[$41>>2] = $36;
- $42 = (($40) + 4)|0;
- $43 = $42;
- HEAP32[$43>>2] = $39;
- $44 = (($$051) + 1)|0;
- $45 = HEAP32[$8>>2]|0;
- $46 = ($44>>>0)<($45>>>0);
- $47 = $46 ? $44 : 0;
- $48 = (((($8)) + 4|0) + ($47<<3)|0);
- $49 = $48;
- $50 = $49;
- $51 = HEAP32[$50>>2]|0;
- $52 = (($49) + 4)|0;
- $53 = $52;
- $54 = HEAP32[$53>>2]|0;
- $55 = $10;
- $56 = $55;
- HEAP32[$56>>2] = $51;
- $57 = (($55) + 4)|0;
- $58 = $57;
- HEAP32[$58>>2] = $54;
- $59 = ((($8)) + 388|0);
- ;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;
- ;HEAP32[$$byval_copy24>>2]=HEAP32[$9>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$9+4>>2]|0;
- _Mat2MultiplyVector2($11,$tmpcast58$byval_copy23,$$byval_copy24);
- $60 = $11;
- $61 = $60;
- $62 = HEAP32[$61>>2]|0;
- $63 = (($60) + 4)|0;
- $64 = $63;
- $65 = HEAP32[$64>>2]|0;
- $66 = $9;
- $67 = $66;
- HEAP32[$67>>2] = $62;
- $68 = (($66) + 4)|0;
- $69 = $68;
- HEAP32[$69>>2] = $65;
- $70 = ((($5)) + 4|0);
- $71 = HEAP32[$70>>2]|0;
- $72 = ((($71)) + 8|0);
- ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$9>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$9+4>>2]|0;
- ;HEAP32[$$byval_copy24>>2]=HEAP32[$72>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$72+4>>2]|0;
- _Vector2Add_2($12,$tmpcast58$byval_copy23,$$byval_copy24);
- $73 = $12;
- $74 = $73;
- $75 = HEAP32[$74>>2]|0;
- $76 = (($73) + 4)|0;
- $77 = $76;
- $78 = HEAP32[$77>>2]|0;
- $79 = $9;
- $80 = $79;
- HEAP32[$80>>2] = $75;
- $81 = (($79) + 4)|0;
- $82 = $81;
- HEAP32[$82>>2] = $78;
- ;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;
- ;HEAP32[$$byval_copy24>>2]=HEAP32[$10>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$10+4>>2]|0;
- _Mat2MultiplyVector2($13,$tmpcast58$byval_copy23,$$byval_copy24);
- $83 = $13;
- $84 = $83;
- $85 = HEAP32[$84>>2]|0;
- $86 = (($83) + 4)|0;
- $87 = $86;
- $88 = HEAP32[$87>>2]|0;
- $89 = $10;
- $90 = $89;
- HEAP32[$90>>2] = $85;
- $91 = (($89) + 4)|0;
- $92 = $91;
- HEAP32[$92>>2] = $88;
- $93 = HEAP32[$70>>2]|0;
- $94 = ((($93)) + 8|0);
- ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$10>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$10+4>>2]|0;
- ;HEAP32[$$byval_copy24>>2]=HEAP32[$94>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$94+4>>2]|0;
- _Vector2Add_2($14,$tmpcast58$byval_copy23,$$byval_copy24);
- $95 = $14;
- $96 = $95;
- $97 = HEAP32[$96>>2]|0;
- $98 = (($95) + 4)|0;
- $99 = $98;
- $100 = HEAP32[$99>>2]|0;
- $101 = $10;
- $102 = $101;
- HEAP32[$102>>2] = $97;
- $103 = (($101) + 4)|0;
- $104 = $103;
- HEAP32[$104>>2] = $100;
- ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$10>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$10+4>>2]|0;
- ;HEAP32[$$byval_copy24>>2]=HEAP32[$9>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$9+4>>2]|0;
- _Vector2Subtract_4($15,$tmpcast58$byval_copy23,$$byval_copy24);
- _MathNormalize($15);
- $105 = ((($15)) + 4|0);
- $106 = HEAP32[$105>>2]|0;
- HEAP32[$16>>2] = $106;
- $107 = ((($16)) + 4|0);
- $108 = +HEAPF32[$15>>2];
- $109 = -$108;
- HEAPF32[$107>>2] = $109;
- ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$16>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$16+4>>2]|0;
- ;HEAP32[$$byval_copy24>>2]=HEAP32[$9>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$9+4>>2]|0;
- $110 = (+_MathDot($tmpcast58$byval_copy23,$$byval_copy24));
- ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$15>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$15+4>>2]|0;
- ;HEAP32[$$byval_copy24>>2]=HEAP32[$9>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$9+4>>2]|0;
- $111 = (+_MathDot($tmpcast58$byval_copy23,$$byval_copy24));
- $112 = -$111;
- ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$15>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$15+4>>2]|0;
- ;HEAP32[$$byval_copy24>>2]=HEAP32[$10>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$10+4>>2]|0;
- $113 = (+_MathDot($tmpcast58$byval_copy23,$$byval_copy24));
- $114 = +HEAPF32[$15>>2];
- $115 = -$114;
- HEAPF32[$17>>2] = $115;
- $116 = ((($17)) + 4|0);
- $117 = +HEAPF32[$105>>2];
- $118 = -$117;
- HEAPF32[$116>>2] = $118;
- ;HEAP32[$$byval_copy24>>2]=HEAP32[$17>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$17+4>>2]|0;
- $119 = (_Clip($$byval_copy24,$112,$7,$31)|0);
- $120 = ($119|0)<(2);
- if (!($120)) {
- ;HEAP32[$$byval_copy24>>2]=HEAP32[$15>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$15+4>>2]|0;
- $121 = (_Clip($$byval_copy24,$113,$7,$31)|0);
- $122 = ($121|0)<(2);
- if (!($122)) {
- $123 = ($$052|0)==(0);
- if ($123) {
- $128 = ((($0)) + 16|0);
- $129 = $16;
- $130 = $129;
- $131 = HEAP32[$130>>2]|0;
- $132 = (($129) + 4)|0;
- $133 = $132;
- $134 = HEAP32[$133>>2]|0;
- $135 = $128;
- $136 = $135;
- HEAP32[$136>>2] = $131;
- $137 = (($135) + 4)|0;
- $138 = $137;
- HEAP32[$138>>2] = $134;
- } else {
- $124 = +HEAPF32[$16>>2];
- $125 = -$124;
- $126 = +HEAPF32[$107>>2];
- $127 = -$126;
- $$sroa$0$0$$sroa_idx = ((($0)) + 16|0);
- HEAPF32[$$sroa$0$0$$sroa_idx>>2] = $125;
- $$sroa$2$0$$sroa_idx12 = ((($0)) + 20|0);
- HEAPF32[$$sroa$2$0$$sroa_idx12>>2] = $127;
- }
- ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$16>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$16+4>>2]|0;
- ;HEAP32[$$byval_copy24>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$7+4>>2]|0;
- $139 = (+_MathDot($tmpcast58$byval_copy23,$$byval_copy24));
- $140 = $139 - $110;
- $141 = !($140 <= 0.0);
- if ($141) {
- $$0 = 0;$$sink = 0.0;
- } else {
- $142 = -$140;
- $143 = ((($0)) + 24|0);
- $144 = $7;
- $145 = $144;
- $146 = HEAP32[$145>>2]|0;
- $147 = (($144) + 4)|0;
- $148 = $147;
- $149 = HEAP32[$148>>2]|0;
- $150 = $143;
- $151 = $150;
- HEAP32[$151>>2] = $146;
- $152 = (($150) + 4)|0;
- $153 = $152;
- HEAP32[$153>>2] = $149;
- $$0 = 1;$$sink = $142;
- }
- $154 = ((($0)) + 12|0);
- HEAPF32[$154>>2] = $$sink;
- ;HEAP32[$tmpcast58$byval_copy23>>2]=HEAP32[$16>>2]|0;HEAP32[$tmpcast58$byval_copy23+4>>2]=HEAP32[$16+4>>2]|0;
- ;HEAP32[$$byval_copy24>>2]=HEAP32[$31>>2]|0;HEAP32[$$byval_copy24+4>>2]=HEAP32[$31+4>>2]|0;
- $155 = (+_MathDot($tmpcast58$byval_copy23,$$byval_copy24));
- $156 = $155 - $110;
- $157 = !($156 <= 0.0);
- if ($157) {
- $$1 = $$0;
- } else {
- $158 = (((($0)) + 24|0) + ($$0<<3)|0);
- $159 = $31;
- $160 = $159;
- $161 = HEAP32[$160>>2]|0;
- $162 = (($159) + 4)|0;
- $163 = $162;
- $164 = HEAP32[$163>>2]|0;
- $165 = $158;
- $166 = $165;
- HEAP32[$166>>2] = $161;
- $167 = (($165) + 4)|0;
- $168 = $167;
- HEAP32[$168>>2] = $164;
- $169 = +HEAPF32[$154>>2];
- $170 = $169 - $156;
- $171 = (($$0) + 1)|0;
- $172 = (+($171|0));
- $173 = $170 / $172;
- HEAPF32[$154>>2] = $173;
- $$1 = $171;
- }
- HEAP32[$24>>2] = $$1;
- }
- }
- }
- STACKTOP = sp;return;
- }
- function _MathLenSqr($0) {
- $0 = $0|0;
- var $1 = 0.0, $2 = 0.0, $3 = 0, $4 = 0.0, $5 = 0.0, $6 = 0.0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = +HEAPF32[$0>>2];
- $2 = $1 * $1;
- $3 = ((($0)) + 4|0);
- $4 = +HEAPF32[$3>>2];
- $5 = $4 * $4;
- $6 = $2 + $5;
- return (+$6);
- }
- function _Mat2Transpose($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- sp = STACKTOP;
- $2 = HEAP32[$1>>2]|0;
- HEAP32[$0>>2] = $2;
- $3 = ((($0)) + 4|0);
- $4 = ((($1)) + 8|0);
- $5 = HEAP32[$4>>2]|0;
- HEAP32[$3>>2] = $5;
- $6 = ((($0)) + 8|0);
- $7 = ((($1)) + 4|0);
- $8 = HEAP32[$7>>2]|0;
- HEAP32[$6>>2] = $8;
- $9 = ((($0)) + 12|0);
- $10 = ((($1)) + 12|0);
- $11 = HEAP32[$10>>2]|0;
- HEAP32[$9>>2] = $11;
- return;
- }
- function _MathDot($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- sp = STACKTOP;
- $2 = +HEAPF32[$0>>2];
- $3 = +HEAPF32[$1>>2];
- $4 = $2 * $3;
- $5 = ((($0)) + 4|0);
- $6 = +HEAPF32[$5>>2];
- $7 = ((($1)) + 4|0);
- $8 = +HEAPF32[$7>>2];
- $9 = $6 * $8;
- $10 = $4 + $9;
- return (+$10);
- }
- function _DistSqr($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- var $$byval_copy2 = 0, $$byval_copy3 = 0, $2 = 0, $3 = 0.0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
- $$byval_copy3 = sp + 16|0;
- $$byval_copy2 = sp + 8|0;
- $2 = sp;
- ;HEAP32[$$byval_copy2>>2]=HEAP32[$0>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$0+4>>2]|0;
- ;HEAP32[$$byval_copy3>>2]=HEAP32[$1>>2]|0;HEAP32[$$byval_copy3+4>>2]=HEAP32[$1+4>>2]|0;
- _Vector2Subtract_4($2,$$byval_copy2,$$byval_copy3);
- ;HEAP32[$$byval_copy2>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy2+4>>2]=HEAP32[$2+4>>2]|0;
- ;HEAP32[$$byval_copy3>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy3+4>>2]=HEAP32[$2+4>>2]|0;
- $3 = (+_MathDot($$byval_copy2,$$byval_copy3));
- STACKTOP = sp;return (+$3);
- }
- function _FindAxisLeastPenetration($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- var $94 = 0, $95 = 0, $96 = 0.0, $97 = 0, $98 = 0, $99 = 0, $tmpcast$byval_copy15 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 1344|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(1344|0);
- $$byval_copy16 = sp + 1320|0;
- $tmpcast$byval_copy15 = sp + 904|0;
- $3 = sp + 484|0;
- $4 = sp + 80|0;
- $5 = sp + 8|0;
- $6 = sp + 72|0;
- $7 = sp + 56|0;
- $8 = sp + 48|0;
- $9 = sp + 896|0;
- $10 = sp;
- $11 = sp + 40|0;
- $12 = sp + 32|0;
- $13 = sp + 24|0;
- $14 = sp + 16|0;
- $15 = sp + 888|0;
- $16 = ((($1)) + 12|0);
- _memcpy(($3|0),($16|0),404)|0;
- $17 = ((($2)) + 12|0);
- _memcpy(($4|0),($17|0),404)|0;
- $18 = HEAP32[$3>>2]|0;
- $19 = ($18|0)==(0);
- if ($19) {
- $$0$lcssa = -3.4028234663852886E+38;$$018$lcssa = 0;
- HEAP32[$0>>2] = $$018$lcssa;
- STACKTOP = sp;return (+$$0$lcssa);
- }
- $20 = ((($3)) + 388|0);
- $21 = ((($4)) + 388|0);
- $22 = ((($9)) + 4|0);
- $23 = ((($5)) + 4|0);
- $24 = ((($1)) + 4|0);
- $25 = ((($2)) + 4|0);
- $$01727 = 0;$$01826 = 0;$$028 = -3.4028234663852886E+38;
- while(1) {
- $26 = (((($3)) + 196|0) + ($$01727<<3)|0);
- $27 = $26;
- $28 = $27;
- $29 = HEAP32[$28>>2]|0;
- $30 = (($27) + 4)|0;
- $31 = $30;
- $32 = HEAP32[$31>>2]|0;
- $33 = $5;
- $34 = $33;
- HEAP32[$34>>2] = $29;
- $35 = (($33) + 4)|0;
- $36 = $35;
- HEAP32[$36>>2] = $32;
- ;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;
- ;HEAP32[$$byval_copy16>>2]=HEAP32[$5>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$5+4>>2]|0;
- _Mat2MultiplyVector2($6,$tmpcast$byval_copy15,$$byval_copy16);
- ;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;
- _Mat2Transpose($7,$$byval_copy16);
- ;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;
- ;HEAP32[$$byval_copy16>>2]=HEAP32[$6>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$6+4>>2]|0;
- _Mat2MultiplyVector2($5,$tmpcast$byval_copy15,$$byval_copy16);
- $37 = +HEAPF32[$5>>2];
- $38 = -$37;
- HEAPF32[$9>>2] = $38;
- $39 = +HEAPF32[$23>>2];
- $40 = -$39;
- HEAPF32[$22>>2] = $40;
- _memcpy(($tmpcast$byval_copy15|0),($2|0),416)|0;
- ;HEAP32[$$byval_copy16>>2]=HEAP32[$9>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$9+4>>2]|0;
- _GetSupport($8,$tmpcast$byval_copy15,$$byval_copy16);
- $41 = (((($3)) + 4|0) + ($$01727<<3)|0);
- $42 = $41;
- $43 = $42;
- $44 = HEAP32[$43>>2]|0;
- $45 = (($42) + 4)|0;
- $46 = $45;
- $47 = HEAP32[$46>>2]|0;
- $48 = $10;
- $49 = $48;
- HEAP32[$49>>2] = $44;
- $50 = (($48) + 4)|0;
- $51 = $50;
- HEAP32[$51>>2] = $47;
- ;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;
- ;HEAP32[$$byval_copy16>>2]=HEAP32[$10>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$10+4>>2]|0;
- _Mat2MultiplyVector2($11,$tmpcast$byval_copy15,$$byval_copy16);
- $52 = $11;
- $53 = $52;
- $54 = HEAP32[$53>>2]|0;
- $55 = (($52) + 4)|0;
- $56 = $55;
- $57 = HEAP32[$56>>2]|0;
- $58 = $10;
- $59 = $58;
- HEAP32[$59>>2] = $54;
- $60 = (($58) + 4)|0;
- $61 = $60;
- HEAP32[$61>>2] = $57;
- $62 = HEAP32[$24>>2]|0;
- $63 = ((($62)) + 8|0);
- ;HEAP32[$tmpcast$byval_copy15>>2]=HEAP32[$10>>2]|0;HEAP32[$tmpcast$byval_copy15+4>>2]=HEAP32[$10+4>>2]|0;
- ;HEAP32[$$byval_copy16>>2]=HEAP32[$63>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$63+4>>2]|0;
- _Vector2Add_2($12,$tmpcast$byval_copy15,$$byval_copy16);
- $64 = $12;
- $65 = $64;
- $66 = HEAP32[$65>>2]|0;
- $67 = (($64) + 4)|0;
- $68 = $67;
- $69 = HEAP32[$68>>2]|0;
- $70 = $10;
- $71 = $70;
- HEAP32[$71>>2] = $66;
- $72 = (($70) + 4)|0;
- $73 = $72;
- HEAP32[$73>>2] = $69;
- $74 = HEAP32[$25>>2]|0;
- $75 = ((($74)) + 8|0);
- ;HEAP32[$tmpcast$byval_copy15>>2]=HEAP32[$10>>2]|0;HEAP32[$tmpcast$byval_copy15+4>>2]=HEAP32[$10+4>>2]|0;
- ;HEAP32[$$byval_copy16>>2]=HEAP32[$75>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$75+4>>2]|0;
- _Vector2Subtract_4($13,$tmpcast$byval_copy15,$$byval_copy16);
- $76 = $13;
- $77 = $76;
- $78 = HEAP32[$77>>2]|0;
- $79 = (($76) + 4)|0;
- $80 = $79;
- $81 = HEAP32[$80>>2]|0;
- $82 = $10;
- $83 = $82;
- HEAP32[$83>>2] = $78;
- $84 = (($82) + 4)|0;
- $85 = $84;
- HEAP32[$85>>2] = $81;
- ;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;
- ;HEAP32[$$byval_copy16>>2]=HEAP32[$10>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$10+4>>2]|0;
- _Mat2MultiplyVector2($14,$tmpcast$byval_copy15,$$byval_copy16);
- $86 = $14;
- $87 = $86;
- $88 = HEAP32[$87>>2]|0;
- $89 = (($86) + 4)|0;
- $90 = $89;
- $91 = HEAP32[$90>>2]|0;
- $92 = $10;
- $93 = $92;
- HEAP32[$93>>2] = $88;
- $94 = (($92) + 4)|0;
- $95 = $94;
- HEAP32[$95>>2] = $91;
- ;HEAP32[$tmpcast$byval_copy15>>2]=HEAP32[$8>>2]|0;HEAP32[$tmpcast$byval_copy15+4>>2]=HEAP32[$8+4>>2]|0;
- ;HEAP32[$$byval_copy16>>2]=HEAP32[$10>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$10+4>>2]|0;
- _Vector2Subtract_4($15,$tmpcast$byval_copy15,$$byval_copy16);
- ;HEAP32[$tmpcast$byval_copy15>>2]=HEAP32[$5>>2]|0;HEAP32[$tmpcast$byval_copy15+4>>2]=HEAP32[$5+4>>2]|0;
- ;HEAP32[$$byval_copy16>>2]=HEAP32[$15>>2]|0;HEAP32[$$byval_copy16+4>>2]=HEAP32[$15+4>>2]|0;
- $96 = (+_MathDot($tmpcast$byval_copy15,$$byval_copy16));
- $97 = $96 > $$028;
- $$119 = $97 ? $$01727 : $$01826;
- $$1 = $97 ? $96 : $$028;
- $98 = (($$01727) + 1)|0;
- $99 = HEAP32[$3>>2]|0;
- $100 = ($98>>>0)<($99>>>0);
- if ($100) {
- $$01727 = $98;$$01826 = $$119;$$028 = $$1;
- } else {
- $$0$lcssa = $$1;$$018$lcssa = $$119;
- break;
- }
- }
- HEAP32[$0>>2] = $$018$lcssa;
- STACKTOP = sp;return (+$$0$lcssa);
- }
- function _BiasGreaterThan($0,$1) {
- $0 = +$0;
- $1 = +$1;
- var $2 = 0.0, $3 = 0.0, $4 = 0.0, $5 = 0, $6 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $2 = $1 * 0.94999998807907104;
- $3 = $0 * 0.0099999997764825821;
- $4 = $3 + $2;
- $5 = $4 <= $0;
- $6 = $5&1;
- return ($6|0);
- }
- function _FindIncidentFace($0,$1,$2,$3,$4) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- $4 = $4|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 912|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(912|0);
- $$byval_copy13 = sp + 896|0;
- $tmpcast$byval_copy12 = sp + 880|0;
- $5 = sp + 460|0;
- $6 = sp + 56|0;
- $7 = sp;
- $8 = sp + 48|0;
- $9 = sp + 864|0;
- $10 = sp + 40|0;
- $11 = sp + 32|0;
- $12 = sp + 24|0;
- $13 = sp + 16|0;
- $14 = sp + 8|0;
- $15 = ((($2)) + 12|0);
- _memcpy(($5|0),($15|0),404)|0;
- $16 = ((($3)) + 12|0);
- _memcpy(($6|0),($16|0),404)|0;
- $17 = (((($5)) + 196|0) + ($4<<3)|0);
- $18 = $17;
- $19 = $18;
- $20 = HEAP32[$19>>2]|0;
- $21 = (($18) + 4)|0;
- $22 = $21;
- $23 = HEAP32[$22>>2]|0;
- $24 = $7;
- $25 = $24;
- HEAP32[$25>>2] = $20;
- $26 = (($24) + 4)|0;
- $27 = $26;
- HEAP32[$27>>2] = $23;
- $28 = ((($5)) + 388|0);
- ;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;
- ;HEAP32[$$byval_copy13>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$7+4>>2]|0;
- _Mat2MultiplyVector2($8,$tmpcast$byval_copy12,$$byval_copy13);
- $29 = $8;
- $30 = $29;
- $31 = HEAP32[$30>>2]|0;
- $32 = (($29) + 4)|0;
- $33 = $32;
- $34 = HEAP32[$33>>2]|0;
- $35 = $7;
- $36 = $35;
- HEAP32[$36>>2] = $31;
- $37 = (($35) + 4)|0;
- $38 = $37;
- HEAP32[$38>>2] = $34;
- $39 = ((($6)) + 388|0);
- ;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;
- _Mat2Transpose($9,$$byval_copy13);
- ;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;
- ;HEAP32[$$byval_copy13>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$7+4>>2]|0;
- _Mat2MultiplyVector2($10,$tmpcast$byval_copy12,$$byval_copy13);
- $40 = $10;
- $41 = $40;
- $42 = HEAP32[$41>>2]|0;
- $43 = (($40) + 4)|0;
- $44 = $43;
- $45 = HEAP32[$44>>2]|0;
- $46 = $7;
- $47 = $46;
- HEAP32[$47>>2] = $42;
- $48 = (($46) + 4)|0;
- $49 = $48;
- HEAP32[$49>>2] = $45;
- $50 = HEAP32[$6>>2]|0;
- $51 = ($50|0)==(0);
- if ($51) {
- $$0$lcssa = 0;
- } else {
- $52 = HEAP32[$6>>2]|0;
- $$02434 = 0;$$02533 = 3.4028234663852886E+38;$$035 = 0;
- while(1) {
- $104 = (((($6)) + 196|0) + ($$02434<<3)|0);
- ;HEAP32[$tmpcast$byval_copy12>>2]=HEAP32[$7>>2]|0;HEAP32[$tmpcast$byval_copy12+4>>2]=HEAP32[$7+4>>2]|0;
- ;HEAP32[$$byval_copy13>>2]=HEAP32[$104>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$104+4>>2]|0;
- $105 = (+_MathDot($tmpcast$byval_copy12,$$byval_copy13));
- $106 = $105 < $$02533;
- $$126 = $106 ? $105 : $$02533;
- $$1 = $106 ? $$02434 : $$035;
- $107 = (($$02434) + 1)|0;
- $108 = ($107>>>0)<($52>>>0);
- if ($108) {
- $$02434 = $107;$$02533 = $$126;$$035 = $$1;
- } else {
- $$0$lcssa = $$1;
- break;
- }
- }
- }
- $53 = (((($6)) + 4|0) + ($$0$lcssa<<3)|0);
- ;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;
- ;HEAP32[$$byval_copy13>>2]=HEAP32[$53>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$53+4>>2]|0;
- _Mat2MultiplyVector2($11,$tmpcast$byval_copy12,$$byval_copy13);
- $54 = $11;
- $55 = $54;
- $56 = HEAP32[$55>>2]|0;
- $57 = (($54) + 4)|0;
- $58 = $57;
- $59 = HEAP32[$58>>2]|0;
- $60 = $0;
- $61 = $60;
- HEAP32[$61>>2] = $56;
- $62 = (($60) + 4)|0;
- $63 = $62;
- HEAP32[$63>>2] = $59;
- $64 = ((($3)) + 4|0);
- $65 = HEAP32[$64>>2]|0;
- $66 = ((($65)) + 8|0);
- ;HEAP32[$tmpcast$byval_copy12>>2]=HEAP32[$0>>2]|0;HEAP32[$tmpcast$byval_copy12+4>>2]=HEAP32[$0+4>>2]|0;
- ;HEAP32[$$byval_copy13>>2]=HEAP32[$66>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$66+4>>2]|0;
- _Vector2Add_2($12,$tmpcast$byval_copy12,$$byval_copy13);
- $67 = $12;
- $68 = $67;
- $69 = HEAP32[$68>>2]|0;
- $70 = (($67) + 4)|0;
- $71 = $70;
- $72 = HEAP32[$71>>2]|0;
- $73 = $0;
- $74 = $73;
- HEAP32[$74>>2] = $69;
- $75 = (($73) + 4)|0;
- $76 = $75;
- HEAP32[$76>>2] = $72;
- $77 = (($$0$lcssa) + 1)|0;
- $78 = HEAP32[$6>>2]|0;
- $79 = ($77>>>0)<($78>>>0);
- $80 = $79 ? $77 : 0;
- $81 = (((($6)) + 4|0) + ($80<<3)|0);
- ;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;
- ;HEAP32[$$byval_copy13>>2]=HEAP32[$81>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$81+4>>2]|0;
- _Mat2MultiplyVector2($13,$tmpcast$byval_copy12,$$byval_copy13);
- $82 = $13;
- $83 = $82;
- $84 = HEAP32[$83>>2]|0;
- $85 = (($82) + 4)|0;
- $86 = $85;
- $87 = HEAP32[$86>>2]|0;
- $88 = $1;
- $89 = $88;
- HEAP32[$89>>2] = $84;
- $90 = (($88) + 4)|0;
- $91 = $90;
- HEAP32[$91>>2] = $87;
- $92 = HEAP32[$64>>2]|0;
- $93 = ((($92)) + 8|0);
- ;HEAP32[$tmpcast$byval_copy12>>2]=HEAP32[$1>>2]|0;HEAP32[$tmpcast$byval_copy12+4>>2]=HEAP32[$1+4>>2]|0;
- ;HEAP32[$$byval_copy13>>2]=HEAP32[$93>>2]|0;HEAP32[$$byval_copy13+4>>2]=HEAP32[$93+4>>2]|0;
- _Vector2Add_2($14,$tmpcast$byval_copy12,$$byval_copy13);
- $94 = $14;
- $95 = $94;
- $96 = HEAP32[$95>>2]|0;
- $97 = (($94) + 4)|0;
- $98 = $97;
- $99 = HEAP32[$98>>2]|0;
- $100 = $1;
- $101 = $100;
- HEAP32[$101>>2] = $96;
- $102 = (($100) + 4)|0;
- $103 = $102;
- HEAP32[$103>>2] = $99;
- STACKTOP = sp;return;
- }
- function _Clip($0,$1,$2,$3) {
- $0 = $0|0;
- $1 = +$1;
- $2 = $2|0;
- $3 = $3|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- var $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 48|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(48|0);
- $$byval_copy7 = sp + 40|0;
- $$byval_copy6 = sp + 32|0;
- $4 = sp;
- $5 = sp + 24|0;
- $6 = sp + 16|0;
- $7 = $2;
- $8 = $7;
- $9 = HEAP32[$8>>2]|0;
- $10 = (($7) + 4)|0;
- $11 = $10;
- $12 = HEAP32[$11>>2]|0;
- $13 = $4;
- $14 = $13;
- HEAP32[$14>>2] = $9;
- $15 = (($13) + 4)|0;
- $16 = $15;
- HEAP32[$16>>2] = $12;
- $17 = ((($4)) + 8|0);
- $18 = $3;
- $19 = $18;
- $20 = HEAP32[$19>>2]|0;
- $21 = (($18) + 4)|0;
- $22 = $21;
- $23 = HEAP32[$22>>2]|0;
- $24 = $17;
- $25 = $24;
- HEAP32[$25>>2] = $20;
- $26 = (($24) + 4)|0;
- $27 = $26;
- HEAP32[$27>>2] = $23;
- ;HEAP32[$$byval_copy6>>2]=HEAP32[$0>>2]|0;HEAP32[$$byval_copy6+4>>2]=HEAP32[$0+4>>2]|0;
- ;HEAP32[$$byval_copy7>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy7+4>>2]=HEAP32[$2+4>>2]|0;
- $28 = (+_MathDot($$byval_copy6,$$byval_copy7));
- $29 = $28 - $1;
- ;HEAP32[$$byval_copy6>>2]=HEAP32[$0>>2]|0;HEAP32[$$byval_copy6+4>>2]=HEAP32[$0+4>>2]|0;
- ;HEAP32[$$byval_copy7>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy7+4>>2]=HEAP32[$3+4>>2]|0;
- $30 = (+_MathDot($$byval_copy6,$$byval_copy7));
- $31 = $30 - $1;
- $32 = !($29 <= 0.0);
- if ($32) {
- $$0 = 0;
- } else {
- $33 = $2;
- $34 = $33;
- $35 = HEAP32[$34>>2]|0;
- $36 = (($33) + 4)|0;
- $37 = $36;
- $38 = HEAP32[$37>>2]|0;
- $39 = $4;
- $40 = $39;
- HEAP32[$40>>2] = $35;
- $41 = (($39) + 4)|0;
- $42 = $41;
- HEAP32[$42>>2] = $38;
- $$0 = 1;
- }
- $43 = !($31 <= 0.0);
- if ($43) {
- $$1 = $$0;
- } else {
- $44 = (($4) + ($$0<<3)|0);
- $45 = (($$0) + 1)|0;
- $46 = $3;
- $47 = $46;
- $48 = HEAP32[$47>>2]|0;
- $49 = (($46) + 4)|0;
- $50 = $49;
- $51 = HEAP32[$50>>2]|0;
- $52 = $44;
- $53 = $52;
- HEAP32[$53>>2] = $48;
- $54 = (($52) + 4)|0;
- $55 = $54;
- HEAP32[$55>>2] = $51;
- $$1 = $45;
- }
- $56 = $29 * $31;
- $57 = $56 < 0.0;
- if (!($57)) {
- $$2 = $$1;
- $87 = $4;
- $88 = $87;
- $89 = HEAP32[$88>>2]|0;
- $90 = (($87) + 4)|0;
- $91 = $90;
- $92 = HEAP32[$91>>2]|0;
- $93 = $2;
- $94 = $93;
- HEAP32[$94>>2] = $89;
- $95 = (($93) + 4)|0;
- $96 = $95;
- HEAP32[$96>>2] = $92;
- $97 = $17;
- $98 = $97;
- $99 = HEAP32[$98>>2]|0;
- $100 = (($97) + 4)|0;
- $101 = $100;
- $102 = HEAP32[$101>>2]|0;
- $103 = $3;
- $104 = $103;
- HEAP32[$104>>2] = $99;
- $105 = (($103) + 4)|0;
- $106 = $105;
- HEAP32[$106>>2] = $102;
- STACKTOP = sp;return ($$2|0);
- }
- $58 = $29 - $31;
- $59 = $29 / $58;
- $60 = (($4) + ($$1<<3)|0);
- $61 = $2;
- $62 = $61;
- $63 = HEAP32[$62>>2]|0;
- $64 = (($61) + 4)|0;
- $65 = $64;
- $66 = HEAP32[$65>>2]|0;
- $67 = $60;
- $68 = $67;
- HEAP32[$68>>2] = $63;
- $69 = (($67) + 4)|0;
- $70 = $69;
- HEAP32[$70>>2] = $66;
- ;HEAP32[$$byval_copy6>>2]=HEAP32[$3>>2]|0;HEAP32[$$byval_copy6+4>>2]=HEAP32[$3+4>>2]|0;
- ;HEAP32[$$byval_copy7>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy7+4>>2]=HEAP32[$2+4>>2]|0;
- _Vector2Subtract_4($5,$$byval_copy6,$$byval_copy7);
- $71 = +HEAPF32[$5>>2];
- $72 = $59 * $71;
- HEAPF32[$5>>2] = $72;
- $73 = ((($5)) + 4|0);
- $74 = +HEAPF32[$73>>2];
- $75 = $59 * $74;
- HEAPF32[$73>>2] = $75;
- ;HEAP32[$$byval_copy6>>2]=HEAP32[$60>>2]|0;HEAP32[$$byval_copy6+4>>2]=HEAP32[$60+4>>2]|0;
- ;HEAP32[$$byval_copy7>>2]=HEAP32[$5>>2]|0;HEAP32[$$byval_copy7+4>>2]=HEAP32[$5+4>>2]|0;
- _Vector2Add_2($6,$$byval_copy6,$$byval_copy7);
- $76 = $6;
- $77 = $76;
- $78 = HEAP32[$77>>2]|0;
- $79 = (($76) + 4)|0;
- $80 = $79;
- $81 = HEAP32[$80>>2]|0;
- $82 = $60;
- $83 = $82;
- HEAP32[$83>>2] = $78;
- $84 = (($82) + 4)|0;
- $85 = $84;
- HEAP32[$85>>2] = $81;
- $86 = (($$1) + 1)|0;
- $$2 = $86;
- $87 = $4;
- $88 = $87;
- $89 = HEAP32[$88>>2]|0;
- $90 = (($87) + 4)|0;
- $91 = $90;
- $92 = HEAP32[$91>>2]|0;
- $93 = $2;
- $94 = $93;
- HEAP32[$94>>2] = $89;
- $95 = (($93) + 4)|0;
- $96 = $95;
- HEAP32[$96>>2] = $92;
- $97 = $17;
- $98 = $97;
- $99 = HEAP32[$98>>2]|0;
- $100 = (($97) + 4)|0;
- $101 = $100;
- $102 = HEAP32[$101>>2]|0;
- $103 = $3;
- $104 = $103;
- HEAP32[$104>>2] = $99;
- $105 = (($103) + 4)|0;
- $106 = $105;
- HEAP32[$106>>2] = $102;
- STACKTOP = sp;return ($$2|0);
- }
- function _GetSupport($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 432|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(432|0);
- $$byval_copy = sp + 424|0;
- $tmpcast$byval_copy = sp + 416|0;
- $3 = sp + 8|0;
- $4 = sp;
- $5 = ((($1)) + 12|0);
- _memcpy(($3|0),($5|0),404)|0;
- $6 = HEAP32[$3>>2]|0;
- $7 = ($6|0)==(0);
- if ($7) {
- $11 = 0;$14 = 0;
- $9 = $0;
- $10 = $9;
- HEAP32[$10>>2] = $11;
- $12 = (($9) + 4)|0;
- $13 = $12;
- HEAP32[$13>>2] = $14;
- STACKTOP = sp;return;
- }
- $8 = HEAP32[$3>>2]|0;
- $$01318 = 0;$$019 = -3.4028234663852886E+38;$29 = 0;$31 = 0;
- while(1) {
- $15 = (((($3)) + 4|0) + ($$01318<<3)|0);
- $16 = $15;
- $17 = $16;
- $18 = HEAP32[$17>>2]|0;
- $19 = (($16) + 4)|0;
- $20 = $19;
- $21 = HEAP32[$20>>2]|0;
- $22 = $4;
- $23 = $22;
- HEAP32[$23>>2] = $18;
- $24 = (($22) + 4)|0;
- $25 = $24;
- HEAP32[$25>>2] = $21;
- ;HEAP32[$tmpcast$byval_copy>>2]=HEAP32[$4>>2]|0;HEAP32[$tmpcast$byval_copy+4>>2]=HEAP32[$4+4>>2]|0;
- ;HEAP32[$$byval_copy>>2]=HEAP32[$2>>2]|0;HEAP32[$$byval_copy+4>>2]=HEAP32[$2+4>>2]|0;
- $26 = (+_MathDot($tmpcast$byval_copy,$$byval_copy));
- $27 = $26 > $$019;
- $28 = $27 ? $18 : $29;
- $30 = $27 ? $21 : $31;
- $$1 = $27 ? $26 : $$019;
- $32 = (($$01318) + 1)|0;
- $33 = ($32>>>0)<($8>>>0);
- if ($33) {
- $$01318 = $32;$$019 = $$1;$29 = $28;$31 = $30;
- } else {
- $11 = $28;$14 = $30;
- break;
- }
- }
- $9 = $0;
- $10 = $9;
- HEAP32[$10>>2] = $11;
- $12 = (($9) + 4)|0;
- $13 = $12;
- HEAP32[$13>>2] = $14;
- STACKTOP = sp;return;
- }
- function _MathCross($0,$1,$2) {
- $0 = $0|0;
- $1 = +$1;
- $2 = $2|0;
- var $3 = 0, $4 = 0.0, $5 = 0.0, $6 = 0.0, $7 = 0, $8 = 0.0, $9 = 0.0, label = 0, sp = 0;
- sp = STACKTOP;
- $3 = ((($2)) + 4|0);
- $4 = +HEAPF32[$3>>2];
- $5 = $4 * $1;
- $6 = -$5;
- HEAPF32[$0>>2] = $6;
- $7 = ((($0)) + 4|0);
- $8 = +HEAPF32[$2>>2];
- $9 = $8 * $1;
- HEAPF32[$7>>2] = $9;
- return;
- }
- function _Mat2Set($0,$1) {
- $0 = $0|0;
- $1 = +$1;
- var $2 = 0.0, $3 = 0.0, $4 = 0.0, $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $2 = (+Math_cos((+$1)));
- $3 = (+Math_sin((+$1)));
- HEAPF32[$0>>2] = $2;
- $4 = -$3;
- $5 = ((($0)) + 4|0);
- HEAPF32[$5>>2] = $4;
- $6 = ((($0)) + 8|0);
- HEAPF32[$6>>2] = $3;
- $7 = ((($0)) + 12|0);
- HEAPF32[$7>>2] = $2;
- return;
- }
- function _Vector2Distance($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- sp = STACKTOP;
- $2 = +HEAPF32[$0>>2];
- $3 = +HEAPF32[$1>>2];
- $4 = $2 - $3;
- $5 = $4 * $4;
- $6 = ((($0)) + 4|0);
- $7 = +HEAPF32[$6>>2];
- $8 = ((($1)) + 4|0);
- $9 = +HEAPF32[$8>>2];
- $10 = $7 - $9;
- $11 = $10 * $10;
- $12 = $5 + $11;
- $13 = (+Math_sqrt((+$12)));
- return (+$13);
- }
- function _Vector2Angle($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- sp = STACKTOP;
- $2 = ((($1)) + 4|0);
- $3 = +HEAPF32[$2>>2];
- $4 = ((($0)) + 4|0);
- $5 = +HEAPF32[$4>>2];
- $6 = $3 - $5;
- $7 = +HEAPF32[$1>>2];
- $8 = +HEAPF32[$0>>2];
- $9 = $7 - $8;
- $10 = (+Math_atan2((+$6),(+$9)));
- $11 = $10 * 57.2957763671875;
- $12 = $11 < 0.0;
- $13 = $11 + 360.0;
- $$0 = $12 ? $13 : $11;
- return (+$$0);
- }
- function _VectorZero($0) {
- $0 = $0|0;
- var $1 = 0, $2 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- HEAPF32[$0>>2] = 0.0;
- $1 = ((($0)) + 4|0);
- HEAPF32[$1>>2] = 0.0;
- $2 = ((($0)) + 8|0);
- HEAPF32[$2>>2] = 0.0;
- return;
- }
- function _VectorLength($0) {
- $0 = $0|0;
- 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;
- sp = STACKTOP;
- $1 = +HEAPF32[$0>>2];
- $2 = $1 * $1;
- $3 = ((($0)) + 4|0);
- $4 = +HEAPF32[$3>>2];
- $5 = $4 * $4;
- $6 = $2 + $5;
- $7 = ((($0)) + 8|0);
- $8 = +HEAPF32[$7>>2];
- $9 = $8 * $8;
- $10 = $6 + $9;
- $11 = (+Math_sqrt((+$10)));
- return (+$11);
- }
- function _VectorNormalize($0) {
- $0 = $0|0;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $$byval_copy = sp;
- ;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;
- $1 = (+_VectorLength($$byval_copy));
- $2 = $1 == 0.0;
- $$op = 1.0 / $1;
- $3 = $2 ? 1.0 : $$op;
- $4 = +HEAPF32[$0>>2];
- $5 = $4 * $3;
- HEAPF32[$0>>2] = $5;
- $6 = ((($0)) + 4|0);
- $7 = +HEAPF32[$6>>2];
- $8 = $3 * $7;
- HEAPF32[$6>>2] = $8;
- $9 = ((($0)) + 8|0);
- $10 = +HEAPF32[$9>>2];
- $11 = $3 * $10;
- HEAPF32[$9>>2] = $11;
- STACKTOP = sp;return;
- }
- function _VectorTransform($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- 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;
- var $47 = 0.0, $5 = 0, $6 = 0.0, $7 = 0.0, $8 = 0.0, $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $2 = +HEAPF32[$0>>2];
- $3 = ((($0)) + 4|0);
- $4 = +HEAPF32[$3>>2];
- $5 = ((($0)) + 8|0);
- $6 = +HEAPF32[$5>>2];
- $7 = +HEAPF32[$1>>2];
- $8 = $2 * $7;
- $9 = ((($1)) + 4|0);
- $10 = +HEAPF32[$9>>2];
- $11 = $4 * $10;
- $12 = $8 + $11;
- $13 = ((($1)) + 8|0);
- $14 = +HEAPF32[$13>>2];
- $15 = $6 * $14;
- $16 = $12 + $15;
- $17 = ((($1)) + 12|0);
- $18 = +HEAPF32[$17>>2];
- $19 = $18 + $16;
- HEAPF32[$0>>2] = $19;
- $20 = ((($1)) + 16|0);
- $21 = +HEAPF32[$20>>2];
- $22 = $2 * $21;
- $23 = ((($1)) + 20|0);
- $24 = +HEAPF32[$23>>2];
- $25 = $4 * $24;
- $26 = $22 + $25;
- $27 = ((($1)) + 24|0);
- $28 = +HEAPF32[$27>>2];
- $29 = $6 * $28;
- $30 = $26 + $29;
- $31 = ((($1)) + 28|0);
- $32 = +HEAPF32[$31>>2];
- $33 = $32 + $30;
- HEAPF32[$3>>2] = $33;
- $34 = ((($1)) + 32|0);
- $35 = +HEAPF32[$34>>2];
- $36 = $2 * $35;
- $37 = ((($1)) + 36|0);
- $38 = +HEAPF32[$37>>2];
- $39 = $4 * $38;
- $40 = $36 + $39;
- $41 = ((($1)) + 40|0);
- $42 = +HEAPF32[$41>>2];
- $43 = $6 * $42;
- $44 = $40 + $43;
- $45 = ((($1)) + 44|0);
- $46 = +HEAPF32[$45>>2];
- $47 = $46 + $44;
- HEAPF32[$5>>2] = $47;
- return;
- }
- function _MatrixTranspose($0) {
- $0 = $0|0;
- 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;
- var $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = ((($0)) + 4|0);
- $2 = HEAP32[$1>>2]|0;
- $3 = ((($0)) + 8|0);
- $4 = HEAP32[$3>>2]|0;
- $5 = ((($0)) + 12|0);
- $6 = HEAP32[$5>>2]|0;
- $7 = ((($0)) + 16|0);
- $8 = HEAP32[$7>>2]|0;
- $9 = ((($0)) + 24|0);
- $10 = HEAP32[$9>>2]|0;
- $11 = ((($0)) + 28|0);
- $12 = HEAP32[$11>>2]|0;
- $13 = ((($0)) + 32|0);
- $14 = HEAP32[$13>>2]|0;
- $15 = ((($0)) + 36|0);
- $16 = HEAP32[$15>>2]|0;
- $17 = ((($0)) + 44|0);
- $18 = HEAP32[$17>>2]|0;
- $19 = ((($0)) + 48|0);
- $20 = HEAP32[$19>>2]|0;
- $21 = ((($0)) + 52|0);
- $22 = HEAP32[$21>>2]|0;
- $23 = ((($0)) + 56|0);
- $24 = HEAP32[$23>>2]|0;
- HEAP32[$1>>2] = $8;
- HEAP32[$3>>2] = $14;
- HEAP32[$5>>2] = $20;
- HEAP32[$7>>2] = $2;
- HEAP32[$9>>2] = $16;
- HEAP32[$11>>2] = $22;
- HEAP32[$13>>2] = $4;
- HEAP32[$15>>2] = $10;
- HEAP32[$17>>2] = $24;
- HEAP32[$19>>2] = $6;
- HEAP32[$21>>2] = $12;
- HEAP32[$23>>2] = $18;
- return;
- }
- function _MatrixIdentity($0) {
- $0 = $0|0;
- 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;
- sp = STACKTOP;
- HEAPF32[$0>>2] = 1.0;
- $$sroa$5$0$$sroa_idx = ((($0)) + 4|0);
- ;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;
- $$sroa$55$0$$sroa_idx6 = ((($0)) + 20|0);
- HEAPF32[$$sroa$55$0$$sroa_idx6>>2] = 1.0;
- $$sroa$6$0$$sroa_idx = ((($0)) + 24|0);
- ;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;
- $$sroa$611$0$$sroa_idx12 = ((($0)) + 40|0);
- HEAPF32[$$sroa$611$0$$sroa_idx12>>2] = 1.0;
- $$sroa$7$0$$sroa_idx = ((($0)) + 44|0);
- ;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;
- $$sroa$717$0$$sroa_idx18 = ((($0)) + 60|0);
- HEAPF32[$$sroa$717$0$$sroa_idx18>>2] = 1.0;
- return;
- }
- function _MatrixTranslate($0,$1,$2,$3) {
- $0 = $0|0;
- $1 = +$1;
- $2 = +$2;
- $3 = +$3;
- 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;
- sp = STACKTOP;
- HEAPF32[$0>>2] = 1.0;
- $$sroa$4$0$$sroa_idx2 = ((($0)) + 4|0);
- $$sroa$8$0$$sroa_idx10 = ((($0)) + 20|0);
- ;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;
- HEAPF32[$$sroa$8$0$$sroa_idx10>>2] = 1.0;
- $$sroa$9$0$$sroa_idx12 = ((($0)) + 24|0);
- $$sroa$13$0$$sroa_idx20 = ((($0)) + 40|0);
- ;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;
- HEAPF32[$$sroa$13$0$$sroa_idx20>>2] = 1.0;
- $$sroa$14$0$$sroa_idx22 = ((($0)) + 44|0);
- HEAPF32[$$sroa$14$0$$sroa_idx22>>2] = 0.0;
- $$sroa$15$0$$sroa_idx24 = ((($0)) + 48|0);
- HEAPF32[$$sroa$15$0$$sroa_idx24>>2] = $1;
- $$sroa$16$0$$sroa_idx26 = ((($0)) + 52|0);
- HEAPF32[$$sroa$16$0$$sroa_idx26>>2] = $2;
- $$sroa$17$0$$sroa_idx28 = ((($0)) + 56|0);
- HEAPF32[$$sroa$17$0$$sroa_idx28>>2] = $3;
- $$sroa$18$0$$sroa_idx30 = ((($0)) + 60|0);
- HEAPF32[$$sroa$18$0$$sroa_idx30>>2] = 1.0;
- return;
- }
- function _MatrixRotate($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = +$2;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
- $3 = sp;
- _MatrixIdentity($3);
- $4 = +HEAPF32[$1>>2];
- $5 = ((($1)) + 4|0);
- $6 = +HEAPF32[$5>>2];
- $7 = ((($1)) + 8|0);
- $8 = +HEAPF32[$7>>2];
- $9 = $4 * $4;
- $10 = $6 * $6;
- $11 = $9 + $10;
- $12 = $8 * $8;
- $13 = $11 + $12;
- $14 = (+Math_sqrt((+$13)));
- $15 = $14 != 1.0;
- $16 = $14 != 0.0;
- $or$cond = $15 & $16;
- $17 = 1.0 / $14;
- $18 = $4 * $17;
- $19 = $6 * $17;
- $20 = $8 * $17;
- $$ = $or$cond ? $20 : $8;
- $$221 = $or$cond ? $19 : $6;
- $$222 = $or$cond ? $18 : $4;
- $21 = (+Math_sin((+$2)));
- $22 = (+Math_cos((+$2)));
- $23 = 1.0 - $22;
- $24 = +HEAPF32[$3>>2];
- $25 = ((($3)) + 16|0);
- $26 = +HEAPF32[$25>>2];
- $27 = ((($3)) + 32|0);
- $28 = +HEAPF32[$27>>2];
- $29 = ((($3)) + 48|0);
- $30 = +HEAPF32[$29>>2];
- $31 = ((($3)) + 4|0);
- $32 = +HEAPF32[$31>>2];
- $33 = ((($3)) + 20|0);
- $34 = +HEAPF32[$33>>2];
- $35 = ((($3)) + 36|0);
- $36 = +HEAPF32[$35>>2];
- $37 = ((($3)) + 52|0);
- $38 = +HEAPF32[$37>>2];
- $39 = ((($3)) + 8|0);
- $40 = +HEAPF32[$39>>2];
- $41 = ((($3)) + 24|0);
- $42 = +HEAPF32[$41>>2];
- $43 = ((($3)) + 40|0);
- $44 = +HEAPF32[$43>>2];
- $45 = ((($3)) + 56|0);
- $46 = +HEAPF32[$45>>2];
- $47 = $$222 * $$222;
- $48 = $23 * $47;
- $49 = $22 + $48;
- $50 = $$221 * $$222;
- $51 = $23 * $50;
- $52 = $21 * $$;
- $53 = $52 + $51;
- $54 = $$ * $$222;
- $55 = $23 * $54;
- $56 = $21 * $$221;
- $57 = $55 - $56;
- $58 = $51 - $52;
- $59 = $$221 * $$221;
- $60 = $23 * $59;
- $61 = $22 + $60;
- $62 = $$ * $$221;
- $63 = $23 * $62;
- $64 = $21 * $$222;
- $65 = $64 + $63;
- $66 = $56 + $55;
- $67 = $63 - $64;
- $68 = $$ * $$;
- $69 = $23 * $68;
- $70 = $22 + $69;
- $71 = $24 * $49;
- $72 = $53 * $32;
- $73 = $71 + $72;
- $74 = $57 * $40;
- $75 = $73 + $74;
- $76 = $26 * $49;
- $77 = $53 * $34;
- $78 = $76 + $77;
- $79 = $57 * $42;
- $80 = $78 + $79;
- $81 = $28 * $49;
- $82 = $53 * $36;
- $83 = $81 + $82;
- $84 = $57 * $44;
- $85 = $83 + $84;
- $86 = $30 * $49;
- $87 = $53 * $38;
- $88 = $86 + $87;
- $89 = $57 * $46;
- $90 = $88 + $89;
- $91 = $24 * $58;
- $92 = $61 * $32;
- $93 = $91 + $92;
- $94 = $65 * $40;
- $95 = $93 + $94;
- $96 = $26 * $58;
- $97 = $61 * $34;
- $98 = $96 + $97;
- $99 = $65 * $42;
- $100 = $98 + $99;
- $101 = $28 * $58;
- $102 = $61 * $36;
- $103 = $101 + $102;
- $104 = $65 * $44;
- $105 = $103 + $104;
- $106 = $30 * $58;
- $107 = $61 * $38;
- $108 = $106 + $107;
- $109 = $65 * $46;
- $110 = $108 + $109;
- $111 = $24 * $66;
- $112 = $67 * $32;
- $113 = $111 + $112;
- $114 = $70 * $40;
- $115 = $113 + $114;
- $116 = $26 * $66;
- $117 = $67 * $34;
- $118 = $116 + $117;
- $119 = $70 * $42;
- $120 = $118 + $119;
- $121 = $28 * $66;
- $122 = $67 * $36;
- $123 = $121 + $122;
- $124 = $70 * $44;
- $125 = $123 + $124;
- $126 = $30 * $66;
- $127 = $67 * $38;
- $128 = $126 + $127;
- $129 = $70 * $46;
- $130 = $128 + $129;
- $131 = ((($3)) + 12|0);
- $132 = HEAP32[$131>>2]|0;
- $133 = ((($3)) + 28|0);
- $134 = HEAP32[$133>>2]|0;
- $135 = ((($3)) + 44|0);
- $136 = HEAP32[$135>>2]|0;
- $137 = ((($3)) + 60|0);
- $138 = HEAP32[$137>>2]|0;
- HEAPF32[$0>>2] = $75;
- $$sroa$4$0$$sroa_idx187 = ((($0)) + 4|0);
- HEAPF32[$$sroa$4$0$$sroa_idx187>>2] = $95;
- $$sroa$5$0$$sroa_idx189 = ((($0)) + 8|0);
- HEAPF32[$$sroa$5$0$$sroa_idx189>>2] = $115;
- $$sroa$6$0$$sroa_idx191 = ((($0)) + 12|0);
- HEAP32[$$sroa$6$0$$sroa_idx191>>2] = $132;
- $$sroa$7$0$$sroa_idx193 = ((($0)) + 16|0);
- HEAPF32[$$sroa$7$0$$sroa_idx193>>2] = $80;
- $$sroa$8$0$$sroa_idx195 = ((($0)) + 20|0);
- HEAPF32[$$sroa$8$0$$sroa_idx195>>2] = $100;
- $$sroa$9$0$$sroa_idx197 = ((($0)) + 24|0);
- HEAPF32[$$sroa$9$0$$sroa_idx197>>2] = $120;
- $$sroa$10$0$$sroa_idx199 = ((($0)) + 28|0);
- HEAP32[$$sroa$10$0$$sroa_idx199>>2] = $134;
- $$sroa$11$0$$sroa_idx201 = ((($0)) + 32|0);
- HEAPF32[$$sroa$11$0$$sroa_idx201>>2] = $85;
- $$sroa$12$0$$sroa_idx203 = ((($0)) + 36|0);
- HEAPF32[$$sroa$12$0$$sroa_idx203>>2] = $105;
- $$sroa$13$0$$sroa_idx205 = ((($0)) + 40|0);
- HEAPF32[$$sroa$13$0$$sroa_idx205>>2] = $125;
- $$sroa$14$0$$sroa_idx207 = ((($0)) + 44|0);
- HEAP32[$$sroa$14$0$$sroa_idx207>>2] = $136;
- $$sroa$15$0$$sroa_idx209 = ((($0)) + 48|0);
- HEAPF32[$$sroa$15$0$$sroa_idx209>>2] = $90;
- $$sroa$16$0$$sroa_idx211 = ((($0)) + 52|0);
- HEAPF32[$$sroa$16$0$$sroa_idx211>>2] = $110;
- $$sroa$17$0$$sroa_idx213 = ((($0)) + 56|0);
- HEAPF32[$$sroa$17$0$$sroa_idx213>>2] = $130;
- $$sroa$18$0$$sroa_idx215 = ((($0)) + 60|0);
- HEAP32[$$sroa$18$0$$sroa_idx215>>2] = $138;
- STACKTOP = sp;return;
- }
- function _MatrixScale($0,$1,$2,$3) {
- $0 = $0|0;
- $1 = +$1;
- $2 = +$2;
- $3 = +$3;
- 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;
- sp = STACKTOP;
- HEAPF32[$0>>2] = $1;
- $$sroa$5$0$$sroa_idx = ((($0)) + 4|0);
- ;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;
- $$sroa$55$0$$sroa_idx6 = ((($0)) + 20|0);
- HEAPF32[$$sroa$55$0$$sroa_idx6>>2] = $2;
- $$sroa$6$0$$sroa_idx = ((($0)) + 24|0);
- ;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;
- $$sroa$611$0$$sroa_idx12 = ((($0)) + 40|0);
- HEAPF32[$$sroa$611$0$$sroa_idx12>>2] = $3;
- $$sroa$7$0$$sroa_idx = ((($0)) + 44|0);
- ;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;
- $$sroa$717$0$$sroa_idx18 = ((($0)) + 60|0);
- HEAPF32[$$sroa$717$0$$sroa_idx18>>2] = 1.0;
- return;
- }
- function _MatrixMultiply($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- $3 = +HEAPF32[$2>>2];
- $4 = +HEAPF32[$1>>2];
- $5 = $3 * $4;
- $6 = ((($2)) + 16|0);
- $7 = +HEAPF32[$6>>2];
- $8 = ((($1)) + 4|0);
- $9 = +HEAPF32[$8>>2];
- $10 = $7 * $9;
- $11 = $5 + $10;
- $12 = ((($2)) + 32|0);
- $13 = +HEAPF32[$12>>2];
- $14 = ((($1)) + 8|0);
- $15 = +HEAPF32[$14>>2];
- $16 = $13 * $15;
- $17 = $11 + $16;
- $18 = ((($2)) + 48|0);
- $19 = +HEAPF32[$18>>2];
- $20 = ((($1)) + 12|0);
- $21 = +HEAPF32[$20>>2];
- $22 = $19 * $21;
- $23 = $17 + $22;
- $24 = ((($1)) + 16|0);
- $25 = +HEAPF32[$24>>2];
- $26 = $3 * $25;
- $27 = ((($1)) + 20|0);
- $28 = +HEAPF32[$27>>2];
- $29 = $7 * $28;
- $30 = $26 + $29;
- $31 = ((($1)) + 24|0);
- $32 = +HEAPF32[$31>>2];
- $33 = $13 * $32;
- $34 = $30 + $33;
- $35 = ((($1)) + 28|0);
- $36 = +HEAPF32[$35>>2];
- $37 = $19 * $36;
- $38 = $34 + $37;
- $39 = ((($1)) + 32|0);
- $40 = +HEAPF32[$39>>2];
- $41 = $3 * $40;
- $42 = ((($1)) + 36|0);
- $43 = +HEAPF32[$42>>2];
- $44 = $7 * $43;
- $45 = $41 + $44;
- $46 = ((($1)) + 40|0);
- $47 = +HEAPF32[$46>>2];
- $48 = $13 * $47;
- $49 = $45 + $48;
- $50 = ((($1)) + 44|0);
- $51 = +HEAPF32[$50>>2];
- $52 = $19 * $51;
- $53 = $49 + $52;
- $54 = ((($1)) + 48|0);
- $55 = +HEAPF32[$54>>2];
- $56 = $3 * $55;
- $57 = ((($1)) + 52|0);
- $58 = +HEAPF32[$57>>2];
- $59 = $7 * $58;
- $60 = $56 + $59;
- $61 = ((($1)) + 56|0);
- $62 = +HEAPF32[$61>>2];
- $63 = $13 * $62;
- $64 = $60 + $63;
- $65 = ((($1)) + 60|0);
- $66 = +HEAPF32[$65>>2];
- $67 = $19 * $66;
- $68 = $64 + $67;
- $69 = ((($2)) + 4|0);
- $70 = +HEAPF32[$69>>2];
- $71 = $4 * $70;
- $72 = ((($2)) + 20|0);
- $73 = +HEAPF32[$72>>2];
- $74 = $9 * $73;
- $75 = $71 + $74;
- $76 = ((($2)) + 36|0);
- $77 = +HEAPF32[$76>>2];
- $78 = $15 * $77;
- $79 = $75 + $78;
- $80 = ((($2)) + 52|0);
- $81 = +HEAPF32[$80>>2];
- $82 = $21 * $81;
- $83 = $79 + $82;
- $84 = $25 * $70;
- $85 = $28 * $73;
- $86 = $84 + $85;
- $87 = $32 * $77;
- $88 = $86 + $87;
- $89 = $36 * $81;
- $90 = $88 + $89;
- $91 = $40 * $70;
- $92 = $43 * $73;
- $93 = $91 + $92;
- $94 = $47 * $77;
- $95 = $93 + $94;
- $96 = $51 * $81;
- $97 = $95 + $96;
- $98 = $55 * $70;
- $99 = $58 * $73;
- $100 = $98 + $99;
- $101 = $62 * $77;
- $102 = $100 + $101;
- $103 = $66 * $81;
- $104 = $102 + $103;
- $105 = ((($2)) + 8|0);
- $106 = +HEAPF32[$105>>2];
- $107 = $4 * $106;
- $108 = ((($2)) + 24|0);
- $109 = +HEAPF32[$108>>2];
- $110 = $9 * $109;
- $111 = $107 + $110;
- $112 = ((($2)) + 40|0);
- $113 = +HEAPF32[$112>>2];
- $114 = $15 * $113;
- $115 = $111 + $114;
- $116 = ((($2)) + 56|0);
- $117 = +HEAPF32[$116>>2];
- $118 = $21 * $117;
- $119 = $115 + $118;
- $120 = $25 * $106;
- $121 = $28 * $109;
- $122 = $120 + $121;
- $123 = $32 * $113;
- $124 = $122 + $123;
- $125 = $36 * $117;
- $126 = $124 + $125;
- $127 = $40 * $106;
- $128 = $43 * $109;
- $129 = $127 + $128;
- $130 = $47 * $113;
- $131 = $129 + $130;
- $132 = $51 * $117;
- $133 = $131 + $132;
- $134 = $55 * $106;
- $135 = $58 * $109;
- $136 = $134 + $135;
- $137 = $62 * $113;
- $138 = $136 + $137;
- $139 = $66 * $117;
- $140 = $138 + $139;
- $141 = ((($2)) + 12|0);
- $142 = +HEAPF32[$141>>2];
- $143 = $4 * $142;
- $144 = ((($2)) + 28|0);
- $145 = +HEAPF32[$144>>2];
- $146 = $9 * $145;
- $147 = $143 + $146;
- $148 = ((($2)) + 44|0);
- $149 = +HEAPF32[$148>>2];
- $150 = $15 * $149;
- $151 = $147 + $150;
- $152 = ((($2)) + 60|0);
- $153 = +HEAPF32[$152>>2];
- $154 = $21 * $153;
- $155 = $151 + $154;
- $156 = $25 * $142;
- $157 = $28 * $145;
- $158 = $156 + $157;
- $159 = $32 * $149;
- $160 = $158 + $159;
- $161 = $36 * $153;
- $162 = $160 + $161;
- $163 = $40 * $142;
- $164 = $43 * $145;
- $165 = $163 + $164;
- $166 = $47 * $149;
- $167 = $165 + $166;
- $168 = $51 * $153;
- $169 = $167 + $168;
- $170 = $55 * $142;
- $171 = $58 * $145;
- $172 = $170 + $171;
- $173 = $62 * $149;
- $174 = $172 + $173;
- $175 = $66 * $153;
- $176 = $174 + $175;
- HEAPF32[$0>>2] = $23;
- $$sroa$4$0$$sroa_idx2 = ((($0)) + 4|0);
- HEAPF32[$$sroa$4$0$$sroa_idx2>>2] = $83;
- $$sroa$5$0$$sroa_idx4 = ((($0)) + 8|0);
- HEAPF32[$$sroa$5$0$$sroa_idx4>>2] = $119;
- $$sroa$6$0$$sroa_idx6 = ((($0)) + 12|0);
- HEAPF32[$$sroa$6$0$$sroa_idx6>>2] = $155;
- $$sroa$7$0$$sroa_idx8 = ((($0)) + 16|0);
- HEAPF32[$$sroa$7$0$$sroa_idx8>>2] = $38;
- $$sroa$8$0$$sroa_idx10 = ((($0)) + 20|0);
- HEAPF32[$$sroa$8$0$$sroa_idx10>>2] = $90;
- $$sroa$9$0$$sroa_idx12 = ((($0)) + 24|0);
- HEAPF32[$$sroa$9$0$$sroa_idx12>>2] = $126;
- $$sroa$10$0$$sroa_idx14 = ((($0)) + 28|0);
- HEAPF32[$$sroa$10$0$$sroa_idx14>>2] = $162;
- $$sroa$11$0$$sroa_idx16 = ((($0)) + 32|0);
- HEAPF32[$$sroa$11$0$$sroa_idx16>>2] = $53;
- $$sroa$12$0$$sroa_idx18 = ((($0)) + 36|0);
- HEAPF32[$$sroa$12$0$$sroa_idx18>>2] = $97;
- $$sroa$13$0$$sroa_idx20 = ((($0)) + 40|0);
- HEAPF32[$$sroa$13$0$$sroa_idx20>>2] = $133;
- $$sroa$14$0$$sroa_idx22 = ((($0)) + 44|0);
- HEAPF32[$$sroa$14$0$$sroa_idx22>>2] = $169;
- $$sroa$15$0$$sroa_idx24 = ((($0)) + 48|0);
- HEAPF32[$$sroa$15$0$$sroa_idx24>>2] = $68;
- $$sroa$16$0$$sroa_idx26 = ((($0)) + 52|0);
- HEAPF32[$$sroa$16$0$$sroa_idx26>>2] = $104;
- $$sroa$17$0$$sroa_idx28 = ((($0)) + 56|0);
- HEAPF32[$$sroa$17$0$$sroa_idx28>>2] = $140;
- $$sroa$18$0$$sroa_idx30 = ((($0)) + 60|0);
- HEAPF32[$$sroa$18$0$$sroa_idx30>>2] = $176;
- return;
- }
- function _MatrixOrtho($0,$1,$2,$3,$4,$5,$6) {
- $0 = $0|0;
- $1 = +$1;
- $2 = +$2;
- $3 = +$3;
- $4 = +$4;
- $5 = +$5;
- $6 = +$6;
- 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;
- 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;
- var sp = 0;
- sp = STACKTOP;
- $7 = $2 - $1;
- $8 = $7;
- $9 = $4 - $3;
- $10 = $9;
- $11 = $6 - $5;
- $12 = $11;
- $13 = 2.0 / $8;
- $14 = 2.0 / $10;
- $15 = -2.0 / $12;
- $16 = $1 + $2;
- $17 = -$16;
- $18 = $8;
- $19 = $17 / $18;
- $20 = $19;
- $21 = $3 + $4;
- $22 = -$21;
- $23 = $10;
- $24 = $22 / $23;
- $25 = $24;
- $26 = $5 + $6;
- $27 = -$26;
- $28 = $12;
- $29 = $27 / $28;
- $30 = $29;
- HEAPF32[$0>>2] = $13;
- $$sroa$4$0$$sroa_idx12 = ((($0)) + 4|0);
- HEAPF32[$$sroa$4$0$$sroa_idx12>>2] = 0.0;
- $$sroa$5$0$$sroa_idx14 = ((($0)) + 8|0);
- HEAPF32[$$sroa$5$0$$sroa_idx14>>2] = 0.0;
- $$sroa$6$0$$sroa_idx16 = ((($0)) + 12|0);
- HEAPF32[$$sroa$6$0$$sroa_idx16>>2] = $20;
- $$sroa$7$0$$sroa_idx18 = ((($0)) + 16|0);
- HEAPF32[$$sroa$7$0$$sroa_idx18>>2] = 0.0;
- $$sroa$8$0$$sroa_idx20 = ((($0)) + 20|0);
- HEAPF32[$$sroa$8$0$$sroa_idx20>>2] = $14;
- $$sroa$9$0$$sroa_idx22 = ((($0)) + 24|0);
- HEAPF32[$$sroa$9$0$$sroa_idx22>>2] = 0.0;
- $$sroa$10$0$$sroa_idx24 = ((($0)) + 28|0);
- HEAPF32[$$sroa$10$0$$sroa_idx24>>2] = $25;
- $$sroa$11$0$$sroa_idx26 = ((($0)) + 32|0);
- HEAPF32[$$sroa$11$0$$sroa_idx26>>2] = 0.0;
- $$sroa$12$0$$sroa_idx28 = ((($0)) + 36|0);
- HEAPF32[$$sroa$12$0$$sroa_idx28>>2] = 0.0;
- $$sroa$13$0$$sroa_idx30 = ((($0)) + 40|0);
- HEAPF32[$$sroa$13$0$$sroa_idx30>>2] = $15;
- $$sroa$14$0$$sroa_idx32 = ((($0)) + 44|0);
- HEAPF32[$$sroa$14$0$$sroa_idx32>>2] = $30;
- $$sroa$15$0$$sroa_idx34 = ((($0)) + 48|0);
- HEAPF32[$$sroa$15$0$$sroa_idx34>>2] = 0.0;
- $$sroa$16$0$$sroa_idx36 = ((($0)) + 52|0);
- HEAPF32[$$sroa$16$0$$sroa_idx36>>2] = 0.0;
- $$sroa$17$0$$sroa_idx38 = ((($0)) + 56|0);
- HEAPF32[$$sroa$17$0$$sroa_idx38>>2] = 0.0;
- $$sroa$18$0$$sroa_idx40 = ((($0)) + 60|0);
- HEAPF32[$$sroa$18$0$$sroa_idx40>>2] = 1.0;
- return;
- }
- function _ProcessGestureEvent($0) {
- $0 = $0|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- var $moveDownPosition2$byval_copy12 = 0, $or$cond = 0, $or$cond3 = 0, $or$cond5 = 0, $or$cond7 = 0, $or$cond9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $moveDownPosition2$byval_copy12 = sp + 8|0;
- $moveDownPosition$byval_copy11 = sp;
- $1 = ((($0)) + 4|0);
- $2 = HEAP32[$1>>2]|0;
- HEAP32[7738] = $2;
- $3 = ($2|0)<(2);
- $4 = HEAP32[$0>>2]|0;
- $5 = ($4|0)==(1);
- if (!($3)) {
- if ($5) {
- $88 = ((($0)) + 24|0);
- $89 = $88;
- $90 = $89;
- $91 = HEAP32[$90>>2]|0;
- $92 = (($89) + 4)|0;
- $93 = $92;
- $94 = HEAP32[$93>>2]|0;
- $95 = 14000;
- $96 = $95;
- HEAP32[$96>>2] = $91;
- $97 = (($95) + 4)|0;
- $98 = $97;
- HEAP32[$98>>2] = $94;
- $99 = ((($0)) + 32|0);
- $100 = $99;
- $101 = $100;
- $102 = HEAP32[$101>>2]|0;
- $103 = (($100) + 4)|0;
- $104 = $103;
- $105 = HEAP32[$104>>2]|0;
- $106 = 14040;
- $107 = $106;
- HEAP32[$107>>2] = $102;
- $108 = (($106) + 4)|0;
- $109 = $108;
- HEAP32[$109>>2] = $105;
- $110 = +HEAPF32[3510];
- $111 = +HEAPF32[3500];
- $112 = $110 - $111;
- HEAPF32[3512] = $112;
- $113 = +HEAPF32[(14044)>>2];
- $114 = +HEAPF32[(14004)>>2];
- $115 = $113 - $114;
- HEAPF32[(14052)>>2] = $115;
- HEAP32[7737] = 4;
- STACKTOP = sp;return;
- }
- switch ($4|0) {
- case 2: {
- ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14032>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14032+4>>2]|0;
- ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14056>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14056+4>>2]|0;
- $116 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
- HEAPF32[7743] = $116;
- $117 = 14032;
- $118 = $117;
- $119 = HEAP32[$118>>2]|0;
- $120 = (($117) + 4)|0;
- $121 = $120;
- $122 = HEAP32[$121>>2]|0;
- $123 = 14000;
- $124 = $123;
- HEAP32[$124>>2] = $119;
- $125 = (($123) + 4)|0;
- $126 = $125;
- HEAP32[$126>>2] = $122;
- $127 = 14056;
- $128 = $127;
- $129 = HEAP32[$128>>2]|0;
- $130 = (($127) + 4)|0;
- $131 = $130;
- $132 = HEAP32[$131>>2]|0;
- $133 = 14040;
- $134 = $133;
- HEAP32[$134>>2] = $129;
- $135 = (($133) + 4)|0;
- $136 = $135;
- HEAP32[$136>>2] = $132;
- $137 = ((($0)) + 24|0);
- $138 = $137;
- $139 = $138;
- $140 = HEAP32[$139>>2]|0;
- $141 = (($138) + 4)|0;
- $142 = $141;
- $143 = HEAP32[$142>>2]|0;
- $144 = 14032;
- $145 = $144;
- HEAP32[$145>>2] = $140;
- $146 = (($144) + 4)|0;
- $147 = $146;
- HEAP32[$147>>2] = $143;
- $148 = ((($0)) + 32|0);
- $149 = $148;
- $150 = $149;
- $151 = HEAP32[$150>>2]|0;
- $152 = (($149) + 4)|0;
- $153 = $152;
- $154 = HEAP32[$153>>2]|0;
- $155 = 14056;
- $156 = $155;
- HEAP32[$156>>2] = $151;
- $157 = (($155) + 4)|0;
- $158 = $157;
- HEAP32[$158>>2] = $154;
- $159 = +HEAPF32[3514];
- $160 = +HEAPF32[3508];
- $161 = $159 - $160;
- HEAPF32[3512] = $161;
- $162 = +HEAPF32[(14060)>>2];
- $163 = +HEAPF32[(14036)>>2];
- $164 = $162 - $163;
- HEAPF32[(14052)>>2] = $164;
- ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14000>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14000+4>>2]|0;
- ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14032>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14032+4>>2]|0;
- $165 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
- $166 = !($165 >= 0.004999999888241291);
- if ($166) {
- ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14040>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14040+4>>2]|0;
- ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14056>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14056+4>>2]|0;
- $167 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
- $168 = !($167 >= 0.004999999888241291);
- if ($168) {
- $$sink16 = 4;
- } else {
- label = 29;
- }
- } else {
- label = 29;
- }
- if ((label|0) == 29) {
- ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14032>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14032+4>>2]|0;
- ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14056>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14056+4>>2]|0;
- $169 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
- $170 = +HEAPF32[7743];
- $171 = $169 - $170;
- $172 = $171 < 0.0;
- $$sink11 = $172 ? 256 : 512;
- $$sink16 = $$sink11;
- }
- HEAP32[7737] = $$sink16;
- ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14032>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14032+4>>2]|0;
- ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14056>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14056+4>>2]|0;
- $173 = (+_Vector2Angle($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
- $174 = 360.0 - $173;
- HEAPF32[7744] = $174;
- STACKTOP = sp;return;
- break;
- }
- case 0: {
- HEAPF32[7743] = 0.0;
- HEAPF32[7744] = 0.0;
- HEAPF32[3512] = 0.0;
- HEAPF32[(14052)>>2] = 0.0;
- HEAP32[7738] = 0;
- HEAP32[7737] = 0;
- STACKTOP = sp;return;
- break;
- }
- default: {
- STACKTOP = sp;return;
- }
- }
- }
- if ($5) {
- $6 = HEAP32[7739]|0;
- $7 = (($6) + 1)|0;
- HEAP32[7739] = $7;
- $8 = HEAP32[7737]|0;
- $9 = ($8|0)==(0);
- $10 = ($6|0)>(0);
- $or$cond = $10 & $9;
- if ($or$cond) {
- $11 = ((($0)) + 24|0);
- ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14000>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14000+4>>2]|0;
- ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[$11>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[$11+4>>2]|0;
- $12 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
- $13 = $12 < 0.029999999329447746;
- if ($13) {
- HEAP32[7737] = 2;
- HEAP32[7739] = 0;
- } else {
- label = 6;
- }
- } else {
- label = 6;
- }
- if ((label|0) == 6) {
- HEAP32[7739] = 1;
- HEAP32[7737] = 1;
- }
- $14 = ((($0)) + 24|0);
- $15 = $14;
- $16 = $15;
- $17 = HEAP32[$16>>2]|0;
- $18 = (($15) + 4)|0;
- $19 = $18;
- $20 = HEAP32[$19>>2]|0;
- $21 = 14000;
- $22 = $21;
- HEAP32[$22>>2] = $17;
- $23 = (($21) + 4)|0;
- $24 = $23;
- HEAP32[$24>>2] = $20;
- $25 = 14008;
- $26 = $25;
- HEAP32[$26>>2] = $17;
- $27 = (($25) + 4)|0;
- $28 = $27;
- HEAP32[$28>>2] = $20;
- $29 = 14016;
- $30 = $29;
- HEAP32[$30>>2] = $17;
- $31 = (($29) + 4)|0;
- $32 = $31;
- HEAP32[$32>>2] = $20;
- $33 = ((($0)) + 8|0);
- $34 = HEAP32[$33>>2]|0;
- HEAP32[6] = $34;
- HEAPF32[3506] = 0.0;
- HEAPF32[(14028)>>2] = 0.0;
- STACKTOP = sp;return;
- }
- switch ($4|0) {
- case 0: {
- $35 = HEAP32[7737]|0;
- $36 = ($35|0)==(8);
- if ($36) {
- $37 = ((($0)) + 24|0);
- $38 = $37;
- $39 = $38;
- $40 = HEAP32[$39>>2]|0;
- $41 = (($38) + 4)|0;
- $42 = $41;
- $43 = HEAP32[$42>>2]|0;
- $44 = 14016;
- $45 = $44;
- HEAP32[$45>>2] = $40;
- $46 = (($44) + 4)|0;
- $47 = $46;
- HEAP32[$47>>2] = $43;
- }
- ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14000>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14000+4>>2]|0;
- ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14016>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14016+4>>2]|0;
- $48 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
- $49 = $48 / 0.0;
- HEAPF32[7740] = $49;
- HEAP32[7741] = 0;
- $50 = $49 > 5.0000002374872565E-4;
- if ($50) {
- $51 = HEAP32[6]|0;
- $52 = ((($0)) + 8|0);
- $53 = HEAP32[$52>>2]|0;
- $54 = ($51|0)==($53|0);
- if ($54) {
- ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14000>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14000+4>>2]|0;
- ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14016>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14016+4>>2]|0;
- $55 = (+_Vector2Angle($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
- $56 = 360.0 - $55;
- HEAPF32[7742] = $56;
- $57 = $56 < 30.0;
- $58 = $56 > 330.0;
- $or$cond3 = $57 | $58;
- if ($or$cond3) {
- $$sink10 = 16;
- } else {
- $59 = $56 > 30.0;
- $60 = $56 < 120.0;
- $or$cond5 = $59 & $60;
- if ($or$cond5) {
- $$sink10 = 64;
- } else {
- $61 = $56 > 120.0;
- $62 = $56 < 210.0;
- $or$cond7 = $61 & $62;
- $63 = $56 > 210.0;
- $64 = $56 < 300.0;
- $or$cond9 = $63 & $64;
- $$sink = $or$cond9 ? 128 : 0;
- $$$sink = $or$cond7 ? 32 : $$sink;
- $$sink10 = $$$sink;
- }
- }
- } else {
- label = 16;
- }
- } else {
- label = 16;
- }
- if ((label|0) == 16) {
- HEAPF32[7740] = 0.0;
- HEAPF32[7742] = 0.0;
- $$sink10 = 0;
- }
- HEAP32[7737] = $$sink10;
- HEAPF32[3502] = 0.0;
- HEAPF32[(14012)>>2] = 0.0;
- HEAP32[7738] = 0;
- STACKTOP = sp;return;
- break;
- }
- case 2: {
- $65 = HEAP32[7741]|0;
- $66 = ($65|0)==(0);
- if ($66) {
- HEAP32[7741] = 1;
- }
- $67 = ((($0)) + 24|0);
- $68 = $67;
- $69 = $68;
- $70 = HEAP32[$69>>2]|0;
- $71 = (($68) + 4)|0;
- $72 = $71;
- $73 = HEAP32[$72>>2]|0;
- $74 = 14032;
- $75 = $74;
- HEAP32[$75>>2] = $70;
- $76 = (($74) + 4)|0;
- $77 = $76;
- HEAP32[$77>>2] = $73;
- $78 = HEAP32[7737]|0;
- $79 = ($78|0)==(4);
- if ($79) {
- ;HEAP32[$moveDownPosition$byval_copy11>>2]=HEAP32[14000>>2]|0;HEAP32[$moveDownPosition$byval_copy11+4>>2]=HEAP32[14000+4>>2]|0;
- ;HEAP32[$moveDownPosition2$byval_copy12>>2]=HEAP32[14032>>2]|0;HEAP32[$moveDownPosition2$byval_copy12+4>>2]=HEAP32[14032+4>>2]|0;
- $80 = (+_Vector2Distance($moveDownPosition$byval_copy11,$moveDownPosition2$byval_copy12));
- $81 = !($80 >= 0.014999999664723873);
- if (!($81)) {
- HEAP32[7737] = 8;
- }
- }
- $82 = +HEAPF32[3508];
- $83 = +HEAPF32[3502];
- $84 = $82 - $83;
- HEAPF32[3506] = $84;
- $85 = +HEAPF32[(14036)>>2];
- $86 = +HEAPF32[(14012)>>2];
- $87 = $85 - $86;
- HEAPF32[(14028)>>2] = $87;
- STACKTOP = sp;return;
- break;
- }
- default: {
- STACKTOP = sp;return;
- }
- }
- }
- function _UpdateGestures() {
- 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;
- sp = STACKTOP;
- $0 = HEAP32[7737]|0;
- $$off = (($0) + -1)|0;
- $1 = ($$off>>>0)<(2);
- $2 = HEAP32[7738]|0;
- $3 = ($2|0)<(2);
- $or$cond3 = $1 & $3;
- if ($or$cond3) {
- HEAP32[7737] = 4;
- }
- $4 = HEAP32[7737]|0;
- $5 = (($4) + -16)|0;
- $6 = $5 >>> 4;
- $7 = $5 << 28;
- $8 = $6 | $7;
- switch ($8|0) {
- case 0: case 1: case 3: case 7: {
- break;
- }
- default: {
- return;
- }
- }
- HEAP32[7737] = 0;
- return;
- }
- function _GetMousePosition($0) {
- $0 = $0|0;
- 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;
- sp = STACKTOP;
- $1 = 14064;
- $2 = $1;
- $3 = HEAP32[$2>>2]|0;
- $4 = (($1) + 4)|0;
- $5 = $4;
- $6 = HEAP32[$5>>2]|0;
- $7 = $0;
- $8 = $7;
- HEAP32[$8>>2] = $3;
- $9 = (($7) + 4)|0;
- $10 = $9;
- HEAP32[$10>>2] = $6;
- return;
- }
- function _IsKeyDown($0) {
- $0 = $0|0;
- var $$ = 0, $1 = 0, $2 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = (_GetKeyStatus($0)|0);
- $2 = ($1|0)==(1);
- $$ = $2&1;
- return ($$|0);
- }
- function _GetScreenWidth() {
- var $0 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = HEAP32[7747]|0;
- return ($0|0);
- }
- function _GetScreenHeight() {
- var $0 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = HEAP32[7746]|0;
- return ($0|0);
- }
- function _GetKeyStatus($0) {
- $0 = $0|0;
- var $1 = 0, $2 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = HEAP32[7745]|0;
- $2 = (_glfwGetKey(($1|0),($0|0))|0);
- return ($2|0);
- }
- function _InitWindow($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $vararg_buffer = sp;
- _TraceLog(0,3356,$vararg_buffer);
- HEAP32[7749] = $2;
- _InitGraphicsDevice($0,$1);
- _LoadDefaultFont();
- _InitTimer_12();
- (_emscripten_set_fullscreenchange_callback((0|0),(0|0),1,(4|0))|0);
- (_emscripten_set_keypress_callback((3385|0),(0|0),1,(5|0))|0);
- (_emscripten_set_click_callback((3385|0),(0|0),1,(6|0))|0);
- (_emscripten_set_touchstart_callback((3385|0),(0|0),1,(7|0))|0);
- (_emscripten_set_touchend_callback((3385|0),(0|0),1,(7|0))|0);
- (_emscripten_set_touchmove_callback((3385|0),(0|0),1,(7|0))|0);
- (_emscripten_set_touchcancel_callback((3385|0),(0|0),1,(7|0))|0);
- (_emscripten_set_gamepadconnected_callback((0|0),1,(8|0))|0);
- (_emscripten_set_gamepaddisconnected_callback((0|0),1,(8|0))|0);
- $3 = HEAP32[7747]|0;
- $4 = (+($3|0));
- $5 = $4 * 0.5;
- HEAPF32[3516] = $5;
- $6 = HEAP32[7746]|0;
- $7 = (+($6|0));
- $8 = $7 * 0.5;
- HEAPF32[(14068)>>2] = $8;
- $9 = HEAP32[7750]|0;
- $10 = ($9|0)==(0);
- if ($10) {
- STACKTOP = sp;return;
- }
- _SetTargetFPS(60);
- _LogoAnimation();
- STACKTOP = sp;return;
- }
- function _TraceLog($0,$1,$varargs) {
- $0 = $0|0;
- $1 = $1|0;
- $varargs = $varargs|0;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $2 = sp;
- switch ($0|0) {
- case 0: {
- ;HEAP8[14104>>0]=HEAP8[7914>>0]|0;HEAP8[14104+1>>0]=HEAP8[7914+1>>0]|0;HEAP8[14104+2>>0]=HEAP8[7914+2>>0]|0;HEAP8[14104+3>>0]=HEAP8[7914+3>>0]|0;HEAP8[14104+4>>0]=HEAP8[7914+4>>0]|0;HEAP8[14104+5>>0]=HEAP8[7914+5>>0]|0;HEAP8[14104+6>>0]=HEAP8[7914+6>>0]|0;
- break;
- }
- case 1: {
- $3 = 14104;
- $4 = $3;
- HEAP32[$4>>2] = 1330795077;
- $5 = (($3) + 4)|0;
- $6 = $5;
- HEAP32[$6>>2] = 2112082;
- break;
- }
- case 2: {
- dest=14104; src=7921; 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));
- break;
- }
- case 3: {
- $7 = 14104;
- $8 = $7;
- HEAP32[$8>>2] = 1430406468;
- $9 = (($7) + 4)|0;
- $10 = $9;
- HEAP32[$10>>2] = 2112071;
- break;
- }
- default: {
- }
- }
- (_strcat(14104,$1)|0);
- $strlen = (_strlen(14104)|0);
- $endptr = (14104 + ($strlen)|0);
- HEAP8[$endptr>>0]=10&255;HEAP8[$endptr+1>>0]=10>>8;
- HEAP32[$2>>2] = $varargs;
- $11 = ($0|0)==(3);
- if ($11) {
- STACKTOP = sp;return;
- }
- (_vprintf(14104,$2)|0);
- $12 = ($0|0)==(1);
- if ($12) {
- _exit(1);
- // unreachable;
- } else {
- STACKTOP = sp;return;
- }
- }
- function _InitGraphicsDevice($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- var label = 0, sp = 0, src = 0, stop = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 144|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(144|0);
- $$byval_copy = sp + 136|0;
- $vararg_buffer22 = sp + 64|0;
- $vararg_buffer18 = sp + 56|0;
- $vararg_buffer14 = sp + 48|0;
- $vararg_buffer10 = sp + 40|0;
- $vararg_buffer8 = sp + 32|0;
- $vararg_buffer6 = sp + 24|0;
- $vararg_buffer3 = sp + 16|0;
- $vararg_buffer1 = sp + 8|0;
- $vararg_buffer = sp;
- $2 = sp + 72|0;
- $3 = sp + 140|0;
- HEAP32[7747] = $0;
- HEAP32[7746] = $1;
- _MatrixIdentity($2);
- dest=31076; 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));
- (_glfwSetErrorCallback((1|0))|0);
- $4 = (_glfwInit()|0);
- $5 = ($4|0)==(0);
- if ($5) {
- _TraceLog(1,4056,$vararg_buffer);
- }
- $6 = HEAP32[7747]|0;
- HEAP32[7785] = $6;
- $7 = HEAP32[7746]|0;
- HEAP32[7786] = $7;
- _glfwDefaultWindowHints();
- $8 = HEAP8[35952]|0;
- $9 = $8 & 4;
- $10 = ($9<<24>>24)==(0);
- if ($10) {
- _glfwWindowHint(131075,0);
- } else {
- _glfwWindowHint(131075,1);
- }
- $11 = HEAP8[35952]|0;
- $12 = $11 & 8;
- $13 = ($12<<24>>24)==(0);
- if (!($13)) {
- _glfwWindowHint(131077,1);
- }
- $14 = HEAP8[35952]|0;
- $15 = $14 & 32;
- $16 = ($15<<24>>24)==(0);
- if (!($16)) {
- _glfwWindowHint(135181,4);
- _TraceLog(0,4082,$vararg_buffer1);
- }
- $17 = (_rlGetVersion()|0);
- $18 = ($17|0)==(2);
- if ($18) {
- _glfwWindowHint(139266,2);
- _glfwWindowHint(139267,1);
- } else {
- $19 = (_rlGetVersion()|0);
- $20 = ($19|0)==(3);
- if ($20) {
- _glfwWindowHint(139266,3);
- _glfwWindowHint(139267,3);
- _glfwWindowHint(139272,204801);
- _glfwWindowHint(139270,0);
- }
- }
- $21 = HEAP32[7787]|0;
- $22 = ($21|0)==(0);
- if ($22) {
- $47 = HEAP32[7747]|0;
- $48 = HEAP32[7746]|0;
- $49 = HEAP32[7749]|0;
- $50 = (_glfwCreateWindow(($47|0),($48|0),($49|0),(0|0),(0|0))|0);
- HEAP32[7745] = $50;
- $51 = HEAP32[7747]|0;
- HEAP32[7788] = $51;
- $52 = HEAP32[7746]|0;
- HEAP32[7789] = $52;
- $54 = $50;
- } else {
- $23 = (_glfwGetPrimaryMonitor()|0);
- $24 = (_glfwGetVideoModes(($23|0),($$byval_copy|0))|0);
- $25 = HEAP32[$$byval_copy>>2]|0;
- $26 = ($25|0)>(0);
- L22: do {
- if ($26) {
- $27 = HEAP32[7747]|0;
- $28 = HEAP32[$$byval_copy>>2]|0;
- $29 = HEAP32[7746]|0;
- $$015 = 0;
- while(1) {
- $30 = (($24) + (($$015*24)|0)|0);
- $31 = HEAP32[$30>>2]|0;
- $32 = ($31|0)<($27|0);
- if (!($32)) {
- $33 = (((($24) + (($$015*24)|0)|0)) + 4|0);
- $34 = HEAP32[$33>>2]|0;
- $35 = ($34|0)<($29|0);
- if (!($35)) {
- break;
- }
- }
- $36 = (($$015) + 1)|0;
- $37 = ($36|0)<($28|0);
- if ($37) {
- $$015 = $36;
- } else {
- break L22;
- }
- }
- HEAP32[7785] = $31;
- HEAP32[7786] = $34;
- }
- } while(0);
- $38 = HEAP32[7785]|0;
- $39 = HEAP32[7786]|0;
- HEAP32[$vararg_buffer3>>2] = $38;
- $vararg_ptr5 = ((($vararg_buffer3)) + 4|0);
- HEAP32[$vararg_ptr5>>2] = $39;
- _TraceLog(2,4107,$vararg_buffer3);
- $40 = HEAP32[7785]|0;
- $41 = HEAP32[7786]|0;
- _SetupFramebufferSize($40,$41);
- $42 = HEAP32[7785]|0;
- $43 = HEAP32[7786]|0;
- $44 = HEAP32[7749]|0;
- $45 = (_glfwGetPrimaryMonitor()|0);
- $46 = (_glfwCreateWindow(($42|0),($43|0),($44|0),($45|0),(0|0))|0);
- HEAP32[7745] = $46;
- $54 = $46;
- }
- $53 = ($54|0)==(0|0);
- if ($53) {
- _glfwTerminate();
- _TraceLog(1,4145,$vararg_buffer6);
- } else {
- _TraceLog(0,4178,$vararg_buffer8);
- $55 = HEAP32[7788]|0;
- $56 = HEAP32[7789]|0;
- HEAP32[$vararg_buffer10>>2] = $55;
- $vararg_ptr13 = ((($vararg_buffer10)) + 4|0);
- HEAP32[$vararg_ptr13>>2] = $56;
- _TraceLog(0,4218,$vararg_buffer10);
- $57 = HEAP32[7747]|0;
- $58 = HEAP32[7746]|0;
- HEAP32[$vararg_buffer14>>2] = $57;
- $vararg_ptr17 = ((($vararg_buffer14)) + 4|0);
- HEAP32[$vararg_ptr17>>2] = $58;
- _TraceLog(0,4239,$vararg_buffer14);
- $59 = HEAP32[7790]|0;
- $60 = HEAP32[7791]|0;
- HEAP32[$vararg_buffer18>>2] = $59;
- $vararg_ptr21 = ((($vararg_buffer18)) + 4|0);
- HEAP32[$vararg_ptr21>>2] = $60;
- _TraceLog(0,4260,$vararg_buffer18);
- }
- $61 = HEAP32[7745]|0;
- (_glfwSetWindowSizeCallback(($61|0),(1|0))|0);
- $62 = HEAP32[7745]|0;
- (_glfwSetCursorEnterCallback(($62|0),(2|0))|0);
- $63 = HEAP32[7745]|0;
- (_glfwSetKeyCallback(($63|0),(1|0))|0);
- $64 = HEAP32[7745]|0;
- (_glfwSetMouseButtonCallback(($64|0),(1|0))|0);
- $65 = HEAP32[7745]|0;
- (_glfwSetCursorPosCallback(($65|0),(1|0))|0);
- $66 = HEAP32[7745]|0;
- (_glfwSetCharCallback(($66|0),(3|0))|0);
- $67 = HEAP32[7745]|0;
- (_glfwSetScrollCallback(($67|0),(2|0))|0);
- $68 = HEAP32[7745]|0;
- (_glfwSetWindowIconifyCallback(($68|0),(4|0))|0);
- $69 = HEAP32[7745]|0;
- _glfwMakeContextCurrent(($69|0));
- _glfwSwapInterval(0);
- $70 = HEAP8[35952]|0;
- $71 = $70 & 64;
- $72 = ($71<<24>>24)==(0);
- if ($72) {
- $73 = HEAP32[7747]|0;
- $74 = HEAP32[7746]|0;
- _rlglInit($73,$74);
- _SetupViewport();
- _rlMatrixMode(5889);
- _rlLoadIdentity();
- $75 = HEAP32[7788]|0;
- $76 = HEAP32[7790]|0;
- $77 = (($75) - ($76))|0;
- $78 = (+($77|0));
- $79 = HEAP32[7789]|0;
- $80 = HEAP32[7791]|0;
- $81 = (($79) - ($80))|0;
- $82 = (+($81|0));
- _rlOrtho(0.0,$78,$82,0.0,0.0,1.0);
- _rlMatrixMode(5888);
- _rlLoadIdentity();
- HEAP8[$3>>0] = -11;
- $83 = ((($3)) + 1|0);
- HEAP8[$83>>0] = -11;
- $84 = ((($3)) + 2|0);
- HEAP8[$84>>0] = -11;
- $85 = ((($3)) + 3|0);
- HEAP8[$85>>0] = -1;
- ;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;
- _ClearBackground($$byval_copy);
- STACKTOP = sp;return;
- }
- _glfwSwapInterval(1);
- _TraceLog(0,4285,$vararg_buffer22);
- $73 = HEAP32[7747]|0;
- $74 = HEAP32[7746]|0;
- _rlglInit($73,$74);
- _SetupViewport();
- _rlMatrixMode(5889);
- _rlLoadIdentity();
- $75 = HEAP32[7788]|0;
- $76 = HEAP32[7790]|0;
- $77 = (($75) - ($76))|0;
- $78 = (+($77|0));
- $79 = HEAP32[7789]|0;
- $80 = HEAP32[7791]|0;
- $81 = (($79) - ($80))|0;
- $82 = (+($81|0));
- _rlOrtho(0.0,$78,$82,0.0,0.0,1.0);
- _rlMatrixMode(5888);
- _rlLoadIdentity();
- HEAP8[$3>>0] = -11;
- $83 = ((($3)) + 1|0);
- HEAP8[$83>>0] = -11;
- $84 = ((($3)) + 2|0);
- HEAP8[$84>>0] = -11;
- $85 = ((($3)) + 3|0);
- HEAP8[$85>>0] = -1;
- ;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;
- _ClearBackground($$byval_copy);
- STACKTOP = sp;return;
- }
- function _LoadDefaultFont() {
- 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;
- 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;
- 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;
- var $vararg_buffer = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
- $$byval_copy1 = sp + 44|0;
- $vararg_buffer = sp;
- $0 = sp + 4|0;
- $1 = sp + 24|0;
- HEAP32[(31044)>>2] = 224;
- $2 = (_malloc(65536)|0);
- _memset(($2|0),0,65536)|0;
- $$095104 = 0;$$096103 = 0;
- while(1) {
- $3 = (28 + ($$095104<<2)|0);
- $4 = HEAP32[$3>>2]|0;
- $$097102 = 31;
- while(1) {
- $16 = 1 << $$097102;
- $17 = $4 & $16;
- $18 = ($17|0)==(0);
- if (!($18)) {
- $19 = (($$097102) + ($$096103))|0;
- $$sroa$0$0$$sroa_idx = (($2) + ($19<<2)|0);
- 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;
- }
- $20 = (($$097102) + -1)|0;
- $21 = ($$097102|0)>(0);
- if ($21) {
- $$097102 = $20;
- } else {
- break;
- }
- }
- $12 = (($$095104) + 1)|0;
- $13 = ($$095104|0)>(511);
- $$ = $13 ? 0 : $12;
- $14 = (($$096103) + 32)|0;
- $15 = ($14|0)<(16384);
- if ($15) {
- $$095104 = $$;$$096103 = $14;
- } else {
- break;
- }
- }
- _LoadImageEx($0,$2,128,128);
- _ImageFormat($0,2);
- _free($2);
- ;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;
- _LoadTextureFromImage($1,$$byval_copy1);
- ;HEAP32[31020>>2]=HEAP32[$1>>2]|0;HEAP32[31020+4>>2]=HEAP32[$1+4>>2]|0;HEAP32[31020+8>>2]=HEAP32[$1+8>>2]|0;HEAP32[31020+12>>2]=HEAP32[$1+12>>2]|0;HEAP32[31020+16>>2]=HEAP32[$1+16>>2]|0;
- ;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;
- _UnloadImage($$byval_copy1);
- $5 = HEAP32[(31044)>>2]|0;
- $6 = $5 << 5;
- $7 = (_malloc($6)|0);
- HEAP32[(31048)>>2] = $7;
- $8 = ($5|0)>(0);
- if (!($8)) {
- $$lcssa = $7;
- $22 = ((($$lcssa)) + 16|0);
- $23 = HEAP32[$22>>2]|0;
- HEAP32[(31040)>>2] = $23;
- $24 = HEAP32[7755]|0;
- HEAP32[$vararg_buffer>>2] = $24;
- _TraceLog(0,3580,$vararg_buffer);
- STACKTOP = sp;return;
- }
- $9 = HEAP32[(31024)>>2]|0;
- $10 = HEAP32[(31044)>>2]|0;
- $11 = HEAP32[(31048)>>2]|0;
- $$0101 = 0;$$090100 = 1;$$09299 = 0;$27 = $7;
- while(1) {
- $25 = (($$0101) + 32)|0;
- $26 = (($27) + ($$0101<<5)|0);
- HEAP32[$26>>2] = $25;
- $28 = (((($27) + ($$0101<<5)|0)) + 4|0);
- HEAP32[$28>>2] = $$090100;
- $29 = ($$09299*11)|0;
- $30 = (($29) + 1)|0;
- $31 = (((($27) + ($$0101<<5)|0)) + 8|0);
- HEAP32[$31>>2] = $30;
- $32 = (2076 + ($$0101<<2)|0);
- $33 = HEAP32[$32>>2]|0;
- $34 = (((($27) + ($$0101<<5)|0)) + 12|0);
- HEAP32[$34>>2] = $33;
- $35 = (((($27) + ($$0101<<5)|0)) + 16|0);
- HEAP32[$35>>2] = 10;
- $36 = (($$090100) + 1)|0;
- $37 = (($36) + ($33))|0;
- $38 = ($37|0)<($9|0);
- $39 = (($$09299) + 1)|0;
- if ($38) {
- $$191 = $37;$$193 = $$09299;
- } else {
- $40 = ($39*11)|0;
- $41 = (($40) + 1)|0;
- $42 = (($33) + 2)|0;
- HEAP32[$28>>2] = 1;
- HEAP32[$31>>2] = $41;
- $$191 = $42;$$193 = $39;
- }
- $43 = (((($27) + ($$0101<<5)|0)) + 20|0);
- HEAP32[$43>>2] = 0;
- $44 = (((($27) + ($$0101<<5)|0)) + 24|0);
- HEAP32[$44>>2] = 0;
- $45 = (((($27) + ($$0101<<5)|0)) + 28|0);
- HEAP32[$45>>2] = 0;
- $46 = (($$0101) + 1)|0;
- $47 = ($46|0)<($10|0);
- if ($47) {
- $$0101 = $46;$$090100 = $$191;$$09299 = $$193;$27 = $11;
- } else {
- $$lcssa = $11;
- break;
- }
- }
- $22 = ((($$lcssa)) + 16|0);
- $23 = HEAP32[$22>>2]|0;
- HEAP32[(31040)>>2] = $23;
- $24 = HEAP32[7755]|0;
- HEAP32[$vararg_buffer>>2] = $24;
- _TraceLog(0,3580,$vararg_buffer);
- STACKTOP = sp;return;
- }
- function _InitTimer_12() {
- var $0 = 0, $1 = 0.0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = (_time((0|0))|0);
- _srand($0);
- $1 = (+_GetTime());
- HEAPF64[1762] = $1;
- return;
- }
- function _EmscriptenFullscreenChangeCallback($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
- $vararg_buffer4 = sp + 16|0;
- $vararg_buffer = sp;
- $3 = HEAP32[$1>>2]|0;
- $4 = ($3|0)==(0);
- $5 = ((($1)) + 264|0);
- $6 = HEAP32[$5>>2]|0;
- $7 = ((($1)) + 268|0);
- $8 = HEAP32[$7>>2]|0;
- $9 = ((($1)) + 272|0);
- $10 = HEAP32[$9>>2]|0;
- $11 = ((($1)) + 276|0);
- $12 = HEAP32[$11>>2]|0;
- if ($4) {
- HEAP32[$vararg_buffer4>>2] = $6;
- $vararg_ptr7 = ((($vararg_buffer4)) + 4|0);
- HEAP32[$vararg_ptr7>>2] = $8;
- $vararg_ptr8 = ((($vararg_buffer4)) + 8|0);
- HEAP32[$vararg_ptr8>>2] = $10;
- $vararg_ptr9 = ((($vararg_buffer4)) + 12|0);
- HEAP32[$vararg_ptr9>>2] = $12;
- _TraceLog(0,3513,$vararg_buffer4);
- STACKTOP = sp;return 0;
- } else {
- HEAP32[$vararg_buffer>>2] = $6;
- $vararg_ptr1 = ((($vararg_buffer)) + 4|0);
- HEAP32[$vararg_ptr1>>2] = $8;
- $vararg_ptr2 = ((($vararg_buffer)) + 8|0);
- HEAP32[$vararg_ptr2>>2] = $10;
- $vararg_ptr3 = ((($vararg_buffer)) + 12|0);
- HEAP32[$vararg_ptr3>>2] = $12;
- _TraceLog(0,3444,$vararg_buffer);
- STACKTOP = sp;return 0;
- }
- return (0)|0;
- }
- function _EmscriptenKeyboardCallback($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- var $3 = 0, $4 = 0, $5 = 0, $6 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $3 = ($0|0)==(1);
- if (!($3)) {
- return 0;
- }
- $4 = ((($1)) + 32|0);
- $5 = (_strcmp($4,3437)|0);
- $6 = ($5|0)==(0);
- if (!($6)) {
- return 0;
- }
- (_emscripten_exit_pointerlock()|0);
- return 0;
- }
- function _EmscriptenMouseCallback($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- var $3 = 0, $4 = 0, $5 = 0, $6 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 272|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(272|0);
- $3 = sp;
- $4 = ($0|0)==(4);
- if (!($4)) {
- STACKTOP = sp;return 0;
- }
- (_emscripten_get_pointerlock_status(($3|0))|0);
- $5 = HEAP32[$3>>2]|0;
- $6 = ($5|0)==(0);
- if ($6) {
- (_emscripten_request_pointerlock((0|0),1)|0);
- } else {
- (_emscripten_exit_pointerlock()|0);
- (_emscripten_get_pointerlock_status(($3|0))|0);
- }
- STACKTOP = sp;return 0;
- }
- function _EmscriptenTouchCallback($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- 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;
- 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;
- var $60 = 0.0, $61 = 0.0, $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 112|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(112|0);
- $$byval_copy = sp + 56|0;
- $3 = sp;
- switch ($0|0) {
- case 22: {
- $$sink = 1;
- label = 4;
- break;
- }
- case 23: {
- $$sink = 0;
- label = 4;
- break;
- }
- case 24: {
- $$sink = 2;
- label = 4;
- break;
- }
- default: {
- }
- }
- if ((label|0) == 4) {
- HEAP32[$3>>2] = $$sink;
- }
- $4 = HEAP32[$1>>2]|0;
- $5 = ((($3)) + 4|0);
- HEAP32[$5>>2] = $4;
- $6 = ((($1)) + 20|0);
- $7 = HEAP32[$6>>2]|0;
- $8 = ((($3)) + 8|0);
- HEAP32[$8>>2] = $7;
- $9 = ((($1)) + 72|0);
- $10 = HEAP32[$9>>2]|0;
- $11 = ((($3)) + 12|0);
- HEAP32[$11>>2] = $10;
- $12 = ((($1)) + 56|0);
- $13 = HEAP32[$12>>2]|0;
- $14 = (+($13|0));
- $15 = ((($1)) + 60|0);
- $16 = HEAP32[$15>>2]|0;
- $17 = (+($16|0));
- $$sroa$03$0$$sroa_idx = ((($3)) + 24|0);
- HEAPF32[$$sroa$03$0$$sroa_idx>>2] = $14;
- $$sroa$24$0$$sroa_idx5 = ((($3)) + 28|0);
- HEAPF32[$$sroa$24$0$$sroa_idx5>>2] = $17;
- $18 = ((($1)) + 108|0);
- $19 = HEAP32[$18>>2]|0;
- $20 = (+($19|0));
- $21 = ((($1)) + 112|0);
- $22 = HEAP32[$21>>2]|0;
- $23 = (+($22|0));
- $$sroa$0$0$$sroa_idx = ((($3)) + 32|0);
- HEAPF32[$$sroa$0$0$$sroa_idx>>2] = $20;
- $$sroa$2$0$$sroa_idx2 = ((($3)) + 36|0);
- HEAPF32[$$sroa$2$0$$sroa_idx2>>2] = $23;
- $24 = ((($3)) + 24|0);
- $25 = $24;
- $26 = $25;
- $27 = HEAP32[$26>>2]|0;
- $28 = (($25) + 4)|0;
- $29 = $28;
- $30 = HEAP32[$29>>2]|0;
- $31 = 14080;
- $32 = $31;
- HEAP32[$32>>2] = $27;
- $33 = (($31) + 4)|0;
- $34 = $33;
- HEAP32[$34>>2] = $30;
- $35 = ((($3)) + 32|0);
- $36 = $35;
- $37 = $36;
- $38 = HEAP32[$37>>2]|0;
- $39 = (($36) + 4)|0;
- $40 = $39;
- $41 = HEAP32[$40>>2]|0;
- $42 = (14088);
- $43 = $42;
- HEAP32[$43>>2] = $38;
- $44 = (($42) + 4)|0;
- $45 = $44;
- HEAP32[$45>>2] = $41;
- $46 = (_GetScreenWidth()|0);
- $47 = (+($46|0));
- $48 = +HEAPF32[$24>>2];
- $49 = $48 / $47;
- HEAPF32[$24>>2] = $49;
- $50 = (_GetScreenHeight()|0);
- $51 = (+($50|0));
- $52 = +HEAPF32[$$sroa$24$0$$sroa_idx5>>2];
- $53 = $52 / $51;
- HEAPF32[$$sroa$24$0$$sroa_idx5>>2] = $53;
- $54 = (_GetScreenWidth()|0);
- $55 = (+($54|0));
- $56 = +HEAPF32[$35>>2];
- $57 = $56 / $55;
- HEAPF32[$35>>2] = $57;
- $58 = (_GetScreenHeight()|0);
- $59 = (+($58|0));
- $60 = +HEAPF32[$$sroa$2$0$$sroa_idx2>>2];
- $61 = $60 / $59;
- HEAPF32[$$sroa$2$0$$sroa_idx2>>2] = $61;
- 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));
- _ProcessGestureEvent($$byval_copy);
- STACKTOP = sp;return 1;
- }
- function _EmscriptenGamepadCallback($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- sp = STACKTOP;
- $3 = ((($1)) + 1296|0);
- $4 = HEAP32[$3>>2]|0;
- $5 = ($4|0)==(0);
- if ($5) {
- label = 3;
- } else {
- $6 = ((($1)) + 1300|0);
- $7 = HEAP32[$6>>2]|0;
- $8 = ($7|0)<(4);
- if ($8) {
- $$sink = 1;
- } else {
- label = 3;
- }
- }
- if ((label|0) == 3) {
- $$sink = 0;
- }
- $9 = ((($1)) + 1300|0);
- $10 = HEAP32[$9>>2]|0;
- $11 = (31004 + ($10<<2)|0);
- HEAP32[$11>>2] = $$sink;
- return 0;
- }
- function _SetTargetFPS($0) {
- $0 = $0|0;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $vararg_buffer = sp;
- $1 = ($0|0)<(1);
- $2 = (+($0|0));
- $3 = 1.0 / $2;
- $$ = $1 ? 0.0 : $3;
- HEAPF64[1759] = $$;
- $4 = $3;
- $$op = $4 * 1000.0;
- $5 = $$op;
- $6 = $1 ? 0.0 : $5;
- HEAPF64[$vararg_buffer>>3] = $6;
- _TraceLog(0,3393,$vararg_buffer);
- STACKTOP = sp;return;
- }
- function _LogoAnimation() {
- var label = 0, sp = 0;
- sp = STACKTOP;
- HEAP32[7750] = 0;
- return;
- }
- function _GetTime() {
- var $0 = 0.0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = (+_glfwGetTime());
- return (+$0);
- }
- function _LoadImageEx($0,$1,$2,$3) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- 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;
- 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;
- sp = STACKTOP;
- $4 = $2 << 2;
- $5 = Math_imul($4, $3)|0;
- $6 = (_malloc($5)|0);
- $7 = ($5|0)>(0);
- if ($7) {
- $8 = (($5) + -1)|0;
- $9 = $8 >>> 2;
- $$03334 = 0;$$035 = 0;
- while(1) {
- $10 = (($1) + ($$03334<<2)|0);
- $11 = HEAP8[$10>>0]|0;
- $12 = (($6) + ($$035)|0);
- HEAP8[$12>>0] = $11;
- $13 = (((($1) + ($$03334<<2)|0)) + 1|0);
- $14 = HEAP8[$13>>0]|0;
- $15 = $$035 | 1;
- $16 = (($6) + ($15)|0);
- HEAP8[$16>>0] = $14;
- $17 = (((($1) + ($$03334<<2)|0)) + 2|0);
- $18 = HEAP8[$17>>0]|0;
- $19 = $$035 | 2;
- $20 = (($6) + ($19)|0);
- HEAP8[$20>>0] = $18;
- $21 = (((($1) + ($$03334<<2)|0)) + 3|0);
- $22 = HEAP8[$21>>0]|0;
- $23 = $$035 | 3;
- $24 = (($6) + ($23)|0);
- HEAP8[$24>>0] = $22;
- $25 = (($$03334) + 1)|0;
- $26 = (($$035) + 4)|0;
- $exitcond = ($$03334|0)==($9|0);
- if ($exitcond) {
- break;
- } else {
- $$03334 = $25;$$035 = $26;
- }
- }
- }
- HEAP32[$0>>2] = $6;
- $$sroa$9$0$$sroa_idx18 = ((($0)) + 4|0);
- HEAP32[$$sroa$9$0$$sroa_idx18>>2] = $2;
- $$sroa$12$0$$sroa_idx21 = ((($0)) + 8|0);
- HEAP32[$$sroa$12$0$$sroa_idx21>>2] = $3;
- $$sroa$15$0$$sroa_idx24 = ((($0)) + 12|0);
- HEAP32[$$sroa$15$0$$sroa_idx24>>2] = 1;
- $$sroa$16$0$$sroa_idx26 = ((($0)) + 16|0);
- HEAP32[$$sroa$16$0$$sroa_idx26>>2] = 7;
- return;
- }
- function _ImageFormat($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
- $$byval_copy = sp + 4|0;
- $vararg_buffer = sp;
- $2 = ((($0)) + 16|0);
- $3 = HEAP32[$2>>2]|0;
- $4 = ($3|0)==($1|0);
- if ($4) {
- STACKTOP = sp;return;
- }
- $5 = ($3|0)<(8);
- $6 = ($1|0)<(8);
- $or$cond = $6 & $5;
- if (!($or$cond)) {
- _TraceLog(2,3956,$vararg_buffer);
- STACKTOP = sp;return;
- }
- ;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;
- $7 = (_GetImageData($$byval_copy)|0);
- $8 = HEAP32[$0>>2]|0;
- _free($8);
- HEAP32[$2>>2] = $1;
- switch ($1|0) {
- case 1: {
- $9 = ((($0)) + 4|0);
- $10 = HEAP32[$9>>2]|0;
- $11 = ((($0)) + 8|0);
- $12 = HEAP32[$11>>2]|0;
- $13 = Math_imul($12, $10)|0;
- $14 = (_malloc($13)|0);
- HEAP32[$0>>2] = $14;
- $15 = Math_imul($12, $10)|0;
- $16 = ($15|0)>(0);
- if ($16) {
- $$0171188 = 0;
- while(1) {
- $17 = (($7) + ($$0171188<<2)|0);
- $18 = HEAP8[$17>>0]|0;
- $19 = (+($18&255));
- $20 = $19 * 0.29899999499320984;
- $21 = (((($7) + ($$0171188<<2)|0)) + 1|0);
- $22 = HEAP8[$21>>0]|0;
- $23 = (+($22&255));
- $24 = $23 * 0.58700001239776611;
- $25 = $20 + $24;
- $26 = (((($7) + ($$0171188<<2)|0)) + 2|0);
- $27 = HEAP8[$26>>0]|0;
- $28 = (+($27&255));
- $29 = $28 * 0.11400000005960464;
- $30 = $25 + $29;
- $31 = (~~(($30))&255);
- $32 = HEAP32[$0>>2]|0;
- $33 = (($32) + ($$0171188)|0);
- HEAP8[$33>>0] = $31;
- $34 = (($$0171188) + 1)|0;
- $35 = HEAP32[$9>>2]|0;
- $36 = HEAP32[$11>>2]|0;
- $37 = Math_imul($36, $35)|0;
- $38 = ($34|0)<($37|0);
- if ($38) {
- $$0171188 = $34;
- } else {
- break;
- }
- }
- }
- break;
- }
- case 2: {
- $39 = ((($0)) + 4|0);
- $40 = HEAP32[$39>>2]|0;
- $41 = ((($0)) + 8|0);
- $42 = HEAP32[$41>>2]|0;
- $43 = $40 << 1;
- $44 = Math_imul($43, $42)|0;
- $45 = (_malloc($44)|0);
- HEAP32[$0>>2] = $45;
- $46 = HEAP32[$39>>2]|0;
- $47 = $46 << 1;
- $48 = Math_imul($47, $42)|0;
- $49 = ($48|0)>(0);
- if ($49) {
- $$0170190 = 0;$$0172189 = 0;
- while(1) {
- $50 = (($7) + ($$0172189<<2)|0);
- $51 = HEAP8[$50>>0]|0;
- $52 = (+($51&255));
- $53 = $52 * 0.29899999499320984;
- $54 = (((($7) + ($$0172189<<2)|0)) + 1|0);
- $55 = HEAP8[$54>>0]|0;
- $56 = (+($55&255));
- $57 = $56 * 0.58700001239776611;
- $58 = $53 + $57;
- $59 = (((($7) + ($$0172189<<2)|0)) + 2|0);
- $60 = HEAP8[$59>>0]|0;
- $61 = (+($60&255));
- $62 = $61 * 0.11400000005960464;
- $63 = $58 + $62;
- $64 = (~~(($63))&255);
- $65 = HEAP32[$0>>2]|0;
- $66 = (($65) + ($$0170190)|0);
- HEAP8[$66>>0] = $64;
- $67 = (((($7) + ($$0172189<<2)|0)) + 3|0);
- $68 = HEAP8[$67>>0]|0;
- $69 = HEAP32[$0>>2]|0;
- $70 = $$0170190 | 1;
- $71 = (($69) + ($70)|0);
- HEAP8[$71>>0] = $68;
- $72 = (($$0172189) + 1)|0;
- $73 = (($$0170190) + 2)|0;
- $74 = HEAP32[$39>>2]|0;
- $75 = HEAP32[$41>>2]|0;
- $76 = $74 << 1;
- $77 = Math_imul($76, $75)|0;
- $78 = ($73|0)<($77|0);
- if ($78) {
- $$0170190 = $73;$$0172189 = $72;
- } else {
- break;
- }
- }
- }
- break;
- }
- case 3: {
- $79 = ((($0)) + 4|0);
- $80 = HEAP32[$79>>2]|0;
- $81 = ((($0)) + 8|0);
- $82 = HEAP32[$81>>2]|0;
- $83 = $80 << 1;
- $84 = Math_imul($83, $82)|0;
- $85 = (_malloc($84)|0);
- HEAP32[$0>>2] = $85;
- $86 = HEAP32[$79>>2]|0;
- $87 = Math_imul($82, $86)|0;
- $88 = ($87|0)>(0);
- if ($88) {
- $89 = HEAP8[$7>>0]|0;
- $90 = (+($89&255));
- $91 = $90 * 31.0;
- $92 = $91 / 255.0;
- $roundf179 = (+_roundf((+$92)));
- $93 = (~~(($roundf179))&255);
- $94 = ((($7)) + 1|0);
- $95 = HEAP8[$94>>0]|0;
- $96 = (+($95&255));
- $97 = $96 * 63.0;
- $98 = $97 / 255.0;
- $roundf180 = (+_roundf((+$98)));
- $99 = (~~(($roundf180))&255);
- $100 = ((($7)) + 2|0);
- $101 = HEAP8[$100>>0]|0;
- $102 = (+($101&255));
- $103 = $102 * 31.0;
- $104 = $103 / 255.0;
- $roundf181 = (+_roundf((+$104)));
- $105 = (~~(($roundf181))&255);
- $106 = $93&255;
- $107 = $106 << 11;
- $108 = $99&255;
- $109 = $108 << 5;
- $110 = $109 | $107;
- $111 = $105&255;
- $112 = $110 | $111;
- $113 = $112&65535;
- $114 = HEAP32[$0>>2]|0;
- $115 = HEAP32[$79>>2]|0;
- $116 = HEAP32[$81>>2]|0;
- $117 = Math_imul($116, $115)|0;
- $$0169192 = 0;
- while(1) {
- $118 = (($114) + ($$0169192<<1)|0);
- HEAP16[$118>>1] = $113;
- $119 = (($$0169192) + 1)|0;
- $120 = ($119|0)<($117|0);
- if ($120) {
- $$0169192 = $119;
- } else {
- break;
- }
- }
- }
- break;
- }
- case 4: {
- $121 = ((($0)) + 4|0);
- $122 = HEAP32[$121>>2]|0;
- $123 = ((($0)) + 8|0);
- $124 = HEAP32[$123>>2]|0;
- $125 = ($122*3)|0;
- $126 = Math_imul($125, $124)|0;
- $127 = (_malloc($126)|0);
- HEAP32[$0>>2] = $127;
- $128 = HEAP32[$121>>2]|0;
- $129 = ($128*3)|0;
- $130 = Math_imul($129, $124)|0;
- $131 = ($130|0)>(0);
- if ($131) {
- $$0168195 = 0;$$1194 = 0;
- while(1) {
- $132 = (($7) + ($$1194<<2)|0);
- $133 = HEAP8[$132>>0]|0;
- $134 = HEAP32[$0>>2]|0;
- $135 = (($134) + ($$0168195)|0);
- HEAP8[$135>>0] = $133;
- $136 = (((($7) + ($$1194<<2)|0)) + 1|0);
- $137 = HEAP8[$136>>0]|0;
- $138 = HEAP32[$0>>2]|0;
- $139 = (($$0168195) + 1)|0;
- $140 = (($138) + ($139)|0);
- HEAP8[$140>>0] = $137;
- $141 = (((($7) + ($$1194<<2)|0)) + 2|0);
- $142 = HEAP8[$141>>0]|0;
- $143 = HEAP32[$0>>2]|0;
- $144 = (($$0168195) + 2)|0;
- $145 = (($143) + ($144)|0);
- HEAP8[$145>>0] = $142;
- $146 = (($$1194) + 1)|0;
- $147 = (($$0168195) + 3)|0;
- $148 = HEAP32[$121>>2]|0;
- $149 = HEAP32[$123>>2]|0;
- $150 = ($148*3)|0;
- $151 = Math_imul($150, $149)|0;
- $152 = ($147|0)<($151|0);
- if ($152) {
- $$0168195 = $147;$$1194 = $146;
- } else {
- break;
- }
- }
- }
- break;
- }
- case 5: {
- $153 = ((($0)) + 4|0);
- $154 = HEAP32[$153>>2]|0;
- $155 = ((($0)) + 8|0);
- $156 = HEAP32[$155>>2]|0;
- $157 = $154 << 1;
- $158 = Math_imul($157, $156)|0;
- $159 = (_malloc($158)|0);
- HEAP32[$0>>2] = $159;
- $160 = HEAP32[$153>>2]|0;
- $161 = Math_imul($156, $160)|0;
- $162 = ($161|0)>(0);
- if ($162) {
- $163 = HEAP32[$0>>2]|0;
- $164 = HEAP32[$153>>2]|0;
- $165 = HEAP32[$155>>2]|0;
- $166 = Math_imul($165, $164)|0;
- $$0167197 = 0;
- while(1) {
- $167 = (($7) + ($$0167197<<2)|0);
- $168 = HEAP8[$167>>0]|0;
- $169 = (+($168&255));
- $170 = $169 * 31.0;
- $171 = $170 / 255.0;
- $roundf176 = (+_roundf((+$171)));
- $172 = (~~(($roundf176))&255);
- $173 = (((($7) + ($$0167197<<2)|0)) + 1|0);
- $174 = HEAP8[$173>>0]|0;
- $175 = (+($174&255));
- $176 = $175 * 31.0;
- $177 = $176 / 255.0;
- $roundf177 = (+_roundf((+$177)));
- $178 = (~~(($roundf177))&255);
- $179 = (((($7) + ($$0167197<<2)|0)) + 2|0);
- $180 = HEAP8[$179>>0]|0;
- $181 = (+($180&255));
- $182 = $181 * 31.0;
- $183 = $182 / 255.0;
- $roundf178 = (+_roundf((+$183)));
- $184 = (~~(($roundf178))&255);
- $185 = (((($7) + ($$0167197<<2)|0)) + 3|0);
- $186 = HEAP8[$185>>0]|0;
- $187 = ($186&255)>(50);
- $188 = $172&255;
- $189 = $188 << 11;
- $190 = $178&255;
- $191 = $190 << 6;
- $192 = $191 | $189;
- $193 = $184&255;
- $194 = $193 << 1;
- $195 = $192 | $194;
- $196 = $187&1;
- $197 = $195 | $196;
- $198 = $197&65535;
- $199 = (($163) + ($$0167197<<1)|0);
- HEAP16[$199>>1] = $198;
- $200 = (($$0167197) + 1)|0;
- $201 = ($200|0)<($166|0);
- if ($201) {
- $$0167197 = $200;
- } else {
- break;
- }
- }
- }
- break;
- }
- case 6: {
- $202 = ((($0)) + 4|0);
- $203 = HEAP32[$202>>2]|0;
- $204 = ((($0)) + 8|0);
- $205 = HEAP32[$204>>2]|0;
- $206 = $203 << 1;
- $207 = Math_imul($206, $205)|0;
- $208 = (_malloc($207)|0);
- HEAP32[$0>>2] = $208;
- $209 = HEAP32[$202>>2]|0;
- $210 = Math_imul($205, $209)|0;
- $211 = ($210|0)>(0);
- if ($211) {
- $212 = HEAP32[$0>>2]|0;
- $213 = HEAP32[$202>>2]|0;
- $214 = HEAP32[$204>>2]|0;
- $215 = Math_imul($214, $213)|0;
- $$0166199 = 0;
- while(1) {
- $216 = (($7) + ($$0166199<<2)|0);
- $217 = HEAP8[$216>>0]|0;
- $218 = (+($217&255));
- $219 = $218 * 15.0;
- $220 = $219 / 255.0;
- $roundf = (+_roundf((+$220)));
- $221 = (~~(($roundf))&255);
- $222 = (((($7) + ($$0166199<<2)|0)) + 1|0);
- $223 = HEAP8[$222>>0]|0;
- $224 = (+($223&255));
- $225 = $224 * 15.0;
- $226 = $225 / 255.0;
- $roundf173 = (+_roundf((+$226)));
- $227 = (~~(($roundf173))&255);
- $228 = (((($7) + ($$0166199<<2)|0)) + 2|0);
- $229 = HEAP8[$228>>0]|0;
- $230 = (+($229&255));
- $231 = $230 * 15.0;
- $232 = $231 / 255.0;
- $roundf174 = (+_roundf((+$232)));
- $233 = (~~(($roundf174))&255);
- $234 = (((($7) + ($$0166199<<2)|0)) + 3|0);
- $235 = HEAP8[$234>>0]|0;
- $236 = (+($235&255));
- $237 = $236 * 15.0;
- $238 = $237 / 255.0;
- $roundf175 = (+_roundf((+$238)));
- $239 = (~~(($roundf175))&255);
- $240 = $221&255;
- $241 = $240 << 12;
- $242 = $227&255;
- $243 = $242 << 8;
- $244 = $243 | $241;
- $245 = $233&255;
- $246 = $245 << 4;
- $247 = $244 | $246;
- $248 = $239&255;
- $249 = $247 | $248;
- $250 = $249&65535;
- $251 = (($212) + ($$0166199<<1)|0);
- HEAP16[$251>>1] = $250;
- $252 = (($$0166199) + 1)|0;
- $253 = ($252|0)<($215|0);
- if ($253) {
- $$0166199 = $252;
- } else {
- break;
- }
- }
- }
- break;
- }
- case 7: {
- $254 = ((($0)) + 4|0);
- $255 = HEAP32[$254>>2]|0;
- $256 = ((($0)) + 8|0);
- $257 = HEAP32[$256>>2]|0;
- $258 = $255 << 2;
- $259 = Math_imul($258, $257)|0;
- $260 = (_malloc($259)|0);
- HEAP32[$0>>2] = $260;
- $261 = HEAP32[$254>>2]|0;
- $262 = $261 << 2;
- $263 = Math_imul($262, $257)|0;
- $264 = ($263|0)>(0);
- if ($264) {
- $$0202 = 0;$$2201 = 0;
- while(1) {
- $265 = (($7) + ($$2201<<2)|0);
- $266 = HEAP8[$265>>0]|0;
- $267 = HEAP32[$0>>2]|0;
- $268 = (($267) + ($$0202)|0);
- HEAP8[$268>>0] = $266;
- $269 = (((($7) + ($$2201<<2)|0)) + 1|0);
- $270 = HEAP8[$269>>0]|0;
- $271 = HEAP32[$0>>2]|0;
- $272 = $$0202 | 1;
- $273 = (($271) + ($272)|0);
- HEAP8[$273>>0] = $270;
- $274 = (((($7) + ($$2201<<2)|0)) + 2|0);
- $275 = HEAP8[$274>>0]|0;
- $276 = HEAP32[$0>>2]|0;
- $277 = $$0202 | 2;
- $278 = (($276) + ($277)|0);
- HEAP8[$278>>0] = $275;
- $279 = (((($7) + ($$2201<<2)|0)) + 3|0);
- $280 = HEAP8[$279>>0]|0;
- $281 = HEAP32[$0>>2]|0;
- $282 = $$0202 | 3;
- $283 = (($281) + ($282)|0);
- HEAP8[$283>>0] = $280;
- $284 = (($$2201) + 1)|0;
- $285 = (($$0202) + 4)|0;
- $286 = HEAP32[$254>>2]|0;
- $287 = HEAP32[$256>>2]|0;
- $288 = $286 << 2;
- $289 = Math_imul($288, $287)|0;
- $290 = ($285|0)<($289|0);
- if ($290) {
- $$0202 = $285;$$2201 = $284;
- } else {
- break;
- }
- }
- }
- break;
- }
- default: {
- }
- }
- _free($7);
- STACKTOP = sp;return;
- }
- function _LoadTextureFromImage($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- sp = STACKTOP;
- $2 = HEAP32[$1>>2]|0;
- $3 = ((($1)) + 4|0);
- $4 = HEAP32[$3>>2]|0;
- $5 = ((($1)) + 8|0);
- $6 = HEAP32[$5>>2]|0;
- $7 = ((($1)) + 16|0);
- $8 = HEAP32[$7>>2]|0;
- $9 = ((($1)) + 12|0);
- $10 = HEAP32[$9>>2]|0;
- $11 = (_rlglLoadTexture($2,$4,$6,$8,$10)|0);
- $12 = HEAP32[$3>>2]|0;
- $13 = HEAP32[$5>>2]|0;
- HEAP32[$0>>2] = $11;
- $$sroa$5$0$$sroa_idx2 = ((($0)) + 4|0);
- HEAP32[$$sroa$5$0$$sroa_idx2>>2] = $12;
- $$sroa$7$0$$sroa_idx4 = ((($0)) + 8|0);
- HEAP32[$$sroa$7$0$$sroa_idx4>>2] = $13;
- $$sroa$9$0$$sroa_idx6 = ((($0)) + 12|0);
- HEAP32[$$sroa$9$0$$sroa_idx6>>2] = $10;
- $$sroa$11$0$$sroa_idx8 = ((($0)) + 16|0);
- HEAP32[$$sroa$11$0$$sroa_idx8>>2] = $8;
- return;
- }
- function _UnloadImage($0) {
- $0 = $0|0;
- var $1 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = HEAP32[$0>>2]|0;
- _free($1);
- return;
- }
- function _rlglLoadTexture($0,$1,$2,$3,$4) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- $4 = $4|0;
- 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;
- 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;
- 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;
- var $vararg_buffer9 = 0, $vararg_ptr13 = 0, $vararg_ptr14 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 80|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(80|0);
- $vararg_buffer15 = sp + 64|0;
- $vararg_buffer11 = sp + 48|0;
- $vararg_buffer9 = sp + 40|0;
- $vararg_buffer7 = sp + 32|0;
- $vararg_buffer5 = sp + 24|0;
- $vararg_buffer3 = sp + 16|0;
- $vararg_buffer1 = sp + 8|0;
- $vararg_buffer = sp;
- $5 = sp + 68|0;
- _glBindTexture(3553,0);
- HEAP32[$5>>2] = 0;
- $6 = HEAP32[7763]|0;
- $7 = ($6|0)==(0);
- $8 = $3 & -4;
- $switch = ($8|0)==(8);
- $or$cond100 = $switch & $7;
- if ($or$cond100) {
- _TraceLog(2,3625,$vararg_buffer);
- $$0 = HEAP32[$5>>2]|0;
- STACKTOP = sp;return ($$0|0);
- }
- $9 = HEAP32[7764]|0;
- $10 = ($9|0)==(0);
- $11 = ($3|0)==(12);
- $or$cond7 = $11 & $10;
- if ($or$cond7) {
- _TraceLog(2,3669,$vararg_buffer1);
- $$0 = HEAP32[$5>>2]|0;
- STACKTOP = sp;return ($$0|0);
- }
- $12 = HEAP32[7765]|0;
- $13 = ($12|0)==(0);
- $$off = (($3) + -13)|0;
- $14 = ($$off>>>0)<(2);
- $or$cond = $14 & $13;
- if ($or$cond) {
- _TraceLog(2,3714,$vararg_buffer3);
- $$0 = HEAP32[$5>>2]|0;
- STACKTOP = sp;return ($$0|0);
- }
- $15 = HEAP32[7766]|0;
- $16 = ($15|0)==(0);
- $$off92 = (($3) + -15)|0;
- $17 = ($$off92>>>0)<(2);
- $or$cond96 = $17 & $16;
- if ($or$cond96) {
- _TraceLog(2,3759,$vararg_buffer5);
- $$0 = HEAP32[$5>>2]|0;
- STACKTOP = sp;return ($$0|0);
- }
- $18 = HEAP32[7767]|0;
- $19 = ($18|0)==(0);
- $$off93 = (($3) + -17)|0;
- $20 = ($$off93>>>0)<(2);
- $or$cond98 = $20 & $19;
- if ($or$cond98) {
- _TraceLog(2,3804,$vararg_buffer7);
- $$0 = HEAP32[$5>>2]|0;
- STACKTOP = sp;return ($$0|0);
- }
- _glGenTextures(1,($5|0));
- $21 = HEAP32[$5>>2]|0;
- _glBindTexture(3553,($21|0));
- do {
- switch ($3|0) {
- case 1: {
- _glTexImage2D(3553,0,6409,($1|0),($2|0),0,6409,5121,($0|0));
- break;
- }
- case 2: {
- _glTexImage2D(3553,0,6410,($1|0),($2|0),0,6410,5121,($0|0));
- break;
- }
- case 3: {
- _glTexImage2D(3553,0,6407,($1|0),($2|0),0,6407,33635,($0|0));
- break;
- }
- case 4: {
- _glTexImage2D(3553,0,6407,($1|0),($2|0),0,6407,5121,($0|0));
- break;
- }
- case 5: {
- _glTexImage2D(3553,0,6408,($1|0),($2|0),0,6408,32820,($0|0));
- break;
- }
- case 6: {
- _glTexImage2D(3553,0,6408,($1|0),($2|0),0,6408,32819,($0|0));
- break;
- }
- case 7: {
- _glTexImage2D(3553,0,6408,($1|0),($2|0),0,6408,5121,($0|0));
- break;
- }
- case 8: {
- $22 = HEAP32[7763]|0;
- $23 = ($22|0)==(0);
- if (!($23)) {
- _LoadCompressedTexture($0,$1,$2,$4,33776);
- }
- break;
- }
- case 9: {
- $24 = HEAP32[7763]|0;
- $25 = ($24|0)==(0);
- if (!($25)) {
- _LoadCompressedTexture($0,$1,$2,$4,33777);
- }
- break;
- }
- case 10: {
- $26 = HEAP32[7763]|0;
- $27 = ($26|0)==(0);
- if (!($27)) {
- _LoadCompressedTexture($0,$1,$2,$4,33778);
- }
- break;
- }
- case 11: {
- $28 = HEAP32[7763]|0;
- $29 = ($28|0)==(0);
- if (!($29)) {
- _LoadCompressedTexture($0,$1,$2,$4,33779);
- }
- break;
- }
- case 12: {
- $30 = HEAP32[7764]|0;
- $31 = ($30|0)==(0);
- if (!($31)) {
- _LoadCompressedTexture($0,$1,$2,$4,36196);
- }
- break;
- }
- case 13: {
- $32 = HEAP32[7765]|0;
- $33 = ($32|0)==(0);
- if (!($33)) {
- _LoadCompressedTexture($0,$1,$2,$4,37492);
- }
- break;
- }
- case 14: {
- $34 = HEAP32[7765]|0;
- $35 = ($34|0)==(0);
- if (!($35)) {
- _LoadCompressedTexture($0,$1,$2,$4,37496);
- }
- break;
- }
- case 15: {
- $36 = HEAP32[7766]|0;
- $37 = ($36|0)==(0);
- if (!($37)) {
- _LoadCompressedTexture($0,$1,$2,$4,35840);
- }
- break;
- }
- case 16: {
- $38 = HEAP32[7766]|0;
- $39 = ($38|0)==(0);
- if (!($39)) {
- _LoadCompressedTexture($0,$1,$2,$4,35842);
- }
- break;
- }
- case 17: {
- $40 = HEAP32[7767]|0;
- $41 = ($40|0)==(0);
- if (!($41)) {
- _LoadCompressedTexture($0,$1,$2,$4,37808);
- }
- break;
- }
- case 18: {
- $42 = HEAP32[7767]|0;
- $43 = ($42|0)==(0);
- if (!($43)) {
- _LoadCompressedTexture($0,$1,$2,$4,37815);
- }
- break;
- }
- default: {
- _TraceLog(2,3849,$vararg_buffer9);
- }
- }
- } while(0);
- $44 = HEAP32[7768]|0;
- $45 = ($44|0)==(0);
- if ($45) {
- _glTexParameteri(3553,10242,33071);
- _glTexParameteri(3553,10243,33071);
- } else {
- _glTexParameteri(3553,10242,10497);
- _glTexParameteri(3553,10243,10497);
- }
- _glTexParameteri(3553,10240,9728);
- _glTexParameteri(3553,10241,9728);
- _glBindTexture(3553,0);
- $46 = HEAP32[$5>>2]|0;
- $47 = ($46|0)==(0);
- if ($47) {
- _TraceLog(2,3927,$vararg_buffer15);
- $$0 = HEAP32[$5>>2]|0;
- STACKTOP = sp;return ($$0|0);
- } else {
- HEAP32[$vararg_buffer11>>2] = $46;
- $vararg_ptr13 = ((($vararg_buffer11)) + 4|0);
- HEAP32[$vararg_ptr13>>2] = $1;
- $vararg_ptr14 = ((($vararg_buffer11)) + 8|0);
- HEAP32[$vararg_ptr14>>2] = $2;
- _TraceLog(0,3878,$vararg_buffer11);
- $$0 = HEAP32[$5>>2]|0;
- STACKTOP = sp;return ($$0|0);
- }
- return (0)|0;
- }
- function _LoadCompressedTexture($0,$1,$2,$3,$4) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- $4 = $4|0;
- 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;
- var $23 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, $or$cond42 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- _glPixelStorei(3317,1);
- switch ($4|0) {
- case 33776: case 33777: case 36196: case 37492: {
- $$038 = 8;
- break;
- }
- default: {
- $$038 = 16;
- }
- }
- $5 = ($3|0)<(1);
- $6 = $1 | $2;
- $7 = ($6|0)==(0);
- $or$cond42 = $5 | $7;
- if ($or$cond42) {
- return;
- } else {
- $$03645 = 0;$$03744 = 0;$$03943 = $2;$$046 = $1;
- }
- while(1) {
- $8 = (($$046) + 3)|0;
- $9 = (($8|0) / 4)&-1;
- $10 = (($$03943) + 3)|0;
- $11 = (($10|0) / 4)&-1;
- $12 = Math_imul($11, $$038)|0;
- $13 = Math_imul($12, $9)|0;
- $14 = (($0) + ($$03744)|0);
- _glCompressedTexImage2D(3553,($$03645|0),($4|0),($$046|0),($$03943|0),0,($13|0),($14|0));
- $15 = (($13) + ($$03744))|0;
- $16 = (($$046|0) / 2)&-1;
- $17 = (($$03943|0) / 2)&-1;
- $18 = ($$046|0)<(2);
- $$ = $18 ? 1 : $16;
- $19 = ($$03943|0)<(2);
- $$140 = $19 ? 1 : $17;
- $20 = (($$03645) + 1)|0;
- $21 = ($20|0)>=($3|0);
- $22 = $$ | $$140;
- $23 = ($22|0)==(0);
- $or$cond = $21 | $23;
- if ($or$cond) {
- break;
- } else {
- $$03645 = $20;$$03744 = $15;$$03943 = $$140;$$046 = $$;
- }
- }
- return;
- }
- function _GetImageData($0) {
- $0 = $0|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- var $97 = 0.0, $98 = 0.0, $99 = 0, $vararg_buffer = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $vararg_buffer = sp;
- $1 = ((($0)) + 4|0);
- $2 = HEAP32[$1>>2]|0;
- $3 = ((($0)) + 8|0);
- $4 = HEAP32[$3>>2]|0;
- $5 = $2 << 2;
- $6 = Math_imul($5, $4)|0;
- $7 = (_malloc($6)|0);
- $8 = HEAP32[$1>>2]|0;
- $9 = Math_imul($4, $8)|0;
- $10 = ($9|0)>(0);
- if (!($10)) {
- STACKTOP = sp;return ($7|0);
- }
- $11 = ((($0)) + 16|0);
- $12 = HEAP32[$11>>2]|0;
- $13 = HEAP32[$0>>2]|0;
- $$0104105 = 0;$$0106 = 0;
- while(1) {
- switch ($12|0) {
- case 1: {
- $14 = (($13) + ($$0106)|0);
- $15 = HEAP8[$14>>0]|0;
- $16 = (($7) + ($$0104105<<2)|0);
- HEAP8[$16>>0] = $15;
- $17 = HEAP8[$14>>0]|0;
- $18 = (((($7) + ($$0104105<<2)|0)) + 1|0);
- HEAP8[$18>>0] = $17;
- $19 = HEAP8[$14>>0]|0;
- $20 = (((($7) + ($$0104105<<2)|0)) + 2|0);
- HEAP8[$20>>0] = $19;
- $21 = (((($7) + ($$0104105<<2)|0)) + 3|0);
- HEAP8[$21>>0] = -1;
- $22 = (($$0106) + 1)|0;
- $$1 = $22;
- break;
- }
- case 2: {
- $23 = (($13) + ($$0106)|0);
- $24 = HEAP8[$23>>0]|0;
- $25 = (($7) + ($$0104105<<2)|0);
- HEAP8[$25>>0] = $24;
- $26 = HEAP8[$23>>0]|0;
- $27 = (((($7) + ($$0104105<<2)|0)) + 1|0);
- HEAP8[$27>>0] = $26;
- $28 = HEAP8[$23>>0]|0;
- $29 = (((($7) + ($$0104105<<2)|0)) + 2|0);
- HEAP8[$29>>0] = $28;
- $30 = (($$0106) + 1)|0;
- $31 = (($13) + ($30)|0);
- $32 = HEAP8[$31>>0]|0;
- $33 = (((($7) + ($$0104105<<2)|0)) + 3|0);
- HEAP8[$33>>0] = $32;
- $34 = (($$0106) + 2)|0;
- $$1 = $34;
- break;
- }
- case 5: {
- $35 = (($13) + ($$0106<<1)|0);
- $36 = HEAP16[$35>>1]|0;
- $37 = $36&65535;
- $38 = $37 >>> 11;
- $39 = (+($38|0));
- $40 = $39 * 8.0;
- $41 = (~~(($40))&255);
- $42 = (($7) + ($$0104105<<2)|0);
- HEAP8[$42>>0] = $41;
- $43 = $37 >>> 6;
- $44 = $43 & 31;
- $45 = (+($44|0));
- $46 = $45 * 8.0;
- $47 = (~~(($46))&255);
- $48 = (((($7) + ($$0104105<<2)|0)) + 1|0);
- HEAP8[$48>>0] = $47;
- $49 = $37 >>> 1;
- $50 = $49 & 31;
- $51 = (+($50|0));
- $52 = $51 * 8.0;
- $53 = (~~(($52))&255);
- $54 = (((($7) + ($$0104105<<2)|0)) + 2|0);
- HEAP8[$54>>0] = $53;
- $55 = $37 & 1;
- $56 = (0 - ($55))|0;
- $57 = $56&255;
- $58 = (((($7) + ($$0104105<<2)|0)) + 3|0);
- HEAP8[$58>>0] = $57;
- $59 = (($$0106) + 1)|0;
- $$1 = $59;
- break;
- }
- case 3: {
- $60 = (($13) + ($$0106<<1)|0);
- $61 = HEAP16[$60>>1]|0;
- $62 = $61&65535;
- $63 = $62 >>> 11;
- $64 = (+($63|0));
- $65 = $64 * 8.0;
- $66 = (~~(($65))&255);
- $67 = (($7) + ($$0104105<<2)|0);
- HEAP8[$67>>0] = $66;
- $68 = $62 >>> 5;
- $69 = $68 & 63;
- $70 = (+($69|0));
- $71 = $70 * 4.0;
- $72 = (~~(($71))&255);
- $73 = (((($7) + ($$0104105<<2)|0)) + 1|0);
- HEAP8[$73>>0] = $72;
- $74 = $62 & 31;
- $75 = (+($74|0));
- $76 = $75 * 8.0;
- $77 = (~~(($76))&255);
- $78 = (((($7) + ($$0104105<<2)|0)) + 2|0);
- HEAP8[$78>>0] = $77;
- $79 = (((($7) + ($$0104105<<2)|0)) + 3|0);
- HEAP8[$79>>0] = -1;
- $80 = (($$0106) + 1)|0;
- $$1 = $80;
- break;
- }
- case 6: {
- $81 = (($13) + ($$0106<<1)|0);
- $82 = HEAP16[$81>>1]|0;
- $83 = $82&65535;
- $84 = $83 >>> 12;
- $85 = (+($84|0));
- $86 = $85 * 17.0;
- $87 = (~~(($86))&255);
- $88 = (($7) + ($$0104105<<2)|0);
- HEAP8[$88>>0] = $87;
- $89 = $83 >>> 8;
- $90 = $89 & 15;
- $91 = (+($90|0));
- $92 = $91 * 17.0;
- $93 = (~~(($92))&255);
- $94 = (((($7) + ($$0104105<<2)|0)) + 1|0);
- HEAP8[$94>>0] = $93;
- $95 = $83 >>> 4;
- $96 = $95 & 15;
- $97 = (+($96|0));
- $98 = $97 * 17.0;
- $99 = (~~(($98))&255);
- $100 = (((($7) + ($$0104105<<2)|0)) + 2|0);
- HEAP8[$100>>0] = $99;
- $101 = $83 & 15;
- $102 = (+($101|0));
- $103 = $102 * 17.0;
- $104 = (~~(($103))&255);
- $105 = (((($7) + ($$0104105<<2)|0)) + 3|0);
- HEAP8[$105>>0] = $104;
- $106 = (($$0106) + 1)|0;
- $$1 = $106;
- break;
- }
- case 7: {
- $107 = (($13) + ($$0106)|0);
- $108 = HEAP8[$107>>0]|0;
- $109 = (($7) + ($$0104105<<2)|0);
- HEAP8[$109>>0] = $108;
- $110 = (($$0106) + 1)|0;
- $111 = (($13) + ($110)|0);
- $112 = HEAP8[$111>>0]|0;
- $113 = (((($7) + ($$0104105<<2)|0)) + 1|0);
- HEAP8[$113>>0] = $112;
- $114 = (($$0106) + 2)|0;
- $115 = (($13) + ($114)|0);
- $116 = HEAP8[$115>>0]|0;
- $117 = (((($7) + ($$0104105<<2)|0)) + 2|0);
- HEAP8[$117>>0] = $116;
- $118 = (($$0106) + 3)|0;
- $119 = (($13) + ($118)|0);
- $120 = HEAP8[$119>>0]|0;
- $121 = (((($7) + ($$0104105<<2)|0)) + 3|0);
- HEAP8[$121>>0] = $120;
- $122 = (($$0106) + 4)|0;
- $$1 = $122;
- break;
- }
- case 4: {
- $123 = (($13) + ($$0106)|0);
- $124 = HEAP8[$123>>0]|0;
- $125 = (($7) + ($$0104105<<2)|0);
- HEAP8[$125>>0] = $124;
- $126 = (($$0106) + 1)|0;
- $127 = (($13) + ($126)|0);
- $128 = HEAP8[$127>>0]|0;
- $129 = (((($7) + ($$0104105<<2)|0)) + 1|0);
- HEAP8[$129>>0] = $128;
- $130 = (($$0106) + 2)|0;
- $131 = (($13) + ($130)|0);
- $132 = HEAP8[$131>>0]|0;
- $133 = (((($7) + ($$0104105<<2)|0)) + 2|0);
- HEAP8[$133>>0] = $132;
- $134 = (((($7) + ($$0104105<<2)|0)) + 3|0);
- HEAP8[$134>>0] = -1;
- $135 = (($$0106) + 3)|0;
- $$1 = $135;
- break;
- }
- default: {
- _TraceLog(2,4010,$vararg_buffer);
- $$1 = $$0106;
- }
- }
- $136 = (($$0104105) + 1)|0;
- $137 = HEAP32[$1>>2]|0;
- $138 = HEAP32[$3>>2]|0;
- $139 = Math_imul($138, $137)|0;
- $140 = ($136|0)<($139|0);
- if ($140) {
- $$0104105 = $136;$$0106 = $$1;
- } else {
- break;
- }
- }
- STACKTOP = sp;return ($7|0);
- }
- function _ErrorCallback($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- var $vararg_buffer = 0, $vararg_ptr1 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $vararg_buffer = sp;
- HEAP32[$vararg_buffer>>2] = $0;
- $vararg_ptr1 = ((($vararg_buffer)) + 4|0);
- HEAP32[$vararg_ptr1>>2] = $1;
- _TraceLog(2,7876,$vararg_buffer);
- STACKTOP = sp;return;
- }
- function _rlGetVersion() {
- var label = 0, sp = 0;
- sp = STACKTOP;
- return 4;
- }
- function _SetupFramebufferSize($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- 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;
- 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;
- var $vararg_ptr3 = 0, $vararg_ptr7 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 112|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(112|0);
- $vararg_buffer8 = sp + 24|0;
- $vararg_buffer4 = sp + 16|0;
- $vararg_buffer = sp;
- $2 = sp + 40|0;
- $3 = HEAP32[7747]|0;
- $4 = ($3|0)>($0|0);
- if (!($4)) {
- $5 = HEAP32[7746]|0;
- $6 = ($5|0)>($1|0);
- if (!($6)) {
- $30 = ($3|0)<($0|0);
- $31 = ($5|0)<($1|0);
- $or$cond = $30 | $31;
- if (!($or$cond)) {
- HEAP32[7788] = $3;
- HEAP32[7789] = $5;
- HEAP32[7790] = 0;
- HEAP32[7791] = 0;
- STACKTOP = sp;return;
- }
- HEAP32[$vararg_buffer8>>2] = $3;
- $vararg_ptr11 = ((($vararg_buffer8)) + 4|0);
- HEAP32[$vararg_ptr11>>2] = $5;
- $vararg_ptr12 = ((($vararg_buffer8)) + 8|0);
- HEAP32[$vararg_ptr12>>2] = $0;
- $vararg_ptr13 = ((($vararg_buffer8)) + 12|0);
- HEAP32[$vararg_ptr13>>2] = $1;
- _TraceLog(0,7810,$vararg_buffer8);
- $32 = (+($0|0));
- $33 = (+($1|0));
- $34 = $32 / $33;
- $35 = HEAP32[7747]|0;
- $36 = (+($35|0));
- $37 = HEAP32[7746]|0;
- $38 = (+($37|0));
- $39 = $36 / $38;
- $40 = !($34 <= $39);
- if ($40) {
- $44 = $34 * $38;
- $roundf = (+_roundf((+$44)));
- $45 = (~~(($roundf)));
- HEAP32[7788] = $45;
- HEAP32[7789] = $37;
- $46 = (($45) - ($35))|0;
- HEAP32[7790] = $46;
- $$sink1 = 0;
- } else {
- HEAP32[7788] = $35;
- $41 = $36 / $34;
- $roundf38 = (+_roundf((+$41)));
- $42 = (~~(($roundf38)));
- HEAP32[7789] = $42;
- HEAP32[7790] = 0;
- $43 = (($42) - ($37))|0;
- $$sink1 = $43;
- }
- HEAP32[7791] = $$sink1;
- STACKTOP = sp;return;
- }
- }
- $7 = HEAP32[7746]|0;
- HEAP32[$vararg_buffer>>2] = $3;
- $vararg_ptr1 = ((($vararg_buffer)) + 4|0);
- HEAP32[$vararg_ptr1>>2] = $7;
- $vararg_ptr2 = ((($vararg_buffer)) + 8|0);
- HEAP32[$vararg_ptr2>>2] = $0;
- $vararg_ptr3 = ((($vararg_buffer)) + 12|0);
- HEAP32[$vararg_ptr3>>2] = $1;
- _TraceLog(2,7667,$vararg_buffer);
- $8 = (+($0|0));
- $9 = HEAP32[7747]|0;
- $10 = (+($9|0));
- $11 = $8 / $10;
- $12 = (+($1|0));
- $13 = HEAP32[7746]|0;
- $14 = (+($13|0));
- $15 = $12 / $14;
- $16 = !($11 <= $15);
- if ($16) {
- $22 = $10 * $15;
- $roundf39 = (+_roundf((+$22)));
- $23 = (~~(($roundf39)));
- HEAP32[7788] = $23;
- HEAP32[7789] = $1;
- $24 = (($0) - ($23))|0;
- HEAP32[7790] = $24;
- $$sink = 0;
- } else {
- HEAP32[7788] = $0;
- $17 = HEAP32[7746]|0;
- $18 = (+($17|0));
- $19 = $11 * $18;
- $roundf40 = (+_roundf((+$19)));
- $20 = (~~(($roundf40)));
- HEAP32[7789] = $20;
- HEAP32[7790] = 0;
- $21 = (($1) - ($20))|0;
- $$sink = $21;
- }
- HEAP32[7791] = $$sink;
- $25 = HEAP32[7788]|0;
- $26 = (+($25|0));
- $27 = HEAP32[7747]|0;
- $28 = (+($27|0));
- $29 = $26 / $28;
- _MatrixScale($2,$29,$29,$29);
- dest=31076; 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));
- HEAP32[7788] = $0;
- HEAP32[7789] = $1;
- HEAP32[$vararg_buffer4>>2] = $0;
- $vararg_ptr7 = ((($vararg_buffer4)) + 4|0);
- HEAP32[$vararg_ptr7>>2] = $1;
- _TraceLog(2,7745,$vararg_buffer4);
- STACKTOP = sp;return;
- }
- function _WindowSizeCallback($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- var $3 = 0.0, $4 = 0.0, label = 0, sp = 0;
- sp = STACKTOP;
- _rlViewport(0,0,$1,$2);
- _rlMatrixMode(5889);
- _rlLoadIdentity();
- $3 = (+($1|0));
- $4 = (+($2|0));
- _rlOrtho(0.0,$3,$4,0.0,0.0,1.0);
- _rlMatrixMode(5888);
- _rlLoadIdentity();
- _rlClearScreenBuffers();
- HEAP32[7747] = $1;
- HEAP32[7746] = $2;
- HEAP32[7788] = $1;
- HEAP32[7789] = $2;
- return;
- }
- function _CursorEnterCallback($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- var label = 0, sp = 0;
- sp = STACKTOP;
- return;
- }
- function _KeyCallback($0,$1,$2,$3,$4) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- $4 = $4|0;
- var $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $5 = HEAP32[744]|0;
- $6 = ($5|0)==($1|0);
- $7 = ($3|0)==(1);
- $or$cond = $7 & $6;
- if ($or$cond) {
- _glfwSetWindowShouldClose(($0|0),1);
- return;
- }
- $8 = $3&255;
- $9 = (35959 + ($1)|0);
- HEAP8[$9>>0] = $8;
- if (!($7)) {
- return;
- }
- HEAP32[743] = $1;
- return;
- }
- function _MouseButtonCallback($0,$1,$2,$3) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 128|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(128|0);
- $$byval_copy = sp + 64|0;
- $4 = sp + 8|0;
- $5 = sp;
- $6 = $2&255;
- $7 = (35953 + ($1)|0);
- HEAP8[$7>>0] = $6;
- $8 = (_IsMouseButtonPressed(0)|0);
- $9 = ($8|0)==(0);
- if ($9) {
- $10 = (_IsMouseButtonReleased(0)|0);
- $11 = ($10|0)==(0);
- if (!($11)) {
- $$sink = 0;
- label = 3;
- }
- } else {
- $$sink = 1;
- label = 3;
- }
- if ((label|0) == 3) {
- HEAP32[$4>>2] = $$sink;
- }
- $12 = ((($4)) + 8|0);
- HEAP32[$12>>2] = 0;
- $13 = ((($4)) + 4|0);
- HEAP32[$13>>2] = 1;
- $14 = ((($4)) + 24|0);
- _GetMousePosition($5);
- $15 = $5;
- $16 = $15;
- $17 = HEAP32[$16>>2]|0;
- $18 = (($15) + 4)|0;
- $19 = $18;
- $20 = HEAP32[$19>>2]|0;
- $21 = $14;
- $22 = $21;
- HEAP32[$22>>2] = $17;
- $23 = (($21) + 4)|0;
- $24 = $23;
- HEAP32[$24>>2] = $20;
- $25 = (_GetScreenWidth()|0);
- $26 = (+($25|0));
- $27 = +HEAPF32[$14>>2];
- $28 = $27 / $26;
- HEAPF32[$14>>2] = $28;
- $29 = (_GetScreenHeight()|0);
- $30 = (+($29|0));
- $31 = ((($4)) + 28|0);
- $32 = +HEAPF32[$31>>2];
- $33 = $32 / $30;
- HEAPF32[$31>>2] = $33;
- 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));
- _ProcessGestureEvent($$byval_copy);
- STACKTOP = sp;return;
- }
- function _MouseCursorPosCallback($0,$1,$2) {
- $0 = $0|0;
- $1 = +$1;
- $2 = +$2;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 112|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(112|0);
- $$byval_copy = sp + 56|0;
- $3 = sp;
- HEAP32[$3>>2] = 2;
- $4 = ((($3)) + 8|0);
- HEAP32[$4>>2] = 0;
- $5 = ((($3)) + 4|0);
- HEAP32[$5>>2] = 1;
- $6 = $1;
- $7 = $2;
- $$sroa$0$0$$sroa_idx = ((($3)) + 24|0);
- HEAPF32[$$sroa$0$0$$sroa_idx>>2] = $6;
- $$sroa$2$0$$sroa_idx1 = ((($3)) + 28|0);
- HEAPF32[$$sroa$2$0$$sroa_idx1>>2] = $7;
- $8 = ((($3)) + 24|0);
- $9 = $8;
- $10 = $9;
- $11 = HEAP32[$10>>2]|0;
- $12 = (($9) + 4)|0;
- $13 = $12;
- $14 = HEAP32[$13>>2]|0;
- $15 = 14080;
- $16 = $15;
- HEAP32[$16>>2] = $11;
- $17 = (($15) + 4)|0;
- $18 = $17;
- HEAP32[$18>>2] = $14;
- $19 = (_GetScreenWidth()|0);
- $20 = (+($19|0));
- $21 = +HEAPF32[$8>>2];
- $22 = $21 / $20;
- HEAPF32[$8>>2] = $22;
- $23 = (_GetScreenHeight()|0);
- $24 = (+($23|0));
- $25 = +HEAPF32[$$sroa$2$0$$sroa_idx1>>2];
- $26 = $25 / $24;
- HEAPF32[$$sroa$2$0$$sroa_idx1>>2] = $26;
- 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));
- _ProcessGestureEvent($$byval_copy);
- STACKTOP = sp;return;
- }
- function _CharCallback($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- var label = 0, sp = 0;
- sp = STACKTOP;
- HEAP32[743] = $1;
- return;
- }
- function _ScrollCallback($0,$1,$2) {
- $0 = $0|0;
- $1 = +$1;
- $2 = +$2;
- var $3 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $3 = (~~(($2)));
- HEAP32[8161] = $3;
- return;
- }
- function _WindowIconifyCallback($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- var $$sink = 0, $2 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $2 = ($1|0)!=(0);
- $$sink = $2&1;
- HEAP32[8160] = $$sink;
- return;
- }
- function _rlglInit($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 2464|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(2464|0);
- $vararg_buffer41 = sp + 2184|0;
- $vararg_buffer39 = sp + 2176|0;
- $vararg_buffer36 = sp + 2168|0;
- $vararg_buffer34 = sp + 2160|0;
- $vararg_buffer31 = sp + 2152|0;
- $vararg_buffer29 = sp + 2144|0;
- $vararg_buffer27 = sp + 2136|0;
- $vararg_buffer25 = sp + 2128|0;
- $vararg_buffer23 = sp + 2120|0;
- $vararg_buffer21 = sp + 2112|0;
- $vararg_buffer19 = sp + 2104|0;
- $vararg_buffer17 = sp + 2096|0;
- $vararg_buffer15 = sp + 2088|0;
- $vararg_buffer13 = sp + 2080|0;
- $vararg_buffer10 = sp + 2072|0;
- $vararg_buffer7 = sp + 24|0;
- $vararg_buffer4 = sp + 16|0;
- $vararg_buffer1 = sp + 8|0;
- $vararg_buffer = sp;
- $2 = sp + 2400|0;
- $3 = sp + 2384|0;
- $4 = sp + 2320|0;
- $5 = sp + 2256|0;
- $6 = sp + 2192|0;
- $7 = (_glGetString(7936)|0);
- HEAP32[$vararg_buffer>>2] = $7;
- _TraceLog(0,4308,$vararg_buffer);
- $8 = (_glGetString(7937)|0);
- HEAP32[$vararg_buffer1>>2] = $8;
- _TraceLog(0,4326,$vararg_buffer1);
- $9 = (_glGetString(7938)|0);
- HEAP32[$vararg_buffer4>>2] = $9;
- _TraceLog(0,4344,$vararg_buffer4);
- $10 = (_glGetString(35724)|0);
- HEAP32[$vararg_buffer7>>2] = $10;
- _TraceLog(0,4362,$vararg_buffer7);
- $11 = (_glGetString(7939)|0);
- $12 = (_strlen($11)|0);
- $13 = (($12) + 1)|0;
- $14 = (_malloc($13)|0);
- _memcpy(($14|0),($11|0),($13|0))|0;
- $$062 = 0;$$sink63 = $14;
- while(1) {
- $15 = (_strtok($$sink63,4380)|0);
- $16 = (($vararg_buffer7) + ($$062<<2)|0);
- HEAP32[$16>>2] = $15;
- $17 = ($15|0)==(0|0);
- $18 = (($$062) + 1)|0;
- if ($17) {
- break;
- } else {
- $$062 = $18;$$sink63 = 0;
- }
- }
- _free($14);
- $19 = (($$062) + -1)|0;
- HEAP32[$vararg_buffer10>>2] = $19;
- _TraceLog(0,4382,$vararg_buffer10);
- $20 = ($$062|0)>(1);
- if ($20) {
- $$06167 = 0;
- while(1) {
- $23 = (($vararg_buffer7) + ($$06167<<2)|0);
- $24 = HEAP32[$23>>2]|0;
- $25 = (_strcmp($24,4417)|0);
- $26 = ($25|0)==(0);
- if ($26) {
- HEAP32[7826] = 1;
- $27 = (_eglGetProcAddress((4444|0))|0);
- HEAP32[7827] = $27;
- $28 = (_eglGetProcAddress((4465|0))|0);
- HEAP32[7828] = $28;
- $29 = (_eglGetProcAddress((4486|0))|0);
- HEAP32[7829] = $29;
- }
- $30 = (_strcmp($24,4510)|0);
- $31 = ($30|0)==(0);
- if ($31) {
- HEAP32[7768] = 1;
- }
- $32 = (_strcmp($24,4530)|0);
- $33 = ($32|0)==(0);
- if ($33) {
- label = 12;
- } else {
- $34 = HEAP32[$23>>2]|0;
- $35 = (_strcmp($34,4562)|0);
- $36 = ($35|0)==(0);
- if ($36) {
- label = 12;
- } else {
- $37 = (_strcmp($34,4595)|0);
- $38 = ($37|0)==(0);
- if ($38) {
- label = 12;
- }
- }
- }
- if ((label|0) == 12) {
- label = 0;
- HEAP32[7763] = 1;
- }
- $39 = (_strcmp($24,4635)|0);
- $40 = ($39|0)==(0);
- if ($40) {
- label = 15;
- } else {
- $41 = HEAP32[$23>>2]|0;
- $42 = (_strcmp($41,4671)|0);
- $43 = ($42|0)==(0);
- if ($43) {
- label = 15;
- }
- }
- if ((label|0) == 15) {
- label = 0;
- HEAP32[7764] = 1;
- }
- $44 = HEAP32[$23>>2]|0;
- $45 = (_strcmp($44,4704)|0);
- $46 = ($45|0)==(0);
- if ($46) {
- HEAP32[7765] = 1;
- }
- $47 = (_strcmp($44,4729)|0);
- $48 = ($47|0)==(0);
- if ($48) {
- HEAP32[7766] = 1;
- }
- $49 = (_strcmp($44,4762)|0);
- $50 = ($49|0)==(0);
- if ($50) {
- HEAP32[7767] = 1;
- }
- $51 = (_strcmp($44,4798)|0);
- $52 = ($51|0)==(0);
- if ($52) {
- HEAP32[7830] = 1;
- _glGetFloatv(34047,(31324|0));
- }
- $53 = HEAP32[$23>>2]|0;
- $54 = (_strcmp($53,4832)|0);
- $55 = ($54|0)==(0);
- if ($55) {
- HEAP32[7832] = 1;
- }
- $56 = (($$06167) + 1)|0;
- $exitcond70 = ($56|0)==($19|0);
- if ($exitcond70) {
- break;
- } else {
- $$06167 = $56;
- }
- }
- }
- $21 = HEAP32[7826]|0;
- $22 = ($21|0)==(0);
- if ($22) {
- _TraceLog(2,4935,$vararg_buffer15);
- } else {
- _TraceLog(0,4860,$vararg_buffer13);
- }
- $57 = HEAP32[7768]|0;
- $58 = ($57|0)==(0);
- if ($58) {
- _TraceLog(2,5071,$vararg_buffer19);
- } else {
- _TraceLog(0,4996,$vararg_buffer17);
- }
- $59 = HEAP32[7763]|0;
- $60 = ($59|0)==(0);
- if (!($60)) {
- _TraceLog(0,5163,$vararg_buffer21);
- }
- $61 = HEAP32[7764]|0;
- $62 = ($61|0)==(0);
- if (!($62)) {
- _TraceLog(0,5209,$vararg_buffer23);
- }
- $63 = HEAP32[7765]|0;
- $64 = ($63|0)==(0);
- if (!($64)) {
- _TraceLog(0,5256,$vararg_buffer25);
- }
- $65 = HEAP32[7766]|0;
- $66 = ($65|0)==(0);
- if (!($66)) {
- _TraceLog(0,5307,$vararg_buffer27);
- }
- $67 = HEAP32[7767]|0;
- $68 = ($67|0)==(0);
- if (!($68)) {
- _TraceLog(0,5354,$vararg_buffer29);
- }
- $69 = HEAP32[7830]|0;
- $70 = ($69|0)==(0);
- if (!($70)) {
- $71 = +HEAPF32[7831];
- $72 = $71;
- HEAPF64[$vararg_buffer31>>3] = $72;
- _TraceLog(0,5401,$vararg_buffer31);
- }
- $73 = HEAP32[7832]|0;
- $74 = ($73|0)==(0);
- if (!($74)) {
- _TraceLog(0,5467,$vararg_buffer34);
- }
- HEAP32[$vararg_buffer10>>2] = -1;
- $75 = (_rlglLoadTexture($vararg_buffer10,1,1,7,1)|0);
- HEAP32[7833] = $75;
- $76 = ($75|0)==(0);
- if ($76) {
- _TraceLog(2,5571,$vararg_buffer39);
- } else {
- HEAP32[$vararg_buffer36>>2] = $75;
- _TraceLog(0,5520,$vararg_buffer36);
- }
- _LoadDefaultShader($2);
- dest=31336; 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));
- dest=31392; 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));
- _LoadDefaultBuffers();
- $77 = (_malloc(49152)|0);
- HEAP32[7862] = $77;
- $$06066 = 0;
- while(1) {
- $79 = HEAP32[7862]|0;
- $80 = (($79) + (($$06066*12)|0)|0);
- _VectorZero($3);
- ;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;
- $81 = (($$06066) + 1)|0;
- $exitcond69 = ($81|0)==(4096);
- if ($exitcond69) {
- break;
- } else {
- $$06066 = $81;
- }
- }
- $78 = (_malloc(36864)|0);
- HEAP32[7863] = $78;
- $$05965 = 0;
- while(1) {
- $82 = (((($78) + (($$05965*144)|0)|0)) + 8|0);
- HEAP32[$82>>2] = 0;
- $83 = (($78) + (($$05965*144)|0)|0);
- HEAP32[$83>>2] = 0;
- $84 = (($$05965) + 1)|0;
- $exitcond = ($84|0)==(256);
- if ($exitcond) {
- break;
- } else {
- $$05965 = $84;
- }
- }
- HEAP32[7864] = 1;
- $85 = HEAP32[7833]|0;
- $86 = ((($78)) + 8|0);
- HEAP32[$86>>2] = $85;
- HEAP32[7865] = 4;
- _MatrixIdentity($4);
- dest=31464; 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));
- _MatrixIdentity($4);
- dest=(31528); 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));
- _MatrixIdentity($4);
- dest=(31592); 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));
- _MatrixIdentity($4);
- dest=(31656); 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));
- _MatrixIdentity($4);
- dest=(31720); 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));
- _MatrixIdentity($4);
- dest=(31784); 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));
- _MatrixIdentity($4);
- dest=(31848); 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));
- _MatrixIdentity($4);
- dest=(31912); 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));
- _MatrixIdentity($4);
- dest=(31976); 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));
- _MatrixIdentity($4);
- dest=(32040); 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));
- _MatrixIdentity($4);
- dest=(32104); 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));
- _MatrixIdentity($4);
- dest=(32168); 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));
- _MatrixIdentity($4);
- dest=(32232); 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));
- _MatrixIdentity($4);
- dest=(32296); 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));
- _MatrixIdentity($4);
- dest=(32360); 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));
- _MatrixIdentity($4);
- dest=(32424); 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));
- _MatrixIdentity($5);
- dest=31172; 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));
- _MatrixIdentity($6);
- dest=31236; 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));
- HEAP32[7792] = 31236;
- _glDepthFunc(515);
- _glDisable(2929);
- _glBlendFunc(770,771);
- _glEnable(3042);
- _glCullFace(1029);
- _glFrontFace(2305);
- _glEnable(2884);
- _glClearColor(0.0,0.0,0.0,1.0);
- _glClearDepthf(1.0);
- _glClear(16640);
- HEAP32[8122] = $0;
- HEAP32[8123] = $1;
- _TraceLog(0,5610,$vararg_buffer41);
- STACKTOP = sp;return;
- }
- function _SetupViewport() {
- var $0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = HEAP32[7790]|0;
- $1 = (($0|0) / 2)&-1;
- $2 = HEAP32[7791]|0;
- $3 = (($2|0) / 2)&-1;
- $4 = HEAP32[7788]|0;
- $5 = (($4) - ($0))|0;
- $6 = HEAP32[7789]|0;
- $7 = (($6) - ($2))|0;
- _rlViewport($1,$3,$5,$7);
- return;
- }
- function _rlMatrixMode($0) {
- $0 = $0|0;
- var $modelview$sink = 0, label = 0, sp = 0;
- sp = STACKTOP;
- switch ($0|0) {
- case 5889: {
- $modelview$sink = 31172;
- label = 3;
- break;
- }
- case 5888: {
- $modelview$sink = 31236;
- label = 3;
- break;
- }
- default: {
- }
- }
- if ((label|0) == 3) {
- HEAP32[7792] = $modelview$sink;
- }
- HEAP32[7825] = $0;
- return;
- }
- function _rlLoadIdentity() {
- var $0 = 0, $1 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
- $0 = sp;
- $1 = HEAP32[7792]|0;
- _MatrixIdentity($0);
- 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));
- STACKTOP = sp;return;
- }
- function _rlOrtho($0,$1,$2,$3,$4,$5) {
- $0 = +$0;
- $1 = +$1;
- $2 = +$2;
- $3 = +$3;
- $4 = +$4;
- $5 = +$5;
- var $$byval_copy = 0, $$byval_copy1 = 0, $6 = 0, $7 = 0, $8 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 256|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(256|0);
- $$byval_copy1 = sp + 192|0;
- $$byval_copy = sp + 128|0;
- $6 = sp + 64|0;
- $7 = sp;
- _MatrixOrtho($6,$0,$1,$2,$3,$4,$5);
- _MatrixTranspose($6);
- $8 = HEAP32[7792]|0;
- 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));
- 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));
- _MatrixMultiply($7,$$byval_copy,$$byval_copy1);
- 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));
- STACKTOP = sp;return;
- }
- function _ClearBackground($0) {
- $0 = $0|0;
- var $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = HEAP8[$0>>0]|0;
- $2 = ((($0)) + 1|0);
- $3 = HEAP8[$2>>0]|0;
- $4 = ((($0)) + 2|0);
- $5 = HEAP8[$4>>0]|0;
- $6 = ((($0)) + 3|0);
- $7 = HEAP8[$6>>0]|0;
- _rlClearColor($1,$3,$5,$7);
- return;
- }
- function _rlClearColor($0,$1,$2,$3) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- 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;
- sp = STACKTOP;
- $4 = (+($0&255));
- $5 = $4 / 255.0;
- $6 = (+($1&255));
- $7 = $6 / 255.0;
- $8 = (+($2&255));
- $9 = $8 / 255.0;
- $10 = (+($3&255));
- $11 = $10 / 255.0;
- _glClearColor((+$5),(+$7),(+$9),(+$11));
- return;
- }
- function _rlViewport($0,$1,$2,$3) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- var label = 0, sp = 0;
- sp = STACKTOP;
- _glViewport(($0|0),($1|0),($2|0),($3|0));
- return;
- }
- function _LoadDefaultShader($0) {
- $0 = $0|0;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 1008|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(1008|0);
- $vararg_buffer1 = sp + 8|0;
- $vararg_buffer = sp;
- $1 = sp + 16|0;
- $2 = sp + 513|0;
- $3 = sp + 72|0;
- _memcpy(($2|0),(6186|0),489)|0;
- _memcpy(($3|0),(6675|0),441)|0;
- $4 = (_LoadShaderProgram($2,$3)|0);
- HEAP32[$1>>2] = $4;
- $5 = ($4|0)==(0);
- if ($5) {
- HEAP32[$vararg_buffer1>>2] = $4;
- _TraceLog(2,7164,$vararg_buffer1);
- } else {
- HEAP32[$vararg_buffer>>2] = $4;
- _TraceLog(0,7116,$vararg_buffer);
- }
- $6 = HEAP32[$1>>2]|0;
- $7 = ($6|0)==(0);
- if (!($7)) {
- _LoadDefaultShaderLocations($1);
- }
- 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));
- STACKTOP = sp;return;
- }
- function _LoadDefaultBuffers() {
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
- $vararg_buffer17 = sp + 48|0;
- $vararg_buffer14 = sp + 40|0;
- $vararg_buffer10 = sp + 32|0;
- $vararg_buffer7 = sp + 24|0;
- $vararg_buffer3 = sp + 16|0;
- $vararg_buffer1 = sp + 8|0;
- $vararg_buffer = sp;
- $0 = (_malloc(24576)|0);
- HEAP32[(32508)>>2] = $0;
- $1 = (_malloc(8192)|0);
- HEAP32[(32516)>>2] = $1;
- HEAP32[(32512)>>2] = 0;
- HEAP32[(32520)>>2] = 0;
- _memset(($0|0),0,24576)|0;
- $$05972 = 0;
- while(1) {
- $2 = HEAP32[(32516)>>2]|0;
- $3 = (($2) + ($$05972)|0);
- HEAP8[$3>>0] = 0;
- $4 = (($$05972) + 1)|0;
- $exitcond80 = ($4|0)==(8192);
- if ($exitcond80) {
- break;
- } else {
- $$05972 = $4;
- }
- }
- HEAP32[8124] = 0;
- HEAP32[(32504)>>2] = 0;
- HEAP32[(32500)>>2] = 0;
- $5 = (_malloc(73728)|0);
- HEAP32[(32556)>>2] = $5;
- $6 = (_malloc(24576)|0);
- HEAP32[(32564)>>2] = $6;
- HEAP32[(32560)>>2] = 0;
- HEAP32[(32568)>>2] = 0;
- _memset(($5|0),0,73728)|0;
- $$05770 = 0;
- while(1) {
- $7 = HEAP32[(32564)>>2]|0;
- $8 = (($7) + ($$05770)|0);
- HEAP8[$8>>0] = 0;
- $9 = (($$05770) + 1)|0;
- $exitcond78 = ($9|0)==(24576);
- if ($exitcond78) {
- break;
- } else {
- $$05770 = $9;
- }
- }
- HEAP32[8136] = 0;
- HEAP32[(32552)>>2] = 0;
- HEAP32[(32548)>>2] = 0;
- $10 = (_malloc(49152)|0);
- HEAP32[(32604)>>2] = $10;
- $11 = (_malloc(32768)|0);
- HEAP32[(32608)>>2] = $11;
- $12 = (_malloc(16384)|0);
- HEAP32[(32612)>>2] = $12;
- $13 = (_malloc(12288)|0);
- HEAP32[(32616)>>2] = $13;
- $14 = HEAP32[(32604)>>2]|0;
- _memset(($14|0),0,49152)|0;
- $15 = HEAP32[(32608)>>2]|0;
- _memset(($15|0),0,32768)|0;
- $$05467 = 0;
- while(1) {
- $17 = HEAP32[(32612)>>2]|0;
- $18 = (($17) + ($$05467)|0);
- HEAP8[$18>>0] = 0;
- $19 = (($$05467) + 1)|0;
- $exitcond75 = ($19|0)==(16384);
- if ($exitcond75) {
- break;
- } else {
- $$05467 = $19;
- }
- }
- $16 = HEAP32[(32616)>>2]|0;
- $$05365 = 0;$$066 = 0;
- while(1) {
- $22 = $$05365 << 2;
- $23 = $22&65535;
- $24 = (($16) + ($$066<<1)|0);
- HEAP16[$24>>1] = $23;
- $25 = $22 | 1;
- $26 = $25&65535;
- $27 = $$066 | 1;
- $28 = (($16) + ($27<<1)|0);
- HEAP16[$28>>1] = $26;
- $29 = $22 | 2;
- $30 = $29&65535;
- $31 = (($$066) + 2)|0;
- $32 = (($16) + ($31<<1)|0);
- HEAP16[$32>>1] = $30;
- $33 = (($$066) + 3)|0;
- $34 = (($16) + ($33<<1)|0);
- HEAP16[$34>>1] = $23;
- $35 = (($$066) + 4)|0;
- $36 = (($16) + ($35<<1)|0);
- HEAP16[$36>>1] = $30;
- $37 = $22 | 3;
- $38 = $37&65535;
- $39 = (($$066) + 5)|0;
- $40 = (($16) + ($39<<1)|0);
- HEAP16[$40>>1] = $38;
- $41 = (($$05365) + 1)|0;
- $42 = (($$066) + 6)|0;
- $exitcond = ($41|0)==(1024);
- if ($exitcond) {
- break;
- } else {
- $$05365 = $41;$$066 = $42;
- }
- }
- HEAP32[8148] = 0;
- HEAP32[(32596)>>2] = 0;
- HEAP32[(32600)>>2] = 0;
- _TraceLog(0,5657,$vararg_buffer);
- $20 = HEAP32[7826]|0;
- $21 = ($20|0)==(0);
- if (!($21)) {
- $43 = HEAP32[7827]|0;
- FUNCTION_TABLE_vii[$43 & 63](1,(32524));
- $44 = HEAP32[7828]|0;
- $45 = HEAP32[(32524)>>2]|0;
- FUNCTION_TABLE_vi[$44 & 31]($45);
- }
- _glGenBuffers(2,((32528)|0));
- $46 = HEAP32[(32528)>>2]|0;
- _glBindBuffer(34962,($46|0));
- $47 = HEAP32[(32508)>>2]|0;
- _glBufferData(34962,24576,($47|0),35048);
- $48 = HEAP32[(31396)>>2]|0;
- _glEnableVertexAttribArray(($48|0));
- $49 = HEAP32[(31396)>>2]|0;
- _glVertexAttribPointer(($49|0),3,5126,0,0,(0|0));
- _glGenBuffers(2,((32532)|0));
- $50 = HEAP32[(32532)>>2]|0;
- _glBindBuffer(34962,($50|0));
- $51 = HEAP32[(32516)>>2]|0;
- _glBufferData(34962,8192,($51|0),35048);
- $52 = HEAP32[(31416)>>2]|0;
- _glEnableVertexAttribArray(($52|0));
- $53 = HEAP32[(31416)>>2]|0;
- _glVertexAttribPointer(($53|0),4,5121,1,0,(0|0));
- $54 = HEAP32[7826]|0;
- $55 = ($54|0)==(0);
- if ($55) {
- $57 = HEAP32[(32528)>>2]|0;
- $58 = HEAP32[(32532)>>2]|0;
- HEAP32[$vararg_buffer3>>2] = $57;
- $vararg_ptr6 = ((($vararg_buffer3)) + 4|0);
- HEAP32[$vararg_ptr6>>2] = $58;
- _TraceLog(0,5795,$vararg_buffer3);
- } else {
- $56 = HEAP32[(32524)>>2]|0;
- HEAP32[$vararg_buffer1>>2] = $56;
- _TraceLog(0,5730,$vararg_buffer1);
- }
- $59 = HEAP32[7826]|0;
- $60 = ($59|0)==(0);
- if (!($60)) {
- $61 = HEAP32[7827]|0;
- FUNCTION_TABLE_vii[$61 & 63](1,(32572));
- $62 = HEAP32[7828]|0;
- $63 = HEAP32[(32572)>>2]|0;
- FUNCTION_TABLE_vi[$62 & 31]($63);
- }
- _glGenBuffers(1,((32576)|0));
- $64 = HEAP32[(32576)>>2]|0;
- _glBindBuffer(34962,($64|0));
- $65 = HEAP32[(32556)>>2]|0;
- _glBufferData(34962,73728,($65|0),35048);
- $66 = HEAP32[(31396)>>2]|0;
- _glEnableVertexAttribArray(($66|0));
- $67 = HEAP32[(31396)>>2]|0;
- _glVertexAttribPointer(($67|0),3,5126,0,0,(0|0));
- _glGenBuffers(1,((32580)|0));
- $68 = HEAP32[(32580)>>2]|0;
- _glBindBuffer(34962,($68|0));
- $69 = HEAP32[(32564)>>2]|0;
- _glBufferData(34962,24576,($69|0),35048);
- $70 = HEAP32[(31416)>>2]|0;
- _glEnableVertexAttribArray(($70|0));
- $71 = HEAP32[(31416)>>2]|0;
- _glVertexAttribPointer(($71|0),4,5121,1,0,(0|0));
- $72 = HEAP32[7826]|0;
- $73 = ($72|0)==(0);
- if ($73) {
- $75 = HEAP32[(32576)>>2]|0;
- $76 = HEAP32[(32580)>>2]|0;
- HEAP32[$vararg_buffer10>>2] = $75;
- $vararg_ptr13 = ((($vararg_buffer10)) + 4|0);
- HEAP32[$vararg_ptr13>>2] = $76;
- _TraceLog(0,5941,$vararg_buffer10);
- } else {
- $74 = HEAP32[(32572)>>2]|0;
- HEAP32[$vararg_buffer7>>2] = $74;
- _TraceLog(0,5872,$vararg_buffer7);
- }
- $77 = HEAP32[7826]|0;
- $78 = ($77|0)==(0);
- if (!($78)) {
- $79 = HEAP32[7827]|0;
- FUNCTION_TABLE_vii[$79 & 63](1,(32620));
- $80 = HEAP32[7828]|0;
- $81 = HEAP32[(32620)>>2]|0;
- FUNCTION_TABLE_vi[$80 & 31]($81);
- }
- _glGenBuffers(1,((32624)|0));
- $82 = HEAP32[(32624)>>2]|0;
- _glBindBuffer(34962,($82|0));
- $83 = HEAP32[(32604)>>2]|0;
- _glBufferData(34962,49152,($83|0),35048);
- $84 = HEAP32[(31396)>>2]|0;
- _glEnableVertexAttribArray(($84|0));
- $85 = HEAP32[(31396)>>2]|0;
- _glVertexAttribPointer(($85|0),3,5126,0,0,(0|0));
- _glGenBuffers(1,((32628)|0));
- $86 = HEAP32[(32628)>>2]|0;
- _glBindBuffer(34962,($86|0));
- $87 = HEAP32[(32608)>>2]|0;
- _glBufferData(34962,32768,($87|0),35048);
- $88 = HEAP32[(31400)>>2]|0;
- _glEnableVertexAttribArray(($88|0));
- $89 = HEAP32[(31400)>>2]|0;
- _glVertexAttribPointer(($89|0),2,5126,0,0,(0|0));
- _glGenBuffers(1,((32632)|0));
- $90 = HEAP32[(32632)>>2]|0;
- _glBindBuffer(34962,($90|0));
- $91 = HEAP32[(32612)>>2]|0;
- _glBufferData(34962,16384,($91|0),35048);
- $92 = HEAP32[(31416)>>2]|0;
- _glEnableVertexAttribArray(($92|0));
- $93 = HEAP32[(31416)>>2]|0;
- _glVertexAttribPointer(($93|0),4,5121,1,0,(0|0));
- _glGenBuffers(1,((32636)|0));
- $94 = HEAP32[(32636)>>2]|0;
- _glBindBuffer(34963,($94|0));
- $95 = HEAP32[(32616)>>2]|0;
- _glBufferData(34963,12288,($95|0),35044);
- $96 = HEAP32[7826]|0;
- $97 = ($96|0)==(0);
- if ($97) {
- $99 = HEAP32[(32624)>>2]|0;
- $100 = HEAP32[(32628)>>2]|0;
- $101 = HEAP32[(32632)>>2]|0;
- $102 = HEAP32[(32636)>>2]|0;
- HEAP32[$vararg_buffer17>>2] = $99;
- $vararg_ptr20 = ((($vararg_buffer17)) + 4|0);
- HEAP32[$vararg_ptr20>>2] = $100;
- $vararg_ptr21 = ((($vararg_buffer17)) + 8|0);
- HEAP32[$vararg_ptr21>>2] = $101;
- $vararg_ptr22 = ((($vararg_buffer17)) + 12|0);
- HEAP32[$vararg_ptr22>>2] = $102;
- _TraceLog(0,6087,$vararg_buffer17);
- } else {
- $98 = HEAP32[(32620)>>2]|0;
- HEAP32[$vararg_buffer14>>2] = $98;
- _TraceLog(0,6022,$vararg_buffer14);
- }
- $103 = HEAP32[7826]|0;
- $104 = ($103|0)==(0);
- if ($104) {
- STACKTOP = sp;return;
- }
- $105 = HEAP32[7828]|0;
- FUNCTION_TABLE_vi[$105 & 31](0);
- STACKTOP = sp;return;
- }
- function _LoadShaderProgram($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
- $vararg_buffer22 = sp + 64|0;
- $vararg_buffer19 = sp + 56|0;
- $vararg_buffer16 = sp + 48|0;
- $vararg_buffer13 = sp + 40|0;
- $vararg_buffer10 = sp + 32|0;
- $vararg_buffer7 = sp + 24|0;
- $vararg_buffer4 = sp + 16|0;
- $vararg_buffer1 = sp + 8|0;
- $vararg_buffer = sp;
- $2 = sp + 80|0;
- $3 = sp + 76|0;
- $4 = sp + 72|0;
- $5 = sp + 68|0;
- $6 = (_glCreateShader(35633)|0);
- $7 = (_glCreateShader(35632)|0);
- HEAP32[$2>>2] = $0;
- HEAP32[$3>>2] = $1;
- _glShaderSource(($6|0),1,($2|0),(0|0));
- _glShaderSource(($7|0),1,($3|0),(0|0));
- HEAP32[$4>>2] = 0;
- _glCompileShader(($6|0));
- _glGetShaderiv(($6|0),35713,($4|0));
- $8 = HEAP32[$4>>2]|0;
- $9 = ($8|0)==(1);
- if ($9) {
- HEAP32[$vararg_buffer4>>2] = $6;
- _TraceLog(0,7420,$vararg_buffer4);
- } else {
- HEAP32[$vararg_buffer>>2] = $6;
- _TraceLog(2,7368,$vararg_buffer);
- HEAP32[$vararg_buffer>>2] = 0;
- _glGetShaderiv(($6|0),35716,($vararg_buffer|0));
- $10 = HEAP32[$vararg_buffer>>2]|0;
- $11 = (_llvm_stacksave()|0);
- $$alloca_mul = $10;
- $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);;
- $13 = HEAP32[$vararg_buffer>>2]|0;
- _glGetShaderInfoLog(($6|0),($13|0),($5|0),($12|0));
- HEAP32[$vararg_buffer1>>2] = $12;
- _TraceLog(0,7417,$vararg_buffer1);
- _llvm_stackrestore(($11|0));
- }
- _glCompileShader(($7|0));
- _glGetShaderiv(($7|0),35713,($4|0));
- $14 = HEAP32[$4>>2]|0;
- $15 = ($14|0)==(1);
- if ($15) {
- HEAP32[$vararg_buffer13>>2] = $7;
- _TraceLog(0,7521,$vararg_buffer13);
- } else {
- HEAP32[$vararg_buffer7>>2] = $7;
- _TraceLog(2,7470,$vararg_buffer7);
- HEAP32[$vararg_buffer7>>2] = 0;
- _glGetShaderiv(($7|0),35716,($vararg_buffer7|0));
- $16 = HEAP32[$vararg_buffer7>>2]|0;
- $17 = (_llvm_stacksave()|0);
- $$alloca_mul34 = $16;
- $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);;
- $19 = HEAP32[$vararg_buffer7>>2]|0;
- _glGetShaderInfoLog(($7|0),($19|0),($5|0),($18|0));
- HEAP32[$vararg_buffer10>>2] = $18;
- _TraceLog(0,7417,$vararg_buffer10);
- _llvm_stackrestore(($17|0));
- }
- $20 = (_glCreateProgram()|0);
- _glAttachShader(($20|0),($6|0));
- _glAttachShader(($20|0),($7|0));
- _glBindAttribLocation(($20|0),0,(7212|0));
- _glBindAttribLocation(($20|0),1,(7227|0));
- _glBindAttribLocation(($20|0),2,(7258|0));
- _glBindAttribLocation(($20|0),3,(7285|0));
- _glBindAttribLocation(($20|0),4,(7271|0));
- _glBindAttribLocation(($20|0),5,(7242|0));
- _glLinkProgram(($20|0));
- _glGetProgramiv(($20|0),35714,($4|0));
- $21 = HEAP32[$4>>2]|0;
- $22 = ($21|0)==(0);
- if ($22) {
- HEAP32[$vararg_buffer16>>2] = $20;
- _TraceLog(2,7573,$vararg_buffer16);
- HEAP32[$vararg_buffer16>>2] = 0;
- _glGetProgramiv(($20|0),35716,($vararg_buffer16|0));
- $23 = HEAP32[$vararg_buffer16>>2]|0;
- $24 = (_llvm_stacksave()|0);
- $$alloca_mul36 = $23;
- $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);;
- $26 = HEAP32[$vararg_buffer16>>2]|0;
- _glGetProgramInfoLog(($20|0),($26|0),($5|0),($25|0));
- HEAP32[$vararg_buffer19>>2] = $25;
- _TraceLog(0,7417,$vararg_buffer19);
- _glDeleteProgram(($20|0));
- _llvm_stackrestore(($24|0));
- $$0 = 0;
- _glDeleteShader(($6|0));
- _glDeleteShader(($7|0));
- STACKTOP = sp;return ($$0|0);
- } else {
- HEAP32[$vararg_buffer22>>2] = $20;
- _TraceLog(0,7619,$vararg_buffer22);
- $$0 = $20;
- _glDeleteShader(($6|0));
- _glDeleteShader(($7|0));
- STACKTOP = sp;return ($$0|0);
- }
- return (0)|0;
- }
- function _LoadDefaultShaderLocations($0) {
- $0 = $0|0;
- 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;
- 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;
- var sp = 0;
- sp = STACKTOP;
- $1 = HEAP32[$0>>2]|0;
- $2 = (_glGetAttribLocation(($1|0),(7212|0))|0);
- $3 = ((($0)) + 4|0);
- HEAP32[$3>>2] = $2;
- $4 = HEAP32[$0>>2]|0;
- $5 = (_glGetAttribLocation(($4|0),(7227|0))|0);
- $6 = ((($0)) + 8|0);
- HEAP32[$6>>2] = $5;
- $7 = HEAP32[$0>>2]|0;
- $8 = (_glGetAttribLocation(($7|0),(7242|0))|0);
- $9 = ((($0)) + 12|0);
- HEAP32[$9>>2] = $8;
- $10 = HEAP32[$0>>2]|0;
- $11 = (_glGetAttribLocation(($10|0),(7258|0))|0);
- $12 = ((($0)) + 16|0);
- HEAP32[$12>>2] = $11;
- $13 = HEAP32[$0>>2]|0;
- $14 = (_glGetAttribLocation(($13|0),(7271|0))|0);
- $15 = ((($0)) + 20|0);
- HEAP32[$15>>2] = $14;
- $16 = HEAP32[$0>>2]|0;
- $17 = (_glGetAttribLocation(($16|0),(7285|0))|0);
- $18 = ((($0)) + 24|0);
- HEAP32[$18>>2] = $17;
- $19 = HEAP32[$0>>2]|0;
- $20 = (_glGetUniformLocation(($19|0),(7297|0))|0);
- $21 = ((($0)) + 28|0);
- HEAP32[$21>>2] = $20;
- $22 = HEAP32[$0>>2]|0;
- $23 = (_glGetUniformLocation(($22|0),(7307|0))|0);
- $24 = ((($0)) + 32|0);
- HEAP32[$24>>2] = $23;
- $25 = HEAP32[$0>>2]|0;
- $26 = (_glGetUniformLocation(($25|0),(7318|0))|0);
- $27 = ((($0)) + 36|0);
- HEAP32[$27>>2] = $26;
- $28 = HEAP32[$0>>2]|0;
- $29 = (_glGetUniformLocation(($28|0),(7329|0))|0);
- $30 = ((($0)) + 40|0);
- HEAP32[$30>>2] = $29;
- $31 = HEAP32[$0>>2]|0;
- $32 = (_glGetUniformLocation(($31|0),(7341|0))|0);
- $33 = ((($0)) + 44|0);
- HEAP32[$33>>2] = $32;
- $34 = HEAP32[$0>>2]|0;
- $35 = (_glGetUniformLocation(($34|0),(7350|0))|0);
- $36 = ((($0)) + 48|0);
- HEAP32[$36>>2] = $35;
- $37 = HEAP32[$0>>2]|0;
- $38 = (_glGetUniformLocation(($37|0),(7359|0))|0);
- $39 = ((($0)) + 52|0);
- HEAP32[$39>>2] = $38;
- return;
- }
- function _IsMouseButtonPressed($0) {
- $0 = $0|0;
- var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $or$cond = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = (35953 + ($0)|0);
- $2 = HEAP8[$1>>0]|0;
- $3 = (35956 + ($0)|0);
- $4 = HEAP8[$3>>0]|0;
- $5 = ($2<<24>>24)!=($4<<24>>24);
- $6 = ($2<<24>>24)==(1);
- $or$cond = $6 & $5;
- $$0 = $or$cond&1;
- return ($$0|0);
- }
- function _IsMouseButtonReleased($0) {
- $0 = $0|0;
- var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $or$cond = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = (35953 + ($0)|0);
- $2 = HEAP8[$1>>0]|0;
- $3 = (35956 + ($0)|0);
- $4 = HEAP8[$3>>0]|0;
- $5 = ($2<<24>>24)!=($4<<24>>24);
- $6 = ($2<<24>>24)==(0);
- $or$cond = $6 & $5;
- $$0 = $or$cond&1;
- return ($$0|0);
- }
- function _rlClearScreenBuffers() {
- var label = 0, sp = 0;
- sp = STACKTOP;
- _glClear(16640);
- return;
- }
- function _CloseWindow() {
- var $0 = 0, $vararg_buffer = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $vararg_buffer = sp;
- _UnloadDefaultFont();
- _rlglClose();
- $0 = HEAP32[7745]|0;
- _glfwDestroyWindow(($0|0));
- _glfwTerminate();
- _TraceLog(0,7931,$vararg_buffer);
- STACKTOP = sp;return;
- }
- function _UnloadDefaultFont() {
- var $$byval_copy = 0, $0 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
- $$byval_copy = sp;
- ;HEAP32[$$byval_copy>>2]=HEAP32[31020>>2]|0;HEAP32[$$byval_copy+4>>2]=HEAP32[31020+4>>2]|0;HEAP32[$$byval_copy+8>>2]=HEAP32[31020+8>>2]|0;HEAP32[$$byval_copy+12>>2]=HEAP32[31020+12>>2]|0;HEAP32[$$byval_copy+16>>2]=HEAP32[31020+16>>2]|0;
- _UnloadTexture($$byval_copy);
- $0 = HEAP32[(31048)>>2]|0;
- _free($0);
- STACKTOP = sp;return;
- }
- function _rlglClose() {
- var $0 = 0, $1 = 0, $vararg_buffer = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $vararg_buffer = sp;
- _UnloadDefaultShader();
- _UnloadDefaultBuffers();
- _glDeleteTextures(1,(31332|0));
- $0 = HEAP32[7833]|0;
- HEAP32[$vararg_buffer>>2] = $0;
- _TraceLog(0,7958,$vararg_buffer);
- $1 = HEAP32[7863]|0;
- _free($1);
- STACKTOP = sp;return;
- }
- function _UnloadDefaultShader() {
- var $0 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- _glUseProgram(0);
- $0 = HEAP32[7834]|0;
- _glDeleteProgram(($0|0));
- return;
- }
- function _UnloadDefaultBuffers() {
- 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;
- sp = STACKTOP;
- $0 = HEAP32[7826]|0;
- $1 = ($0|0)==(0);
- if (!($1)) {
- $2 = HEAP32[7828]|0;
- FUNCTION_TABLE_vi[$2 & 31](0);
- }
- _glDisableVertexAttribArray(0);
- _glDisableVertexAttribArray(1);
- _glDisableVertexAttribArray(2);
- _glDisableVertexAttribArray(3);
- _glBindBuffer(34962,0);
- _glBindBuffer(34963,0);
- _glDeleteBuffers(1,((32528)|0));
- _glDeleteBuffers(1,((32532)|0));
- _glDeleteBuffers(1,((32576)|0));
- _glDeleteBuffers(1,((32580)|0));
- _glDeleteBuffers(1,((32624)|0));
- _glDeleteBuffers(1,((32628)|0));
- _glDeleteBuffers(1,((32632)|0));
- _glDeleteBuffers(1,((32636)|0));
- $3 = HEAP32[7826]|0;
- $4 = ($3|0)==(0);
- if (!($4)) {
- $5 = HEAP32[7829]|0;
- FUNCTION_TABLE_vii[$5 & 63](1,(32524));
- $6 = HEAP32[7829]|0;
- FUNCTION_TABLE_vii[$6 & 63](1,(32572));
- $7 = HEAP32[7829]|0;
- FUNCTION_TABLE_vii[$7 & 63](1,(32620));
- }
- $8 = HEAP32[(32508)>>2]|0;
- _free($8);
- $9 = HEAP32[(32516)>>2]|0;
- _free($9);
- $10 = HEAP32[(32556)>>2]|0;
- _free($10);
- $11 = HEAP32[(32564)>>2]|0;
- _free($11);
- $12 = HEAP32[(32604)>>2]|0;
- _free($12);
- $13 = HEAP32[(32608)>>2]|0;
- _free($13);
- $14 = HEAP32[(32612)>>2]|0;
- _free($14);
- $15 = HEAP32[(32616)>>2]|0;
- _free($15);
- return;
- }
- function _UnloadTexture($0) {
- $0 = $0|0;
- var $1 = 0, $2 = 0, $3 = 0, $vararg_buffer = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $vararg_buffer = sp;
- $1 = HEAP32[$0>>2]|0;
- $2 = ($1|0)==(0);
- if ($2) {
- STACKTOP = sp;return;
- }
- _rlDeleteTextures($1);
- $3 = HEAP32[$0>>2]|0;
- HEAP32[$vararg_buffer>>2] = $3;
- _TraceLog(0,8023,$vararg_buffer);
- STACKTOP = sp;return;
- }
- function _rlDeleteTextures($0) {
- $0 = $0|0;
- var $1 = 0, $2 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $1 = sp;
- HEAP32[$1>>2] = $0;
- $2 = ($0|0)==(0);
- if (!($2)) {
- _glDeleteTextures(1,($1|0));
- }
- STACKTOP = sp;return;
- }
- function _BeginDrawing() {
- var $0 = 0.0, $1 = 0.0, $2 = 0.0, $downscaleView$byval_copy = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
- $downscaleView$byval_copy = sp;
- $0 = (+_GetTime());
- HEAPF64[1779] = $0;
- $1 = +HEAPF64[1762];
- $2 = $0 - $1;
- HEAPF64[1780] = $2;
- HEAPF64[1762] = $0;
- _rlClearScreenBuffers();
- _rlLoadIdentity();
- dest=$downscaleView$byval_copy; src=31076; 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));
- (_MatrixToFloat($downscaleView$byval_copy)|0);
- _rlMultMatrixf(32648);
- STACKTOP = sp;return;
- }
- function _MatrixToFloat($0) {
- $0 = $0|0;
- 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;
- 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;
- sp = STACKTOP;
- $1 = HEAP32[$0>>2]|0;
- HEAP32[8162] = $1;
- $2 = ((($0)) + 4|0);
- $3 = HEAP32[$2>>2]|0;
- HEAP32[(32652)>>2] = $3;
- $4 = ((($0)) + 8|0);
- $5 = HEAP32[$4>>2]|0;
- HEAP32[(32656)>>2] = $5;
- $6 = ((($0)) + 12|0);
- $7 = HEAP32[$6>>2]|0;
- HEAP32[(32660)>>2] = $7;
- $8 = ((($0)) + 16|0);
- $9 = HEAP32[$8>>2]|0;
- HEAP32[(32664)>>2] = $9;
- $10 = ((($0)) + 20|0);
- $11 = HEAP32[$10>>2]|0;
- HEAP32[(32668)>>2] = $11;
- $12 = ((($0)) + 24|0);
- $13 = HEAP32[$12>>2]|0;
- HEAP32[(32672)>>2] = $13;
- $14 = ((($0)) + 28|0);
- $15 = HEAP32[$14>>2]|0;
- HEAP32[(32676)>>2] = $15;
- $16 = ((($0)) + 32|0);
- $17 = HEAP32[$16>>2]|0;
- HEAP32[(32680)>>2] = $17;
- $18 = ((($0)) + 36|0);
- $19 = HEAP32[$18>>2]|0;
- HEAP32[(32684)>>2] = $19;
- $20 = ((($0)) + 40|0);
- $21 = HEAP32[$20>>2]|0;
- HEAP32[(32688)>>2] = $21;
- $22 = ((($0)) + 44|0);
- $23 = HEAP32[$22>>2]|0;
- HEAP32[(32692)>>2] = $23;
- $24 = ((($0)) + 48|0);
- $25 = HEAP32[$24>>2]|0;
- HEAP32[(32696)>>2] = $25;
- $26 = ((($0)) + 52|0);
- $27 = HEAP32[$26>>2]|0;
- HEAP32[(32700)>>2] = $27;
- $28 = ((($0)) + 56|0);
- $29 = HEAP32[$28>>2]|0;
- HEAP32[(32704)>>2] = $29;
- $30 = ((($0)) + 60|0);
- $31 = HEAP32[$30>>2]|0;
- HEAP32[(32708)>>2] = $31;
- return (32648|0);
- }
- function _rlMultMatrixf($0) {
- $0 = $0|0;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 256|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(256|0);
- $$byval_copy1 = sp + 192|0;
- $$byval_copy = sp + 128|0;
- $1 = sp + 64|0;
- $2 = sp;
- $3 = HEAP32[$0>>2]|0;
- HEAP32[$1>>2] = $3;
- $4 = ((($1)) + 4|0);
- $5 = ((($0)) + 4|0);
- $6 = HEAP32[$5>>2]|0;
- HEAP32[$4>>2] = $6;
- $7 = ((($1)) + 8|0);
- $8 = ((($0)) + 8|0);
- $9 = HEAP32[$8>>2]|0;
- HEAP32[$7>>2] = $9;
- $10 = ((($1)) + 12|0);
- $11 = ((($0)) + 12|0);
- $12 = HEAP32[$11>>2]|0;
- HEAP32[$10>>2] = $12;
- $13 = ((($1)) + 16|0);
- $14 = ((($0)) + 16|0);
- $15 = HEAP32[$14>>2]|0;
- HEAP32[$13>>2] = $15;
- $16 = ((($1)) + 20|0);
- $17 = ((($0)) + 20|0);
- $18 = HEAP32[$17>>2]|0;
- HEAP32[$16>>2] = $18;
- $19 = ((($1)) + 24|0);
- $20 = ((($0)) + 24|0);
- $21 = HEAP32[$20>>2]|0;
- HEAP32[$19>>2] = $21;
- $22 = ((($1)) + 28|0);
- $23 = ((($0)) + 28|0);
- $24 = HEAP32[$23>>2]|0;
- HEAP32[$22>>2] = $24;
- $25 = ((($1)) + 32|0);
- $26 = ((($0)) + 32|0);
- $27 = HEAP32[$26>>2]|0;
- HEAP32[$25>>2] = $27;
- $28 = ((($1)) + 36|0);
- $29 = ((($0)) + 36|0);
- $30 = HEAP32[$29>>2]|0;
- HEAP32[$28>>2] = $30;
- $31 = ((($1)) + 40|0);
- $32 = ((($0)) + 40|0);
- $33 = HEAP32[$32>>2]|0;
- HEAP32[$31>>2] = $33;
- $34 = ((($1)) + 44|0);
- $35 = ((($0)) + 44|0);
- $36 = HEAP32[$35>>2]|0;
- HEAP32[$34>>2] = $36;
- $37 = ((($1)) + 48|0);
- $38 = ((($0)) + 48|0);
- $39 = HEAP32[$38>>2]|0;
- HEAP32[$37>>2] = $39;
- $40 = ((($1)) + 52|0);
- $41 = ((($0)) + 52|0);
- $42 = HEAP32[$41>>2]|0;
- HEAP32[$40>>2] = $42;
- $43 = ((($1)) + 56|0);
- $44 = ((($0)) + 56|0);
- $45 = HEAP32[$44>>2]|0;
- HEAP32[$43>>2] = $45;
- $46 = ((($1)) + 60|0);
- $47 = ((($0)) + 60|0);
- $48 = HEAP32[$47>>2]|0;
- HEAP32[$46>>2] = $48;
- $49 = HEAP32[7792]|0;
- 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));
- 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));
- _MatrixMultiply($2,$$byval_copy,$$byval_copy1);
- 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));
- STACKTOP = sp;return;
- }
- function _EndDrawing() {
- 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;
- sp = STACKTOP;
- _rlglDraw();
- _SwapBuffers();
- _PollInputEvents();
- $0 = (+_GetTime());
- HEAPF64[1779] = $0;
- $1 = +HEAPF64[1762];
- $2 = $0 - $1;
- HEAPF64[1781] = $2;
- HEAPF64[1762] = $0;
- $3 = +HEAPF64[1780];
- $4 = $2 + $3;
- HEAPF64[1782] = $4;
- $5 = +HEAPF64[1759];
- $6 = $4 < $5;
- if (!($6)) {
- return;
- }
- $7 = $5 - $4;
- $8 = $7 * 1000.0;
- $9 = $8;
- _Wait($9);
- $10 = (+_GetTime());
- HEAPF64[1779] = $10;
- $11 = +HEAPF64[1762];
- $12 = $10 - $11;
- HEAPF64[1762] = $10;
- $13 = +HEAPF64[1782];
- $14 = $12 + $13;
- HEAPF64[1782] = $14;
- return;
- }
- function _rlglDraw() {
- var label = 0, sp = 0;
- sp = STACKTOP;
- _UpdateDefaultBuffers();
- _DrawDefaultBuffers();
- return;
- }
- function _SwapBuffers() {
- var $0 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = HEAP32[7745]|0;
- _glfwSwapBuffers(($0|0));
- return;
- }
- function _PollInputEvents() {
- 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;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 1456|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(1456|0);
- $0 = sp + 1440|0;
- $1 = sp + 1432|0;
- $2 = sp;
- _UpdateGestures();
- HEAP32[743] = -1;
- HEAP32[745] = -1;
- HEAP32[8178] = 0;
- $3 = HEAP32[7745]|0;
- _glfwGetCursorPos(($3|0),($0|0),($1|0));
- $4 = +HEAPF64[$0>>3];
- $5 = $4;
- HEAPF32[3516] = $5;
- $6 = +HEAPF64[$1>>3];
- $7 = $6;
- HEAPF32[(14068)>>2] = $7;
- _memcpy((36471|0),(35959|0),512)|0;
- ;HEAP8[35956>>0]=HEAP8[35953>>0]|0;HEAP8[35956+1>>0]=HEAP8[35953+1>>0]|0;HEAP8[35956+2>>0]=HEAP8[35953+2>>0]|0;
- $8 = HEAP32[8161]|0;
- HEAP32[7748] = $8;
- HEAP32[8161] = 0;
- $9 = (_emscripten_get_num_gamepads()|0);
- $10 = ($9|0)>(0);
- if (!($10)) {
- STACKTOP = sp;return;
- }
- $11 = ((($2)) + 12|0);
- $12 = ((($2)) + 8|0);
- $$05160 = 0;
- while(1) {
- $scevgep = (36983 + ($$05160<<5)|0);
- $scevgep67 = (37111 + ($$05160<<5)|0);
- 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));
- $13 = (_emscripten_get_gamepad_status(($$05160|0),($2|0))|0);
- $14 = ($13|0)==(0);
- if ($14) {
- $15 = HEAP32[$11>>2]|0;
- $16 = ($15|0)>(0);
- if ($16) {
- $17 = HEAP32[$11>>2]|0;
- $$04857 = 0;
- while(1) {
- $21 = (((($2)) + 1040|0) + ($$04857<<2)|0);
- $22 = HEAP32[$21>>2]|0;
- $23 = ($22|0)==(1);
- $24 = ((37111 + ($$05160<<5)|0) + ($$04857)|0);
- if ($23) {
- HEAP8[$24>>0] = 1;
- HEAP32[745] = $$04857;
- } else {
- HEAP8[$24>>0] = 0;
- }
- $25 = (($$04857) + 1)|0;
- $26 = ($25|0)<($17|0);
- $27 = ($25|0)<(32);
- $28 = $27 & $26;
- if ($28) {
- $$04857 = $25;
- } else {
- break;
- }
- }
- }
- $18 = HEAP32[$12>>2]|0;
- $19 = ($18|0)>(0);
- if ($19) {
- $20 = HEAP32[$12>>2]|0;
- $$058 = 0;
- while(1) {
- $29 = (((($2)) + 16|0) + ($$058<<3)|0);
- $30 = +HEAPF64[$29>>3];
- $31 = $30;
- $32 = ((32716 + ($$05160<<5)|0) + ($$058<<2)|0);
- HEAPF32[$32>>2] = $31;
- $33 = (($$058) + 1)|0;
- $34 = ($33|0)<($20|0);
- $35 = ($33|0)<(8);
- $36 = $35 & $34;
- if ($36) {
- $$058 = $33;
- } else {
- $$lcssa = $20;
- break;
- }
- }
- } else {
- $$lcssa = $18;
- }
- HEAP32[8178] = $$lcssa;
- }
- $37 = (($$05160) + 1)|0;
- $38 = ($37|0)<($9|0);
- $39 = ($37|0)<(4);
- $40 = $38 & $39;
- if ($40) {
- $$05160 = $37;
- } else {
- break;
- }
- }
- STACKTOP = sp;return;
- }
- function _Wait($0) {
- $0 = +$0;
- 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;
- sp = STACKTOP;
- $1 = (+_GetTime());
- $2 = 0.0 - $1;
- $3 = $0 / 1000.0;
- $4 = $3;
- $5 = $2 < $4;
- if (!($5)) {
- return;
- }
- while(1) {
- $6 = (+_GetTime());
- $7 = $6 - $1;
- $8 = $7 < $4;
- if (!($8)) {
- break;
- }
- }
- return;
- }
- function _UpdateDefaultBuffers() {
- 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;
- 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;
- var $45 = 0, $46 = 0, $47 = 0, $48 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = HEAP32[8124]|0;
- $1 = ($0|0)>(0);
- if ($1) {
- $2 = HEAP32[7826]|0;
- $3 = ($2|0)==(0);
- if (!($3)) {
- $4 = HEAP32[7828]|0;
- $5 = HEAP32[(32524)>>2]|0;
- FUNCTION_TABLE_vi[$4 & 31]($5);
- }
- $6 = HEAP32[(32528)>>2]|0;
- _glBindBuffer(34962,($6|0));
- $7 = HEAP32[8124]|0;
- $8 = ($7*12)|0;
- $9 = HEAP32[(32508)>>2]|0;
- _glBufferSubData(34962,0,($8|0),($9|0));
- $10 = HEAP32[(32532)>>2]|0;
- _glBindBuffer(34962,($10|0));
- $11 = HEAP32[(32504)>>2]|0;
- $12 = $11 << 2;
- $13 = HEAP32[(32516)>>2]|0;
- _glBufferSubData(34962,0,($12|0),($13|0));
- }
- $14 = HEAP32[8136]|0;
- $15 = ($14|0)>(0);
- if ($15) {
- $16 = HEAP32[7826]|0;
- $17 = ($16|0)==(0);
- if (!($17)) {
- $18 = HEAP32[7828]|0;
- $19 = HEAP32[(32572)>>2]|0;
- FUNCTION_TABLE_vi[$18 & 31]($19);
- }
- $20 = HEAP32[(32576)>>2]|0;
- _glBindBuffer(34962,($20|0));
- $21 = HEAP32[8136]|0;
- $22 = ($21*12)|0;
- $23 = HEAP32[(32556)>>2]|0;
- _glBufferSubData(34962,0,($22|0),($23|0));
- $24 = HEAP32[(32580)>>2]|0;
- _glBindBuffer(34962,($24|0));
- $25 = HEAP32[(32552)>>2]|0;
- $26 = $25 << 2;
- $27 = HEAP32[(32564)>>2]|0;
- _glBufferSubData(34962,0,($26|0),($27|0));
- }
- $28 = HEAP32[8148]|0;
- $29 = ($28|0)>(0);
- if ($29) {
- $30 = HEAP32[7826]|0;
- $31 = ($30|0)==(0);
- if (!($31)) {
- $32 = HEAP32[7828]|0;
- $33 = HEAP32[(32620)>>2]|0;
- FUNCTION_TABLE_vi[$32 & 31]($33);
- }
- $34 = HEAP32[(32624)>>2]|0;
- _glBindBuffer(34962,($34|0));
- $35 = HEAP32[8148]|0;
- $36 = ($35*12)|0;
- $37 = HEAP32[(32604)>>2]|0;
- _glBufferSubData(34962,0,($36|0),($37|0));
- $38 = HEAP32[(32628)>>2]|0;
- _glBindBuffer(34962,($38|0));
- $39 = HEAP32[8148]|0;
- $40 = $39 << 3;
- $41 = HEAP32[(32608)>>2]|0;
- _glBufferSubData(34962,0,($40|0),($41|0));
- $42 = HEAP32[(32632)>>2]|0;
- _glBindBuffer(34962,($42|0));
- $43 = HEAP32[8148]|0;
- $44 = $43 << 2;
- $45 = HEAP32[(32612)>>2]|0;
- _glBufferSubData(34962,0,($44|0),($45|0));
- }
- $46 = HEAP32[7826]|0;
- $47 = ($46|0)==(0);
- if ($47) {
- return;
- }
- $48 = HEAP32[7828]|0;
- FUNCTION_TABLE_vi[$48 & 31](0);
- return;
- }
- function _DrawDefaultBuffers() {
- 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;
- 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;
- 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;
- 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;
- 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;
- var $or$cond = 0, $or$cond3 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 320|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(320|0);
- $$byval_copy2 = sp + 256|0;
- $modelview$byval_copy = sp + 192|0;
- $0 = sp + 128|0;
- $1 = sp + 64|0;
- $2 = sp;
- dest=$0; src=31172; 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));
- dest=$1; src=31236; 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));
- $3 = HEAP32[8211]|0;
- $4 = ($3|0)!=(0);
- $$ = $4 ? 2 : 1;
- $$02932 = 0;
- while(1) {
- if ($4) {
- 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));
- 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));
- _SetStereoView($$02932,$modelview$byval_copy,$$byval_copy2);
- }
- $8 = HEAP32[8124]|0;
- $9 = ($8|0)>(0);
- $10 = HEAP32[8136]|0;
- $11 = ($10|0)>(0);
- $or$cond = $9 | $11;
- $12 = HEAP32[8148]|0;
- $13 = ($12|0)>(0);
- $or$cond3 = $or$cond | $13;
- if ($or$cond3) {
- $14 = HEAP32[7848]|0;
- _glUseProgram(($14|0));
- dest=$modelview$byval_copy; src=31236; 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));
- dest=$$byval_copy2; src=31172; 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));
- _MatrixMultiply($2,$modelview$byval_copy,$$byval_copy2);
- $15 = HEAP32[(31420)>>2]|0;
- 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));
- $16 = (_MatrixToFloat($$byval_copy2)|0);
- _glUniformMatrix4fv(($15|0),1,0,($16|0));
- $17 = HEAP32[(31424)>>2]|0;
- _glUniform4f(($17|0),1.0,1.0,1.0,1.0);
- $18 = HEAP32[(31436)>>2]|0;
- _glUniform1i(($18|0),0);
- }
- $19 = HEAP32[8124]|0;
- $20 = ($19|0)>(0);
- if ($20) {
- $21 = HEAP32[7833]|0;
- _glBindTexture(3553,($21|0));
- $22 = HEAP32[7826]|0;
- $23 = ($22|0)==(0);
- if ($23) {
- $26 = HEAP32[(32528)>>2]|0;
- _glBindBuffer(34962,($26|0));
- $27 = HEAP32[(31396)>>2]|0;
- _glVertexAttribPointer(($27|0),3,5126,0,0,(0|0));
- $28 = HEAP32[(31396)>>2]|0;
- _glEnableVertexAttribArray(($28|0));
- $29 = HEAP32[(32532)>>2]|0;
- _glBindBuffer(34962,($29|0));
- $30 = HEAP32[(31416)>>2]|0;
- _glVertexAttribPointer(($30|0),4,5121,1,0,(0|0));
- $31 = HEAP32[(31416)>>2]|0;
- _glEnableVertexAttribArray(($31|0));
- } else {
- $24 = HEAP32[7828]|0;
- $25 = HEAP32[(32524)>>2]|0;
- FUNCTION_TABLE_vi[$24 & 31]($25);
- }
- $32 = HEAP32[8124]|0;
- _glDrawArrays(1,0,($32|0));
- $33 = HEAP32[7826]|0;
- $34 = ($33|0)==(0);
- if ($34) {
- _glBindBuffer(34962,0);
- }
- _glBindTexture(3553,0);
- }
- $35 = HEAP32[8136]|0;
- $36 = ($35|0)>(0);
- if ($36) {
- $37 = HEAP32[7833]|0;
- _glBindTexture(3553,($37|0));
- $38 = HEAP32[7826]|0;
- $39 = ($38|0)==(0);
- if ($39) {
- $42 = HEAP32[(32576)>>2]|0;
- _glBindBuffer(34962,($42|0));
- $43 = HEAP32[(31396)>>2]|0;
- _glVertexAttribPointer(($43|0),3,5126,0,0,(0|0));
- $44 = HEAP32[(31396)>>2]|0;
- _glEnableVertexAttribArray(($44|0));
- $45 = HEAP32[(32580)>>2]|0;
- _glBindBuffer(34962,($45|0));
- $46 = HEAP32[(31416)>>2]|0;
- _glVertexAttribPointer(($46|0),4,5121,1,0,(0|0));
- $47 = HEAP32[(31416)>>2]|0;
- _glEnableVertexAttribArray(($47|0));
- } else {
- $40 = HEAP32[7828]|0;
- $41 = HEAP32[(32572)>>2]|0;
- FUNCTION_TABLE_vi[$40 & 31]($41);
- }
- $48 = HEAP32[8136]|0;
- _glDrawArrays(4,0,($48|0));
- $49 = HEAP32[7826]|0;
- $50 = ($49|0)==(0);
- if ($50) {
- _glBindBuffer(34962,0);
- }
- _glBindTexture(3553,0);
- }
- $51 = HEAP32[8148]|0;
- $52 = ($51|0)>(0);
- if ($52) {
- $53 = HEAP32[7826]|0;
- $54 = ($53|0)==(0);
- if ($54) {
- $57 = HEAP32[(32624)>>2]|0;
- _glBindBuffer(34962,($57|0));
- $58 = HEAP32[(31396)>>2]|0;
- _glVertexAttribPointer(($58|0),3,5126,0,0,(0|0));
- $59 = HEAP32[(31396)>>2]|0;
- _glEnableVertexAttribArray(($59|0));
- $60 = HEAP32[(32628)>>2]|0;
- _glBindBuffer(34962,($60|0));
- $61 = HEAP32[(31400)>>2]|0;
- _glVertexAttribPointer(($61|0),2,5126,0,0,(0|0));
- $62 = HEAP32[(31400)>>2]|0;
- _glEnableVertexAttribArray(($62|0));
- $63 = HEAP32[(32632)>>2]|0;
- _glBindBuffer(34962,($63|0));
- $64 = HEAP32[(31416)>>2]|0;
- _glVertexAttribPointer(($64|0),4,5121,1,0,(0|0));
- $65 = HEAP32[(31416)>>2]|0;
- _glEnableVertexAttribArray(($65|0));
- $66 = HEAP32[(32636)>>2]|0;
- _glBindBuffer(34963,($66|0));
- } else {
- $55 = HEAP32[7828]|0;
- $56 = HEAP32[(32620)>>2]|0;
- FUNCTION_TABLE_vi[$55 & 31]($56);
- }
- $67 = HEAP32[7864]|0;
- $68 = ($67|0)>(0);
- if ($68) {
- $$02830 = 0;$$031 = 0;
- while(1) {
- $71 = HEAP32[7863]|0;
- $72 = (($71) + (($$031*144)|0)|0);
- $73 = HEAP32[$72>>2]|0;
- $74 = (($73|0) / 4)&-1;
- $75 = ($74*6)|0;
- $76 = (((($71) + (($$031*144)|0)|0)) + 8|0);
- $77 = HEAP32[$76>>2]|0;
- _glBindTexture(3553,($77|0));
- $78 = $$02830 << 1;
- $79 = $78;
- _glDrawElements(4,($75|0),5123,($79|0));
- $80 = HEAP32[7863]|0;
- $81 = (($80) + (($$031*144)|0)|0);
- $82 = HEAP32[$81>>2]|0;
- $83 = (($82|0) / 4)&-1;
- $84 = ($83*6)|0;
- $85 = (($84) + ($$02830))|0;
- $86 = (($$031) + 1)|0;
- $87 = HEAP32[7864]|0;
- $88 = ($86|0)<($87|0);
- if ($88) {
- $$02830 = $85;$$031 = $86;
- } else {
- break;
- }
- }
- }
- $69 = HEAP32[7826]|0;
- $70 = ($69|0)==(0);
- if ($70) {
- _glBindBuffer(34962,0);
- _glBindBuffer(34963,0);
- }
- _glBindTexture(3553,0);
- }
- $89 = HEAP32[7826]|0;
- $90 = ($89|0)==(0);
- if (!($90)) {
- $91 = HEAP32[7828]|0;
- FUNCTION_TABLE_vi[$91 & 31](0);
- }
- _glUseProgram(0);
- $92 = (($$02932) + 1)|0;
- $93 = ($92|0)<($$|0);
- if ($93) {
- $$02932 = $92;
- } else {
- break;
- }
- }
- HEAP32[7864] = 1;
- $5 = HEAP32[7833]|0;
- $6 = HEAP32[7863]|0;
- $7 = ((($6)) + 8|0);
- HEAP32[$7>>2] = $5;
- HEAP32[$6>>2] = 0;
- HEAP32[8124] = 0;
- HEAP32[(32504)>>2] = 0;
- HEAP32[8136] = 0;
- HEAP32[(32552)>>2] = 0;
- HEAP32[8148] = 0;
- HEAP32[(32596)>>2] = 0;
- HEAP32[(32600)>>2] = 0;
- HEAPF32[746] = -1.0;
- dest=31172; 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));
- dest=31236; 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));
- STACKTOP = sp;return;
- }
- function _SetStereoView($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 256|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(256|0);
- $$byval_copy3 = sp + 192|0;
- $$byval_copy = sp + 64|0;
- $3 = sp;
- $4 = sp + 128|0;
- 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));
- $5 = HEAP32[8122]|0;
- $6 = Math_imul($5, $0)|0;
- $7 = (($6|0) / 2)&-1;
- $8 = (($5|0) / 2)&-1;
- $9 = HEAP32[8123]|0;
- _rlViewport($7,0,$8,$9);
- $10 = (33076 + ($0<<6)|0);
- 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));
- 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));
- _MatrixMultiply($4,$$byval_copy,$$byval_copy3);
- $11 = (32948 + ($0<<6)|0);
- 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));
- 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));
- _SetMatrixModelview($$byval_copy3);
- 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));
- _SetMatrixProjection($$byval_copy3);
- STACKTOP = sp;return;
- }
- function _SetMatrixModelview($0) {
- $0 = $0|0;
- var dest = 0, label = 0, sp = 0, src = 0, stop = 0;
- sp = STACKTOP;
- dest=31236; 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));
- return;
- }
- function _SetMatrixProjection($0) {
- $0 = $0|0;
- var dest = 0, label = 0, sp = 0, src = 0, stop = 0;
- sp = STACKTOP;
- dest=31172; 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));
- return;
- }
- function _rlPushMatrix() {
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $vararg_buffer = sp;
- $0 = HEAP32[8301]|0;
- $1 = ($0|0)==(15);
- if ($1) {
- HEAP32[$vararg_buffer>>2] = 16;
- _TraceLog(1,8073,$vararg_buffer);
- }
- $2 = HEAP32[8301]|0;
- $3 = (31464 + ($2<<6)|0);
- $4 = HEAP32[7792]|0;
- 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));
- _rlLoadIdentity();
- $5 = HEAP32[8301]|0;
- $6 = (($5) + 1)|0;
- HEAP32[8301] = $6;
- $7 = HEAP32[7825]|0;
- $8 = ($7|0)==(5888);
- if (!($8)) {
- STACKTOP = sp;return;
- }
- HEAP32[8302] = 1;
- STACKTOP = sp;return;
- }
- function _rlPopMatrix() {
- var $0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = HEAP32[8301]|0;
- $1 = ($0|0)>(0);
- if (!($1)) {
- return;
- }
- $2 = HEAP32[8301]|0;
- $3 = (($2) + -1)|0;
- $4 = (31464 + ($3<<6)|0);
- $5 = HEAP32[7792]|0;
- _memmove(($5|0),($4|0),64)|0;
- $6 = (($2) + -1)|0;
- HEAP32[8301] = $6;
- return;
- }
- function _GetFPS() {
- var $0 = 0.0, $1 = 0.0, $2 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = (+_GetFrameTime());
- $1 = 1.0 / $0;
- $2 = (~~(($1)));
- return ($2|0);
- }
- function _GetFrameTime() {
- var $0 = 0.0, $1 = 0.0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = +HEAPF64[1782];
- $1 = $0;
- return (+$1);
- }
- function _SetConfigFlags($0) {
- $0 = $0|0;
- var $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- HEAP8[35952] = $0;
- $1 = $0 & 1;
- $2 = ($1<<24>>24)==(0);
- if (!($2)) {
- HEAP32[7750] = 1;
- }
- $3 = HEAP8[35952]|0;
- $4 = $3 & 2;
- $5 = ($4<<24>>24)==(0);
- if ($5) {
- return;
- }
- HEAP32[7787] = 1;
- return;
- }
- function _IsKeyPressed($0) {
- $0 = $0|0;
- var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $or$cond = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = (35959 + ($0)|0);
- $2 = HEAP8[$1>>0]|0;
- $3 = (36471 + ($0)|0);
- $4 = HEAP8[$3>>0]|0;
- $5 = ($2<<24>>24)!=($4<<24>>24);
- $6 = ($2<<24>>24)==(1);
- $or$cond = $6 & $5;
- $$0 = $or$cond&1;
- return ($$0|0);
- }
- function _rlTranslatef($0,$1,$2) {
- $0 = +$0;
- $1 = +$1;
- $2 = +$2;
- var $$byval_copy = 0, $$byval_copy1 = 0, $3 = 0, $4 = 0, $5 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 256|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(256|0);
- $$byval_copy1 = sp + 192|0;
- $$byval_copy = sp + 128|0;
- $3 = sp + 64|0;
- $4 = sp;
- _MatrixTranslate($3,$0,$1,$2);
- _MatrixTranspose($3);
- $5 = HEAP32[7792]|0;
- 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));
- 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));
- _MatrixMultiply($4,$$byval_copy,$$byval_copy1);
- 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));
- STACKTOP = sp;return;
- }
- function _rlRotatef($0,$1,$2,$3) {
- $0 = +$0;
- $1 = +$1;
- $2 = +$2;
- $3 = +$3;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 336|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(336|0);
- $$byval_copy2 = sp + 272|0;
- $$byval_copy1 = sp + 208|0;
- $4 = sp + 144|0;
- $5 = sp + 64|0;
- $6 = sp + 80|0;
- $7 = sp;
- _MatrixIdentity($4);
- HEAPF32[$5>>2] = $1;
- $8 = ((($5)) + 4|0);
- HEAPF32[$8>>2] = $2;
- $9 = ((($5)) + 8|0);
- HEAPF32[$9>>2] = $3;
- _VectorNormalize($5);
- $10 = $0 * 0.01745329238474369;
- ;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;
- _MatrixRotate($6,$$byval_copy2,$10);
- 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));
- _MatrixTranspose($4);
- $11 = HEAP32[7792]|0;
- 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));
- 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));
- _MatrixMultiply($7,$$byval_copy1,$$byval_copy2);
- 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));
- STACKTOP = sp;return;
- }
- function _rlBegin($0) {
- $0 = $0|0;
- var label = 0, sp = 0;
- sp = STACKTOP;
- HEAP32[7865] = $0;
- return;
- }
- function _rlEnd() {
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- var $scevgep = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
- $$byval_copy = sp;
- $0 = HEAP32[8302]|0;
- $1 = ($0|0)==(0);
- if (!($1)) {
- $2 = HEAP32[8303]|0;
- $3 = ($2|0)>(0);
- if ($3) {
- $$03956 = 0;
- while(1) {
- $6 = HEAP32[7862]|0;
- $7 = (($6) + (($$03956*12)|0)|0);
- $8 = HEAP32[7792]|0;
- 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));
- _VectorTransform($7,$$byval_copy);
- $9 = (($$03956) + 1)|0;
- $5 = HEAP32[8303]|0;
- $10 = ($9|0)<($5|0);
- if ($10) {
- $$03956 = $9;
- } else {
- break;
- }
- }
- HEAP32[8302] = 0;
- $4 = ($5|0)>(0);
- if ($4) {
- $$04154 = 0;
- while(1) {
- $11 = HEAP32[7862]|0;
- $12 = (($11) + (($$04154*12)|0)|0);
- $13 = +HEAPF32[$12>>2];
- $14 = (((($11) + (($$04154*12)|0)|0)) + 4|0);
- $15 = +HEAPF32[$14>>2];
- $16 = (((($11) + (($$04154*12)|0)|0)) + 8|0);
- $17 = +HEAPF32[$16>>2];
- _rlVertex3f($13,$15,$17);
- $18 = (($$04154) + 1)|0;
- $19 = HEAP32[8303]|0;
- $20 = ($18|0)<($19|0);
- if ($20) {
- $$04154 = $18;
- } else {
- break;
- }
- }
- }
- } else {
- HEAP32[8302] = 0;
- }
- HEAP32[8303] = 0;
- }
- $21 = HEAP32[7865]|0;
- switch ($21|0) {
- case 1: {
- $22 = HEAP32[8124]|0;
- $23 = HEAP32[(32504)>>2]|0;
- $24 = ($22|0)==($23|0);
- if ($24) {
- $148 = +HEAPF32[746];
- $149 = $148 + 4.9999998736893758E-5;
- HEAPF32[746] = $149;
- STACKTOP = sp;return;
- }
- $25 = (($22) - ($23))|0;
- $26 = ($25|0)>(0);
- if ($26) {
- $$04347 = 0;
- } else {
- $148 = +HEAPF32[746];
- $149 = $148 + 4.9999998736893758E-5;
- HEAPF32[746] = $149;
- STACKTOP = sp;return;
- }
- while(1) {
- $27 = HEAP32[(32516)>>2]|0;
- $28 = HEAP32[(32504)>>2]|0;
- $29 = $28 << 2;
- $30 = (($29) + -4)|0;
- $31 = (($27) + ($30)|0);
- $32 = HEAP8[$31>>0]|0;
- $33 = (($27) + ($29)|0);
- HEAP8[$33>>0] = $32;
- $34 = HEAP32[(32516)>>2]|0;
- $35 = HEAP32[(32504)>>2]|0;
- $36 = $35 << 2;
- $37 = (($36) + -3)|0;
- $38 = (($34) + ($37)|0);
- $39 = HEAP8[$38>>0]|0;
- $40 = $36 | 1;
- $41 = (($34) + ($40)|0);
- HEAP8[$41>>0] = $39;
- $42 = HEAP32[(32516)>>2]|0;
- $43 = HEAP32[(32504)>>2]|0;
- $44 = $43 << 2;
- $45 = (($44) + -2)|0;
- $46 = (($42) + ($45)|0);
- $47 = HEAP8[$46>>0]|0;
- $48 = $44 | 2;
- $49 = (($42) + ($48)|0);
- HEAP8[$49>>0] = $47;
- $50 = HEAP32[(32516)>>2]|0;
- $51 = HEAP32[(32504)>>2]|0;
- $52 = $51 << 2;
- $53 = (($52) + -1)|0;
- $54 = (($50) + ($53)|0);
- $55 = HEAP8[$54>>0]|0;
- $56 = $52 | 3;
- $57 = (($50) + ($56)|0);
- HEAP8[$57>>0] = $55;
- $58 = HEAP32[(32504)>>2]|0;
- $59 = (($58) + 1)|0;
- HEAP32[(32504)>>2] = $59;
- $60 = (($$04347) + 1)|0;
- $exitcond = ($60|0)==($25|0);
- if ($exitcond) {
- break;
- } else {
- $$04347 = $60;
- }
- }
- $148 = +HEAPF32[746];
- $149 = $148 + 4.9999998736893758E-5;
- HEAPF32[746] = $149;
- STACKTOP = sp;return;
- break;
- }
- case 4: {
- $61 = HEAP32[8136]|0;
- $62 = HEAP32[(32552)>>2]|0;
- $63 = ($61|0)==($62|0);
- if ($63) {
- $148 = +HEAPF32[746];
- $149 = $148 + 4.9999998736893758E-5;
- HEAPF32[746] = $149;
- STACKTOP = sp;return;
- }
- $64 = (($61) - ($62))|0;
- $65 = ($64|0)>(0);
- if ($65) {
- $$04248 = 0;
- } else {
- $148 = +HEAPF32[746];
- $149 = $148 + 4.9999998736893758E-5;
- HEAPF32[746] = $149;
- STACKTOP = sp;return;
- }
- while(1) {
- $66 = HEAP32[(32564)>>2]|0;
- $67 = HEAP32[(32552)>>2]|0;
- $68 = $67 << 2;
- $69 = (($68) + -4)|0;
- $70 = (($66) + ($69)|0);
- $71 = HEAP8[$70>>0]|0;
- $72 = (($66) + ($68)|0);
- HEAP8[$72>>0] = $71;
- $73 = HEAP32[(32564)>>2]|0;
- $74 = HEAP32[(32552)>>2]|0;
- $75 = $74 << 2;
- $76 = (($75) + -3)|0;
- $77 = (($73) + ($76)|0);
- $78 = HEAP8[$77>>0]|0;
- $79 = $75 | 1;
- $80 = (($73) + ($79)|0);
- HEAP8[$80>>0] = $78;
- $81 = HEAP32[(32564)>>2]|0;
- $82 = HEAP32[(32552)>>2]|0;
- $83 = $82 << 2;
- $84 = (($83) + -2)|0;
- $85 = (($81) + ($84)|0);
- $86 = HEAP8[$85>>0]|0;
- $87 = $83 | 2;
- $88 = (($81) + ($87)|0);
- HEAP8[$88>>0] = $86;
- $89 = HEAP32[(32564)>>2]|0;
- $90 = HEAP32[(32552)>>2]|0;
- $91 = $90 << 2;
- $92 = (($91) + -1)|0;
- $93 = (($89) + ($92)|0);
- $94 = HEAP8[$93>>0]|0;
- $95 = $91 | 3;
- $96 = (($89) + ($95)|0);
- HEAP8[$96>>0] = $94;
- $97 = HEAP32[(32552)>>2]|0;
- $98 = (($97) + 1)|0;
- HEAP32[(32552)>>2] = $98;
- $99 = (($$04248) + 1)|0;
- $exitcond60 = ($99|0)==($64|0);
- if ($exitcond60) {
- break;
- } else {
- $$04248 = $99;
- }
- }
- $148 = +HEAPF32[746];
- $149 = $148 + 4.9999998736893758E-5;
- HEAPF32[746] = $149;
- STACKTOP = sp;return;
- break;
- }
- case 7: {
- $100 = HEAP32[8148]|0;
- $101 = HEAP32[(32600)>>2]|0;
- $102 = ($100|0)==($101|0);
- if (!($102)) {
- $103 = (($100) - ($101))|0;
- $104 = ($103|0)>(0);
- if ($104) {
- $$04052 = 0;
- while(1) {
- $105 = HEAP32[(32612)>>2]|0;
- $106 = HEAP32[(32600)>>2]|0;
- $107 = $106 << 2;
- $108 = (($107) + -4)|0;
- $109 = (($105) + ($108)|0);
- $110 = HEAP8[$109>>0]|0;
- $111 = (($105) + ($107)|0);
- HEAP8[$111>>0] = $110;
- $112 = HEAP32[(32612)>>2]|0;
- $113 = HEAP32[(32600)>>2]|0;
- $114 = $113 << 2;
- $115 = (($114) + -3)|0;
- $116 = (($112) + ($115)|0);
- $117 = HEAP8[$116>>0]|0;
- $118 = $114 | 1;
- $119 = (($112) + ($118)|0);
- HEAP8[$119>>0] = $117;
- $120 = HEAP32[(32612)>>2]|0;
- $121 = HEAP32[(32600)>>2]|0;
- $122 = $121 << 2;
- $123 = (($122) + -2)|0;
- $124 = (($120) + ($123)|0);
- $125 = HEAP8[$124>>0]|0;
- $126 = $122 | 2;
- $127 = (($120) + ($126)|0);
- HEAP8[$127>>0] = $125;
- $128 = HEAP32[(32612)>>2]|0;
- $129 = HEAP32[(32600)>>2]|0;
- $130 = $129 << 2;
- $131 = (($130) + -1)|0;
- $132 = (($128) + ($131)|0);
- $133 = HEAP8[$132>>0]|0;
- $134 = $130 | 3;
- $135 = (($128) + ($134)|0);
- HEAP8[$135>>0] = $133;
- $136 = HEAP32[(32600)>>2]|0;
- $137 = (($136) + 1)|0;
- HEAP32[(32600)>>2] = $137;
- $138 = (($$04052) + 1)|0;
- $exitcond63 = ($138|0)==($103|0);
- if ($exitcond63) {
- break;
- } else {
- $$04052 = $138;
- }
- }
- }
- }
- $139 = HEAP32[8148]|0;
- $140 = HEAP32[(32596)>>2]|0;
- $141 = ($139|0)>($140|0);
- if (!($141)) {
- $148 = +HEAPF32[746];
- $149 = $148 + 4.9999998736893758E-5;
- HEAPF32[746] = $149;
- STACKTOP = sp;return;
- }
- $142 = HEAP32[(32608)>>2]|0;
- $$promoted = HEAP32[(32596)>>2]|0;
- $143 = $$promoted << 1;
- $scevgep = (($142) + ($143<<2)|0);
- $144 = (($139) - ($140))|0;
- $145 = $144 << 3;
- _memset(($scevgep|0),0,($145|0))|0;
- $146 = (($139) + ($$promoted))|0;
- $147 = (($146) - ($140))|0;
- HEAP32[(32596)>>2] = $147;
- $148 = +HEAPF32[746];
- $149 = $148 + 4.9999998736893758E-5;
- HEAPF32[746] = $149;
- STACKTOP = sp;return;
- break;
- }
- default: {
- $148 = +HEAPF32[746];
- $149 = $148 + 4.9999998736893758E-5;
- HEAPF32[746] = $149;
- STACKTOP = sp;return;
- }
- }
- }
- function _rlVertex3f($0,$1,$2) {
- $0 = +$0;
- $1 = +$1;
- $2 = +$2;
- 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;
- 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;
- var $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $vararg_buffer = 0, $vararg_buffer1 = 0, $vararg_buffer3 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
- $vararg_buffer3 = sp + 16|0;
- $vararg_buffer1 = sp + 8|0;
- $vararg_buffer = sp;
- $3 = HEAP32[8302]|0;
- $4 = ($3|0)==(0);
- if (!($4)) {
- $5 = HEAP32[7862]|0;
- $6 = HEAP32[8303]|0;
- $7 = (($5) + (($6*12)|0)|0);
- HEAPF32[$7>>2] = $0;
- $8 = (((($5) + (($6*12)|0)|0)) + 4|0);
- HEAPF32[$8>>2] = $1;
- $9 = (((($5) + (($6*12)|0)|0)) + 8|0);
- HEAPF32[$9>>2] = $2;
- $10 = (($6) + 1)|0;
- HEAP32[8303] = $10;
- STACKTOP = sp;return;
- }
- $11 = HEAP32[7865]|0;
- switch ($11|0) {
- case 1: {
- $12 = HEAP32[8124]|0;
- $13 = ($12|0)<(2048);
- if ($13) {
- $14 = HEAP32[(32508)>>2]|0;
- $15 = ($12*3)|0;
- $16 = (($14) + ($15<<2)|0);
- HEAPF32[$16>>2] = $0;
- $17 = (($15) + 1)|0;
- $18 = (($14) + ($17<<2)|0);
- HEAPF32[$18>>2] = $1;
- $19 = (($15) + 2)|0;
- $20 = (($14) + ($19<<2)|0);
- HEAPF32[$20>>2] = $2;
- $21 = (($12) + 1)|0;
- HEAP32[8124] = $21;
- STACKTOP = sp;return;
- } else {
- _TraceLog(1,8111,$vararg_buffer);
- STACKTOP = sp;return;
- }
- break;
- }
- case 4: {
- $22 = HEAP32[8136]|0;
- $23 = ($22|0)<(6144);
- if ($23) {
- $24 = HEAP32[(32556)>>2]|0;
- $25 = ($22*3)|0;
- $26 = (($24) + ($25<<2)|0);
- HEAPF32[$26>>2] = $0;
- $27 = (($25) + 1)|0;
- $28 = (($24) + ($27<<2)|0);
- HEAPF32[$28>>2] = $1;
- $29 = (($25) + 2)|0;
- $30 = (($24) + ($29<<2)|0);
- HEAPF32[$30>>2] = $2;
- $31 = (($22) + 1)|0;
- HEAP32[8136] = $31;
- STACKTOP = sp;return;
- } else {
- _TraceLog(1,8136,$vararg_buffer1);
- STACKTOP = sp;return;
- }
- break;
- }
- case 7: {
- $32 = HEAP32[8148]|0;
- $33 = ($32|0)<(4096);
- if ($33) {
- $34 = HEAP32[(32604)>>2]|0;
- $35 = ($32*3)|0;
- $36 = (($34) + ($35<<2)|0);
- HEAPF32[$36>>2] = $0;
- $37 = (($35) + 1)|0;
- $38 = (($34) + ($37<<2)|0);
- HEAPF32[$38>>2] = $1;
- $39 = (($35) + 2)|0;
- $40 = (($34) + ($39<<2)|0);
- HEAPF32[$40>>2] = $2;
- $41 = (($32) + 1)|0;
- HEAP32[8148] = $41;
- $42 = HEAP32[7863]|0;
- $43 = HEAP32[7864]|0;
- $44 = (($43) + -1)|0;
- $45 = (($42) + (($44*144)|0)|0);
- $46 = HEAP32[$45>>2]|0;
- $47 = (($46) + 1)|0;
- HEAP32[$45>>2] = $47;
- STACKTOP = sp;return;
- } else {
- _TraceLog(1,8165,$vararg_buffer3);
- STACKTOP = sp;return;
- }
- break;
- }
- default: {
- STACKTOP = sp;return;
- }
- }
- }
- function _rlVertex2f($0,$1) {
- $0 = +$0;
- $1 = +$1;
- var $2 = 0.0, label = 0, sp = 0;
- sp = STACKTOP;
- $2 = +HEAPF32[746];
- _rlVertex3f($0,$1,$2);
- return;
- }
- function _rlTexCoord2f($0,$1) {
- $0 = +$0;
- $1 = +$1;
- var $10 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $2 = HEAP32[7865]|0;
- $3 = ($2|0)==(7);
- if (!($3)) {
- return;
- }
- $4 = HEAP32[(32608)>>2]|0;
- $5 = HEAP32[(32596)>>2]|0;
- $6 = $5 << 1;
- $7 = (($4) + ($6<<2)|0);
- HEAPF32[$7>>2] = $0;
- $8 = $6 | 1;
- $9 = (($4) + ($8<<2)|0);
- HEAPF32[$9>>2] = $1;
- $10 = (($5) + 1)|0;
- HEAP32[(32596)>>2] = $10;
- return;
- }
- function _rlNormal3f($0,$1,$2) {
- $0 = +$0;
- $1 = +$1;
- $2 = +$2;
- var label = 0, sp = 0;
- sp = STACKTOP;
- return;
- }
- function _rlColor4ub($0,$1,$2,$3) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- 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;
- var $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $4 = HEAP32[7865]|0;
- switch ($4|0) {
- case 1: {
- $$sink37 = (32504);$$sink38 = (32516);
- break;
- }
- case 4: {
- $$sink37 = (32552);$$sink38 = (32564);
- break;
- }
- case 7: {
- $$sink37 = (32600);$$sink38 = (32612);
- break;
- }
- default: {
- return;
- }
- }
- $5 = HEAP32[$$sink38>>2]|0;
- $6 = HEAP32[$$sink37>>2]|0;
- $7 = $6 << 2;
- $8 = (($5) + ($7)|0);
- HEAP8[$8>>0] = $0;
- $9 = HEAP32[$$sink38>>2]|0;
- $10 = HEAP32[$$sink37>>2]|0;
- $11 = $10 << 2;
- $12 = $11 | 1;
- $13 = (($9) + ($12)|0);
- HEAP8[$13>>0] = $1;
- $14 = HEAP32[$$sink38>>2]|0;
- $15 = HEAP32[$$sink37>>2]|0;
- $16 = $15 << 2;
- $17 = $16 | 2;
- $18 = (($14) + ($17)|0);
- HEAP8[$18>>0] = $2;
- $19 = HEAP32[$$sink38>>2]|0;
- $20 = HEAP32[$$sink37>>2]|0;
- $21 = $20 << 2;
- $22 = $21 | 3;
- $23 = (($19) + ($22)|0);
- HEAP8[$23>>0] = $3;
- $24 = HEAP32[$$sink37>>2]|0;
- $25 = (($24) + 1)|0;
- HEAP32[$$sink37>>2] = $25;
- return;
- }
- function _rlEnableTexture($0) {
- $0 = $0|0;
- 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;
- sp = STACKTOP;
- $1 = HEAP32[7863]|0;
- $2 = HEAP32[7864]|0;
- $3 = (($2) + -1)|0;
- $4 = (((($1) + (($3*144)|0)|0)) + 8|0);
- $5 = HEAP32[$4>>2]|0;
- $6 = ($5|0)==($0|0);
- if ($6) {
- return;
- }
- $7 = (($1) + (($3*144)|0)|0);
- $8 = HEAP32[$7>>2]|0;
- $9 = ($8|0)>(0);
- if ($9) {
- $10 = (($2) + 1)|0;
- HEAP32[7864] = $10;
- }
- $11 = HEAP32[7864]|0;
- $12 = (($11) + -1)|0;
- $13 = (((($1) + (($12*144)|0)|0)) + 8|0);
- HEAP32[$13>>2] = $0;
- $14 = (($1) + (($12*144)|0)|0);
- HEAP32[$14>>2] = 0;
- return;
- }
- function _rlDisableTexture() {
- var $0 = 0, $1 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = HEAP32[8148]|0;
- $1 = ($0|0)>(4095);
- if (!($1)) {
- return;
- }
- _rlglDraw();
- return;
- }
- function _DrawLineV($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- sp = STACKTOP;
- _rlBegin(1);
- $3 = HEAP8[$2>>0]|0;
- $4 = ((($2)) + 1|0);
- $5 = HEAP8[$4>>0]|0;
- $6 = ((($2)) + 2|0);
- $7 = HEAP8[$6>>0]|0;
- $8 = ((($2)) + 3|0);
- $9 = HEAP8[$8>>0]|0;
- _rlColor4ub($3,$5,$7,$9);
- $10 = +HEAPF32[$0>>2];
- $11 = ((($0)) + 4|0);
- $12 = +HEAPF32[$11>>2];
- _rlVertex2f($10,$12);
- $13 = +HEAPF32[$1>>2];
- $14 = ((($1)) + 4|0);
- $15 = +HEAPF32[$14>>2];
- _rlVertex2f($13,$15);
- _rlEnd();
- return;
- }
- function _GetDefaultFont($0) {
- $0 = $0|0;
- var label = 0, sp = 0;
- sp = STACKTOP;
- ;HEAP32[$0>>2]=HEAP32[31020>>2]|0;HEAP32[$0+4>>2]=HEAP32[31020+4>>2]|0;HEAP32[$0+8>>2]=HEAP32[31020+8>>2]|0;HEAP32[$0+12>>2]=HEAP32[31020+12>>2]|0;HEAP32[$0+16>>2]=HEAP32[31020+16>>2]|0;HEAP32[$0+20>>2]=HEAP32[31020+20>>2]|0;HEAP32[$0+24>>2]=HEAP32[31020+24>>2]|0;HEAP32[$0+28>>2]=HEAP32[31020+28>>2]|0;
- return;
- }
- function _MeasureTextEx($0,$1,$2,$3,$4) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = +$3;
- $4 = $4|0;
- 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;
- 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;
- 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;
- var sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
- $$byval_copy = sp;
- $5 = (_strlen($2)|0);
- $6 = ((($1)) + 20|0);
- $7 = HEAP32[$6>>2]|0;
- $8 = (+($7|0));
- $9 = $3 / $8;
- $10 = ($5|0)>(0);
- if (!($10)) {
- $$0$lcssa = -1;$$052$lcssa = 0.0;$$055$lcssa = 0.0;$$058$lcssa = $8;
- $12 = $$055$lcssa < $$052$lcssa;
- $$3 = $12 ? $$052$lcssa : $$055$lcssa;
- $13 = $9 * $$3;
- $14 = Math_imul($$0$lcssa, $4)|0;
- $15 = (+($14|0));
- $16 = $13 + $15;
- $17 = $9 * $$058$lcssa;
- HEAPF32[$0>>2] = $16;
- $$sroa$4$0$$sroa_idx2 = ((($0)) + 4|0);
- HEAPF32[$$sroa$4$0$$sroa_idx2>>2] = $17;
- STACKTOP = sp;return;
- }
- $11 = ((($1)) + 28|0);
- $$05064 = 0;$$05263 = 0.0;$$05462 = 0;$$05561 = 0.0;$$05860 = $8;$$065 = 0;
- while(1) {
- $18 = (($$05064) + 1)|0;
- $19 = (($2) + ($$05462)|0);
- $20 = HEAP8[$19>>0]|0;
- $21 = ($20<<24>>24)==(10);
- if ($21) {
- $33 = $$05561 < $$05263;
- $$156 = $33 ? $$05263 : $$05561;
- $34 = HEAP32[$6>>2]|0;
- $35 = (+($34|0));
- $36 = $35 * 1.5;
- $37 = $$05860 + $36;
- $$151 = 0;$$159 = $37;$$2 = 0.0;$$257 = $$156;
- } else {
- $22 = $20 << 24 >> 24;
- ;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;
- $23 = (_GetCharIndex($$byval_copy,$22)|0);
- $24 = HEAP32[$11>>2]|0;
- $25 = (((($24) + ($23<<5)|0)) + 28|0);
- $26 = HEAP32[$25>>2]|0;
- $27 = ($26|0)==(0);
- if ($27) {
- $28 = (((($24) + ($23<<5)|0)) + 20|0);
- $29 = (((($24) + ($23<<5)|0)) + 12|0);
- $30 = HEAP32[$29>>2]|0;
- $31 = HEAP32[$28>>2]|0;
- $32 = (($31) + ($30))|0;
- $$pn$in = $32;
- } else {
- $$pn$in = $26;
- }
- $$pn = (+($$pn$in|0));
- $$153 = $$05263 + $$pn;
- $$151 = $18;$$159 = $$05860;$$2 = $$153;$$257 = $$05561;
- }
- $38 = ($$065|0)<($$151|0);
- $$151$$0 = $38 ? $$151 : $$065;
- $39 = (($$05462) + 1)|0;
- $exitcond = ($39|0)==($5|0);
- if ($exitcond) {
- break;
- } else {
- $$05064 = $$151;$$05263 = $$2;$$05462 = $39;$$05561 = $$257;$$05860 = $$159;$$065 = $$151$$0;
- }
- }
- $phitmp = (($$151$$0) + -1)|0;
- $$0$lcssa = $phitmp;$$052$lcssa = $$2;$$055$lcssa = $$257;$$058$lcssa = $$159;
- $12 = $$055$lcssa < $$052$lcssa;
- $$3 = $12 ? $$052$lcssa : $$055$lcssa;
- $13 = $9 * $$3;
- $14 = Math_imul($$0$lcssa, $4)|0;
- $15 = (+($14|0));
- $16 = $13 + $15;
- $17 = $9 * $$058$lcssa;
- HEAPF32[$0>>2] = $16;
- $$sroa$4$0$$sroa_idx2 = ((($0)) + 4|0);
- HEAPF32[$$sroa$4$0$$sroa_idx2>>2] = $17;
- STACKTOP = sp;return;
- }
- function _GetCharIndex($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- sp = STACKTOP;
- $2 = ((($0)) + 24|0);
- $3 = HEAP32[$2>>2]|0;
- $4 = ($3|0)>(0);
- if (!($4)) {
- $$08 = 0;
- return ($$08|0);
- }
- $5 = ((($0)) + 28|0);
- $6 = HEAP32[$5>>2]|0;
- $$09 = 0;
- while(1) {
- $7 = (($6) + ($$09<<5)|0);
- $8 = HEAP32[$7>>2]|0;
- $9 = ($8|0)==($1|0);
- if ($9) {
- $$08 = $$09;
- label = 5;
- break;
- }
- $10 = (($$09) + 1)|0;
- $11 = HEAP32[$2>>2]|0;
- $12 = ($10|0)<($11|0);
- if ($12) {
- $$09 = $10;
- } else {
- $$08 = 0;
- label = 5;
- break;
- }
- }
- if ((label|0) == 5) {
- return ($$08|0);
- }
- return (0)|0;
- }
- function _DrawTexturePro($0,$1,$2,$3,$4,$5) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- $4 = +$4;
- $5 = $5|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- $6 = HEAP32[$0>>2]|0;
- $7 = ($6|0)==(0);
- if ($7) {
- return;
- }
- $8 = ((($1)) + 8|0);
- $9 = HEAP32[$8>>2]|0;
- $10 = ($9|0)<(0);
- if ($10) {
- $11 = HEAP32[$1>>2]|0;
- $12 = (($11) - ($9))|0;
- HEAP32[$1>>2] = $12;
- }
- $13 = ((($1)) + 12|0);
- $14 = HEAP32[$13>>2]|0;
- $15 = ($14|0)<(0);
- if ($15) {
- $16 = ((($1)) + 4|0);
- $17 = HEAP32[$16>>2]|0;
- $18 = (($17) - ($14))|0;
- HEAP32[$16>>2] = $18;
- }
- $19 = HEAP32[$0>>2]|0;
- _rlEnableTexture($19);
- _rlPushMatrix();
- $20 = HEAP32[$2>>2]|0;
- $21 = (+($20|0));
- $22 = ((($2)) + 4|0);
- $23 = HEAP32[$22>>2]|0;
- $24 = (+($23|0));
- _rlTranslatef($21,$24,0.0);
- _rlRotatef($4,0.0,0.0,1.0);
- $25 = +HEAPF32[$3>>2];
- $26 = -$25;
- $27 = ((($3)) + 4|0);
- $28 = +HEAPF32[$27>>2];
- $29 = -$28;
- _rlTranslatef($26,$29,0.0);
- _rlBegin(7);
- $30 = HEAP8[$5>>0]|0;
- $31 = ((($5)) + 1|0);
- $32 = HEAP8[$31>>0]|0;
- $33 = ((($5)) + 2|0);
- $34 = HEAP8[$33>>0]|0;
- $35 = ((($5)) + 3|0);
- $36 = HEAP8[$35>>0]|0;
- _rlColor4ub($30,$32,$34,$36);
- $37 = HEAP32[$1>>2]|0;
- $38 = (+($37|0));
- $39 = ((($0)) + 4|0);
- $40 = HEAP32[$39>>2]|0;
- $41 = (+($40|0));
- $42 = $38 / $41;
- $43 = ((($1)) + 4|0);
- $44 = HEAP32[$43>>2]|0;
- $45 = (+($44|0));
- $46 = ((($0)) + 8|0);
- $47 = HEAP32[$46>>2]|0;
- $48 = (+($47|0));
- $49 = $45 / $48;
- _rlTexCoord2f($42,$49);
- _rlVertex2f(0.0,0.0);
- $50 = HEAP32[$1>>2]|0;
- $51 = (+($50|0));
- $52 = HEAP32[$39>>2]|0;
- $53 = (+($52|0));
- $54 = $51 / $53;
- $55 = HEAP32[$43>>2]|0;
- $56 = HEAP32[$13>>2]|0;
- $57 = (($56) + ($55))|0;
- $58 = (+($57|0));
- $59 = HEAP32[$46>>2]|0;
- $60 = (+($59|0));
- $61 = $58 / $60;
- _rlTexCoord2f($54,$61);
- $62 = ((($2)) + 12|0);
- $63 = HEAP32[$62>>2]|0;
- $64 = (+($63|0));
- _rlVertex2f(0.0,$64);
- $65 = HEAP32[$1>>2]|0;
- $66 = HEAP32[$8>>2]|0;
- $67 = (($66) + ($65))|0;
- $68 = (+($67|0));
- $69 = HEAP32[$39>>2]|0;
- $70 = (+($69|0));
- $71 = $68 / $70;
- $72 = HEAP32[$43>>2]|0;
- $73 = HEAP32[$13>>2]|0;
- $74 = (($73) + ($72))|0;
- $75 = (+($74|0));
- $76 = HEAP32[$46>>2]|0;
- $77 = (+($76|0));
- $78 = $75 / $77;
- _rlTexCoord2f($71,$78);
- $79 = ((($2)) + 8|0);
- $80 = HEAP32[$79>>2]|0;
- $81 = (+($80|0));
- $82 = HEAP32[$62>>2]|0;
- $83 = (+($82|0));
- _rlVertex2f($81,$83);
- $84 = HEAP32[$1>>2]|0;
- $85 = HEAP32[$8>>2]|0;
- $86 = (($85) + ($84))|0;
- $87 = (+($86|0));
- $88 = HEAP32[$39>>2]|0;
- $89 = (+($88|0));
- $90 = $87 / $89;
- $91 = HEAP32[$43>>2]|0;
- $92 = (+($91|0));
- $93 = HEAP32[$46>>2]|0;
- $94 = (+($93|0));
- $95 = $92 / $94;
- _rlTexCoord2f($90,$95);
- $96 = HEAP32[$79>>2]|0;
- $97 = (+($96|0));
- _rlVertex2f($97,0.0);
- _rlEnd();
- _rlPopMatrix();
- _rlDisableTexture();
- return;
- }
- function _DrawText($0,$1,$2,$3,$4) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- $4 = $4|0;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 128|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(128|0);
- $$byval_copy2 = sp + 112|0;
- $$byval_copy1 = sp + 104|0;
- $$byval_copy = sp + 72|0;
- $5 = sp + 32|0;
- $6 = sp + 64|0;
- $7 = sp;
- _GetDefaultFont($5);
- $8 = HEAP32[$5>>2]|0;
- $9 = ($8|0)==(0);
- if ($9) {
- STACKTOP = sp;return;
- }
- $10 = (+($1|0));
- HEAPF32[$6>>2] = $10;
- $11 = ((($6)) + 4|0);
- $12 = (+($2|0));
- HEAPF32[$11>>2] = $12;
- $13 = ($3|0)>(10);
- $$ = $13 ? $3 : 10;
- $14 = (($$>>>0) / 10)&-1;
- _GetDefaultFont($7);
- $15 = (+($$|0));
- ;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;
- ;HEAP32[$$byval_copy1>>2]=HEAP32[$6>>2]|0;HEAP32[$$byval_copy1+4>>2]=HEAP32[$6+4>>2]|0;
- ;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;
- _DrawTextEx($$byval_copy,$0,$$byval_copy1,$15,$14,$$byval_copy2);
- STACKTOP = sp;return;
- }
- function _DrawTextEx($0,$1,$2,$3,$4,$5) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = +$3;
- $4 = $4|0;
- $5 = $5|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 128|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(128|0);
- $$byval_copy5 = sp + 88|0;
- $$byval_copy4 = sp + 80|0;
- $$byval_copy3 = sp + 64|0;
- $$byval_copy2 = sp + 48|0;
- $$byval_copy1 = sp + 24|0;
- $6 = sp + 8|0;
- $7 = sp;
- $8 = (_strlen($1)|0);
- $9 = ((($0)) + 20|0);
- $10 = HEAP32[$9>>2]|0;
- $11 = (+($10|0));
- $12 = $3 / $11;
- $13 = ($8|0)>(0);
- if (!($13)) {
- STACKTOP = sp;return;
- }
- $14 = ((($0)) + 28|0);
- $15 = +HEAPF32[$2>>2];
- $16 = ((($6)) + 4|0);
- $17 = ((($2)) + 4|0);
- $18 = ((($6)) + 8|0);
- $19 = ((($6)) + 12|0);
- $20 = ((($7)) + 4|0);
- $21 = (+($4|0));
- $$04954 = 0;$$05153 = 0;$$055 = 0;
- while(1) {
- $22 = (($1) + ($$055)|0);
- $23 = HEAP8[$22>>0]|0;
- switch ($23<<24>>24) {
- case 10: {
- $24 = HEAP32[$9>>2]|0;
- $25 = (($24|0) / 2)&-1;
- $26 = (($25) + ($24))|0;
- $27 = (+($26|0));
- $28 = $12 * $27;
- $29 = (~~(($28)));
- $30 = (($29) + ($$05153))|0;
- $$150 = 0;$$152 = $30;$$2 = $$055;
- break;
- }
- case -62: {
- $31 = (($$055) + 1)|0;
- $32 = (($1) + ($31)|0);
- $33 = HEAP8[$32>>0]|0;
- $34 = $33&255;
- $$1 = $31;$$sink = $34;
- label = 9;
- break;
- }
- case -61: {
- $35 = (($$055) + 1)|0;
- $36 = (($1) + ($35)|0);
- $37 = HEAP8[$36>>0]|0;
- $38 = $37&255;
- $39 = (($38) + 64)|0;
- $$1 = $35;$$sink = $39;
- label = 9;
- break;
- }
- default: {
- $40 = $23 << 24 >> 24;
- $$1 = $$055;$$sink = $40;
- label = 9;
- }
- }
- do {
- if ((label|0) == 9) {
- label = 0;
- ;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;
- $41 = (_GetCharIndex($$byval_copy5,$$sink)|0);
- $42 = HEAP32[$14>>2]|0;
- $43 = (((($42) + ($41<<5)|0)) + 4|0);
- $44 = (+($$04954|0));
- $45 = $44 + $15;
- $46 = (((($42) + ($41<<5)|0)) + 20|0);
- $47 = HEAP32[$46>>2]|0;
- $48 = (+($47|0));
- $49 = $12 * $48;
- $50 = $45 + $49;
- $51 = (~~(($50)));
- HEAP32[$6>>2] = $51;
- $52 = +HEAPF32[$17>>2];
- $53 = (+($$05153|0));
- $54 = $53 + $52;
- $55 = (((($42) + ($41<<5)|0)) + 24|0);
- $56 = HEAP32[$55>>2]|0;
- $57 = (+($56|0));
- $58 = $12 * $57;
- $59 = $54 + $58;
- $60 = (~~(($59)));
- HEAP32[$16>>2] = $60;
- $61 = (((($42) + ($41<<5)|0)) + 12|0);
- $62 = HEAP32[$61>>2]|0;
- $63 = (+($62|0));
- $64 = $12 * $63;
- $65 = (~~(($64)));
- HEAP32[$18>>2] = $65;
- $66 = (((($42) + ($41<<5)|0)) + 16|0);
- $67 = HEAP32[$66>>2]|0;
- $68 = (+($67|0));
- $69 = $12 * $68;
- $70 = (~~(($69)));
- HEAP32[$19>>2] = $70;
- HEAPF32[$7>>2] = 0.0;
- HEAPF32[$20>>2] = 0.0;
- ;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;
- ;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;
- ;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;
- ;HEAP32[$$byval_copy4>>2]=HEAP32[$7>>2]|0;HEAP32[$$byval_copy4+4>>2]=HEAP32[$7+4>>2]|0;
- ;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;
- _DrawTexturePro($$byval_copy1,$$byval_copy2,$$byval_copy3,$$byval_copy4,0.0,$$byval_copy5);
- $71 = HEAP32[$14>>2]|0;
- $72 = (((($71) + ($41<<5)|0)) + 28|0);
- $73 = HEAP32[$72>>2]|0;
- $74 = ($73|0)==(0);
- if ($74) {
- $75 = (((($71) + ($41<<5)|0)) + 12|0);
- $76 = HEAP32[$75>>2]|0;
- $77 = (+($76|0));
- $78 = $12 * $77;
- $79 = $21 + $78;
- $80 = (~~(($79)));
- $81 = (($80) + ($$04954))|0;
- $$150 = $81;$$152 = $$05153;$$2 = $$1;
- break;
- } else {
- $82 = (+($73|0));
- $83 = $12 * $82;
- $84 = $21 + $83;
- $85 = (~~(($84)));
- $86 = (($85) + ($$04954))|0;
- $$150 = $86;$$152 = $$05153;$$2 = $$1;
- break;
- }
- }
- } while(0);
- $87 = (($$2) + 1)|0;
- $88 = ($87|0)<($8|0);
- if ($88) {
- $$04954 = $$150;$$05153 = $$152;$$055 = $87;
- } else {
- break;
- }
- }
- STACKTOP = sp;return;
- }
- function _FormatText($0,$varargs) {
- $0 = $0|0;
- $varargs = $varargs|0;
- var $1 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $1 = sp;
- HEAP32[$1>>2] = $varargs;
- (_vsprintf(37239,$0,$1)|0);
- STACKTOP = sp;return (37239|0);
- }
- function _MeasureText($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 112|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(112|0);
- $$byval_copy = sp + 72|0;
- $2 = sp + 40|0;
- $3 = sp + 8|0;
- $4 = sp;
- _GetDefaultFont($2);
- $5 = HEAP32[$2>>2]|0;
- $6 = ($5|0)==(0);
- if ($6) {
- $$sroa$0$0 = 0;
- STACKTOP = sp;return ($$sroa$0$0|0);
- }
- $7 = ($1|0)>(10);
- $$ = $7 ? $1 : 10;
- $8 = (($$>>>0) / 10)&-1;
- _GetDefaultFont($3);
- $9 = (+($$|0));
- ;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;
- _MeasureTextEx($4,$$byval_copy,$0,$9,$8);
- $$sroa$0$0$copyload = +HEAPF32[$4>>2];
- $phitmp = (~~(($$sroa$0$0$copyload)));
- $$sroa$0$0 = $phitmp;
- STACKTOP = sp;return ($$sroa$0$0|0);
- }
- function _DrawFPS($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $$byval_copy = sp;
- $2 = sp + 4|0;
- $3 = HEAP32[8304]|0;
- $4 = HEAP32[747]|0;
- $5 = ($3|0)<($4|0);
- if ($5) {
- $6 = (($3) + 1)|0;
- $$sink = $6;
- } else {
- $7 = (_GetFPS()|0);
- HEAP32[8305] = $7;
- HEAP32[747] = $7;
- $$sink = 0;
- }
- HEAP32[8304] = $$sink;
- $8 = HEAP32[8305]|0;
- HEAP32[$$byval_copy>>2] = $8;
- (_FormatText(8190,$$byval_copy)|0);
- HEAP8[$2>>0] = 0;
- $9 = ((($2)) + 1|0);
- HEAP8[$9>>0] = -98;
- $10 = ((($2)) + 2|0);
- HEAP8[$10>>0] = 47;
- $11 = ((($2)) + 3|0);
- HEAP8[$11>>0] = -1;
- ;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;
- _DrawText(37239,$0,$1,20,$$byval_copy);
- STACKTOP = sp;return;
- }
- function _emscripten_GetProcAddress($0) {
- $0 = $0|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $1 = sp + 12|0;
- $2 = sp + 8|0;
- $3 = sp + 4|0;
- $4 = sp;
- HEAP32[$2>>2] = $0;
- $5 = HEAP32[$2>>2]|0;
- $6 = (_strlen($5)|0);
- $7 = (($6) + 1)|0;
- $8 = (_malloc($7)|0);
- HEAP32[$3>>2] = $8;
- $9 = HEAP32[$3>>2]|0;
- $10 = HEAP32[$2>>2]|0;
- (_strcpy($9,$10)|0);
- $11 = HEAP32[$3>>2]|0;
- $12 = (_strstr($11,8198)|0);
- HEAP32[$4>>2] = $12;
- $13 = HEAP32[$4>>2]|0;
- $14 = ($13|0)!=(0|0);
- if ($14) {
- $15 = HEAP32[$4>>2]|0;
- HEAP8[$15>>0] = 0;
- }
- $16 = HEAP32[$3>>2]|0;
- $17 = (_strstr($16,8202)|0);
- HEAP32[$4>>2] = $17;
- $18 = HEAP32[$4>>2]|0;
- $19 = ($18|0)!=(0|0);
- if ($19) {
- $20 = HEAP32[$4>>2]|0;
- HEAP8[$20>>0] = 0;
- }
- $21 = HEAP32[$3>>2]|0;
- $22 = (_strstr($21,8206)|0);
- HEAP32[$4>>2] = $22;
- $23 = HEAP32[$4>>2]|0;
- $24 = ($23|0)!=(0|0);
- if ($24) {
- $25 = HEAP32[$4>>2]|0;
- HEAP8[$25>>0] = 0;
- }
- $26 = HEAP32[$3>>2]|0;
- $27 = (_strstr($26,8210)|0);
- HEAP32[$4>>2] = $27;
- $28 = HEAP32[$4>>2]|0;
- $29 = ($28|0)!=(0|0);
- if ($29) {
- $30 = HEAP32[$4>>2]|0;
- HEAP8[$30>>0] = 0;
- }
- $31 = HEAP32[$3>>2]|0;
- $32 = (_strcmp($31,8216)|0);
- $33 = ($32|0)!=(0);
- do {
- if ($33) {
- $34 = HEAP32[$3>>2]|0;
- $35 = (_strcmp($34,8254)|0);
- $36 = ($35|0)!=(0);
- if (!($36)) {
- HEAP32[$3>>2] = 8273;
- break;
- }
- $37 = HEAP32[$3>>2]|0;
- $38 = (_strcmp($37,8286)|0);
- $39 = ($38|0)!=(0);
- if (!($39)) {
- HEAP32[$3>>2] = 8307;
- break;
- }
- $40 = HEAP32[$3>>2]|0;
- $41 = (_strcmp($40,8322)|0);
- $42 = ($41|0)!=(0);
- if (!($42)) {
- HEAP32[$3>>2] = 8337;
- break;
- }
- $43 = HEAP32[$3>>2]|0;
- $44 = (_strcmp($43,8352)|0);
- $45 = ($44|0)!=(0);
- if (!($45)) {
- HEAP32[$3>>2] = 8367;
- }
- } else {
- HEAP32[$3>>2] = 8238;
- }
- } while(0);
- $46 = HEAP32[$3>>2]|0;
- $47 = (_strcmp($46,8382)|0);
- $48 = ($47|0)!=(0);
- do {
- if ($48) {
- $49 = HEAP32[$3>>2]|0;
- $50 = (_strcmp($49,8396)|0);
- $51 = ($50|0)!=(0);
- if (!($51)) {
- HEAP32[$1>>2] = 3;
- break;
- }
- $52 = HEAP32[$3>>2]|0;
- $53 = (_strcmp($52,8408)|0);
- $54 = ($53|0)!=(0);
- if (!($54)) {
- HEAP32[$1>>2] = 6;
- break;
- }
- $55 = HEAP32[$3>>2]|0;
- $56 = (_strcmp($55,8422)|0);
- $57 = ($56|0)!=(0);
- if (!($57)) {
- HEAP32[$1>>2] = 7;
- break;
- }
- $58 = HEAP32[$3>>2]|0;
- $59 = (_strcmp($58,8434)|0);
- $60 = ($59|0)!=(0);
- if (!($60)) {
- HEAP32[$1>>2] = 8;
- break;
- }
- $61 = HEAP32[$3>>2]|0;
- $62 = (_strcmp($61,8448)|0);
- $63 = ($62|0)!=(0);
- if (!($63)) {
- HEAP32[$1>>2] = 9;
- break;
- }
- $64 = HEAP32[$3>>2]|0;
- $65 = (_strcmp($64,8462)|0);
- $66 = ($65|0)!=(0);
- if (!($66)) {
- HEAP32[$1>>2] = 10;
- break;
- }
- $67 = HEAP32[$3>>2]|0;
- $68 = (_strcmp($67,8479)|0);
- $69 = ($68|0)!=(0);
- if (!($69)) {
- HEAP32[$1>>2] = 1;
- break;
- }
- $70 = HEAP32[$3>>2]|0;
- $71 = (_strcmp($70,8502)|0);
- $72 = ($71|0)!=(0);
- if (!($72)) {
- HEAP32[$1>>2] = 1;
- break;
- }
- $73 = HEAP32[$3>>2]|0;
- $74 = (_strcmp($73,8528)|0);
- $75 = ($74|0)!=(0);
- if (!($75)) {
- HEAP32[$1>>2] = 2;
- break;
- }
- $76 = HEAP32[$3>>2]|0;
- $77 = (_strcmp($76,8541)|0);
- $78 = ($77|0)!=(0);
- if (!($78)) {
- HEAP32[$1>>2] = 3;
- break;
- }
- $79 = HEAP32[$3>>2]|0;
- $80 = (_strcmp($79,8557)|0);
- $81 = ($80|0)!=(0);
- if (!($81)) {
- HEAP32[$1>>2] = 1;
- break;
- }
- $82 = HEAP32[$3>>2]|0;
- $83 = (_strcmp($82,8570)|0);
- $84 = ($83|0)!=(0);
- if (!($84)) {
- HEAP32[$1>>2] = 11;
- break;
- }
- $85 = HEAP32[$3>>2]|0;
- $86 = (_strcmp($85,8584)|0);
- $87 = ($86|0)!=(0);
- if (!($87)) {
- HEAP32[$1>>2] = 2;
- break;
- }
- $88 = HEAP32[$3>>2]|0;
- $89 = (_strcmp($88,8604)|0);
- $90 = ($89|0)!=(0);
- if (!($90)) {
- HEAP32[$1>>2] = 3;
- break;
- }
- $91 = HEAP32[$3>>2]|0;
- $92 = (_strcmp($91,8624)|0);
- $93 = ($92|0)!=(0);
- if (!($93)) {
- HEAP32[$1>>2] = 4;
- break;
- }
- $94 = HEAP32[$3>>2]|0;
- $95 = (_strcmp($94,8641)|0);
- $96 = ($95|0)!=(0);
- if (!($96)) {
- HEAP32[$1>>2] = 5;
- break;
- }
- $97 = HEAP32[$3>>2]|0;
- $98 = (_strcmp($97,8658)|0);
- $99 = ($98|0)!=(0);
- if (!($99)) {
- HEAP32[$1>>2] = 4;
- break;
- }
- $100 = HEAP32[$3>>2]|0;
- $101 = (_strcmp($100,8670)|0);
- $102 = ($101|0)!=(0);
- if (!($102)) {
- HEAP32[$1>>2] = 12;
- break;
- }
- $103 = HEAP32[$3>>2]|0;
- $104 = (_strcmp($103,8683)|0);
- $105 = ($104|0)!=(0);
- if (!($105)) {
- HEAP32[$1>>2] = 13;
- break;
- }
- $106 = HEAP32[$3>>2]|0;
- $107 = (_strcmp($106,8699)|0);
- $108 = ($107|0)!=(0);
- if (!($108)) {
- HEAP32[$1>>2] = 6;
- break;
- }
- $109 = HEAP32[$3>>2]|0;
- $110 = (_strcmp($109,8722)|0);
- $111 = ($110|0)!=(0);
- if (!($111)) {
- HEAP32[$1>>2] = 2;
- break;
- }
- $112 = HEAP32[$3>>2]|0;
- $113 = (_strcmp($112,8735)|0);
- $114 = ($113|0)!=(0);
- if (!($114)) {
- HEAP32[$1>>2] = 3;
- break;
- }
- $115 = HEAP32[$3>>2]|0;
- $116 = (_strcmp($115,8751)|0);
- $117 = ($116|0)!=(0);
- if (!($117)) {
- HEAP32[$1>>2] = 5;
- break;
- }
- $118 = HEAP32[$3>>2]|0;
- $119 = (_strcmp($118,8762)|0);
- $120 = ($119|0)!=(0);
- if (!($120)) {
- HEAP32[$1>>2] = 14;
- break;
- }
- $121 = HEAP32[$3>>2]|0;
- $122 = (_strcmp($121,8781)|0);
- $123 = ($122|0)!=(0);
- if (!($123)) {
- HEAP32[$1>>2] = 15;
- break;
- }
- $124 = HEAP32[$3>>2]|0;
- $125 = (_strcmp($124,8803)|0);
- $126 = ($125|0)!=(0);
- if (!($126)) {
- HEAP32[$1>>2] = 16;
- break;
- }
- $127 = HEAP32[$3>>2]|0;
- $128 = (_strcmp($127,8822)|0);
- $129 = ($128|0)!=(0);
- if (!($129)) {
- HEAP32[$1>>2] = 7;
- break;
- }
- $130 = HEAP32[$3>>2]|0;
- $131 = (_strcmp($130,8851)|0);
- $132 = ($131|0)!=(0);
- if (!($132)) {
- HEAP32[$1>>2] = 6;
- break;
- }
- $133 = HEAP32[$3>>2]|0;
- $134 = (_strcmp($133,8868)|0);
- $135 = ($134|0)!=(0);
- if (!($135)) {
- HEAP32[$1>>2] = 8;
- break;
- }
- $136 = HEAP32[$3>>2]|0;
- $137 = (_strcmp($136,8883)|0);
- $138 = ($137|0)!=(0);
- if (!($138)) {
- HEAP32[$1>>2] = 9;
- break;
- }
- $139 = HEAP32[$3>>2]|0;
- $140 = (_strcmp($139,8898)|0);
- $141 = ($140|0)!=(0);
- if (!($141)) {
- HEAP32[$1>>2] = 1;
- break;
- }
- $142 = HEAP32[$3>>2]|0;
- $143 = (_strcmp($142,8919)|0);
- $144 = ($143|0)!=(0);
- if (!($144)) {
- HEAP32[$1>>2] = 10;
- break;
- }
- $145 = HEAP32[$3>>2]|0;
- $146 = (_strcmp($145,8939)|0);
- $147 = ($146|0)!=(0);
- if (!($147)) {
- HEAP32[$1>>2] = 11;
- break;
- }
- $148 = HEAP32[$3>>2]|0;
- $149 = (_strcmp($148,8959)|0);
- $150 = ($149|0)!=(0);
- if (!($150)) {
- HEAP32[$1>>2] = 12;
- break;
- }
- $151 = HEAP32[$3>>2]|0;
- $152 = (_strcmp($151,8985)|0);
- $153 = ($152|0)!=(0);
- if (!($153)) {
- HEAP32[$1>>2] = 2;
- break;
- }
- $154 = HEAP32[$3>>2]|0;
- $155 = (_strcmp($154,9004)|0);
- $156 = ($155|0)!=(0);
- if (!($156)) {
- HEAP32[$1>>2] = 1;
- break;
- }
- $157 = HEAP32[$3>>2]|0;
- $158 = (_strcmp($157,9016)|0);
- $159 = ($158|0)!=(0);
- if (!($159)) {
- HEAP32[$1>>2] = 3;
- break;
- }
- $160 = HEAP32[$3>>2]|0;
- $161 = (_strcmp($160,9028)|0);
- $162 = ($161|0)!=(0);
- if (!($162)) {
- HEAP32[$1>>2] = 1;
- break;
- }
- $163 = HEAP32[$3>>2]|0;
- $164 = (_strcmp($163,9040)|0);
- $165 = ($164|0)!=(0);
- if (!($165)) {
- HEAP32[$1>>2] = 1;
- break;
- }
- $166 = HEAP32[$3>>2]|0;
- $167 = (_strcmp($166,9052)|0);
- $168 = ($167|0)!=(0);
- if (!($168)) {
- HEAP32[$1>>2] = 17;
- break;
- }
- $169 = HEAP32[$3>>2]|0;
- $170 = (_strcmp($169,9064)|0);
- $171 = ($170|0)!=(0);
- if (!($171)) {
- HEAP32[$1>>2] = 13;
- break;
- }
- $172 = HEAP32[$3>>2]|0;
- $173 = (_strcmp($172,9076)|0);
- $174 = ($173|0)!=(0);
- if (!($174)) {
- HEAP32[$1>>2] = 4;
- break;
- }
- $175 = HEAP32[$3>>2]|0;
- $176 = (_strcmp($175,9088)|0);
- $177 = ($176|0)!=(0);
- if (!($177)) {
- HEAP32[$1>>2] = 2;
- break;
- }
- $178 = HEAP32[$3>>2]|0;
- $179 = (_strcmp($178,9100)|0);
- $180 = ($179|0)!=(0);
- if (!($180)) {
- HEAP32[$1>>2] = 14;
- break;
- }
- $181 = HEAP32[$3>>2]|0;
- $182 = (_strcmp($181,9113)|0);
- $183 = ($182|0)!=(0);
- if (!($183)) {
- HEAP32[$1>>2] = 15;
- break;
- }
- $184 = HEAP32[$3>>2]|0;
- $185 = (_strcmp($184,9126)|0);
- $186 = ($185|0)!=(0);
- if (!($186)) {
- HEAP32[$1>>2] = 16;
- break;
- }
- $187 = HEAP32[$3>>2]|0;
- $188 = (_strcmp($187,9139)|0);
- $189 = ($188|0)!=(0);
- if (!($189)) {
- HEAP32[$1>>2] = 17;
- break;
- }
- $190 = HEAP32[$3>>2]|0;
- $191 = (_strcmp($190,9152)|0);
- $192 = ($191|0)!=(0);
- if (!($192)) {
- HEAP32[$1>>2] = 18;
- break;
- }
- $193 = HEAP32[$3>>2]|0;
- $194 = (_strcmp($193,9165)|0);
- $195 = ($194|0)!=(0);
- if (!($195)) {
- HEAP32[$1>>2] = 19;
- break;
- }
- $196 = HEAP32[$3>>2]|0;
- $197 = (_strcmp($196,9178)|0);
- $198 = ($197|0)!=(0);
- if (!($198)) {
- HEAP32[$1>>2] = 20;
- break;
- }
- $199 = HEAP32[$3>>2]|0;
- $200 = (_strcmp($199,9191)|0);
- $201 = ($200|0)!=(0);
- if (!($201)) {
- HEAP32[$1>>2] = 21;
- break;
- }
- $202 = HEAP32[$3>>2]|0;
- $203 = (_strcmp($202,9204)|0);
- $204 = ($203|0)!=(0);
- if (!($204)) {
- HEAP32[$1>>2] = 5;
- break;
- }
- $205 = HEAP32[$3>>2]|0;
- $206 = (_strcmp($205,9223)|0);
- $207 = ($206|0)!=(0);
- if (!($207)) {
- HEAP32[$1>>2] = 6;
- break;
- }
- $208 = HEAP32[$3>>2]|0;
- $209 = (_strcmp($208,9242)|0);
- $210 = ($209|0)!=(0);
- if (!($210)) {
- HEAP32[$1>>2] = 7;
- break;
- }
- $211 = HEAP32[$3>>2]|0;
- $212 = (_strcmp($211,9261)|0);
- $213 = ($212|0)!=(0);
- if (!($213)) {
- HEAP32[$1>>2] = 18;
- break;
- }
- $214 = HEAP32[$3>>2]|0;
- $215 = (_strcmp($214,9274)|0);
- $216 = ($215|0)!=(0);
- if (!($216)) {
- HEAP32[$1>>2] = 19;
- break;
- }
- $217 = HEAP32[$3>>2]|0;
- $218 = (_strcmp($217,9292)|0);
- $219 = ($218|0)!=(0);
- if (!($219)) {
- HEAP32[$1>>2] = 20;
- break;
- }
- $220 = HEAP32[$3>>2]|0;
- $221 = (_strcmp($220,9310)|0);
- $222 = ($221|0)!=(0);
- if (!($222)) {
- HEAP32[$1>>2] = 21;
- break;
- }
- $223 = HEAP32[$3>>2]|0;
- $224 = (_strcmp($223,9328)|0);
- $225 = ($224|0)!=(0);
- if (!($225)) {
- HEAP32[$1>>2] = 22;
- break;
- }
- $226 = HEAP32[$3>>2]|0;
- $227 = (_strcmp($226,9346)|0);
- $228 = ($227|0)!=(0);
- if (!($228)) {
- HEAP32[$1>>2] = 2;
- break;
- }
- $229 = HEAP32[$3>>2]|0;
- $230 = (_strcmp($229,9366)|0);
- $231 = ($230|0)!=(0);
- if (!($231)) {
- HEAP32[$1>>2] = 3;
- break;
- }
- $232 = HEAP32[$3>>2]|0;
- $233 = (_strcmp($232,8307)|0);
- $234 = ($233|0)!=(0);
- if (!($234)) {
- HEAP32[$1>>2] = 7;
- break;
- }
- $235 = HEAP32[$3>>2]|0;
- $236 = (_strcmp($235,9384)|0);
- $237 = ($236|0)!=(0);
- if (!($237)) {
- HEAP32[$1>>2] = 1;
- break;
- }
- $238 = HEAP32[$3>>2]|0;
- $239 = (_strcmp($238,9399)|0);
- $240 = ($239|0)!=(0);
- if (!($240)) {
- HEAP32[$1>>2] = 8;
- break;
- }
- $241 = HEAP32[$3>>2]|0;
- $242 = (_strcmp($241,9420)|0);
- $243 = ($242|0)!=(0);
- if (!($243)) {
- HEAP32[$1>>2] = 9;
- break;
- }
- $244 = HEAP32[$3>>2]|0;
- $245 = (_strcmp($244,9435)|0);
- $246 = ($245|0)!=(0);
- if (!($246)) {
- HEAP32[$1>>2] = 10;
- break;
- }
- $247 = HEAP32[$3>>2]|0;
- $248 = (_strcmp($247,9453)|0);
- $249 = ($248|0)!=(0);
- if (!($249)) {
- HEAP32[$1>>2] = 2;
- break;
- }
- $250 = HEAP32[$3>>2]|0;
- $251 = (_strcmp($250,9469)|0);
- $252 = ($251|0)!=(0);
- if (!($252)) {
- HEAP32[$1>>2] = 11;
- break;
- }
- $253 = HEAP32[$3>>2]|0;
- $254 = (_strcmp($253,9488)|0);
- $255 = ($254|0)!=(0);
- if (!($255)) {
- HEAP32[$1>>2] = 22;
- break;
- }
- $256 = HEAP32[$3>>2]|0;
- $257 = (_strcmp($256,9502)|0);
- $258 = ($257|0)!=(0);
- if (!($258)) {
- HEAP32[$1>>2] = 23;
- break;
- }
- $259 = HEAP32[$3>>2]|0;
- $260 = (_strcmp($259,9517)|0);
- $261 = ($260|0)!=(0);
- if (!($261)) {
- HEAP32[$1>>2] = 8;
- break;
- }
- $262 = HEAP32[$3>>2]|0;
- $263 = (_strcmp($262,8238)|0);
- $264 = ($263|0)!=(0);
- if (!($264)) {
- HEAP32[$1>>2] = 1;
- break;
- }
- $265 = HEAP32[$3>>2]|0;
- $266 = (_strcmp($265,9528)|0);
- $267 = ($266|0)!=(0);
- if (!($267)) {
- HEAP32[$1>>2] = 3;
- break;
- }
- $268 = HEAP32[$3>>2]|0;
- $269 = (_strcmp($268,8337)|0);
- $270 = ($269|0)!=(0);
- if (!($270)) {
- HEAP32[$1>>2] = 23;
- break;
- }
- $271 = HEAP32[$3>>2]|0;
- $272 = (_strcmp($271,8367)|0);
- $273 = ($272|0)!=(0);
- if (!($273)) {
- HEAP32[$1>>2] = 24;
- break;
- }
- $274 = HEAP32[$3>>2]|0;
- $275 = (_strcmp($274,9544)|0);
- $276 = ($275|0)!=(0);
- if (!($276)) {
- HEAP32[$1>>2] = 12;
- break;
- }
- $277 = HEAP32[$3>>2]|0;
- $278 = (_strcmp($277,9571)|0);
- $279 = ($278|0)!=(0);
- if (!($279)) {
- HEAP32[$1>>2] = 4;
- break;
- }
- $280 = HEAP32[$3>>2]|0;
- $281 = (_strcmp($280,9585)|0);
- $282 = ($281|0)!=(0);
- if (!($282)) {
- HEAP32[$1>>2] = 13;
- break;
- }
- $283 = HEAP32[$3>>2]|0;
- $284 = (_strcmp($283,8273)|0);
- $285 = ($284|0)!=(0);
- if (!($285)) {
- HEAP32[$1>>2] = 5;
- break;
- }
- $286 = HEAP32[$3>>2]|0;
- $287 = (_strcmp($286,9605)|0);
- $288 = ($287|0)!=(0);
- if (!($288)) {
- HEAP32[$1>>2] = 6;
- break;
- }
- $289 = HEAP32[$3>>2]|0;
- $290 = (_strcmp($289,9623)|0);
- $291 = ($290|0)!=(0);
- if (!($291)) {
- HEAP32[$1>>2] = 9;
- break;
- }
- $292 = HEAP32[$3>>2]|0;
- $293 = (_strcmp($292,9635)|0);
- $294 = ($293|0)!=(0);
- if (!($294)) {
- HEAP32[$1>>2] = 24;
- break;
- }
- $295 = HEAP32[$3>>2]|0;
- $296 = (_strcmp($295,9656)|0);
- $297 = ($296|0)!=(0);
- if (!($297)) {
- HEAP32[$1>>2] = 25;
- break;
- }
- $298 = HEAP32[$3>>2]|0;
- $299 = (_strcmp($298,9674)|0);
- $300 = ($299|0)!=(0);
- if (!($300)) {
- HEAP32[$1>>2] = 26;
- break;
- }
- $301 = HEAP32[$3>>2]|0;
- $302 = (_strcmp($301,9692)|0);
- $303 = ($302|0)!=(0);
- if (!($303)) {
- HEAP32[$1>>2] = 27;
- break;
- }
- $304 = HEAP32[$3>>2]|0;
- $305 = (_strcmp($304,9713)|0);
- $306 = ($305|0)!=(0);
- if (!($306)) {
- HEAP32[$1>>2] = 14;
- break;
- }
- $307 = HEAP32[$3>>2]|0;
- $308 = (_strcmp($307,9739)|0);
- $309 = ($308|0)!=(0);
- if (!($309)) {
- HEAP32[$1>>2] = 3;
- break;
- }
- $310 = HEAP32[$3>>2]|0;
- $311 = (_strcmp($310,9762)|0);
- $312 = ($311|0)!=(0);
- if (!($312)) {
- HEAP32[$1>>2] = 15;
- break;
- }
- $313 = HEAP32[$3>>2]|0;
- $314 = (_strcmp($313,9800)|0);
- $315 = ($314|0)!=(0);
- if (!($315)) {
- HEAP32[$1>>2] = 10;
- break;
- }
- $316 = HEAP32[$3>>2]|0;
- $317 = (_strcmp($316,9816)|0);
- $318 = ($317|0)!=(0);
- if (!($318)) {
- HEAP32[$1>>2] = 7;
- break;
- }
- $319 = HEAP32[$3>>2]|0;
- $320 = (_strcmp($319,9831)|0);
- $321 = ($320|0)!=(0);
- if (!($321)) {
- HEAP32[$1>>2] = 25;
- break;
- }
- $322 = HEAP32[$3>>2]|0;
- $323 = (_strcmp($322,9854)|0);
- $324 = ($323|0)!=(0);
- if (!($324)) {
- HEAP32[$1>>2] = 16;
- break;
- }
- $325 = HEAP32[$3>>2]|0;
- $326 = (_strcmp($325,9867)|0);
- $327 = ($326|0)!=(0);
- if (!($327)) {
- HEAP32[$1>>2] = 28;
- break;
- }
- $328 = HEAP32[$3>>2]|0;
- $329 = (_strcmp($328,9881)|0);
- $330 = ($329|0)!=(0);
- if (!($330)) {
- HEAP32[$1>>2] = 29;
- break;
- }
- $331 = HEAP32[$3>>2]|0;
- $332 = (_strcmp($331,9895)|0);
- $333 = ($332|0)!=(0);
- if (!($333)) {
- HEAP32[$1>>2] = 1;
- break;
- }
- $334 = HEAP32[$3>>2]|0;
- $335 = (_strcmp($334,9915)|0);
- $336 = ($335|0)!=(0);
- if (!($336)) {
- HEAP32[$1>>2] = 8;
- break;
- }
- $337 = HEAP32[$3>>2]|0;
- $338 = (_strcmp($337,9935)|0);
- $339 = ($338|0)!=(0);
- if (!($339)) {
- HEAP32[$1>>2] = 17;
- break;
- }
- $340 = HEAP32[$3>>2]|0;
- $341 = (_strcmp($340,9951)|0);
- $342 = ($341|0)!=(0);
- if (!($342)) {
- HEAP32[$1>>2] = 18;
- break;
- }
- $343 = HEAP32[$3>>2]|0;
- $344 = (_strcmp($343,9969)|0);
- $345 = ($344|0)!=(0);
- if (!($345)) {
- HEAP32[$1>>2] = 26;
- break;
- }
- $346 = HEAP32[$3>>2]|0;
- $347 = (_strcmp($346,9985)|0);
- $348 = ($347|0)!=(0);
- if (!($348)) {
- HEAP32[$1>>2] = 19;
- break;
- }
- $349 = HEAP32[$3>>2]|0;
- $350 = (_strcmp($349,10000)|0);
- $351 = ($350|0)!=(0);
- if (!($351)) {
- HEAP32[$1>>2] = 9;
- break;
- }
- $352 = HEAP32[$3>>2]|0;
- $353 = (_strcmp($352,10022)|0);
- $354 = ($353|0)!=(0);
- if (!($354)) {
- HEAP32[$1>>2] = 30;
- break;
- }
- $355 = HEAP32[$3>>2]|0;
- $356 = (_strcmp($355,10040)|0);
- $357 = ($356|0)!=(0);
- if (!($357)) {
- HEAP32[$1>>2] = 31;
- break;
- }
- $358 = HEAP32[$3>>2]|0;
- $359 = (_strcmp($358,10061)|0);
- $360 = ($359|0)!=(0);
- if (!($360)) {
- HEAP32[$1>>2] = 10;
- break;
- }
- $361 = HEAP32[$3>>2]|0;
- $362 = (_strcmp($361,10079)|0);
- $363 = ($362|0)!=(0);
- if (!($363)) {
- HEAP32[$1>>2] = 11;
- break;
- }
- $364 = HEAP32[$3>>2]|0;
- $365 = (_strcmp($364,10092)|0);
- $366 = ($365|0)!=(0);
- if (!($366)) {
- HEAP32[$1>>2] = 2;
- break;
- }
- $367 = HEAP32[$3>>2]|0;
- $368 = (_strcmp($367,10107)|0);
- $369 = ($368|0)!=(0);
- if (!($369)) {
- HEAP32[$1>>2] = 12;
- break;
- }
- $370 = HEAP32[$3>>2]|0;
- $371 = (_strcmp($370,10121)|0);
- $372 = ($371|0)!=(0);
- if (!($372)) {
- HEAP32[$1>>2] = 1;
- break;
- }
- $373 = HEAP32[$3>>2]|0;
- $374 = (_strcmp($373,10131)|0);
- $375 = ($374|0)!=(0);
- if (!($375)) {
- HEAP32[$1>>2] = 1;
- break;
- }
- $376 = HEAP32[$3>>2]|0;
- $377 = (_strcmp($376,10141)|0);
- $378 = ($377|0)!=(0);
- if (!($378)) {
- HEAP32[$1>>2] = 2;
- break;
- }
- $379 = HEAP32[$3>>2]|0;
- $380 = (_strcmp($379,10163)|0);
- $381 = ($380|0)!=(0);
- if (!($381)) {
- HEAP32[$1>>2] = 13;
- break;
- }
- $382 = HEAP32[$3>>2]|0;
- $383 = (_strcmp($382,10189)|0);
- $384 = ($383|0)!=(0);
- if (!($384)) {
- HEAP32[$1>>2] = 14;
- break;
- }
- $385 = HEAP32[$3>>2]|0;
- $386 = (_strcmp($385,10216)|0);
- $387 = ($386|0)!=(0);
- if (!($387)) {
- HEAP32[$1>>2] = 27;
- break;
- }
- $388 = HEAP32[$3>>2]|0;
- $389 = (_strcmp($388,10229)|0);
- $390 = ($389|0)!=(0);
- if (!($390)) {
- HEAP32[$1>>2] = 20;
- break;
- }
- $391 = HEAP32[$3>>2]|0;
- $392 = (_strcmp($391,10244)|0);
- $393 = ($392|0)!=(0);
- if (!($393)) {
- HEAP32[$1>>2] = 4;
- break;
- }
- $394 = HEAP32[$3>>2]|0;
- $395 = (_strcmp($394,10259)|0);
- $396 = ($395|0)!=(0);
- if (!($396)) {
- HEAP32[$1>>2] = 3;
- break;
- }
- $397 = HEAP32[$3>>2]|0;
- $398 = (_strcmp($397,10283)|0);
- $399 = ($398|0)!=(0);
- if (!($399)) {
- HEAP32[$1>>2] = 2;
- break;
- }
- $400 = HEAP32[$3>>2]|0;
- $401 = (_strcmp($400,10294)|0);
- $402 = ($401|0)!=(0);
- if (!($402)) {
- HEAP32[$1>>2] = 32;
- break;
- }
- $403 = HEAP32[$3>>2]|0;
- $404 = (_strcmp($403,10316)|0);
- $405 = ($404|0)!=(0);
- if (!($405)) {
- HEAP32[$1>>2] = 21;
- break;
- }
- $406 = HEAP32[$3>>2]|0;
- $407 = (_strcmp($406,10338)|0);
- $408 = ($407|0)!=(0);
- if (!($408)) {
- HEAP32[$1>>2] = 5;
- break;
- }
- $409 = HEAP32[$3>>2]|0;
- $410 = (_strcmp($409,10362)|0);
- $411 = ($410|0)!=(0);
- if (!($411)) {
- HEAP32[$1>>2] = 4;
- break;
- }
- $412 = HEAP32[$3>>2]|0;
- $413 = (_strcmp($412,10371)|0);
- $414 = ($413|0)!=(0);
- if (!($414)) {
- HEAP32[$1>>2] = 5;
- break;
- }
- $415 = HEAP32[$3>>2]|0;
- $416 = (_strcmp($415,10379)|0);
- $417 = ($416|0)!=(0);
- if (!($417)) {
- HEAP32[$1>>2] = 1;
- break;
- }
- $418 = HEAP32[$3>>2]|0;
- $419 = (_strcmp($418,10392)|0);
- $420 = ($419|0)!=(0);
- if (!($420)) {
- HEAP32[$1>>2] = 2;
- break;
- }
- $421 = HEAP32[$3>>2]|0;
- $422 = (_strcmp($421,10406)|0);
- $423 = ($422|0)!=(0);
- if (!($423)) {
- HEAP32[$1>>2] = 15;
- break;
- }
- $424 = HEAP32[$3>>2]|0;
- $425 = (_strcmp($424,10418)|0);
- $426 = ($425|0)!=(0);
- if (!($426)) {
- HEAP32[$1>>2] = 16;
- break;
- }
- $427 = HEAP32[$3>>2]|0;
- $428 = (_strcmp($427,10427)|0);
- $429 = ($428|0)!=(0);
- if (!($429)) {
- HEAP32[$1>>2] = 17;
- break;
- }
- $430 = HEAP32[$3>>2]|0;
- $431 = (_strcmp($430,10437)|0);
- $432 = ($431|0)!=(0);
- if (!($432)) {
- HEAP32[$1>>2] = 18;
- break;
- }
- $433 = HEAP32[$3>>2]|0;
- $434 = (_strcmp($433,10449)|0);
- $435 = ($434|0)!=(0);
- if (!($435)) {
- HEAP32[$1>>2] = 19;
- break;
- }
- $436 = HEAP32[$3>>2]|0;
- $437 = (_strcmp($436,10460)|0);
- $438 = ($437|0)!=(0);
- if (!($438)) {
- HEAP32[$1>>2] = 20;
- break;
- }
- $439 = HEAP32[$3>>2]|0;
- $440 = (_strcmp($439,10468)|0);
- $441 = ($440|0)!=(0);
- if (!($441)) {
- HEAP32[$1>>2] = 3;
- break;
- }
- $442 = HEAP32[$3>>2]|0;
- $443 = (_strcmp($442,10480)|0);
- $444 = ($443|0)!=(0);
- if (!($444)) {
- HEAP32[$1>>2] = 21;
- break;
- }
- $445 = HEAP32[$3>>2]|0;
- $446 = (_strcmp($445,10495)|0);
- $447 = ($446|0)!=(0);
- if (!($447)) {
- HEAP32[$1>>2] = 22;
- break;
- }
- $448 = HEAP32[$3>>2]|0;
- $449 = (_strcmp($448,10507)|0);
- $450 = ($449|0)!=(0);
- if (!($450)) {
- HEAP32[$1>>2] = 23;
- break;
- }
- $451 = HEAP32[$3>>2]|0;
- $452 = (_strcmp($451,10521)|0);
- $453 = ($452|0)!=(0);
- if (!($453)) {
- HEAP32[$1>>2] = 11;
- break;
- }
- $454 = HEAP32[$3>>2]|0;
- $455 = (_strcmp($454,10546)|0);
- $456 = ($455|0)!=(0);
- if (!($456)) {
- HEAP32[$1>>2] = 24;
- break;
- }
- $457 = HEAP32[$3>>2]|0;
- $458 = (_strcmp($457,10563)|0);
- $459 = ($458|0)!=(0);
- if (!($459)) {
- HEAP32[$1>>2] = 25;
- break;
- }
- $460 = HEAP32[$3>>2]|0;
- $461 = (_strcmp($460,10579)|0);
- $462 = ($461|0)!=(0);
- if (!($462)) {
- HEAP32[$1>>2] = 26;
- break;
- }
- $463 = HEAP32[$3>>2]|0;
- $464 = (_strcmp($463,10595)|0);
- $465 = ($464|0)!=(0);
- if (!($465)) {
- HEAP32[$1>>2] = 12;
- break;
- }
- $466 = HEAP32[$3>>2]|0;
- $467 = (_strcmp($466,10607)|0);
- $468 = ($467|0)!=(0);
- if (!($468)) {
- HEAP32[$1>>2] = 33;
- break;
- }
- $469 = HEAP32[$3>>2]|0;
- $470 = (_strcmp($469,10619)|0);
- $471 = ($470|0)!=(0);
- if (!($471)) {
- HEAP32[$1>>2] = 34;
- break;
- }
- $472 = HEAP32[$3>>2]|0;
- $473 = (_strcmp($472,10643)|0);
- $474 = ($473|0)!=(0);
- if (!($474)) {
- HEAP32[$1>>2] = 1;
- break;
- }
- $475 = HEAP32[$3>>2]|0;
- $476 = (_strcmp($475,10656)|0);
- $477 = ($476|0)!=(0);
- if (!($477)) {
- HEAP32[$1>>2] = 2;
- break;
- }
- $478 = HEAP32[$3>>2]|0;
- $479 = (_strcmp($478,10670)|0);
- $480 = ($479|0)!=(0);
- if (!($480)) {
- HEAP32[$1>>2] = 35;
- break;
- }
- $481 = HEAP32[$3>>2]|0;
- $482 = (_strcmp($481,10692)|0);
- $483 = ($482|0)!=(0);
- if (!($483)) {
- HEAP32[$1>>2] = 36;
- break;
- }
- $484 = HEAP32[$3>>2]|0;
- $485 = (_strcmp($484,10699)|0);
- $486 = ($485|0)!=(0);
- if (!($486)) {
- HEAP32[$1>>2] = 3;
- break;
- }
- $487 = HEAP32[$3>>2]|0;
- $488 = (_strcmp($487,10715)|0);
- $489 = ($488|0)!=(0);
- if (!($489)) {
- HEAP32[$1>>2] = 2;
- break;
- }
- $490 = HEAP32[$3>>2]|0;
- $491 = (_strcmp($490,10732)|0);
- $492 = ($491|0)!=(0);
- if (!($492)) {
- HEAP32[$1>>2] = 1;
- break;
- }
- $493 = HEAP32[$3>>2]|0;
- $494 = (_strcmp($493,10749)|0);
- $495 = ($494|0)!=(0);
- if (!($495)) {
- HEAP32[$1>>2] = 28;
- break;
- }
- $496 = HEAP32[$3>>2]|0;
- $497 = (_strcmp($496,10765)|0);
- $498 = ($497|0)!=(0);
- if (!($498)) {
- HEAP32[$1>>2] = 1;
- break;
- }
- $499 = HEAP32[$3>>2]|0;
- $500 = (_strcmp($499,10781)|0);
- $501 = ($500|0)!=(0);
- if (!($501)) {
- HEAP32[$1>>2] = 4;
- break;
- }
- $502 = HEAP32[$3>>2]|0;
- $503 = (_strcmp($502,10798)|0);
- $504 = ($503|0)!=(0);
- if (!($504)) {
- HEAP32[$1>>2] = 29;
- break;
- }
- $505 = HEAP32[$3>>2]|0;
- $506 = (_strcmp($505,10812)|0);
- $507 = ($506|0)!=(0);
- if (!($507)) {
- HEAP32[$1>>2] = 30;
- break;
- }
- $508 = HEAP32[$3>>2]|0;
- $509 = (_strcmp($508,10824)|0);
- $510 = ($509|0)!=(0);
- if (!($510)) {
- HEAP32[$1>>2] = 22;
- break;
- }
- $511 = HEAP32[$3>>2]|0;
- $512 = (_strcmp($511,10835)|0);
- $513 = ($512|0)!=(0);
- if (!($513)) {
- HEAP32[$1>>2] = 2;
- break;
- }
- $514 = HEAP32[$3>>2]|0;
- $515 = (_strcmp($514,10848)|0);
- $516 = ($515|0)!=(0);
- if (!($516)) {
- HEAP32[$1>>2] = 23;
- break;
- }
- $517 = HEAP32[$3>>2]|0;
- $518 = (_strcmp($517,10858)|0);
- $519 = ($518|0)!=(0);
- if (!($519)) {
- HEAP32[$1>>2] = 2;
- break;
- }
- $520 = HEAP32[$3>>2]|0;
- $521 = (_strcmp($520,10875)|0);
- $522 = ($521|0)!=(0);
- if (!($522)) {
- HEAP32[$1>>2] = 24;
- break;
- }
- $523 = HEAP32[$3>>2]|0;
- $524 = (_strcmp($523,10887)|0);
- $525 = ($524|0)!=(0);
- if (!($525)) {
- HEAP32[$1>>2] = 25;
- break;
- }
- $526 = HEAP32[$3>>2]|0;
- $527 = (_strcmp($526,10909)|0);
- $528 = ($527|0)!=(0);
- if (!($528)) {
- HEAP32[$1>>2] = 26;
- break;
- }
- $529 = HEAP32[$3>>2]|0;
- $530 = (_strcmp($529,10929)|0);
- $531 = ($530|0)!=(0);
- if (!($531)) {
- HEAP32[$1>>2] = 3;
- break;
- }
- $532 = HEAP32[$3>>2]|0;
- $533 = (_strcmp($532,10942)|0);
- $534 = ($533|0)!=(0);
- if (!($534)) {
- HEAP32[$1>>2] = 27;
- break;
- }
- $535 = HEAP32[$3>>2]|0;
- $536 = (_strcmp($535,10964)|0);
- $537 = ($536|0)!=(0);
- if (!($537)) {
- HEAP32[$1>>2] = 28;
- break;
- }
- $538 = HEAP32[$3>>2]|0;
- $539 = (_strcmp($538,10984)|0);
- $540 = ($539|0)!=(0);
- if (!($540)) {
- HEAP32[$1>>2] = 2;
- break;
- }
- $541 = HEAP32[$3>>2]|0;
- $542 = (_strcmp($541,11001)|0);
- $543 = ($542|0)!=(0);
- if (!($543)) {
- HEAP32[$1>>2] = 2;
- break;
- }
- $544 = HEAP32[$3>>2]|0;
- $545 = (_strcmp($544,11018)|0);
- $546 = ($545|0)!=(0);
- if (!($546)) {
- HEAP32[$1>>2] = 3;
- break;
- }
- $547 = HEAP32[$3>>2]|0;
- $548 = (_strcmp($547,11038)|0);
- $549 = ($548|0)!=(0);
- if ($549) {
- $550 = HEAP32[$2>>2]|0;
- $551 = HEAP32[$3>>2]|0;
- $552 = _emscripten_asm_const_iii(0, ($550|0), ($551|0))|0;
- HEAP32[$1>>2] = 0;
- break;
- } else {
- HEAP32[$1>>2] = 37;
- break;
- }
- } else {
- HEAP32[$1>>2] = 5;
- }
- } while(0);
- $553 = HEAP32[$1>>2]|0;
- STACKTOP = sp;return ($553|0);
- }
- function _emscripten_get_global_libc() {
- var label = 0, sp = 0;
- sp = STACKTOP;
- return (33224|0);
- }
- function ___emscripten_pthread_data_constructor() {
- var $0 = 0, $1 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = (_pthread_self()|0);
- $1 = ((($0)) + 188|0);
- HEAP32[$1>>2] = (33264);
- return;
- }
- function ___stdio_close($0) {
- $0 = $0|0;
- var $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $vararg_buffer = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $vararg_buffer = sp;
- $1 = ((($0)) + 60|0);
- $2 = HEAP32[$1>>2]|0;
- $3 = (_dummy_736($2)|0);
- HEAP32[$vararg_buffer>>2] = $3;
- $4 = (___syscall6(6,($vararg_buffer|0))|0);
- $5 = (___syscall_ret($4)|0);
- STACKTOP = sp;return ($5|0);
- }
- function ___stdio_write($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- 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;
- 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;
- var $vararg_ptr7 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 48|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(48|0);
- $vararg_buffer3 = sp + 16|0;
- $vararg_buffer = sp;
- $3 = sp + 32|0;
- $4 = ((($0)) + 28|0);
- $5 = HEAP32[$4>>2]|0;
- HEAP32[$3>>2] = $5;
- $6 = ((($3)) + 4|0);
- $7 = ((($0)) + 20|0);
- $8 = HEAP32[$7>>2]|0;
- $9 = (($8) - ($5))|0;
- HEAP32[$6>>2] = $9;
- $10 = ((($3)) + 8|0);
- HEAP32[$10>>2] = $1;
- $11 = ((($3)) + 12|0);
- HEAP32[$11>>2] = $2;
- $12 = (($9) + ($2))|0;
- $13 = ((($0)) + 60|0);
- $14 = HEAP32[$13>>2]|0;
- $15 = $3;
- HEAP32[$vararg_buffer>>2] = $14;
- $vararg_ptr1 = ((($vararg_buffer)) + 4|0);
- HEAP32[$vararg_ptr1>>2] = $15;
- $vararg_ptr2 = ((($vararg_buffer)) + 8|0);
- HEAP32[$vararg_ptr2>>2] = 2;
- $16 = (___syscall146(146,($vararg_buffer|0))|0);
- $17 = (___syscall_ret($16)|0);
- $18 = ($12|0)==($17|0);
- L1: do {
- if ($18) {
- label = 3;
- } else {
- $$04756 = 2;$$04855 = $12;$$04954 = $3;$26 = $17;
- while(1) {
- $25 = ($26|0)<(0);
- if ($25) {
- break;
- }
- $34 = (($$04855) - ($26))|0;
- $35 = ((($$04954)) + 4|0);
- $36 = HEAP32[$35>>2]|0;
- $37 = ($26>>>0)>($36>>>0);
- $38 = ((($$04954)) + 8|0);
- $$150 = $37 ? $38 : $$04954;
- $39 = $37 << 31 >> 31;
- $$1 = (($39) + ($$04756))|0;
- $40 = $37 ? $36 : 0;
- $$0 = (($26) - ($40))|0;
- $41 = HEAP32[$$150>>2]|0;
- $42 = (($41) + ($$0)|0);
- HEAP32[$$150>>2] = $42;
- $43 = ((($$150)) + 4|0);
- $44 = HEAP32[$43>>2]|0;
- $45 = (($44) - ($$0))|0;
- HEAP32[$43>>2] = $45;
- $46 = HEAP32[$13>>2]|0;
- $47 = $$150;
- HEAP32[$vararg_buffer3>>2] = $46;
- $vararg_ptr6 = ((($vararg_buffer3)) + 4|0);
- HEAP32[$vararg_ptr6>>2] = $47;
- $vararg_ptr7 = ((($vararg_buffer3)) + 8|0);
- HEAP32[$vararg_ptr7>>2] = $$1;
- $48 = (___syscall146(146,($vararg_buffer3|0))|0);
- $49 = (___syscall_ret($48)|0);
- $50 = ($34|0)==($49|0);
- if ($50) {
- label = 3;
- break L1;
- } else {
- $$04756 = $$1;$$04855 = $34;$$04954 = $$150;$26 = $49;
- }
- }
- $27 = ((($0)) + 16|0);
- HEAP32[$27>>2] = 0;
- HEAP32[$4>>2] = 0;
- HEAP32[$7>>2] = 0;
- $28 = HEAP32[$0>>2]|0;
- $29 = $28 | 32;
- HEAP32[$0>>2] = $29;
- $30 = ($$04756|0)==(2);
- if ($30) {
- $$051 = 0;
- } else {
- $31 = ((($$04954)) + 4|0);
- $32 = HEAP32[$31>>2]|0;
- $33 = (($2) - ($32))|0;
- $$051 = $33;
- }
- }
- } while(0);
- if ((label|0) == 3) {
- $19 = ((($0)) + 44|0);
- $20 = HEAP32[$19>>2]|0;
- $21 = ((($0)) + 48|0);
- $22 = HEAP32[$21>>2]|0;
- $23 = (($20) + ($22)|0);
- $24 = ((($0)) + 16|0);
- HEAP32[$24>>2] = $23;
- HEAP32[$4>>2] = $20;
- HEAP32[$7>>2] = $20;
- $$051 = $2;
- }
- STACKTOP = sp;return ($$051|0);
- }
- function ___stdio_seek($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
- $vararg_buffer = sp;
- $3 = sp + 20|0;
- $4 = ((($0)) + 60|0);
- $5 = HEAP32[$4>>2]|0;
- $6 = $3;
- HEAP32[$vararg_buffer>>2] = $5;
- $vararg_ptr1 = ((($vararg_buffer)) + 4|0);
- HEAP32[$vararg_ptr1>>2] = 0;
- $vararg_ptr2 = ((($vararg_buffer)) + 8|0);
- HEAP32[$vararg_ptr2>>2] = $1;
- $vararg_ptr3 = ((($vararg_buffer)) + 12|0);
- HEAP32[$vararg_ptr3>>2] = $6;
- $vararg_ptr4 = ((($vararg_buffer)) + 16|0);
- HEAP32[$vararg_ptr4>>2] = $2;
- $7 = (___syscall140(140,($vararg_buffer|0))|0);
- $8 = (___syscall_ret($7)|0);
- $9 = ($8|0)<(0);
- if ($9) {
- HEAP32[$3>>2] = -1;
- $10 = -1;
- } else {
- $$pre = HEAP32[$3>>2]|0;
- $10 = $$pre;
- }
- STACKTOP = sp;return ($10|0);
- }
- function ___syscall_ret($0) {
- $0 = $0|0;
- var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = ($0>>>0)>(4294963200);
- if ($1) {
- $2 = (0 - ($0))|0;
- $3 = (___errno_location()|0);
- HEAP32[$3>>2] = $2;
- $$0 = -1;
- } else {
- $$0 = $0;
- }
- return ($$0|0);
- }
- function ___errno_location() {
- var $0 = 0, $1 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = (___pthread_self_108()|0);
- $1 = ((($0)) + 64|0);
- return ($1|0);
- }
- function ___pthread_self_108() {
- var $0 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = (_pthread_self()|0);
- return ($0|0);
- }
- function _dummy_736($0) {
- $0 = $0|0;
- var label = 0, sp = 0;
- sp = STACKTOP;
- return ($0|0);
- }
- function ___stdout_write($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
- $vararg_buffer = sp;
- $3 = sp + 16|0;
- $4 = ((($0)) + 36|0);
- HEAP32[$4>>2] = 9;
- $5 = HEAP32[$0>>2]|0;
- $6 = $5 & 64;
- $7 = ($6|0)==(0);
- if ($7) {
- $8 = ((($0)) + 60|0);
- $9 = HEAP32[$8>>2]|0;
- $10 = $3;
- HEAP32[$vararg_buffer>>2] = $9;
- $vararg_ptr1 = ((($vararg_buffer)) + 4|0);
- HEAP32[$vararg_ptr1>>2] = 21523;
- $vararg_ptr2 = ((($vararg_buffer)) + 8|0);
- HEAP32[$vararg_ptr2>>2] = $10;
- $11 = (___syscall54(54,($vararg_buffer|0))|0);
- $12 = ($11|0)==(0);
- if (!($12)) {
- $13 = ((($0)) + 75|0);
- HEAP8[$13>>0] = -1;
- }
- }
- $14 = (___stdio_write($0,$1,$2)|0);
- STACKTOP = sp;return ($14|0);
- }
- function _strcmp($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- var sp = 0;
- sp = STACKTOP;
- $2 = HEAP8[$0>>0]|0;
- $3 = HEAP8[$1>>0]|0;
- $4 = ($2<<24>>24)!=($3<<24>>24);
- $5 = ($2<<24>>24)==(0);
- $or$cond9 = $5 | $4;
- if ($or$cond9) {
- $$lcssa = $3;$$lcssa8 = $2;
- } else {
- $$011 = $1;$$0710 = $0;
- while(1) {
- $6 = ((($$0710)) + 1|0);
- $7 = ((($$011)) + 1|0);
- $8 = HEAP8[$6>>0]|0;
- $9 = HEAP8[$7>>0]|0;
- $10 = ($8<<24>>24)!=($9<<24>>24);
- $11 = ($8<<24>>24)==(0);
- $or$cond = $11 | $10;
- if ($or$cond) {
- $$lcssa = $9;$$lcssa8 = $8;
- break;
- } else {
- $$011 = $7;$$0710 = $6;
- }
- }
- }
- $12 = $$lcssa8&255;
- $13 = $$lcssa&255;
- $14 = (($12) - ($13))|0;
- return ($14|0);
- }
- function _memcmp($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- sp = STACKTOP;
- $3 = ($2|0)==(0);
- L1: do {
- if ($3) {
- $14 = 0;
- } else {
- $$01318 = $0;$$01417 = $2;$$019 = $1;
- while(1) {
- $4 = HEAP8[$$01318>>0]|0;
- $5 = HEAP8[$$019>>0]|0;
- $6 = ($4<<24>>24)==($5<<24>>24);
- if (!($6)) {
- break;
- }
- $7 = (($$01417) + -1)|0;
- $8 = ((($$01318)) + 1|0);
- $9 = ((($$019)) + 1|0);
- $10 = ($7|0)==(0);
- if ($10) {
- $14 = 0;
- break L1;
- } else {
- $$01318 = $8;$$01417 = $7;$$019 = $9;
- }
- }
- $11 = $4&255;
- $12 = $5&255;
- $13 = (($11) - ($12))|0;
- $14 = $13;
- }
- } while(0);
- return ($14|0);
- }
- function _vsprintf($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- var $3 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $3 = (_vsnprintf($0,2147483647,$1,$2)|0);
- return ($3|0);
- }
- function _vsnprintf($0,$1,$2,$3) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- 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;
- var $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, src = 0, stop = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 128|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(128|0);
- $4 = sp + 124|0;
- $5 = sp;
- 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));
- $6 = (($1) + -1)|0;
- $7 = ($6>>>0)>(2147483646);
- if ($7) {
- $8 = ($1|0)==(0);
- if ($8) {
- $$014 = $4;$$015 = 1;
- label = 4;
- } else {
- $9 = (___errno_location()|0);
- HEAP32[$9>>2] = 75;
- $$0 = -1;
- }
- } else {
- $$014 = $0;$$015 = $1;
- label = 4;
- }
- if ((label|0) == 4) {
- $10 = $$014;
- $11 = (-2 - ($10))|0;
- $12 = ($$015>>>0)>($11>>>0);
- $$$015 = $12 ? $11 : $$015;
- $13 = ((($5)) + 48|0);
- HEAP32[$13>>2] = $$$015;
- $14 = ((($5)) + 20|0);
- HEAP32[$14>>2] = $$014;
- $15 = ((($5)) + 44|0);
- HEAP32[$15>>2] = $$014;
- $16 = (($$014) + ($$$015)|0);
- $17 = ((($5)) + 16|0);
- HEAP32[$17>>2] = $16;
- $18 = ((($5)) + 28|0);
- HEAP32[$18>>2] = $16;
- $19 = (_vfprintf($5,$2,$3)|0);
- $20 = ($$$015|0)==(0);
- if ($20) {
- $$0 = $19;
- } else {
- $21 = HEAP32[$14>>2]|0;
- $22 = HEAP32[$17>>2]|0;
- $23 = ($21|0)==($22|0);
- $24 = $23 << 31 >> 31;
- $25 = (($21) + ($24)|0);
- HEAP8[$25>>0] = 0;
- $$0 = $19;
- }
- }
- STACKTOP = sp;return ($$0|0);
- }
- function _vfprintf($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- 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;
- var $8 = 0, $9 = 0, $vacopy_currentptr = 0, dest = 0, label = 0, sp = 0, stop = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 224|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(224|0);
- $3 = sp + 120|0;
- $4 = sp + 80|0;
- $5 = sp;
- $6 = sp + 136|0;
- dest=$4; stop=dest+40|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
- $vacopy_currentptr = HEAP32[$2>>2]|0;
- HEAP32[$3>>2] = $vacopy_currentptr;
- $7 = (_printf_core(0,$1,$3,$5,$4)|0);
- $8 = ($7|0)<(0);
- if ($8) {
- $$0 = -1;
- } else {
- $9 = ((($0)) + 76|0);
- $10 = (Atomics_load(HEAP32,$9>>2)|0);
- $11 = ($10|0)>(-1);
- if ($11) {
- $12 = (___lockfile($0)|0);
- $40 = $12;
- } else {
- $40 = 0;
- }
- $13 = HEAP32[$0>>2]|0;
- $14 = $13 & 32;
- $15 = ((($0)) + 74|0);
- $16 = HEAP8[$15>>0]|0;
- $17 = ($16<<24>>24)<(1);
- if ($17) {
- $18 = $13 & -33;
- HEAP32[$0>>2] = $18;
- }
- $19 = ((($0)) + 48|0);
- $20 = HEAP32[$19>>2]|0;
- $21 = ($20|0)==(0);
- if ($21) {
- $23 = ((($0)) + 44|0);
- $24 = HEAP32[$23>>2]|0;
- HEAP32[$23>>2] = $6;
- $25 = ((($0)) + 28|0);
- HEAP32[$25>>2] = $6;
- $26 = ((($0)) + 20|0);
- HEAP32[$26>>2] = $6;
- HEAP32[$19>>2] = 80;
- $27 = ((($6)) + 80|0);
- $28 = ((($0)) + 16|0);
- HEAP32[$28>>2] = $27;
- $29 = (_printf_core($0,$1,$3,$5,$4)|0);
- $30 = ($24|0)==(0|0);
- if ($30) {
- $$1 = $29;
- } else {
- $31 = ((($0)) + 36|0);
- $32 = HEAP32[$31>>2]|0;
- (FUNCTION_TABLE_iiii[$32 & 15]($0,0,0)|0);
- $33 = HEAP32[$26>>2]|0;
- $34 = ($33|0)==(0|0);
- $$ = $34 ? -1 : $29;
- HEAP32[$23>>2] = $24;
- HEAP32[$19>>2] = 0;
- HEAP32[$28>>2] = 0;
- HEAP32[$25>>2] = 0;
- HEAP32[$26>>2] = 0;
- $$1 = $$;
- }
- } else {
- $22 = (_printf_core($0,$1,$3,$5,$4)|0);
- $$1 = $22;
- }
- $35 = HEAP32[$0>>2]|0;
- $36 = $35 & 32;
- $37 = ($36|0)==(0);
- $$1$ = $37 ? $$1 : -1;
- $38 = $35 | $14;
- HEAP32[$0>>2] = $38;
- $39 = ($40|0)==(0);
- if (!($39)) {
- ___unlockfile($0);
- }
- $$0 = $$1$;
- }
- STACKTOP = sp;return ($$0|0);
- }
- function _printf_core($0,$1,$2,$3,$4) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- $4 = $4|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 64|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(64|0);
- $5 = sp + 16|0;
- $6 = sp;
- $7 = sp + 24|0;
- $8 = sp + 8|0;
- $9 = sp + 20|0;
- HEAP32[$5>>2] = $1;
- $10 = ($0|0)!=(0|0);
- $11 = ((($7)) + 40|0);
- $12 = $11;
- $13 = ((($7)) + 39|0);
- $14 = ((($8)) + 4|0);
- $$0243 = 0;$$0247 = 0;$$0269 = 0;$21 = $1;
- L1: while(1) {
- $15 = ($$0247|0)>(-1);
- do {
- if ($15) {
- $16 = (2147483647 - ($$0247))|0;
- $17 = ($$0243|0)>($16|0);
- if ($17) {
- $18 = (___errno_location()|0);
- HEAP32[$18>>2] = 75;
- $$1248 = -1;
- break;
- } else {
- $19 = (($$0243) + ($$0247))|0;
- $$1248 = $19;
- break;
- }
- } else {
- $$1248 = $$0247;
- }
- } while(0);
- $20 = HEAP8[$21>>0]|0;
- $22 = ($20<<24>>24)==(0);
- if ($22) {
- label = 87;
- break;
- } else {
- $23 = $20;$25 = $21;
- }
- L9: while(1) {
- switch ($23<<24>>24) {
- case 37: {
- $$0249306 = $25;$27 = $25;
- label = 9;
- break L9;
- break;
- }
- case 0: {
- $$0249$lcssa = $25;$39 = $25;
- break L9;
- break;
- }
- default: {
- }
- }
- $24 = ((($25)) + 1|0);
- HEAP32[$5>>2] = $24;
- $$pre = HEAP8[$24>>0]|0;
- $23 = $$pre;$25 = $24;
- }
- L12: do {
- if ((label|0) == 9) {
- while(1) {
- label = 0;
- $26 = ((($27)) + 1|0);
- $28 = HEAP8[$26>>0]|0;
- $29 = ($28<<24>>24)==(37);
- if (!($29)) {
- $$0249$lcssa = $$0249306;$39 = $27;
- break L12;
- }
- $30 = ((($$0249306)) + 1|0);
- $31 = ((($27)) + 2|0);
- HEAP32[$5>>2] = $31;
- $32 = HEAP8[$31>>0]|0;
- $33 = ($32<<24>>24)==(37);
- if ($33) {
- $$0249306 = $30;$27 = $31;
- label = 9;
- } else {
- $$0249$lcssa = $30;$39 = $31;
- break;
- }
- }
- }
- } while(0);
- $34 = $$0249$lcssa;
- $35 = $21;
- $36 = (($34) - ($35))|0;
- if ($10) {
- _out($0,$21,$36);
- }
- $37 = ($36|0)==(0);
- if (!($37)) {
- $$0269$phi = $$0269;$$0243 = $36;$$0247 = $$1248;$21 = $39;$$0269 = $$0269$phi;
- continue;
- }
- $38 = ((($39)) + 1|0);
- $40 = HEAP8[$38>>0]|0;
- $41 = $40 << 24 >> 24;
- $isdigittmp = (($41) + -48)|0;
- $isdigit = ($isdigittmp>>>0)<(10);
- if ($isdigit) {
- $42 = ((($39)) + 2|0);
- $43 = HEAP8[$42>>0]|0;
- $44 = ($43<<24>>24)==(36);
- $45 = ((($39)) + 3|0);
- $$377 = $44 ? $45 : $38;
- $$$0269 = $44 ? 1 : $$0269;
- $isdigittmp$ = $44 ? $isdigittmp : -1;
- $$0253 = $isdigittmp$;$$1270 = $$$0269;$storemerge = $$377;
- } else {
- $$0253 = -1;$$1270 = $$0269;$storemerge = $38;
- }
- HEAP32[$5>>2] = $storemerge;
- $46 = HEAP8[$storemerge>>0]|0;
- $47 = $46 << 24 >> 24;
- $48 = (($47) + -32)|0;
- $49 = ($48>>>0)<(32);
- L24: do {
- if ($49) {
- $$0262311 = 0;$329 = $46;$51 = $48;$storemerge273310 = $storemerge;
- while(1) {
- $50 = 1 << $51;
- $52 = $50 & 75913;
- $53 = ($52|0)==(0);
- if ($53) {
- $$0262$lcssa = $$0262311;$$lcssa295 = $329;$62 = $storemerge273310;
- break L24;
- }
- $54 = $50 | $$0262311;
- $55 = ((($storemerge273310)) + 1|0);
- HEAP32[$5>>2] = $55;
- $56 = HEAP8[$55>>0]|0;
- $57 = $56 << 24 >> 24;
- $58 = (($57) + -32)|0;
- $59 = ($58>>>0)<(32);
- if ($59) {
- $$0262311 = $54;$329 = $56;$51 = $58;$storemerge273310 = $55;
- } else {
- $$0262$lcssa = $54;$$lcssa295 = $56;$62 = $55;
- break;
- }
- }
- } else {
- $$0262$lcssa = 0;$$lcssa295 = $46;$62 = $storemerge;
- }
- } while(0);
- $60 = ($$lcssa295<<24>>24)==(42);
- if ($60) {
- $61 = ((($62)) + 1|0);
- $63 = HEAP8[$61>>0]|0;
- $64 = $63 << 24 >> 24;
- $isdigittmp276 = (($64) + -48)|0;
- $isdigit277 = ($isdigittmp276>>>0)<(10);
- if ($isdigit277) {
- $65 = ((($62)) + 2|0);
- $66 = HEAP8[$65>>0]|0;
- $67 = ($66<<24>>24)==(36);
- if ($67) {
- $68 = (($4) + ($isdigittmp276<<2)|0);
- HEAP32[$68>>2] = 10;
- $69 = HEAP8[$61>>0]|0;
- $70 = $69 << 24 >> 24;
- $71 = (($70) + -48)|0;
- $72 = (($3) + ($71<<3)|0);
- $73 = $72;
- $74 = $73;
- $75 = HEAP32[$74>>2]|0;
- $76 = (($73) + 4)|0;
- $77 = $76;
- $78 = HEAP32[$77>>2]|0;
- $79 = ((($62)) + 3|0);
- $$0259 = $75;$$2271 = 1;$storemerge278 = $79;
- } else {
- label = 23;
- }
- } else {
- label = 23;
- }
- if ((label|0) == 23) {
- label = 0;
- $80 = ($$1270|0)==(0);
- if (!($80)) {
- $$0 = -1;
- break;
- }
- if ($10) {
- $arglist_current = HEAP32[$2>>2]|0;
- $81 = $arglist_current;
- $82 = ((0) + 4|0);
- $expanded4 = $82;
- $expanded = (($expanded4) - 1)|0;
- $83 = (($81) + ($expanded))|0;
- $84 = ((0) + 4|0);
- $expanded8 = $84;
- $expanded7 = (($expanded8) - 1)|0;
- $expanded6 = $expanded7 ^ -1;
- $85 = $83 & $expanded6;
- $86 = $85;
- $87 = HEAP32[$86>>2]|0;
- $arglist_next = ((($86)) + 4|0);
- HEAP32[$2>>2] = $arglist_next;
- $$0259 = $87;$$2271 = 0;$storemerge278 = $61;
- } else {
- $$0259 = 0;$$2271 = 0;$storemerge278 = $61;
- }
- }
- HEAP32[$5>>2] = $storemerge278;
- $88 = ($$0259|0)<(0);
- $89 = $$0262$lcssa | 8192;
- $90 = (0 - ($$0259))|0;
- $$$0262 = $88 ? $89 : $$0262$lcssa;
- $$$0259 = $88 ? $90 : $$0259;
- $$1260 = $$$0259;$$1263 = $$$0262;$$3272 = $$2271;$94 = $storemerge278;
- } else {
- $91 = (_getint($5)|0);
- $92 = ($91|0)<(0);
- if ($92) {
- $$0 = -1;
- break;
- }
- $$pre346 = HEAP32[$5>>2]|0;
- $$1260 = $91;$$1263 = $$0262$lcssa;$$3272 = $$1270;$94 = $$pre346;
- }
- $93 = HEAP8[$94>>0]|0;
- $95 = ($93<<24>>24)==(46);
- do {
- if ($95) {
- $96 = ((($94)) + 1|0);
- $97 = HEAP8[$96>>0]|0;
- $98 = ($97<<24>>24)==(42);
- if (!($98)) {
- $125 = ((($94)) + 1|0);
- HEAP32[$5>>2] = $125;
- $126 = (_getint($5)|0);
- $$pre347$pre = HEAP32[$5>>2]|0;
- $$0254 = $126;$$pre347 = $$pre347$pre;
- break;
- }
- $99 = ((($94)) + 2|0);
- $100 = HEAP8[$99>>0]|0;
- $101 = $100 << 24 >> 24;
- $isdigittmp274 = (($101) + -48)|0;
- $isdigit275 = ($isdigittmp274>>>0)<(10);
- if ($isdigit275) {
- $102 = ((($94)) + 3|0);
- $103 = HEAP8[$102>>0]|0;
- $104 = ($103<<24>>24)==(36);
- if ($104) {
- $105 = (($4) + ($isdigittmp274<<2)|0);
- HEAP32[$105>>2] = 10;
- $106 = HEAP8[$99>>0]|0;
- $107 = $106 << 24 >> 24;
- $108 = (($107) + -48)|0;
- $109 = (($3) + ($108<<3)|0);
- $110 = $109;
- $111 = $110;
- $112 = HEAP32[$111>>2]|0;
- $113 = (($110) + 4)|0;
- $114 = $113;
- $115 = HEAP32[$114>>2]|0;
- $116 = ((($94)) + 4|0);
- HEAP32[$5>>2] = $116;
- $$0254 = $112;$$pre347 = $116;
- break;
- }
- }
- $117 = ($$3272|0)==(0);
- if (!($117)) {
- $$0 = -1;
- break L1;
- }
- if ($10) {
- $arglist_current2 = HEAP32[$2>>2]|0;
- $118 = $arglist_current2;
- $119 = ((0) + 4|0);
- $expanded11 = $119;
- $expanded10 = (($expanded11) - 1)|0;
- $120 = (($118) + ($expanded10))|0;
- $121 = ((0) + 4|0);
- $expanded15 = $121;
- $expanded14 = (($expanded15) - 1)|0;
- $expanded13 = $expanded14 ^ -1;
- $122 = $120 & $expanded13;
- $123 = $122;
- $124 = HEAP32[$123>>2]|0;
- $arglist_next3 = ((($123)) + 4|0);
- HEAP32[$2>>2] = $arglist_next3;
- $330 = $124;
- } else {
- $330 = 0;
- }
- HEAP32[$5>>2] = $99;
- $$0254 = $330;$$pre347 = $99;
- } else {
- $$0254 = -1;$$pre347 = $94;
- }
- } while(0);
- $$0252 = 0;$128 = $$pre347;
- while(1) {
- $127 = HEAP8[$128>>0]|0;
- $129 = $127 << 24 >> 24;
- $130 = (($129) + -65)|0;
- $131 = ($130>>>0)>(57);
- if ($131) {
- $$0 = -1;
- break L1;
- }
- $132 = ((($128)) + 1|0);
- HEAP32[$5>>2] = $132;
- $133 = HEAP8[$128>>0]|0;
- $134 = $133 << 24 >> 24;
- $135 = (($134) + -65)|0;
- $136 = ((11154 + (($$0252*58)|0)|0) + ($135)|0);
- $137 = HEAP8[$136>>0]|0;
- $138 = $137&255;
- $139 = (($138) + -1)|0;
- $140 = ($139>>>0)<(8);
- if ($140) {
- $$0252 = $138;$128 = $132;
- } else {
- break;
- }
- }
- $141 = ($137<<24>>24)==(0);
- if ($141) {
- $$0 = -1;
- break;
- }
- $142 = ($137<<24>>24)==(19);
- $143 = ($$0253|0)>(-1);
- do {
- if ($142) {
- if ($143) {
- $$0 = -1;
- break L1;
- } else {
- label = 49;
- }
- } else {
- if ($143) {
- $144 = (($4) + ($$0253<<2)|0);
- HEAP32[$144>>2] = $138;
- $145 = (($3) + ($$0253<<3)|0);
- $146 = $145;
- $147 = $146;
- $148 = HEAP32[$147>>2]|0;
- $149 = (($146) + 4)|0;
- $150 = $149;
- $151 = HEAP32[$150>>2]|0;
- $152 = $6;
- $153 = $152;
- HEAP32[$153>>2] = $148;
- $154 = (($152) + 4)|0;
- $155 = $154;
- HEAP32[$155>>2] = $151;
- label = 49;
- break;
- }
- if (!($10)) {
- $$0 = 0;
- break L1;
- }
- _pop_arg($6,$138,$2);
- }
- } while(0);
- if ((label|0) == 49) {
- label = 0;
- if (!($10)) {
- $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
- continue;
- }
- }
- $156 = HEAP8[$128>>0]|0;
- $157 = $156 << 24 >> 24;
- $158 = ($$0252|0)!=(0);
- $159 = $157 & 15;
- $160 = ($159|0)==(3);
- $or$cond281 = $158 & $160;
- $161 = $157 & -33;
- $$0235 = $or$cond281 ? $161 : $157;
- $162 = $$1263 & 8192;
- $163 = ($162|0)==(0);
- $164 = $$1263 & -65537;
- $$1263$ = $163 ? $$1263 : $164;
- L71: do {
- switch ($$0235|0) {
- case 110: {
- $trunc = $$0252&255;
- switch ($trunc<<24>>24) {
- case 0: {
- $171 = HEAP32[$6>>2]|0;
- HEAP32[$171>>2] = $$1248;
- $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
- continue L1;
- break;
- }
- case 1: {
- $172 = HEAP32[$6>>2]|0;
- HEAP32[$172>>2] = $$1248;
- $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
- continue L1;
- break;
- }
- case 2: {
- $173 = ($$1248|0)<(0);
- $174 = $173 << 31 >> 31;
- $175 = HEAP32[$6>>2]|0;
- $176 = $175;
- $177 = $176;
- HEAP32[$177>>2] = $$1248;
- $178 = (($176) + 4)|0;
- $179 = $178;
- HEAP32[$179>>2] = $174;
- $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
- continue L1;
- break;
- }
- case 3: {
- $180 = $$1248&65535;
- $181 = HEAP32[$6>>2]|0;
- HEAP16[$181>>1] = $180;
- $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
- continue L1;
- break;
- }
- case 4: {
- $182 = $$1248&255;
- $183 = HEAP32[$6>>2]|0;
- HEAP8[$183>>0] = $182;
- $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
- continue L1;
- break;
- }
- case 6: {
- $184 = HEAP32[$6>>2]|0;
- HEAP32[$184>>2] = $$1248;
- $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
- continue L1;
- break;
- }
- case 7: {
- $185 = ($$1248|0)<(0);
- $186 = $185 << 31 >> 31;
- $187 = HEAP32[$6>>2]|0;
- $188 = $187;
- $189 = $188;
- HEAP32[$189>>2] = $$1248;
- $190 = (($188) + 4)|0;
- $191 = $190;
- HEAP32[$191>>2] = $186;
- $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
- continue L1;
- break;
- }
- default: {
- $$0243 = 0;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
- continue L1;
- }
- }
- break;
- }
- case 112: {
- $192 = ($$0254>>>0)>(8);
- $193 = $192 ? $$0254 : 8;
- $194 = $$1263$ | 8;
- $$1236 = 120;$$1255 = $193;$$3265 = $194;
- label = 61;
- break;
- }
- case 88: case 120: {
- $$1236 = $$0235;$$1255 = $$0254;$$3265 = $$1263$;
- label = 61;
- break;
- }
- case 111: {
- $210 = $6;
- $211 = $210;
- $212 = HEAP32[$211>>2]|0;
- $213 = (($210) + 4)|0;
- $214 = $213;
- $215 = HEAP32[$214>>2]|0;
- $216 = (_fmt_o($212,$215,$11)|0);
- $217 = $$1263$ & 8;
- $218 = ($217|0)==(0);
- $219 = $216;
- $220 = (($12) - ($219))|0;
- $221 = ($$0254|0)>($220|0);
- $222 = (($220) + 1)|0;
- $223 = $218 | $221;
- $$0254$$0254$ = $223 ? $$0254 : $222;
- $$0228 = $216;$$1233 = 0;$$1238 = 11618;$$2256 = $$0254$$0254$;$$4266 = $$1263$;$248 = $212;$250 = $215;
- label = 67;
- break;
- }
- case 105: case 100: {
- $224 = $6;
- $225 = $224;
- $226 = HEAP32[$225>>2]|0;
- $227 = (($224) + 4)|0;
- $228 = $227;
- $229 = HEAP32[$228>>2]|0;
- $230 = ($229|0)<(0);
- if ($230) {
- $231 = (_i64Subtract(0,0,($226|0),($229|0))|0);
- $232 = tempRet0;
- $233 = $6;
- $234 = $233;
- HEAP32[$234>>2] = $231;
- $235 = (($233) + 4)|0;
- $236 = $235;
- HEAP32[$236>>2] = $232;
- $$0232 = 1;$$0237 = 11618;$242 = $231;$243 = $232;
- label = 66;
- break L71;
- } else {
- $237 = $$1263$ & 2048;
- $238 = ($237|0)==(0);
- $239 = $$1263$ & 1;
- $240 = ($239|0)==(0);
- $$ = $240 ? 11618 : (11620);
- $$$ = $238 ? $$ : (11619);
- $241 = $$1263$ & 2049;
- $narrow = ($241|0)!=(0);
- $$284$ = $narrow&1;
- $$0232 = $$284$;$$0237 = $$$;$242 = $226;$243 = $229;
- label = 66;
- break L71;
- }
- break;
- }
- case 117: {
- $165 = $6;
- $166 = $165;
- $167 = HEAP32[$166>>2]|0;
- $168 = (($165) + 4)|0;
- $169 = $168;
- $170 = HEAP32[$169>>2]|0;
- $$0232 = 0;$$0237 = 11618;$242 = $167;$243 = $170;
- label = 66;
- break;
- }
- case 99: {
- $259 = $6;
- $260 = $259;
- $261 = HEAP32[$260>>2]|0;
- $262 = (($259) + 4)|0;
- $263 = $262;
- $264 = HEAP32[$263>>2]|0;
- $265 = $261&255;
- HEAP8[$13>>0] = $265;
- $$2 = $13;$$2234 = 0;$$2239 = 11618;$$2251 = $11;$$5 = 1;$$6268 = $164;
- break;
- }
- case 109: {
- $266 = (___errno_location()|0);
- $267 = HEAP32[$266>>2]|0;
- $268 = (_strerror($267)|0);
- $$1 = $268;
- label = 71;
- break;
- }
- case 115: {
- $269 = HEAP32[$6>>2]|0;
- $270 = ($269|0)!=(0|0);
- $271 = $270 ? $269 : 11628;
- $$1 = $271;
- label = 71;
- break;
- }
- case 67: {
- $278 = $6;
- $279 = $278;
- $280 = HEAP32[$279>>2]|0;
- $281 = (($278) + 4)|0;
- $282 = $281;
- $283 = HEAP32[$282>>2]|0;
- HEAP32[$8>>2] = $280;
- HEAP32[$14>>2] = 0;
- HEAP32[$6>>2] = $8;
- $$4258355 = -1;$331 = $8;
- label = 75;
- break;
- }
- case 83: {
- $$pre349 = HEAP32[$6>>2]|0;
- $284 = ($$0254|0)==(0);
- if ($284) {
- _pad_672($0,32,$$1260,0,$$1263$);
- $$0240$lcssa357 = 0;
- label = 84;
- } else {
- $$4258355 = $$0254;$331 = $$pre349;
- label = 75;
- }
- break;
- }
- case 65: case 71: case 70: case 69: case 97: case 103: case 102: case 101: {
- $306 = +HEAPF64[$6>>3];
- $307 = (_fmt_fp($0,$306,$$1260,$$0254,$$1263$,$$0235)|0);
- $$0243 = $307;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
- continue L1;
- break;
- }
- default: {
- $$2 = $21;$$2234 = 0;$$2239 = 11618;$$2251 = $11;$$5 = $$0254;$$6268 = $$1263$;
- }
- }
- } while(0);
- L95: do {
- if ((label|0) == 61) {
- label = 0;
- $195 = $6;
- $196 = $195;
- $197 = HEAP32[$196>>2]|0;
- $198 = (($195) + 4)|0;
- $199 = $198;
- $200 = HEAP32[$199>>2]|0;
- $201 = $$1236 & 32;
- $202 = (_fmt_x($197,$200,$11,$201)|0);
- $203 = ($197|0)==(0);
- $204 = ($200|0)==(0);
- $205 = $203 & $204;
- $206 = $$3265 & 8;
- $207 = ($206|0)==(0);
- $or$cond283 = $207 | $205;
- $208 = $$1236 >> 4;
- $209 = (11618 + ($208)|0);
- $$289 = $or$cond283 ? 11618 : $209;
- $$290 = $or$cond283 ? 0 : 2;
- $$0228 = $202;$$1233 = $$290;$$1238 = $$289;$$2256 = $$1255;$$4266 = $$3265;$248 = $197;$250 = $200;
- label = 67;
- }
- else if ((label|0) == 66) {
- label = 0;
- $244 = (_fmt_u($242,$243,$11)|0);
- $$0228 = $244;$$1233 = $$0232;$$1238 = $$0237;$$2256 = $$0254;$$4266 = $$1263$;$248 = $242;$250 = $243;
- label = 67;
- }
- else if ((label|0) == 71) {
- label = 0;
- $272 = (_memchr($$1,0,$$0254)|0);
- $273 = ($272|0)==(0|0);
- $274 = $272;
- $275 = $$1;
- $276 = (($274) - ($275))|0;
- $277 = (($$1) + ($$0254)|0);
- $$3257 = $273 ? $$0254 : $276;
- $$1250 = $273 ? $277 : $272;
- $$2 = $$1;$$2234 = 0;$$2239 = 11618;$$2251 = $$1250;$$5 = $$3257;$$6268 = $164;
- }
- else if ((label|0) == 75) {
- label = 0;
- $$0229322 = $331;$$0240321 = 0;$$1244320 = 0;
- while(1) {
- $285 = HEAP32[$$0229322>>2]|0;
- $286 = ($285|0)==(0);
- if ($286) {
- $$0240$lcssa = $$0240321;$$2245 = $$1244320;
- break;
- }
- $287 = (_wctomb($9,$285)|0);
- $288 = ($287|0)<(0);
- $289 = (($$4258355) - ($$0240321))|0;
- $290 = ($287>>>0)>($289>>>0);
- $or$cond286 = $288 | $290;
- if ($or$cond286) {
- $$0240$lcssa = $$0240321;$$2245 = $287;
- break;
- }
- $291 = ((($$0229322)) + 4|0);
- $292 = (($287) + ($$0240321))|0;
- $293 = ($$4258355>>>0)>($292>>>0);
- if ($293) {
- $$0229322 = $291;$$0240321 = $292;$$1244320 = $287;
- } else {
- $$0240$lcssa = $292;$$2245 = $287;
- break;
- }
- }
- $294 = ($$2245|0)<(0);
- if ($294) {
- $$0 = -1;
- break L1;
- }
- _pad_672($0,32,$$1260,$$0240$lcssa,$$1263$);
- $295 = ($$0240$lcssa|0)==(0);
- if ($295) {
- $$0240$lcssa357 = 0;
- label = 84;
- } else {
- $$1230333 = $331;$$1241332 = 0;
- while(1) {
- $296 = HEAP32[$$1230333>>2]|0;
- $297 = ($296|0)==(0);
- if ($297) {
- $$0240$lcssa357 = $$0240$lcssa;
- label = 84;
- break L95;
- }
- $298 = (_wctomb($9,$296)|0);
- $299 = (($298) + ($$1241332))|0;
- $300 = ($299|0)>($$0240$lcssa|0);
- if ($300) {
- $$0240$lcssa357 = $$0240$lcssa;
- label = 84;
- break L95;
- }
- $301 = ((($$1230333)) + 4|0);
- _out($0,$9,$298);
- $302 = ($299>>>0)<($$0240$lcssa>>>0);
- if ($302) {
- $$1230333 = $301;$$1241332 = $299;
- } else {
- $$0240$lcssa357 = $$0240$lcssa;
- label = 84;
- break;
- }
- }
- }
- }
- } while(0);
- if ((label|0) == 67) {
- label = 0;
- $245 = ($$2256|0)>(-1);
- $246 = $$4266 & -65537;
- $$$4266 = $245 ? $246 : $$4266;
- $247 = ($248|0)!=(0);
- $249 = ($250|0)!=(0);
- $251 = $247 | $249;
- $252 = ($$2256|0)!=(0);
- $or$cond = $252 | $251;
- $253 = $$0228;
- $254 = (($12) - ($253))|0;
- $255 = $251 ^ 1;
- $256 = $255&1;
- $257 = (($256) + ($254))|0;
- $258 = ($$2256|0)>($257|0);
- $$2256$ = $258 ? $$2256 : $257;
- $$2256$$$2256 = $or$cond ? $$2256$ : $$2256;
- $$0228$ = $or$cond ? $$0228 : $11;
- $$2 = $$0228$;$$2234 = $$1233;$$2239 = $$1238;$$2251 = $11;$$5 = $$2256$$$2256;$$6268 = $$$4266;
- }
- else if ((label|0) == 84) {
- label = 0;
- $303 = $$1263$ ^ 8192;
- _pad_672($0,32,$$1260,$$0240$lcssa357,$303);
- $304 = ($$1260|0)>($$0240$lcssa357|0);
- $305 = $304 ? $$1260 : $$0240$lcssa357;
- $$0243 = $305;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
- continue;
- }
- $308 = $$2251;
- $309 = $$2;
- $310 = (($308) - ($309))|0;
- $311 = ($$5|0)<($310|0);
- $$$5 = $311 ? $310 : $$5;
- $312 = (($$$5) + ($$2234))|0;
- $313 = ($$1260|0)<($312|0);
- $$2261 = $313 ? $312 : $$1260;
- _pad_672($0,32,$$2261,$312,$$6268);
- _out($0,$$2239,$$2234);
- $314 = $$6268 ^ 65536;
- _pad_672($0,48,$$2261,$312,$314);
- _pad_672($0,48,$$$5,$310,0);
- _out($0,$$2,$310);
- $315 = $$6268 ^ 8192;
- _pad_672($0,32,$$2261,$312,$315);
- $$0243 = $$2261;$$0247 = $$1248;$$0269 = $$3272;$21 = $132;
- }
- L114: do {
- if ((label|0) == 87) {
- $316 = ($0|0)==(0|0);
- if ($316) {
- $317 = ($$0269|0)==(0);
- if ($317) {
- $$0 = 0;
- } else {
- $$2242305 = 1;
- while(1) {
- $318 = (($4) + ($$2242305<<2)|0);
- $319 = HEAP32[$318>>2]|0;
- $320 = ($319|0)==(0);
- if ($320) {
- $$3303 = $$2242305;
- break;
- }
- $321 = (($3) + ($$2242305<<3)|0);
- _pop_arg($321,$319,$2);
- $322 = (($$2242305) + 1)|0;
- $323 = ($322|0)<(10);
- if ($323) {
- $$2242305 = $322;
- } else {
- $$0 = 1;
- break L114;
- }
- }
- while(1) {
- $326 = (($4) + ($$3303<<2)|0);
- $327 = HEAP32[$326>>2]|0;
- $328 = ($327|0)==(0);
- $325 = (($$3303) + 1)|0;
- if (!($328)) {
- $$0 = -1;
- break L114;
- }
- $324 = ($325|0)<(10);
- if ($324) {
- $$3303 = $325;
- } else {
- $$0 = 1;
- break;
- }
- }
- }
- } else {
- $$0 = $$1248;
- }
- }
- } while(0);
- STACKTOP = sp;return ($$0|0);
- }
- function ___lockfile($0) {
- $0 = $0|0;
- var label = 0, sp = 0;
- sp = STACKTOP;
- return 0;
- }
- function ___unlockfile($0) {
- $0 = $0|0;
- var label = 0, sp = 0;
- sp = STACKTOP;
- return;
- }
- function _out($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- var $3 = 0, $4 = 0, $5 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $3 = HEAP32[$0>>2]|0;
- $4 = $3 & 32;
- $5 = ($4|0)==(0);
- if ($5) {
- (___fwritex($1,$2,$0)|0);
- }
- return;
- }
- function _getint($0) {
- $0 = $0|0;
- 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;
- sp = STACKTOP;
- $1 = HEAP32[$0>>2]|0;
- $2 = HEAP8[$1>>0]|0;
- $3 = $2 << 24 >> 24;
- $isdigittmp4 = (($3) + -48)|0;
- $isdigit5 = ($isdigittmp4>>>0)<(10);
- if ($isdigit5) {
- $$06 = 0;$7 = $1;$isdigittmp7 = $isdigittmp4;
- while(1) {
- $4 = ($$06*10)|0;
- $5 = (($isdigittmp7) + ($4))|0;
- $6 = ((($7)) + 1|0);
- HEAP32[$0>>2] = $6;
- $8 = HEAP8[$6>>0]|0;
- $9 = $8 << 24 >> 24;
- $isdigittmp = (($9) + -48)|0;
- $isdigit = ($isdigittmp>>>0)<(10);
- if ($isdigit) {
- $$06 = $5;$7 = $6;$isdigittmp7 = $isdigittmp;
- } else {
- $$0$lcssa = $5;
- break;
- }
- }
- } else {
- $$0$lcssa = 0;
- }
- return ($$0$lcssa|0);
- }
- function _pop_arg($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- var $expanded88 = 0, $expanded90 = 0, $expanded91 = 0, $expanded93 = 0, $expanded94 = 0, $expanded95 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $3 = ($1>>>0)>(20);
- L1: do {
- if (!($3)) {
- do {
- switch ($1|0) {
- case 9: {
- $arglist_current = HEAP32[$2>>2]|0;
- $4 = $arglist_current;
- $5 = ((0) + 4|0);
- $expanded28 = $5;
- $expanded = (($expanded28) - 1)|0;
- $6 = (($4) + ($expanded))|0;
- $7 = ((0) + 4|0);
- $expanded32 = $7;
- $expanded31 = (($expanded32) - 1)|0;
- $expanded30 = $expanded31 ^ -1;
- $8 = $6 & $expanded30;
- $9 = $8;
- $10 = HEAP32[$9>>2]|0;
- $arglist_next = ((($9)) + 4|0);
- HEAP32[$2>>2] = $arglist_next;
- HEAP32[$0>>2] = $10;
- break L1;
- break;
- }
- case 10: {
- $arglist_current2 = HEAP32[$2>>2]|0;
- $11 = $arglist_current2;
- $12 = ((0) + 4|0);
- $expanded35 = $12;
- $expanded34 = (($expanded35) - 1)|0;
- $13 = (($11) + ($expanded34))|0;
- $14 = ((0) + 4|0);
- $expanded39 = $14;
- $expanded38 = (($expanded39) - 1)|0;
- $expanded37 = $expanded38 ^ -1;
- $15 = $13 & $expanded37;
- $16 = $15;
- $17 = HEAP32[$16>>2]|0;
- $arglist_next3 = ((($16)) + 4|0);
- HEAP32[$2>>2] = $arglist_next3;
- $18 = ($17|0)<(0);
- $19 = $18 << 31 >> 31;
- $20 = $0;
- $21 = $20;
- HEAP32[$21>>2] = $17;
- $22 = (($20) + 4)|0;
- $23 = $22;
- HEAP32[$23>>2] = $19;
- break L1;
- break;
- }
- case 11: {
- $arglist_current5 = HEAP32[$2>>2]|0;
- $24 = $arglist_current5;
- $25 = ((0) + 4|0);
- $expanded42 = $25;
- $expanded41 = (($expanded42) - 1)|0;
- $26 = (($24) + ($expanded41))|0;
- $27 = ((0) + 4|0);
- $expanded46 = $27;
- $expanded45 = (($expanded46) - 1)|0;
- $expanded44 = $expanded45 ^ -1;
- $28 = $26 & $expanded44;
- $29 = $28;
- $30 = HEAP32[$29>>2]|0;
- $arglist_next6 = ((($29)) + 4|0);
- HEAP32[$2>>2] = $arglist_next6;
- $31 = $0;
- $32 = $31;
- HEAP32[$32>>2] = $30;
- $33 = (($31) + 4)|0;
- $34 = $33;
- HEAP32[$34>>2] = 0;
- break L1;
- break;
- }
- case 12: {
- $arglist_current8 = HEAP32[$2>>2]|0;
- $35 = $arglist_current8;
- $36 = ((0) + 8|0);
- $expanded49 = $36;
- $expanded48 = (($expanded49) - 1)|0;
- $37 = (($35) + ($expanded48))|0;
- $38 = ((0) + 8|0);
- $expanded53 = $38;
- $expanded52 = (($expanded53) - 1)|0;
- $expanded51 = $expanded52 ^ -1;
- $39 = $37 & $expanded51;
- $40 = $39;
- $41 = $40;
- $42 = $41;
- $43 = HEAP32[$42>>2]|0;
- $44 = (($41) + 4)|0;
- $45 = $44;
- $46 = HEAP32[$45>>2]|0;
- $arglist_next9 = ((($40)) + 8|0);
- HEAP32[$2>>2] = $arglist_next9;
- $47 = $0;
- $48 = $47;
- HEAP32[$48>>2] = $43;
- $49 = (($47) + 4)|0;
- $50 = $49;
- HEAP32[$50>>2] = $46;
- break L1;
- break;
- }
- case 13: {
- $arglist_current11 = HEAP32[$2>>2]|0;
- $51 = $arglist_current11;
- $52 = ((0) + 4|0);
- $expanded56 = $52;
- $expanded55 = (($expanded56) - 1)|0;
- $53 = (($51) + ($expanded55))|0;
- $54 = ((0) + 4|0);
- $expanded60 = $54;
- $expanded59 = (($expanded60) - 1)|0;
- $expanded58 = $expanded59 ^ -1;
- $55 = $53 & $expanded58;
- $56 = $55;
- $57 = HEAP32[$56>>2]|0;
- $arglist_next12 = ((($56)) + 4|0);
- HEAP32[$2>>2] = $arglist_next12;
- $58 = $57&65535;
- $59 = $58 << 16 >> 16;
- $60 = ($59|0)<(0);
- $61 = $60 << 31 >> 31;
- $62 = $0;
- $63 = $62;
- HEAP32[$63>>2] = $59;
- $64 = (($62) + 4)|0;
- $65 = $64;
- HEAP32[$65>>2] = $61;
- break L1;
- break;
- }
- case 14: {
- $arglist_current14 = HEAP32[$2>>2]|0;
- $66 = $arglist_current14;
- $67 = ((0) + 4|0);
- $expanded63 = $67;
- $expanded62 = (($expanded63) - 1)|0;
- $68 = (($66) + ($expanded62))|0;
- $69 = ((0) + 4|0);
- $expanded67 = $69;
- $expanded66 = (($expanded67) - 1)|0;
- $expanded65 = $expanded66 ^ -1;
- $70 = $68 & $expanded65;
- $71 = $70;
- $72 = HEAP32[$71>>2]|0;
- $arglist_next15 = ((($71)) + 4|0);
- HEAP32[$2>>2] = $arglist_next15;
- $$mask31 = $72 & 65535;
- $73 = $0;
- $74 = $73;
- HEAP32[$74>>2] = $$mask31;
- $75 = (($73) + 4)|0;
- $76 = $75;
- HEAP32[$76>>2] = 0;
- break L1;
- break;
- }
- case 15: {
- $arglist_current17 = HEAP32[$2>>2]|0;
- $77 = $arglist_current17;
- $78 = ((0) + 4|0);
- $expanded70 = $78;
- $expanded69 = (($expanded70) - 1)|0;
- $79 = (($77) + ($expanded69))|0;
- $80 = ((0) + 4|0);
- $expanded74 = $80;
- $expanded73 = (($expanded74) - 1)|0;
- $expanded72 = $expanded73 ^ -1;
- $81 = $79 & $expanded72;
- $82 = $81;
- $83 = HEAP32[$82>>2]|0;
- $arglist_next18 = ((($82)) + 4|0);
- HEAP32[$2>>2] = $arglist_next18;
- $84 = $83&255;
- $85 = $84 << 24 >> 24;
- $86 = ($85|0)<(0);
- $87 = $86 << 31 >> 31;
- $88 = $0;
- $89 = $88;
- HEAP32[$89>>2] = $85;
- $90 = (($88) + 4)|0;
- $91 = $90;
- HEAP32[$91>>2] = $87;
- break L1;
- break;
- }
- case 16: {
- $arglist_current20 = HEAP32[$2>>2]|0;
- $92 = $arglist_current20;
- $93 = ((0) + 4|0);
- $expanded77 = $93;
- $expanded76 = (($expanded77) - 1)|0;
- $94 = (($92) + ($expanded76))|0;
- $95 = ((0) + 4|0);
- $expanded81 = $95;
- $expanded80 = (($expanded81) - 1)|0;
- $expanded79 = $expanded80 ^ -1;
- $96 = $94 & $expanded79;
- $97 = $96;
- $98 = HEAP32[$97>>2]|0;
- $arglist_next21 = ((($97)) + 4|0);
- HEAP32[$2>>2] = $arglist_next21;
- $$mask = $98 & 255;
- $99 = $0;
- $100 = $99;
- HEAP32[$100>>2] = $$mask;
- $101 = (($99) + 4)|0;
- $102 = $101;
- HEAP32[$102>>2] = 0;
- break L1;
- break;
- }
- case 17: {
- $arglist_current23 = HEAP32[$2>>2]|0;
- $103 = $arglist_current23;
- $104 = ((0) + 8|0);
- $expanded84 = $104;
- $expanded83 = (($expanded84) - 1)|0;
- $105 = (($103) + ($expanded83))|0;
- $106 = ((0) + 8|0);
- $expanded88 = $106;
- $expanded87 = (($expanded88) - 1)|0;
- $expanded86 = $expanded87 ^ -1;
- $107 = $105 & $expanded86;
- $108 = $107;
- $109 = +HEAPF64[$108>>3];
- $arglist_next24 = ((($108)) + 8|0);
- HEAP32[$2>>2] = $arglist_next24;
- HEAPF64[$0>>3] = $109;
- break L1;
- break;
- }
- case 18: {
- $arglist_current26 = HEAP32[$2>>2]|0;
- $110 = $arglist_current26;
- $111 = ((0) + 8|0);
- $expanded91 = $111;
- $expanded90 = (($expanded91) - 1)|0;
- $112 = (($110) + ($expanded90))|0;
- $113 = ((0) + 8|0);
- $expanded95 = $113;
- $expanded94 = (($expanded95) - 1)|0;
- $expanded93 = $expanded94 ^ -1;
- $114 = $112 & $expanded93;
- $115 = $114;
- $116 = +HEAPF64[$115>>3];
- $arglist_next27 = ((($115)) + 8|0);
- HEAP32[$2>>2] = $arglist_next27;
- HEAPF64[$0>>3] = $116;
- break L1;
- break;
- }
- default: {
- break L1;
- }
- }
- } while(0);
- }
- } while(0);
- return;
- }
- function _fmt_x($0,$1,$2,$3) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- 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;
- var sp = 0;
- sp = STACKTOP;
- $4 = ($0|0)==(0);
- $5 = ($1|0)==(0);
- $6 = $4 & $5;
- if ($6) {
- $$05$lcssa = $2;
- } else {
- $$056 = $2;$15 = $1;$8 = $0;
- while(1) {
- $7 = $8 & 15;
- $9 = (11670 + ($7)|0);
- $10 = HEAP8[$9>>0]|0;
- $11 = $10&255;
- $12 = $11 | $3;
- $13 = $12&255;
- $14 = ((($$056)) + -1|0);
- HEAP8[$14>>0] = $13;
- $16 = (_bitshift64Lshr(($8|0),($15|0),4)|0);
- $17 = tempRet0;
- $18 = ($16|0)==(0);
- $19 = ($17|0)==(0);
- $20 = $18 & $19;
- if ($20) {
- $$05$lcssa = $14;
- break;
- } else {
- $$056 = $14;$15 = $17;$8 = $16;
- }
- }
- }
- return ($$05$lcssa|0);
- }
- function _fmt_o($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- sp = STACKTOP;
- $3 = ($0|0)==(0);
- $4 = ($1|0)==(0);
- $5 = $3 & $4;
- if ($5) {
- $$0$lcssa = $2;
- } else {
- $$06 = $2;$11 = $1;$7 = $0;
- while(1) {
- $6 = $7&255;
- $8 = $6 & 7;
- $9 = $8 | 48;
- $10 = ((($$06)) + -1|0);
- HEAP8[$10>>0] = $9;
- $12 = (_bitshift64Lshr(($7|0),($11|0),3)|0);
- $13 = tempRet0;
- $14 = ($12|0)==(0);
- $15 = ($13|0)==(0);
- $16 = $14 & $15;
- if ($16) {
- $$0$lcssa = $10;
- break;
- } else {
- $$06 = $10;$11 = $13;$7 = $12;
- }
- }
- }
- return ($$0$lcssa|0);
- }
- function _fmt_u($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- 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;
- sp = STACKTOP;
- $3 = ($1>>>0)>(0);
- $4 = ($0>>>0)>(4294967295);
- $5 = ($1|0)==(0);
- $6 = $5 & $4;
- $7 = $3 | $6;
- if ($7) {
- $$0914 = $2;$8 = $0;$9 = $1;
- while(1) {
- $10 = (___uremdi3(($8|0),($9|0),10,0)|0);
- $11 = tempRet0;
- $12 = $10&255;
- $13 = $12 | 48;
- $14 = ((($$0914)) + -1|0);
- HEAP8[$14>>0] = $13;
- $15 = (___udivdi3(($8|0),($9|0),10,0)|0);
- $16 = tempRet0;
- $17 = ($9>>>0)>(9);
- $18 = ($8>>>0)>(4294967295);
- $19 = ($9|0)==(9);
- $20 = $19 & $18;
- $21 = $17 | $20;
- if ($21) {
- $$0914 = $14;$8 = $15;$9 = $16;
- } else {
- break;
- }
- }
- $$010$lcssa$off0 = $15;$$09$lcssa = $14;
- } else {
- $$010$lcssa$off0 = $0;$$09$lcssa = $2;
- }
- $22 = ($$010$lcssa$off0|0)==(0);
- if ($22) {
- $$1$lcssa = $$09$lcssa;
- } else {
- $$012 = $$010$lcssa$off0;$$111 = $$09$lcssa;
- while(1) {
- $23 = (($$012>>>0) % 10)&-1;
- $24 = $23 | 48;
- $25 = $24&255;
- $26 = ((($$111)) + -1|0);
- HEAP8[$26>>0] = $25;
- $27 = (($$012>>>0) / 10)&-1;
- $28 = ($$012>>>0)<(10);
- if ($28) {
- $$1$lcssa = $26;
- break;
- } else {
- $$012 = $27;$$111 = $26;
- }
- }
- }
- return ($$1$lcssa|0);
- }
- function _strerror($0) {
- $0 = $0|0;
- var $1 = 0, $2 = 0, $3 = 0, $4 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = (___pthread_self_105()|0);
- $2 = ((($1)) + 188|0);
- $3 = HEAP32[$2>>2]|0;
- $4 = (___strerror_l($0,$3)|0);
- return ($4|0);
- }
- function _memchr($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- $3 = $1 & 255;
- $4 = $0;
- $5 = $4 & 3;
- $6 = ($5|0)!=(0);
- $7 = ($2|0)!=(0);
- $or$cond53 = $7 & $6;
- L1: do {
- if ($or$cond53) {
- $8 = $1&255;
- $$03555 = $0;$$03654 = $2;
- while(1) {
- $9 = HEAP8[$$03555>>0]|0;
- $10 = ($9<<24>>24)==($8<<24>>24);
- if ($10) {
- $$035$lcssa65 = $$03555;$$036$lcssa64 = $$03654;
- label = 6;
- break L1;
- }
- $11 = ((($$03555)) + 1|0);
- $12 = (($$03654) + -1)|0;
- $13 = $11;
- $14 = $13 & 3;
- $15 = ($14|0)!=(0);
- $16 = ($12|0)!=(0);
- $or$cond = $16 & $15;
- if ($or$cond) {
- $$03555 = $11;$$03654 = $12;
- } else {
- $$035$lcssa = $11;$$036$lcssa = $12;$$lcssa = $16;
- label = 5;
- break;
- }
- }
- } else {
- $$035$lcssa = $0;$$036$lcssa = $2;$$lcssa = $7;
- label = 5;
- }
- } while(0);
- if ((label|0) == 5) {
- if ($$lcssa) {
- $$035$lcssa65 = $$035$lcssa;$$036$lcssa64 = $$036$lcssa;
- label = 6;
- } else {
- $$2 = $$035$lcssa;$$3 = 0;
- }
- }
- L8: do {
- if ((label|0) == 6) {
- $17 = HEAP8[$$035$lcssa65>>0]|0;
- $18 = $1&255;
- $19 = ($17<<24>>24)==($18<<24>>24);
- if ($19) {
- $$2 = $$035$lcssa65;$$3 = $$036$lcssa64;
- } else {
- $20 = Math_imul($3, 16843009)|0;
- $21 = ($$036$lcssa64>>>0)>(3);
- L11: do {
- if ($21) {
- $$046 = $$035$lcssa65;$$13745 = $$036$lcssa64;
- while(1) {
- $22 = HEAP32[$$046>>2]|0;
- $23 = $22 ^ $20;
- $24 = (($23) + -16843009)|0;
- $25 = $23 & -2139062144;
- $26 = $25 ^ -2139062144;
- $27 = $26 & $24;
- $28 = ($27|0)==(0);
- if (!($28)) {
- break;
- }
- $29 = ((($$046)) + 4|0);
- $30 = (($$13745) + -4)|0;
- $31 = ($30>>>0)>(3);
- if ($31) {
- $$046 = $29;$$13745 = $30;
- } else {
- $$0$lcssa = $29;$$137$lcssa = $30;
- label = 11;
- break L11;
- }
- }
- $$140 = $$046;$$23839 = $$13745;
- } else {
- $$0$lcssa = $$035$lcssa65;$$137$lcssa = $$036$lcssa64;
- label = 11;
- }
- } while(0);
- if ((label|0) == 11) {
- $32 = ($$137$lcssa|0)==(0);
- if ($32) {
- $$2 = $$0$lcssa;$$3 = 0;
- break;
- } else {
- $$140 = $$0$lcssa;$$23839 = $$137$lcssa;
- }
- }
- while(1) {
- $33 = HEAP8[$$140>>0]|0;
- $34 = ($33<<24>>24)==($18<<24>>24);
- if ($34) {
- $$2 = $$140;$$3 = $$23839;
- break L8;
- }
- $35 = ((($$140)) + 1|0);
- $36 = (($$23839) + -1)|0;
- $37 = ($36|0)==(0);
- if ($37) {
- $$2 = $35;$$3 = 0;
- break;
- } else {
- $$140 = $35;$$23839 = $36;
- }
- }
- }
- }
- } while(0);
- $38 = ($$3|0)!=(0);
- $39 = $38 ? $$2 : 0;
- return ($39|0);
- }
- function _pad_672($0,$1,$2,$3,$4) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- $4 = $4|0;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 256|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(256|0);
- $5 = sp;
- $6 = $4 & 73728;
- $7 = ($6|0)==(0);
- $8 = ($2|0)>($3|0);
- $or$cond = $8 & $7;
- if ($or$cond) {
- $9 = (($2) - ($3))|0;
- $10 = ($9>>>0)<(256);
- $11 = $10 ? $9 : 256;
- _memset(($5|0),($1|0),($11|0))|0;
- $12 = ($9>>>0)>(255);
- if ($12) {
- $13 = (($2) - ($3))|0;
- $$011 = $9;
- while(1) {
- _out($0,$5,256);
- $14 = (($$011) + -256)|0;
- $15 = ($14>>>0)>(255);
- if ($15) {
- $$011 = $14;
- } else {
- break;
- }
- }
- $16 = $13 & 255;
- $$0$lcssa = $16;
- } else {
- $$0$lcssa = $9;
- }
- _out($0,$5,$$0$lcssa);
- }
- STACKTOP = sp;return;
- }
- function _wctomb($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- var $$0 = 0, $2 = 0, $3 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $2 = ($0|0)==(0|0);
- if ($2) {
- $$0 = 0;
- } else {
- $3 = (_wcrtomb($0,$1,0)|0);
- $$0 = $3;
- }
- return ($$0|0);
- }
- function _fmt_fp($0,$1,$2,$3,$4,$5) {
- $0 = $0|0;
- $1 = +$1;
- $2 = $2|0;
- $3 = $3|0;
- $4 = $4|0;
- $5 = $5|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 560|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(560|0);
- $6 = sp + 8|0;
- $7 = sp;
- $8 = sp + 524|0;
- $9 = $8;
- $10 = sp + 512|0;
- HEAP32[$7>>2] = 0;
- $11 = ((($10)) + 12|0);
- (___DOUBLE_BITS_673($1)|0);
- $12 = tempRet0;
- $13 = ($12|0)<(0);
- if ($13) {
- $14 = -$1;
- $$0471 = $14;$$0520 = 1;$$0521 = 11635;
- } else {
- $15 = $4 & 2048;
- $16 = ($15|0)==(0);
- $17 = $4 & 1;
- $18 = ($17|0)==(0);
- $$ = $18 ? (11636) : (11641);
- $$$ = $16 ? $$ : (11638);
- $19 = $4 & 2049;
- $narrow = ($19|0)!=(0);
- $$534$ = $narrow&1;
- $$0471 = $1;$$0520 = $$534$;$$0521 = $$$;
- }
- (___DOUBLE_BITS_673($$0471)|0);
- $20 = tempRet0;
- $21 = $20 & 2146435072;
- $22 = ($21>>>0)<(2146435072);
- $23 = (0)<(0);
- $24 = ($21|0)==(2146435072);
- $25 = $24 & $23;
- $26 = $22 | $25;
- do {
- if ($26) {
- $35 = (+_frexpl($$0471,$7));
- $36 = $35 * 2.0;
- $37 = $36 != 0.0;
- if ($37) {
- $38 = HEAP32[$7>>2]|0;
- $39 = (($38) + -1)|0;
- HEAP32[$7>>2] = $39;
- }
- $40 = $5 | 32;
- $41 = ($40|0)==(97);
- if ($41) {
- $42 = $5 & 32;
- $43 = ($42|0)==(0);
- $44 = ((($$0521)) + 9|0);
- $$0521$ = $43 ? $$0521 : $44;
- $45 = $$0520 | 2;
- $46 = ($3>>>0)>(11);
- $47 = (12 - ($3))|0;
- $48 = ($47|0)==(0);
- $49 = $46 | $48;
- do {
- if ($49) {
- $$1472 = $36;
- } else {
- $$0509582 = 8.0;$$1508583 = $47;
- while(1) {
- $50 = (($$1508583) + -1)|0;
- $51 = $$0509582 * 16.0;
- $52 = ($50|0)==(0);
- if ($52) {
- break;
- } else {
- $$0509582 = $51;$$1508583 = $50;
- }
- }
- $53 = HEAP8[$$0521$>>0]|0;
- $54 = ($53<<24>>24)==(45);
- if ($54) {
- $55 = -$36;
- $56 = $55 - $51;
- $57 = $51 + $56;
- $58 = -$57;
- $$1472 = $58;
- break;
- } else {
- $59 = $36 + $51;
- $60 = $59 - $51;
- $$1472 = $60;
- break;
- }
- }
- } while(0);
- $61 = HEAP32[$7>>2]|0;
- $62 = ($61|0)<(0);
- $63 = (0 - ($61))|0;
- $64 = $62 ? $63 : $61;
- $65 = ($64|0)<(0);
- $66 = $65 << 31 >> 31;
- $67 = (_fmt_u($64,$66,$11)|0);
- $68 = ($67|0)==($11|0);
- if ($68) {
- $69 = ((($10)) + 11|0);
- HEAP8[$69>>0] = 48;
- $$0511 = $69;
- } else {
- $$0511 = $67;
- }
- $70 = $61 >> 31;
- $71 = $70 & 2;
- $72 = (($71) + 43)|0;
- $73 = $72&255;
- $74 = ((($$0511)) + -1|0);
- HEAP8[$74>>0] = $73;
- $75 = (($5) + 15)|0;
- $76 = $75&255;
- $77 = ((($$0511)) + -2|0);
- HEAP8[$77>>0] = $76;
- $notrhs = ($3|0)<(1);
- $78 = $4 & 8;
- $79 = ($78|0)==(0);
- $$0523 = $8;$$2473 = $$1472;
- while(1) {
- $80 = (~~(($$2473)));
- $81 = (11670 + ($80)|0);
- $82 = HEAP8[$81>>0]|0;
- $83 = $82&255;
- $84 = $83 | $42;
- $85 = $84&255;
- $86 = ((($$0523)) + 1|0);
- HEAP8[$$0523>>0] = $85;
- $87 = (+($80|0));
- $88 = $$2473 - $87;
- $89 = $88 * 16.0;
- $90 = $86;
- $91 = (($90) - ($9))|0;
- $92 = ($91|0)==(1);
- if ($92) {
- $notlhs = $89 == 0.0;
- $or$cond3$not = $notrhs & $notlhs;
- $or$cond = $79 & $or$cond3$not;
- if ($or$cond) {
- $$1524 = $86;
- } else {
- $93 = ((($$0523)) + 2|0);
- HEAP8[$86>>0] = 46;
- $$1524 = $93;
- }
- } else {
- $$1524 = $86;
- }
- $94 = $89 != 0.0;
- if ($94) {
- $$0523 = $$1524;$$2473 = $89;
- } else {
- break;
- }
- }
- $95 = ($3|0)!=(0);
- $96 = $77;
- $97 = $11;
- $98 = $$1524;
- $99 = (($98) - ($9))|0;
- $100 = (($97) - ($96))|0;
- $101 = (($99) + -2)|0;
- $102 = ($101|0)<($3|0);
- $or$cond537 = $95 & $102;
- $103 = (($3) + 2)|0;
- $$pn = $or$cond537 ? $103 : $99;
- $$0525 = (($100) + ($45))|0;
- $104 = (($$0525) + ($$pn))|0;
- _pad_672($0,32,$2,$104,$4);
- _out($0,$$0521$,$45);
- $105 = $4 ^ 65536;
- _pad_672($0,48,$2,$104,$105);
- _out($0,$8,$99);
- $106 = (($$pn) - ($99))|0;
- _pad_672($0,48,$106,0,0);
- _out($0,$77,$100);
- $107 = $4 ^ 8192;
- _pad_672($0,32,$2,$104,$107);
- $$sink562 = $104;
- break;
- }
- $108 = ($3|0)<(0);
- $$539 = $108 ? 6 : $3;
- if ($37) {
- $109 = $36 * 268435456.0;
- $110 = HEAP32[$7>>2]|0;
- $111 = (($110) + -28)|0;
- HEAP32[$7>>2] = $111;
- $$3 = $109;$$pr = $111;
- } else {
- $$pre = HEAP32[$7>>2]|0;
- $$3 = $36;$$pr = $$pre;
- }
- $112 = ($$pr|0)<(0);
- $113 = ((($6)) + 288|0);
- $$556 = $112 ? $6 : $113;
- $$0498 = $$556;$$4 = $$3;
- while(1) {
- $114 = (~~(($$4))>>>0);
- HEAP32[$$0498>>2] = $114;
- $115 = ((($$0498)) + 4|0);
- $116 = (+($114>>>0));
- $117 = $$4 - $116;
- $118 = $117 * 1.0E+9;
- $119 = $118 != 0.0;
- if ($119) {
- $$0498 = $115;$$4 = $118;
- } else {
- break;
- }
- }
- $120 = ($$pr|0)>(0);
- if ($120) {
- $$1482661 = $$556;$$1499660 = $115;$122 = $$pr;
- while(1) {
- $121 = ($122|0)<(29);
- $123 = $121 ? $122 : 29;
- $$0488653 = ((($$1499660)) + -4|0);
- $124 = ($$0488653>>>0)<($$1482661>>>0);
- if ($124) {
- $$2483$ph = $$1482661;
- } else {
- $$0488655 = $$0488653;$$0497654 = 0;
- while(1) {
- $125 = HEAP32[$$0488655>>2]|0;
- $126 = (_bitshift64Shl(($125|0),0,($123|0))|0);
- $127 = tempRet0;
- $128 = (_i64Add(($126|0),($127|0),($$0497654|0),0)|0);
- $129 = tempRet0;
- $130 = (___uremdi3(($128|0),($129|0),1000000000,0)|0);
- $131 = tempRet0;
- HEAP32[$$0488655>>2] = $130;
- $132 = (___udivdi3(($128|0),($129|0),1000000000,0)|0);
- $133 = tempRet0;
- $$0488 = ((($$0488655)) + -4|0);
- $134 = ($$0488>>>0)<($$1482661>>>0);
- if ($134) {
- break;
- } else {
- $$0488655 = $$0488;$$0497654 = $132;
- }
- }
- $135 = ($132|0)==(0);
- if ($135) {
- $$2483$ph = $$1482661;
- } else {
- $136 = ((($$1482661)) + -4|0);
- HEAP32[$136>>2] = $132;
- $$2483$ph = $136;
- }
- }
- $$2500 = $$1499660;
- while(1) {
- $137 = ($$2500>>>0)>($$2483$ph>>>0);
- if (!($137)) {
- break;
- }
- $138 = ((($$2500)) + -4|0);
- $139 = HEAP32[$138>>2]|0;
- $140 = ($139|0)==(0);
- if ($140) {
- $$2500 = $138;
- } else {
- break;
- }
- }
- $141 = HEAP32[$7>>2]|0;
- $142 = (($141) - ($123))|0;
- HEAP32[$7>>2] = $142;
- $143 = ($142|0)>(0);
- if ($143) {
- $$1482661 = $$2483$ph;$$1499660 = $$2500;$122 = $142;
- } else {
- $$1482$lcssa = $$2483$ph;$$1499$lcssa = $$2500;$$pr564 = $142;
- break;
- }
- }
- } else {
- $$1482$lcssa = $$556;$$1499$lcssa = $115;$$pr564 = $$pr;
- }
- $144 = ($$pr564|0)<(0);
- if ($144) {
- $145 = (($$539) + 25)|0;
- $146 = (($145|0) / 9)&-1;
- $147 = (($146) + 1)|0;
- $148 = ($40|0)==(102);
- $$3484648 = $$1482$lcssa;$$3501647 = $$1499$lcssa;$150 = $$pr564;
- while(1) {
- $149 = (0 - ($150))|0;
- $151 = ($149|0)<(9);
- $152 = $151 ? $149 : 9;
- $153 = ($$3484648>>>0)<($$3501647>>>0);
- if ($153) {
- $157 = 1 << $152;
- $158 = (($157) + -1)|0;
- $159 = 1000000000 >>> $152;
- $$0487642 = 0;$$1489641 = $$3484648;
- while(1) {
- $160 = HEAP32[$$1489641>>2]|0;
- $161 = $160 & $158;
- $162 = $160 >>> $152;
- $163 = (($162) + ($$0487642))|0;
- HEAP32[$$1489641>>2] = $163;
- $164 = Math_imul($161, $159)|0;
- $165 = ((($$1489641)) + 4|0);
- $166 = ($165>>>0)<($$3501647>>>0);
- if ($166) {
- $$0487642 = $164;$$1489641 = $165;
- } else {
- break;
- }
- }
- $167 = HEAP32[$$3484648>>2]|0;
- $168 = ($167|0)==(0);
- $169 = ((($$3484648)) + 4|0);
- $$$3484 = $168 ? $169 : $$3484648;
- $170 = ($164|0)==(0);
- if ($170) {
- $$$3484692 = $$$3484;$$4502 = $$3501647;
- } else {
- $171 = ((($$3501647)) + 4|0);
- HEAP32[$$3501647>>2] = $164;
- $$$3484692 = $$$3484;$$4502 = $171;
- }
- } else {
- $154 = HEAP32[$$3484648>>2]|0;
- $155 = ($154|0)==(0);
- $156 = ((($$3484648)) + 4|0);
- $$$3484691 = $155 ? $156 : $$3484648;
- $$$3484692 = $$$3484691;$$4502 = $$3501647;
- }
- $172 = $148 ? $$556 : $$$3484692;
- $173 = $$4502;
- $174 = $172;
- $175 = (($173) - ($174))|0;
- $176 = $175 >> 2;
- $177 = ($176|0)>($147|0);
- $178 = (($172) + ($147<<2)|0);
- $$$4502 = $177 ? $178 : $$4502;
- $179 = HEAP32[$7>>2]|0;
- $180 = (($179) + ($152))|0;
- HEAP32[$7>>2] = $180;
- $181 = ($180|0)<(0);
- if ($181) {
- $$3484648 = $$$3484692;$$3501647 = $$$4502;$150 = $180;
- } else {
- $$3484$lcssa = $$$3484692;$$3501$lcssa = $$$4502;
- break;
- }
- }
- } else {
- $$3484$lcssa = $$1482$lcssa;$$3501$lcssa = $$1499$lcssa;
- }
- $182 = ($$3484$lcssa>>>0)<($$3501$lcssa>>>0);
- $183 = $$556;
- if ($182) {
- $184 = $$3484$lcssa;
- $185 = (($183) - ($184))|0;
- $186 = $185 >> 2;
- $187 = ($186*9)|0;
- $188 = HEAP32[$$3484$lcssa>>2]|0;
- $189 = ($188>>>0)<(10);
- if ($189) {
- $$1515 = $187;
- } else {
- $$0514637 = $187;$$0530636 = 10;
- while(1) {
- $190 = ($$0530636*10)|0;
- $191 = (($$0514637) + 1)|0;
- $192 = ($188>>>0)<($190>>>0);
- if ($192) {
- $$1515 = $191;
- break;
- } else {
- $$0514637 = $191;$$0530636 = $190;
- }
- }
- }
- } else {
- $$1515 = 0;
- }
- $193 = ($40|0)!=(102);
- $194 = $193 ? $$1515 : 0;
- $195 = (($$539) - ($194))|0;
- $196 = ($40|0)==(103);
- $197 = ($$539|0)!=(0);
- $198 = $197 & $196;
- $$neg = $198 << 31 >> 31;
- $199 = (($195) + ($$neg))|0;
- $200 = $$3501$lcssa;
- $201 = (($200) - ($183))|0;
- $202 = $201 >> 2;
- $203 = ($202*9)|0;
- $204 = (($203) + -9)|0;
- $205 = ($199|0)<($204|0);
- if ($205) {
- $206 = ((($$556)) + 4|0);
- $207 = (($199) + 9216)|0;
- $208 = (($207|0) / 9)&-1;
- $209 = (($208) + -1024)|0;
- $210 = (($206) + ($209<<2)|0);
- $211 = (($207|0) % 9)&-1;
- $$0527629 = (($211) + 1)|0;
- $212 = ($$0527629|0)<(9);
- if ($212) {
- $$0527631 = $$0527629;$$1531630 = 10;
- while(1) {
- $213 = ($$1531630*10)|0;
- $$0527 = (($$0527631) + 1)|0;
- $exitcond = ($$0527|0)==(9);
- if ($exitcond) {
- $$1531$lcssa = $213;
- break;
- } else {
- $$0527631 = $$0527;$$1531630 = $213;
- }
- }
- } else {
- $$1531$lcssa = 10;
- }
- $214 = HEAP32[$210>>2]|0;
- $215 = (($214>>>0) % ($$1531$lcssa>>>0))&-1;
- $216 = ($215|0)==(0);
- $217 = ((($210)) + 4|0);
- $218 = ($217|0)==($$3501$lcssa|0);
- $or$cond541 = $218 & $216;
- if ($or$cond541) {
- $$4492 = $210;$$4518 = $$1515;$$8 = $$3484$lcssa;
- } else {
- $219 = (($214>>>0) / ($$1531$lcssa>>>0))&-1;
- $220 = $219 & 1;
- $221 = ($220|0)==(0);
- $$542 = $221 ? 9007199254740992.0 : 9007199254740994.0;
- $222 = (($$1531$lcssa|0) / 2)&-1;
- $223 = ($215>>>0)<($222>>>0);
- $224 = ($215|0)==($222|0);
- $or$cond544 = $218 & $224;
- $$559 = $or$cond544 ? 1.0 : 1.5;
- $$$559 = $223 ? 0.5 : $$559;
- $225 = ($$0520|0)==(0);
- if ($225) {
- $$1467 = $$$559;$$1469 = $$542;
- } else {
- $226 = HEAP8[$$0521>>0]|0;
- $227 = ($226<<24>>24)==(45);
- $228 = -$$542;
- $229 = -$$$559;
- $$$542 = $227 ? $228 : $$542;
- $$$$559 = $227 ? $229 : $$$559;
- $$1467 = $$$$559;$$1469 = $$$542;
- }
- $230 = (($214) - ($215))|0;
- HEAP32[$210>>2] = $230;
- $231 = $$1469 + $$1467;
- $232 = $231 != $$1469;
- if ($232) {
- $233 = (($230) + ($$1531$lcssa))|0;
- HEAP32[$210>>2] = $233;
- $234 = ($233>>>0)>(999999999);
- if ($234) {
- $$5486623 = $$3484$lcssa;$$sink545622 = $210;
- while(1) {
- $235 = ((($$sink545622)) + -4|0);
- HEAP32[$$sink545622>>2] = 0;
- $236 = ($235>>>0)<($$5486623>>>0);
- if ($236) {
- $237 = ((($$5486623)) + -4|0);
- HEAP32[$237>>2] = 0;
- $$6 = $237;
- } else {
- $$6 = $$5486623;
- }
- $238 = HEAP32[$235>>2]|0;
- $239 = (($238) + 1)|0;
- HEAP32[$235>>2] = $239;
- $240 = ($239>>>0)>(999999999);
- if ($240) {
- $$5486623 = $$6;$$sink545622 = $235;
- } else {
- $$5486$lcssa = $$6;$$sink545$lcssa = $235;
- break;
- }
- }
- } else {
- $$5486$lcssa = $$3484$lcssa;$$sink545$lcssa = $210;
- }
- $241 = $$5486$lcssa;
- $242 = (($183) - ($241))|0;
- $243 = $242 >> 2;
- $244 = ($243*9)|0;
- $245 = HEAP32[$$5486$lcssa>>2]|0;
- $246 = ($245>>>0)<(10);
- if ($246) {
- $$4492 = $$sink545$lcssa;$$4518 = $244;$$8 = $$5486$lcssa;
- } else {
- $$2516618 = $244;$$2532617 = 10;
- while(1) {
- $247 = ($$2532617*10)|0;
- $248 = (($$2516618) + 1)|0;
- $249 = ($245>>>0)<($247>>>0);
- if ($249) {
- $$4492 = $$sink545$lcssa;$$4518 = $248;$$8 = $$5486$lcssa;
- break;
- } else {
- $$2516618 = $248;$$2532617 = $247;
- }
- }
- }
- } else {
- $$4492 = $210;$$4518 = $$1515;$$8 = $$3484$lcssa;
- }
- }
- $250 = ((($$4492)) + 4|0);
- $251 = ($$3501$lcssa>>>0)>($250>>>0);
- $$$3501 = $251 ? $250 : $$3501$lcssa;
- $$5519$ph = $$4518;$$7505$ph = $$$3501;$$9$ph = $$8;
- } else {
- $$5519$ph = $$1515;$$7505$ph = $$3501$lcssa;$$9$ph = $$3484$lcssa;
- }
- $$7505 = $$7505$ph;
- while(1) {
- $252 = ($$7505>>>0)>($$9$ph>>>0);
- if (!($252)) {
- $$lcssa673 = 0;
- break;
- }
- $253 = ((($$7505)) + -4|0);
- $254 = HEAP32[$253>>2]|0;
- $255 = ($254|0)==(0);
- if ($255) {
- $$7505 = $253;
- } else {
- $$lcssa673 = 1;
- break;
- }
- }
- $256 = (0 - ($$5519$ph))|0;
- do {
- if ($196) {
- $not$ = $197 ^ 1;
- $257 = $not$&1;
- $$539$ = (($257) + ($$539))|0;
- $258 = ($$539$|0)>($$5519$ph|0);
- $259 = ($$5519$ph|0)>(-5);
- $or$cond6 = $258 & $259;
- if ($or$cond6) {
- $260 = (($5) + -1)|0;
- $$neg567 = (($$539$) + -1)|0;
- $261 = (($$neg567) - ($$5519$ph))|0;
- $$0479 = $260;$$2476 = $261;
- } else {
- $262 = (($5) + -2)|0;
- $263 = (($$539$) + -1)|0;
- $$0479 = $262;$$2476 = $263;
- }
- $264 = $4 & 8;
- $265 = ($264|0)==(0);
- if ($265) {
- if ($$lcssa673) {
- $266 = ((($$7505)) + -4|0);
- $267 = HEAP32[$266>>2]|0;
- $268 = ($267|0)==(0);
- if ($268) {
- $$2529 = 9;
- } else {
- $269 = (($267>>>0) % 10)&-1;
- $270 = ($269|0)==(0);
- if ($270) {
- $$1528614 = 0;$$3533613 = 10;
- while(1) {
- $271 = ($$3533613*10)|0;
- $272 = (($$1528614) + 1)|0;
- $273 = (($267>>>0) % ($271>>>0))&-1;
- $274 = ($273|0)==(0);
- if ($274) {
- $$1528614 = $272;$$3533613 = $271;
- } else {
- $$2529 = $272;
- break;
- }
- }
- } else {
- $$2529 = 0;
- }
- }
- } else {
- $$2529 = 9;
- }
- $275 = $$0479 | 32;
- $276 = ($275|0)==(102);
- $277 = $$7505;
- $278 = (($277) - ($183))|0;
- $279 = $278 >> 2;
- $280 = ($279*9)|0;
- $281 = (($280) + -9)|0;
- if ($276) {
- $282 = (($281) - ($$2529))|0;
- $283 = ($282|0)>(0);
- $$546 = $283 ? $282 : 0;
- $284 = ($$2476|0)<($$546|0);
- $$2476$$547 = $284 ? $$2476 : $$546;
- $$1480 = $$0479;$$3477 = $$2476$$547;$$pre$phi690Z2D = 0;
- break;
- } else {
- $285 = (($281) + ($$5519$ph))|0;
- $286 = (($285) - ($$2529))|0;
- $287 = ($286|0)>(0);
- $$548 = $287 ? $286 : 0;
- $288 = ($$2476|0)<($$548|0);
- $$2476$$549 = $288 ? $$2476 : $$548;
- $$1480 = $$0479;$$3477 = $$2476$$549;$$pre$phi690Z2D = 0;
- break;
- }
- } else {
- $$1480 = $$0479;$$3477 = $$2476;$$pre$phi690Z2D = $264;
- }
- } else {
- $$pre689 = $4 & 8;
- $$1480 = $5;$$3477 = $$539;$$pre$phi690Z2D = $$pre689;
- }
- } while(0);
- $289 = $$3477 | $$pre$phi690Z2D;
- $290 = ($289|0)!=(0);
- $291 = $290&1;
- $292 = $$1480 | 32;
- $293 = ($292|0)==(102);
- if ($293) {
- $294 = ($$5519$ph|0)>(0);
- $295 = $294 ? $$5519$ph : 0;
- $$2513 = 0;$$pn566 = $295;
- } else {
- $296 = ($$5519$ph|0)<(0);
- $297 = $296 ? $256 : $$5519$ph;
- $298 = ($297|0)<(0);
- $299 = $298 << 31 >> 31;
- $300 = (_fmt_u($297,$299,$11)|0);
- $301 = $11;
- $302 = $300;
- $303 = (($301) - ($302))|0;
- $304 = ($303|0)<(2);
- if ($304) {
- $$1512607 = $300;
- while(1) {
- $305 = ((($$1512607)) + -1|0);
- HEAP8[$305>>0] = 48;
- $306 = $305;
- $307 = (($301) - ($306))|0;
- $308 = ($307|0)<(2);
- if ($308) {
- $$1512607 = $305;
- } else {
- $$1512$lcssa = $305;
- break;
- }
- }
- } else {
- $$1512$lcssa = $300;
- }
- $309 = $$5519$ph >> 31;
- $310 = $309 & 2;
- $311 = (($310) + 43)|0;
- $312 = $311&255;
- $313 = ((($$1512$lcssa)) + -1|0);
- HEAP8[$313>>0] = $312;
- $314 = $$1480&255;
- $315 = ((($$1512$lcssa)) + -2|0);
- HEAP8[$315>>0] = $314;
- $316 = $315;
- $317 = (($301) - ($316))|0;
- $$2513 = $315;$$pn566 = $317;
- }
- $318 = (($$0520) + 1)|0;
- $319 = (($318) + ($$3477))|0;
- $$1526 = (($319) + ($291))|0;
- $320 = (($$1526) + ($$pn566))|0;
- _pad_672($0,32,$2,$320,$4);
- _out($0,$$0521,$$0520);
- $321 = $4 ^ 65536;
- _pad_672($0,48,$2,$320,$321);
- if ($293) {
- $322 = ($$9$ph>>>0)>($$556>>>0);
- $$0496$$9 = $322 ? $$556 : $$9$ph;
- $323 = ((($8)) + 9|0);
- $324 = $323;
- $325 = ((($8)) + 8|0);
- $$5493597 = $$0496$$9;
- while(1) {
- $326 = HEAP32[$$5493597>>2]|0;
- $327 = (_fmt_u($326,0,$323)|0);
- $328 = ($$5493597|0)==($$0496$$9|0);
- if ($328) {
- $334 = ($327|0)==($323|0);
- if ($334) {
- HEAP8[$325>>0] = 48;
- $$1465 = $325;
- } else {
- $$1465 = $327;
- }
- } else {
- $329 = ($327>>>0)>($8>>>0);
- if ($329) {
- $330 = $327;
- $331 = (($330) - ($9))|0;
- _memset(($8|0),48,($331|0))|0;
- $$0464594 = $327;
- while(1) {
- $332 = ((($$0464594)) + -1|0);
- $333 = ($332>>>0)>($8>>>0);
- if ($333) {
- $$0464594 = $332;
- } else {
- $$1465 = $332;
- break;
- }
- }
- } else {
- $$1465 = $327;
- }
- }
- $335 = $$1465;
- $336 = (($324) - ($335))|0;
- _out($0,$$1465,$336);
- $337 = ((($$5493597)) + 4|0);
- $338 = ($337>>>0)>($$556>>>0);
- if ($338) {
- break;
- } else {
- $$5493597 = $337;
- }
- }
- $339 = ($289|0)==(0);
- if (!($339)) {
- _out($0,11686,1);
- }
- $340 = ($337>>>0)<($$7505>>>0);
- $341 = ($$3477|0)>(0);
- $342 = $340 & $341;
- if ($342) {
- $$4478590 = $$3477;$$6494589 = $337;
- while(1) {
- $343 = HEAP32[$$6494589>>2]|0;
- $344 = (_fmt_u($343,0,$323)|0);
- $345 = ($344>>>0)>($8>>>0);
- if ($345) {
- $346 = $344;
- $347 = (($346) - ($9))|0;
- _memset(($8|0),48,($347|0))|0;
- $$0463584 = $344;
- while(1) {
- $348 = ((($$0463584)) + -1|0);
- $349 = ($348>>>0)>($8>>>0);
- if ($349) {
- $$0463584 = $348;
- } else {
- $$0463$lcssa = $348;
- break;
- }
- }
- } else {
- $$0463$lcssa = $344;
- }
- $350 = ($$4478590|0)<(9);
- $351 = $350 ? $$4478590 : 9;
- _out($0,$$0463$lcssa,$351);
- $352 = ((($$6494589)) + 4|0);
- $353 = (($$4478590) + -9)|0;
- $354 = ($352>>>0)<($$7505>>>0);
- $355 = ($$4478590|0)>(9);
- $356 = $354 & $355;
- if ($356) {
- $$4478590 = $353;$$6494589 = $352;
- } else {
- $$4478$lcssa = $353;
- break;
- }
- }
- } else {
- $$4478$lcssa = $$3477;
- }
- $357 = (($$4478$lcssa) + 9)|0;
- _pad_672($0,48,$357,9,0);
- } else {
- $358 = ((($$9$ph)) + 4|0);
- $$7505$ = $$lcssa673 ? $$7505 : $358;
- $359 = ($$3477|0)>(-1);
- if ($359) {
- $360 = ((($8)) + 9|0);
- $361 = ($$pre$phi690Z2D|0)==(0);
- $362 = $360;
- $363 = (0 - ($9))|0;
- $364 = ((($8)) + 8|0);
- $$5602 = $$3477;$$7495601 = $$9$ph;
- while(1) {
- $365 = HEAP32[$$7495601>>2]|0;
- $366 = (_fmt_u($365,0,$360)|0);
- $367 = ($366|0)==($360|0);
- if ($367) {
- HEAP8[$364>>0] = 48;
- $$0 = $364;
- } else {
- $$0 = $366;
- }
- $368 = ($$7495601|0)==($$9$ph|0);
- do {
- if ($368) {
- $372 = ((($$0)) + 1|0);
- _out($0,$$0,1);
- $373 = ($$5602|0)<(1);
- $or$cond554 = $361 & $373;
- if ($or$cond554) {
- $$2 = $372;
- break;
- }
- _out($0,11686,1);
- $$2 = $372;
- } else {
- $369 = ($$0>>>0)>($8>>>0);
- if (!($369)) {
- $$2 = $$0;
- break;
- }
- $scevgep684 = (($$0) + ($363)|0);
- $scevgep684685 = $scevgep684;
- _memset(($8|0),48,($scevgep684685|0))|0;
- $$1598 = $$0;
- while(1) {
- $370 = ((($$1598)) + -1|0);
- $371 = ($370>>>0)>($8>>>0);
- if ($371) {
- $$1598 = $370;
- } else {
- $$2 = $370;
- break;
- }
- }
- }
- } while(0);
- $374 = $$2;
- $375 = (($362) - ($374))|0;
- $376 = ($$5602|0)>($375|0);
- $377 = $376 ? $375 : $$5602;
- _out($0,$$2,$377);
- $378 = (($$5602) - ($375))|0;
- $379 = ((($$7495601)) + 4|0);
- $380 = ($379>>>0)<($$7505$>>>0);
- $381 = ($378|0)>(-1);
- $382 = $380 & $381;
- if ($382) {
- $$5602 = $378;$$7495601 = $379;
- } else {
- $$5$lcssa = $378;
- break;
- }
- }
- } else {
- $$5$lcssa = $$3477;
- }
- $383 = (($$5$lcssa) + 18)|0;
- _pad_672($0,48,$383,18,0);
- $384 = $11;
- $385 = $$2513;
- $386 = (($384) - ($385))|0;
- _out($0,$$2513,$386);
- }
- $387 = $4 ^ 8192;
- _pad_672($0,32,$2,$320,$387);
- $$sink562 = $320;
- } else {
- $27 = $5 & 32;
- $28 = ($27|0)!=(0);
- $29 = $28 ? 11654 : 11658;
- $30 = ($$0471 != $$0471) | (0.0 != 0.0);
- $31 = $28 ? 11662 : 11666;
- $$0510 = $30 ? $31 : $29;
- $32 = (($$0520) + 3)|0;
- $33 = $4 & -65537;
- _pad_672($0,32,$2,$32,$33);
- _out($0,$$0521,$$0520);
- _out($0,$$0510,3);
- $34 = $4 ^ 8192;
- _pad_672($0,32,$2,$32,$34);
- $$sink562 = $32;
- }
- } while(0);
- $388 = ($$sink562|0)<($2|0);
- $$555 = $388 ? $2 : $$sink562;
- STACKTOP = sp;return ($$555|0);
- }
- function ___DOUBLE_BITS_673($0) {
- $0 = +$0;
- var $1 = 0, $2 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- HEAPF64[tempDoublePtr>>3] = $0;$1 = HEAP32[tempDoublePtr>>2]|0;
- $2 = HEAP32[tempDoublePtr+4>>2]|0;
- tempRet0 = ($2);
- return ($1|0);
- }
- function _frexpl($0,$1) {
- $0 = +$0;
- $1 = $1|0;
- var $2 = 0.0, label = 0, sp = 0;
- sp = STACKTOP;
- $2 = (+_frexp($0,$1));
- return (+$2);
- }
- function _frexp($0,$1) {
- $0 = +$0;
- $1 = $1|0;
- 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;
- var sp = 0;
- sp = STACKTOP;
- HEAPF64[tempDoublePtr>>3] = $0;$2 = HEAP32[tempDoublePtr>>2]|0;
- $3 = HEAP32[tempDoublePtr+4>>2]|0;
- $4 = (_bitshift64Lshr(($2|0),($3|0),52)|0);
- $5 = tempRet0;
- $6 = $4&65535;
- $trunc$clear = $6 & 2047;
- switch ($trunc$clear<<16>>16) {
- case 0: {
- $7 = $0 != 0.0;
- if ($7) {
- $8 = $0 * 1.8446744073709552E+19;
- $9 = (+_frexp($8,$1));
- $10 = HEAP32[$1>>2]|0;
- $11 = (($10) + -64)|0;
- $$016 = $9;$storemerge = $11;
- } else {
- $$016 = $0;$storemerge = 0;
- }
- HEAP32[$1>>2] = $storemerge;
- $$0 = $$016;
- break;
- }
- case 2047: {
- $$0 = $0;
- break;
- }
- default: {
- $12 = $4 & 2047;
- $13 = (($12) + -1022)|0;
- HEAP32[$1>>2] = $13;
- $14 = $3 & -2146435073;
- $15 = $14 | 1071644672;
- HEAP32[tempDoublePtr>>2] = $2;HEAP32[tempDoublePtr+4>>2] = $15;$16 = +HEAPF64[tempDoublePtr>>3];
- $$0 = $16;
- }
- }
- return (+$$0);
- }
- function _wcrtomb($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- $3 = ($0|0)==(0|0);
- do {
- if ($3) {
- $$0 = 1;
- } else {
- $4 = ($1>>>0)<(128);
- if ($4) {
- $5 = $1&255;
- HEAP8[$0>>0] = $5;
- $$0 = 1;
- break;
- }
- $6 = (___pthread_self_446()|0);
- $7 = ((($6)) + 188|0);
- $8 = HEAP32[$7>>2]|0;
- $9 = (Atomics_load(HEAP32,$8>>2)|0);
- $not$ = ($9|0)==(0|0);
- if ($not$) {
- $10 = $1 & -128;
- $11 = ($10|0)==(57216);
- if ($11) {
- $13 = $1&255;
- HEAP8[$0>>0] = $13;
- $$0 = 1;
- break;
- } else {
- $12 = (___errno_location()|0);
- HEAP32[$12>>2] = 84;
- $$0 = -1;
- break;
- }
- }
- $14 = ($1>>>0)<(2048);
- if ($14) {
- $15 = $1 >>> 6;
- $16 = $15 | 192;
- $17 = $16&255;
- $18 = ((($0)) + 1|0);
- HEAP8[$0>>0] = $17;
- $19 = $1 & 63;
- $20 = $19 | 128;
- $21 = $20&255;
- HEAP8[$18>>0] = $21;
- $$0 = 2;
- break;
- }
- $22 = ($1>>>0)<(55296);
- $23 = $1 & -8192;
- $24 = ($23|0)==(57344);
- $or$cond = $22 | $24;
- if ($or$cond) {
- $25 = $1 >>> 12;
- $26 = $25 | 224;
- $27 = $26&255;
- $28 = ((($0)) + 1|0);
- HEAP8[$0>>0] = $27;
- $29 = $1 >>> 6;
- $30 = $29 & 63;
- $31 = $30 | 128;
- $32 = $31&255;
- $33 = ((($0)) + 2|0);
- HEAP8[$28>>0] = $32;
- $34 = $1 & 63;
- $35 = $34 | 128;
- $36 = $35&255;
- HEAP8[$33>>0] = $36;
- $$0 = 3;
- break;
- }
- $37 = (($1) + -65536)|0;
- $38 = ($37>>>0)<(1048576);
- if ($38) {
- $39 = $1 >>> 18;
- $40 = $39 | 240;
- $41 = $40&255;
- $42 = ((($0)) + 1|0);
- HEAP8[$0>>0] = $41;
- $43 = $1 >>> 12;
- $44 = $43 & 63;
- $45 = $44 | 128;
- $46 = $45&255;
- $47 = ((($0)) + 2|0);
- HEAP8[$42>>0] = $46;
- $48 = $1 >>> 6;
- $49 = $48 & 63;
- $50 = $49 | 128;
- $51 = $50&255;
- $52 = ((($0)) + 3|0);
- HEAP8[$47>>0] = $51;
- $53 = $1 & 63;
- $54 = $53 | 128;
- $55 = $54&255;
- HEAP8[$52>>0] = $55;
- $$0 = 4;
- break;
- } else {
- $56 = (___errno_location()|0);
- HEAP32[$56>>2] = 84;
- $$0 = -1;
- break;
- }
- }
- } while(0);
- return ($$0|0);
- }
- function ___pthread_self_446() {
- var $0 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = (_pthread_self()|0);
- return ($0|0);
- }
- function ___pthread_self_105() {
- var $0 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = (_pthread_self()|0);
- return ($0|0);
- }
- function ___strerror_l($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- var label = 0, sp = 0;
- sp = STACKTOP;
- $$016 = 0;
- while(1) {
- $3 = (11688 + ($$016)|0);
- $4 = HEAP8[$3>>0]|0;
- $5 = $4&255;
- $6 = ($5|0)==($0|0);
- if ($6) {
- label = 2;
- break;
- }
- $7 = (($$016) + 1)|0;
- $8 = ($7|0)==(87);
- if ($8) {
- $$01214 = 11776;$$115 = 87;
- label = 5;
- break;
- } else {
- $$016 = $7;
- }
- }
- if ((label|0) == 2) {
- $2 = ($$016|0)==(0);
- if ($2) {
- $$012$lcssa = 11776;
- } else {
- $$01214 = 11776;$$115 = $$016;
- label = 5;
- }
- }
- if ((label|0) == 5) {
- while(1) {
- label = 0;
- $$113 = $$01214;
- while(1) {
- $9 = HEAP8[$$113>>0]|0;
- $10 = ($9<<24>>24)==(0);
- $11 = ((($$113)) + 1|0);
- if ($10) {
- break;
- } else {
- $$113 = $11;
- }
- }
- $12 = (($$115) + -1)|0;
- $13 = ($12|0)==(0);
- if ($13) {
- $$012$lcssa = $11;
- break;
- } else {
- $$01214 = $11;$$115 = $12;
- label = 5;
- }
- }
- }
- $14 = ((($1)) + 20|0);
- $15 = (Atomics_load(HEAP32,$14>>2)|0);
- $16 = (___lctrans($$012$lcssa,$15)|0);
- return ($16|0);
- }
- function ___lctrans($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- var $2 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $2 = (___lctrans_impl($0,$1)|0);
- return ($2|0);
- }
- function ___lctrans_impl($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- var $$0 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $2 = ($1|0)==(0|0);
- if ($2) {
- $$0 = 0;
- } else {
- $3 = HEAP32[$1>>2]|0;
- $4 = ((($1)) + 4|0);
- $5 = HEAP32[$4>>2]|0;
- $6 = (___mo_lookup($3,$5,$0)|0);
- $$0 = $6;
- }
- $7 = ($$0|0)!=(0|0);
- $8 = $7 ? $$0 : $0;
- return ($8|0);
- }
- function ___mo_lookup($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- $3 = HEAP32[$0>>2]|0;
- $4 = (($3) + 1794895138)|0;
- $5 = ((($0)) + 8|0);
- $6 = HEAP32[$5>>2]|0;
- $7 = (_swapc($6,$4)|0);
- $8 = ((($0)) + 12|0);
- $9 = HEAP32[$8>>2]|0;
- $10 = (_swapc($9,$4)|0);
- $11 = ((($0)) + 16|0);
- $12 = HEAP32[$11>>2]|0;
- $13 = (_swapc($12,$4)|0);
- $14 = $1 >>> 2;
- $15 = ($7>>>0)<($14>>>0);
- L1: do {
- if ($15) {
- $16 = $7 << 2;
- $17 = (($1) - ($16))|0;
- $18 = ($10>>>0)<($17>>>0);
- $19 = ($13>>>0)<($17>>>0);
- $or$cond = $18 & $19;
- if ($or$cond) {
- $20 = $13 | $10;
- $21 = $20 & 3;
- $22 = ($21|0)==(0);
- if ($22) {
- $23 = $10 >>> 2;
- $24 = $13 >>> 2;
- $$090 = 0;$$094 = $7;
- while(1) {
- $25 = $$094 >>> 1;
- $26 = (($$090) + ($25))|0;
- $27 = $26 << 1;
- $28 = (($27) + ($23))|0;
- $29 = (($0) + ($28<<2)|0);
- $30 = HEAP32[$29>>2]|0;
- $31 = (_swapc($30,$4)|0);
- $32 = (($28) + 1)|0;
- $33 = (($0) + ($32<<2)|0);
- $34 = HEAP32[$33>>2]|0;
- $35 = (_swapc($34,$4)|0);
- $36 = ($35>>>0)<($1>>>0);
- $37 = (($1) - ($35))|0;
- $38 = ($31>>>0)<($37>>>0);
- $or$cond102 = $36 & $38;
- if (!($or$cond102)) {
- $$4 = 0;
- break L1;
- }
- $39 = (($35) + ($31))|0;
- $40 = (($0) + ($39)|0);
- $41 = HEAP8[$40>>0]|0;
- $42 = ($41<<24>>24)==(0);
- if (!($42)) {
- $$4 = 0;
- break L1;
- }
- $43 = (($0) + ($35)|0);
- $44 = (_strcmp($2,$43)|0);
- $45 = ($44|0)==(0);
- if ($45) {
- break;
- }
- $62 = ($$094|0)==(1);
- $63 = ($44|0)<(0);
- $64 = (($$094) - ($25))|0;
- $$195 = $63 ? $25 : $64;
- $$191 = $63 ? $$090 : $26;
- if ($62) {
- $$4 = 0;
- break L1;
- } else {
- $$090 = $$191;$$094 = $$195;
- }
- }
- $46 = (($27) + ($24))|0;
- $47 = (($0) + ($46<<2)|0);
- $48 = HEAP32[$47>>2]|0;
- $49 = (_swapc($48,$4)|0);
- $50 = (($46) + 1)|0;
- $51 = (($0) + ($50<<2)|0);
- $52 = HEAP32[$51>>2]|0;
- $53 = (_swapc($52,$4)|0);
- $54 = ($53>>>0)<($1>>>0);
- $55 = (($1) - ($53))|0;
- $56 = ($49>>>0)<($55>>>0);
- $or$cond104 = $54 & $56;
- if ($or$cond104) {
- $57 = (($0) + ($53)|0);
- $58 = (($53) + ($49))|0;
- $59 = (($0) + ($58)|0);
- $60 = HEAP8[$59>>0]|0;
- $61 = ($60<<24>>24)==(0);
- $$ = $61 ? $57 : 0;
- $$4 = $$;
- } else {
- $$4 = 0;
- }
- } else {
- $$4 = 0;
- }
- } else {
- $$4 = 0;
- }
- } else {
- $$4 = 0;
- }
- } while(0);
- return ($$4|0);
- }
- function _swapc($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- var $$ = 0, $2 = 0, $3 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $2 = ($1|0)==(0);
- $3 = (_llvm_bswap_i32(($0|0))|0);
- $$ = $2 ? $0 : $3;
- return ($$|0);
- }
- function ___fwritex($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- 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;
- var label = 0, sp = 0;
- sp = STACKTOP;
- $3 = ((($2)) + 16|0);
- $4 = HEAP32[$3>>2]|0;
- $5 = ($4|0)==(0|0);
- if ($5) {
- $7 = (___towrite($2)|0);
- $8 = ($7|0)==(0);
- if ($8) {
- $$pre = HEAP32[$3>>2]|0;
- $12 = $$pre;
- label = 5;
- } else {
- $$1 = 0;
- }
- } else {
- $6 = $4;
- $12 = $6;
- label = 5;
- }
- L5: do {
- if ((label|0) == 5) {
- $9 = ((($2)) + 20|0);
- $10 = HEAP32[$9>>2]|0;
- $11 = (($12) - ($10))|0;
- $13 = ($11>>>0)<($1>>>0);
- $14 = $10;
- if ($13) {
- $15 = ((($2)) + 36|0);
- $16 = HEAP32[$15>>2]|0;
- $17 = (FUNCTION_TABLE_iiii[$16 & 15]($2,$0,$1)|0);
- $$1 = $17;
- break;
- }
- $18 = ((($2)) + 75|0);
- $19 = HEAP8[$18>>0]|0;
- $20 = ($19<<24>>24)>(-1);
- L10: do {
- if ($20) {
- $$038 = $1;
- while(1) {
- $21 = ($$038|0)==(0);
- if ($21) {
- $$139 = 0;$$141 = $0;$$143 = $1;$31 = $14;
- break L10;
- }
- $22 = (($$038) + -1)|0;
- $23 = (($0) + ($22)|0);
- $24 = HEAP8[$23>>0]|0;
- $25 = ($24<<24>>24)==(10);
- if ($25) {
- break;
- } else {
- $$038 = $22;
- }
- }
- $26 = ((($2)) + 36|0);
- $27 = HEAP32[$26>>2]|0;
- $28 = (FUNCTION_TABLE_iiii[$27 & 15]($2,$0,$$038)|0);
- $29 = ($28>>>0)<($$038>>>0);
- if ($29) {
- $$1 = $28;
- break L5;
- }
- $30 = (($0) + ($$038)|0);
- $$042 = (($1) - ($$038))|0;
- $$pre47 = HEAP32[$9>>2]|0;
- $$139 = $$038;$$141 = $30;$$143 = $$042;$31 = $$pre47;
- } else {
- $$139 = 0;$$141 = $0;$$143 = $1;$31 = $14;
- }
- } while(0);
- _memcpy(($31|0),($$141|0),($$143|0))|0;
- $32 = HEAP32[$9>>2]|0;
- $33 = (($32) + ($$143)|0);
- HEAP32[$9>>2] = $33;
- $34 = (($$139) + ($$143))|0;
- $$1 = $34;
- }
- } while(0);
- return ($$1|0);
- }
- function ___towrite($0) {
- $0 = $0|0;
- 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;
- var $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = ((($0)) + 74|0);
- $2 = HEAP8[$1>>0]|0;
- $3 = $2 << 24 >> 24;
- $4 = (($3) + 255)|0;
- $5 = $4 | $3;
- $6 = $5&255;
- HEAP8[$1>>0] = $6;
- $7 = HEAP32[$0>>2]|0;
- $8 = $7 & 8;
- $9 = ($8|0)==(0);
- if ($9) {
- $11 = ((($0)) + 8|0);
- HEAP32[$11>>2] = 0;
- $12 = ((($0)) + 4|0);
- HEAP32[$12>>2] = 0;
- $13 = ((($0)) + 44|0);
- $14 = HEAP32[$13>>2]|0;
- $15 = ((($0)) + 28|0);
- HEAP32[$15>>2] = $14;
- $16 = ((($0)) + 20|0);
- HEAP32[$16>>2] = $14;
- $17 = ((($0)) + 48|0);
- $18 = HEAP32[$17>>2]|0;
- $19 = (($14) + ($18)|0);
- $20 = ((($0)) + 16|0);
- HEAP32[$20>>2] = $19;
- $$0 = 0;
- } else {
- $10 = $7 | 32;
- HEAP32[$0>>2] = $10;
- $$0 = -1;
- }
- return ($$0|0);
- }
- function _sn_write($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- var $$ = 0, $10 = 0, $11 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $3 = ((($0)) + 16|0);
- $4 = HEAP32[$3>>2]|0;
- $5 = ((($0)) + 20|0);
- $6 = HEAP32[$5>>2]|0;
- $7 = $6;
- $8 = (($4) - ($7))|0;
- $9 = ($8>>>0)>($2>>>0);
- $$ = $9 ? $2 : $8;
- _memcpy(($6|0),($1|0),($$|0))|0;
- $10 = HEAP32[$5>>2]|0;
- $11 = (($10) + ($$)|0);
- HEAP32[$5>>2] = $11;
- return ($2|0);
- }
- function _strlen($0) {
- $0 = $0|0;
- 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;
- 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;
- sp = STACKTOP;
- $1 = $0;
- $2 = $1 & 3;
- $3 = ($2|0)==(0);
- L1: do {
- if ($3) {
- $$015$lcssa = $0;
- label = 4;
- } else {
- $$01519 = $0;$23 = $1;
- while(1) {
- $4 = HEAP8[$$01519>>0]|0;
- $5 = ($4<<24>>24)==(0);
- if ($5) {
- $$sink = $23;
- break L1;
- }
- $6 = ((($$01519)) + 1|0);
- $7 = $6;
- $8 = $7 & 3;
- $9 = ($8|0)==(0);
- if ($9) {
- $$015$lcssa = $6;
- label = 4;
- break;
- } else {
- $$01519 = $6;$23 = $7;
- }
- }
- }
- } while(0);
- if ((label|0) == 4) {
- $$0 = $$015$lcssa;
- while(1) {
- $10 = HEAP32[$$0>>2]|0;
- $11 = (($10) + -16843009)|0;
- $12 = $10 & -2139062144;
- $13 = $12 ^ -2139062144;
- $14 = $13 & $11;
- $15 = ($14|0)==(0);
- $16 = ((($$0)) + 4|0);
- if ($15) {
- $$0 = $16;
- } else {
- break;
- }
- }
- $17 = $10&255;
- $18 = ($17<<24>>24)==(0);
- if ($18) {
- $$1$lcssa = $$0;
- } else {
- $$pn = $$0;
- while(1) {
- $19 = ((($$pn)) + 1|0);
- $$pre = HEAP8[$19>>0]|0;
- $20 = ($$pre<<24>>24)==(0);
- if ($20) {
- $$1$lcssa = $19;
- break;
- } else {
- $$pn = $19;
- }
- }
- }
- $21 = $$1$lcssa;
- $$sink = $21;
- }
- $22 = (($$sink) - ($1))|0;
- return ($22|0);
- }
- function _strchr($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- var $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $2 = (___strchrnul($0,$1)|0);
- $3 = HEAP8[$2>>0]|0;
- $4 = $1&255;
- $5 = ($3<<24>>24)==($4<<24>>24);
- $6 = $5 ? $2 : 0;
- return ($6|0);
- }
- function ___strchrnul($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- $2 = $1 & 255;
- $3 = ($2|0)==(0);
- L1: do {
- if ($3) {
- $8 = (_strlen($0)|0);
- $9 = (($0) + ($8)|0);
- $$0 = $9;
- } else {
- $4 = $0;
- $5 = $4 & 3;
- $6 = ($5|0)==(0);
- if ($6) {
- $$030$lcssa = $0;
- } else {
- $7 = $1&255;
- $$03039 = $0;
- while(1) {
- $10 = HEAP8[$$03039>>0]|0;
- $11 = ($10<<24>>24)==(0);
- $12 = ($10<<24>>24)==($7<<24>>24);
- $or$cond = $11 | $12;
- if ($or$cond) {
- $$0 = $$03039;
- break L1;
- }
- $13 = ((($$03039)) + 1|0);
- $14 = $13;
- $15 = $14 & 3;
- $16 = ($15|0)==(0);
- if ($16) {
- $$030$lcssa = $13;
- break;
- } else {
- $$03039 = $13;
- }
- }
- }
- $17 = Math_imul($2, 16843009)|0;
- $18 = HEAP32[$$030$lcssa>>2]|0;
- $19 = (($18) + -16843009)|0;
- $20 = $18 & -2139062144;
- $21 = $20 ^ -2139062144;
- $22 = $21 & $19;
- $23 = ($22|0)==(0);
- L10: do {
- if ($23) {
- $$02936 = $$030$lcssa;$25 = $18;
- while(1) {
- $24 = $25 ^ $17;
- $26 = (($24) + -16843009)|0;
- $27 = $24 & -2139062144;
- $28 = $27 ^ -2139062144;
- $29 = $28 & $26;
- $30 = ($29|0)==(0);
- if (!($30)) {
- $$029$lcssa = $$02936;
- break L10;
- }
- $31 = ((($$02936)) + 4|0);
- $32 = HEAP32[$31>>2]|0;
- $33 = (($32) + -16843009)|0;
- $34 = $32 & -2139062144;
- $35 = $34 ^ -2139062144;
- $36 = $35 & $33;
- $37 = ($36|0)==(0);
- if ($37) {
- $$02936 = $31;$25 = $32;
- } else {
- $$029$lcssa = $31;
- break;
- }
- }
- } else {
- $$029$lcssa = $$030$lcssa;
- }
- } while(0);
- $38 = $1&255;
- $$1 = $$029$lcssa;
- while(1) {
- $39 = HEAP8[$$1>>0]|0;
- $40 = ($39<<24>>24)==(0);
- $41 = ($39<<24>>24)==($38<<24>>24);
- $or$cond33 = $40 | $41;
- $42 = ((($$1)) + 1|0);
- if ($or$cond33) {
- $$0 = $$1;
- break;
- } else {
- $$1 = $42;
- }
- }
- }
- } while(0);
- return ($$0|0);
- }
- function _strcpy($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- var label = 0, sp = 0;
- sp = STACKTOP;
- (___stpcpy($0,$1)|0);
- return ($0|0);
- }
- function ___stpcpy($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- 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;
- var $35 = 0, $36 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $2 = $1;
- $3 = $0;
- $4 = $2 ^ $3;
- $5 = $4 & 3;
- $6 = ($5|0)==(0);
- L1: do {
- if ($6) {
- $7 = $2 & 3;
- $8 = ($7|0)==(0);
- if ($8) {
- $$026$lcssa = $1;$$027$lcssa = $0;
- } else {
- $$02642 = $1;$$02741 = $0;
- while(1) {
- $9 = HEAP8[$$02642>>0]|0;
- HEAP8[$$02741>>0] = $9;
- $10 = ($9<<24>>24)==(0);
- if ($10) {
- $$029 = $$02741;
- break L1;
- }
- $11 = ((($$02642)) + 1|0);
- $12 = ((($$02741)) + 1|0);
- $13 = $11;
- $14 = $13 & 3;
- $15 = ($14|0)==(0);
- if ($15) {
- $$026$lcssa = $11;$$027$lcssa = $12;
- break;
- } else {
- $$02642 = $11;$$02741 = $12;
- }
- }
- }
- $16 = HEAP32[$$026$lcssa>>2]|0;
- $17 = (($16) + -16843009)|0;
- $18 = $16 & -2139062144;
- $19 = $18 ^ -2139062144;
- $20 = $19 & $17;
- $21 = ($20|0)==(0);
- if ($21) {
- $$02536 = $$027$lcssa;$$037 = $$026$lcssa;$24 = $16;
- while(1) {
- $22 = ((($$037)) + 4|0);
- $23 = ((($$02536)) + 4|0);
- HEAP32[$$02536>>2] = $24;
- $25 = HEAP32[$22>>2]|0;
- $26 = (($25) + -16843009)|0;
- $27 = $25 & -2139062144;
- $28 = $27 ^ -2139062144;
- $29 = $28 & $26;
- $30 = ($29|0)==(0);
- if ($30) {
- $$02536 = $23;$$037 = $22;$24 = $25;
- } else {
- $$0$lcssa = $22;$$025$lcssa = $23;
- break;
- }
- }
- } else {
- $$0$lcssa = $$026$lcssa;$$025$lcssa = $$027$lcssa;
- }
- $$1$ph = $$0$lcssa;$$128$ph = $$025$lcssa;
- label = 8;
- } else {
- $$1$ph = $1;$$128$ph = $0;
- label = 8;
- }
- } while(0);
- if ((label|0) == 8) {
- $31 = HEAP8[$$1$ph>>0]|0;
- HEAP8[$$128$ph>>0] = $31;
- $32 = ($31<<24>>24)==(0);
- if ($32) {
- $$029 = $$128$ph;
- } else {
- $$12834 = $$128$ph;$$135 = $$1$ph;
- while(1) {
- $33 = ((($$135)) + 1|0);
- $34 = ((($$12834)) + 1|0);
- $35 = HEAP8[$33>>0]|0;
- HEAP8[$34>>0] = $35;
- $36 = ($35<<24>>24)==(0);
- if ($36) {
- $$029 = $34;
- break;
- } else {
- $$12834 = $34;$$135 = $33;
- }
- }
- }
- }
- return ($$029|0);
- }
- function ___ofl_lock() {
- var label = 0, sp = 0;
- sp = STACKTOP;
- ___lock((33288|0));
- return (33296|0);
- }
- function ___ofl_unlock() {
- var label = 0, sp = 0;
- sp = STACKTOP;
- ___unlock((33288|0));
- return;
- }
- function _fflush($0) {
- $0 = $0|0;
- 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;
- 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;
- sp = STACKTOP;
- $1 = ($0|0)==(0|0);
- do {
- if ($1) {
- $8 = (Atomics_load(HEAP32,780)|0);
- $9 = ($8|0)==(0|0);
- if ($9) {
- $29 = 0;
- } else {
- $10 = (Atomics_load(HEAP32,780)|0);
- $11 = (_fflush($10)|0);
- $29 = $11;
- }
- $12 = (___ofl_lock()|0);
- $$02325 = HEAP32[$12>>2]|0;
- $13 = ($$02325|0)==(0|0);
- if ($13) {
- $$024$lcssa = $29;
- } else {
- $$02327 = $$02325;$$02426 = $29;
- while(1) {
- $14 = ((($$02327)) + 76|0);
- $15 = (Atomics_load(HEAP32,$14>>2)|0);
- $16 = ($15|0)>(-1);
- if ($16) {
- $17 = (___lockfile($$02327)|0);
- $26 = $17;
- } else {
- $26 = 0;
- }
- $18 = ((($$02327)) + 20|0);
- $19 = HEAP32[$18>>2]|0;
- $20 = ((($$02327)) + 28|0);
- $21 = HEAP32[$20>>2]|0;
- $22 = ($19>>>0)>($21>>>0);
- if ($22) {
- $23 = (___fflush_unlocked($$02327)|0);
- $24 = $23 | $$02426;
- $$1 = $24;
- } else {
- $$1 = $$02426;
- }
- $25 = ($26|0)==(0);
- if (!($25)) {
- ___unlockfile($$02327);
- }
- $27 = ((($$02327)) + 56|0);
- $$023 = HEAP32[$27>>2]|0;
- $28 = ($$023|0)==(0|0);
- if ($28) {
- $$024$lcssa = $$1;
- break;
- } else {
- $$02327 = $$023;$$02426 = $$1;
- }
- }
- }
- ___ofl_unlock();
- $$0 = $$024$lcssa;
- } else {
- $2 = ((($0)) + 76|0);
- $3 = (Atomics_load(HEAP32,$2>>2)|0);
- $4 = ($3|0)>(-1);
- if (!($4)) {
- $5 = (___fflush_unlocked($0)|0);
- $$0 = $5;
- break;
- }
- $6 = (___lockfile($0)|0);
- $phitmp = ($6|0)==(0);
- $7 = (___fflush_unlocked($0)|0);
- if ($phitmp) {
- $$0 = $7;
- } else {
- ___unlockfile($0);
- $$0 = $7;
- }
- }
- } while(0);
- return ($$0|0);
- }
- function ___fflush_unlocked($0) {
- $0 = $0|0;
- 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;
- var $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = ((($0)) + 20|0);
- $2 = HEAP32[$1>>2]|0;
- $3 = ((($0)) + 28|0);
- $4 = HEAP32[$3>>2]|0;
- $5 = ($2>>>0)>($4>>>0);
- if ($5) {
- $6 = ((($0)) + 36|0);
- $7 = HEAP32[$6>>2]|0;
- (FUNCTION_TABLE_iiii[$7 & 15]($0,0,0)|0);
- $8 = HEAP32[$1>>2]|0;
- $9 = ($8|0)==(0|0);
- if ($9) {
- $$0 = -1;
- } else {
- label = 3;
- }
- } else {
- label = 3;
- }
- if ((label|0) == 3) {
- $10 = ((($0)) + 4|0);
- $11 = HEAP32[$10>>2]|0;
- $12 = ((($0)) + 8|0);
- $13 = HEAP32[$12>>2]|0;
- $14 = ($11>>>0)<($13>>>0);
- if ($14) {
- $15 = $11;
- $16 = $13;
- $17 = (($15) - ($16))|0;
- $18 = ((($0)) + 40|0);
- $19 = HEAP32[$18>>2]|0;
- (FUNCTION_TABLE_iiii[$19 & 15]($0,$17,1)|0);
- }
- $20 = ((($0)) + 16|0);
- HEAP32[$20>>2] = 0;
- HEAP32[$3>>2] = 0;
- HEAP32[$1>>2] = 0;
- HEAP32[$12>>2] = 0;
- HEAP32[$10>>2] = 0;
- $$0 = 0;
- }
- return ($$0|0);
- }
- function _strstr($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- 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;
- sp = STACKTOP;
- $2 = HEAP8[$1>>0]|0;
- $3 = ($2<<24>>24)==(0);
- do {
- if ($3) {
- $$0 = $0;
- } else {
- $4 = $2 << 24 >> 24;
- $5 = (_strchr($0,$4)|0);
- $6 = ($5|0)==(0|0);
- if ($6) {
- $$0 = 0;
- } else {
- $7 = ((($1)) + 1|0);
- $8 = HEAP8[$7>>0]|0;
- $9 = ($8<<24>>24)==(0);
- if ($9) {
- $$0 = $5;
- } else {
- $10 = ((($5)) + 1|0);
- $11 = HEAP8[$10>>0]|0;
- $12 = ($11<<24>>24)==(0);
- if ($12) {
- $$0 = 0;
- } else {
- $13 = ((($1)) + 2|0);
- $14 = HEAP8[$13>>0]|0;
- $15 = ($14<<24>>24)==(0);
- if ($15) {
- $16 = (_twobyte_strstr($5,$1)|0);
- $$0 = $16;
- break;
- }
- $17 = ((($5)) + 2|0);
- $18 = HEAP8[$17>>0]|0;
- $19 = ($18<<24>>24)==(0);
- if ($19) {
- $$0 = 0;
- } else {
- $20 = ((($1)) + 3|0);
- $21 = HEAP8[$20>>0]|0;
- $22 = ($21<<24>>24)==(0);
- if ($22) {
- $23 = (_threebyte_strstr($5,$1)|0);
- $$0 = $23;
- break;
- }
- $24 = ((($5)) + 3|0);
- $25 = HEAP8[$24>>0]|0;
- $26 = ($25<<24>>24)==(0);
- if ($26) {
- $$0 = 0;
- } else {
- $27 = ((($1)) + 4|0);
- $28 = HEAP8[$27>>0]|0;
- $29 = ($28<<24>>24)==(0);
- if ($29) {
- $30 = (_fourbyte_strstr($5,$1)|0);
- $$0 = $30;
- break;
- } else {
- $31 = (_twoway_strstr($5,$1)|0);
- $$0 = $31;
- break;
- }
- }
- }
- }
- }
- }
- }
- } while(0);
- return ($$0|0);
- }
- function _twobyte_strstr($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- var label = 0, sp = 0;
- sp = STACKTOP;
- $2 = HEAP8[$1>>0]|0;
- $3 = $2&255;
- $4 = $3 << 8;
- $5 = ((($1)) + 1|0);
- $6 = HEAP8[$5>>0]|0;
- $7 = $6&255;
- $8 = $4 | $7;
- $9 = HEAP8[$0>>0]|0;
- $10 = $9&255;
- $$sink$in = $10;$$sink17$sink = $0;
- while(1) {
- $11 = ((($$sink17$sink)) + 1|0);
- $12 = HEAP8[$11>>0]|0;
- $13 = ($12<<24>>24)==(0);
- if ($13) {
- $$lcssa = 0;
- break;
- }
- $$sink = $$sink$in << 8;
- $14 = $12&255;
- $$sink$masked = $$sink & 65280;
- $15 = $14 | $$sink$masked;
- $16 = ($15|0)==($8|0);
- if ($16) {
- $$lcssa = $$sink17$sink;
- break;
- } else {
- $$sink$in = $15;$$sink17$sink = $11;
- }
- }
- return ($$lcssa|0);
- }
- function _threebyte_strstr($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- 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;
- var $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, $or$cond18 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $2 = HEAP8[$1>>0]|0;
- $3 = $2&255;
- $4 = $3 << 24;
- $5 = ((($1)) + 1|0);
- $6 = HEAP8[$5>>0]|0;
- $7 = $6&255;
- $8 = $7 << 16;
- $9 = $8 | $4;
- $10 = ((($1)) + 2|0);
- $11 = HEAP8[$10>>0]|0;
- $12 = $11&255;
- $13 = $12 << 8;
- $14 = $9 | $13;
- $15 = HEAP8[$0>>0]|0;
- $16 = $15&255;
- $17 = $16 << 24;
- $18 = ((($0)) + 1|0);
- $19 = HEAP8[$18>>0]|0;
- $20 = $19&255;
- $21 = $20 << 16;
- $22 = $21 | $17;
- $23 = ((($0)) + 2|0);
- $24 = HEAP8[$23>>0]|0;
- $25 = $24&255;
- $26 = $25 << 8;
- $27 = $22 | $26;
- $28 = ($24<<24>>24)!=(0);
- $$not17 = $28 ^ 1;
- $29 = ($27|0)==($14|0);
- $or$cond18 = $29 | $$not17;
- if ($or$cond18) {
- $$016$lcssa = $23;$$lcssa = $28;
- } else {
- $$01619 = $23;$$020 = $27;
- while(1) {
- $30 = ((($$01619)) + 1|0);
- $31 = HEAP8[$30>>0]|0;
- $32 = $31&255;
- $33 = $32 | $$020;
- $34 = $33 << 8;
- $35 = ($31<<24>>24)!=(0);
- $$not = $35 ^ 1;
- $36 = ($34|0)==($14|0);
- $or$cond = $36 | $$not;
- if ($or$cond) {
- $$016$lcssa = $30;$$lcssa = $35;
- break;
- } else {
- $$01619 = $30;$$020 = $34;
- }
- }
- }
- $37 = ((($$016$lcssa)) + -2|0);
- $38 = $$lcssa ? $37 : 0;
- return ($38|0);
- }
- function _fourbyte_strstr($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- $2 = HEAP8[$1>>0]|0;
- $3 = $2&255;
- $4 = $3 << 24;
- $5 = ((($1)) + 1|0);
- $6 = HEAP8[$5>>0]|0;
- $7 = $6&255;
- $8 = $7 << 16;
- $9 = $8 | $4;
- $10 = ((($1)) + 2|0);
- $11 = HEAP8[$10>>0]|0;
- $12 = $11&255;
- $13 = $12 << 8;
- $14 = $9 | $13;
- $15 = ((($1)) + 3|0);
- $16 = HEAP8[$15>>0]|0;
- $17 = $16&255;
- $18 = $14 | $17;
- $19 = HEAP8[$0>>0]|0;
- $20 = $19&255;
- $21 = $20 << 24;
- $22 = ((($0)) + 1|0);
- $23 = HEAP8[$22>>0]|0;
- $24 = $23&255;
- $25 = $24 << 16;
- $26 = $25 | $21;
- $27 = ((($0)) + 2|0);
- $28 = HEAP8[$27>>0]|0;
- $29 = $28&255;
- $30 = $29 << 8;
- $31 = $26 | $30;
- $32 = ((($0)) + 3|0);
- $33 = HEAP8[$32>>0]|0;
- $34 = $33&255;
- $35 = $34 | $31;
- $36 = ($33<<24>>24)!=(0);
- $$not22 = $36 ^ 1;
- $37 = ($35|0)==($18|0);
- $or$cond23 = $37 | $$not22;
- if ($or$cond23) {
- $$lcssa = $36;$$sink21$lcssa = $32;
- } else {
- $$sink2124 = $32;$39 = $35;
- while(1) {
- $38 = $39 << 8;
- $40 = ((($$sink2124)) + 1|0);
- $41 = HEAP8[$40>>0]|0;
- $42 = $41&255;
- $43 = $42 | $38;
- $44 = ($41<<24>>24)!=(0);
- $$not = $44 ^ 1;
- $45 = ($43|0)==($18|0);
- $or$cond = $45 | $$not;
- if ($or$cond) {
- $$lcssa = $44;$$sink21$lcssa = $40;
- break;
- } else {
- $$sink2124 = $40;$39 = $43;
- }
- }
- }
- $46 = ((($$sink21$lcssa)) + -3|0);
- $47 = $$lcssa ? $46 : 0;
- return ($47|0);
- }
- function _twoway_strstr($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 1056|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(1056|0);
- $2 = sp + 1024|0;
- $3 = sp;
- ;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;
- $4 = HEAP8[$1>>0]|0;
- $cond265 = ($4<<24>>24)==(0);
- L1: do {
- if ($cond265) {
- $$0175$ph$ph$lcssa220323 = 1;$$0185$ph$lcssa322 = -1;$$0187$lcssa320321 = 0;$$1176$ph$ph$lcssa211 = 1;$$1186$ph$lcssa = -1;
- label = 27;
- } else {
- $5 = $4&255;
- $$0187266 = 0;$12 = $4;$20 = $5;
- while(1) {
- $8 = (($0) + ($$0187266)|0);
- $9 = HEAP8[$8>>0]|0;
- $10 = ($9<<24>>24)==(0);
- if ($10) {
- $$3 = 0;
- break L1;
- }
- $11 = $12 & 31;
- $13 = $11&255;
- $14 = 1 << $13;
- $div188 = ($12&255) >>> 5;
- $15 = $div188&255;
- $16 = (($2) + ($15<<2)|0);
- $17 = HEAP32[$16>>2]|0;
- $18 = $17 | $14;
- HEAP32[$16>>2] = $18;
- $7 = (($$0187266) + 1)|0;
- $19 = (($3) + ($20<<2)|0);
- HEAP32[$19>>2] = $7;
- $21 = (($1) + ($7)|0);
- $22 = HEAP8[$21>>0]|0;
- $23 = $22&255;
- $cond = ($22<<24>>24)==(0);
- if ($cond) {
- break;
- } else {
- $$0187266 = $7;$12 = $22;$20 = $23;
- }
- }
- $6 = ($7>>>0)>(1);
- if ($6) {
- $$0183$ph262 = 0;$$0185$ph261 = -1;$129 = 1;
- L7: while(1) {
- $$0175$ph$ph256 = 1;$$0183$ph200$ph255 = $$0183$ph262;$132 = $129;
- while(1) {
- $$0183$ph200250 = $$0183$ph200$ph255;$131 = $132;
- L11: while(1) {
- $$0179244 = 1;$31 = $131;
- while(1) {
- $27 = (($$0179244) + ($$0185$ph261))|0;
- $28 = (($1) + ($27)|0);
- $29 = HEAP8[$28>>0]|0;
- $30 = (($1) + ($31)|0);
- $32 = HEAP8[$30>>0]|0;
- $33 = ($29<<24>>24)==($32<<24>>24);
- if (!($33)) {
- break L11;
- }
- $34 = ($$0179244|0)==($$0175$ph$ph256|0);
- $25 = (($$0179244) + 1)|0;
- if ($34) {
- break;
- }
- $24 = (($25) + ($$0183$ph200250))|0;
- $26 = ($24>>>0)<($7>>>0);
- if ($26) {
- $$0179244 = $25;$31 = $24;
- } else {
- $$0175$ph$ph$lcssa220 = $$0175$ph$ph256;$$0185$ph$lcssa = $$0185$ph261;
- break L7;
- }
- }
- $35 = (($$0175$ph$ph256) + ($$0183$ph200250))|0;
- $36 = (($35) + 1)|0;
- $37 = ($36>>>0)<($7>>>0);
- if ($37) {
- $$0183$ph200250 = $35;$131 = $36;
- } else {
- $$0175$ph$ph$lcssa220 = $$0175$ph$ph256;$$0185$ph$lcssa = $$0185$ph261;
- break L7;
- }
- }
- $38 = ($29&255)>($32&255);
- $39 = (($31) - ($$0185$ph261))|0;
- if (!($38)) {
- break;
- }
- $43 = (($31) + 1)|0;
- $44 = ($43>>>0)<($7>>>0);
- if ($44) {
- $$0175$ph$ph256 = $39;$$0183$ph200$ph255 = $31;$132 = $43;
- } else {
- $$0175$ph$ph$lcssa220 = $39;$$0185$ph$lcssa = $$0185$ph261;
- break L7;
- }
- }
- $40 = (($$0183$ph200250) + 1)|0;
- $41 = (($$0183$ph200250) + 2)|0;
- $42 = ($41>>>0)<($7>>>0);
- if ($42) {
- $$0183$ph262 = $40;$$0185$ph261 = $$0183$ph200250;$129 = $41;
- } else {
- $$0175$ph$ph$lcssa220 = 1;$$0185$ph$lcssa = $$0183$ph200250;
- break;
- }
- }
- if ($6) {
- $$1184$ph241 = 0;$$1186$ph240 = -1;$130 = 1;
- while(1) {
- $$1176$ph$ph235 = 1;$$1184$ph196$ph234 = $$1184$ph241;$134 = $130;
- while(1) {
- $$1184$ph196229 = $$1184$ph196$ph234;$133 = $134;
- L26: while(1) {
- $$1180224 = 1;$52 = $133;
- while(1) {
- $48 = (($$1180224) + ($$1186$ph240))|0;
- $49 = (($1) + ($48)|0);
- $50 = HEAP8[$49>>0]|0;
- $51 = (($1) + ($52)|0);
- $53 = HEAP8[$51>>0]|0;
- $54 = ($50<<24>>24)==($53<<24>>24);
- if (!($54)) {
- break L26;
- }
- $55 = ($$1180224|0)==($$1176$ph$ph235|0);
- $46 = (($$1180224) + 1)|0;
- if ($55) {
- break;
- }
- $45 = (($46) + ($$1184$ph196229))|0;
- $47 = ($45>>>0)<($7>>>0);
- if ($47) {
- $$1180224 = $46;$52 = $45;
- } else {
- $$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;
- label = 27;
- break L1;
- }
- }
- $56 = (($$1176$ph$ph235) + ($$1184$ph196229))|0;
- $57 = (($56) + 1)|0;
- $58 = ($57>>>0)<($7>>>0);
- if ($58) {
- $$1184$ph196229 = $56;$133 = $57;
- } else {
- $$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;
- label = 27;
- break L1;
- }
- }
- $59 = ($50&255)<($53&255);
- $60 = (($52) - ($$1186$ph240))|0;
- if (!($59)) {
- break;
- }
- $64 = (($52) + 1)|0;
- $65 = ($64>>>0)<($7>>>0);
- if ($65) {
- $$1176$ph$ph235 = $60;$$1184$ph196$ph234 = $52;$134 = $64;
- } else {
- $$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;
- label = 27;
- break L1;
- }
- }
- $61 = (($$1184$ph196229) + 1)|0;
- $62 = (($$1184$ph196229) + 2)|0;
- $63 = ($62>>>0)<($7>>>0);
- if ($63) {
- $$1184$ph241 = $61;$$1186$ph240 = $$1184$ph196229;$130 = $62;
- } else {
- $$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;
- label = 27;
- break;
- }
- }
- } else {
- $$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;
- label = 27;
- }
- } else {
- $$0175$ph$ph$lcssa220323 = 1;$$0185$ph$lcssa322 = -1;$$0187$lcssa320321 = $7;$$1176$ph$ph$lcssa211 = 1;$$1186$ph$lcssa = -1;
- label = 27;
- }
- }
- } while(0);
- L36: do {
- if ((label|0) == 27) {
- $66 = (($$1186$ph$lcssa) + 1)|0;
- $67 = (($$0185$ph$lcssa322) + 1)|0;
- $68 = ($66>>>0)>($67>>>0);
- $$1176$$0175 = $68 ? $$1176$ph$ph$lcssa211 : $$0175$ph$ph$lcssa220323;
- $$1186$$0185 = $68 ? $$1186$ph$lcssa : $$0185$ph$lcssa322;
- $69 = (($1) + ($$1176$$0175)|0);
- $70 = (($$1186$$0185) + 1)|0;
- $71 = (_memcmp($1,$69,$70)|0);
- $72 = ($71|0)==(0);
- if ($72) {
- $77 = (($$0187$lcssa320321) - ($$1176$$0175))|0;
- $$0168 = $77;$$3178 = $$1176$$0175;
- } else {
- $73 = (($$0187$lcssa320321) - ($$1186$$0185))|0;
- $74 = (($73) + -1)|0;
- $75 = ($$1186$$0185>>>0)>($74>>>0);
- $$1186$$0185$ = $75 ? $$1186$$0185 : $74;
- $76 = (($$1186$$0185$) + 1)|0;
- $$0168 = 0;$$3178 = $76;
- }
- $78 = $$0187$lcssa320321 | 63;
- $79 = (($$0187$lcssa320321) + -1)|0;
- $80 = ($$0168|0)!=(0);
- $81 = (($$0187$lcssa320321) - ($$3178))|0;
- $$0166 = $0;$$0169 = 0;$$0170 = $0;
- while(1) {
- $82 = $$0170;
- $83 = $$0166;
- $84 = (($82) - ($83))|0;
- $85 = ($84>>>0)<($$0187$lcssa320321>>>0);
- do {
- if ($85) {
- $86 = (_memchr($$0170,0,$78)|0);
- $87 = ($86|0)==(0|0);
- if ($87) {
- $91 = (($$0170) + ($78)|0);
- $$3173 = $91;
- break;
- } else {
- $88 = $86;
- $89 = (($88) - ($83))|0;
- $90 = ($89>>>0)<($$0187$lcssa320321>>>0);
- if ($90) {
- $$3 = 0;
- break L36;
- } else {
- $$3173 = $86;
- break;
- }
- }
- } else {
- $$3173 = $$0170;
- }
- } while(0);
- $92 = (($$0166) + ($79)|0);
- $93 = HEAP8[$92>>0]|0;
- $div = ($93&255) >>> 5;
- $94 = $div&255;
- $95 = (($2) + ($94<<2)|0);
- $96 = HEAP32[$95>>2]|0;
- $97 = $93 & 31;
- $98 = $97&255;
- $99 = 1 << $98;
- $100 = $99 & $96;
- $101 = ($100|0)==(0);
- L50: do {
- if ($101) {
- $$0169$be = 0;$$2181$sink = $$0187$lcssa320321;
- } else {
- $102 = $93&255;
- $103 = (($3) + ($102<<2)|0);
- $104 = HEAP32[$103>>2]|0;
- $105 = (($$0187$lcssa320321) - ($104))|0;
- $106 = ($105|0)==(0);
- if (!($106)) {
- $107 = ($$0169|0)!=(0);
- $or$cond = $80 & $107;
- $108 = ($105>>>0)<($$3178>>>0);
- $or$cond190 = $or$cond & $108;
- $$2181 = $or$cond190 ? $81 : $105;
- $$0169$be = 0;$$2181$sink = $$2181;
- break;
- }
- $110 = ($70>>>0)>($$0169>>>0);
- $111 = $110 ? $70 : $$0169;
- $112 = (($1) + ($111)|0);
- $113 = HEAP8[$112>>0]|0;
- $cond191222 = ($113<<24>>24)==(0);
- L55: do {
- if ($cond191222) {
- $$4 = $70;
- } else {
- $$3182223 = $111;$117 = $113;
- while(1) {
- $114 = (($$0166) + ($$3182223)|0);
- $115 = HEAP8[$114>>0]|0;
- $116 = ($117<<24>>24)==($115<<24>>24);
- if (!($116)) {
- break;
- }
- $118 = (($$3182223) + 1)|0;
- $119 = (($1) + ($118)|0);
- $120 = HEAP8[$119>>0]|0;
- $cond191 = ($120<<24>>24)==(0);
- if ($cond191) {
- $$4 = $70;
- break L55;
- } else {
- $$3182223 = $118;$117 = $120;
- }
- }
- $121 = (($$3182223) - ($$1186$$0185))|0;
- $$0169$be = 0;$$2181$sink = $121;
- break L50;
- }
- } while(0);
- while(1) {
- $122 = ($$4>>>0)>($$0169>>>0);
- if (!($122)) {
- $$3 = $$0166;
- break L36;
- }
- $123 = (($$4) + -1)|0;
- $124 = (($1) + ($123)|0);
- $125 = HEAP8[$124>>0]|0;
- $126 = (($$0166) + ($123)|0);
- $127 = HEAP8[$126>>0]|0;
- $128 = ($125<<24>>24)==($127<<24>>24);
- if ($128) {
- $$4 = $123;
- } else {
- $$0169$be = $$0168;$$2181$sink = $$3178;
- break;
- }
- }
- }
- } while(0);
- $109 = (($$0166) + ($$2181$sink)|0);
- $$0166 = $109;$$0169 = $$0169$be;$$0170 = $$3173;
- }
- }
- } while(0);
- STACKTOP = sp;return ($$3|0);
- }
- function _strspn($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- 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;
- var $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $div = 0, $div21 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
- $2 = sp;
- ;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;
- $3 = HEAP8[$1>>0]|0;
- $4 = ($3<<24>>24)==(0);
- do {
- if ($4) {
- $$0 = 0;
- } else {
- $5 = ((($1)) + 1|0);
- $6 = HEAP8[$5>>0]|0;
- $7 = ($6<<24>>24)==(0);
- if ($7) {
- $$020 = $0;
- while(1) {
- $8 = HEAP8[$$020>>0]|0;
- $9 = ($8<<24>>24)==($3<<24>>24);
- $10 = ((($$020)) + 1|0);
- if ($9) {
- $$020 = $10;
- } else {
- break;
- }
- }
- $11 = $$020;
- $12 = $0;
- $13 = (($11) - ($12))|0;
- $$0 = $13;
- break;
- } else {
- $$01925 = $1;$17 = $3;
- }
- while(1) {
- $16 = $17 & 31;
- $18 = $16&255;
- $19 = 1 << $18;
- $div21 = ($17&255) >>> 5;
- $20 = $div21&255;
- $21 = (($2) + ($20<<2)|0);
- $22 = HEAP32[$21>>2]|0;
- $23 = $22 | $19;
- HEAP32[$21>>2] = $23;
- $24 = ((($$01925)) + 1|0);
- $25 = HEAP8[$24>>0]|0;
- $26 = ($25<<24>>24)==(0);
- if ($26) {
- break;
- } else {
- $$01925 = $24;$17 = $25;
- }
- }
- $14 = HEAP8[$0>>0]|0;
- $15 = ($14<<24>>24)==(0);
- L10: do {
- if ($15) {
- $$1$lcssa = $0;
- } else {
- $$123 = $0;$27 = $14;
- while(1) {
- $div = ($27&255) >>> 5;
- $28 = $div&255;
- $29 = (($2) + ($28<<2)|0);
- $30 = HEAP32[$29>>2]|0;
- $31 = $27 & 31;
- $32 = $31&255;
- $33 = 1 << $32;
- $34 = $30 & $33;
- $35 = ($34|0)==(0);
- if ($35) {
- $$1$lcssa = $$123;
- break L10;
- }
- $36 = ((($$123)) + 1|0);
- $37 = HEAP8[$36>>0]|0;
- $38 = ($37<<24>>24)==(0);
- if ($38) {
- $$1$lcssa = $36;
- break;
- } else {
- $$123 = $36;$27 = $37;
- }
- }
- }
- } while(0);
- $39 = $$1$lcssa;
- $40 = $0;
- $41 = (($39) - ($40))|0;
- $$0 = $41;
- }
- } while(0);
- STACKTOP = sp;return ($$0|0);
- }
- function _srand($0) {
- $0 = $0|0;
- var $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = (($0) + -1)|0;
- $2 = 14264;
- $3 = $2;
- HEAP32[$3>>2] = $1;
- $4 = (($2) + 4)|0;
- $5 = $4;
- HEAP32[$5>>2] = 0;
- return;
- }
- function _vprintf($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- var $2 = 0, $3 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $2 = HEAP32[748]|0;
- $3 = (_vfprintf($2,$0,$1)|0);
- return ($3|0);
- }
- function _strcspn($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- 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;
- var $div20 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
- $2 = sp;
- $3 = HEAP8[$1>>0]|0;
- $4 = ($3<<24>>24)==(0);
- L1: do {
- if ($4) {
- label = 3;
- } else {
- $5 = ((($1)) + 1|0);
- $6 = HEAP8[$5>>0]|0;
- $7 = ($6<<24>>24)==(0);
- if ($7) {
- label = 3;
- } else {
- ;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;
- $$01824 = $1;$13 = $3;
- while(1) {
- $12 = $13 & 31;
- $14 = $12&255;
- $15 = 1 << $14;
- $div20 = ($13&255) >>> 5;
- $16 = $div20&255;
- $17 = (($2) + ($16<<2)|0);
- $18 = HEAP32[$17>>2]|0;
- $19 = $18 | $15;
- HEAP32[$17>>2] = $19;
- $20 = ((($$01824)) + 1|0);
- $21 = HEAP8[$20>>0]|0;
- $22 = ($21<<24>>24)==(0);
- if ($22) {
- break;
- } else {
- $$01824 = $20;$13 = $21;
- }
- }
- $10 = HEAP8[$0>>0]|0;
- $11 = ($10<<24>>24)==(0);
- if ($11) {
- $$019$sink = $0;
- } else {
- $$01922 = $0;$23 = $10;
- while(1) {
- $div = ($23&255) >>> 5;
- $24 = $div&255;
- $25 = (($2) + ($24<<2)|0);
- $26 = HEAP32[$25>>2]|0;
- $27 = $23 & 31;
- $28 = $27&255;
- $29 = 1 << $28;
- $30 = $26 & $29;
- $31 = ($30|0)==(0);
- if (!($31)) {
- $$019$sink = $$01922;
- break L1;
- }
- $32 = ((($$01922)) + 1|0);
- $33 = HEAP8[$32>>0]|0;
- $34 = ($33<<24>>24)==(0);
- if ($34) {
- $$019$sink = $32;
- break;
- } else {
- $$01922 = $32;$23 = $33;
- }
- }
- }
- }
- }
- } while(0);
- if ((label|0) == 3) {
- $8 = $3 << 24 >> 24;
- $9 = (___strchrnul($0,$8)|0);
- $$019$sink = $9;
- }
- $35 = $$019$sink;
- $36 = $0;
- $37 = (($35) - ($36))|0;
- STACKTOP = sp;return ($37|0);
- }
- function _strcat($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- var $2 = 0, $3 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $2 = (_strlen($0)|0);
- $3 = (($0) + ($2)|0);
- (_strcpy($3,$1)|0);
- return ($0|0);
- }
- function _strtok($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- sp = STACKTOP;
- $2 = ($0|0)==(0|0);
- if ($2) {
- $3 = HEAP32[8325]|0;
- $4 = ($3|0)==(0|0);
- if ($4) {
- $$0 = 0;
- } else {
- $$010 = $3;
- label = 3;
- }
- } else {
- $$010 = $0;
- label = 3;
- }
- do {
- if ((label|0) == 3) {
- $5 = (_strspn($$010,$1)|0);
- $6 = (($$010) + ($5)|0);
- $7 = HEAP8[$6>>0]|0;
- $8 = ($7<<24>>24)==(0);
- if ($8) {
- HEAP32[8325] = 0;
- $$0 = 0;
- break;
- }
- $9 = (_strcspn($6,$1)|0);
- $10 = (($6) + ($9)|0);
- HEAP32[8325] = $10;
- $11 = HEAP8[$10>>0]|0;
- $12 = ($11<<24>>24)==(0);
- if ($12) {
- HEAP32[8325] = 0;
- $$0 = $6;
- break;
- } else {
- $13 = ((($10)) + 1|0);
- HEAP32[8325] = $13;
- HEAP8[$10>>0] = 0;
- $$0 = $6;
- break;
- }
- }
- } while(0);
- return ($$0|0);
- }
- function __emscripten_atomic_fetch_and_add_u64($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- var $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $3 = $0;
- $4 = $3 >>> 3;
- $5 = $4 & 255;
- $6 = (34376 + ($5<<2)|0);
- while(1) {
- while(1) {
- $7 = (Atomics_load(HEAP32, $6>>2)|0);
- $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
- $9 = ($7|0)==($8|0);
- if ($9) {
- break;
- }
- }
- $10 = ($7|0)==(0);
- if ($10) {
- break;
- }
- }
- $11 = $0;
- $12 = $11;
- $13 = HEAP32[$12>>2]|0;
- $14 = (($11) + 4)|0;
- $15 = $14;
- $16 = HEAP32[$15>>2]|0;
- $17 = (_i64Add(($13|0),($16|0),($1|0),($2|0))|0);
- $18 = tempRet0;
- $19 = $0;
- $20 = $19;
- HEAP32[$20>>2] = $17;
- $21 = (($19) + 4)|0;
- $22 = $21;
- HEAP32[$22>>2] = $18;
- $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
- tempRet0 = ($16);
- return ($13|0);
- }
- function __emscripten_atomic_fetch_and_and_u64($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- var $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $3 = $0;
- $4 = $3 >>> 3;
- $5 = $4 & 255;
- $6 = (34376 + ($5<<2)|0);
- while(1) {
- while(1) {
- $7 = (Atomics_load(HEAP32, $6>>2)|0);
- $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
- $9 = ($7|0)==($8|0);
- if ($9) {
- break;
- }
- }
- $10 = ($7|0)==(0);
- if ($10) {
- break;
- }
- }
- $11 = $0;
- $12 = $11;
- $13 = HEAP32[$12>>2]|0;
- $14 = (($11) + 4)|0;
- $15 = $14;
- $16 = HEAP32[$15>>2]|0;
- $17 = $13 & $1;
- $18 = $16 & $2;
- $19 = $0;
- $20 = $19;
- HEAP32[$20>>2] = $17;
- $21 = (($19) + 4)|0;
- $22 = $21;
- HEAP32[$22>>2] = $18;
- $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
- tempRet0 = ($16);
- return ($13|0);
- }
- function __emscripten_atomic_fetch_and_or_u64($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- var $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $3 = $0;
- $4 = $3 >>> 3;
- $5 = $4 & 255;
- $6 = (34376 + ($5<<2)|0);
- while(1) {
- while(1) {
- $7 = (Atomics_load(HEAP32, $6>>2)|0);
- $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
- $9 = ($7|0)==($8|0);
- if ($9) {
- break;
- }
- }
- $10 = ($7|0)==(0);
- if ($10) {
- break;
- }
- }
- $11 = $0;
- $12 = $11;
- $13 = HEAP32[$12>>2]|0;
- $14 = (($11) + 4)|0;
- $15 = $14;
- $16 = HEAP32[$15>>2]|0;
- $17 = $13 | $1;
- $18 = $16 | $2;
- $19 = $0;
- $20 = $19;
- HEAP32[$20>>2] = $17;
- $21 = (($19) + 4)|0;
- $22 = $21;
- HEAP32[$22>>2] = $18;
- $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
- tempRet0 = ($16);
- return ($13|0);
- }
- function __emscripten_atomic_fetch_and_sub_u64($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- var $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $3 = $0;
- $4 = $3 >>> 3;
- $5 = $4 & 255;
- $6 = (34376 + ($5<<2)|0);
- while(1) {
- while(1) {
- $7 = (Atomics_load(HEAP32, $6>>2)|0);
- $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
- $9 = ($7|0)==($8|0);
- if ($9) {
- break;
- }
- }
- $10 = ($7|0)==(0);
- if ($10) {
- break;
- }
- }
- $11 = $0;
- $12 = $11;
- $13 = HEAP32[$12>>2]|0;
- $14 = (($11) + 4)|0;
- $15 = $14;
- $16 = HEAP32[$15>>2]|0;
- $17 = (_i64Subtract(($13|0),($16|0),($1|0),($2|0))|0);
- $18 = tempRet0;
- $19 = $0;
- $20 = $19;
- HEAP32[$20>>2] = $17;
- $21 = (($19) + 4)|0;
- $22 = $21;
- HEAP32[$22>>2] = $18;
- $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
- tempRet0 = ($16);
- return ($13|0);
- }
- function __emscripten_atomic_fetch_and_xor_u64($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- var $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $3 = $0;
- $4 = $3 >>> 3;
- $5 = $4 & 255;
- $6 = (34376 + ($5<<2)|0);
- while(1) {
- while(1) {
- $7 = (Atomics_load(HEAP32, $6>>2)|0);
- $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
- $9 = ($7|0)==($8|0);
- if ($9) {
- break;
- }
- }
- $10 = ($7|0)==(0);
- if ($10) {
- break;
- }
- }
- $11 = $0;
- $12 = $11;
- $13 = HEAP32[$12>>2]|0;
- $14 = (($11) + 4)|0;
- $15 = $14;
- $16 = HEAP32[$15>>2]|0;
- $17 = $13 ^ $1;
- $18 = $16 ^ $2;
- $19 = $0;
- $20 = $19;
- HEAP32[$20>>2] = $17;
- $21 = (($19) + 4)|0;
- $22 = $21;
- HEAP32[$22>>2] = $18;
- $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
- tempRet0 = ($16);
- return ($13|0);
- }
- function _emscripten_async_run_in_main_thread($0) {
- $0 = $0|0;
- 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;
- var $9 = 0, $call_queue$init$val = 0, $call_queue$init$val$pre_trunc = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = ($0|0)==(0|0);
- if ($1) {
- ___assert_fail((13870|0),(13702|0),260,(13875|0));
- // unreachable;
- }
- $2 = (_emscripten_is_main_runtime_thread()|0);
- $3 = ($2|0)==(0);
- if (!($3)) {
- __do_call($0);
- return;
- }
- (___pthread_mutex_lock(33820)|0);
- $call_queue$init$val$pre_trunc = HEAP8[38335]|0;
- $call_queue$init$val = $call_queue$init$val$pre_trunc&1;
- if (!($call_queue$init$val)) {
- $$expand_i1_val = 1;
- HEAP8[38335] = $$expand_i1_val;
- }
- $4 = (Atomics_load(HEAP32, 8462)|0);
- $5 = (Atomics_load(HEAP32, 8463)|0);
- $$0$in19 = (($5) + 1)|0;
- $$020 = (($$0$in19|0) % 128)&-1;
- $6 = ($$020|0)==($4|0);
- if ($6) {
- $7 = $4;
- while(1) {
- (___pthread_mutex_unlock(33820)|0);
- (_emscripten_futex_wait((33848|0),($7|0),inf)|0);
- (___pthread_mutex_lock(33820)|0);
- $8 = (Atomics_load(HEAP32, 8462)|0);
- $9 = (Atomics_load(HEAP32, 8463)|0);
- $$0$in = (($9) + 1)|0;
- $$0 = (($$0$in|0) % 128)&-1;
- $10 = ($$0|0)==($8|0);
- if ($10) {
- $7 = $8;
- } else {
- $$0$lcssa = $$0;$$lcssa = $9;$$lcssa18 = $8;
- break;
- }
- }
- } else {
- $$0$lcssa = $$020;$$lcssa = $5;$$lcssa18 = $4;
- }
- $11 = (33856 + ($$lcssa<<2)|0);
- HEAP32[$11>>2] = $0;
- $12 = ($$lcssa18|0)==($$lcssa|0);
- if ($12) {
- _emscripten_asm_const_v(1);
- }
- $13 = (Atomics_store(HEAP32, 8463, $$0$lcssa)|0);
- (___pthread_mutex_unlock(33820)|0);
- return;
- }
- function _emscripten_atomic_add_u64($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- var $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $3 = $0;
- $4 = $3 >>> 3;
- $5 = $4 & 255;
- $6 = (34376 + ($5<<2)|0);
- while(1) {
- while(1) {
- $7 = (Atomics_load(HEAP32, $6>>2)|0);
- $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
- $9 = ($7|0)==($8|0);
- if ($9) {
- break;
- }
- }
- $10 = ($7|0)==(0);
- if ($10) {
- break;
- }
- }
- $11 = $0;
- $12 = $11;
- $13 = HEAP32[$12>>2]|0;
- $14 = (($11) + 4)|0;
- $15 = $14;
- $16 = HEAP32[$15>>2]|0;
- $17 = (_i64Add(($13|0),($16|0),($1|0),($2|0))|0);
- $18 = tempRet0;
- $19 = $0;
- $20 = $19;
- HEAP32[$20>>2] = $17;
- $21 = (($19) + 4)|0;
- $22 = $21;
- HEAP32[$22>>2] = $18;
- $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
- tempRet0 = ($18);
- return ($17|0);
- }
- function _emscripten_atomic_and_u64($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- var $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $3 = $0;
- $4 = $3 >>> 3;
- $5 = $4 & 255;
- $6 = (34376 + ($5<<2)|0);
- while(1) {
- while(1) {
- $7 = (Atomics_load(HEAP32, $6>>2)|0);
- $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
- $9 = ($7|0)==($8|0);
- if ($9) {
- break;
- }
- }
- $10 = ($7|0)==(0);
- if ($10) {
- break;
- }
- }
- $11 = $0;
- $12 = $11;
- $13 = HEAP32[$12>>2]|0;
- $14 = (($11) + 4)|0;
- $15 = $14;
- $16 = HEAP32[$15>>2]|0;
- $17 = $13 & $1;
- $18 = $16 & $2;
- $19 = $0;
- $20 = $19;
- HEAP32[$20>>2] = $17;
- $21 = (($19) + 4)|0;
- $22 = $21;
- HEAP32[$22>>2] = $18;
- $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
- tempRet0 = ($18);
- return ($17|0);
- }
- function _emscripten_atomic_cas_u64($0,$1,$2,$3,$4) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- $4 = $4|0;
- 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;
- var $8 = 0, $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $5 = $0;
- $6 = $5 >>> 3;
- $7 = $6 & 255;
- $8 = (34376 + ($7<<2)|0);
- while(1) {
- while(1) {
- $9 = (Atomics_load(HEAP32, $8>>2)|0);
- $10 = (Atomics_compareExchange(HEAP32, $8>>2, $9, 1)|0);
- $11 = ($9|0)==($10|0);
- if ($11) {
- break;
- }
- }
- $12 = ($9|0)==(0);
- if ($12) {
- break;
- }
- }
- $13 = $0;
- $14 = $13;
- $15 = HEAP32[$14>>2]|0;
- $16 = (($13) + 4)|0;
- $17 = $16;
- $18 = HEAP32[$17>>2]|0;
- $19 = ($15|0)==($1|0);
- $20 = ($18|0)==($2|0);
- $21 = $19 & $20;
- if (!($21)) {
- $26 = (Atomics_store(HEAP32, $8>>2, 0)|0);
- tempRet0 = ($18);
- return ($15|0);
- }
- $22 = $0;
- $23 = $22;
- HEAP32[$23>>2] = $3;
- $24 = (($22) + 4)|0;
- $25 = $24;
- HEAP32[$25>>2] = $4;
- $26 = (Atomics_store(HEAP32, $8>>2, 0)|0);
- tempRet0 = ($18);
- return ($15|0);
- }
- function _emscripten_atomic_exchange_u32($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- var $2 = 0, $3 = 0, $4 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- while(1) {
- $2 = (Atomics_load(HEAP32, $0>>2)|0);
- $3 = (Atomics_compareExchange(HEAP32, $0>>2, $2, $1)|0);
- $4 = ($2|0)==($3|0);
- if ($4) {
- break;
- }
- }
- return ($2|0);
- }
- function _emscripten_atomic_exchange_u64($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- var sp = 0;
- sp = STACKTOP;
- $3 = $0;
- $4 = $3 >>> 3;
- $5 = $4 & 255;
- $6 = (34376 + ($5<<2)|0);
- while(1) {
- while(1) {
- $7 = (Atomics_load(HEAP32, $6>>2)|0);
- $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
- $9 = ($7|0)==($8|0);
- if ($9) {
- break;
- }
- }
- $10 = ($7|0)==(0);
- if ($10) {
- break;
- }
- }
- $11 = $0;
- $12 = $11;
- $13 = HEAP32[$12>>2]|0;
- $14 = (($11) + 4)|0;
- $15 = $14;
- $16 = HEAP32[$15>>2]|0;
- $17 = $0;
- $18 = $17;
- HEAP32[$18>>2] = $1;
- $19 = (($17) + 4)|0;
- $20 = $19;
- HEAP32[$20>>2] = $2;
- $21 = (Atomics_store(HEAP32, $6>>2, 0)|0);
- tempRet0 = ($16);
- return ($13|0);
- }
- function _emscripten_atomic_load_f32($0) {
- $0 = $0|0;
- var $1 = 0, $2 = 0.0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = (Atomics_load(HEAP32, $0>>2)|0);
- $2 = (HEAP32[tempDoublePtr>>2]=$1,+HEAPF32[tempDoublePtr>>2]);
- return (+$2);
- }
- function _emscripten_atomic_load_f64($0) {
- $0 = $0|0;
- 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;
- sp = STACKTOP;
- $1 = $0;
- $2 = $1 >>> 3;
- $3 = $2 & 255;
- $4 = (34376 + ($3<<2)|0);
- while(1) {
- while(1) {
- $5 = (Atomics_load(HEAP32, $4>>2)|0);
- $6 = (Atomics_compareExchange(HEAP32, $4>>2, $5, 1)|0);
- $7 = ($5|0)==($6|0);
- if ($7) {
- break;
- }
- }
- $8 = ($5|0)==(0);
- if ($8) {
- break;
- }
- }
- $9 = +HEAPF64[$0>>3];
- $10 = (Atomics_store(HEAP32, $4>>2, 0)|0);
- return (+$9);
- }
- function _emscripten_atomic_load_u64($0) {
- $0 = $0|0;
- 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;
- sp = STACKTOP;
- $1 = $0;
- $2 = $1 >>> 3;
- $3 = $2 & 255;
- $4 = (34376 + ($3<<2)|0);
- while(1) {
- while(1) {
- $5 = (Atomics_load(HEAP32, $4>>2)|0);
- $6 = (Atomics_compareExchange(HEAP32, $4>>2, $5, 1)|0);
- $7 = ($5|0)==($6|0);
- if ($7) {
- break;
- }
- }
- $8 = ($5|0)==(0);
- if ($8) {
- break;
- }
- }
- $9 = $0;
- $10 = $9;
- $11 = HEAP32[$10>>2]|0;
- $12 = (($9) + 4)|0;
- $13 = $12;
- $14 = HEAP32[$13>>2]|0;
- $15 = (Atomics_store(HEAP32, $4>>2, 0)|0);
- tempRet0 = ($14);
- return ($11|0);
- }
- function _emscripten_atomic_or_u64($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- var $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $3 = $0;
- $4 = $3 >>> 3;
- $5 = $4 & 255;
- $6 = (34376 + ($5<<2)|0);
- while(1) {
- while(1) {
- $7 = (Atomics_load(HEAP32, $6>>2)|0);
- $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
- $9 = ($7|0)==($8|0);
- if ($9) {
- break;
- }
- }
- $10 = ($7|0)==(0);
- if ($10) {
- break;
- }
- }
- $11 = $0;
- $12 = $11;
- $13 = HEAP32[$12>>2]|0;
- $14 = (($11) + 4)|0;
- $15 = $14;
- $16 = HEAP32[$15>>2]|0;
- $17 = $13 | $1;
- $18 = $16 | $2;
- $19 = $0;
- $20 = $19;
- HEAP32[$20>>2] = $17;
- $21 = (($19) + 4)|0;
- $22 = $21;
- HEAP32[$22>>2] = $18;
- $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
- tempRet0 = ($18);
- return ($17|0);
- }
- function _emscripten_atomic_store_f32($0,$1) {
- $0 = $0|0;
- $1 = +$1;
- var $2 = 0, $3 = 0, $4 = 0.0, label = 0, sp = 0;
- sp = STACKTOP;
- $2 = (HEAPF32[tempDoublePtr>>2]=$1,HEAP32[tempDoublePtr>>2]|0);
- $3 = (Atomics_store(HEAP32, $0>>2, $2)|0);
- $4 = (+($3>>>0));
- return (+$4);
- }
- function _emscripten_atomic_store_f64($0,$1) {
- $0 = $0|0;
- $1 = +$1;
- var $10 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $2 = $0;
- $3 = $2 >>> 3;
- $4 = $3 & 255;
- $5 = (34376 + ($4<<2)|0);
- while(1) {
- while(1) {
- $6 = (Atomics_load(HEAP32, $5>>2)|0);
- $7 = (Atomics_compareExchange(HEAP32, $5>>2, $6, 1)|0);
- $8 = ($6|0)==($7|0);
- if ($8) {
- break;
- }
- }
- $9 = ($6|0)==(0);
- if ($9) {
- break;
- }
- }
- HEAPF64[$0>>3] = $1;
- $10 = (Atomics_store(HEAP32, $5>>2, 0)|0);
- return (+$1);
- }
- function _emscripten_atomic_store_u64($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- sp = STACKTOP;
- $3 = $0;
- $4 = $3 >>> 3;
- $5 = $4 & 255;
- $6 = (34376 + ($5<<2)|0);
- while(1) {
- while(1) {
- $7 = (Atomics_load(HEAP32, $6>>2)|0);
- $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
- $9 = ($7|0)==($8|0);
- if ($9) {
- break;
- }
- }
- $10 = ($7|0)==(0);
- if ($10) {
- break;
- }
- }
- $11 = $0;
- $12 = $11;
- HEAP32[$12>>2] = $1;
- $13 = (($11) + 4)|0;
- $14 = $13;
- HEAP32[$14>>2] = $2;
- $15 = (Atomics_store(HEAP32, $6>>2, 0)|0);
- tempRet0 = ($2);
- return ($1|0);
- }
- function _emscripten_atomic_sub_u64($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- var $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $3 = $0;
- $4 = $3 >>> 3;
- $5 = $4 & 255;
- $6 = (34376 + ($5<<2)|0);
- while(1) {
- while(1) {
- $7 = (Atomics_load(HEAP32, $6>>2)|0);
- $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
- $9 = ($7|0)==($8|0);
- if ($9) {
- break;
- }
- }
- $10 = ($7|0)==(0);
- if ($10) {
- break;
- }
- }
- $11 = $0;
- $12 = $11;
- $13 = HEAP32[$12>>2]|0;
- $14 = (($11) + 4)|0;
- $15 = $14;
- $16 = HEAP32[$15>>2]|0;
- $17 = (_i64Subtract(($13|0),($16|0),($1|0),($2|0))|0);
- $18 = tempRet0;
- $19 = $0;
- $20 = $19;
- HEAP32[$20>>2] = $17;
- $21 = (($19) + 4)|0;
- $22 = $21;
- HEAP32[$22>>2] = $18;
- $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
- tempRet0 = ($18);
- return ($17|0);
- }
- function _emscripten_atomic_xor_u64($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- 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;
- var $9 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $3 = $0;
- $4 = $3 >>> 3;
- $5 = $4 & 255;
- $6 = (34376 + ($5<<2)|0);
- while(1) {
- while(1) {
- $7 = (Atomics_load(HEAP32, $6>>2)|0);
- $8 = (Atomics_compareExchange(HEAP32, $6>>2, $7, 1)|0);
- $9 = ($7|0)==($8|0);
- if ($9) {
- break;
- }
- }
- $10 = ($7|0)==(0);
- if ($10) {
- break;
- }
- }
- $11 = $0;
- $12 = $11;
- $13 = HEAP32[$12>>2]|0;
- $14 = (($11) + 4)|0;
- $15 = $14;
- $16 = HEAP32[$15>>2]|0;
- $17 = $13 ^ $1;
- $18 = $16 ^ $2;
- $19 = $0;
- $20 = $19;
- HEAP32[$20>>2] = $17;
- $21 = (($19) + 4)|0;
- $22 = $21;
- HEAP32[$22>>2] = $18;
- $23 = (Atomics_store(HEAP32, $6>>2, 0)|0);
- tempRet0 = ($18);
- return ($17|0);
- }
- function _emscripten_main_thread_process_queued_calls() {
- 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;
- sp = STACKTOP;
- $0 = (_emscripten_is_main_runtime_thread()|0);
- $1 = ($0|0)==(0);
- if ($1) {
- ___assert_fail((13580|0),(13702|0),424,(13766|0));
- // unreachable;
- }
- $2 = (_emscripten_is_main_runtime_thread()|0);
- $3 = ($2|0)==(0);
- $4 = HEAP32[8454]|0;
- $5 = ($4|0)!=(0);
- $or$cond = $3 | $5;
- if ($or$cond) {
- return;
- }
- HEAP32[8454] = 1;
- (___pthread_mutex_lock(33820)|0);
- $6 = (Atomics_load(HEAP32, 8462)|0);
- $7 = (Atomics_load(HEAP32, 8463)|0);
- $8 = ($6|0)==($7|0);
- (___pthread_mutex_unlock(33820)|0);
- if (!($8)) {
- $$0910 = $6;
- while(1) {
- $9 = (33856 + ($$0910<<2)|0);
- $10 = HEAP32[$9>>2]|0;
- __do_call($10);
- (___pthread_mutex_lock(33820)|0);
- $11 = (($$0910) + 1)|0;
- $12 = (($11|0) % 128)&-1;
- $13 = (Atomics_store(HEAP32, 8462, $12)|0);
- $14 = (Atomics_load(HEAP32, 8463)|0);
- $15 = ($12|0)==($14|0);
- (___pthread_mutex_unlock(33820)|0);
- if ($15) {
- break;
- } else {
- $$0910 = $12;
- }
- }
- }
- (_emscripten_futex_wake((33848|0),2147483647)|0);
- HEAP32[8454] = 0;
- return;
- }
- function _emscripten_sync_run_in_main_thread($0) {
- $0 = $0|0;
- var label = 0, sp = 0;
- sp = STACKTOP;
- _emscripten_async_run_in_main_thread($0);
- (_emscripten_wait_for_call_v($0,inf)|0);
- return;
- }
- function _emscripten_sync_run_in_main_thread_0($0) {
- $0 = $0|0;
- var $1 = 0, $2 = 0, $3 = 0, dest = 0, label = 0, sp = 0, stop = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
- $1 = sp;
- dest=$1; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
- HEAP32[$1>>2] = $0;
- $2 = ((($1)) + 80|0);
- HEAP32[$2>>2] = 0;
- _emscripten_async_run_in_main_thread($1);
- (_emscripten_wait_for_call_v($1,inf)|0);
- $3 = HEAP32[$2>>2]|0;
- STACKTOP = sp;return ($3|0);
- }
- function _emscripten_sync_run_in_main_thread_1($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- var $2 = 0, $3 = 0, $4 = 0, $5 = 0, dest = 0, label = 0, sp = 0, stop = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
- $2 = sp;
- dest=$2; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
- HEAP32[$2>>2] = $0;
- $3 = ((($2)) + 16|0);
- HEAP32[$3>>2] = $1;
- $4 = ((($2)) + 80|0);
- HEAP32[$4>>2] = 0;
- _emscripten_async_run_in_main_thread($2);
- (_emscripten_wait_for_call_v($2,inf)|0);
- $5 = HEAP32[$4>>2]|0;
- STACKTOP = sp;return ($5|0);
- }
- function _emscripten_sync_run_in_main_thread_2($0,$1,$2) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- var $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, dest = 0, label = 0, sp = 0, stop = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
- $3 = sp;
- dest=$3; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
- HEAP32[$3>>2] = $0;
- $4 = ((($3)) + 16|0);
- HEAP32[$4>>2] = $1;
- $5 = ((($3)) + 24|0);
- HEAP32[$5>>2] = $2;
- $6 = ((($3)) + 80|0);
- HEAP32[$6>>2] = 0;
- _emscripten_async_run_in_main_thread($3);
- (_emscripten_wait_for_call_v($3,inf)|0);
- $7 = HEAP32[$6>>2]|0;
- STACKTOP = sp;return ($7|0);
- }
- function _emscripten_sync_run_in_main_thread_3($0,$1,$2,$3) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- var $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, stop = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
- $4 = sp;
- dest=$4; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
- HEAP32[$4>>2] = $0;
- $5 = ((($4)) + 16|0);
- HEAP32[$5>>2] = $1;
- $6 = ((($4)) + 24|0);
- HEAP32[$6>>2] = $2;
- $7 = ((($4)) + 32|0);
- HEAP32[$7>>2] = $3;
- $8 = ((($4)) + 80|0);
- HEAP32[$8>>2] = 0;
- _emscripten_async_run_in_main_thread($4);
- (_emscripten_wait_for_call_v($4,inf)|0);
- $9 = HEAP32[$8>>2]|0;
- STACKTOP = sp;return ($9|0);
- }
- function _emscripten_sync_run_in_main_thread_4($0,$1,$2,$3,$4) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- $4 = $4|0;
- var $10 = 0, $11 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, dest = 0, label = 0, sp = 0, stop = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
- $5 = sp;
- dest=$5; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
- HEAP32[$5>>2] = $0;
- $6 = ((($5)) + 16|0);
- HEAP32[$6>>2] = $1;
- $7 = ((($5)) + 24|0);
- HEAP32[$7>>2] = $2;
- $8 = ((($5)) + 32|0);
- HEAP32[$8>>2] = $3;
- $9 = ((($5)) + 40|0);
- HEAP32[$9>>2] = $4;
- $10 = ((($5)) + 80|0);
- HEAP32[$10>>2] = 0;
- _emscripten_async_run_in_main_thread($5);
- (_emscripten_wait_for_call_v($5,inf)|0);
- $11 = HEAP32[$10>>2]|0;
- STACKTOP = sp;return ($11|0);
- }
- function _emscripten_sync_run_in_main_thread_5($0,$1,$2,$3,$4,$5) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- $4 = $4|0;
- $5 = $5|0;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
- $6 = sp;
- dest=$6; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
- HEAP32[$6>>2] = $0;
- $7 = ((($6)) + 16|0);
- HEAP32[$7>>2] = $1;
- $8 = ((($6)) + 24|0);
- HEAP32[$8>>2] = $2;
- $9 = ((($6)) + 32|0);
- HEAP32[$9>>2] = $3;
- $10 = ((($6)) + 40|0);
- HEAP32[$10>>2] = $4;
- $11 = ((($6)) + 48|0);
- HEAP32[$11>>2] = $5;
- $12 = ((($6)) + 80|0);
- HEAP32[$12>>2] = 0;
- _emscripten_async_run_in_main_thread($6);
- (_emscripten_wait_for_call_v($6,inf)|0);
- $13 = HEAP32[$12>>2]|0;
- STACKTOP = sp;return ($13|0);
- }
- function _emscripten_sync_run_in_main_thread_6($0,$1,$2,$3,$4,$5,$6) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- $4 = $4|0;
- $5 = $5|0;
- $6 = $6|0;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
- $7 = sp;
- dest=$7; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
- HEAP32[$7>>2] = $0;
- $8 = ((($7)) + 16|0);
- HEAP32[$8>>2] = $1;
- $9 = ((($7)) + 24|0);
- HEAP32[$9>>2] = $2;
- $10 = ((($7)) + 32|0);
- HEAP32[$10>>2] = $3;
- $11 = ((($7)) + 40|0);
- HEAP32[$11>>2] = $4;
- $12 = ((($7)) + 48|0);
- HEAP32[$12>>2] = $5;
- $13 = ((($7)) + 56|0);
- HEAP32[$13>>2] = $6;
- $14 = ((($7)) + 80|0);
- HEAP32[$14>>2] = 0;
- _emscripten_async_run_in_main_thread($7);
- (_emscripten_wait_for_call_v($7,inf)|0);
- $15 = HEAP32[$14>>2]|0;
- STACKTOP = sp;return ($15|0);
- }
- function _emscripten_sync_run_in_main_thread_7($0,$1,$2,$3,$4,$5,$6,$7) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- $4 = $4|0;
- $5 = $5|0;
- $6 = $6|0;
- $7 = $7|0;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 96|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(96|0);
- $8 = sp;
- dest=$8; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
- HEAP32[$8>>2] = $0;
- $9 = ((($8)) + 16|0);
- HEAP32[$9>>2] = $1;
- $10 = ((($8)) + 24|0);
- HEAP32[$10>>2] = $2;
- $11 = ((($8)) + 32|0);
- HEAP32[$11>>2] = $3;
- $12 = ((($8)) + 40|0);
- HEAP32[$12>>2] = $4;
- $13 = ((($8)) + 48|0);
- HEAP32[$13>>2] = $5;
- $14 = ((($8)) + 56|0);
- HEAP32[$14>>2] = $6;
- $15 = ((($8)) + 64|0);
- HEAP32[$15>>2] = $7;
- $16 = ((($8)) + 80|0);
- HEAP32[$16>>2] = 0;
- _emscripten_async_run_in_main_thread($8);
- (_emscripten_wait_for_call_v($8,inf)|0);
- $17 = HEAP32[$16>>2]|0;
- STACKTOP = sp;return ($17|0);
- }
- function _emscripten_sync_run_in_main_thread_xprintf_varargs($0,$1,$2,$varargs) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $varargs = $varargs|0;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 240|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(240|0);
- $3 = sp + 96|0;
- $4 = sp + 112|0;
- $5 = sp;
- HEAP32[$3>>2] = $varargs;
- $6 = (_vsnprintf($4,128,$2,$3)|0);
- $7 = ($6|0)>(127);
- $8 = (($6) + 1)|0;
- if ($7) {
- $9 = (_malloc($8)|0);
- HEAP32[$3>>2] = $varargs;
- (_vsnprintf($9,$8,$2,$3)|0);
- $$0 = $9;
- } else {
- $$0 = $4;
- }
- dest=$5; stop=dest+96|0; do { HEAP32[dest>>2]=0|0; dest=dest+4|0; } while ((dest|0) < (stop|0));
- HEAP32[$5>>2] = $0;
- $10 = $1;
- $11 = ((($5)) + 16|0);
- HEAP32[$11>>2] = $10;
- $12 = ((($5)) + 24|0);
- HEAP32[$12>>2] = $$0;
- $13 = ((($5)) + 80|0);
- HEAP32[$13>>2] = 0;
- _emscripten_async_run_in_main_thread($5);
- (_emscripten_wait_for_call_v($5,inf)|0);
- $14 = ($$0|0)==($4|0);
- if ($14) {
- $15 = HEAP32[$13>>2]|0;
- STACKTOP = sp;return ($15|0);
- }
- _free($$0);
- $15 = HEAP32[$13>>2]|0;
- STACKTOP = sp;return ($15|0);
- }
- function ___pthread_tsd_run_dtors() {
- 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;
- var $8 = 0, $9 = 0, $exitcond = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = (_pthread_self()|0);
- $1 = ((($0)) + 60|0);
- $2 = HEAP32[$1>>2]|0;
- $3 = ($2|0)==(0);
- if ($3) {
- return;
- }
- $4 = ((($0)) + 116|0);
- $$02427 = 0;
- while(1) {
- $$026 = 0;$$125 = 0;
- while(1) {
- $5 = HEAP32[$4>>2]|0;
- $6 = (($5) + ($$026<<2)|0);
- $7 = HEAP32[$6>>2]|0;
- $8 = ($7|0)==(0|0);
- if ($8) {
- $$2 = $$125;
- } else {
- $9 = (33304 + ($$026<<2)|0);
- $10 = (Atomics_load(HEAP32,$9>>2)|0);
- $11 = ($10|0)==(0|0);
- if ($11) {
- $$2 = $$125;
- } else {
- HEAP32[$6>>2] = 0;
- $12 = (Atomics_load(HEAP32,$9>>2)|0);
- FUNCTION_TABLE_vi[$12 & 31]($7);
- $$2 = 1;
- }
- }
- $13 = (($$026) + 1)|0;
- $exitcond = ($13|0)==(128);
- if ($exitcond) {
- break;
- } else {
- $$026 = $13;$$125 = $$2;
- }
- }
- $14 = (($$02427) + 1)|0;
- $15 = ($$2|0)!=(0);
- $16 = ($14|0)<(4);
- $17 = $16 & $15;
- if ($17) {
- $$02427 = $14;
- } else {
- break;
- }
- }
- return;
- }
- function _emscripten_wait_for_call_v($0,$1) {
- $0 = $0|0;
- $1 = +$1;
- 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;
- sp = STACKTOP;
- $2 = ((($0)) + 8|0);
- $3 = (Atomics_load(HEAP32, $2>>2)|0);
- $4 = ($3|0)==(0);
- if (!($4)) {
- $$1 = $3;
- $13 = ($$1|0)==(0);
- $$ = $13 ? -8 : 0;
- return ($$|0);
- }
- $5 = (+_emscripten_get_now());
- $6 = $5 + $1;
- _emscripten_set_current_thread_status(5);
- $7 = $5 < $6;
- if ($7) {
- $$01921 = $5;
- while(1) {
- $8 = $6 - $$01921;
- (_emscripten_futex_wait(($2|0),0,(+$8))|0);
- $9 = (Atomics_load(HEAP32, $2>>2)|0);
- $10 = (+_emscripten_get_now());
- $11 = ($9|0)==(0);
- $12 = $10 < $6;
- $or$cond = $11 & $12;
- if ($or$cond) {
- $$01921 = $10;
- } else {
- $$020$lcssa = $9;
- break;
- }
- }
- } else {
- $$020$lcssa = 0;
- }
- _emscripten_set_current_thread_status(1);
- $$1 = $$020$lcssa;
- $13 = ($$1|0)==(0);
- $$ = $13 ? -8 : 0;
- return ($$|0);
- }
- function __do_call($0) {
- $0 = $0|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- var $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = HEAP32[$0>>2]|0;
- do {
- switch ($1|0) {
- case 12: {
- $2 = ((($0)) + 16|0);
- $3 = HEAP32[$2>>2]|0;
- $4 = ((($0)) + 24|0);
- $5 = HEAP32[$4>>2]|0;
- $6 = (_utime(($3|0),($5|0))|0);
- $7 = ((($0)) + 80|0);
- HEAP32[$7>>2] = $6;
- break;
- }
- case 13: {
- $8 = ((($0)) + 16|0);
- $9 = HEAP32[$8>>2]|0;
- $10 = ((($0)) + 24|0);
- $11 = HEAP32[$10>>2]|0;
- $12 = (_utimes(($9|0),($11|0))|0);
- $13 = ((($0)) + 80|0);
- HEAP32[$13>>2] = $12;
- break;
- }
- case 37: {
- $14 = ((($0)) + 16|0);
- $15 = HEAP32[$14>>2]|0;
- $16 = (_chroot(($15|0))|0);
- $17 = ((($0)) + 80|0);
- HEAP32[$17>>2] = $16;
- break;
- }
- case 46: {
- $18 = ((($0)) + 16|0);
- $19 = HEAP32[$18>>2]|0;
- $20 = ((($0)) + 24|0);
- $21 = HEAP32[$20>>2]|0;
- $22 = (_fpathconf(($19|0),($21|0))|0);
- $23 = ((($0)) + 80|0);
- HEAP32[$23>>2] = $22;
- break;
- }
- case 68: {
- $24 = ((($0)) + 16|0);
- $25 = HEAP32[$24>>2]|0;
- $26 = ((($0)) + 24|0);
- $27 = HEAP32[$26>>2]|0;
- $28 = ((($0)) + 32|0);
- $29 = HEAP32[$28>>2]|0;
- $30 = (_confstr(($25|0),($27|0),($29|0))|0);
- $31 = ((($0)) + 80|0);
- HEAP32[$31>>2] = $30;
- break;
- }
- case 72: {
- $32 = ((($0)) + 16|0);
- $33 = HEAP32[$32>>2]|0;
- $34 = (_sysconf(($33|0))|0);
- $35 = ((($0)) + 80|0);
- HEAP32[$35>>2] = $34;
- break;
- }
- case 110: {
- $36 = ((($0)) + 16|0);
- $37 = HEAP32[$36>>2]|0;
- $38 = (_atexit(($37|0))|0);
- $39 = ((($0)) + 80|0);
- HEAP32[$39>>2] = $38;
- break;
- }
- case 111: {
- $40 = ((($0)) + 16|0);
- $41 = HEAP32[$40>>2]|0;
- $42 = (_getenv(($41|0))|0);
- $43 = ((($0)) + 80|0);
- HEAP32[$43>>2] = $42;
- break;
- }
- case 112: {
- $44 = (_clearenv()|0);
- $45 = ((($0)) + 80|0);
- HEAP32[$45>>2] = $44;
- break;
- }
- case 113: {
- $46 = ((($0)) + 16|0);
- $47 = HEAP32[$46>>2]|0;
- $48 = ((($0)) + 24|0);
- $49 = HEAP32[$48>>2]|0;
- $50 = ((($0)) + 32|0);
- $51 = HEAP32[$50>>2]|0;
- $52 = (_setenv(($47|0),($49|0),($51|0))|0);
- $53 = ((($0)) + 80|0);
- HEAP32[$53>>2] = $52;
- break;
- }
- case 114: {
- $54 = ((($0)) + 16|0);
- $55 = HEAP32[$54>>2]|0;
- $56 = (_unsetenv(($55|0))|0);
- $57 = ((($0)) + 80|0);
- HEAP32[$57>>2] = $56;
- break;
- }
- case 115: {
- $58 = ((($0)) + 16|0);
- $59 = HEAP32[$58>>2]|0;
- $60 = (_putenv(($59|0))|0);
- $61 = ((($0)) + 80|0);
- HEAP32[$61>>2] = $60;
- break;
- }
- case 119: {
- _tzset();
- break;
- }
- case 137: {
- $62 = ((($0)) + 16|0);
- $63 = HEAP32[$62>>2]|0;
- $64 = ((($0)) + 24|0);
- $65 = HEAP32[$64>>2]|0;
- $66 = ((($0)) + 32|0);
- $67 = HEAP32[$66>>2]|0;
- $68 = ((($0)) + 40|0);
- $69 = HEAP32[$68>>2]|0;
- $70 = (_pthread_create(($63|0),($65|0),($67|0),($69|0))|0);
- $71 = ((($0)) + 80|0);
- HEAP32[$71>>2] = $70;
- break;
- }
- case 138: {
- $72 = ((($0)) + 16|0);
- $73 = HEAP32[$72>>2]|0;
- $74 = ((($0)) + 24|0);
- $75 = HEAP32[$74>>2]|0;
- $76 = (_emscripten_syscall(($73|0),($75|0))|0);
- $77 = ((($0)) + 80|0);
- HEAP32[$77>>2] = $76;
- break;
- }
- case 1024: {
- $78 = ((($0)) + 4|0);
- $79 = HEAP32[$78>>2]|0;
- FUNCTION_TABLE_v[$79 & 7]();
- break;
- }
- case 1025: {
- $80 = ((($0)) + 4|0);
- $81 = HEAP32[$80>>2]|0;
- $82 = ((($0)) + 16|0);
- $83 = HEAP32[$82>>2]|0;
- FUNCTION_TABLE_vi[$81 & 31]($83);
- break;
- }
- case 1026: {
- $84 = ((($0)) + 4|0);
- $85 = HEAP32[$84>>2]|0;
- $86 = ((($0)) + 16|0);
- $87 = HEAP32[$86>>2]|0;
- $88 = ((($0)) + 24|0);
- $89 = HEAP32[$88>>2]|0;
- FUNCTION_TABLE_vii[$85 & 63]($87,$89);
- break;
- }
- case 1027: {
- $90 = ((($0)) + 4|0);
- $91 = HEAP32[$90>>2]|0;
- $92 = ((($0)) + 16|0);
- $93 = HEAP32[$92>>2]|0;
- $94 = ((($0)) + 24|0);
- $95 = HEAP32[$94>>2]|0;
- $96 = ((($0)) + 32|0);
- $97 = HEAP32[$96>>2]|0;
- FUNCTION_TABLE_viii[$91 & 31]($93,$95,$97);
- break;
- }
- case 2048: {
- $98 = ((($0)) + 4|0);
- $99 = HEAP32[$98>>2]|0;
- $100 = (FUNCTION_TABLE_i[$99 & 3]()|0);
- $101 = ((($0)) + 80|0);
- HEAP32[$101>>2] = $100;
- break;
- }
- case 2049: {
- $102 = ((($0)) + 4|0);
- $103 = HEAP32[$102>>2]|0;
- $104 = ((($0)) + 16|0);
- $105 = HEAP32[$104>>2]|0;
- $106 = (FUNCTION_TABLE_ii[$103 & 15]($105)|0);
- $107 = ((($0)) + 80|0);
- HEAP32[$107>>2] = $106;
- break;
- }
- case 2050: {
- $108 = ((($0)) + 4|0);
- $109 = HEAP32[$108>>2]|0;
- $110 = ((($0)) + 16|0);
- $111 = HEAP32[$110>>2]|0;
- $112 = ((($0)) + 24|0);
- $113 = HEAP32[$112>>2]|0;
- $114 = (FUNCTION_TABLE_iii[$109 & 3]($111,$113)|0);
- $115 = ((($0)) + 80|0);
- HEAP32[$115>>2] = $114;
- break;
- }
- case 2051: {
- $116 = ((($0)) + 4|0);
- $117 = HEAP32[$116>>2]|0;
- $118 = ((($0)) + 16|0);
- $119 = HEAP32[$118>>2]|0;
- $120 = ((($0)) + 24|0);
- $121 = HEAP32[$120>>2]|0;
- $122 = ((($0)) + 32|0);
- $123 = HEAP32[$122>>2]|0;
- $124 = (FUNCTION_TABLE_iiii[$117 & 15]($119,$121,$123)|0);
- $125 = ((($0)) + 80|0);
- HEAP32[$125>>2] = $124;
- break;
- }
- default: {
- ___assert_fail((13810|0),(13702|0),211,(13861|0));
- // unreachable;
- }
- }
- } while(0);
- $126 = ((($0)) + 88|0);
- $127 = HEAP32[$126>>2]|0;
- $128 = ($127|0)==(0);
- if ($128) {
- $129 = ((($0)) + 8|0);
- HEAP32[$129>>2] = 1;
- (_emscripten_futex_wake(($129|0),2147483647)|0);
- return;
- } else {
- _free($0);
- return;
- }
- }
- function ___pthread_mutex_unlock($0) {
- $0 = $0|0;
- 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;
- 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;
- var $7 = 0, $8 = 0, $9 = 0, $or$cond = 0, $or$cond3 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = ((($0)) + 8|0);
- $2 = (Atomics_load(HEAP32,$1>>2)|0);
- $3 = HEAP32[$0>>2]|0;
- $4 = $3 & 15;
- $5 = $3 & 128;
- $6 = $5 ^ 128;
- $7 = ($4|0)==(0);
- if ($7) {
- $$pre = ((($0)) + 4|0);
- $$045 = 0;$$pre$phiZ2D = $$pre;
- } else {
- $8 = (_pthread_self()|0);
- $9 = ((($0)) + 4|0);
- $10 = (Atomics_load(HEAP32,$9>>2)|0);
- $11 = $10 & 2147483647;
- $12 = ((($8)) + 52|0);
- $13 = HEAP32[$12>>2]|0;
- $14 = ($11|0)==($13|0);
- if (!($14)) {
- $$0 = 1;
- return ($$0|0);
- }
- $15 = $3 & 3;
- $16 = ($15|0)==(1);
- if ($16) {
- $17 = ((($0)) + 20|0);
- $18 = HEAP32[$17>>2]|0;
- $19 = ($18|0)==(0);
- if (!($19)) {
- $20 = (($18) + -1)|0;
- HEAP32[$17>>2] = $20;
- $$0 = 0;
- return ($$0|0);
- }
- }
- $21 = ($6|0)==(0);
- $22 = ((($0)) + 16|0);
- if ($21) {
- $23 = ((($8)) + 176|0);
- Atomics_store(HEAP32,$23>>2,$22)|0;
- ___vm_lock();
- }
- $24 = ((($0)) + 12|0);
- $25 = HEAP32[$24>>2]|0;
- $26 = HEAP32[$22>>2]|0;
- Atomics_store(HEAP32,$25>>2,$26)|0;
- $27 = ((($8)) + 168|0);
- $28 = ($26|0)==($27|0);
- if ($28) {
- $$045 = $8;$$pre$phiZ2D = $9;
- } else {
- $29 = ((($26)) + -4|0);
- Atomics_store(HEAP32,$29>>2,$25)|0;
- $$045 = $8;$$pre$phiZ2D = $9;
- }
- }
- $30 = $3 & 8;
- $31 = ($30|0)!=(0);
- $32 = $31 ? 2147483647 : 0;
- while(1) {
- $33 = (Atomics_load(HEAP32, $$pre$phiZ2D>>2)|0);
- $34 = (Atomics_compareExchange(HEAP32, $$pre$phiZ2D>>2, $33, $32)|0);
- $35 = ($34|0)==($33|0);
- if ($35) {
- break;
- }
- }
- $36 = ($6|0)!=(0);
- $or$cond = $7 | $36;
- if (!($or$cond)) {
- $37 = ((($$045)) + 176|0);
- Atomics_store(HEAP32,$37>>2,0)|0;
- ___vm_unlock();
- }
- $38 = ($2|0)!=(0);
- $39 = ($33|0)<(0);
- $or$cond3 = $38 | $39;
- if (!($or$cond3)) {
- $$0 = 0;
- return ($$0|0);
- }
- (_emscripten_futex_wake(($$pre$phiZ2D|0),1)|0);
- $$0 = 0;
- return ($$0|0);
- }
- function ___vm_lock() {
- var $0 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = (Atomics_add(HEAP32, 8592, 1)|0);
- return;
- }
- function ___vm_unlock() {
- var $0 = 0, $1 = 0, $2 = 0, $3 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $0 = (Atomics_add(HEAP32, 8592, -1)|0);
- $1 = ($0|0)==(1);
- if (!($1)) {
- return;
- }
- $2 = (Atomics_load(HEAP32,(34372)>>2)|0);
- $3 = ($2|0)==(0);
- if ($3) {
- return;
- }
- (_emscripten_futex_wake((34368|0),2147483647)|0);
- return;
- }
- function ___pthread_mutex_lock($0) {
- $0 = $0|0;
- var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = HEAP32[$0>>2]|0;
- $2 = $1 & 15;
- $3 = ($2|0)==(0);
- if ($3) {
- $4 = ((($0)) + 4|0);
- $5 = (Atomics_compareExchange(HEAP32, $4>>2, 0, 16)|0);
- $6 = ($5|0)==(0);
- if ($6) {
- $$0 = 0;
- return ($$0|0);
- }
- }
- $7 = (___pthread_mutex_timedlock($0,0)|0);
- $$0 = $7;
- return ($$0|0);
- }
- function ___pthread_mutex_timedlock($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- 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;
- 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;
- var $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $or$cond40 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $2 = HEAP32[$0>>2]|0;
- $3 = $2 & 15;
- $4 = ($3|0)==(0);
- do {
- if ($4) {
- $5 = ((($0)) + 4|0);
- $6 = (Atomics_compareExchange(HEAP32, $5>>2, 0, 16)|0);
- $7 = ($6|0)==(0);
- if ($7) {
- $$2 = 0;
- return ($$2|0);
- } else {
- $$pre = HEAP32[$0>>2]|0;
- $9 = $$pre;
- break;
- }
- } else {
- $9 = $2;
- }
- } while(0);
- $8 = $9 & 128;
- $10 = $8 ^ 128;
- $11 = (___pthread_mutex_trylock($0)|0);
- $12 = ($11|0)==(16);
- if (!($12)) {
- $$2 = $11;
- return ($$2|0);
- }
- $13 = ((($0)) + 4|0);
- $14 = ((($0)) + 8|0);
- $$0 = 100;
- while(1) {
- $15 = (($$0) + -1)|0;
- $16 = ($$0|0)==(0);
- if ($16) {
- break;
- }
- $17 = (Atomics_load(HEAP32,$13>>2)|0);
- $18 = ($17|0)==(0);
- if ($18) {
- break;
- }
- $19 = (Atomics_load(HEAP32,$14>>2)|0);
- $20 = ($19|0)==(0);
- if ($20) {
- $$0 = $15;
- } else {
- break;
- }
- }
- $21 = (___pthread_mutex_trylock($0)|0);
- $22 = ($21|0)==(16);
- if (!($22)) {
- $$2 = $21;
- return ($$2|0);
- }
- L18: while(1) {
- $23 = (Atomics_load(HEAP32,$13>>2)|0);
- $24 = ($23|0)==(0);
- if (!($24)) {
- $27 = $23 & 1073741824;
- $28 = ($27|0)==(0);
- $29 = HEAP32[$0>>2]|0;
- $30 = $29 & 4;
- $31 = ($30|0)==(0);
- $or$cond40 = $28 | $31;
- if ($or$cond40) {
- $32 = $29 & 3;
- $33 = ($32|0)==(2);
- if ($33) {
- $34 = $23 & 2147483647;
- $35 = (_pthread_self()|0);
- $36 = ((($35)) + 52|0);
- $37 = HEAP32[$36>>2]|0;
- $38 = ($34|0)==($37|0);
- if ($38) {
- $$2 = 35;
- label = 17;
- break;
- }
- }
- $39 = (Atomics_add(HEAP32, $14>>2, 1)|0);
- $40 = $23 | -2147483648;
- $41 = (Atomics_compareExchange(HEAP32, $13>>2, $23, $40)|0);
- $42 = (___timedwait($13,$40,0,$1,$10)|0);
- $43 = (Atomics_sub(HEAP32, $14>>2, 1)|0);
- switch ($42|0) {
- case 0: case 4: {
- break;
- }
- default: {
- $$2 = $42;
- label = 17;
- break L18;
- }
- }
- }
- }
- $25 = (___pthread_mutex_trylock($0)|0);
- $26 = ($25|0)==(16);
- if (!($26)) {
- $$2 = $25;
- label = 17;
- break;
- }
- }
- if ((label|0) == 17) {
- return ($$2|0);
- }
- return (0)|0;
- }
- function ___timedwait($0,$1,$2,$3,$4) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- $4 = $4|0;
- var $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $5 = sp;
- (___pthread_setcancelstate(1,($5|0))|0);
- _emscripten_conditional_set_current_thread_status(1,4);
- $6 = (___timedwait_cp($0,$1,$2,$3,$4)|0);
- _emscripten_conditional_set_current_thread_status(4,1);
- $7 = HEAP32[$5>>2]|0;
- (___pthread_setcancelstate(($7|0),(0|0))|0);
- STACKTOP = sp;return ($6|0);
- }
- function ___timedwait_cp($0,$1,$2,$3,$4) {
- $0 = $0|0;
- $1 = $1|0;
- $2 = $2|0;
- $3 = $3|0;
- $4 = $4|0;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $5 = sp;
- $6 = ($3|0)!=(0|0);
- if ($6) {
- $7 = ((($3)) + 4|0);
- $8 = HEAP32[$7>>2]|0;
- $9 = ($8>>>0)>(999999999);
- if ($9) {
- $$138 = 22;
- STACKTOP = sp;return ($$138|0);
- }
- $10 = (___clock_gettime(($2|0),($5|0))|0);
- $11 = ($10|0)==(0);
- if (!($11)) {
- $$138 = 22;
- STACKTOP = sp;return ($$138|0);
- }
- $12 = HEAP32[$3>>2]|0;
- $13 = HEAP32[$5>>2]|0;
- $14 = (($12) - ($13))|0;
- HEAP32[$5>>2] = $14;
- $15 = HEAP32[$7>>2]|0;
- $16 = ((($5)) + 4|0);
- $17 = HEAP32[$16>>2]|0;
- $18 = (($15) - ($17))|0;
- HEAP32[$16>>2] = $18;
- $19 = ($18|0)<(0);
- if ($19) {
- $20 = (($14) + -1)|0;
- HEAP32[$5>>2] = $20;
- $21 = (($18) + 1000000000)|0;
- HEAP32[$16>>2] = $21;
- $23 = $20;
- } else {
- $23 = $14;
- }
- $22 = ($23|0)<(0);
- if ($22) {
- $$138 = 110;
- STACKTOP = sp;return ($$138|0);
- }
- }
- $24 = (_emscripten_is_main_runtime_thread()|0);
- $25 = ($24|0)!=(0);
- $$$045 = $25 ? 1.0 : 100.0;
- if ($25) {
- L15: while(1) {
- $26 = (_pthread_self()|0);
- $27 = (__pthread_isduecanceled($26)|0);
- $28 = ($27|0)==(0);
- if (!($28)) {
- $$138$ph = 125;
- break;
- }
- _emscripten_main_thread_process_queued_calls();
- if ($6) {
- $29 = (+__pthread_msecs_until($3));
- $30 = !($29 <= 0.0);
- $31 = $29 > 100.0;
- $$0$us = $31 ? 100.0 : $29;
- $32 = $$0$us > 1.0;
- $$$0$us = $32 ? 1.0 : $$0$us;
- if ($30) {
- $$$046$us = $$$0$us;
- } else {
- $$138$ph = 110;
- break;
- }
- } else {
- $$$046$us = $$$045;
- }
- $33 = (_emscripten_futex_wait(($0|0),($1|0),(+$$$046$us))|0);
- $34 = (0 - ($33))|0;
- switch ($34|0) {
- case 110: {
- break;
- }
- case 4: case 125: {
- $$138$ph = $34;
- break L15;
- break;
- }
- default: {
- $$138 = 0;
- label = 21;
- break L15;
- }
- }
- }
- if ((label|0) == 21) {
- STACKTOP = sp;return ($$138|0);
- }
- $$138 = $$138$ph;
- STACKTOP = sp;return ($$138|0);
- }
- if (!($6)) {
- L27: while(1) {
- $43 = (_pthread_self()|0);
- $44 = (__pthread_isduecanceled($43)|0);
- $45 = ($44|0)==(0);
- if (!($45)) {
- $$138$ph72 = 125;
- break;
- }
- $46 = (_emscripten_futex_wait(($0|0),($1|0),(+$$$045))|0);
- $47 = (0 - ($46))|0;
- switch ($47|0) {
- case 110: {
- break;
- }
- case 4: case 125: {
- $$138$ph72 = $47;
- break L27;
- break;
- }
- default: {
- $$138 = 0;
- label = 21;
- break L27;
- }
- }
- }
- if ((label|0) == 21) {
- STACKTOP = sp;return ($$138|0);
- }
- $$138 = $$138$ph72;
- STACKTOP = sp;return ($$138|0);
- }
- L34: while(1) {
- $35 = (_pthread_self()|0);
- $36 = (__pthread_isduecanceled($35)|0);
- $37 = ($36|0)==(0);
- if (!($37)) {
- $$138$ph70 = 125;
- break;
- }
- $38 = (+__pthread_msecs_until($3));
- $39 = !($38 <= 0.0);
- if (!($39)) {
- $$138$ph70 = 110;
- break;
- }
- $40 = $38 > 100.0;
- $$0$us53 = $40 ? 100.0 : $38;
- $41 = (_emscripten_futex_wait(($0|0),($1|0),(+$$0$us53))|0);
- $42 = (0 - ($41))|0;
- switch ($42|0) {
- case 110: {
- break;
- }
- case 4: case 125: {
- $$138$ph70 = $42;
- break L34;
- break;
- }
- default: {
- $$138 = 0;
- label = 21;
- break L34;
- }
- }
- }
- if ((label|0) == 21) {
- STACKTOP = sp;return ($$138|0);
- }
- $$138 = $$138$ph70;
- STACKTOP = sp;return ($$138|0);
- }
- function __pthread_isduecanceled($0) {
- $0 = $0|0;
- var $1 = 0, $2 = 0, $3 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = HEAP32[$0>>2]|0;
- $2 = ($1|0)==(2);
- $3 = $2&1;
- return ($3|0);
- }
- function __pthread_msecs_until($0) {
- $0 = $0|0;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $1 = sp;
- (_gettimeofday(($1|0),(0|0))|0);
- $2 = HEAP32[$1>>2]|0;
- $3 = (+($2|0));
- $4 = $3 * 1000.0;
- $5 = ((($1)) + 4|0);
- $6 = HEAP32[$5>>2]|0;
- $7 = (+($6|0));
- $8 = $7 * 0.001;
- $9 = $4 + $8;
- $10 = HEAP32[$0>>2]|0;
- $11 = (+($10|0));
- $12 = $11 * 1000.0;
- $13 = ((($0)) + 4|0);
- $14 = HEAP32[$13>>2]|0;
- $15 = (+($14|0));
- $16 = $15 * 9.9999999999999995E-7;
- $17 = $12 + $16;
- $18 = $17 - $9;
- STACKTOP = sp;return (+$18);
- }
- function ___pthread_mutex_trylock($0) {
- $0 = $0|0;
- var $$0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- $1 = HEAP32[$0>>2]|0;
- $2 = $1 & 15;
- $3 = ($2|0)==(0);
- if ($3) {
- $4 = ((($0)) + 4|0);
- $5 = (Atomics_compareExchange(HEAP32, $4>>2, 0, 16)|0);
- $6 = $5 & 16;
- $$0 = $6;
- return ($$0|0);
- } else {
- $7 = (___pthread_mutex_trylock_owner($0)|0);
- $$0 = $7;
- return ($$0|0);
- }
- return (0)|0;
- }
- function ___pthread_mutex_trylock_owner($0) {
- $0 = $0|0;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- $1 = HEAP32[$0>>2]|0;
- $2 = (_pthread_self()|0);
- $3 = ((($2)) + 52|0);
- $4 = HEAP32[$3>>2]|0;
- $5 = ((($0)) + 4|0);
- $6 = (Atomics_load(HEAP32,$5>>2)|0);
- $7 = $6 & 2147483647;
- $8 = ($7|0)==($4|0);
- $9 = $1 & 3;
- $10 = ($9|0)==(1);
- $or$cond = $10 & $8;
- if ($or$cond) {
- $11 = ((($0)) + 20|0);
- $12 = HEAP32[$11>>2]|0;
- $13 = ($12>>>0)>(2147483646);
- if ($13) {
- $$1 = 11;
- return ($$1|0);
- }
- $14 = (($12) + 1)|0;
- HEAP32[$11>>2] = $14;
- $$1 = 0;
- return ($$1|0);
- }
- $15 = ($7|0)==(2147483647);
- if ($15) {
- $$1 = 131;
- return ($$1|0);
- }
- $16 = HEAP32[$0>>2]|0;
- $17 = $16 & 128;
- $18 = ($17|0)==(0);
- if ($18) {
- $$154 = $4;
- } else {
- $19 = ((($2)) + 172|0);
- $20 = HEAP32[$19>>2]|0;
- $21 = ($20|0)==(0);
- if ($21) {
- HEAP32[$19>>2] = -12;
- }
- $22 = ((($0)) + 8|0);
- $23 = (Atomics_load(HEAP32,$22>>2)|0);
- $24 = ($23|0)==(0);
- $25 = $4 | -2147483648;
- $$ = $24 ? $4 : $25;
- $26 = ((($0)) + 16|0);
- $27 = ((($2)) + 176|0);
- Atomics_store(HEAP32,$27>>2,$26)|0;
- $$154 = $$;
- }
- $28 = ($7|0)!=(0);
- if ($28) {
- $29 = $6 & 1073741824;
- $30 = ($29|0)==(0);
- $31 = $1 & 4;
- $32 = ($31|0)==(0);
- $or$cond57 = $32 | $30;
- if (!($or$cond57)) {
- label = 11;
- }
- } else {
- label = 11;
- }
- if ((label|0) == 11) {
- $33 = (Atomics_compareExchange(HEAP32, $5>>2, $6, $$154)|0);
- $34 = ($33|0)==($6|0);
- if ($34) {
- $36 = ((($2)) + 168|0);
- $37 = (Atomics_load(HEAP32,$36>>2)|0);
- $38 = ((($0)) + 16|0);
- HEAP32[$38>>2] = $37;
- $39 = ((($0)) + 12|0);
- HEAP32[$39>>2] = $36;
- $40 = ($37|0)==($36|0);
- if (!($40)) {
- $41 = ((($37)) + -4|0);
- Atomics_store(HEAP32,$41>>2,$38)|0;
- }
- Atomics_store(HEAP32,$36>>2,$38)|0;
- $42 = ((($2)) + 176|0);
- Atomics_store(HEAP32,$42>>2,0)|0;
- if (!($28)) {
- $$1 = 0;
- return ($$1|0);
- }
- $43 = ((($0)) + 20|0);
- HEAP32[$43>>2] = 0;
- $44 = HEAP32[$0>>2]|0;
- $45 = $44 | 8;
- HEAP32[$0>>2] = $45;
- $$1 = 130;
- return ($$1|0);
- }
- }
- $35 = ((($2)) + 176|0);
- Atomics_store(HEAP32,$35>>2,0)|0;
- $$1 = 16;
- return ($$1|0);
- }
- function _pthread_mutexattr_destroy($0) {
- $0 = $0|0;
- var label = 0, sp = 0;
- sp = STACKTOP;
- return 0;
- }
- function _pthread_mutexattr_init($0) {
- $0 = $0|0;
- var label = 0, sp = 0;
- sp = STACKTOP;
- HEAP32[$0>>2] = 0;
- return 0;
- }
- function _pthread_mutex_init($0,$1) {
- $0 = $0|0;
- $1 = $1|0;
- var $$sroa$0 = 0, $2 = 0, $3 = 0, label = 0, sp = 0;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(32|0);
- $$sroa$0 = sp;
- ;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;
- ;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;
- $2 = ($1|0)==(0|0);
- if ($2) {
- STACKTOP = sp;return 0;
- }
- $3 = HEAP32[$1>>2]|0;
- HEAP32[$0>>2] = $3;
- STACKTOP = sp;return 0;
- }
- function _malloc($0) {
- $0 = $0|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- STACKTOP = STACKTOP + 16|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
- $1 = sp + 4|0;
- $2 = sp;
- $3 = HEAP32[8850]|0;
- $4 = ($3|0)==(0);
- if ($4) {
- (___pthread_mutex_lock(35424)|0);
- $5 = HEAP32[8850]|0;
- $6 = ($5|0)==(0);
- if ($6) {
- HEAP32[(35408)>>2] = 4096;
- HEAP32[(35404)>>2] = 4096;
- HEAP32[(35412)>>2] = -1;
- HEAP32[(35416)>>2] = -1;
- HEAP32[(35420)>>2] = 2;
- HEAP32[(35896)>>2] = 2;
- $7 = (_pthread_mutexattr_init($1)|0);
- $8 = ($7|0)==(0);
- if ($8) {
- $9 = (_pthread_mutex_init((35900),$1)|0);
- $10 = ($9|0)==(0);
- if ($10) {
- }
- }
- $11 = $2;
- $12 = $11 & -16;
- $13 = $12 ^ 1431655768;
- HEAP32[$2>>2] = $13;
- Atomics_store(HEAP32,8850,$13)|0;
- }
- (___pthread_mutex_unlock(35424)|0);
- }
- $14 = HEAP32[(35896)>>2]|0;
- $15 = $14 & 2;
- $16 = ($15|0)==(0);
- if (!($16)) {
- $17 = (___pthread_mutex_lock((35900))|0);
- $18 = ($17|0)==(0);
- if (!($18)) {
- $$1 = 0;
- STACKTOP = sp;return ($$1|0);
- }
- }
- $19 = ($0>>>0)<(245);
- do {
- if ($19) {
- $20 = ($0>>>0)<(11);
- $21 = (($0) + 11)|0;
- $22 = $21 & -8;
- $23 = $20 ? 16 : $22;
- $24 = $23 >>> 3;
- $25 = HEAP32[8863]|0;
- $26 = $25 >>> $24;
- $27 = $26 & 3;
- $28 = ($27|0)==(0);
- if (!($28)) {
- $29 = $26 & 1;
- $30 = $29 ^ 1;
- $31 = (($30) + ($24))|0;
- $32 = $31 << 1;
- $33 = (35492 + ($32<<2)|0);
- $34 = ((($33)) + 8|0);
- $35 = HEAP32[$34>>2]|0;
- $36 = ((($35)) + 8|0);
- $37 = HEAP32[$36>>2]|0;
- $38 = ($33|0)==($37|0);
- do {
- if ($38) {
- $39 = 1 << $31;
- $40 = $39 ^ -1;
- $41 = $25 & $40;
- HEAP32[8863] = $41;
- } else {
- $42 = HEAP32[(35468)>>2]|0;
- $43 = ($37>>>0)<($42>>>0);
- if ($43) {
- _abort();
- // unreachable;
- }
- $44 = ((($37)) + 12|0);
- $45 = HEAP32[$44>>2]|0;
- $46 = ($45|0)==($35|0);
- if ($46) {
- HEAP32[$44>>2] = $33;
- HEAP32[$34>>2] = $37;
- break;
- } else {
- _abort();
- // unreachable;
- }
- }
- } while(0);
- $47 = $31 << 3;
- $48 = $47 | 3;
- $49 = ((($35)) + 4|0);
- HEAP32[$49>>2] = $48;
- $50 = (($35) + ($47)|0);
- $51 = ((($50)) + 4|0);
- $52 = HEAP32[$51>>2]|0;
- $53 = $52 | 1;
- HEAP32[$51>>2] = $53;
- $$2 = $36;
- break;
- }
- $54 = HEAP32[(35460)>>2]|0;
- $55 = ($23>>>0)>($54>>>0);
- if ($55) {
- $56 = ($26|0)==(0);
- if (!($56)) {
- $57 = $26 << $24;
- $58 = 2 << $24;
- $59 = (0 - ($58))|0;
- $60 = $58 | $59;
- $61 = $57 & $60;
- $62 = (0 - ($61))|0;
- $63 = $61 & $62;
- $64 = (($63) + -1)|0;
- $65 = $64 >>> 12;
- $66 = $65 & 16;
- $67 = $64 >>> $66;
- $68 = $67 >>> 5;
- $69 = $68 & 8;
- $70 = $69 | $66;
- $71 = $67 >>> $69;
- $72 = $71 >>> 2;
- $73 = $72 & 4;
- $74 = $70 | $73;
- $75 = $71 >>> $73;
- $76 = $75 >>> 1;
- $77 = $76 & 2;
- $78 = $74 | $77;
- $79 = $75 >>> $77;
- $80 = $79 >>> 1;
- $81 = $80 & 1;
- $82 = $78 | $81;
- $83 = $79 >>> $81;
- $84 = (($82) + ($83))|0;
- $85 = $84 << 1;
- $86 = (35492 + ($85<<2)|0);
- $87 = ((($86)) + 8|0);
- $88 = HEAP32[$87>>2]|0;
- $89 = ((($88)) + 8|0);
- $90 = HEAP32[$89>>2]|0;
- $91 = ($86|0)==($90|0);
- do {
- if ($91) {
- $92 = 1 << $84;
- $93 = $92 ^ -1;
- $94 = $25 & $93;
- HEAP32[8863] = $94;
- $115 = $94;
- } else {
- $95 = HEAP32[(35468)>>2]|0;
- $96 = ($90>>>0)<($95>>>0);
- if ($96) {
- _abort();
- // unreachable;
- }
- $97 = ((($90)) + 12|0);
- $98 = HEAP32[$97>>2]|0;
- $99 = ($98|0)==($88|0);
- if ($99) {
- HEAP32[$97>>2] = $86;
- HEAP32[$87>>2] = $90;
- $115 = $25;
- break;
- } else {
- _abort();
- // unreachable;
- }
- }
- } while(0);
- $100 = $84 << 3;
- $101 = (($100) - ($23))|0;
- $102 = $23 | 3;
- $103 = ((($88)) + 4|0);
- HEAP32[$103>>2] = $102;
- $104 = (($88) + ($23)|0);
- $105 = $101 | 1;
- $106 = ((($104)) + 4|0);
- HEAP32[$106>>2] = $105;
- $107 = (($104) + ($101)|0);
- HEAP32[$107>>2] = $101;
- $108 = ($54|0)==(0);
- if (!($108)) {
- $109 = HEAP32[(35472)>>2]|0;
- $110 = $54 >>> 3;
- $111 = $110 << 1;
- $112 = (35492 + ($111<<2)|0);
- $113 = 1 << $110;
- $114 = $115 & $113;
- $116 = ($114|0)==(0);
- if ($116) {
- $117 = $115 | $113;
- HEAP32[8863] = $117;
- $$pre = ((($112)) + 8|0);
- $$0200 = $112;$$pre$phiZ2D = $$pre;
- } else {
- $118 = ((($112)) + 8|0);
- $119 = HEAP32[$118>>2]|0;
- $120 = HEAP32[(35468)>>2]|0;
- $121 = ($119>>>0)<($120>>>0);
- if ($121) {
- _abort();
- // unreachable;
- } else {
- $$0200 = $119;$$pre$phiZ2D = $118;
- }
- }
- HEAP32[$$pre$phiZ2D>>2] = $109;
- $122 = ((($$0200)) + 12|0);
- HEAP32[$122>>2] = $109;
- $123 = ((($109)) + 8|0);
- HEAP32[$123>>2] = $$0200;
- $124 = ((($109)) + 12|0);
- HEAP32[$124>>2] = $112;
- }
- HEAP32[(35460)>>2] = $101;
- HEAP32[(35472)>>2] = $104;
- $$2 = $89;
- break;
- }
- $125 = HEAP32[(35456)>>2]|0;
- $126 = ($125|0)==(0);
- if ($126) {
- $$0198 = $23;
- label = 153;
- } else {
- $127 = (0 - ($125))|0;
- $128 = $125 & $127;
- $129 = (($128) + -1)|0;
- $130 = $129 >>> 12;
- $131 = $130 & 16;
- $132 = $129 >>> $131;
- $133 = $132 >>> 5;
- $134 = $133 & 8;
- $135 = $134 | $131;
- $136 = $132 >>> $134;
- $137 = $136 >>> 2;
- $138 = $137 & 4;
- $139 = $135 | $138;
- $140 = $136 >>> $138;
- $141 = $140 >>> 1;
- $142 = $141 & 2;
- $143 = $139 | $142;
- $144 = $140 >>> $142;
- $145 = $144 >>> 1;
- $146 = $145 & 1;
- $147 = $143 | $146;
- $148 = $144 >>> $146;
- $149 = (($147) + ($148))|0;
- $150 = (35756 + ($149<<2)|0);
- $151 = HEAP32[$150>>2]|0;
- $152 = ((($151)) + 4|0);
- $153 = HEAP32[$152>>2]|0;
- $154 = $153 & -8;
- $155 = (($154) - ($23))|0;
- $156 = ((($151)) + 16|0);
- $157 = HEAP32[$156>>2]|0;
- $not$5$i = ($157|0)==(0|0);
- $$sink16$i = $not$5$i&1;
- $158 = (((($151)) + 16|0) + ($$sink16$i<<2)|0);
- $159 = HEAP32[$158>>2]|0;
- $160 = ($159|0)==(0|0);
- if ($160) {
- $$0192$lcssa$i = $151;$$0193$lcssa$i = $155;
- } else {
- $$01928$i = $151;$$01937$i = $155;$162 = $159;
- while(1) {
- $161 = ((($162)) + 4|0);
- $163 = HEAP32[$161>>2]|0;
- $164 = $163 & -8;
- $165 = (($164) - ($23))|0;
- $166 = ($165>>>0)<($$01937$i>>>0);
- $$$0193$i = $166 ? $165 : $$01937$i;
- $$$0192$i = $166 ? $162 : $$01928$i;
- $167 = ((($162)) + 16|0);
- $168 = HEAP32[$167>>2]|0;
- $not$$i = ($168|0)==(0|0);
- $$sink1$i = $not$$i&1;
- $169 = (((($162)) + 16|0) + ($$sink1$i<<2)|0);
- $170 = HEAP32[$169>>2]|0;
- $171 = ($170|0)==(0|0);
- if ($171) {
- $$0192$lcssa$i = $$$0192$i;$$0193$lcssa$i = $$$0193$i;
- break;
- } else {
- $$01928$i = $$$0192$i;$$01937$i = $$$0193$i;$162 = $170;
- }
- }
- }
- $172 = HEAP32[(35468)>>2]|0;
- $173 = ($$0192$lcssa$i>>>0)<($172>>>0);
- if ($173) {
- _abort();
- // unreachable;
- }
- $174 = (($$0192$lcssa$i) + ($23)|0);
- $175 = ($$0192$lcssa$i>>>0)<($174>>>0);
- if (!($175)) {
- _abort();
- // unreachable;
- }
- $176 = ((($$0192$lcssa$i)) + 24|0);
- $177 = HEAP32[$176>>2]|0;
- $178 = ((($$0192$lcssa$i)) + 12|0);
- $179 = HEAP32[$178>>2]|0;
- $180 = ($179|0)==($$0192$lcssa$i|0);
- do {
- if ($180) {
- $190 = ((($$0192$lcssa$i)) + 20|0);
- $191 = HEAP32[$190>>2]|0;
- $192 = ($191|0)==(0|0);
- if ($192) {
- $193 = ((($$0192$lcssa$i)) + 16|0);
- $194 = HEAP32[$193>>2]|0;
- $195 = ($194|0)==(0|0);
- if ($195) {
- $$3$i = 0;
- break;
- } else {
- $$1196$i = $194;$$1198$i = $193;
- }
- } else {
- $$1196$i = $191;$$1198$i = $190;
- }
- while(1) {
- $196 = ((($$1196$i)) + 20|0);
- $197 = HEAP32[$196>>2]|0;
- $198 = ($197|0)==(0|0);
- if (!($198)) {
- $$1196$i = $197;$$1198$i = $196;
- continue;
- }
- $199 = ((($$1196$i)) + 16|0);
- $200 = HEAP32[$199>>2]|0;
- $201 = ($200|0)==(0|0);
- if ($201) {
- break;
- } else {
- $$1196$i = $200;$$1198$i = $199;
- }
- }
- $202 = ($$1198$i>>>0)<($172>>>0);
- if ($202) {
- _abort();
- // unreachable;
- } else {
- HEAP32[$$1198$i>>2] = 0;
- $$3$i = $$1196$i;
- break;
- }
- } else {
- $181 = ((($$0192$lcssa$i)) + 8|0);
- $182 = HEAP32[$181>>2]|0;
- $183 = ($182>>>0)<($172>>>0);
- if ($183) {
- _abort();
- // unreachable;
- }
- $184 = ((($182)) + 12|0);
- $185 = HEAP32[$184>>2]|0;
- $186 = ($185|0)==($$0192$lcssa$i|0);
- if (!($186)) {
- _abort();
- // unreachable;
- }
- $187 = ((($179)) + 8|0);
- $188 = HEAP32[$187>>2]|0;
- $189 = ($188|0)==($$0192$lcssa$i|0);
- if ($189) {
- HEAP32[$184>>2] = $179;
- HEAP32[$187>>2] = $182;
- $$3$i = $179;
- break;
- } else {
- _abort();
- // unreachable;
- }
- }
- } while(0);
- $203 = ($177|0)==(0|0);
- L85: do {
- if (!($203)) {
- $204 = ((($$0192$lcssa$i)) + 28|0);
- $205 = HEAP32[$204>>2]|0;
- $206 = (35756 + ($205<<2)|0);
- $207 = HEAP32[$206>>2]|0;
- $208 = ($$0192$lcssa$i|0)==($207|0);
- do {
- if ($208) {
- HEAP32[$206>>2] = $$3$i;
- $cond$i = ($$3$i|0)==(0|0);
- if ($cond$i) {
- $209 = 1 << $205;
- $210 = $209 ^ -1;
- $211 = $125 & $210;
- HEAP32[(35456)>>2] = $211;
- break L85;
- }
- } else {
- $212 = HEAP32[(35468)>>2]|0;
- $213 = ($177>>>0)<($212>>>0);
- if ($213) {
- _abort();
- // unreachable;
- } else {
- $214 = ((($177)) + 16|0);
- $215 = HEAP32[$214>>2]|0;
- $not$1$i = ($215|0)!=($$0192$lcssa$i|0);
- $$sink2$i = $not$1$i&1;
- $216 = (((($177)) + 16|0) + ($$sink2$i<<2)|0);
- HEAP32[$216>>2] = $$3$i;
- $217 = ($$3$i|0)==(0|0);
- if ($217) {
- break L85;
- } else {
- break;
- }
- }
- }
- } while(0);
- $218 = HEAP32[(35468)>>2]|0;
- $219 = ($$3$i>>>0)<($218>>>0);
- if ($219) {
- _abort();
- // unreachable;
- }
- $220 = ((($$3$i)) + 24|0);
- HEAP32[$220>>2] = $177;
- $221 = ((($$0192$lcssa$i)) + 16|0);
- $222 = HEAP32[$221>>2]|0;
- $223 = ($222|0)==(0|0);
- do {
- if (!($223)) {
- $224 = ($222>>>0)<($218>>>0);
- if ($224) {
- _abort();
- // unreachable;
- } else {
- $225 = ((($$3$i)) + 16|0);
- HEAP32[$225>>2] = $222;
- $226 = ((($222)) + 24|0);
- HEAP32[$226>>2] = $$3$i;
- break;
- }
- }
- } while(0);
- $227 = ((($$0192$lcssa$i)) + 20|0);
- $228 = HEAP32[$227>>2]|0;
- $229 = ($228|0)==(0|0);
- if (!($229)) {
- $230 = HEAP32[(35468)>>2]|0;
- $231 = ($228>>>0)<($230>>>0);
- if ($231) {
- _abort();
- // unreachable;
- } else {
- $232 = ((($$3$i)) + 20|0);
- HEAP32[$232>>2] = $228;
- $233 = ((($228)) + 24|0);
- HEAP32[$233>>2] = $$3$i;
- break;
- }
- }
- }
- } while(0);
- $234 = ($$0193$lcssa$i>>>0)<(16);
- if ($234) {
- $235 = (($$0193$lcssa$i) + ($23))|0;
- $236 = $235 | 3;
- $237 = ((($$0192$lcssa$i)) + 4|0);
- HEAP32[$237>>2] = $236;
- $238 = (($$0192$lcssa$i) + ($235)|0);
- $239 = ((($238)) + 4|0);
- $240 = HEAP32[$239>>2]|0;
- $241 = $240 | 1;
- HEAP32[$239>>2] = $241;
- } else {
- $242 = $23 | 3;
- $243 = ((($$0192$lcssa$i)) + 4|0);
- HEAP32[$243>>2] = $242;
- $244 = $$0193$lcssa$i | 1;
- $245 = ((($174)) + 4|0);
- HEAP32[$245>>2] = $244;
- $246 = (($174) + ($$0193$lcssa$i)|0);
- HEAP32[$246>>2] = $$0193$lcssa$i;
- $247 = ($54|0)==(0);
- if (!($247)) {
- $248 = HEAP32[(35472)>>2]|0;
- $249 = $54 >>> 3;
- $250 = $249 << 1;
- $251 = (35492 + ($250<<2)|0);
- $252 = 1 << $249;
- $253 = $25 & $252;
- $254 = ($253|0)==(0);
- if ($254) {
- $255 = $25 | $252;
- HEAP32[8863] = $255;
- $$pre$i = ((($251)) + 8|0);
- $$0189$i = $251;$$pre$phi$iZ2D = $$pre$i;
- } else {
- $256 = ((($251)) + 8|0);
- $257 = HEAP32[$256>>2]|0;
- $258 = HEAP32[(35468)>>2]|0;
- $259 = ($257>>>0)<($258>>>0);
- if ($259) {
- _abort();
- // unreachable;
- } else {
- $$0189$i = $257;$$pre$phi$iZ2D = $256;
- }
- }
- HEAP32[$$pre$phi$iZ2D>>2] = $248;
- $260 = ((($$0189$i)) + 12|0);
- HEAP32[$260>>2] = $248;
- $261 = ((($248)) + 8|0);
- HEAP32[$261>>2] = $$0189$i;
- $262 = ((($248)) + 12|0);
- HEAP32[$262>>2] = $251;
- }
- HEAP32[(35460)>>2] = $$0193$lcssa$i;
- HEAP32[(35472)>>2] = $174;
- }
- $263 = ((($$0192$lcssa$i)) + 8|0);
- $$2 = $263;
- }
- } else {
- $$0198 = $23;
- label = 153;
- }
- } else {
- $264 = ($0>>>0)>(4294967231);
- if ($264) {
- $$0198 = -1;
- label = 153;
- } else {
- $265 = (($0) + 11)|0;
- $266 = $265 & -8;
- $267 = HEAP32[(35456)>>2]|0;
- $268 = ($267|0)==(0);
- if ($268) {
- $$0198 = $266;
- label = 153;
- } else {
- $269 = (0 - ($266))|0;
- $270 = $265 >>> 8;
- $271 = ($270|0)==(0);
- if ($271) {
- $$0358$i = 0;
- } else {
- $272 = ($266>>>0)>(16777215);
- if ($272) {
- $$0358$i = 31;
- } else {
- $273 = (($270) + 1048320)|0;
- $274 = $273 >>> 16;
- $275 = $274 & 8;
- $276 = $270 << $275;
- $277 = (($276) + 520192)|0;
- $278 = $277 >>> 16;
- $279 = $278 & 4;
- $280 = $279 | $275;
- $281 = $276 << $279;
- $282 = (($281) + 245760)|0;
- $283 = $282 >>> 16;
- $284 = $283 & 2;
- $285 = $280 | $284;
- $286 = (14 - ($285))|0;
- $287 = $281 << $284;
- $288 = $287 >>> 15;
- $289 = (($286) + ($288))|0;
- $290 = $289 << 1;
- $291 = (($289) + 7)|0;
- $292 = $266 >>> $291;
- $293 = $292 & 1;
- $294 = $293 | $290;
- $$0358$i = $294;
- }
- }
- $295 = (35756 + ($$0358$i<<2)|0);
- $296 = HEAP32[$295>>2]|0;
- $297 = ($296|0)==(0|0);
- L128: do {
- if ($297) {
- $$2355$i = 0;$$3$i202 = 0;$$3350$i = $269;
- label = 90;
- } else {
- $298 = ($$0358$i|0)==(31);
- $299 = $$0358$i >>> 1;
- $300 = (25 - ($299))|0;
- $301 = $298 ? 0 : $300;
- $302 = $266 << $301;
- $$0342$i = 0;$$0347$i = $269;$$0353$i = $296;$$0359$i = $302;$$0362$i = 0;
- while(1) {
- $303 = ((($$0353$i)) + 4|0);
- $304 = HEAP32[$303>>2]|0;
- $305 = $304 & -8;
- $306 = (($305) - ($266))|0;
- $307 = ($306>>>0)<($$0347$i>>>0);
- if ($307) {
- $308 = ($306|0)==(0);
- if ($308) {
- $$415$i = $$0353$i;$$435114$i = 0;$$435713$i = $$0353$i;
- label = 94;
- break L128;
- } else {
- $$1343$i = $$0353$i;$$1348$i = $306;
- }
- } else {
- $$1343$i = $$0342$i;$$1348$i = $$0347$i;
- }
- $309 = ((($$0353$i)) + 20|0);
- $310 = HEAP32[$309>>2]|0;
- $311 = $$0359$i >>> 31;
- $312 = (((($$0353$i)) + 16|0) + ($311<<2)|0);
- $313 = HEAP32[$312>>2]|0;
- $314 = ($310|0)==(0|0);
- $315 = ($310|0)==($313|0);
- $or$cond2$i = $314 | $315;
- $$1363$i = $or$cond2$i ? $$0362$i : $310;
- $316 = ($313|0)==(0|0);
- $not$8$i = $316 ^ 1;
- $317 = $not$8$i&1;
- $$0359$$i = $$0359$i << $317;
- if ($316) {
- $$2355$i = $$1363$i;$$3$i202 = $$1343$i;$$3350$i = $$1348$i;
- label = 90;
- break;
- } else {
- $$0342$i = $$1343$i;$$0347$i = $$1348$i;$$0353$i = $313;$$0359$i = $$0359$$i;$$0362$i = $$1363$i;
- }
- }
- }
- } while(0);
- if ((label|0) == 90) {
- $318 = ($$2355$i|0)==(0|0);
- $319 = ($$3$i202|0)==(0|0);
- $or$cond$i = $318 & $319;
- if ($or$cond$i) {
- $320 = 2 << $$0358$i;
- $321 = (0 - ($320))|0;
- $322 = $320 | $321;
- $323 = $267 & $322;
- $324 = ($323|0)==(0);
- if ($324) {
- $$0198 = $266;
- label = 153;
- break;
- }
- $325 = (0 - ($323))|0;
- $326 = $323 & $325;
- $327 = (($326) + -1)|0;
- $328 = $327 >>> 12;
- $329 = $328 & 16;
- $330 = $327 >>> $329;
- $331 = $330 >>> 5;
- $332 = $331 & 8;
- $333 = $332 | $329;
- $334 = $330 >>> $332;
- $335 = $334 >>> 2;
- $336 = $335 & 4;
- $337 = $333 | $336;
- $338 = $334 >>> $336;
- $339 = $338 >>> 1;
- $340 = $339 & 2;
- $341 = $337 | $340;
- $342 = $338 >>> $340;
- $343 = $342 >>> 1;
- $344 = $343 & 1;
- $345 = $341 | $344;
- $346 = $342 >>> $344;
- $347 = (($345) + ($346))|0;
- $348 = (35756 + ($347<<2)|0);
- $349 = HEAP32[$348>>2]|0;
- $$4$ph$i = 0;$$4357$ph$i = $349;
- } else {
- $$4$ph$i = $$3$i202;$$4357$ph$i = $$2355$i;
- }
- $350 = ($$4357$ph$i|0)==(0|0);
- if ($350) {
- $$4$lcssa$i = $$4$ph$i;$$4351$lcssa$i = $$3350$i;
- } else {
- $$415$i = $$4$ph$i;$$435114$i = $$3350$i;$$435713$i = $$4357$ph$i;
- label = 94;
- }
- }
- if ((label|0) == 94) {
- while(1) {
- label = 0;
- $351 = ((($$435713$i)) + 4|0);
- $352 = HEAP32[$351>>2]|0;
- $353 = $352 & -8;
- $354 = (($353) - ($266))|0;
- $355 = ($354>>>0)<($$435114$i>>>0);
- $$$4351$i = $355 ? $354 : $$435114$i;
- $$4357$$4$i = $355 ? $$435713$i : $$415$i;
- $356 = ((($$435713$i)) + 16|0);
- $357 = HEAP32[$356>>2]|0;
- $not$1$i204 = ($357|0)==(0|0);
- $$sink2$i205 = $not$1$i204&1;
- $358 = (((($$435713$i)) + 16|0) + ($$sink2$i205<<2)|0);
- $359 = HEAP32[$358>>2]|0;
- $360 = ($359|0)==(0|0);
- if ($360) {
- $$4$lcssa$i = $$4357$$4$i;$$4351$lcssa$i = $$$4351$i;
- break;
- } else {
- $$415$i = $$4357$$4$i;$$435114$i = $$$4351$i;$$435713$i = $359;
- label = 94;
- }
- }
- }
- $361 = ($$4$lcssa$i|0)==(0|0);
- if ($361) {
- $$0198 = $266;
- label = 153;
- } else {
- $362 = HEAP32[(35460)>>2]|0;
- $363 = (($362) - ($266))|0;
- $364 = ($$4351$lcssa$i>>>0)<($363>>>0);
- if ($364) {
- $365 = HEAP32[(35468)>>2]|0;
- $366 = ($$4$lcssa$i>>>0)<($365>>>0);
- if ($366) {
- _abort();
- // unreachable;
- }
- $367 = (($$4$lcssa$i) + ($266)|0);
- $368 = ($$4$lcssa$i>>>0)<($367>>>0);
- if (!($368)) {
- _abort();
- // unreachable;
- }
- $369 = ((($$4$lcssa$i)) + 24|0);
- $370 = HEAP32[$369>>2]|0;
- $371 = ((($$4$lcssa$i)) + 12|0);
- $372 = HEAP32[$371>>2]|0;
- $373 = ($372|0)==($$4$lcssa$i|0);
- do {
- if ($373) {
- $383 = ((($$4$lcssa$i)) + 20|0);
- $384 = HEAP32[$383>>2]|0;
- $385 = ($384|0)==(0|0);
- if ($385) {
- $386 = ((($$4$lcssa$i)) + 16|0);
- $387 = HEAP32[$386>>2]|0;
- $388 = ($387|0)==(0|0);
- if ($388) {
- $$3372$i = 0;
- break;
- } else {
- $$1370$i = $387;$$1374$i = $386;
- }
- } else {
- $$1370$i = $384;$$1374$i = $383;
- }
- while(1) {
- $389 = ((($$1370$i)) + 20|0);
- $390 = HEAP32[$389>>2]|0;
- $391 = ($390|0)==(0|0);
- if (!($391)) {
- $$1370$i = $390;$$1374$i = $389;
- continue;
- }
- $392 = ((($$1370$i)) + 16|0);
- $393 = HEAP32[$392>>2]|0;
- $394 = ($393|0)==(0|0);
- if ($394) {
- break;
- } else {
- $$1370$i = $393;$$1374$i = $392;
- }
- }
- $395 = ($$1374$i>>>0)<($365>>>0);
- if ($395) {
- _abort();
- // unreachable;
- } else {
- HEAP32[$$1374$i>>2] = 0;
- $$3372$i = $$1370$i;
- break;
- }
- } else {
- $374 = ((($$4$lcssa$i)) + 8|0);
- $375 = HEAP32[$374>>2]|0;
- $376 = ($375>>>0)<($365>>>0);
- if ($376) {
- _abort();
- // unreachable;
- }
- $377 = ((($375)) + 12|0);
- $378 = HEAP32[$377>>2]|0;
- $379 = ($378|0)==($$4$lcssa$i|0);
- if (!($379)) {
- _abort();
- // unreachable;
- }
- $380 = ((($372)) + 8|0);
- $381 = HEAP32[$380>>2]|0;
- $382 = ($381|0)==($$4$lcssa$i|0);
- if ($382) {
- HEAP32[$377>>2] = $372;
- HEAP32[$380>>2] = $375;
- $$3372$i = $372;
- break;
- } else {
- _abort();
- // unreachable;
- }
- }
- } while(0);
- $396 = ($370|0)==(0|0);
- L175: do {
- if ($396) {
- $487 = $267;
- } else {
- $397 = ((($$4$lcssa$i)) + 28|0);
- $398 = HEAP32[$397>>2]|0;
- $399 = (35756 + ($398<<2)|0);
- $400 = HEAP32[$399>>2]|0;
- $401 = ($$4$lcssa$i|0)==($400|0);
- do {
- if ($401) {
- HEAP32[$399>>2] = $$3372$i;
- $cond$i209 = ($$3372$i|0)==(0|0);
- if ($cond$i209) {
- $402 = 1 << $398;
- $403 = $402 ^ -1;
- $404 = $267 & $403;
- HEAP32[(35456)>>2] = $404;
- $487 = $404;
- break L175;
- }
- } else {
- $405 = HEAP32[(35468)>>2]|0;
- $406 = ($370>>>0)<($405>>>0);
- if ($406) {
- _abort();
- // unreachable;
- } else {
- $407 = ((($370)) + 16|0);
- $408 = HEAP32[$407>>2]|0;
- $not$$i210 = ($408|0)!=($$4$lcssa$i|0);
- $$sink3$i = $not$$i210&1;
- $409 = (((($370)) + 16|0) + ($$sink3$i<<2)|0);
- HEAP32[$409>>2] = $$3372$i;
- $410 = ($$3372$i|0)==(0|0);
- if ($410) {
- $487 = $267;
- break L175;
- } else {
- break;
- }
- }
- }
- } while(0);
- $411 = HEAP32[(35468)>>2]|0;
- $412 = ($$3372$i>>>0)<($411>>>0);
- if ($412) {
- _abort();
- // unreachable;
- }
- $413 = ((($$3372$i)) + 24|0);
- HEAP32[$413>>2] = $370;
- $414 = ((($$4$lcssa$i)) + 16|0);
- $415 = HEAP32[$414>>2]|0;
- $416 = ($415|0)==(0|0);
- do {
- if (!($416)) {
- $417 = ($415>>>0)<($411>>>0);
- if ($417) {
- _abort();
- // unreachable;
- } else {
- $418 = ((($$3372$i)) + 16|0);
- HEAP32[$418>>2] = $415;
- $419 = ((($415)) + 24|0);
- HEAP32[$419>>2] = $$3372$i;
- break;
- }
- }
- } while(0);
- $420 = ((($$4$lcssa$i)) + 20|0);
- $421 = HEAP32[$420>>2]|0;
- $422 = ($421|0)==(0|0);
- if ($422) {
- $487 = $267;
- } else {
- $423 = HEAP32[(35468)>>2]|0;
- $424 = ($421>>>0)<($423>>>0);
- if ($424) {
- _abort();
- // unreachable;
- } else {
- $425 = ((($$3372$i)) + 20|0);
- HEAP32[$425>>2] = $421;
- $426 = ((($421)) + 24|0);
- HEAP32[$426>>2] = $$3372$i;
- $487 = $267;
- break;
- }
- }
- }
- } while(0);
- $427 = ($$4351$lcssa$i>>>0)<(16);
- do {
- if ($427) {
- $428 = (($$4351$lcssa$i) + ($266))|0;
- $429 = $428 | 3;
- $430 = ((($$4$lcssa$i)) + 4|0);
- HEAP32[$430>>2] = $429;
- $431 = (($$4$lcssa$i) + ($428)|0);
- $432 = ((($431)) + 4|0);
- $433 = HEAP32[$432>>2]|0;
- $434 = $433 | 1;
- HEAP32[$432>>2] = $434;
- } else {
- $435 = $266 | 3;
- $436 = ((($$4$lcssa$i)) + 4|0);
- HEAP32[$436>>2] = $435;
- $437 = $$4351$lcssa$i | 1;
- $438 = ((($367)) + 4|0);
- HEAP32[$438>>2] = $437;
- $439 = (($367) + ($$4351$lcssa$i)|0);
- HEAP32[$439>>2] = $$4351$lcssa$i;
- $440 = $$4351$lcssa$i >>> 3;
- $441 = ($$4351$lcssa$i>>>0)<(256);
- if ($441) {
- $442 = $440 << 1;
- $443 = (35492 + ($442<<2)|0);
- $444 = HEAP32[8863]|0;
- $445 = 1 << $440;
- $446 = $444 & $445;
- $447 = ($446|0)==(0);
- do {
- if ($447) {
- $448 = $444 | $445;
- HEAP32[8863] = $448;
- $$pre$i211 = ((($443)) + 8|0);
- $$0368$i = $443;$$pre$phi$i212Z2D = $$pre$i211;
- } else {
- $449 = ((($443)) + 8|0);
- $450 = HEAP32[$449>>2]|0;
- $451 = HEAP32[(35468)>>2]|0;
- $452 = ($450>>>0)<($451>>>0);
- if (!($452)) {
- $$0368$i = $450;$$pre$phi$i212Z2D = $449;
- break;
- }
- _abort();
- // unreachable;
- }
- } while(0);
- HEAP32[$$pre$phi$i212Z2D>>2] = $367;
- $453 = ((($$0368$i)) + 12|0);
- HEAP32[$453>>2] = $367;
- $454 = ((($367)) + 8|0);
- HEAP32[$454>>2] = $$0368$i;
- $455 = ((($367)) + 12|0);
- HEAP32[$455>>2] = $443;
- break;
- }
- $456 = $$4351$lcssa$i >>> 8;
- $457 = ($456|0)==(0);
- if ($457) {
- $$0361$i = 0;
- } else {
- $458 = ($$4351$lcssa$i>>>0)>(16777215);
- if ($458) {
- $$0361$i = 31;
- } else {
- $459 = (($456) + 1048320)|0;
- $460 = $459 >>> 16;
- $461 = $460 & 8;
- $462 = $456 << $461;
- $463 = (($462) + 520192)|0;
- $464 = $463 >>> 16;
- $465 = $464 & 4;
- $466 = $465 | $461;
- $467 = $462 << $465;
- $468 = (($467) + 245760)|0;
- $469 = $468 >>> 16;
- $470 = $469 & 2;
- $471 = $466 | $470;
- $472 = (14 - ($471))|0;
- $473 = $467 << $470;
- $474 = $473 >>> 15;
- $475 = (($472) + ($474))|0;
- $476 = $475 << 1;
- $477 = (($475) + 7)|0;
- $478 = $$4351$lcssa$i >>> $477;
- $479 = $478 & 1;
- $480 = $479 | $476;
- $$0361$i = $480;
- }
- }
- $481 = (35756 + ($$0361$i<<2)|0);
- $482 = ((($367)) + 28|0);
- HEAP32[$482>>2] = $$0361$i;
- $483 = ((($367)) + 16|0);
- $484 = ((($483)) + 4|0);
- HEAP32[$484>>2] = 0;
- HEAP32[$483>>2] = 0;
- $485 = 1 << $$0361$i;
- $486 = $487 & $485;
- $488 = ($486|0)==(0);
- if ($488) {
- $489 = $487 | $485;
- HEAP32[(35456)>>2] = $489;
- HEAP32[$481>>2] = $367;
- $490 = ((($367)) + 24|0);
- HEAP32[$490>>2] = $481;
- $491 = ((($367)) + 12|0);
- HEAP32[$491>>2] = $367;
- $492 = ((($367)) + 8|0);
- HEAP32[$492>>2] = $367;
- break;
- }
- $493 = HEAP32[$481>>2]|0;
- $494 = ($$0361$i|0)==(31);
- $495 = $$0361$i >>> 1;
- $496 = (25 - ($495))|0;
- $497 = $494 ? 0 : $496;
- $498 = $$4351$lcssa$i << $497;
- $$0344$i = $498;$$0345$i = $493;
- while(1) {
- $499 = ((($$0345$i)) + 4|0);
- $500 = HEAP32[$499>>2]|0;
- $501 = $500 & -8;
- $502 = ($501|0)==($$4351$lcssa$i|0);
- if ($502) {
- label = 148;
- break;
- }
- $503 = $$0344$i >>> 31;
- $504 = (((($$0345$i)) + 16|0) + ($503<<2)|0);
- $505 = $$0344$i << 1;
- $506 = HEAP32[$504>>2]|0;
- $507 = ($506|0)==(0|0);
- if ($507) {
- label = 145;
- break;
- } else {
- $$0344$i = $505;$$0345$i = $506;
- }
- }
- if ((label|0) == 145) {
- $508 = HEAP32[(35468)>>2]|0;
- $509 = ($504>>>0)<($508>>>0);
- if ($509) {
- _abort();
- // unreachable;
- } else {
- HEAP32[$504>>2] = $367;
- $510 = ((($367)) + 24|0);
- HEAP32[$510>>2] = $$0345$i;
- $511 = ((($367)) + 12|0);
- HEAP32[$511>>2] = $367;
- $512 = ((($367)) + 8|0);
- HEAP32[$512>>2] = $367;
- break;
- }
- }
- else if ((label|0) == 148) {
- $513 = ((($$0345$i)) + 8|0);
- $514 = HEAP32[$513>>2]|0;
- $515 = HEAP32[(35468)>>2]|0;
- $516 = ($514>>>0)>=($515>>>0);
- $not$9$i = ($$0345$i>>>0)>=($515>>>0);
- $517 = $516 & $not$9$i;
- if ($517) {
- $518 = ((($514)) + 12|0);
- HEAP32[$518>>2] = $367;
- HEAP32[$513>>2] = $367;
- $519 = ((($367)) + 8|0);
- HEAP32[$519>>2] = $514;
- $520 = ((($367)) + 12|0);
- HEAP32[$520>>2] = $$0345$i;
- $521 = ((($367)) + 24|0);
- HEAP32[$521>>2] = 0;
- break;
- } else {
- _abort();
- // unreachable;
- }
- }
- }
- } while(0);
- $522 = ((($$4$lcssa$i)) + 8|0);
- $$2 = $522;
- } else {
- $$0198 = $266;
- label = 153;
- }
- }
- }
- }
- }
- } while(0);
- L230: do {
- if ((label|0) == 153) {
- $523 = HEAP32[(35460)>>2]|0;
- $524 = ($523>>>0)<($$0198>>>0);
- if (!($524)) {
- $525 = (($523) - ($$0198))|0;
- $526 = HEAP32[(35472)>>2]|0;
- $527 = ($525>>>0)>(15);
- if ($527) {
- $528 = (($526) + ($$0198)|0);
- HEAP32[(35472)>>2] = $528;
- HEAP32[(35460)>>2] = $525;
- $529 = $525 | 1;
- $530 = ((($528)) + 4|0);
- HEAP32[$530>>2] = $529;
- $531 = (($528) + ($525)|0);
- HEAP32[$531>>2] = $525;
- $532 = $$0198 | 3;
- $533 = ((($526)) + 4|0);
- HEAP32[$533>>2] = $532;
- } else {
- HEAP32[(35460)>>2] = 0;
- HEAP32[(35472)>>2] = 0;
- $534 = $523 | 3;
- $535 = ((($526)) + 4|0);
- HEAP32[$535>>2] = $534;
- $536 = (($526) + ($523)|0);
- $537 = ((($536)) + 4|0);
- $538 = HEAP32[$537>>2]|0;
- $539 = $538 | 1;
- HEAP32[$537>>2] = $539;
- }
- $540 = ((($526)) + 8|0);
- $$2 = $540;
- break;
- }
- $541 = HEAP32[(35464)>>2]|0;
- $542 = ($541>>>0)>($$0198>>>0);
- if ($542) {
- $543 = (($541) - ($$0198))|0;
- HEAP32[(35464)>>2] = $543;
- $544 = HEAP32[(35476)>>2]|0;
- $545 = (($544) + ($$0198)|0);
- HEAP32[(35476)>>2] = $545;
- $546 = $543 | 1;
- $547 = ((($545)) + 4|0);
- HEAP32[$547>>2] = $546;
- $548 = $$0198 | 3;
- $549 = ((($544)) + 4|0);
- HEAP32[$549>>2] = $548;
- $550 = ((($544)) + 8|0);
- $$2 = $550;
- break;
- }
- $551 = HEAP32[8850]|0;
- $552 = ($551|0)==(0);
- if ($552) {
- (___pthread_mutex_lock(35424)|0);
- $553 = HEAP32[8850]|0;
- $554 = ($553|0)==(0);
- if ($554) {
- HEAP32[(35408)>>2] = 4096;
- HEAP32[(35404)>>2] = 4096;
- HEAP32[(35412)>>2] = -1;
- HEAP32[(35416)>>2] = -1;
- HEAP32[(35420)>>2] = 2;
- HEAP32[(35896)>>2] = 2;
- $555 = (_pthread_mutexattr_init($1)|0);
- $556 = ($555|0)==(0);
- if ($556) {
- $557 = (_pthread_mutex_init((35900),$1)|0);
- $558 = ($557|0)==(0);
- if ($558) {
- }
- }
- $559 = $2;
- $560 = $559 & -16;
- $561 = $560 ^ 1431655768;
- HEAP32[$2>>2] = $561;
- Atomics_store(HEAP32,8850,$561)|0;
- }
- (___pthread_mutex_unlock(35424)|0);
- }
- $562 = (($$0198) + 48)|0;
- $563 = HEAP32[(35408)>>2]|0;
- $564 = (($$0198) + 47)|0;
- $565 = (($563) + ($564))|0;
- $566 = (0 - ($563))|0;
- $567 = $565 & $566;
- $568 = ($567>>>0)>($$0198>>>0);
- if ($568) {
- $569 = HEAP32[(35892)>>2]|0;
- $570 = ($569|0)==(0);
- if (!($570)) {
- $571 = HEAP32[(35884)>>2]|0;
- $572 = (($571) + ($567))|0;
- $573 = ($572>>>0)<=($571>>>0);
- $574 = ($572>>>0)>($569>>>0);
- $or$cond1$i = $573 | $574;
- if ($or$cond1$i) {
- $$2 = 0;
- break;
- }
- }
- $575 = HEAP32[(35896)>>2]|0;
- $576 = $575 & 4;
- $577 = ($576|0)==(0);
- if ($577) {
- $578 = HEAP32[(35476)>>2]|0;
- $579 = ($578|0)==(0|0);
- L258: do {
- if ($579) {
- label = 176;
- } else {
- $$0$i$i = (35928);
- while(1) {
- $580 = HEAP32[$$0$i$i>>2]|0;
- $581 = ($580>>>0)>($578>>>0);
- if (!($581)) {
- $582 = ((($$0$i$i)) + 4|0);
- $583 = HEAP32[$582>>2]|0;
- $584 = (($580) + ($583)|0);
- $585 = ($584>>>0)>($578>>>0);
- if ($585) {
- break;
- }
- }
- $586 = ((($$0$i$i)) + 8|0);
- $587 = HEAP32[$586>>2]|0;
- $588 = ($587|0)==(0|0);
- if ($588) {
- label = 176;
- break L258;
- } else {
- $$0$i$i = $587;
- }
- }
- (___pthread_mutex_lock(35424)|0);
- $611 = HEAP32[(35464)>>2]|0;
- $612 = HEAP32[(35408)>>2]|0;
- $613 = (($564) - ($611))|0;
- $614 = (($613) + ($612))|0;
- $615 = (0 - ($612))|0;
- $616 = $614 & $615;
- $617 = ($616>>>0)<(2147483647);
- if ($617) {
- $618 = (_sbrk(($616|0))|0);
- $619 = HEAP32[$$0$i$i>>2]|0;
- $620 = HEAP32[$582>>2]|0;
- $621 = (($619) + ($620)|0);
- $622 = ($618|0)==($621|0);
- if ($622) {
- $623 = ($618|0)==((-1)|0);
- if ($623) {
- $$2234253237$i = $616;
- label = 190;
- } else {
- $$3229$i = $618;$$3235$i = $616;
- }
- } else {
- $$2247$ph$i = $618;$$2253$ph$i = $616;
- label = 184;
- }
- } else {
- $$2234253237$i = 0;
- label = 190;
- }
- }
- } while(0);
- do {
- if ((label|0) == 176) {
- (___pthread_mutex_lock(35424)|0);
- $589 = (_sbrk(0)|0);
- $590 = ($589|0)==((-1)|0);
- if ($590) {
- $$2234253237$i = 0;
- label = 190;
- } else {
- $591 = $589;
- $592 = HEAP32[(35404)>>2]|0;
- $593 = (($592) + -1)|0;
- $594 = $593 & $591;
- $595 = ($594|0)==(0);
- $596 = (($593) + ($591))|0;
- $597 = (0 - ($592))|0;
- $598 = $596 & $597;
- $599 = (($598) - ($591))|0;
- $600 = $595 ? 0 : $599;
- $$$i = (($600) + ($567))|0;
- $601 = HEAP32[(35884)>>2]|0;
- $602 = (($$$i) + ($601))|0;
- $603 = ($$$i>>>0)>($$0198>>>0);
- $604 = ($$$i>>>0)<(2147483647);
- $or$cond$i213 = $603 & $604;
- if ($or$cond$i213) {
- $605 = HEAP32[(35892)>>2]|0;
- $606 = ($605|0)==(0);
- if (!($606)) {
- $607 = ($602>>>0)<=($601>>>0);
- $608 = ($602>>>0)>($605>>>0);
- $or$cond2$i214 = $607 | $608;
- if ($or$cond2$i214) {
- $$2234253237$i = 0;
- label = 190;
- break;
- }
- }
- $609 = (_sbrk(($$$i|0))|0);
- $610 = ($609|0)==($589|0);
- if ($610) {
- $$3229$i = $589;$$3235$i = $$$i;
- } else {
- $$2247$ph$i = $609;$$2253$ph$i = $$$i;
- label = 184;
- }
- } else {
- $$2234253237$i = 0;
- label = 190;
- }
- }
- }
- } while(0);
- do {
- if ((label|0) == 184) {
- $624 = (0 - ($$2253$ph$i))|0;
- $625 = ($$2247$ph$i|0)!=((-1)|0);
- $626 = ($$2253$ph$i>>>0)<(2147483647);
- $or$cond7$i = $626 & $625;
- $627 = ($562>>>0)>($$2253$ph$i>>>0);
- $or$cond10$i = $627 & $or$cond7$i;
- if (!($or$cond10$i)) {
- $637 = ($$2247$ph$i|0)==((-1)|0);
- if ($637) {
- $$2234253237$i = 0;
- label = 190;
- break;
- } else {
- $$3229$i = $$2247$ph$i;$$3235$i = $$2253$ph$i;
- break;
- }
- }
- $628 = HEAP32[(35408)>>2]|0;
- $629 = (($564) - ($$2253$ph$i))|0;
- $630 = (($629) + ($628))|0;
- $631 = (0 - ($628))|0;
- $632 = $630 & $631;
- $633 = ($632>>>0)<(2147483647);
- if ($633) {
- $634 = (_sbrk(($632|0))|0);
- $635 = ($634|0)==((-1)|0);
- if ($635) {
- (_sbrk(($624|0))|0);
- $$2234253237$i = 0;
- label = 190;
- break;
- } else {
- $636 = (($632) + ($$2253$ph$i))|0;
- $$3229$i = $$2247$ph$i;$$3235$i = $636;
- break;
- }
- } else {
- $$3229$i = $$2247$ph$i;$$3235$i = $$2253$ph$i;
- }
- }
- } while(0);
- if ((label|0) == 190) {
- $638 = HEAP32[(35896)>>2]|0;
- $639 = $638 | 4;
- HEAP32[(35896)>>2] = $639;
- $$3229$i = (-1);$$3235$i = $$2234253237$i;
- }
- (___pthread_mutex_unlock(35424)|0);
- $$4230$i = $$3229$i;$$4236$i = $$3235$i;
- } else {
- $$4230$i = (-1);$$4236$i = 0;
- }
- $640 = ($$4230$i|0)==((-1)|0);
- $641 = ($567>>>0)<(2147483647);
- $or$cond9$i = $641 & $640;
- if ($or$cond9$i) {
- (___pthread_mutex_lock(35424)|0);
- $642 = (_sbrk(($567|0))|0);
- $643 = (_sbrk(0)|0);
- (___pthread_mutex_unlock(35424)|0);
- $644 = ($642|0)!=((-1)|0);
- $645 = ($643|0)!=((-1)|0);
- $or$cond5$i = $644 & $645;
- $646 = ($642>>>0)<($643>>>0);
- $or$cond11$i = $646 & $or$cond5$i;
- $647 = $643;
- $648 = $642;
- $649 = (($647) - ($648))|0;
- $650 = (($$0198) + 40)|0;
- $651 = ($649>>>0)>($650>>>0);
- $$$4236$i = $651 ? $649 : $$4236$i;
- $$$4230$i = $651 ? $642 : (-1);
- if ($or$cond11$i) {
- $$7$i = $$$4230$i;$$7239$i = $$$4236$i;
- label = 194;
- }
- } else {
- $$7$i = $$4230$i;$$7239$i = $$4236$i;
- label = 194;
- }
- if ((label|0) == 194) {
- $652 = ($$7$i|0)==((-1)|0);
- if (!($652)) {
- $653 = HEAP32[(35884)>>2]|0;
- $654 = (($653) + ($$7239$i))|0;
- HEAP32[(35884)>>2] = $654;
- $655 = HEAP32[(35888)>>2]|0;
- $656 = ($654>>>0)>($655>>>0);
- if ($656) {
- HEAP32[(35888)>>2] = $654;
- }
- $657 = HEAP32[(35476)>>2]|0;
- $658 = ($657|0)==(0|0);
- do {
- if ($658) {
- $659 = HEAP32[(35468)>>2]|0;
- $660 = ($659|0)==(0|0);
- $661 = ($$7$i>>>0)<($659>>>0);
- $or$cond12$i = $660 | $661;
- if ($or$cond12$i) {
- HEAP32[(35468)>>2] = $$7$i;
- }
- HEAP32[(35928)>>2] = $$7$i;
- HEAP32[(35932)>>2] = $$7239$i;
- HEAP32[(35940)>>2] = 0;
- $662 = HEAP32[8850]|0;
- HEAP32[(35488)>>2] = $662;
- HEAP32[(35484)>>2] = -1;
- $$01$i$i = 0;
- while(1) {
- $663 = $$01$i$i << 1;
- $664 = (35492 + ($663<<2)|0);
- $665 = ((($664)) + 12|0);
- HEAP32[$665>>2] = $664;
- $666 = ((($664)) + 8|0);
- HEAP32[$666>>2] = $664;
- $667 = (($$01$i$i) + 1)|0;
- $exitcond$i$i = ($667|0)==(32);
- if ($exitcond$i$i) {
- break;
- } else {
- $$01$i$i = $667;
- }
- }
- $668 = (($$7239$i) + -40)|0;
- $669 = ((($$7$i)) + 8|0);
- $670 = $669;
- $671 = $670 & 7;
- $672 = ($671|0)==(0);
- $673 = (0 - ($670))|0;
- $674 = $673 & 7;
- $675 = $672 ? 0 : $674;
- $676 = (($$7$i) + ($675)|0);
- $677 = (($668) - ($675))|0;
- HEAP32[(35476)>>2] = $676;
- HEAP32[(35464)>>2] = $677;
- $678 = $677 | 1;
- $679 = ((($676)) + 4|0);
- HEAP32[$679>>2] = $678;
- $680 = (($676) + ($677)|0);
- $681 = ((($680)) + 4|0);
- HEAP32[$681>>2] = 40;
- $682 = HEAP32[(35416)>>2]|0;
- HEAP32[(35480)>>2] = $682;
- } else {
- $$024363$i = (35928);
- while(1) {
- $683 = HEAP32[$$024363$i>>2]|0;
- $684 = ((($$024363$i)) + 4|0);
- $685 = HEAP32[$684>>2]|0;
- $686 = (($683) + ($685)|0);
- $687 = ($$7$i|0)==($686|0);
- if ($687) {
- label = 205;
- break;
- }
- $688 = ((($$024363$i)) + 8|0);
- $689 = HEAP32[$688>>2]|0;
- $690 = ($689|0)==(0|0);
- if ($690) {
- break;
- } else {
- $$024363$i = $689;
- }
- }
- if ((label|0) == 205) {
- $691 = ((($$024363$i)) + 12|0);
- $692 = HEAP32[$691>>2]|0;
- $693 = $692 & 8;
- $694 = ($693|0)==(0);
- if ($694) {
- $695 = ($657>>>0)>=($683>>>0);
- $696 = ($657>>>0)<($$7$i>>>0);
- $or$cond43$i = $696 & $695;
- if ($or$cond43$i) {
- $697 = (($685) + ($$7239$i))|0;
- HEAP32[$684>>2] = $697;
- $698 = HEAP32[(35464)>>2]|0;
- $699 = ((($657)) + 8|0);
- $700 = $699;
- $701 = $700 & 7;
- $702 = ($701|0)==(0);
- $703 = (0 - ($700))|0;
- $704 = $703 & 7;
- $705 = $702 ? 0 : $704;
- $706 = (($657) + ($705)|0);
- $707 = (($$7239$i) - ($705))|0;
- $708 = (($698) + ($707))|0;
- HEAP32[(35476)>>2] = $706;
- HEAP32[(35464)>>2] = $708;
- $709 = $708 | 1;
- $710 = ((($706)) + 4|0);
- HEAP32[$710>>2] = $709;
- $711 = (($706) + ($708)|0);
- $712 = ((($711)) + 4|0);
- HEAP32[$712>>2] = 40;
- $713 = HEAP32[(35416)>>2]|0;
- HEAP32[(35480)>>2] = $713;
- break;
- }
- }
- }
- $714 = HEAP32[(35468)>>2]|0;
- $715 = ($$7$i>>>0)<($714>>>0);
- if ($715) {
- HEAP32[(35468)>>2] = $$7$i;
- $779 = $$7$i;
- } else {
- $779 = $714;
- }
- $716 = (($$7$i) + ($$7239$i)|0);
- $$124462$i = (35928);
- while(1) {
- $717 = HEAP32[$$124462$i>>2]|0;
- $718 = ($717|0)==($716|0);
- if ($718) {
- label = 213;
- break;
- }
- $719 = ((($$124462$i)) + 8|0);
- $720 = HEAP32[$719>>2]|0;
- $721 = ($720|0)==(0|0);
- if ($721) {
- break;
- } else {
- $$124462$i = $720;
- }
- }
- if ((label|0) == 213) {
- $722 = ((($$124462$i)) + 12|0);
- $723 = HEAP32[$722>>2]|0;
- $724 = $723 & 8;
- $725 = ($724|0)==(0);
- if ($725) {
- HEAP32[$$124462$i>>2] = $$7$i;
- $726 = ((($$124462$i)) + 4|0);
- $727 = HEAP32[$726>>2]|0;
- $728 = (($727) + ($$7239$i))|0;
- HEAP32[$726>>2] = $728;
- $729 = ((($$7$i)) + 8|0);
- $730 = $729;
- $731 = $730 & 7;
- $732 = ($731|0)==(0);
- $733 = (0 - ($730))|0;
- $734 = $733 & 7;
- $735 = $732 ? 0 : $734;
- $736 = (($$7$i) + ($735)|0);
- $737 = ((($716)) + 8|0);
- $738 = $737;
- $739 = $738 & 7;
- $740 = ($739|0)==(0);
- $741 = (0 - ($738))|0;
- $742 = $741 & 7;
- $743 = $740 ? 0 : $742;
- $744 = (($716) + ($743)|0);
- $745 = $744;
- $746 = $736;
- $747 = (($745) - ($746))|0;
- $748 = (($736) + ($$0198)|0);
- $749 = (($747) - ($$0198))|0;
- $750 = $$0198 | 3;
- $751 = ((($736)) + 4|0);
- HEAP32[$751>>2] = $750;
- $752 = ($744|0)==($657|0);
- do {
- if ($752) {
- $753 = HEAP32[(35464)>>2]|0;
- $754 = (($753) + ($749))|0;
- HEAP32[(35464)>>2] = $754;
- HEAP32[(35476)>>2] = $748;
- $755 = $754 | 1;
- $756 = ((($748)) + 4|0);
- HEAP32[$756>>2] = $755;
- } else {
- $757 = HEAP32[(35472)>>2]|0;
- $758 = ($744|0)==($757|0);
- if ($758) {
- $759 = HEAP32[(35460)>>2]|0;
- $760 = (($759) + ($749))|0;
- HEAP32[(35460)>>2] = $760;
- HEAP32[(35472)>>2] = $748;
- $761 = $760 | 1;
- $762 = ((($748)) + 4|0);
- HEAP32[$762>>2] = $761;
- $763 = (($748) + ($760)|0);
- HEAP32[$763>>2] = $760;
- break;
- }
- $764 = ((($744)) + 4|0);
- $765 = HEAP32[$764>>2]|0;
- $766 = $765 & 3;
- $767 = ($766|0)==(1);
- if ($767) {
- $768 = $765 & -8;
- $769 = $765 >>> 3;
- $770 = ($765>>>0)<(256);
- L329: do {
- if ($770) {
- $771 = ((($744)) + 8|0);
- $772 = HEAP32[$771>>2]|0;
- $773 = ((($744)) + 12|0);
- $774 = HEAP32[$773>>2]|0;
- $775 = $769 << 1;
- $776 = (35492 + ($775<<2)|0);
- $777 = ($772|0)==($776|0);
- do {
- if (!($777)) {
- $778 = ($772>>>0)<($779>>>0);
- if ($778) {
- _abort();
- // unreachable;
- }
- $780 = ((($772)) + 12|0);
- $781 = HEAP32[$780>>2]|0;
- $782 = ($781|0)==($744|0);
- if ($782) {
- break;
- }
- _abort();
- // unreachable;
- }
- } while(0);
- $783 = ($774|0)==($772|0);
- if ($783) {
- $784 = 1 << $769;
- $785 = $784 ^ -1;
- $786 = HEAP32[8863]|0;
- $787 = $786 & $785;
- HEAP32[8863] = $787;
- break;
- }
- $788 = ($774|0)==($776|0);
- do {
- if ($788) {
- $$pre10$i$i = ((($774)) + 8|0);
- $$pre$phi11$i$iZ2D = $$pre10$i$i;
- } else {
- $789 = ($774>>>0)<($779>>>0);
- if ($789) {
- _abort();
- // unreachable;
- }
- $790 = ((($774)) + 8|0);
- $791 = HEAP32[$790>>2]|0;
- $792 = ($791|0)==($744|0);
- if ($792) {
- $$pre$phi11$i$iZ2D = $790;
- break;
- }
- _abort();
- // unreachable;
- }
- } while(0);
- $793 = ((($772)) + 12|0);
- HEAP32[$793>>2] = $774;
- HEAP32[$$pre$phi11$i$iZ2D>>2] = $772;
- } else {
- $794 = ((($744)) + 24|0);
- $795 = HEAP32[$794>>2]|0;
- $796 = ((($744)) + 12|0);
- $797 = HEAP32[$796>>2]|0;
- $798 = ($797|0)==($744|0);
- do {
- if ($798) {
- $808 = ((($744)) + 16|0);
- $809 = ((($808)) + 4|0);
- $810 = HEAP32[$809>>2]|0;
- $811 = ($810|0)==(0|0);
- if ($811) {
- $812 = HEAP32[$808>>2]|0;
- $813 = ($812|0)==(0|0);
- if ($813) {
- $$3$i$i = 0;
- break;
- } else {
- $$1291$i$i = $812;$$1293$i$i = $808;
- }
- } else {
- $$1291$i$i = $810;$$1293$i$i = $809;
- }
- while(1) {
- $814 = ((($$1291$i$i)) + 20|0);
- $815 = HEAP32[$814>>2]|0;
- $816 = ($815|0)==(0|0);
- if (!($816)) {
- $$1291$i$i = $815;$$1293$i$i = $814;
- continue;
- }
- $817 = ((($$1291$i$i)) + 16|0);
- $818 = HEAP32[$817>>2]|0;
- $819 = ($818|0)==(0|0);
- if ($819) {
- break;
- } else {
- $$1291$i$i = $818;$$1293$i$i = $817;
- }
- }
- $820 = ($$1293$i$i>>>0)<($779>>>0);
- if ($820) {
- _abort();
- // unreachable;
- } else {
- HEAP32[$$1293$i$i>>2] = 0;
- $$3$i$i = $$1291$i$i;
- break;
- }
- } else {
- $799 = ((($744)) + 8|0);
- $800 = HEAP32[$799>>2]|0;
- $801 = ($800>>>0)<($779>>>0);
- if ($801) {
- _abort();
- // unreachable;
- }
- $802 = ((($800)) + 12|0);
- $803 = HEAP32[$802>>2]|0;
- $804 = ($803|0)==($744|0);
- if (!($804)) {
- _abort();
- // unreachable;
- }
- $805 = ((($797)) + 8|0);
- $806 = HEAP32[$805>>2]|0;
- $807 = ($806|0)==($744|0);
- if ($807) {
- HEAP32[$802>>2] = $797;
- HEAP32[$805>>2] = $800;
- $$3$i$i = $797;
- break;
- } else {
- _abort();
- // unreachable;
- }
- }
- } while(0);
- $821 = ($795|0)==(0|0);
- if ($821) {
- break;
- }
- $822 = ((($744)) + 28|0);
- $823 = HEAP32[$822>>2]|0;
- $824 = (35756 + ($823<<2)|0);
- $825 = HEAP32[$824>>2]|0;
- $826 = ($744|0)==($825|0);
- do {
- if ($826) {
- HEAP32[$824>>2] = $$3$i$i;
- $cond$i$i = ($$3$i$i|0)==(0|0);
- if (!($cond$i$i)) {
- break;
- }
- $827 = 1 << $823;
- $828 = $827 ^ -1;
- $829 = HEAP32[(35456)>>2]|0;
- $830 = $829 & $828;
- HEAP32[(35456)>>2] = $830;
- break L329;
- } else {
- $831 = HEAP32[(35468)>>2]|0;
- $832 = ($795>>>0)<($831>>>0);
- if ($832) {
- _abort();
- // unreachable;
- } else {
- $833 = ((($795)) + 16|0);
- $834 = HEAP32[$833>>2]|0;
- $not$$i$i = ($834|0)!=($744|0);
- $$sink1$i$i = $not$$i$i&1;
- $835 = (((($795)) + 16|0) + ($$sink1$i$i<<2)|0);
- HEAP32[$835>>2] = $$3$i$i;
- $836 = ($$3$i$i|0)==(0|0);
- if ($836) {
- break L329;
- } else {
- break;
- }
- }
- }
- } while(0);
- $837 = HEAP32[(35468)>>2]|0;
- $838 = ($$3$i$i>>>0)<($837>>>0);
- if ($838) {
- _abort();
- // unreachable;
- }
- $839 = ((($$3$i$i)) + 24|0);
- HEAP32[$839>>2] = $795;
- $840 = ((($744)) + 16|0);
- $841 = HEAP32[$840>>2]|0;
- $842 = ($841|0)==(0|0);
- do {
- if (!($842)) {
- $843 = ($841>>>0)<($837>>>0);
- if ($843) {
- _abort();
- // unreachable;
- } else {
- $844 = ((($$3$i$i)) + 16|0);
- HEAP32[$844>>2] = $841;
- $845 = ((($841)) + 24|0);
- HEAP32[$845>>2] = $$3$i$i;
- break;
- }
- }
- } while(0);
- $846 = ((($840)) + 4|0);
- $847 = HEAP32[$846>>2]|0;
- $848 = ($847|0)==(0|0);
- if ($848) {
- break;
- }
- $849 = HEAP32[(35468)>>2]|0;
- $850 = ($847>>>0)<($849>>>0);
- if ($850) {
- _abort();
- // unreachable;
- } else {
- $851 = ((($$3$i$i)) + 20|0);
- HEAP32[$851>>2] = $847;
- $852 = ((($847)) + 24|0);
- HEAP32[$852>>2] = $$3$i$i;
- break;
- }
- }
- } while(0);
- $853 = (($744) + ($768)|0);
- $854 = (($768) + ($749))|0;
- $$0$i17$i = $853;$$0287$i$i = $854;
- } else {
- $$0$i17$i = $744;$$0287$i$i = $749;
- }
- $855 = ((($$0$i17$i)) + 4|0);
- $856 = HEAP32[$855>>2]|0;
- $857 = $856 & -2;
- HEAP32[$855>>2] = $857;
- $858 = $$0287$i$i | 1;
- $859 = ((($748)) + 4|0);
- HEAP32[$859>>2] = $858;
- $860 = (($748) + ($$0287$i$i)|0);
- HEAP32[$860>>2] = $$0287$i$i;
- $861 = $$0287$i$i >>> 3;
- $862 = ($$0287$i$i>>>0)<(256);
- if ($862) {
- $863 = $861 << 1;
- $864 = (35492 + ($863<<2)|0);
- $865 = HEAP32[8863]|0;
- $866 = 1 << $861;
- $867 = $865 & $866;
- $868 = ($867|0)==(0);
- do {
- if ($868) {
- $869 = $865 | $866;
- HEAP32[8863] = $869;
- $$pre$i$i = ((($864)) + 8|0);
- $$0295$i$i = $864;$$pre$phi$i$iZ2D = $$pre$i$i;
- } else {
- $870 = ((($864)) + 8|0);
- $871 = HEAP32[$870>>2]|0;
- $872 = HEAP32[(35468)>>2]|0;
- $873 = ($871>>>0)<($872>>>0);
- if (!($873)) {
- $$0295$i$i = $871;$$pre$phi$i$iZ2D = $870;
- break;
- }
- _abort();
- // unreachable;
- }
- } while(0);
- HEAP32[$$pre$phi$i$iZ2D>>2] = $748;
- $874 = ((($$0295$i$i)) + 12|0);
- HEAP32[$874>>2] = $748;
- $875 = ((($748)) + 8|0);
- HEAP32[$875>>2] = $$0295$i$i;
- $876 = ((($748)) + 12|0);
- HEAP32[$876>>2] = $864;
- break;
- }
- $877 = $$0287$i$i >>> 8;
- $878 = ($877|0)==(0);
- do {
- if ($878) {
- $$0296$i$i = 0;
- } else {
- $879 = ($$0287$i$i>>>0)>(16777215);
- if ($879) {
- $$0296$i$i = 31;
- break;
- }
- $880 = (($877) + 1048320)|0;
- $881 = $880 >>> 16;
- $882 = $881 & 8;
- $883 = $877 << $882;
- $884 = (($883) + 520192)|0;
- $885 = $884 >>> 16;
- $886 = $885 & 4;
- $887 = $886 | $882;
- $888 = $883 << $886;
- $889 = (($888) + 245760)|0;
- $890 = $889 >>> 16;
- $891 = $890 & 2;
- $892 = $887 | $891;
- $893 = (14 - ($892))|0;
- $894 = $888 << $891;
- $895 = $894 >>> 15;
- $896 = (($893) + ($895))|0;
- $897 = $896 << 1;
- $898 = (($896) + 7)|0;
- $899 = $$0287$i$i >>> $898;
- $900 = $899 & 1;
- $901 = $900 | $897;
- $$0296$i$i = $901;
- }
- } while(0);
- $902 = (35756 + ($$0296$i$i<<2)|0);
- $903 = ((($748)) + 28|0);
- HEAP32[$903>>2] = $$0296$i$i;
- $904 = ((($748)) + 16|0);
- $905 = ((($904)) + 4|0);
- HEAP32[$905>>2] = 0;
- HEAP32[$904>>2] = 0;
- $906 = HEAP32[(35456)>>2]|0;
- $907 = 1 << $$0296$i$i;
- $908 = $906 & $907;
- $909 = ($908|0)==(0);
- if ($909) {
- $910 = $906 | $907;
- HEAP32[(35456)>>2] = $910;
- HEAP32[$902>>2] = $748;
- $911 = ((($748)) + 24|0);
- HEAP32[$911>>2] = $902;
- $912 = ((($748)) + 12|0);
- HEAP32[$912>>2] = $748;
- $913 = ((($748)) + 8|0);
- HEAP32[$913>>2] = $748;
- break;
- }
- $914 = HEAP32[$902>>2]|0;
- $915 = ($$0296$i$i|0)==(31);
- $916 = $$0296$i$i >>> 1;
- $917 = (25 - ($916))|0;
- $918 = $915 ? 0 : $917;
- $919 = $$0287$i$i << $918;
- $$0288$i$i = $919;$$0289$i$i = $914;
- while(1) {
- $920 = ((($$0289$i$i)) + 4|0);
- $921 = HEAP32[$920>>2]|0;
- $922 = $921 & -8;
- $923 = ($922|0)==($$0287$i$i|0);
- if ($923) {
- label = 280;
- break;
- }
- $924 = $$0288$i$i >>> 31;
- $925 = (((($$0289$i$i)) + 16|0) + ($924<<2)|0);
- $926 = $$0288$i$i << 1;
- $927 = HEAP32[$925>>2]|0;
- $928 = ($927|0)==(0|0);
- if ($928) {
- label = 277;
- break;
- } else {
- $$0288$i$i = $926;$$0289$i$i = $927;
- }
- }
- if ((label|0) == 277) {
- $929 = HEAP32[(35468)>>2]|0;
- $930 = ($925>>>0)<($929>>>0);
- if ($930) {
- _abort();
- // unreachable;
- } else {
- HEAP32[$925>>2] = $748;
- $931 = ((($748)) + 24|0);
- HEAP32[$931>>2] = $$0289$i$i;
- $932 = ((($748)) + 12|0);
- HEAP32[$932>>2] = $748;
- $933 = ((($748)) + 8|0);
- HEAP32[$933>>2] = $748;
- break;
- }
- }
- else if ((label|0) == 280) {
- $934 = ((($$0289$i$i)) + 8|0);
- $935 = HEAP32[$934>>2]|0;
- $936 = HEAP32[(35468)>>2]|0;
- $937 = ($935>>>0)>=($936>>>0);
- $not$7$i$i = ($$0289$i$i>>>0)>=($936>>>0);
- $938 = $937 & $not$7$i$i;
- if ($938) {
- $939 = ((($935)) + 12|0);
- HEAP32[$939>>2] = $748;
- HEAP32[$934>>2] = $748;
- $940 = ((($748)) + 8|0);
- HEAP32[$940>>2] = $935;
- $941 = ((($748)) + 12|0);
- HEAP32[$941>>2] = $$0289$i$i;
- $942 = ((($748)) + 24|0);
- HEAP32[$942>>2] = 0;
- break;
- } else {
- _abort();
- // unreachable;
- }
- }
- }
- } while(0);
- $1074 = ((($736)) + 8|0);
- $$2 = $1074;
- break L230;
- }
- }
- $$0$i$i$i = (35928);
- while(1) {
- $943 = HEAP32[$$0$i$i$i>>2]|0;
- $944 = ($943>>>0)>($657>>>0);
- if (!($944)) {
- $945 = ((($$0$i$i$i)) + 4|0);
- $946 = HEAP32[$945>>2]|0;
- $947 = (($943) + ($946)|0);
- $948 = ($947>>>0)>($657>>>0);
- if ($948) {
- break;
- }
- }
- $949 = ((($$0$i$i$i)) + 8|0);
- $950 = HEAP32[$949>>2]|0;
- $$0$i$i$i = $950;
- }
- $951 = ((($947)) + -47|0);
- $952 = ((($951)) + 8|0);
- $953 = $952;
- $954 = $953 & 7;
- $955 = ($954|0)==(0);
- $956 = (0 - ($953))|0;
- $957 = $956 & 7;
- $958 = $955 ? 0 : $957;
- $959 = (($951) + ($958)|0);
- $960 = ((($657)) + 16|0);
- $961 = ($959>>>0)<($960>>>0);
- $962 = $961 ? $657 : $959;
- $963 = ((($962)) + 8|0);
- $964 = ((($962)) + 24|0);
- $965 = (($$7239$i) + -40)|0;
- $966 = ((($$7$i)) + 8|0);
- $967 = $966;
- $968 = $967 & 7;
- $969 = ($968|0)==(0);
- $970 = (0 - ($967))|0;
- $971 = $970 & 7;
- $972 = $969 ? 0 : $971;
- $973 = (($$7$i) + ($972)|0);
- $974 = (($965) - ($972))|0;
- HEAP32[(35476)>>2] = $973;
- HEAP32[(35464)>>2] = $974;
- $975 = $974 | 1;
- $976 = ((($973)) + 4|0);
- HEAP32[$976>>2] = $975;
- $977 = (($973) + ($974)|0);
- $978 = ((($977)) + 4|0);
- HEAP32[$978>>2] = 40;
- $979 = HEAP32[(35416)>>2]|0;
- HEAP32[(35480)>>2] = $979;
- $980 = ((($962)) + 4|0);
- HEAP32[$980>>2] = 27;
- ;HEAP32[$963>>2]=HEAP32[(35928)>>2]|0;HEAP32[$963+4>>2]=HEAP32[(35928)+4>>2]|0;HEAP32[$963+8>>2]=HEAP32[(35928)+8>>2]|0;HEAP32[$963+12>>2]=HEAP32[(35928)+12>>2]|0;
- HEAP32[(35928)>>2] = $$7$i;
- HEAP32[(35932)>>2] = $$7239$i;
- HEAP32[(35940)>>2] = 0;
- HEAP32[(35936)>>2] = $963;
- $982 = $964;
- while(1) {
- $981 = ((($982)) + 4|0);
- HEAP32[$981>>2] = 7;
- $983 = ((($982)) + 8|0);
- $984 = ($983>>>0)<($947>>>0);
- if ($984) {
- $982 = $981;
- } else {
- break;
- }
- }
- $985 = ($962|0)==($657|0);
- if (!($985)) {
- $986 = $962;
- $987 = $657;
- $988 = (($986) - ($987))|0;
- $989 = HEAP32[$980>>2]|0;
- $990 = $989 & -2;
- HEAP32[$980>>2] = $990;
- $991 = $988 | 1;
- $992 = ((($657)) + 4|0);
- HEAP32[$992>>2] = $991;
- HEAP32[$962>>2] = $988;
- $993 = $988 >>> 3;
- $994 = ($988>>>0)<(256);
- if ($994) {
- $995 = $993 << 1;
- $996 = (35492 + ($995<<2)|0);
- $997 = HEAP32[8863]|0;
- $998 = 1 << $993;
- $999 = $997 & $998;
- $1000 = ($999|0)==(0);
- do {
- if ($1000) {
- $1001 = $997 | $998;
- HEAP32[8863] = $1001;
- $$pre$i18$i = ((($996)) + 8|0);
- $$0211$i$i = $996;$$pre$phi$i19$iZ2D = $$pre$i18$i;
- } else {
- $1002 = ((($996)) + 8|0);
- $1003 = HEAP32[$1002>>2]|0;
- $1004 = HEAP32[(35468)>>2]|0;
- $1005 = ($1003>>>0)<($1004>>>0);
- if (!($1005)) {
- $$0211$i$i = $1003;$$pre$phi$i19$iZ2D = $1002;
- break;
- }
- _abort();
- // unreachable;
- }
- } while(0);
- HEAP32[$$pre$phi$i19$iZ2D>>2] = $657;
- $1006 = ((($$0211$i$i)) + 12|0);
- HEAP32[$1006>>2] = $657;
- $1007 = ((($657)) + 8|0);
- HEAP32[$1007>>2] = $$0211$i$i;
- $1008 = ((($657)) + 12|0);
- HEAP32[$1008>>2] = $996;
- break;
- }
- $1009 = $988 >>> 8;
- $1010 = ($1009|0)==(0);
- do {
- if ($1010) {
- $$0212$i$i = 0;
- } else {
- $1011 = ($988>>>0)>(16777215);
- if ($1011) {
- $$0212$i$i = 31;
- break;
- }
- $1012 = (($1009) + 1048320)|0;
- $1013 = $1012 >>> 16;
- $1014 = $1013 & 8;
- $1015 = $1009 << $1014;
- $1016 = (($1015) + 520192)|0;
- $1017 = $1016 >>> 16;
- $1018 = $1017 & 4;
- $1019 = $1018 | $1014;
- $1020 = $1015 << $1018;
- $1021 = (($1020) + 245760)|0;
- $1022 = $1021 >>> 16;
- $1023 = $1022 & 2;
- $1024 = $1019 | $1023;
- $1025 = (14 - ($1024))|0;
- $1026 = $1020 << $1023;
- $1027 = $1026 >>> 15;
- $1028 = (($1025) + ($1027))|0;
- $1029 = $1028 << 1;
- $1030 = (($1028) + 7)|0;
- $1031 = $988 >>> $1030;
- $1032 = $1031 & 1;
- $1033 = $1032 | $1029;
- $$0212$i$i = $1033;
- }
- } while(0);
- $1034 = (35756 + ($$0212$i$i<<2)|0);
- $1035 = ((($657)) + 28|0);
- HEAP32[$1035>>2] = $$0212$i$i;
- $1036 = ((($657)) + 20|0);
- HEAP32[$1036>>2] = 0;
- HEAP32[$960>>2] = 0;
- $1037 = HEAP32[(35456)>>2]|0;
- $1038 = 1 << $$0212$i$i;
- $1039 = $1037 & $1038;
- $1040 = ($1039|0)==(0);
- if ($1040) {
- $1041 = $1037 | $1038;
- HEAP32[(35456)>>2] = $1041;
- HEAP32[$1034>>2] = $657;
- $1042 = ((($657)) + 24|0);
- HEAP32[$1042>>2] = $1034;
- $1043 = ((($657)) + 12|0);
- HEAP32[$1043>>2] = $657;
- $1044 = ((($657)) + 8|0);
- HEAP32[$1044>>2] = $657;
- break;
- }
- $1045 = HEAP32[$1034>>2]|0;
- $1046 = ($$0212$i$i|0)==(31);
- $1047 = $$0212$i$i >>> 1;
- $1048 = (25 - ($1047))|0;
- $1049 = $1046 ? 0 : $1048;
- $1050 = $988 << $1049;
- $$0206$i$i = $1050;$$0207$i$i = $1045;
- while(1) {
- $1051 = ((($$0207$i$i)) + 4|0);
- $1052 = HEAP32[$1051>>2]|0;
- $1053 = $1052 & -8;
- $1054 = ($1053|0)==($988|0);
- if ($1054) {
- label = 307;
- break;
- }
- $1055 = $$0206$i$i >>> 31;
- $1056 = (((($$0207$i$i)) + 16|0) + ($1055<<2)|0);
- $1057 = $$0206$i$i << 1;
- $1058 = HEAP32[$1056>>2]|0;
- $1059 = ($1058|0)==(0|0);
- if ($1059) {
- label = 304;
- break;
- } else {
- $$0206$i$i = $1057;$$0207$i$i = $1058;
- }
- }
- if ((label|0) == 304) {
- $1060 = HEAP32[(35468)>>2]|0;
- $1061 = ($1056>>>0)<($1060>>>0);
- if ($1061) {
- _abort();
- // unreachable;
- } else {
- HEAP32[$1056>>2] = $657;
- $1062 = ((($657)) + 24|0);
- HEAP32[$1062>>2] = $$0207$i$i;
- $1063 = ((($657)) + 12|0);
- HEAP32[$1063>>2] = $657;
- $1064 = ((($657)) + 8|0);
- HEAP32[$1064>>2] = $657;
- break;
- }
- }
- else if ((label|0) == 307) {
- $1065 = ((($$0207$i$i)) + 8|0);
- $1066 = HEAP32[$1065>>2]|0;
- $1067 = HEAP32[(35468)>>2]|0;
- $1068 = ($1066>>>0)>=($1067>>>0);
- $not$$i21$i = ($$0207$i$i>>>0)>=($1067>>>0);
- $1069 = $1068 & $not$$i21$i;
- if ($1069) {
- $1070 = ((($1066)) + 12|0);
- HEAP32[$1070>>2] = $657;
- HEAP32[$1065>>2] = $657;
- $1071 = ((($657)) + 8|0);
- HEAP32[$1071>>2] = $1066;
- $1072 = ((($657)) + 12|0);
- HEAP32[$1072>>2] = $$0207$i$i;
- $1073 = ((($657)) + 24|0);
- HEAP32[$1073>>2] = 0;
- break;
- } else {
- _abort();
- // unreachable;
- }
- }
- }
- }
- } while(0);
- $1075 = HEAP32[(35464)>>2]|0;
- $1076 = ($1075>>>0)>($$0198>>>0);
- if ($1076) {
- $1077 = (($1075) - ($$0198))|0;
- HEAP32[(35464)>>2] = $1077;
- $1078 = HEAP32[(35476)>>2]|0;
- $1079 = (($1078) + ($$0198)|0);
- HEAP32[(35476)>>2] = $1079;
- $1080 = $1077 | 1;
- $1081 = ((($1079)) + 4|0);
- HEAP32[$1081>>2] = $1080;
- $1082 = $$0198 | 3;
- $1083 = ((($1078)) + 4|0);
- HEAP32[$1083>>2] = $1082;
- $1084 = ((($1078)) + 8|0);
- $$2 = $1084;
- break;
- }
- }
- }
- $1085 = (___errno_location()|0);
- HEAP32[$1085>>2] = 12;
- $$2 = 0;
- } else {
- $$2 = 0;
- }
- }
- } while(0);
- $1086 = HEAP32[(35896)>>2]|0;
- $1087 = $1086 & 2;
- $1088 = ($1087|0)==(0);
- if ($1088) {
- $$1 = $$2;
- STACKTOP = sp;return ($$1|0);
- }
- (___pthread_mutex_unlock((35900))|0);
- $$1 = $$2;
- STACKTOP = sp;return ($$1|0);
- }
- function _free($0) {
- $0 = $0|0;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- sp = STACKTOP;
- $1 = ($0|0)==(0|0);
- if ($1) {
- return;
- }
- $2 = ((($0)) + -8|0);
- $3 = HEAP32[(35896)>>2]|0;
- $4 = $3 & 2;
- $5 = ($4|0)==(0);
- if (!($5)) {
- $6 = (___pthread_mutex_lock((35900))|0);
- $7 = ($6|0)==(0);
- if (!($7)) {
- return;
- }
- }
- $8 = HEAP32[(35468)>>2]|0;
- $9 = ($2>>>0)<($8>>>0);
- if ($9) {
- _abort();
- // unreachable;
- }
- $10 = ((($0)) + -4|0);
- $11 = HEAP32[$10>>2]|0;
- $12 = $11 & 3;
- $13 = ($12|0)==(1);
- if ($13) {
- _abort();
- // unreachable;
- }
- $14 = $11 & -8;
- $15 = (($2) + ($14)|0);
- $16 = $11 & 1;
- $17 = ($16|0)==(0);
- L14: do {
- if ($17) {
- $18 = HEAP32[$2>>2]|0;
- $19 = ($12|0)==(0);
- if (!($19)) {
- $20 = (0 - ($18))|0;
- $21 = (($2) + ($20)|0);
- $22 = (($18) + ($14))|0;
- $23 = ($21>>>0)<($8>>>0);
- if ($23) {
- _abort();
- // unreachable;
- }
- $24 = HEAP32[(35472)>>2]|0;
- $25 = ($21|0)==($24|0);
- if ($25) {
- $109 = ((($15)) + 4|0);
- $110 = HEAP32[$109>>2]|0;
- $111 = $110 & 3;
- $112 = ($111|0)==(3);
- if (!($112)) {
- $$1 = $21;$$1382 = $22;$118 = $21;
- label = 55;
- break;
- }
- $113 = (($21) + ($22)|0);
- $114 = ((($21)) + 4|0);
- $115 = $22 | 1;
- $116 = $110 & -2;
- HEAP32[(35460)>>2] = $22;
- HEAP32[$109>>2] = $116;
- HEAP32[$114>>2] = $115;
- HEAP32[$113>>2] = $22;
- break;
- }
- $26 = $18 >>> 3;
- $27 = ($18>>>0)<(256);
- if ($27) {
- $28 = ((($21)) + 8|0);
- $29 = HEAP32[$28>>2]|0;
- $30 = ((($21)) + 12|0);
- $31 = HEAP32[$30>>2]|0;
- $32 = $26 << 1;
- $33 = (35492 + ($32<<2)|0);
- $34 = ($29|0)==($33|0);
- if (!($34)) {
- $35 = ($29>>>0)<($8>>>0);
- if ($35) {
- _abort();
- // unreachable;
- }
- $36 = ((($29)) + 12|0);
- $37 = HEAP32[$36>>2]|0;
- $38 = ($37|0)==($21|0);
- if (!($38)) {
- _abort();
- // unreachable;
- }
- }
- $39 = ($31|0)==($29|0);
- if ($39) {
- $40 = 1 << $26;
- $41 = $40 ^ -1;
- $42 = HEAP32[8863]|0;
- $43 = $42 & $41;
- HEAP32[8863] = $43;
- $$1 = $21;$$1382 = $22;$118 = $21;
- label = 55;
- break;
- }
- $44 = ($31|0)==($33|0);
- if ($44) {
- $$pre444 = ((($31)) + 8|0);
- $$pre$phi445Z2D = $$pre444;
- } else {
- $45 = ($31>>>0)<($8>>>0);
- if ($45) {
- _abort();
- // unreachable;
- }
- $46 = ((($31)) + 8|0);
- $47 = HEAP32[$46>>2]|0;
- $48 = ($47|0)==($21|0);
- if ($48) {
- $$pre$phi445Z2D = $46;
- } else {
- _abort();
- // unreachable;
- }
- }
- $49 = ((($29)) + 12|0);
- HEAP32[$49>>2] = $31;
- HEAP32[$$pre$phi445Z2D>>2] = $29;
- $$1 = $21;$$1382 = $22;$118 = $21;
- label = 55;
- break;
- }
- $50 = ((($21)) + 24|0);
- $51 = HEAP32[$50>>2]|0;
- $52 = ((($21)) + 12|0);
- $53 = HEAP32[$52>>2]|0;
- $54 = ($53|0)==($21|0);
- do {
- if ($54) {
- $64 = ((($21)) + 16|0);
- $65 = ((($64)) + 4|0);
- $66 = HEAP32[$65>>2]|0;
- $67 = ($66|0)==(0|0);
- if ($67) {
- $68 = HEAP32[$64>>2]|0;
- $69 = ($68|0)==(0|0);
- if ($69) {
- $$3 = 0;
- break;
- } else {
- $$1387 = $68;$$1390 = $64;
- }
- } else {
- $$1387 = $66;$$1390 = $65;
- }
- while(1) {
- $70 = ((($$1387)) + 20|0);
- $71 = HEAP32[$70>>2]|0;
- $72 = ($71|0)==(0|0);
- if (!($72)) {
- $$1387 = $71;$$1390 = $70;
- continue;
- }
- $73 = ((($$1387)) + 16|0);
- $74 = HEAP32[$73>>2]|0;
- $75 = ($74|0)==(0|0);
- if ($75) {
- break;
- } else {
- $$1387 = $74;$$1390 = $73;
- }
- }
- $76 = ($$1390>>>0)<($8>>>0);
- if ($76) {
- _abort();
- // unreachable;
- } else {
- HEAP32[$$1390>>2] = 0;
- $$3 = $$1387;
- break;
- }
- } else {
- $55 = ((($21)) + 8|0);
- $56 = HEAP32[$55>>2]|0;
- $57 = ($56>>>0)<($8>>>0);
- if ($57) {
- _abort();
- // unreachable;
- }
- $58 = ((($56)) + 12|0);
- $59 = HEAP32[$58>>2]|0;
- $60 = ($59|0)==($21|0);
- if (!($60)) {
- _abort();
- // unreachable;
- }
- $61 = ((($53)) + 8|0);
- $62 = HEAP32[$61>>2]|0;
- $63 = ($62|0)==($21|0);
- if ($63) {
- HEAP32[$58>>2] = $53;
- HEAP32[$61>>2] = $56;
- $$3 = $53;
- break;
- } else {
- _abort();
- // unreachable;
- }
- }
- } while(0);
- $77 = ($51|0)==(0|0);
- if ($77) {
- $$1 = $21;$$1382 = $22;$118 = $21;
- label = 55;
- } else {
- $78 = ((($21)) + 28|0);
- $79 = HEAP32[$78>>2]|0;
- $80 = (35756 + ($79<<2)|0);
- $81 = HEAP32[$80>>2]|0;
- $82 = ($21|0)==($81|0);
- do {
- if ($82) {
- HEAP32[$80>>2] = $$3;
- $cond421 = ($$3|0)==(0|0);
- if ($cond421) {
- $83 = 1 << $79;
- $84 = $83 ^ -1;
- $85 = HEAP32[(35456)>>2]|0;
- $86 = $85 & $84;
- HEAP32[(35456)>>2] = $86;
- $$1 = $21;$$1382 = $22;$118 = $21;
- label = 55;
- break L14;
- }
- } else {
- $87 = HEAP32[(35468)>>2]|0;
- $88 = ($51>>>0)<($87>>>0);
- if ($88) {
- _abort();
- // unreachable;
- } else {
- $89 = ((($51)) + 16|0);
- $90 = HEAP32[$89>>2]|0;
- $not$405 = ($90|0)!=($21|0);
- $$sink3 = $not$405&1;
- $91 = (((($51)) + 16|0) + ($$sink3<<2)|0);
- HEAP32[$91>>2] = $$3;
- $92 = ($$3|0)==(0|0);
- if ($92) {
- $$1 = $21;$$1382 = $22;$118 = $21;
- label = 55;
- break L14;
- } else {
- break;
- }
- }
- }
- } while(0);
- $93 = HEAP32[(35468)>>2]|0;
- $94 = ($$3>>>0)<($93>>>0);
- if ($94) {
- _abort();
- // unreachable;
- }
- $95 = ((($$3)) + 24|0);
- HEAP32[$95>>2] = $51;
- $96 = ((($21)) + 16|0);
- $97 = HEAP32[$96>>2]|0;
- $98 = ($97|0)==(0|0);
- do {
- if (!($98)) {
- $99 = ($97>>>0)<($93>>>0);
- if ($99) {
- _abort();
- // unreachable;
- } else {
- $100 = ((($$3)) + 16|0);
- HEAP32[$100>>2] = $97;
- $101 = ((($97)) + 24|0);
- HEAP32[$101>>2] = $$3;
- break;
- }
- }
- } while(0);
- $102 = ((($96)) + 4|0);
- $103 = HEAP32[$102>>2]|0;
- $104 = ($103|0)==(0|0);
- if ($104) {
- $$1 = $21;$$1382 = $22;$118 = $21;
- label = 55;
- } else {
- $105 = HEAP32[(35468)>>2]|0;
- $106 = ($103>>>0)<($105>>>0);
- if ($106) {
- _abort();
- // unreachable;
- } else {
- $107 = ((($$3)) + 20|0);
- HEAP32[$107>>2] = $103;
- $108 = ((($103)) + 24|0);
- HEAP32[$108>>2] = $$3;
- $$1 = $21;$$1382 = $22;$118 = $21;
- label = 55;
- break;
- }
- }
- }
- }
- } else {
- $$1 = $2;$$1382 = $14;$118 = $2;
- label = 55;
- }
- } while(0);
- do {
- if ((label|0) == 55) {
- $117 = ($118>>>0)<($15>>>0);
- if (!($117)) {
- _abort();
- // unreachable;
- }
- $119 = ((($15)) + 4|0);
- $120 = HEAP32[$119>>2]|0;
- $121 = $120 & 1;
- $122 = ($121|0)==(0);
- if ($122) {
- _abort();
- // unreachable;
- }
- $123 = $120 & 2;
- $124 = ($123|0)==(0);
- if ($124) {
- $125 = HEAP32[(35476)>>2]|0;
- $126 = ($15|0)==($125|0);
- $127 = HEAP32[(35472)>>2]|0;
- if ($126) {
- $128 = HEAP32[(35464)>>2]|0;
- $129 = (($128) + ($$1382))|0;
- HEAP32[(35464)>>2] = $129;
- HEAP32[(35476)>>2] = $$1;
- $130 = $129 | 1;
- $131 = ((($$1)) + 4|0);
- HEAP32[$131>>2] = $130;
- $132 = ($$1|0)==($127|0);
- if (!($132)) {
- break;
- }
- HEAP32[(35472)>>2] = 0;
- HEAP32[(35460)>>2] = 0;
- break;
- }
- $133 = ($15|0)==($127|0);
- if ($133) {
- $134 = HEAP32[(35460)>>2]|0;
- $135 = (($134) + ($$1382))|0;
- HEAP32[(35460)>>2] = $135;
- HEAP32[(35472)>>2] = $118;
- $136 = $135 | 1;
- $137 = ((($$1)) + 4|0);
- HEAP32[$137>>2] = $136;
- $138 = (($118) + ($135)|0);
- HEAP32[$138>>2] = $135;
- break;
- }
- $139 = $120 & -8;
- $140 = (($139) + ($$1382))|0;
- $141 = $120 >>> 3;
- $142 = ($120>>>0)<(256);
- L106: do {
- if ($142) {
- $143 = ((($15)) + 8|0);
- $144 = HEAP32[$143>>2]|0;
- $145 = ((($15)) + 12|0);
- $146 = HEAP32[$145>>2]|0;
- $147 = $141 << 1;
- $148 = (35492 + ($147<<2)|0);
- $149 = ($144|0)==($148|0);
- if (!($149)) {
- $150 = HEAP32[(35468)>>2]|0;
- $151 = ($144>>>0)<($150>>>0);
- if ($151) {
- _abort();
- // unreachable;
- }
- $152 = ((($144)) + 12|0);
- $153 = HEAP32[$152>>2]|0;
- $154 = ($153|0)==($15|0);
- if (!($154)) {
- _abort();
- // unreachable;
- }
- }
- $155 = ($146|0)==($144|0);
- if ($155) {
- $156 = 1 << $141;
- $157 = $156 ^ -1;
- $158 = HEAP32[8863]|0;
- $159 = $158 & $157;
- HEAP32[8863] = $159;
- break;
- }
- $160 = ($146|0)==($148|0);
- if ($160) {
- $$pre442 = ((($146)) + 8|0);
- $$pre$phi443Z2D = $$pre442;
- } else {
- $161 = HEAP32[(35468)>>2]|0;
- $162 = ($146>>>0)<($161>>>0);
- if ($162) {
- _abort();
- // unreachable;
- }
- $163 = ((($146)) + 8|0);
- $164 = HEAP32[$163>>2]|0;
- $165 = ($164|0)==($15|0);
- if ($165) {
- $$pre$phi443Z2D = $163;
- } else {
- _abort();
- // unreachable;
- }
- }
- $166 = ((($144)) + 12|0);
- HEAP32[$166>>2] = $146;
- HEAP32[$$pre$phi443Z2D>>2] = $144;
- } else {
- $167 = ((($15)) + 24|0);
- $168 = HEAP32[$167>>2]|0;
- $169 = ((($15)) + 12|0);
- $170 = HEAP32[$169>>2]|0;
- $171 = ($170|0)==($15|0);
- do {
- if ($171) {
- $182 = ((($15)) + 16|0);
- $183 = ((($182)) + 4|0);
- $184 = HEAP32[$183>>2]|0;
- $185 = ($184|0)==(0|0);
- if ($185) {
- $186 = HEAP32[$182>>2]|0;
- $187 = ($186|0)==(0|0);
- if ($187) {
- $$3400 = 0;
- break;
- } else {
- $$1398 = $186;$$1402 = $182;
- }
- } else {
- $$1398 = $184;$$1402 = $183;
- }
- while(1) {
- $188 = ((($$1398)) + 20|0);
- $189 = HEAP32[$188>>2]|0;
- $190 = ($189|0)==(0|0);
- if (!($190)) {
- $$1398 = $189;$$1402 = $188;
- continue;
- }
- $191 = ((($$1398)) + 16|0);
- $192 = HEAP32[$191>>2]|0;
- $193 = ($192|0)==(0|0);
- if ($193) {
- break;
- } else {
- $$1398 = $192;$$1402 = $191;
- }
- }
- $194 = HEAP32[(35468)>>2]|0;
- $195 = ($$1402>>>0)<($194>>>0);
- if ($195) {
- _abort();
- // unreachable;
- } else {
- HEAP32[$$1402>>2] = 0;
- $$3400 = $$1398;
- break;
- }
- } else {
- $172 = ((($15)) + 8|0);
- $173 = HEAP32[$172>>2]|0;
- $174 = HEAP32[(35468)>>2]|0;
- $175 = ($173>>>0)<($174>>>0);
- if ($175) {
- _abort();
- // unreachable;
- }
- $176 = ((($173)) + 12|0);
- $177 = HEAP32[$176>>2]|0;
- $178 = ($177|0)==($15|0);
- if (!($178)) {
- _abort();
- // unreachable;
- }
- $179 = ((($170)) + 8|0);
- $180 = HEAP32[$179>>2]|0;
- $181 = ($180|0)==($15|0);
- if ($181) {
- HEAP32[$176>>2] = $170;
- HEAP32[$179>>2] = $173;
- $$3400 = $170;
- break;
- } else {
- _abort();
- // unreachable;
- }
- }
- } while(0);
- $196 = ($168|0)==(0|0);
- if (!($196)) {
- $197 = ((($15)) + 28|0);
- $198 = HEAP32[$197>>2]|0;
- $199 = (35756 + ($198<<2)|0);
- $200 = HEAP32[$199>>2]|0;
- $201 = ($15|0)==($200|0);
- do {
- if ($201) {
- HEAP32[$199>>2] = $$3400;
- $cond422 = ($$3400|0)==(0|0);
- if ($cond422) {
- $202 = 1 << $198;
- $203 = $202 ^ -1;
- $204 = HEAP32[(35456)>>2]|0;
- $205 = $204 & $203;
- HEAP32[(35456)>>2] = $205;
- break L106;
- }
- } else {
- $206 = HEAP32[(35468)>>2]|0;
- $207 = ($168>>>0)<($206>>>0);
- if ($207) {
- _abort();
- // unreachable;
- } else {
- $208 = ((($168)) + 16|0);
- $209 = HEAP32[$208>>2]|0;
- $not$ = ($209|0)!=($15|0);
- $$sink5 = $not$&1;
- $210 = (((($168)) + 16|0) + ($$sink5<<2)|0);
- HEAP32[$210>>2] = $$3400;
- $211 = ($$3400|0)==(0|0);
- if ($211) {
- break L106;
- } else {
- break;
- }
- }
- }
- } while(0);
- $212 = HEAP32[(35468)>>2]|0;
- $213 = ($$3400>>>0)<($212>>>0);
- if ($213) {
- _abort();
- // unreachable;
- }
- $214 = ((($$3400)) + 24|0);
- HEAP32[$214>>2] = $168;
- $215 = ((($15)) + 16|0);
- $216 = HEAP32[$215>>2]|0;
- $217 = ($216|0)==(0|0);
- do {
- if (!($217)) {
- $218 = ($216>>>0)<($212>>>0);
- if ($218) {
- _abort();
- // unreachable;
- } else {
- $219 = ((($$3400)) + 16|0);
- HEAP32[$219>>2] = $216;
- $220 = ((($216)) + 24|0);
- HEAP32[$220>>2] = $$3400;
- break;
- }
- }
- } while(0);
- $221 = ((($215)) + 4|0);
- $222 = HEAP32[$221>>2]|0;
- $223 = ($222|0)==(0|0);
- if (!($223)) {
- $224 = HEAP32[(35468)>>2]|0;
- $225 = ($222>>>0)<($224>>>0);
- if ($225) {
- _abort();
- // unreachable;
- } else {
- $226 = ((($$3400)) + 20|0);
- HEAP32[$226>>2] = $222;
- $227 = ((($222)) + 24|0);
- HEAP32[$227>>2] = $$3400;
- break;
- }
- }
- }
- }
- } while(0);
- $228 = $140 | 1;
- $229 = ((($$1)) + 4|0);
- HEAP32[$229>>2] = $228;
- $230 = (($118) + ($140)|0);
- HEAP32[$230>>2] = $140;
- $231 = HEAP32[(35472)>>2]|0;
- $232 = ($$1|0)==($231|0);
- if ($232) {
- HEAP32[(35460)>>2] = $140;
- break;
- } else {
- $$2 = $140;
- }
- } else {
- $233 = $120 & -2;
- HEAP32[$119>>2] = $233;
- $234 = $$1382 | 1;
- $235 = ((($$1)) + 4|0);
- HEAP32[$235>>2] = $234;
- $236 = (($118) + ($$1382)|0);
- HEAP32[$236>>2] = $$1382;
- $$2 = $$1382;
- }
- $237 = $$2 >>> 3;
- $238 = ($$2>>>0)<(256);
- if ($238) {
- $239 = $237 << 1;
- $240 = (35492 + ($239<<2)|0);
- $241 = HEAP32[8863]|0;
- $242 = 1 << $237;
- $243 = $241 & $242;
- $244 = ($243|0)==(0);
- if ($244) {
- $245 = $241 | $242;
- HEAP32[8863] = $245;
- $$pre = ((($240)) + 8|0);
- $$0403 = $240;$$pre$phiZ2D = $$pre;
- } else {
- $246 = ((($240)) + 8|0);
- $247 = HEAP32[$246>>2]|0;
- $248 = HEAP32[(35468)>>2]|0;
- $249 = ($247>>>0)<($248>>>0);
- if ($249) {
- _abort();
- // unreachable;
- } else {
- $$0403 = $247;$$pre$phiZ2D = $246;
- }
- }
- HEAP32[$$pre$phiZ2D>>2] = $$1;
- $250 = ((($$0403)) + 12|0);
- HEAP32[$250>>2] = $$1;
- $251 = ((($$1)) + 8|0);
- HEAP32[$251>>2] = $$0403;
- $252 = ((($$1)) + 12|0);
- HEAP32[$252>>2] = $240;
- break;
- }
- $253 = $$2 >>> 8;
- $254 = ($253|0)==(0);
- if ($254) {
- $$0396 = 0;
- } else {
- $255 = ($$2>>>0)>(16777215);
- if ($255) {
- $$0396 = 31;
- } else {
- $256 = (($253) + 1048320)|0;
- $257 = $256 >>> 16;
- $258 = $257 & 8;
- $259 = $253 << $258;
- $260 = (($259) + 520192)|0;
- $261 = $260 >>> 16;
- $262 = $261 & 4;
- $263 = $262 | $258;
- $264 = $259 << $262;
- $265 = (($264) + 245760)|0;
- $266 = $265 >>> 16;
- $267 = $266 & 2;
- $268 = $263 | $267;
- $269 = (14 - ($268))|0;
- $270 = $264 << $267;
- $271 = $270 >>> 15;
- $272 = (($269) + ($271))|0;
- $273 = $272 << 1;
- $274 = (($272) + 7)|0;
- $275 = $$2 >>> $274;
- $276 = $275 & 1;
- $277 = $276 | $273;
- $$0396 = $277;
- }
- }
- $278 = (35756 + ($$0396<<2)|0);
- $279 = ((($$1)) + 28|0);
- HEAP32[$279>>2] = $$0396;
- $280 = ((($$1)) + 16|0);
- $281 = ((($$1)) + 20|0);
- HEAP32[$281>>2] = 0;
- HEAP32[$280>>2] = 0;
- $282 = HEAP32[(35456)>>2]|0;
- $283 = 1 << $$0396;
- $284 = $282 & $283;
- $285 = ($284|0)==(0);
- do {
- if ($285) {
- $286 = $282 | $283;
- HEAP32[(35456)>>2] = $286;
- HEAP32[$278>>2] = $$1;
- $287 = ((($$1)) + 24|0);
- HEAP32[$287>>2] = $278;
- $288 = ((($$1)) + 12|0);
- HEAP32[$288>>2] = $$1;
- $289 = ((($$1)) + 8|0);
- HEAP32[$289>>2] = $$1;
- } else {
- $290 = HEAP32[$278>>2]|0;
- $291 = ($$0396|0)==(31);
- $292 = $$0396 >>> 1;
- $293 = (25 - ($292))|0;
- $294 = $291 ? 0 : $293;
- $295 = $$2 << $294;
- $$0383 = $295;$$0384 = $290;
- while(1) {
- $296 = ((($$0384)) + 4|0);
- $297 = HEAP32[$296>>2]|0;
- $298 = $297 & -8;
- $299 = ($298|0)==($$2|0);
- if ($299) {
- label = 126;
- break;
- }
- $300 = $$0383 >>> 31;
- $301 = (((($$0384)) + 16|0) + ($300<<2)|0);
- $302 = $$0383 << 1;
- $303 = HEAP32[$301>>2]|0;
- $304 = ($303|0)==(0|0);
- if ($304) {
- label = 123;
- break;
- } else {
- $$0383 = $302;$$0384 = $303;
- }
- }
- if ((label|0) == 123) {
- $305 = HEAP32[(35468)>>2]|0;
- $306 = ($301>>>0)<($305>>>0);
- if ($306) {
- _abort();
- // unreachable;
- } else {
- HEAP32[$301>>2] = $$1;
- $307 = ((($$1)) + 24|0);
- HEAP32[$307>>2] = $$0384;
- $308 = ((($$1)) + 12|0);
- HEAP32[$308>>2] = $$1;
- $309 = ((($$1)) + 8|0);
- HEAP32[$309>>2] = $$1;
- break;
- }
- }
- else if ((label|0) == 126) {
- $310 = ((($$0384)) + 8|0);
- $311 = HEAP32[$310>>2]|0;
- $312 = HEAP32[(35468)>>2]|0;
- $313 = ($311>>>0)>=($312>>>0);
- $not$437 = ($$0384>>>0)>=($312>>>0);
- $314 = $313 & $not$437;
- if ($314) {
- $315 = ((($311)) + 12|0);
- HEAP32[$315>>2] = $$1;
- HEAP32[$310>>2] = $$1;
- $316 = ((($$1)) + 8|0);
- HEAP32[$316>>2] = $311;
- $317 = ((($$1)) + 12|0);
- HEAP32[$317>>2] = $$0384;
- $318 = ((($$1)) + 24|0);
- HEAP32[$318>>2] = 0;
- break;
- } else {
- _abort();
- // unreachable;
- }
- }
- }
- } while(0);
- $319 = HEAP32[(35484)>>2]|0;
- $320 = (($319) + -1)|0;
- HEAP32[(35484)>>2] = $320;
- $321 = ($320|0)==(0);
- if ($321) {
- $$0212$in$i = (35936);
- while(1) {
- $$0212$i = HEAP32[$$0212$in$i>>2]|0;
- $322 = ($$0212$i|0)==(0|0);
- $323 = ((($$0212$i)) + 8|0);
- if ($322) {
- break;
- } else {
- $$0212$in$i = $323;
- }
- }
- HEAP32[(35484)>>2] = -1;
- }
- }
- } while(0);
- $324 = HEAP32[(35896)>>2]|0;
- $325 = $324 & 2;
- $326 = ($325|0)==(0);
- if ($326) {
- return;
- }
- (___pthread_mutex_unlock((35900))|0);
- return;
- }
- function runPostSets() {
- }
- function _memset(ptr, value, num) {
- ptr = ptr|0; value = value|0; num = num|0;
- var end = 0, aligned_end = 0, block_aligned_end = 0, value4 = 0;
- end = (ptr + num)|0;
- value = value & 0xff;
- if ((num|0) >= 67 /* 64 bytes for an unrolled loop + 3 bytes for unaligned head*/) {
- while ((ptr&3) != 0) {
- HEAP8[((ptr)>>0)]=value;
- ptr = (ptr+1)|0;
- }
- aligned_end = (end & -4)|0;
- block_aligned_end = (aligned_end - 64)|0;
- value4 = value | (value << 8) | (value << 16) | (value << 24);
- while((ptr|0) <= (block_aligned_end|0)) {
- HEAP32[((ptr)>>2)]=value4;
- HEAP32[(((ptr)+(4))>>2)]=value4;
- HEAP32[(((ptr)+(8))>>2)]=value4;
- HEAP32[(((ptr)+(12))>>2)]=value4;
- HEAP32[(((ptr)+(16))>>2)]=value4;
- HEAP32[(((ptr)+(20))>>2)]=value4;
- HEAP32[(((ptr)+(24))>>2)]=value4;
- HEAP32[(((ptr)+(28))>>2)]=value4;
- HEAP32[(((ptr)+(32))>>2)]=value4;
- HEAP32[(((ptr)+(36))>>2)]=value4;
- HEAP32[(((ptr)+(40))>>2)]=value4;
- HEAP32[(((ptr)+(44))>>2)]=value4;
- HEAP32[(((ptr)+(48))>>2)]=value4;
- HEAP32[(((ptr)+(52))>>2)]=value4;
- HEAP32[(((ptr)+(56))>>2)]=value4;
- HEAP32[(((ptr)+(60))>>2)]=value4;
- ptr = (ptr + 64)|0;
- }
- while ((ptr|0) < (aligned_end|0) ) {
- HEAP32[((ptr)>>2)]=value4;
- ptr = (ptr+4)|0;
- }
- }
- // The remaining bytes.
- while ((ptr|0) < (end|0)) {
- HEAP8[((ptr)>>0)]=value;
- ptr = (ptr+1)|0;
- }
- return (end-num)|0;
- }
- function _i64Subtract(a, b, c, d) {
- a = a|0; b = b|0; c = c|0; d = d|0;
- var l = 0, h = 0;
- l = (a - c)>>>0;
- h = (b - d)>>>0;
- h = (b - d - (((c>>>0) > (a>>>0))|0))>>>0; // Borrow one from high word to low word on underflow.
- return ((tempRet0 = h,l|0)|0);
- }
- function _i64Add(a, b, c, d) {
- /*
- x = a + b*2^32
- y = c + d*2^32
- result = l + h*2^32
- */
- a = a|0; b = b|0; c = c|0; d = d|0;
- var l = 0, h = 0;
- l = (a + c)>>>0;
- h = (b + d + (((l>>>0) < (a>>>0))|0))>>>0; // Add carry from low word to high word on overflow.
- return ((tempRet0 = h,l|0)|0);
- }
- function ___muldsi3($a, $b) {
- $a = $a | 0;
- $b = $b | 0;
- var $1 = 0, $2 = 0, $3 = 0, $6 = 0, $8 = 0, $11 = 0, $12 = 0;
- $1 = $a & 65535;
- $2 = $b & 65535;
- $3 = Math_imul($2, $1) | 0;
- $6 = $a >>> 16;
- $8 = ($3 >>> 16) + (Math_imul($2, $6) | 0) | 0;
- $11 = $b >>> 16;
- $12 = Math_imul($11, $1) | 0;
- return (tempRet0 = (($8 >>> 16) + (Math_imul($11, $6) | 0) | 0) + ((($8 & 65535) + $12 | 0) >>> 16) | 0, 0 | ($8 + $12 << 16 | $3 & 65535)) | 0;
- }
- function ___muldi3($a$0, $a$1, $b$0, $b$1) {
- $a$0 = $a$0 | 0;
- $a$1 = $a$1 | 0;
- $b$0 = $b$0 | 0;
- $b$1 = $b$1 | 0;
- var $x_sroa_0_0_extract_trunc = 0, $y_sroa_0_0_extract_trunc = 0, $1$0 = 0, $1$1 = 0, $2 = 0;
- $x_sroa_0_0_extract_trunc = $a$0;
- $y_sroa_0_0_extract_trunc = $b$0;
- $1$0 = ___muldsi3($x_sroa_0_0_extract_trunc, $y_sroa_0_0_extract_trunc) | 0;
- $1$1 = tempRet0;
- $2 = Math_imul($a$1, $y_sroa_0_0_extract_trunc) | 0;
- 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;
- }
- function _memcpy(dest, src, num) {
- dest = dest|0; src = src|0; num = num|0;
- var ret = 0;
- var aligned_dest_end = 0;
- var block_aligned_dest_end = 0;
- var dest_end = 0;
- // Test against a benchmarked cutoff limit for when HEAPU8.set() becomes faster to use.
- if ((num|0) >=
- 8192
- ) {
- return _emscripten_memcpy_big(dest|0, src|0, num|0)|0;
- }
- ret = dest|0;
- dest_end = (dest + num)|0;
- if ((dest&3) == (src&3)) {
- // The initial unaligned < 4-byte front.
- while (dest & 3) {
- if ((num|0) == 0) return ret|0;
- HEAP8[((dest)>>0)]=((HEAP8[((src)>>0)])|0);
- dest = (dest+1)|0;
- src = (src+1)|0;
- num = (num-1)|0;
- }
- aligned_dest_end = (dest_end & -4)|0;
- block_aligned_dest_end = (aligned_dest_end - 64)|0;
- while ((dest|0) <= (block_aligned_dest_end|0) ) {
- HEAP32[((dest)>>2)]=((HEAP32[((src)>>2)])|0);
- HEAP32[(((dest)+(4))>>2)]=((HEAP32[(((src)+(4))>>2)])|0);
- HEAP32[(((dest)+(8))>>2)]=((HEAP32[(((src)+(8))>>2)])|0);
- HEAP32[(((dest)+(12))>>2)]=((HEAP32[(((src)+(12))>>2)])|0);
- HEAP32[(((dest)+(16))>>2)]=((HEAP32[(((src)+(16))>>2)])|0);
- HEAP32[(((dest)+(20))>>2)]=((HEAP32[(((src)+(20))>>2)])|0);
- HEAP32[(((dest)+(24))>>2)]=((HEAP32[(((src)+(24))>>2)])|0);
- HEAP32[(((dest)+(28))>>2)]=((HEAP32[(((src)+(28))>>2)])|0);
- HEAP32[(((dest)+(32))>>2)]=((HEAP32[(((src)+(32))>>2)])|0);
- HEAP32[(((dest)+(36))>>2)]=((HEAP32[(((src)+(36))>>2)])|0);
- HEAP32[(((dest)+(40))>>2)]=((HEAP32[(((src)+(40))>>2)])|0);
- HEAP32[(((dest)+(44))>>2)]=((HEAP32[(((src)+(44))>>2)])|0);
- HEAP32[(((dest)+(48))>>2)]=((HEAP32[(((src)+(48))>>2)])|0);
- HEAP32[(((dest)+(52))>>2)]=((HEAP32[(((src)+(52))>>2)])|0);
- HEAP32[(((dest)+(56))>>2)]=((HEAP32[(((src)+(56))>>2)])|0);
- HEAP32[(((dest)+(60))>>2)]=((HEAP32[(((src)+(60))>>2)])|0);
- dest = (dest+64)|0;
- src = (src+64)|0;
- }
- while ((dest|0) < (aligned_dest_end|0) ) {
- HEAP32[((dest)>>2)]=((HEAP32[((src)>>2)])|0);
- dest = (dest+4)|0;
- src = (src+4)|0;
- }
- } else {
- // In the unaligned copy case, unroll a bit as well.
- aligned_dest_end = (dest_end - 4)|0;
- while ((dest|0) < (aligned_dest_end|0) ) {
- HEAP8[((dest)>>0)]=((HEAP8[((src)>>0)])|0);
- HEAP8[(((dest)+(1))>>0)]=((HEAP8[(((src)+(1))>>0)])|0);
- HEAP8[(((dest)+(2))>>0)]=((HEAP8[(((src)+(2))>>0)])|0);
- HEAP8[(((dest)+(3))>>0)]=((HEAP8[(((src)+(3))>>0)])|0);
- dest = (dest+4)|0;
- src = (src+4)|0;
- }
- }
- // The remaining unaligned < 4 byte tail.
- while ((dest|0) < (dest_end|0)) {
- HEAP8[((dest)>>0)]=((HEAP8[((src)>>0)])|0);
- dest = (dest+1)|0;
- src = (src+1)|0;
- }
- return ret|0;
- }
- function _memmove(dest, src, num) {
- dest = dest|0; src = src|0; num = num|0;
- var ret = 0;
- if (((src|0) < (dest|0)) & ((dest|0) < ((src + num)|0))) {
- // Unlikely case: Copy backwards in a safe manner
- ret = dest;
- src = (src + num)|0;
- dest = (dest + num)|0;
- while ((num|0) > 0) {
- dest = (dest - 1)|0;
- src = (src - 1)|0;
- num = (num - 1)|0;
- HEAP8[((dest)>>0)]=((HEAP8[((src)>>0)])|0);
- }
- dest = ret;
- } else {
- _memcpy(dest, src, num) | 0;
- }
- return dest | 0;
- }
- function _llvm_cttz_i32(x) {
- x = x|0;
- var ret = 0;
- ret = ((HEAP8[(((cttz_i8)+(x & 0xff))>>0)])|0);
- if ((ret|0) < 8) return ret|0;
- ret = ((HEAP8[(((cttz_i8)+((x >> 8)&0xff))>>0)])|0);
- if ((ret|0) < 8) return (ret + 8)|0;
- ret = ((HEAP8[(((cttz_i8)+((x >> 16)&0xff))>>0)])|0);
- if ((ret|0) < 8) return (ret + 16)|0;
- return (((HEAP8[(((cttz_i8)+(x >>> 24))>>0)])|0) + 24)|0;
- }
- function ___udivmoddi4($a$0, $a$1, $b$0, $b$1, $rem) {
- $a$0 = $a$0 | 0;
- $a$1 = $a$1 | 0;
- $b$0 = $b$0 | 0;
- $b$1 = $b$1 | 0;
- $rem = $rem | 0;
- 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;
- $n_sroa_0_0_extract_trunc = $a$0;
- $n_sroa_1_4_extract_shift$0 = $a$1;
- $n_sroa_1_4_extract_trunc = $n_sroa_1_4_extract_shift$0;
- $d_sroa_0_0_extract_trunc = $b$0;
- $d_sroa_1_4_extract_shift$0 = $b$1;
- $d_sroa_1_4_extract_trunc = $d_sroa_1_4_extract_shift$0;
- if (($n_sroa_1_4_extract_trunc | 0) == 0) {
- $4 = ($rem | 0) != 0;
- if (($d_sroa_1_4_extract_trunc | 0) == 0) {
- if ($4) {
- HEAP32[$rem >> 2] = ($n_sroa_0_0_extract_trunc >>> 0) % ($d_sroa_0_0_extract_trunc >>> 0);
- HEAP32[$rem + 4 >> 2] = 0;
- }
- $_0$1 = 0;
- $_0$0 = ($n_sroa_0_0_extract_trunc >>> 0) / ($d_sroa_0_0_extract_trunc >>> 0) >>> 0;
- return (tempRet0 = $_0$1, $_0$0) | 0;
- } else {
- if (!$4) {
- $_0$1 = 0;
- $_0$0 = 0;
- return (tempRet0 = $_0$1, $_0$0) | 0;
- }
- HEAP32[$rem >> 2] = $a$0 & -1;
- HEAP32[$rem + 4 >> 2] = $a$1 & 0;
- $_0$1 = 0;
- $_0$0 = 0;
- return (tempRet0 = $_0$1, $_0$0) | 0;
- }
- }
- $17 = ($d_sroa_1_4_extract_trunc | 0) == 0;
- do {
- if (($d_sroa_0_0_extract_trunc | 0) == 0) {
- if ($17) {
- if (($rem | 0) != 0) {
- HEAP32[$rem >> 2] = ($n_sroa_1_4_extract_trunc >>> 0) % ($d_sroa_0_0_extract_trunc >>> 0);
- HEAP32[$rem + 4 >> 2] = 0;
- }
- $_0$1 = 0;
- $_0$0 = ($n_sroa_1_4_extract_trunc >>> 0) / ($d_sroa_0_0_extract_trunc >>> 0) >>> 0;
- return (tempRet0 = $_0$1, $_0$0) | 0;
- }
- if (($n_sroa_0_0_extract_trunc | 0) == 0) {
- if (($rem | 0) != 0) {
- HEAP32[$rem >> 2] = 0;
- HEAP32[$rem + 4 >> 2] = ($n_sroa_1_4_extract_trunc >>> 0) % ($d_sroa_1_4_extract_trunc >>> 0);
- }
- $_0$1 = 0;
- $_0$0 = ($n_sroa_1_4_extract_trunc >>> 0) / ($d_sroa_1_4_extract_trunc >>> 0) >>> 0;
- return (tempRet0 = $_0$1, $_0$0) | 0;
- }
- $37 = $d_sroa_1_4_extract_trunc - 1 | 0;
- if (($37 & $d_sroa_1_4_extract_trunc | 0) == 0) {
- if (($rem | 0) != 0) {
- HEAP32[$rem >> 2] = 0 | $a$0 & -1;
- HEAP32[$rem + 4 >> 2] = $37 & $n_sroa_1_4_extract_trunc | $a$1 & 0;
- }
- $_0$1 = 0;
- $_0$0 = $n_sroa_1_4_extract_trunc >>> ((_llvm_cttz_i32($d_sroa_1_4_extract_trunc | 0) | 0) >>> 0);
- return (tempRet0 = $_0$1, $_0$0) | 0;
- }
- $49 = Math_clz32($d_sroa_1_4_extract_trunc | 0) | 0;
- $51 = $49 - (Math_clz32($n_sroa_1_4_extract_trunc | 0) | 0) | 0;
- if ($51 >>> 0 <= 30) {
- $57 = $51 + 1 | 0;
- $58 = 31 - $51 | 0;
- $sr_1_ph = $57;
- $r_sroa_0_1_ph = $n_sroa_1_4_extract_trunc << $58 | $n_sroa_0_0_extract_trunc >>> ($57 >>> 0);
- $r_sroa_1_1_ph = $n_sroa_1_4_extract_trunc >>> ($57 >>> 0);
- $q_sroa_0_1_ph = 0;
- $q_sroa_1_1_ph = $n_sroa_0_0_extract_trunc << $58;
- break;
- }
- if (($rem | 0) == 0) {
- $_0$1 = 0;
- $_0$0 = 0;
- return (tempRet0 = $_0$1, $_0$0) | 0;
- }
- HEAP32[$rem >> 2] = 0 | $a$0 & -1;
- HEAP32[$rem + 4 >> 2] = $n_sroa_1_4_extract_shift$0 | $a$1 & 0;
- $_0$1 = 0;
- $_0$0 = 0;
- return (tempRet0 = $_0$1, $_0$0) | 0;
- } else {
- if (!$17) {
- $117 = Math_clz32($d_sroa_1_4_extract_trunc | 0) | 0;
- $119 = $117 - (Math_clz32($n_sroa_1_4_extract_trunc | 0) | 0) | 0;
- if ($119 >>> 0 <= 31) {
- $125 = $119 + 1 | 0;
- $126 = 31 - $119 | 0;
- $130 = $119 - 31 >> 31;
- $sr_1_ph = $125;
- $r_sroa_0_1_ph = $n_sroa_0_0_extract_trunc >>> ($125 >>> 0) & $130 | $n_sroa_1_4_extract_trunc << $126;
- $r_sroa_1_1_ph = $n_sroa_1_4_extract_trunc >>> ($125 >>> 0) & $130;
- $q_sroa_0_1_ph = 0;
- $q_sroa_1_1_ph = $n_sroa_0_0_extract_trunc << $126;
- break;
- }
- if (($rem | 0) == 0) {
- $_0$1 = 0;
- $_0$0 = 0;
- return (tempRet0 = $_0$1, $_0$0) | 0;
- }
- HEAP32[$rem >> 2] = 0 | $a$0 & -1;
- HEAP32[$rem + 4 >> 2] = $n_sroa_1_4_extract_shift$0 | $a$1 & 0;
- $_0$1 = 0;
- $_0$0 = 0;
- return (tempRet0 = $_0$1, $_0$0) | 0;
- }
- $66 = $d_sroa_0_0_extract_trunc - 1 | 0;
- if (($66 & $d_sroa_0_0_extract_trunc | 0) != 0) {
- $86 = (Math_clz32($d_sroa_0_0_extract_trunc | 0) | 0) + 33 | 0;
- $88 = $86 - (Math_clz32($n_sroa_1_4_extract_trunc | 0) | 0) | 0;
- $89 = 64 - $88 | 0;
- $91 = 32 - $88 | 0;
- $92 = $91 >> 31;
- $95 = $88 - 32 | 0;
- $105 = $95 >> 31;
- $sr_1_ph = $88;
- $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;
- $r_sroa_1_1_ph = $105 & $n_sroa_1_4_extract_trunc >>> ($88 >>> 0);
- $q_sroa_0_1_ph = $n_sroa_0_0_extract_trunc << $89 & $92;
- $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;
- break;
- }
- if (($rem | 0) != 0) {
- HEAP32[$rem >> 2] = $66 & $n_sroa_0_0_extract_trunc;
- HEAP32[$rem + 4 >> 2] = 0;
- }
- if (($d_sroa_0_0_extract_trunc | 0) == 1) {
- $_0$1 = $n_sroa_1_4_extract_shift$0 | $a$1 & 0;
- $_0$0 = 0 | $a$0 & -1;
- return (tempRet0 = $_0$1, $_0$0) | 0;
- } else {
- $78 = _llvm_cttz_i32($d_sroa_0_0_extract_trunc | 0) | 0;
- $_0$1 = 0 | $n_sroa_1_4_extract_trunc >>> ($78 >>> 0);
- $_0$0 = $n_sroa_1_4_extract_trunc << 32 - $78 | $n_sroa_0_0_extract_trunc >>> ($78 >>> 0) | 0;
- return (tempRet0 = $_0$1, $_0$0) | 0;
- }
- }
- } while (0);
- if (($sr_1_ph | 0) == 0) {
- $q_sroa_1_1_lcssa = $q_sroa_1_1_ph;
- $q_sroa_0_1_lcssa = $q_sroa_0_1_ph;
- $r_sroa_1_1_lcssa = $r_sroa_1_1_ph;
- $r_sroa_0_1_lcssa = $r_sroa_0_1_ph;
- $carry_0_lcssa$1 = 0;
- $carry_0_lcssa$0 = 0;
- } else {
- $d_sroa_0_0_insert_insert99$0 = 0 | $b$0 & -1;
- $d_sroa_0_0_insert_insert99$1 = $d_sroa_1_4_extract_shift$0 | $b$1 & 0;
- $137$0 = _i64Add($d_sroa_0_0_insert_insert99$0 | 0, $d_sroa_0_0_insert_insert99$1 | 0, -1, -1) | 0;
- $137$1 = tempRet0;
- $q_sroa_1_1198 = $q_sroa_1_1_ph;
- $q_sroa_0_1199 = $q_sroa_0_1_ph;
- $r_sroa_1_1200 = $r_sroa_1_1_ph;
- $r_sroa_0_1201 = $r_sroa_0_1_ph;
- $sr_1202 = $sr_1_ph;
- $carry_0203 = 0;
- while (1) {
- $147 = $q_sroa_0_1199 >>> 31 | $q_sroa_1_1198 << 1;
- $149 = $carry_0203 | $q_sroa_0_1199 << 1;
- $r_sroa_0_0_insert_insert42$0 = 0 | ($r_sroa_0_1201 << 1 | $q_sroa_1_1198 >>> 31);
- $r_sroa_0_0_insert_insert42$1 = $r_sroa_0_1201 >>> 31 | $r_sroa_1_1200 << 1 | 0;
- _i64Subtract($137$0 | 0, $137$1 | 0, $r_sroa_0_0_insert_insert42$0 | 0, $r_sroa_0_0_insert_insert42$1 | 0) | 0;
- $150$1 = tempRet0;
- $151$0 = $150$1 >> 31 | (($150$1 | 0) < 0 ? -1 : 0) << 1;
- $152 = $151$0 & 1;
- $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;
- $r_sroa_0_0_extract_trunc = $154$0;
- $r_sroa_1_4_extract_trunc = tempRet0;
- $155 = $sr_1202 - 1 | 0;
- if (($155 | 0) == 0) {
- break;
- } else {
- $q_sroa_1_1198 = $147;
- $q_sroa_0_1199 = $149;
- $r_sroa_1_1200 = $r_sroa_1_4_extract_trunc;
- $r_sroa_0_1201 = $r_sroa_0_0_extract_trunc;
- $sr_1202 = $155;
- $carry_0203 = $152;
- }
- }
- $q_sroa_1_1_lcssa = $147;
- $q_sroa_0_1_lcssa = $149;
- $r_sroa_1_1_lcssa = $r_sroa_1_4_extract_trunc;
- $r_sroa_0_1_lcssa = $r_sroa_0_0_extract_trunc;
- $carry_0_lcssa$1 = 0;
- $carry_0_lcssa$0 = $152;
- }
- $q_sroa_0_0_insert_ext75$0 = $q_sroa_0_1_lcssa;
- $q_sroa_0_0_insert_ext75$1 = 0;
- $q_sroa_0_0_insert_insert77$1 = $q_sroa_1_1_lcssa | $q_sroa_0_0_insert_ext75$1;
- if (($rem | 0) != 0) {
- HEAP32[$rem >> 2] = 0 | $r_sroa_0_1_lcssa;
- HEAP32[$rem + 4 >> 2] = $r_sroa_1_1_lcssa | 0;
- }
- $_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;
- $_0$0 = ($q_sroa_0_0_insert_ext75$0 << 1 | 0 >>> 31) & -2 | $carry_0_lcssa$0;
- return (tempRet0 = $_0$1, $_0$0) | 0;
- }
- function ___uremdi3($a$0, $a$1, $b$0, $b$1) {
- $a$0 = $a$0 | 0;
- $a$1 = $a$1 | 0;
- $b$0 = $b$0 | 0;
- $b$1 = $b$1 | 0;
- var $rem = 0, __stackBase__ = 0;
- __stackBase__ = STACKTOP;
- STACKTOP = STACKTOP + 16 | 0;
- $rem = __stackBase__ | 0;
- ___udivmoddi4($a$0, $a$1, $b$0, $b$1, $rem) | 0;
- STACKTOP = __stackBase__;
- return (tempRet0 = HEAP32[$rem + 4 >> 2] | 0, HEAP32[$rem >> 2] | 0) | 0;
- }
- function ___udivdi3($a$0, $a$1, $b$0, $b$1) {
- $a$0 = $a$0 | 0;
- $a$1 = $a$1 | 0;
- $b$0 = $b$0 | 0;
- $b$1 = $b$1 | 0;
- var $1$0 = 0;
- $1$0 = ___udivmoddi4($a$0, $a$1, $b$0, $b$1, 0) | 0;
- return $1$0 | 0;
- }
- function _roundf(f) {
- f = +f;
- return f >= +0 ? +Math_floor(f + +0.5) : +Math_ceil(f - +0.5); // TODO: use fround?
- }
- function _emscripten_set_current_thread_status(newStatus) {
- newStatus = newStatus|0;
- }
- function _bitshift64Lshr(low, high, bits) {
- low = low|0; high = high|0; bits = bits|0;
- var ander = 0;
- if ((bits|0) < 32) {
- ander = ((1 << bits) - 1)|0;
- tempRet0 = high >>> bits;
- return (low >>> bits) | ((high&ander) << (32 - bits));
- }
- tempRet0 = 0;
- return (high >>> (bits - 32))|0;
- }
- function _emscripten_conditional_set_current_thread_status(expectedStatus, newStatus) {
- expectedStatus = expectedStatus|0;
- newStatus = newStatus|0;
- }
- function _sbrk(increment) {
- increment = increment|0;
- var oldDynamicTop = 0;
- var oldDynamicTopOnChange = 0;
- var newDynamicTop = 0;
- var totalMemory = 0;
- increment = ((increment + 15) & -16)|0;
- totalMemory = getTotalMemory()|0;
- // Perform a compare-and-swap loop to update the new dynamic top value. This is because
- // this function can becalled simultaneously in multiple threads.
- do {
- oldDynamicTop = Atomics_load(HEAP32, DYNAMICTOP_PTR>>2)|0;
- newDynamicTop = oldDynamicTop + increment | 0;
- // Asking to increase dynamic top to a too high value? In pthreads builds we cannot
- // enlarge memory, so this needs to fail.
- if (((increment|0) > 0 & (newDynamicTop|0) < (oldDynamicTop|0)) // Detect and fail if we would wrap around signed 32-bit int.
- | (newDynamicTop|0) < 0 // Also underflow, sbrk() should be able to be used to subtract.
- | (newDynamicTop|0) > (totalMemory|0)) {
- abortOnCannotGrowMemory()|0;
- }
- // Attempt to update the dynamic top to new value. Another thread may have beat this thread to the update,
- // in which case we will need to start over by iterating the loop body again.
- oldDynamicTopOnChange = Atomics_compareExchange(HEAP32, DYNAMICTOP_PTR>>2, oldDynamicTop|0, newDynamicTop|0)|0;
- } while((oldDynamicTopOnChange|0) != (oldDynamicTop|0));
- return oldDynamicTop|0;
- }
- function _bitshift64Shl(low, high, bits) {
- low = low|0; high = high|0; bits = bits|0;
- var ander = 0;
- if ((bits|0) < 32) {
- ander = ((1 << bits) - 1)|0;
- tempRet0 = (high << bits) | ((low&(ander << (32 - bits))) >>> (32 - bits));
- return low << bits;
- }
- tempRet0 = low << (bits - 32);
- return 0;
- }
- function _llvm_bswap_i32(x) {
- x = x|0;
- return (((x&0xff)<<24) | (((x>>8)&0xff)<<16) | (((x>>16)&0xff)<<8) | (x>>>24))|0;
- }
-
- function dynCall_viiiii(index,a1,a2,a3,a4,a5) {
- index = index|0;
- a1=a1|0; a2=a2|0; a3=a3|0; a4=a4|0; a5=a5|0;
- FUNCTION_TABLE_viiiii[index&7](a1|0,a2|0,a3|0,a4|0,a5|0);
- }
- function dynCall_vd(index,a1) {
- index = index|0;
- a1=+a1;
- FUNCTION_TABLE_vd[index&3](+a1);
- }
- function dynCall_vid(index,a1,a2) {
- index = index|0;
- a1=a1|0; a2=+a2;
- FUNCTION_TABLE_vid[index&3](a1|0,+a2);
- }
- function dynCall_vi(index,a1) {
- index = index|0;
- a1=a1|0;
- FUNCTION_TABLE_vi[index&31](a1|0);
- }
- function dynCall_vii(index,a1,a2) {
- index = index|0;
- a1=a1|0; a2=a2|0;
- FUNCTION_TABLE_vii[index&63](a1|0,a2|0);
- }
- function dynCall_ii(index,a1) {
- index = index|0;
- a1=a1|0;
- return FUNCTION_TABLE_ii[index&15](a1|0)|0;
- }
- function dynCall_viddd(index,a1,a2,a3,a4) {
- index = index|0;
- a1=a1|0; a2=+a2; a3=+a3; a4=+a4;
- FUNCTION_TABLE_viddd[index&3](a1|0,+a2,+a3,+a4);
- }
- function dynCall_vidd(index,a1,a2,a3) {
- index = index|0;
- a1=a1|0; a2=+a2; a3=+a3;
- FUNCTION_TABLE_vidd[index&7](a1|0,+a2,+a3);
- }
- function dynCall_iiii(index,a1,a2,a3) {
- index = index|0;
- a1=a1|0; a2=a2|0; a3=a3|0;
- return FUNCTION_TABLE_iiii[index&15](a1|0,a2|0,a3|0)|0;
- }
- function dynCall_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8) {
- index = index|0;
- a1=a1|0; a2=a2|0; a3=a3|0; a4=a4|0; a5=a5|0; a6=a6|0; a7=a7|0; a8=a8|0;
- FUNCTION_TABLE_viiiiiiii[index&3](a1|0,a2|0,a3|0,a4|0,a5|0,a6|0,a7|0,a8|0);
- }
- function dynCall_viiiiii(index,a1,a2,a3,a4,a5,a6) {
- index = index|0;
- a1=a1|0; a2=a2|0; a3=a3|0; a4=a4|0; a5=a5|0; a6=a6|0;
- FUNCTION_TABLE_viiiiii[index&3](a1|0,a2|0,a3|0,a4|0,a5|0,a6|0);
- }
- function dynCall_viii(index,a1,a2,a3) {
- index = index|0;
- a1=a1|0; a2=a2|0; a3=a3|0;
- FUNCTION_TABLE_viii[index&31](a1|0,a2|0,a3|0);
- }
- function dynCall_vidddd(index,a1,a2,a3,a4,a5) {
- index = index|0;
- a1=a1|0; a2=+a2; a3=+a3; a4=+a4; a5=+a5;
- FUNCTION_TABLE_vidddd[index&3](a1|0,+a2,+a3,+a4,+a5);
- }
- function dynCall_vdi(index,a1,a2) {
- index = index|0;
- a1=+a1; a2=a2|0;
- FUNCTION_TABLE_vdi[index&1](+a1,a2|0);
- }
- function dynCall_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7) {
- index = index|0;
- a1=a1|0; a2=a2|0; a3=a3|0; a4=a4|0; a5=a5|0; a6=a6|0; a7=a7|0;
- FUNCTION_TABLE_viiiiiii[index&3](a1|0,a2|0,a3|0,a4|0,a5|0,a6|0,a7|0);
- }
- function dynCall_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9) {
- index = index|0;
- 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;
- FUNCTION_TABLE_viiiiiiiii[index&3](a1|0,a2|0,a3|0,a4|0,a5|0,a6|0,a7|0,a8|0,a9|0);
- }
- function dynCall_iii(index,a1,a2) {
- index = index|0;
- a1=a1|0; a2=a2|0;
- return FUNCTION_TABLE_iii[index&3](a1|0,a2|0)|0;
- }
- function dynCall_i(index) {
- index = index|0;
-
- return FUNCTION_TABLE_i[index&3]()|0;
- }
- function dynCall_vdddddd(index,a1,a2,a3,a4,a5,a6) {
- index = index|0;
- a1=+a1; a2=+a2; a3=+a3; a4=+a4; a5=+a5; a6=+a6;
- FUNCTION_TABLE_vdddddd[index&1](+a1,+a2,+a3,+a4,+a5,+a6);
- }
- function dynCall_vdddd(index,a1,a2,a3,a4) {
- index = index|0;
- a1=+a1; a2=+a2; a3=+a3; a4=+a4;
- FUNCTION_TABLE_vdddd[index&3](+a1,+a2,+a3,+a4);
- }
- function dynCall_vdd(index,a1,a2) {
- index = index|0;
- a1=+a1; a2=+a2;
- FUNCTION_TABLE_vdd[index&3](+a1,+a2);
- }
- function dynCall_v(index) {
- index = index|0;
-
- FUNCTION_TABLE_v[index&7]();
- }
- function dynCall_viid(index,a1,a2,a3) {
- index = index|0;
- a1=a1|0; a2=a2|0; a3=+a3;
- FUNCTION_TABLE_viid[index&1](a1|0,a2|0,+a3);
- }
- function dynCall_viiii(index,a1,a2,a3,a4) {
- index = index|0;
- a1=a1|0; a2=a2|0; a3=a3|0; a4=a4|0;
- FUNCTION_TABLE_viiii[index&31](a1|0,a2|0,a3|0,a4|0);
- }
- function b0(p0,p1,p2,p3,p4) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0; nullFunc_viiiii(0);
- }
- function _emscripten_glUniform4i__wrapper(p0,p1,p2,p3,p4) {
- 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);
- }
- function _emscripten_glFramebufferTexture2D__wrapper(p0,p1,p2,p3,p4) {
- 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);
- }
- function _emscripten_glShaderBinary__wrapper(p0,p1,p2,p3,p4) {
- 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);
- }
- function _emscripten_glDrawElementsInstanced__wrapper(p0,p1,p2,p3,p4) {
- 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);
- }
- function b1(p0) {
- p0 = +p0; nullFunc_vd(1);
- }
- function _emscripten_glClearDepth__wrapper(p0) {
- p0 = +p0; _emscripten_glClearDepth(+p0);
- }
- function _emscripten_glClearDepthf__wrapper(p0) {
- p0 = +p0; _emscripten_glClearDepthf(+p0);
- }
- function _emscripten_glLineWidth__wrapper(p0) {
- p0 = +p0; _emscripten_glLineWidth(+p0);
- }
- function b2(p0,p1) {
- p0 = p0|0;p1 = +p1; nullFunc_vid(2);
- }
- function _emscripten_glUniform1f__wrapper(p0,p1) {
- p0 = p0|0;p1 = +p1; _emscripten_glUniform1f(p0|0,+p1);
- }
- function _emscripten_glVertexAttrib1f__wrapper(p0,p1) {
- p0 = p0|0;p1 = +p1; _emscripten_glVertexAttrib1f(p0|0,+p1);
- }
- function b3(p0) {
- p0 = p0|0; nullFunc_vi(3);
- }
- function _emscripten_glDeleteShader__wrapper(p0) {
- p0 = p0|0; _emscripten_glDeleteShader(p0|0);
- }
- function _emscripten_glCompileShader__wrapper(p0) {
- p0 = p0|0; _emscripten_glCompileShader(p0|0);
- }
- function _emscripten_glDeleteProgram__wrapper(p0) {
- p0 = p0|0; _emscripten_glDeleteProgram(p0|0);
- }
- function _emscripten_glLinkProgram__wrapper(p0) {
- p0 = p0|0; _emscripten_glLinkProgram(p0|0);
- }
- function _emscripten_glUseProgram__wrapper(p0) {
- p0 = p0|0; _emscripten_glUseProgram(p0|0);
- }
- function _emscripten_glValidateProgram__wrapper(p0) {
- p0 = p0|0; _emscripten_glValidateProgram(p0|0);
- }
- function _emscripten_glDeleteObjectARB__wrapper(p0) {
- p0 = p0|0; _emscripten_glDeleteObjectARB(p0|0);
- }
- function _emscripten_glEnableClientState__wrapper(p0) {
- p0 = p0|0; _emscripten_glEnableClientState(p0|0);
- }
- function _emscripten_glClientActiveTexture__wrapper(p0) {
- p0 = p0|0; _emscripten_glClientActiveTexture(p0|0);
- }
- function _emscripten_glBindVertexArray__wrapper(p0) {
- p0 = p0|0; _emscripten_glBindVertexArray(p0|0);
- }
- function _emscripten_glMatrixMode__wrapper(p0) {
- p0 = p0|0; _emscripten_glMatrixMode(p0|0);
- }
- function _emscripten_glLoadMatrixf__wrapper(p0) {
- p0 = p0|0; _emscripten_glLoadMatrixf(p0|0);
- }
- function _emscripten_glEnableVertexAttribArray__wrapper(p0) {
- p0 = p0|0; _emscripten_glEnableVertexAttribArray(p0|0);
- }
- function _emscripten_glDisableVertexAttribArray__wrapper(p0) {
- p0 = p0|0; _emscripten_glDisableVertexAttribArray(p0|0);
- }
- function _emscripten_glDepthFunc__wrapper(p0) {
- p0 = p0|0; _emscripten_glDepthFunc(p0|0);
- }
- function _emscripten_glEnable__wrapper(p0) {
- p0 = p0|0; _emscripten_glEnable(p0|0);
- }
- function _emscripten_glDisable__wrapper(p0) {
- p0 = p0|0; _emscripten_glDisable(p0|0);
- }
- function _emscripten_glFrontFace__wrapper(p0) {
- p0 = p0|0; _emscripten_glFrontFace(p0|0);
- }
- function _emscripten_glCullFace__wrapper(p0) {
- p0 = p0|0; _emscripten_glCullFace(p0|0);
- }
- function _emscripten_glClear__wrapper(p0) {
- p0 = p0|0; _emscripten_glClear(p0|0);
- }
- function _emscripten_glClearStencil__wrapper(p0) {
- p0 = p0|0; _emscripten_glClearStencil(p0|0);
- }
- function _emscripten_glDepthMask__wrapper(p0) {
- p0 = p0|0; _emscripten_glDepthMask(p0|0);
- }
- function _emscripten_glStencilMask__wrapper(p0) {
- p0 = p0|0; _emscripten_glStencilMask(p0|0);
- }
- function _emscripten_glGenerateMipmap__wrapper(p0) {
- p0 = p0|0; _emscripten_glGenerateMipmap(p0|0);
- }
- function _emscripten_glActiveTexture__wrapper(p0) {
- p0 = p0|0; _emscripten_glActiveTexture(p0|0);
- }
- function _emscripten_glBlendEquation__wrapper(p0) {
- p0 = p0|0; _emscripten_glBlendEquation(p0|0);
- }
- function b4(p0,p1) {
- p0 = p0|0;p1 = p1|0; nullFunc_vii(4);
- }
- function _emscripten_glPixelStorei__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glPixelStorei(p0|0,p1|0);
- }
- function _emscripten_glGetIntegerv__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glGetIntegerv(p0|0,p1|0);
- }
- function _emscripten_glGetFloatv__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glGetFloatv(p0|0,p1|0);
- }
- function _emscripten_glGetBooleanv__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glGetBooleanv(p0|0,p1|0);
- }
- function _emscripten_glGenTextures__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glGenTextures(p0|0,p1|0);
- }
- function _emscripten_glDeleteTextures__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glDeleteTextures(p0|0,p1|0);
- }
- function _emscripten_glBindTexture__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glBindTexture(p0|0,p1|0);
- }
- function _emscripten_glGenBuffers__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glGenBuffers(p0|0,p1|0);
- }
- function _emscripten_glDeleteBuffers__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glDeleteBuffers(p0|0,p1|0);
- }
- function _emscripten_glGenRenderbuffers__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glGenRenderbuffers(p0|0,p1|0);
- }
- function _emscripten_glDeleteRenderbuffers__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glDeleteRenderbuffers(p0|0,p1|0);
- }
- function _emscripten_glBindRenderbuffer__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glBindRenderbuffer(p0|0,p1|0);
- }
- function _emscripten_glUniform1i__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glUniform1i(p0|0,p1|0);
- }
- function _emscripten_glBindBuffer__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glBindBuffer(p0|0,p1|0);
- }
- function _emscripten_glVertexAttrib1fv__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glVertexAttrib1fv(p0|0,p1|0);
- }
- function _emscripten_glVertexAttrib2fv__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glVertexAttrib2fv(p0|0,p1|0);
- }
- function _emscripten_glVertexAttrib3fv__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glVertexAttrib3fv(p0|0,p1|0);
- }
- function _emscripten_glVertexAttrib4fv__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glVertexAttrib4fv(p0|0,p1|0);
- }
- function _emscripten_glAttachShader__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glAttachShader(p0|0,p1|0);
- }
- function _emscripten_glDetachShader__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glDetachShader(p0|0,p1|0);
- }
- function _emscripten_glBindFramebuffer__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glBindFramebuffer(p0|0,p1|0);
- }
- function _emscripten_glGenFramebuffers__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glGenFramebuffers(p0|0,p1|0);
- }
- function _emscripten_glDeleteFramebuffers__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glDeleteFramebuffers(p0|0,p1|0);
- }
- function _emscripten_glBindProgramARB__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glBindProgramARB(p0|0,p1|0);
- }
- function _emscripten_glGetPointerv__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glGetPointerv(p0|0,p1|0);
- }
- function _emscripten_glGenVertexArrays__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glGenVertexArrays(p0|0,p1|0);
- }
- function _emscripten_glDeleteVertexArrays__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glDeleteVertexArrays(p0|0,p1|0);
- }
- function _emscripten_glVertexAttribDivisor__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glVertexAttribDivisor(p0|0,p1|0);
- }
- function _emscripten_glBlendFunc__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glBlendFunc(p0|0,p1|0);
- }
- function _emscripten_glBlendEquationSeparate__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glBlendEquationSeparate(p0|0,p1|0);
- }
- function _emscripten_glStencilMaskSeparate__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glStencilMaskSeparate(p0|0,p1|0);
- }
- function _emscripten_glHint__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glHint(p0|0,p1|0);
- }
- function _emscripten_glDrawBuffers__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; _emscripten_glDrawBuffers(p0|0,p1|0);
- }
- function b5(p0) {
- p0 = p0|0; nullFunc_ii(5);return 0;
- }
- function _emscripten_glGetString__wrapper(p0) {
- p0 = p0|0; return _emscripten_glGetString(p0|0)|0;
- }
- function _emscripten_glIsTexture__wrapper(p0) {
- p0 = p0|0; return _emscripten_glIsTexture(p0|0)|0;
- }
- function _emscripten_glIsBuffer__wrapper(p0) {
- p0 = p0|0; return _emscripten_glIsBuffer(p0|0)|0;
- }
- function _emscripten_glIsRenderbuffer__wrapper(p0) {
- p0 = p0|0; return _emscripten_glIsRenderbuffer(p0|0)|0;
- }
- function _emscripten_glCreateShader__wrapper(p0) {
- p0 = p0|0; return _emscripten_glCreateShader(p0|0)|0;
- }
- function _emscripten_glIsShader__wrapper(p0) {
- p0 = p0|0; return _emscripten_glIsShader(p0|0)|0;
- }
- function _emscripten_glIsProgram__wrapper(p0) {
- p0 = p0|0; return _emscripten_glIsProgram(p0|0)|0;
- }
- function _emscripten_glIsFramebuffer__wrapper(p0) {
- p0 = p0|0; return _emscripten_glIsFramebuffer(p0|0)|0;
- }
- function _emscripten_glCheckFramebufferStatus__wrapper(p0) {
- p0 = p0|0; return _emscripten_glCheckFramebufferStatus(p0|0)|0;
- }
- function _emscripten_glIsEnabled__wrapper(p0) {
- p0 = p0|0; return _emscripten_glIsEnabled(p0|0)|0;
- }
- function b6(p0,p1,p2,p3) {
- p0 = p0|0;p1 = +p1;p2 = +p2;p3 = +p3; nullFunc_viddd(6);
- }
- function _emscripten_glUniform3f__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = +p1;p2 = +p2;p3 = +p3; _emscripten_glUniform3f(p0|0,+p1,+p2,+p3);
- }
- function _emscripten_glVertexAttrib3f__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = +p1;p2 = +p2;p3 = +p3; _emscripten_glVertexAttrib3f(p0|0,+p1,+p2,+p3);
- }
- function b7(p0,p1,p2) {
- p0 = p0|0;p1 = +p1;p2 = +p2; nullFunc_vidd(7);
- }
- function _emscripten_glUniform2f__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = +p1;p2 = +p2; _emscripten_glUniform2f(p0|0,+p1,+p2);
- }
- function _emscripten_glVertexAttrib2f__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = +p1;p2 = +p2; _emscripten_glVertexAttrib2f(p0|0,+p1,+p2);
- }
- function b8(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; nullFunc_iiii(8);return 0;
- }
- function b9(p0,p1,p2,p3,p4,p5,p6,p7) {
- 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);
- }
- function _emscripten_glCompressedTexImage2D__wrapper(p0,p1,p2,p3,p4,p5,p6,p7) {
- 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);
- }
- function _emscripten_glCopyTexImage2D__wrapper(p0,p1,p2,p3,p4,p5,p6,p7) {
- 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);
- }
- function _emscripten_glCopyTexSubImage2D__wrapper(p0,p1,p2,p3,p4,p5,p6,p7) {
- 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);
- }
- function b10(p0,p1,p2,p3,p4,p5) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0;p5 = p5|0; nullFunc_viiiiii(10);
- }
- function _emscripten_glDrawRangeElements__wrapper(p0,p1,p2,p3,p4,p5) {
- 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);
- }
- function _emscripten_glVertexAttribPointer__wrapper(p0,p1,p2,p3,p4,p5) {
- 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);
- }
- function b11(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; nullFunc_viii(11);
- }
- function _emscripten_glGetTexParameterfv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetTexParameterfv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glGetTexParameteriv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetTexParameteriv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glTexParameterfv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glTexParameterfv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glTexParameteriv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glTexParameteriv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glGetBufferParameteriv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetBufferParameteriv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glGetRenderbufferParameteriv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetRenderbufferParameteriv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glGetUniformfv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetUniformfv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glGetUniformiv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetUniformiv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glGetVertexAttribfv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetVertexAttribfv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glGetVertexAttribiv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetVertexAttribiv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glGetVertexAttribPointerv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetVertexAttribPointerv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glUniform2i__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform2i(p0|0,p1|0,p2|0);
- }
- function _emscripten_glUniform1iv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform1iv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glUniform2iv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform2iv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glUniform3iv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform3iv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glUniform4iv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform4iv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glUniform1fv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform1fv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glUniform2fv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform2fv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glUniform3fv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform3fv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glUniform4fv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glUniform4fv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glGetShaderiv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetShaderiv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glGetProgramiv__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetProgramiv(p0|0,p1|0,p2|0);
- }
- function _emscripten_glBindAttribLocation__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glBindAttribLocation(p0|0,p1|0,p2|0);
- }
- function _emscripten_glGetObjectParameterivARB__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glGetObjectParameterivARB(p0|0,p1|0,p2|0);
- }
- function _emscripten_glNormalPointer__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glNormalPointer(p0|0,p1|0,p2|0);
- }
- function _emscripten_glDrawArrays__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glDrawArrays(p0|0,p1|0,p2|0);
- }
- function _emscripten_glTexParameteri__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glTexParameteri(p0|0,p1|0,p2|0);
- }
- function _emscripten_glStencilFunc__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glStencilFunc(p0|0,p1|0,p2|0);
- }
- function _emscripten_glStencilOp__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0; _emscripten_glStencilOp(p0|0,p1|0,p2|0);
- }
- function b12(p0,p1,p2,p3,p4) {
- p0 = p0|0;p1 = +p1;p2 = +p2;p3 = +p3;p4 = +p4; nullFunc_vidddd(12);
- }
- function _emscripten_glUniform4f__wrapper(p0,p1,p2,p3,p4) {
- p0 = p0|0;p1 = +p1;p2 = +p2;p3 = +p3;p4 = +p4; _emscripten_glUniform4f(p0|0,+p1,+p2,+p3,+p4);
- }
- function _emscripten_glVertexAttrib4f__wrapper(p0,p1,p2,p3,p4) {
- p0 = p0|0;p1 = +p1;p2 = +p2;p3 = +p3;p4 = +p4; _emscripten_glVertexAttrib4f(p0|0,+p1,+p2,+p3,+p4);
- }
- function b13(p0,p1) {
- p0 = +p0;p1 = p1|0; nullFunc_vdi(13);
- }
- function _emscripten_glSampleCoverage__wrapper(p0,p1) {
- p0 = +p0;p1 = p1|0; _emscripten_glSampleCoverage(+p0,p1|0);
- }
- function b14(p0,p1,p2,p3,p4,p5,p6) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0;p4 = p4|0;p5 = p5|0;p6 = p6|0; nullFunc_viiiiiii(14);
- }
- function _emscripten_glReadPixels__wrapper(p0,p1,p2,p3,p4,p5,p6) {
- 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);
- }
- function _emscripten_glGetActiveUniform__wrapper(p0,p1,p2,p3,p4,p5,p6) {
- 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);
- }
- function _emscripten_glGetActiveAttrib__wrapper(p0,p1,p2,p3,p4,p5,p6) {
- 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);
- }
- function b15(p0,p1,p2,p3,p4,p5,p6,p7,p8) {
- 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);
- }
- function _emscripten_glCompressedTexSubImage2D__wrapper(p0,p1,p2,p3,p4,p5,p6,p7,p8) {
- 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);
- }
- function _emscripten_glTexImage2D__wrapper(p0,p1,p2,p3,p4,p5,p6,p7,p8) {
- 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);
- }
- function _emscripten_glTexSubImage2D__wrapper(p0,p1,p2,p3,p4,p5,p6,p7,p8) {
- 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);
- }
- function b16(p0,p1) {
- p0 = p0|0;p1 = p1|0; nullFunc_iii(16);return 0;
- }
- function _emscripten_glGetUniformLocation__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; return _emscripten_glGetUniformLocation(p0|0,p1|0)|0;
- }
- function _emscripten_glGetAttribLocation__wrapper(p0,p1) {
- p0 = p0|0;p1 = p1|0; return _emscripten_glGetAttribLocation(p0|0,p1|0)|0;
- }
- function b17() {
- ; nullFunc_i(17);return 0;
- }
- function _emscripten_glCreateProgram__wrapper() {
- ; return _emscripten_glCreateProgram()|0;
- }
- function _emscripten_glGetError__wrapper() {
- ; return _emscripten_glGetError()|0;
- }
- function b18(p0,p1,p2,p3,p4,p5) {
- p0 = +p0;p1 = +p1;p2 = +p2;p3 = +p3;p4 = +p4;p5 = +p5; nullFunc_vdddddd(18);
- }
- function _emscripten_glFrustum__wrapper(p0,p1,p2,p3,p4,p5) {
- p0 = +p0;p1 = +p1;p2 = +p2;p3 = +p3;p4 = +p4;p5 = +p5; _emscripten_glFrustum(+p0,+p1,+p2,+p3,+p4,+p5);
- }
- function b19(p0,p1,p2,p3) {
- p0 = +p0;p1 = +p1;p2 = +p2;p3 = +p3; nullFunc_vdddd(19);
- }
- function _emscripten_glRotatef__wrapper(p0,p1,p2,p3) {
- p0 = +p0;p1 = +p1;p2 = +p2;p3 = +p3; _emscripten_glRotatef(+p0,+p1,+p2,+p3);
- }
- function _emscripten_glClearColor__wrapper(p0,p1,p2,p3) {
- p0 = +p0;p1 = +p1;p2 = +p2;p3 = +p3; _emscripten_glClearColor(+p0,+p1,+p2,+p3);
- }
- function _emscripten_glBlendColor__wrapper(p0,p1,p2,p3) {
- p0 = +p0;p1 = +p1;p2 = +p2;p3 = +p3; _emscripten_glBlendColor(+p0,+p1,+p2,+p3);
- }
- function b20(p0,p1) {
- p0 = +p0;p1 = +p1; nullFunc_vdd(20);
- }
- function _emscripten_glDepthRange__wrapper(p0,p1) {
- p0 = +p0;p1 = +p1; _emscripten_glDepthRange(+p0,+p1);
- }
- function _emscripten_glDepthRangef__wrapper(p0,p1) {
- p0 = +p0;p1 = +p1; _emscripten_glDepthRangef(+p0,+p1);
- }
- function _emscripten_glPolygonOffset__wrapper(p0,p1) {
- p0 = +p0;p1 = +p1; _emscripten_glPolygonOffset(+p0,+p1);
- }
- function b21() {
- ; nullFunc_v(21);
- }
- function _emscripten_glLoadIdentity__wrapper() {
- ; _emscripten_glLoadIdentity();
- }
- function _emscripten_glReleaseShaderCompiler__wrapper() {
- ; _emscripten_glReleaseShaderCompiler();
- }
- function _emscripten_glFinish__wrapper() {
- ; _emscripten_glFinish();
- }
- function _emscripten_glFlush__wrapper() {
- ; _emscripten_glFlush();
- }
- function b22(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = +p2; nullFunc_viid(22);
- }
- function _emscripten_glTexParameterf__wrapper(p0,p1,p2) {
- p0 = p0|0;p1 = p1|0;p2 = +p2; _emscripten_glTexParameterf(p0|0,p1|0,+p2);
- }
- function b23(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; nullFunc_viiii(23);
- }
- function _emscripten_glBufferData__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glBufferData(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glBufferSubData__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glBufferSubData(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glUniform3i__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glUniform3i(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glUniformMatrix2fv__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glUniformMatrix2fv(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glUniformMatrix3fv__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glUniformMatrix3fv(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glUniformMatrix4fv__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glUniformMatrix4fv(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glGetAttachedShaders__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetAttachedShaders(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glShaderSource__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glShaderSource(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glGetShaderSource__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetShaderSource(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glGetShaderInfoLog__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetShaderInfoLog(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glGetShaderPrecisionFormat__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetShaderPrecisionFormat(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glGetProgramInfoLog__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetProgramInfoLog(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glFramebufferRenderbuffer__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glFramebufferRenderbuffer(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glGetFramebufferAttachmentParameteriv__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetFramebufferAttachmentParameteriv(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glGetInfoLogARB__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glGetInfoLogARB(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glVertexPointer__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glVertexPointer(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glTexCoordPointer__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glTexCoordPointer(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glColorPointer__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glColorPointer(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glDrawElements__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glDrawElements(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glDrawArraysInstanced__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glDrawArraysInstanced(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glViewport__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glViewport(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glScissor__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glScissor(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glColorMask__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glColorMask(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glRenderbufferStorage__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glRenderbufferStorage(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glBlendFuncSeparate__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glBlendFuncSeparate(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glStencilFuncSeparate__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glStencilFuncSeparate(p0|0,p1|0,p2|0,p3|0);
- }
- function _emscripten_glStencilOpSeparate__wrapper(p0,p1,p2,p3) {
- p0 = p0|0;p1 = p1|0;p2 = p2|0;p3 = p3|0; _emscripten_glStencilOpSeparate(p0|0,p1|0,p2|0,p3|0);
- }
- // EMSCRIPTEN_END_FUNCS
- var FUNCTION_TABLE_viiiii = [b0,_KeyCallback,_emscripten_glUniform4i__wrapper,_emscripten_glFramebufferTexture2D__wrapper,_emscripten_glShaderBinary__wrapper,_emscripten_glDrawElementsInstanced__wrapper,b0,b0];
- var FUNCTION_TABLE_vd = [b1,_emscripten_glClearDepth__wrapper,_emscripten_glClearDepthf__wrapper,_emscripten_glLineWidth__wrapper];
- var FUNCTION_TABLE_vid = [b2,_emscripten_glUniform1f__wrapper,_emscripten_glVertexAttrib1f__wrapper,b2];
- 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
- ,b3,b3,b3];
- 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
- ,b4,b4,b4,b4,b4];
- 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];
- var FUNCTION_TABLE_viddd = [b6,_emscripten_glUniform3f__wrapper,_emscripten_glVertexAttrib3f__wrapper,b6];
- var FUNCTION_TABLE_vidd = [b7,_MouseCursorPosCallback,_ScrollCallback,_emscripten_glUniform2f__wrapper,_emscripten_glVertexAttrib2f__wrapper,b7,b7,b7];
- var FUNCTION_TABLE_iiii = [b8,___stdout_write,___stdio_seek,_sn_write,_EmscriptenFullscreenChangeCallback,_EmscriptenKeyboardCallback,_EmscriptenMouseCallback,_EmscriptenTouchCallback,_EmscriptenGamepadCallback,___stdio_write,b8,b8,b8,b8,b8,b8];
- var FUNCTION_TABLE_viiiiiiii = [b9,_emscripten_glCompressedTexImage2D__wrapper,_emscripten_glCopyTexImage2D__wrapper,_emscripten_glCopyTexSubImage2D__wrapper];
- var FUNCTION_TABLE_viiiiii = [b10,_emscripten_glDrawRangeElements__wrapper,_emscripten_glVertexAttribPointer__wrapper,b10];
- 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];
- var FUNCTION_TABLE_vidddd = [b12,_emscripten_glUniform4f__wrapper,_emscripten_glVertexAttrib4f__wrapper,b12];
- var FUNCTION_TABLE_vdi = [b13,_emscripten_glSampleCoverage__wrapper];
- var FUNCTION_TABLE_viiiiiii = [b14,_emscripten_glReadPixels__wrapper,_emscripten_glGetActiveUniform__wrapper,_emscripten_glGetActiveAttrib__wrapper];
- var FUNCTION_TABLE_viiiiiiiii = [b15,_emscripten_glCompressedTexSubImage2D__wrapper,_emscripten_glTexImage2D__wrapper,_emscripten_glTexSubImage2D__wrapper];
- var FUNCTION_TABLE_iii = [b16,_emscripten_glGetUniformLocation__wrapper,_emscripten_glGetAttribLocation__wrapper,b16];
- var FUNCTION_TABLE_i = [b17,_emscripten_glCreateProgram__wrapper,_emscripten_glGetError__wrapper,b17];
- var FUNCTION_TABLE_vdddddd = [b18,_emscripten_glFrustum__wrapper];
- var FUNCTION_TABLE_vdddd = [b19,_emscripten_glRotatef__wrapper,_emscripten_glClearColor__wrapper,_emscripten_glBlendColor__wrapper];
- var FUNCTION_TABLE_vdd = [b20,_emscripten_glDepthRange__wrapper,_emscripten_glDepthRangef__wrapper,_emscripten_glPolygonOffset__wrapper];
- var FUNCTION_TABLE_v = [b21,_UpdateDrawFrame,_emscripten_glLoadIdentity__wrapper,_emscripten_glReleaseShaderCompiler__wrapper,_emscripten_glFinish__wrapper,_emscripten_glFlush__wrapper,b21,b21];
- var FUNCTION_TABLE_viid = [b22,_emscripten_glTexParameterf__wrapper];
- 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];
- 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 };
- })
- // EMSCRIPTEN_END_ASM
- (Module.asmGlobalArg, Module.asmLibraryArg, buffer);
- var real___emscripten_atomic_fetch_and_xor_u64 = asm["__emscripten_atomic_fetch_and_xor_u64"]; asm["__emscripten_atomic_fetch_and_xor_u64"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real___emscripten_atomic_fetch_and_xor_u64.apply(null, arguments);
- };
- var real__roundf = asm["_roundf"]; asm["_roundf"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__roundf.apply(null, arguments);
- };
- var real__bitshift64Shl = asm["_bitshift64Shl"]; asm["_bitshift64Shl"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__bitshift64Shl.apply(null, arguments);
- };
- var real__emscripten_atomic_load_f32 = asm["_emscripten_atomic_load_f32"]; asm["_emscripten_atomic_load_f32"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_atomic_load_f32.apply(null, arguments);
- };
- var real____emscripten_pthread_data_constructor = asm["___emscripten_pthread_data_constructor"]; asm["___emscripten_pthread_data_constructor"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real____emscripten_pthread_data_constructor.apply(null, arguments);
- };
- var real_stackSave = asm["stackSave"]; asm["stackSave"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real_stackSave.apply(null, arguments);
- };
- var real__emscripten_atomic_xor_u64 = asm["_emscripten_atomic_xor_u64"]; asm["_emscripten_atomic_xor_u64"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_atomic_xor_u64.apply(null, arguments);
- };
- var real__emscripten_atomic_load_u64 = asm["_emscripten_atomic_load_u64"]; asm["_emscripten_atomic_load_u64"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_atomic_load_u64.apply(null, arguments);
- };
- var real____udivdi3 = asm["___udivdi3"]; asm["___udivdi3"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real____udivdi3.apply(null, arguments);
- };
- var real__bitshift64Lshr = asm["_bitshift64Lshr"]; asm["_bitshift64Lshr"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__bitshift64Lshr.apply(null, arguments);
- };
- var real_getTempRet0 = asm["getTempRet0"]; asm["getTempRet0"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real_getTempRet0.apply(null, arguments);
- };
- var real__emscripten_atomic_and_u64 = asm["_emscripten_atomic_and_u64"]; asm["_emscripten_atomic_and_u64"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_atomic_and_u64.apply(null, arguments);
- };
- var real__emscripten_sync_run_in_main_thread = asm["_emscripten_sync_run_in_main_thread"]; asm["_emscripten_sync_run_in_main_thread"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_sync_run_in_main_thread.apply(null, arguments);
- };
- 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() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_sync_run_in_main_thread_4.apply(null, arguments);
- };
- 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() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_sync_run_in_main_thread_5.apply(null, arguments);
- };
- 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() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_sync_run_in_main_thread_6.apply(null, arguments);
- };
- 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() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_sync_run_in_main_thread_7.apply(null, arguments);
- };
- 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() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_sync_run_in_main_thread_0.apply(null, arguments);
- };
- 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() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_sync_run_in_main_thread_1.apply(null, arguments);
- };
- 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() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_sync_run_in_main_thread_2.apply(null, arguments);
- };
- var real___emscripten_atomic_fetch_and_sub_u64 = asm["__emscripten_atomic_fetch_and_sub_u64"]; asm["__emscripten_atomic_fetch_and_sub_u64"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real___emscripten_atomic_fetch_and_sub_u64.apply(null, arguments);
- };
- var real__emscripten_atomic_exchange_u32 = asm["_emscripten_atomic_exchange_u32"]; asm["_emscripten_atomic_exchange_u32"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_atomic_exchange_u32.apply(null, arguments);
- };
- var real__fflush = asm["_fflush"]; asm["_fflush"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__fflush.apply(null, arguments);
- };
- var real__emscripten_set_current_thread_status = asm["_emscripten_set_current_thread_status"]; asm["_emscripten_set_current_thread_status"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_set_current_thread_status.apply(null, arguments);
- };
- var real__emscripten_atomic_cas_u64 = asm["_emscripten_atomic_cas_u64"]; asm["_emscripten_atomic_cas_u64"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_atomic_cas_u64.apply(null, arguments);
- };
- var real__llvm_cttz_i32 = asm["_llvm_cttz_i32"]; asm["_llvm_cttz_i32"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__llvm_cttz_i32.apply(null, arguments);
- };
- var real__emscripten_atomic_sub_u64 = asm["_emscripten_atomic_sub_u64"]; asm["_emscripten_atomic_sub_u64"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_atomic_sub_u64.apply(null, arguments);
- };
- var real__main = asm["_main"]; asm["_main"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__main.apply(null, arguments);
- };
- 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() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_sync_run_in_main_thread_xprintf_varargs.apply(null, arguments);
- };
- var real____errno_location = asm["___errno_location"]; asm["___errno_location"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real____errno_location.apply(null, arguments);
- };
- var real____muldi3 = asm["___muldi3"]; asm["___muldi3"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real____muldi3.apply(null, arguments);
- };
- var real___emscripten_atomic_fetch_and_and_u64 = asm["__emscripten_atomic_fetch_and_and_u64"]; asm["__emscripten_atomic_fetch_and_and_u64"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real___emscripten_atomic_fetch_and_and_u64.apply(null, arguments);
- };
- 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() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_sync_run_in_main_thread_3.apply(null, arguments);
- };
- var real____uremdi3 = asm["___uremdi3"]; asm["___uremdi3"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real____uremdi3.apply(null, arguments);
- };
- var real_stackAlloc = asm["stackAlloc"]; asm["stackAlloc"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real_stackAlloc.apply(null, arguments);
- };
- var real__i64Subtract = asm["_i64Subtract"]; asm["_i64Subtract"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__i64Subtract.apply(null, arguments);
- };
- var real_setTempRet0 = asm["setTempRet0"]; asm["setTempRet0"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real_setTempRet0.apply(null, arguments);
- };
- var real__i64Add = asm["_i64Add"]; asm["_i64Add"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__i64Add.apply(null, arguments);
- };
- var real__emscripten_atomic_store_u64 = asm["_emscripten_atomic_store_u64"]; asm["_emscripten_atomic_store_u64"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_atomic_store_u64.apply(null, arguments);
- };
- var real__emscripten_atomic_load_f64 = asm["_emscripten_atomic_load_f64"]; asm["_emscripten_atomic_load_f64"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_atomic_load_f64.apply(null, arguments);
- };
- var real__emscripten_get_global_libc = asm["_emscripten_get_global_libc"]; asm["_emscripten_get_global_libc"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_get_global_libc.apply(null, arguments);
- };
- var real___emscripten_atomic_fetch_and_add_u64 = asm["__emscripten_atomic_fetch_and_add_u64"]; asm["__emscripten_atomic_fetch_and_add_u64"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real___emscripten_atomic_fetch_and_add_u64.apply(null, arguments);
- };
- var real___emscripten_atomic_fetch_and_or_u64 = asm["__emscripten_atomic_fetch_and_or_u64"]; asm["__emscripten_atomic_fetch_and_or_u64"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real___emscripten_atomic_fetch_and_or_u64.apply(null, arguments);
- };
- var real__emscripten_GetProcAddress = asm["_emscripten_GetProcAddress"]; asm["_emscripten_GetProcAddress"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_GetProcAddress.apply(null, arguments);
- };
- var real__emscripten_async_run_in_main_thread = asm["_emscripten_async_run_in_main_thread"]; asm["_emscripten_async_run_in_main_thread"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_async_run_in_main_thread.apply(null, arguments);
- };
- var real__llvm_bswap_i32 = asm["_llvm_bswap_i32"]; asm["_llvm_bswap_i32"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__llvm_bswap_i32.apply(null, arguments);
- };
- var real____muldsi3 = asm["___muldsi3"]; asm["___muldsi3"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real____muldsi3.apply(null, arguments);
- };
- var real__emscripten_main_thread_process_queued_calls = asm["_emscripten_main_thread_process_queued_calls"]; asm["_emscripten_main_thread_process_queued_calls"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_main_thread_process_queued_calls.apply(null, arguments);
- };
- var real__emscripten_atomic_add_u64 = asm["_emscripten_atomic_add_u64"]; asm["_emscripten_atomic_add_u64"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_atomic_add_u64.apply(null, arguments);
- };
- var real__free = asm["_free"]; asm["_free"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__free.apply(null, arguments);
- };
- var real__emscripten_atomic_store_f32 = asm["_emscripten_atomic_store_f32"]; asm["_emscripten_atomic_store_f32"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_atomic_store_f32.apply(null, arguments);
- };
- var real_setThrew = asm["setThrew"]; asm["setThrew"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real_setThrew.apply(null, arguments);
- };
- var real__emscripten_atomic_exchange_u64 = asm["_emscripten_atomic_exchange_u64"]; asm["_emscripten_atomic_exchange_u64"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_atomic_exchange_u64.apply(null, arguments);
- };
- var real__emscripten_atomic_store_f64 = asm["_emscripten_atomic_store_f64"]; asm["_emscripten_atomic_store_f64"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_atomic_store_f64.apply(null, arguments);
- };
- var real____pthread_tsd_run_dtors = asm["___pthread_tsd_run_dtors"]; asm["___pthread_tsd_run_dtors"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real____pthread_tsd_run_dtors.apply(null, arguments);
- };
- var real_stackRestore = asm["stackRestore"]; asm["stackRestore"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real_stackRestore.apply(null, arguments);
- };
- var real____udivmoddi4 = asm["___udivmoddi4"]; asm["___udivmoddi4"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real____udivmoddi4.apply(null, arguments);
- };
- var real__malloc = asm["_malloc"]; asm["_malloc"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__malloc.apply(null, arguments);
- };
- var real_establishStackSpace = asm["establishStackSpace"]; asm["establishStackSpace"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real_establishStackSpace.apply(null, arguments);
- };
- var real__emscripten_conditional_set_current_thread_status = asm["_emscripten_conditional_set_current_thread_status"]; asm["_emscripten_conditional_set_current_thread_status"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_conditional_set_current_thread_status.apply(null, arguments);
- };
- var real__sbrk = asm["_sbrk"]; asm["_sbrk"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__sbrk.apply(null, arguments);
- };
- var real__memmove = asm["_memmove"]; asm["_memmove"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__memmove.apply(null, arguments);
- };
- var real__emscripten_atomic_or_u64 = asm["_emscripten_atomic_or_u64"]; asm["_emscripten_atomic_or_u64"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__emscripten_atomic_or_u64.apply(null, arguments);
- };
- var real__strstr = asm["_strstr"]; asm["_strstr"] = function() {
- assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
- assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
- return real__strstr.apply(null, arguments);
- };
- var __emscripten_atomic_fetch_and_xor_u64 = Module["__emscripten_atomic_fetch_and_xor_u64"] = asm["__emscripten_atomic_fetch_and_xor_u64"];
- var _roundf = Module["_roundf"] = asm["_roundf"];
- var _bitshift64Shl = Module["_bitshift64Shl"] = asm["_bitshift64Shl"];
- var _emscripten_atomic_load_f32 = Module["_emscripten_atomic_load_f32"] = asm["_emscripten_atomic_load_f32"];
- var ___emscripten_pthread_data_constructor = Module["___emscripten_pthread_data_constructor"] = asm["___emscripten_pthread_data_constructor"];
- var stackSave = Module["stackSave"] = asm["stackSave"];
- var _emscripten_atomic_xor_u64 = Module["_emscripten_atomic_xor_u64"] = asm["_emscripten_atomic_xor_u64"];
- var _emscripten_atomic_load_u64 = Module["_emscripten_atomic_load_u64"] = asm["_emscripten_atomic_load_u64"];
- var ___udivdi3 = Module["___udivdi3"] = asm["___udivdi3"];
- var _bitshift64Lshr = Module["_bitshift64Lshr"] = asm["_bitshift64Lshr"];
- var getTempRet0 = Module["getTempRet0"] = asm["getTempRet0"];
- var _emscripten_atomic_and_u64 = Module["_emscripten_atomic_and_u64"] = asm["_emscripten_atomic_and_u64"];
- var _emscripten_sync_run_in_main_thread = Module["_emscripten_sync_run_in_main_thread"] = asm["_emscripten_sync_run_in_main_thread"];
- var _emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = asm["_emscripten_sync_run_in_main_thread_4"];
- var _emscripten_sync_run_in_main_thread_5 = Module["_emscripten_sync_run_in_main_thread_5"] = asm["_emscripten_sync_run_in_main_thread_5"];
- var _emscripten_sync_run_in_main_thread_6 = Module["_emscripten_sync_run_in_main_thread_6"] = asm["_emscripten_sync_run_in_main_thread_6"];
- var _emscripten_sync_run_in_main_thread_7 = Module["_emscripten_sync_run_in_main_thread_7"] = asm["_emscripten_sync_run_in_main_thread_7"];
- var _emscripten_sync_run_in_main_thread_0 = Module["_emscripten_sync_run_in_main_thread_0"] = asm["_emscripten_sync_run_in_main_thread_0"];
- var _emscripten_sync_run_in_main_thread_1 = Module["_emscripten_sync_run_in_main_thread_1"] = asm["_emscripten_sync_run_in_main_thread_1"];
- var _emscripten_sync_run_in_main_thread_2 = Module["_emscripten_sync_run_in_main_thread_2"] = asm["_emscripten_sync_run_in_main_thread_2"];
- var __emscripten_atomic_fetch_and_sub_u64 = Module["__emscripten_atomic_fetch_and_sub_u64"] = asm["__emscripten_atomic_fetch_and_sub_u64"];
- var _emscripten_atomic_exchange_u32 = Module["_emscripten_atomic_exchange_u32"] = asm["_emscripten_atomic_exchange_u32"];
- var _fflush = Module["_fflush"] = asm["_fflush"];
- var _emscripten_set_current_thread_status = Module["_emscripten_set_current_thread_status"] = asm["_emscripten_set_current_thread_status"];
- var _emscripten_atomic_cas_u64 = Module["_emscripten_atomic_cas_u64"] = asm["_emscripten_atomic_cas_u64"];
- var _llvm_cttz_i32 = Module["_llvm_cttz_i32"] = asm["_llvm_cttz_i32"];
- var _emscripten_atomic_sub_u64 = Module["_emscripten_atomic_sub_u64"] = asm["_emscripten_atomic_sub_u64"];
- var _main = Module["_main"] = asm["_main"];
- 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"];
- var _memcpy = Module["_memcpy"] = asm["_memcpy"];
- var ___errno_location = Module["___errno_location"] = asm["___errno_location"];
- var ___muldi3 = Module["___muldi3"] = asm["___muldi3"];
- var __emscripten_atomic_fetch_and_and_u64 = Module["__emscripten_atomic_fetch_and_and_u64"] = asm["__emscripten_atomic_fetch_and_and_u64"];
- var _emscripten_sync_run_in_main_thread_3 = Module["_emscripten_sync_run_in_main_thread_3"] = asm["_emscripten_sync_run_in_main_thread_3"];
- var ___uremdi3 = Module["___uremdi3"] = asm["___uremdi3"];
- var stackAlloc = Module["stackAlloc"] = asm["stackAlloc"];
- var _i64Subtract = Module["_i64Subtract"] = asm["_i64Subtract"];
- var _memset = Module["_memset"] = asm["_memset"];
- var setTempRet0 = Module["setTempRet0"] = asm["setTempRet0"];
- var _i64Add = Module["_i64Add"] = asm["_i64Add"];
- var _emscripten_atomic_store_u64 = Module["_emscripten_atomic_store_u64"] = asm["_emscripten_atomic_store_u64"];
- var _emscripten_atomic_load_f64 = Module["_emscripten_atomic_load_f64"] = asm["_emscripten_atomic_load_f64"];
- var _emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = asm["_emscripten_get_global_libc"];
- var __emscripten_atomic_fetch_and_add_u64 = Module["__emscripten_atomic_fetch_and_add_u64"] = asm["__emscripten_atomic_fetch_and_add_u64"];
- var __emscripten_atomic_fetch_and_or_u64 = Module["__emscripten_atomic_fetch_and_or_u64"] = asm["__emscripten_atomic_fetch_and_or_u64"];
- var _emscripten_GetProcAddress = Module["_emscripten_GetProcAddress"] = asm["_emscripten_GetProcAddress"];
- var _emscripten_async_run_in_main_thread = Module["_emscripten_async_run_in_main_thread"] = asm["_emscripten_async_run_in_main_thread"];
- var _llvm_bswap_i32 = Module["_llvm_bswap_i32"] = asm["_llvm_bswap_i32"];
- var runPostSets = Module["runPostSets"] = asm["runPostSets"];
- var ___muldsi3 = Module["___muldsi3"] = asm["___muldsi3"];
- var _emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = asm["_emscripten_main_thread_process_queued_calls"];
- var _emscripten_atomic_add_u64 = Module["_emscripten_atomic_add_u64"] = asm["_emscripten_atomic_add_u64"];
- var _free = Module["_free"] = asm["_free"];
- var _emscripten_atomic_store_f32 = Module["_emscripten_atomic_store_f32"] = asm["_emscripten_atomic_store_f32"];
- var setThrew = Module["setThrew"] = asm["setThrew"];
- var _emscripten_atomic_exchange_u64 = Module["_emscripten_atomic_exchange_u64"] = asm["_emscripten_atomic_exchange_u64"];
- var _emscripten_atomic_store_f64 = Module["_emscripten_atomic_store_f64"] = asm["_emscripten_atomic_store_f64"];
- var ___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = asm["___pthread_tsd_run_dtors"];
- var stackRestore = Module["stackRestore"] = asm["stackRestore"];
- var ___udivmoddi4 = Module["___udivmoddi4"] = asm["___udivmoddi4"];
- var _malloc = Module["_malloc"] = asm["_malloc"];
- var establishStackSpace = Module["establishStackSpace"] = asm["establishStackSpace"];
- var _emscripten_conditional_set_current_thread_status = Module["_emscripten_conditional_set_current_thread_status"] = asm["_emscripten_conditional_set_current_thread_status"];
- var _sbrk = Module["_sbrk"] = asm["_sbrk"];
- var _memmove = Module["_memmove"] = asm["_memmove"];
- var _emscripten_atomic_or_u64 = Module["_emscripten_atomic_or_u64"] = asm["_emscripten_atomic_or_u64"];
- var _strstr = Module["_strstr"] = asm["_strstr"];
- var dynCall_viiiii = Module["dynCall_viiiii"] = asm["dynCall_viiiii"];
- var dynCall_vd = Module["dynCall_vd"] = asm["dynCall_vd"];
- var dynCall_vid = Module["dynCall_vid"] = asm["dynCall_vid"];
- var dynCall_vi = Module["dynCall_vi"] = asm["dynCall_vi"];
- var dynCall_vii = Module["dynCall_vii"] = asm["dynCall_vii"];
- var dynCall_ii = Module["dynCall_ii"] = asm["dynCall_ii"];
- var dynCall_viddd = Module["dynCall_viddd"] = asm["dynCall_viddd"];
- var dynCall_vidd = Module["dynCall_vidd"] = asm["dynCall_vidd"];
- var dynCall_iiii = Module["dynCall_iiii"] = asm["dynCall_iiii"];
- var dynCall_viiiiiiii = Module["dynCall_viiiiiiii"] = asm["dynCall_viiiiiiii"];
- var dynCall_viiiiii = Module["dynCall_viiiiii"] = asm["dynCall_viiiiii"];
- var dynCall_viii = Module["dynCall_viii"] = asm["dynCall_viii"];
- var dynCall_vidddd = Module["dynCall_vidddd"] = asm["dynCall_vidddd"];
- var dynCall_vdi = Module["dynCall_vdi"] = asm["dynCall_vdi"];
- var dynCall_viiiiiii = Module["dynCall_viiiiiii"] = asm["dynCall_viiiiiii"];
- var dynCall_viiiiiiiii = Module["dynCall_viiiiiiiii"] = asm["dynCall_viiiiiiiii"];
- var dynCall_iii = Module["dynCall_iii"] = asm["dynCall_iii"];
- var dynCall_i = Module["dynCall_i"] = asm["dynCall_i"];
- var dynCall_vdddddd = Module["dynCall_vdddddd"] = asm["dynCall_vdddddd"];
- var dynCall_vdddd = Module["dynCall_vdddd"] = asm["dynCall_vdddd"];
- var dynCall_vdd = Module["dynCall_vdd"] = asm["dynCall_vdd"];
- var dynCall_v = Module["dynCall_v"] = asm["dynCall_v"];
- var dynCall_viid = Module["dynCall_viid"] = asm["dynCall_viid"];
- var dynCall_viiii = Module["dynCall_viiii"] = asm["dynCall_viiii"];
- ;
- Runtime.stackAlloc = Module['stackAlloc'];
- Runtime.stackSave = Module['stackSave'];
- Runtime.stackRestore = Module['stackRestore'];
- Runtime.establishStackSpace = Module['establishStackSpace'];
- Runtime.setTempRet0 = Module['setTempRet0'];
- Runtime.getTempRet0 = Module['getTempRet0'];
- // === Auto-generated postamble setup entry stuff ===
- Module['asm'] = asm;
- function ExitStatus(status) {
- this.name = "ExitStatus";
- this.message = "Program terminated with exit(" + status + ")";
- this.status = status;
- };
- ExitStatus.prototype = new Error();
- ExitStatus.prototype.constructor = ExitStatus;
- var initialStackTop;
- var preloadStartTime = null;
- var calledMain = false;
- dependenciesFulfilled = function runCaller() {
- // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)
- if (!Module['calledRun']) run();
- if (!Module['calledRun']) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled
- }
- Module['callMain'] = Module.callMain = function callMain(args) {
- assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on __ATMAIN__)');
- assert(__ATPRERUN__.length == 0, 'cannot call main when preRun functions remain to be called');
- args = args || [];
- ensureInitRuntime();
- var argc = args.length+1;
- function pad() {
- for (var i = 0; i < 4-1; i++) {
- argv.push(0);
- }
- }
- var argv = [allocate(intArrayFromString(Module['thisProgram']), 'i8', ALLOC_NORMAL) ];
- pad();
- for (var i = 0; i < argc-1; i = i + 1) {
- argv.push(allocate(intArrayFromString(args[i]), 'i8', ALLOC_NORMAL));
- pad();
- }
- argv.push(0);
- argv = allocate(argv, 'i32', ALLOC_NORMAL);
- try {
- var ret = Module['_main'](argc, argv, 0);
- // if we're not running an evented main loop, it's time to exit
- exit(ret, /* implicit = */ true);
- }
- catch(e) {
- if (e instanceof ExitStatus) {
- // exit() throws this once it's done to make sure execution
- // has been stopped completely
- return;
- } else if (e == 'SimulateInfiniteLoop') {
- // running an evented main loop, don't immediately exit
- Module['noExitRuntime'] = true;
- return;
- } else {
- var toLog = e;
- if (e && typeof e === 'object' && e.stack) {
- toLog = [e, e.stack];
- }
- Module.printErr('exception thrown: ' + toLog);
- Module['quit'](1, e);
- }
- } finally {
- calledMain = true;
- }
- }
- function run(args) {
- args = args || Module['arguments'];
- if (preloadStartTime === null) preloadStartTime = Date.now();
- if (runDependencies > 0) {
- Module.printErr('run() called, but dependencies remain, so not running');
- return;
- }
- writeStackCookie();
- preRun();
- if (runDependencies > 0) return; // a preRun added a dependency, run will be called later
- if (Module['calledRun']) return; // run may have just been called through dependencies being fulfilled just in this very frame
- function doRun() {
- if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening
- Module['calledRun'] = true;
- if (ABORT) return;
- ensureInitRuntime();
- preMain();
- if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {
- Module.printErr('pre-main prep time: ' + (Date.now() - preloadStartTime) + ' ms');
- }
- if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();
- if (Module['_main'] && shouldRunNow) Module['callMain'](args);
- postRun();
- }
- if (Module['setStatus']) {
- Module['setStatus']('Running...');
- setTimeout(function() {
- setTimeout(function() {
- Module['setStatus']('');
- }, 1);
- doRun();
- }, 1);
- } else {
- doRun();
- }
- checkStackCookie();
- }
- Module['run'] = Module.run = run;
- function exit(status, implicit) {
- if (implicit && Module['noExitRuntime']) {
- 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)');
- return;
- }
- if (Module['noExitRuntime']) {
- 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)');
- } else {
- PThread.terminateAllThreads();
- ABORT = true;
- EXITSTATUS = status;
- STACKTOP = initialStackTop;
- exitRuntime();
- if (Module['onExit']) Module['onExit'](status);
- }
- if (ENVIRONMENT_IS_NODE) {
- process['exit'](status);
- }
- Module['quit'](status, new ExitStatus(status));
- }
- Module['exit'] = Module.exit = exit;
- var abortDecorators = [];
- function abort(what) {
- if (ENVIRONMENT_IS_PTHREAD) console.error('Pthread aborting at ' + new Error().stack);
- if (what !== undefined) {
- Module.print(what);
- Module.printErr(what);
- what = JSON.stringify(what)
- } else {
- what = '';
- }
- ABORT = true;
- EXITSTATUS = 1;
- var extra = '';
- var output = 'abort(' + what + ') at ' + stackTrace() + extra;
- if (abortDecorators) {
- abortDecorators.forEach(function(decorator) {
- output = decorator(output, what);
- });
- }
- throw output;
- }
- Module['abort'] = Module.abort = abort;
- // {{PRE_RUN_ADDITIONS}}
- if (Module['preInit']) {
- if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']];
- while (Module['preInit'].length > 0) {
- Module['preInit'].pop()();
- }
- }
- // shouldRunNow refers to calling main(), not run().
- var shouldRunNow = true;
- if (Module['noInitialRun']) {
- shouldRunNow = false;
- }
- if (!ENVIRONMENT_IS_PTHREAD) run();
- // {{POST_RUN_ADDITIONS}}
- // {{MODULE_ADDITIONS}}
|