musl_linux_ppc64le.go 193 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012
  1. // Code generated by 'ccgo -export-externs X -hide __syscall0,__syscall1,__syscall2,__syscall3,__syscall4,__syscall5,__syscall6 -nostdinc -nostdlib -o ../musl_linux_ppc64le.go -pkgname libc -static-locals-prefix _s -Iarch/powerpc64 -Iarch/generic -Iobj/src/internal -Isrc/include -Isrc/internal -Iobj/include -Iinclude copyright.c src/ctype/__ctype_b_loc.c src/ctype/isalnum.c src/ctype/isalpha.c src/ctype/isdigit.c src/ctype/islower.c src/ctype/isprint.c src/ctype/isupper.c src/ctype/isxdigit.c src/dirent/closedir.c src/dirent/opendir.c src/dirent/readdir.c src/internal/floatscan.c src/internal/intscan.c src/internal/shgetc.c src/locale/localeconv.c src/math/__fpclassify.c src/math/__fpclassifyf.c src/math/__fpclassifyl.c src/math/copysignl.c src/math/fabsl.c src/math/fmodl.c src/math/nanf.c src/math/rint.c src/math/scalbn.c src/math/scalbnl.c src/multibyte/internal.c src/multibyte/mbrtowc.c src/multibyte/mbsinit.c src/network/freeaddrinfo.c src/network/getaddrinfo.c src/network/gethostbyaddr.c src/network/gethostbyaddr_r.c src/network/gethostbyname.c src/network/gethostbyname2.c src/network/gethostbyname2_r.c src/network/gethostbyname_r.c src/network/getnameinfo.c src/network/h_errno.c src/network/inet_aton.c src/network/inet_ntop.c src/network/inet_pton.c src/network/lookup_ipliteral.c src/network/lookup_name.c src/network/lookup_serv.c src/prng/rand_r.c src/stdio/__lockfile.c src/stdio/__toread.c src/stdio/__uflow.c src/stdio/sscanf.c src/stdio/vfscanf.c src/stdio/vsscanf.c src/stdlib/bsearch.c src/stdlib/strtod.c src/stdlib/strtol.c src/string/strdup.c src/string/strlcat.c src/string/strlcpy.c src/string/strncasecmp.c src/string/strncat.c src/string/strnlen.c src/string/strspn.c src/string/strtok.c src/thread/pthread_attr_get.c src/thread/pthread_attr_setdetachstate.c src/thread/pthread_mutex_lock.c src/thread/pthread_mutexattr_destroy.c src/thread/pthread_mutexattr_init.c src/thread/pthread_mutexattr_settype.c', DO NOT EDIT.
  2. package libc
  3. import (
  4. "math"
  5. "reflect"
  6. "sync/atomic"
  7. "unsafe"
  8. )
  9. var _ = math.Pi
  10. var _ reflect.Kind
  11. var _ atomic.Value
  12. var _ unsafe.Pointer
  13. // musl as a whole is licensed under the following standard MIT license:
  14. //
  15. // ----------------------------------------------------------------------
  16. // Copyright © 2005-2020 Rich Felker, et al.
  17. //
  18. // Permission is hereby granted, free of charge, to any person obtaining
  19. // a copy of this software and associated documentation files (the
  20. // "Software"), to deal in the Software without restriction, including
  21. // without limitation the rights to use, copy, modify, merge, publish,
  22. // distribute, sublicense, and/or sell copies of the Software, and to
  23. // permit persons to whom the Software is furnished to do so, subject to
  24. // the following conditions:
  25. //
  26. // The above copyright notice and this permission notice shall be
  27. // included in all copies or substantial portions of the Software.
  28. //
  29. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  30. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  31. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  32. // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  33. // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  34. // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  35. // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  36. // ----------------------------------------------------------------------
  37. //
  38. // Authors/contributors include:
  39. //
  40. // A. Wilcox
  41. // Ada Worcester
  42. // Alex Dowad
  43. // Alex Suykov
  44. // Alexander Monakov
  45. // Andre McCurdy
  46. // Andrew Kelley
  47. // Anthony G. Basile
  48. // Aric Belsito
  49. // Arvid Picciani
  50. // Bartosz Brachaczek
  51. // Benjamin Peterson
  52. // Bobby Bingham
  53. // Boris Brezillon
  54. // Brent Cook
  55. // Chris Spiegel
  56. // Clément Vasseur
  57. // Daniel Micay
  58. // Daniel Sabogal
  59. // Daurnimator
  60. // David Carlier
  61. // David Edelsohn
  62. // Denys Vlasenko
  63. // Dmitry Ivanov
  64. // Dmitry V. Levin
  65. // Drew DeVault
  66. // Emil Renner Berthing
  67. // Fangrui Song
  68. // Felix Fietkau
  69. // Felix Janda
  70. // Gianluca Anzolin
  71. // Hauke Mehrtens
  72. // He X
  73. // Hiltjo Posthuma
  74. // Isaac Dunham
  75. // Jaydeep Patil
  76. // Jens Gustedt
  77. // Jeremy Huntwork
  78. // Jo-Philipp Wich
  79. // Joakim Sindholt
  80. // John Spencer
  81. // Julien Ramseier
  82. // Justin Cormack
  83. // Kaarle Ritvanen
  84. // Khem Raj
  85. // Kylie McClain
  86. // Leah Neukirchen
  87. // Luca Barbato
  88. // Luka Perkov
  89. // M Farkas-Dyck (Strake)
  90. // Mahesh Bodapati
  91. // Markus Wichmann
  92. // Masanori Ogino
  93. // Michael Clark
  94. // Michael Forney
  95. // Mikhail Kremnyov
  96. // Natanael Copa
  97. // Nicholas J. Kain
  98. // orc
  99. // Pascal Cuoq
  100. // Patrick Oppenlander
  101. // Petr Hosek
  102. // Petr Skocik
  103. // Pierre Carrier
  104. // Reini Urban
  105. // Rich Felker
  106. // Richard Pennington
  107. // Ryan Fairfax
  108. // Samuel Holland
  109. // Segev Finer
  110. // Shiz
  111. // sin
  112. // Solar Designer
  113. // Stefan Kristiansson
  114. // Stefan O'Rear
  115. // Szabolcs Nagy
  116. // Timo Teräs
  117. // Trutz Behn
  118. // Valentin Ochs
  119. // Will Dietz
  120. // William Haddon
  121. // William Pitcock
  122. //
  123. // Portions of this software are derived from third-party works licensed
  124. // under terms compatible with the above MIT license:
  125. //
  126. // The TRE regular expression implementation (src/regex/reg* and
  127. // src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed
  128. // under a 2-clause BSD license (license text in the source files). The
  129. // included version has been heavily modified by Rich Felker in 2012, in
  130. // the interests of size, simplicity, and namespace cleanliness.
  131. //
  132. // Much of the math library code (src/math/* and src/complex/*) is
  133. // Copyright © 1993,2004 Sun Microsystems or
  134. // Copyright © 2003-2011 David Schultz or
  135. // Copyright © 2003-2009 Steven G. Kargl or
  136. // Copyright © 2003-2009 Bruce D. Evans or
  137. // Copyright © 2008 Stephen L. Moshier or
  138. // Copyright © 2017-2018 Arm Limited
  139. // and labelled as such in comments in the individual source files. All
  140. // have been licensed under extremely permissive terms.
  141. //
  142. // The ARM memcpy code (src/string/arm/memcpy.S) is Copyright © 2008
  143. // The Android Open Source Project and is licensed under a two-clause BSD
  144. // license. It was taken from Bionic libc, used on Android.
  145. //
  146. // The AArch64 memcpy and memset code (src/string/aarch64/*) are
  147. // Copyright © 1999-2019, Arm Limited.
  148. //
  149. // The implementation of DES for crypt (src/crypt/crypt_des.c) is
  150. // Copyright © 1994 David Burren. It is licensed under a BSD license.
  151. //
  152. // The implementation of blowfish crypt (src/crypt/crypt_blowfish.c) was
  153. // originally written by Solar Designer and placed into the public
  154. // domain. The code also comes with a fallback permissive license for use
  155. // in jurisdictions that may not recognize the public domain.
  156. //
  157. // The smoothsort implementation (src/stdlib/qsort.c) is Copyright © 2011
  158. // Valentin Ochs and is licensed under an MIT-style license.
  159. //
  160. // The x86_64 port was written by Nicholas J. Kain and is licensed under
  161. // the standard MIT terms.
  162. //
  163. // The mips and microblaze ports were originally written by Richard
  164. // Pennington for use in the ellcc project. The original code was adapted
  165. // by Rich Felker for build system and code conventions during upstream
  166. // integration. It is licensed under the standard MIT terms.
  167. //
  168. // The mips64 port was contributed by Imagination Technologies and is
  169. // licensed under the standard MIT terms.
  170. //
  171. // The powerpc port was also originally written by Richard Pennington,
  172. // and later supplemented and integrated by John Spencer. It is licensed
  173. // under the standard MIT terms.
  174. //
  175. // All other files which have no copyright comments are original works
  176. // produced specifically for use as part of this library, written either
  177. // by Rich Felker, the main author of the library, or by one or more
  178. // contibutors listed above. Details on authorship of individual files
  179. // can be found in the git version control history of the project. The
  180. // omission of copyright and license comments in each file is in the
  181. // interest of source tree size.
  182. //
  183. // In addition, permission is hereby granted for all public header files
  184. // (include/* and arch/*/bits/*) and crt files intended to be linked into
  185. // applications (crt/*, ldso/dlstart.c, and arch/*/crt_arch.h) to omit
  186. // the copyright notice and permission notice otherwise required by the
  187. // license, and to use these files without any requirement of
  188. // attribution. These files include substantial contributions from:
  189. //
  190. // Bobby Bingham
  191. // John Spencer
  192. // Nicholas J. Kain
  193. // Rich Felker
  194. // Richard Pennington
  195. // Stefan Kristiansson
  196. // Szabolcs Nagy
  197. //
  198. // all of whom have explicitly granted such permission.
  199. //
  200. // This file previously contained text expressing a belief that most of
  201. // the files covered by the above exception were sufficiently trivial not
  202. // to be subject to copyright, resulting in confusion over whether it
  203. // negated the permissions granted in the license. In the spirit of
  204. // permissive licensing, and of not having licensing issues being an
  205. // obstacle to adoption, that text has been removed.
  206. const ( /* copyright.c:194:1: */
  207. __musl__copyright__ = 0
  208. )
  209. const ( /* nameser.h:117:1: */
  210. ns_uop_delete = 0
  211. ns_uop_add = 1
  212. ns_uop_max = 2
  213. )
  214. const ( /* nameser.h:147:1: */
  215. ns_t_invalid = 0
  216. ns_t_a = 1
  217. ns_t_ns = 2
  218. ns_t_md = 3
  219. ns_t_mf = 4
  220. ns_t_cname = 5
  221. ns_t_soa = 6
  222. ns_t_mb = 7
  223. ns_t_mg = 8
  224. ns_t_mr = 9
  225. ns_t_null = 10
  226. ns_t_wks = 11
  227. ns_t_ptr = 12
  228. ns_t_hinfo = 13
  229. ns_t_minfo = 14
  230. ns_t_mx = 15
  231. ns_t_txt = 16
  232. ns_t_rp = 17
  233. ns_t_afsdb = 18
  234. ns_t_x25 = 19
  235. ns_t_isdn = 20
  236. ns_t_rt = 21
  237. ns_t_nsap = 22
  238. ns_t_nsap_ptr = 23
  239. ns_t_sig = 24
  240. ns_t_key = 25
  241. ns_t_px = 26
  242. ns_t_gpos = 27
  243. ns_t_aaaa = 28
  244. ns_t_loc = 29
  245. ns_t_nxt = 30
  246. ns_t_eid = 31
  247. ns_t_nimloc = 32
  248. ns_t_srv = 33
  249. ns_t_atma = 34
  250. ns_t_naptr = 35
  251. ns_t_kx = 36
  252. ns_t_cert = 37
  253. ns_t_a6 = 38
  254. ns_t_dname = 39
  255. ns_t_sink = 40
  256. ns_t_opt = 41
  257. ns_t_apl = 42
  258. ns_t_tkey = 249
  259. ns_t_tsig = 250
  260. ns_t_ixfr = 251
  261. ns_t_axfr = 252
  262. ns_t_mailb = 253
  263. ns_t_maila = 254
  264. ns_t_any = 255
  265. ns_t_zxfr = 256
  266. ns_t_max = 65536
  267. )
  268. const ( /* nameser.h:210:1: */
  269. ns_c_invalid = 0
  270. ns_c_in = 1
  271. ns_c_2 = 2
  272. ns_c_chaos = 3
  273. ns_c_hs = 4
  274. ns_c_none = 254
  275. ns_c_any = 255
  276. ns_c_max = 65536
  277. )
  278. const ( /* nameser.h:221:1: */
  279. ns_kt_rsa = 1
  280. ns_kt_dh = 2
  281. ns_kt_dsa = 3
  282. ns_kt_private = 254
  283. )
  284. const ( /* nameser.h:228:1: */
  285. cert_t_pkix = 1
  286. cert_t_spki = 2
  287. cert_t_pgp = 3
  288. cert_t_url = 253
  289. cert_t_oid = 254
  290. )
  291. const ( /* nameser.h:28:1: */
  292. ns_s_qd = 0
  293. ns_s_zn = 0
  294. ns_s_an = 1
  295. ns_s_pr = 1
  296. ns_s_ns = 2
  297. ns_s_ud = 2
  298. ns_s_ar = 3
  299. ns_s_max = 4
  300. )
  301. const ( /* nameser.h:75:1: */
  302. ns_f_qr = 0
  303. ns_f_opcode = 1
  304. ns_f_aa = 2
  305. ns_f_tc = 3
  306. ns_f_rd = 4
  307. ns_f_ra = 5
  308. ns_f_z = 6
  309. ns_f_ad = 7
  310. ns_f_cd = 8
  311. ns_f_rcode = 9
  312. ns_f_max = 10
  313. )
  314. const ( /* nameser.h:89:1: */
  315. ns_o_query = 0
  316. ns_o_iquery = 1
  317. ns_o_status = 2
  318. ns_o_notify = 4
  319. ns_o_update = 5
  320. ns_o_max = 6
  321. )
  322. const ( /* nameser.h:98:1: */
  323. ns_r_noerror = 0
  324. ns_r_formerr = 1
  325. ns_r_servfail = 2
  326. ns_r_nxdomain = 3
  327. ns_r_notimpl = 4
  328. ns_r_refused = 5
  329. ns_r_yxdomain = 6
  330. ns_r_yxrrset = 7
  331. ns_r_nxrrset = 8
  332. ns_r_notauth = 9
  333. ns_r_notzone = 10
  334. ns_r_max = 11
  335. ns_r_badvers = 16
  336. ns_r_badsig = 16
  337. ns_r_badkey = 17
  338. ns_r_badtime = 18
  339. )
  340. const ( /* pthread_impl.h:58:1: */
  341. DT_EXITING = 0
  342. DT_JOINABLE = 1
  343. DT_DETACHED = 2
  344. )
  345. type ptrdiff_t = int64 /* <builtin>:3:26 */
  346. type size_t = uint64 /* <builtin>:9:23 */
  347. type wchar_t = int32 /* <builtin>:15:24 */
  348. type uint16_t = uint16 /* alltypes.h:118:25 */
  349. type uint32_t = uint32 /* alltypes.h:123:25 */
  350. type uint64_t = uint64 /* alltypes.h:128:25 */
  351. func __bswap32(tls *TLS, __x uint32_t) uint32_t { /* endian.h:24:26: */
  352. return __x>>24 | __x>>8&uint32_t(0xff00) | __x<<8&uint32_t(0xff0000) | __x<<24
  353. }
  354. var table = [384]uint16{
  355. uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0),
  356. uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0),
  357. uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0),
  358. uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0),
  359. uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536),
  360. uint16((0x200/256 | 0x200*256) % 65536), uint16((0x320/256 | 0x320*256) % 65536), uint16((0x220/256 | 0x220*256) % 65536), uint16((0x220/256 | 0x220*256) % 65536), uint16((0x220/256 | 0x220*256) % 65536), uint16((0x220/256 | 0x220*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536),
  361. uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536),
  362. uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536),
  363. uint16((0x160/256 | 0x160*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536),
  364. uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536),
  365. uint16((0x8d8/256 | 0x8d8*256) % 65536), uint16((0x8d8/256 | 0x8d8*256) % 65536), uint16((0x8d8/256 | 0x8d8*256) % 65536), uint16((0x8d8/256 | 0x8d8*256) % 65536), uint16((0x8d8/256 | 0x8d8*256) % 65536), uint16((0x8d8/256 | 0x8d8*256) % 65536), uint16((0x8d8/256 | 0x8d8*256) % 65536), uint16((0x8d8/256 | 0x8d8*256) % 65536),
  366. uint16((0x8d8/256 | 0x8d8*256) % 65536), uint16((0x8d8/256 | 0x8d8*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536),
  367. uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x8d5/256 | 0x8d5*256) % 65536), uint16((0x8d5/256 | 0x8d5*256) % 65536), uint16((0x8d5/256 | 0x8d5*256) % 65536), uint16((0x8d5/256 | 0x8d5*256) % 65536), uint16((0x8d5/256 | 0x8d5*256) % 65536), uint16((0x8d5/256 | 0x8d5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536),
  368. uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536),
  369. uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536),
  370. uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536),
  371. uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x8d6/256 | 0x8d6*256) % 65536), uint16((0x8d6/256 | 0x8d6*256) % 65536), uint16((0x8d6/256 | 0x8d6*256) % 65536), uint16((0x8d6/256 | 0x8d6*256) % 65536), uint16((0x8d6/256 | 0x8d6*256) % 65536), uint16((0x8d6/256 | 0x8d6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536),
  372. uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536),
  373. uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536),
  374. uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536),
  375. uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0),
  376. uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0),
  377. uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0),
  378. uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0),
  379. } /* __ctype_b_loc.c:9:29 */
  380. var ptable uintptr = 0 /* __ctype_b_loc.c:36:29 */
  381. func X__ctype_b_loc(tls *TLS) uintptr { /* __ctype_b_loc.c:38:22: */
  382. return uintptr(unsafe.Pointer(&ptable))
  383. }
  384. func __isspace(tls *TLS, _c int32) int32 { /* ctype.h:26:21: */
  385. return Bool32(_c == ' ' || uint32(_c)-uint32('\t') < uint32(5))
  386. }
  387. type __locale_struct = struct{ cat [6]uintptr } /* alltypes.h:335:9 */
  388. type locale_t = uintptr /* alltypes.h:335:32 */
  389. func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */
  390. return Bool32(func() int32 {
  391. if 0 != 0 {
  392. return Xisalpha(tls, c)
  393. }
  394. return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26))
  395. }() != 0 || func() int32 {
  396. if 0 != 0 {
  397. return Xisdigit(tls, c)
  398. }
  399. return Bool32(uint32(c)-uint32('0') < uint32(10))
  400. }() != 0)
  401. }
  402. func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */
  403. return Xisalnum(tls, c)
  404. }
  405. func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */
  406. return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26))
  407. }
  408. func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */
  409. return Xisalpha(tls, c)
  410. }
  411. func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */
  412. return Bool32(uint32(c)-uint32('0') < uint32(10))
  413. }
  414. func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */
  415. return Xisdigit(tls, c)
  416. }
  417. func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */
  418. return Bool32(uint32(c)-uint32('a') < uint32(26))
  419. }
  420. func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */
  421. return Xislower(tls, c)
  422. }
  423. func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */
  424. return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f))
  425. }
  426. func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */
  427. return Xisprint(tls, c)
  428. }
  429. func Xisupper(tls *TLS, c int32) int32 { /* isupper.c:4:5: */
  430. return Bool32(uint32(c)-uint32('A') < uint32(26))
  431. }
  432. func X__isupper_l(tls *TLS, c int32, l locale_t) int32 { /* isupper.c:9:5: */
  433. return Xisupper(tls, c)
  434. }
  435. func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */
  436. return Bool32(func() int32 {
  437. if 0 != 0 {
  438. return Xisdigit(tls, c)
  439. }
  440. return Bool32(uint32(c)-uint32('0') < uint32(10))
  441. }() != 0 || uint32(c)|uint32(32)-uint32('a') < uint32(6))
  442. }
  443. func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */
  444. return Xisxdigit(tls, c)
  445. }
  446. type off_t = int64 /* alltypes.h:154:16 */
  447. type ino_t = uint64 /* alltypes.h:159:25 */
  448. type dirent = struct {
  449. d_ino ino_t
  450. d_off off_t
  451. d_reclen uint16
  452. d_type uint8
  453. d_name [256]uint8
  454. _ [5]byte
  455. } /* dirent.h:5:1 */
  456. type __dirstream = struct {
  457. tell off_t
  458. fd int32
  459. buf_pos int32
  460. buf_end int32
  461. lock [1]int32
  462. buf [2048]uint8
  463. } /* dirent.h:20:9 */
  464. type DIR = __dirstream /* dirent.h:20:28 */
  465. type ssize_t = int64 /* alltypes.h:57:15 */
  466. type intptr_t = int64 /* alltypes.h:62:15 */
  467. type pid_t = int32 /* alltypes.h:227:13 */
  468. type uid_t = uint32 /* alltypes.h:237:18 */
  469. type gid_t = uint32 /* alltypes.h:242:18 */
  470. type useconds_t = uint32 /* alltypes.h:252:18 */
  471. type div_t = struct {
  472. quot int32
  473. rem int32
  474. } /* stdlib.h:62:35 */
  475. type ldiv_t = struct {
  476. quot int64
  477. rem int64
  478. } /* stdlib.h:63:36 */
  479. type lldiv_t = struct {
  480. quot int64
  481. rem int64
  482. } /* stdlib.h:64:41 */
  483. func Xclosedir(tls *TLS, dir uintptr) int32 { /* closedir.c:6:5: */
  484. var ret int32 = Xclose(tls, (*DIR)(unsafe.Pointer(dir)).fd)
  485. Xfree(tls, dir)
  486. return ret
  487. }
  488. type mode_t = uint32 /* alltypes.h:144:18 */
  489. type iovec = struct {
  490. iov_base uintptr
  491. iov_len size_t
  492. } /* alltypes.h:347:1 */
  493. type flock = struct {
  494. l_type int16
  495. l_whence int16
  496. _ [4]byte
  497. l_start off_t
  498. l_len off_t
  499. l_pid pid_t
  500. _ [4]byte
  501. } /* fcntl.h:24:1 */
  502. type file_handle = struct {
  503. _ [0]uint32
  504. handle_bytes uint32
  505. handle_type int32
  506. } /* fcntl.h:167:1 */
  507. type f_owner_ex = struct {
  508. __type int32
  509. pid pid_t
  510. } /* fcntl.h:172:1 */
  511. type syscall_arg_t = int64 /* syscall.h:22:14 */
  512. func Xopendir(tls *TLS, name uintptr) uintptr { /* opendir.c:8:5: */
  513. var fd int32
  514. var dir uintptr
  515. if AssignInt32(&fd, Xopen(tls, name, 00|040000|02000000, 0)) < 0 {
  516. return uintptr(0)
  517. }
  518. if !(int32(AssignUintptr(&dir, Xcalloc(tls, uint64(1), uint64(unsafe.Sizeof(DIR{}))))) != 0) {
  519. __syscall1(tls, int64(6), int64(fd))
  520. return uintptr(0)
  521. }
  522. (*DIR)(unsafe.Pointer(dir)).fd = fd
  523. return dir
  524. }
  525. type max_align_t = struct {
  526. __ll int64
  527. __ld float64
  528. } /* alltypes.h:33:54 */
  529. type dirstream_buf_alignment_check = [1]uint8 /* readdir.c:7:14 */
  530. func Xreaddir(tls *TLS, dir uintptr) uintptr { /* readdir.c:10:15: */
  531. var de uintptr
  532. if (*DIR)(unsafe.Pointer(dir)).buf_pos >= (*DIR)(unsafe.Pointer(dir)).buf_end {
  533. var len int32 = int32(__syscall3(tls, int64(202), int64((*DIR)(unsafe.Pointer(dir)).fd), int64(dir+24), int64(unsafe.Sizeof([2048]uint8{}))))
  534. if len <= 0 {
  535. if len < 0 && len != -2 {
  536. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = -len
  537. }
  538. return uintptr(0)
  539. }
  540. (*DIR)(unsafe.Pointer(dir)).buf_end = len
  541. (*DIR)(unsafe.Pointer(dir)).buf_pos = 0
  542. }
  543. de = dir + 24 + uintptr((*DIR)(unsafe.Pointer(dir)).buf_pos)
  544. *(*int32)(unsafe.Pointer(dir + 12)) += int32((*dirent)(unsafe.Pointer(de)).d_reclen)
  545. (*DIR)(unsafe.Pointer(dir)).tell = (*dirent)(unsafe.Pointer(de)).d_off
  546. return de
  547. }
  548. type uintptr_t = uint64 /* alltypes.h:47:24 */
  549. type int8_t = int8 /* alltypes.h:88:25 */
  550. type int16_t = int16 /* alltypes.h:93:25 */
  551. type int32_t = int32 /* alltypes.h:98:25 */
  552. type int64_t = int64 /* alltypes.h:103:25 */
  553. type intmax_t = int64 /* alltypes.h:108:25 */
  554. type uint8_t = uint8 /* alltypes.h:113:25 */
  555. type uintmax_t = uint64 /* alltypes.h:138:25 */
  556. type int_fast8_t = int8_t /* stdint.h:22:16 */
  557. type int_fast64_t = int64_t /* stdint.h:23:17 */
  558. type int_least8_t = int8_t /* stdint.h:25:17 */
  559. type int_least16_t = int16_t /* stdint.h:26:17 */
  560. type int_least32_t = int32_t /* stdint.h:27:17 */
  561. type int_least64_t = int64_t /* stdint.h:28:17 */
  562. type uint_fast8_t = uint8_t /* stdint.h:30:17 */
  563. type uint_fast64_t = uint64_t /* stdint.h:31:18 */
  564. type uint_least8_t = uint8_t /* stdint.h:33:18 */
  565. type uint_least16_t = uint16_t /* stdint.h:34:18 */
  566. type uint_least32_t = uint32_t /* stdint.h:35:18 */
  567. type uint_least64_t = uint64_t /* stdint.h:36:18 */
  568. type int_fast16_t = int32_t /* stdint.h:1:17 */
  569. type int_fast32_t = int32_t /* stdint.h:2:17 */
  570. type uint_fast16_t = uint32_t /* stdint.h:3:18 */
  571. type uint_fast32_t = uint32_t /* stdint.h:4:18 */
  572. type _IO_FILE = struct {
  573. flags uint32
  574. _ [4]byte
  575. rpos uintptr
  576. rend uintptr
  577. close uintptr
  578. wend uintptr
  579. wpos uintptr
  580. mustbezero_1 uintptr
  581. wbase uintptr
  582. read uintptr
  583. write uintptr
  584. seek uintptr
  585. buf uintptr
  586. buf_size size_t
  587. prev uintptr
  588. next uintptr
  589. fd int32
  590. pipe_pid int32
  591. lockcount int64
  592. mode int32
  593. lock int32
  594. lbf int32
  595. _ [4]byte
  596. cookie uintptr
  597. off off_t
  598. getln_buf uintptr
  599. mustbezero_2 uintptr
  600. shend uintptr
  601. shlim off_t
  602. shcnt off_t
  603. prev_locked uintptr
  604. next_locked uintptr
  605. locale uintptr
  606. } /* alltypes.h:312:9 */
  607. type FILE = _IO_FILE /* alltypes.h:312:25 */
  608. type va_list = uintptr /* alltypes.h:318:27 */
  609. type _G_fpos64_t = struct {
  610. _ [0]uint64
  611. __opaque [16]uint8
  612. } /* stdio.h:54:9 */
  613. type fpos_t = _G_fpos64_t /* stdio.h:58:3 */
  614. type float_t = float32 /* alltypes.h:22:15 */
  615. type double_t = float64 /* alltypes.h:27:16 */
  616. func __FLOAT_BITS(tls *TLS, __f float32) uint32 { /* math.h:55:26: */
  617. bp := tls.Alloc(4)
  618. defer tls.Free(4)
  619. // var __u struct {__f float32;} at bp, 4
  620. *(*float32)(unsafe.Pointer(bp)) = __f
  621. return *(*uint32)(unsafe.Pointer(bp))
  622. }
  623. func __DOUBLE_BITS(tls *TLS, __f float64) uint64 { /* math.h:61:36: */
  624. bp := tls.Alloc(8)
  625. defer tls.Free(8)
  626. // var __u struct {__f float64;} at bp, 8
  627. *(*float64)(unsafe.Pointer(bp)) = __f
  628. return *(*uint64)(unsafe.Pointer(bp))
  629. }
  630. type __pthread = struct {
  631. self uintptr
  632. dtv uintptr
  633. prev uintptr
  634. next uintptr
  635. sysinfo uintptr_t
  636. canary uintptr_t
  637. canary2 uintptr_t
  638. tid int32
  639. errno_val int32
  640. detach_state int32
  641. cancel int32
  642. canceldisable uint8
  643. cancelasync uint8
  644. tsd_used uint8 /* unsigned char tsd_used: 1, unsigned char dlerror_flag: 1 */
  645. _ [5]byte
  646. map_base uintptr
  647. map_size size_t
  648. stack uintptr
  649. stack_size size_t
  650. guard_size size_t
  651. result uintptr
  652. cancelbuf uintptr
  653. tsd uintptr
  654. robust_list struct {
  655. head uintptr
  656. off int64
  657. pending uintptr
  658. }
  659. timer_id int32
  660. _ [4]byte
  661. locale locale_t
  662. killlock [1]int32
  663. _ [4]byte
  664. dlerror_buf uintptr
  665. stdio_locks uintptr
  666. canary_at_end uintptr_t
  667. dtv_copy uintptr
  668. } /* alltypes.h:265:9 */
  669. func scanexp(tls *TLS, f uintptr, pok int32) int64 { /* floatscan.c:37:18: */
  670. var c int32
  671. var x int32
  672. var y int64
  673. var neg int32 = 0
  674. c = func() int32 {
  675. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  676. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  677. }
  678. return X__shgetc(tls, f)
  679. }()
  680. if c == '+' || c == '-' {
  681. neg = Bool32(c == '-')
  682. c = func() int32 {
  683. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  684. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  685. }
  686. return X__shgetc(tls, f)
  687. }()
  688. if uint32(c-'0') >= 10 && pok != 0 {
  689. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  690. (*FILE)(unsafe.Pointer(f)).rpos--
  691. } else {
  692. }
  693. }
  694. }
  695. if uint32(c-'0') >= 10 {
  696. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  697. (*FILE)(unsafe.Pointer(f)).rpos--
  698. } else {
  699. }
  700. return -0x7fffffffffffffff - int64(1)
  701. }
  702. for x = 0; uint32(c-'0') < 10 && x < 0x7fffffff/10; c = func() int32 {
  703. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  704. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  705. }
  706. return X__shgetc(tls, f)
  707. }() {
  708. x = 10*x + c - '0'
  709. }
  710. for y = int64(x); uint32(c-'0') < 10 && y < 0x7fffffffffffffff/int64(100); c = func() int32 {
  711. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  712. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  713. }
  714. return X__shgetc(tls, f)
  715. }() {
  716. y = int64(10)*y + int64(c) - int64('0')
  717. }
  718. for ; uint32(c-'0') < 10; c = func() int32 {
  719. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  720. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  721. }
  722. return X__shgetc(tls, f)
  723. }() {
  724. }
  725. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  726. (*FILE)(unsafe.Pointer(f)).rpos--
  727. } else {
  728. }
  729. if neg != 0 {
  730. return -y
  731. }
  732. return y
  733. }
  734. func decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, pok int32) float64 { /* floatscan.c:64:20: */
  735. bp := tls.Alloc(512)
  736. defer tls.Free(512)
  737. // var x [128]uint32_t at bp, 512
  738. var i int32
  739. var j int32
  740. var k int32
  741. var a int32
  742. var z int32
  743. var lrp int64 = int64(0)
  744. var dc int64 = int64(0)
  745. var e10 int64 = int64(0)
  746. var lnz int32 = 0
  747. var gotdig int32 = 0
  748. var gotrad int32 = 0
  749. var rp int32
  750. var e2 int32
  751. var emax int32 = -emin - bits + 3
  752. var denormal int32 = 0
  753. var y float64
  754. var frac float64 = float64(0)
  755. var bias float64 = float64(0)
  756. j = 0
  757. k = 0
  758. // Don't let leading zeros consume buffer space
  759. for ; c == '0'; c = func() int32 {
  760. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  761. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  762. }
  763. return X__shgetc(tls, f)
  764. }() {
  765. gotdig = 1
  766. }
  767. if c == '.' {
  768. gotrad = 1
  769. for c = func() int32 {
  770. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  771. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  772. }
  773. return X__shgetc(tls, f)
  774. }(); c == '0'; c = func() int32 {
  775. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  776. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  777. }
  778. return X__shgetc(tls, f)
  779. }() {
  780. gotdig = 1
  781. lrp--
  782. }
  783. }
  784. *(*uint32_t)(unsafe.Pointer(bp)) = uint32_t(0)
  785. for ; uint32(c-'0') < 10 || c == '.'; c = func() int32 {
  786. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  787. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  788. }
  789. return X__shgetc(tls, f)
  790. }() {
  791. if c == '.' {
  792. if gotrad != 0 {
  793. break
  794. }
  795. gotrad = 1
  796. lrp = dc
  797. } else if k < 128-3 {
  798. dc++
  799. if c != '0' {
  800. lnz = int32(dc)
  801. }
  802. if j != 0 {
  803. *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)) = *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4))*uint32_t(10) + uint32_t(c) - uint32_t('0')
  804. } else {
  805. *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)) = uint32_t(c - '0')
  806. }
  807. if PreIncInt32(&j, 1) == 9 {
  808. k++
  809. j = 0
  810. }
  811. gotdig = 1
  812. } else {
  813. dc++
  814. if c != '0' {
  815. lnz = (128 - 4) * 9
  816. *(*uint32_t)(unsafe.Pointer(bp + 124*4)) |= uint32_t(1)
  817. }
  818. }
  819. }
  820. if !(gotrad != 0) {
  821. lrp = dc
  822. }
  823. if gotdig != 0 && c|32 == 'e' {
  824. e10 = scanexp(tls, f, pok)
  825. if e10 == -0x7fffffffffffffff-int64(1) {
  826. if pok != 0 {
  827. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  828. (*FILE)(unsafe.Pointer(f)).rpos--
  829. } else {
  830. }
  831. } else {
  832. X__shlim(tls, f, int64(0))
  833. return float64(0)
  834. }
  835. e10 = int64(0)
  836. }
  837. lrp = lrp + e10
  838. } else if c >= 0 {
  839. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  840. (*FILE)(unsafe.Pointer(f)).rpos--
  841. } else {
  842. }
  843. }
  844. if !(gotdig != 0) {
  845. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22
  846. X__shlim(tls, f, int64(0))
  847. return float64(0)
  848. }
  849. // Handle zero specially to avoid nasty special cases later
  850. if !(int32(*(*uint32_t)(unsafe.Pointer(bp))) != 0) {
  851. return float64(sign) * 0.0
  852. }
  853. // Optimize small integers (w/no exponent) and over/under-flow
  854. if lrp == dc && dc < int64(10) && (bits > 30 || *(*uint32_t)(unsafe.Pointer(bp))>>bits == uint32_t(0)) {
  855. return float64(sign) * float64(*(*uint32_t)(unsafe.Pointer(bp)))
  856. }
  857. if lrp > int64(-emin/2) {
  858. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 34
  859. return float64(sign) * 1.79769313486231570815e+308 * 1.79769313486231570815e+308
  860. }
  861. if lrp < int64(emin-2*53) {
  862. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 34
  863. return float64(sign) * 2.22507385850720138309e-308 * 2.22507385850720138309e-308
  864. }
  865. // Align incomplete final B1B digit
  866. if j != 0 {
  867. for ; j < 9; j++ {
  868. *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)) *= uint32_t(10)
  869. }
  870. k++
  871. j = 0
  872. }
  873. a = 0
  874. z = k
  875. e2 = 0
  876. rp = int32(lrp)
  877. // Optimize small to mid-size integers (even in exp. notation)
  878. if lnz < 9 && lnz <= rp && rp < 18 {
  879. if rp == 9 {
  880. return float64(sign) * float64(*(*uint32_t)(unsafe.Pointer(bp)))
  881. }
  882. if rp < 9 {
  883. return float64(sign) * float64(*(*uint32_t)(unsafe.Pointer(bp))) / float64(_sp10s[8-rp])
  884. }
  885. var bitlim int32 = bits - 3*(rp-9)
  886. if bitlim > 30 || *(*uint32_t)(unsafe.Pointer(bp))>>bitlim == uint32_t(0) {
  887. return float64(sign) * float64(*(*uint32_t)(unsafe.Pointer(bp))) * float64(_sp10s[rp-10])
  888. }
  889. }
  890. // Drop trailing zeros
  891. for ; !(int32(*(*uint32_t)(unsafe.Pointer(bp + uintptr(z-1)*4))) != 0); z-- {
  892. }
  893. // Align radix point to B1B digit boundary
  894. if rp%9 != 0 {
  895. var rpm9 int32
  896. if rp >= 0 {
  897. rpm9 = rp % 9
  898. } else {
  899. rpm9 = rp%9 + 9
  900. }
  901. var p10 int32 = _sp10s[8-rpm9]
  902. var carry uint32_t = uint32_t(0)
  903. for k = a; k != z; k++ {
  904. var tmp uint32_t = *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)) % uint32_t(p10)
  905. *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)) = *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4))/uint32_t(p10) + carry
  906. carry = uint32_t(1000000000/p10) * tmp
  907. if k == a && !(int32(*(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4))) != 0) {
  908. a = (a + 1) & (128 - 1)
  909. rp = rp - 9
  910. }
  911. }
  912. if carry != 0 {
  913. *(*uint32_t)(unsafe.Pointer(bp + uintptr(PostIncInt32(&z, 1))*4)) = carry
  914. }
  915. rp = rp + (9 - rpm9)
  916. }
  917. // Upscale until desired number of bits are left of radix point
  918. for rp < 9*2 || rp == 9*2 && *(*uint32_t)(unsafe.Pointer(bp + uintptr(a)*4)) < _sth[0] {
  919. var carry uint32_t = uint32_t(0)
  920. e2 = e2 - 29
  921. for k = (z - 1) & (128 - 1); ; k = (k - 1) & (128 - 1) {
  922. var tmp uint64_t = uint64_t(*(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)))<<29 + uint64_t(carry)
  923. if tmp > uint64(1000000000) {
  924. carry = uint32_t(tmp / uint64(1000000000))
  925. *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)) = uint32_t(tmp % uint64(1000000000))
  926. } else {
  927. carry = uint32_t(0)
  928. *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)) = uint32_t(tmp)
  929. }
  930. if k == (z-1)&(128-1) && k != a && !(int32(*(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4))) != 0) {
  931. z = k
  932. }
  933. if k == a {
  934. break
  935. }
  936. }
  937. if carry != 0 {
  938. rp = rp + 9
  939. a = (a - 1) & (128 - 1)
  940. if a == z {
  941. z = (z - 1) & (128 - 1)
  942. *(*uint32_t)(unsafe.Pointer(bp + uintptr((z-1)&(128-1))*4)) |= *(*uint32_t)(unsafe.Pointer(bp + uintptr(z)*4))
  943. }
  944. *(*uint32_t)(unsafe.Pointer(bp + uintptr(a)*4)) = carry
  945. }
  946. }
  947. // Downscale until exactly number of bits are left of radix point
  948. for {
  949. var carry uint32_t = uint32_t(0)
  950. var sh int32 = 1
  951. for i = 0; i < 2; i++ {
  952. k = (a + i) & (128 - 1)
  953. if k == z || *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)) < _sth[i] {
  954. i = 2
  955. break
  956. }
  957. if *(*uint32_t)(unsafe.Pointer(bp + uintptr((a+i)&(128-1))*4)) > _sth[i] {
  958. break
  959. }
  960. }
  961. if i == 2 && rp == 9*2 {
  962. break
  963. }
  964. // FIXME: find a way to compute optimal sh
  965. if rp > 9+9*2 {
  966. sh = 9
  967. }
  968. e2 = e2 + sh
  969. for k = a; k != z; k = (k + 1) & (128 - 1) {
  970. var tmp uint32_t = *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)) & uint32_t(int32(1)<<sh-1)
  971. *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)) = *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4))>>sh + carry
  972. carry = uint32_t(int32(1000000000)>>sh) * tmp
  973. if k == a && !(int32(*(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4))) != 0) {
  974. a = (a + 1) & (128 - 1)
  975. i--
  976. rp = rp - 9
  977. }
  978. }
  979. if carry != 0 {
  980. if (z+1)&(128-1) != a {
  981. *(*uint32_t)(unsafe.Pointer(bp + uintptr(z)*4)) = carry
  982. z = (z + 1) & (128 - 1)
  983. } else {
  984. *(*uint32_t)(unsafe.Pointer(bp + uintptr((z-1)&(128-1))*4)) |= uint32_t(1)
  985. }
  986. }
  987. }
  988. // Assemble desired bits into floating point variable
  989. for y = float64(AssignInt32(&i, 0)); i < 2; i++ {
  990. if (a+i)&(128-1) == z {
  991. *(*uint32_t)(unsafe.Pointer(bp + uintptr(AssignInt32(&z, (z+1)&(128-1))-1)*4)) = uint32_t(0)
  992. }
  993. y = 1000000000.0*y + float64(*(*uint32_t)(unsafe.Pointer(bp + uintptr((a+i)&(128-1))*4)))
  994. }
  995. y = y * float64(sign)
  996. // Limit precision for denormal results
  997. if bits > 53+e2-emin {
  998. bits = 53 + e2 - emin
  999. if bits < 0 {
  1000. bits = 0
  1001. }
  1002. denormal = 1
  1003. }
  1004. // Calculate bias term to force rounding, move out lower bits
  1005. if bits < 53 {
  1006. bias = Xcopysignl(tls, Xscalbn(tls, float64(1), 2*53-bits-1), y)
  1007. frac = Xfmodl(tls, y, Xscalbn(tls, float64(1), 53-bits))
  1008. y = y - frac
  1009. y = y + bias
  1010. }
  1011. // Process tail of decimal input so it can affect rounding
  1012. if (a+i)&(128-1) != z {
  1013. var t uint32_t = *(*uint32_t)(unsafe.Pointer(bp + uintptr((a+i)&(128-1))*4))
  1014. if t < uint32_t(500000000) && (t != 0 || (a+i+1)&(128-1) != z) {
  1015. frac = frac + 0.25*float64(sign)
  1016. } else if t > uint32_t(500000000) {
  1017. frac = frac + 0.75*float64(sign)
  1018. } else if t == uint32_t(500000000) {
  1019. if (a+i+1)&(128-1) == z {
  1020. frac = frac + 0.5*float64(sign)
  1021. } else {
  1022. frac = frac + 0.75*float64(sign)
  1023. }
  1024. }
  1025. if 53-bits >= 2 && !(Xfmodl(tls, frac, float64(1)) != 0) {
  1026. frac += 1
  1027. }
  1028. }
  1029. y = y + frac
  1030. y = y - bias
  1031. if (e2+53)&0x7fffffff > emax-5 {
  1032. if Xfabsl(tls, y) >= float64(float64(2))/2.22044604925031308085e-16 {
  1033. if denormal != 0 && bits == 53+e2-emin {
  1034. denormal = 0
  1035. }
  1036. y = y * 0.5
  1037. e2++
  1038. }
  1039. if e2+53 > emax || denormal != 0 && frac != 0 {
  1040. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 34
  1041. }
  1042. }
  1043. return Xscalbnl(tls, y, e2)
  1044. }
  1045. var _sth = [2]uint32_t{uint32_t(9007199), uint32_t(254740991)} /* floatscan.c:67:24 */
  1046. var _sp10s = [8]int32{10, 100, 1000, 10000,
  1047. 100000, 1000000, 10000000, 100000000} /* floatscan.c:80:19 */
  1048. func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32) float64 { /* floatscan.c:315:20: */
  1049. var x uint32_t = uint32_t(0)
  1050. var y float64 = float64(0)
  1051. var scale float64 = float64(1)
  1052. var bias float64 = float64(0)
  1053. var gottail int32 = 0
  1054. var gotrad int32 = 0
  1055. var gotdig int32 = 0
  1056. var rp int64 = int64(0)
  1057. var dc int64 = int64(0)
  1058. var e2 int64 = int64(0)
  1059. var d int32
  1060. var c int32
  1061. c = func() int32 {
  1062. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1063. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1064. }
  1065. return X__shgetc(tls, f)
  1066. }()
  1067. // Skip leading zeros
  1068. for ; c == '0'; c = func() int32 {
  1069. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1070. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1071. }
  1072. return X__shgetc(tls, f)
  1073. }() {
  1074. gotdig = 1
  1075. }
  1076. if c == '.' {
  1077. gotrad = 1
  1078. c = func() int32 {
  1079. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1080. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1081. }
  1082. return X__shgetc(tls, f)
  1083. }()
  1084. // Count zeros after the radix point before significand
  1085. rp = int64(0)
  1086. __1:
  1087. if !(c == '0') {
  1088. goto __3
  1089. }
  1090. gotdig = 1
  1091. goto __2
  1092. __2:
  1093. c = func() int32 {
  1094. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1095. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1096. }
  1097. return X__shgetc(tls, f)
  1098. }()
  1099. rp--
  1100. goto __1
  1101. goto __3
  1102. __3:
  1103. }
  1104. for ; uint32(c-'0') < 10 || uint32(c|32-'a') < 6 || c == '.'; c = func() int32 {
  1105. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1106. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1107. }
  1108. return X__shgetc(tls, f)
  1109. }() {
  1110. if c == '.' {
  1111. if gotrad != 0 {
  1112. break
  1113. }
  1114. rp = dc
  1115. gotrad = 1
  1116. } else {
  1117. gotdig = 1
  1118. if c > '9' {
  1119. d = c | 32 + 10 - 'a'
  1120. } else {
  1121. d = c - '0'
  1122. }
  1123. if dc < int64(8) {
  1124. x = x*uint32_t(16) + uint32_t(d)
  1125. } else if dc < int64(53/4+1) {
  1126. y = y + float64(d)*AssignDivFloat64(&scale, float64(16))
  1127. } else if d != 0 && !(gottail != 0) {
  1128. y = y + 0.5*scale
  1129. gottail = 1
  1130. }
  1131. dc++
  1132. }
  1133. }
  1134. if !(gotdig != 0) {
  1135. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  1136. (*FILE)(unsafe.Pointer(f)).rpos--
  1137. } else {
  1138. }
  1139. if pok != 0 {
  1140. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  1141. (*FILE)(unsafe.Pointer(f)).rpos--
  1142. } else {
  1143. }
  1144. if gotrad != 0 {
  1145. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  1146. (*FILE)(unsafe.Pointer(f)).rpos--
  1147. } else {
  1148. }
  1149. }
  1150. } else {
  1151. X__shlim(tls, f, int64(0))
  1152. }
  1153. return float64(sign) * 0.0
  1154. }
  1155. if !(gotrad != 0) {
  1156. rp = dc
  1157. }
  1158. for dc < int64(8) {
  1159. x = x * uint32_t(16)
  1160. dc++
  1161. }
  1162. if c|32 == 'p' {
  1163. e2 = scanexp(tls, f, pok)
  1164. if e2 == -0x7fffffffffffffff-int64(1) {
  1165. if pok != 0 {
  1166. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  1167. (*FILE)(unsafe.Pointer(f)).rpos--
  1168. } else {
  1169. }
  1170. } else {
  1171. X__shlim(tls, f, int64(0))
  1172. return float64(0)
  1173. }
  1174. e2 = int64(0)
  1175. }
  1176. } else {
  1177. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  1178. (*FILE)(unsafe.Pointer(f)).rpos--
  1179. } else {
  1180. }
  1181. }
  1182. e2 = e2 + (int64(4)*rp - int64(32))
  1183. if !(x != 0) {
  1184. return float64(sign) * 0.0
  1185. }
  1186. if e2 > int64(-emin) {
  1187. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 34
  1188. return float64(sign) * 1.79769313486231570815e+308 * 1.79769313486231570815e+308
  1189. }
  1190. if e2 < int64(emin-2*53) {
  1191. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 34
  1192. return float64(sign) * 2.22507385850720138309e-308 * 2.22507385850720138309e-308
  1193. }
  1194. for x < 0x80000000 {
  1195. if y >= 0.5 {
  1196. x = x + (x + uint32_t(1))
  1197. y = y + (y - float64(1))
  1198. } else {
  1199. x = x + x
  1200. y = y + y
  1201. }
  1202. e2--
  1203. }
  1204. if int64(bits) > int64(32)+e2-int64(emin) {
  1205. bits = int32(int64(32) + e2 - int64(emin))
  1206. if bits < 0 {
  1207. bits = 0
  1208. }
  1209. }
  1210. if bits < 53 {
  1211. bias = Xcopysignl(tls, Xscalbn(tls, float64(1), 32+53-bits-1), float64(sign))
  1212. }
  1213. if bits < 32 && y != 0 && !(x&uint32_t(1) != 0) {
  1214. x++
  1215. y = float64(0)
  1216. }
  1217. y = bias + float64(sign)*float64(x) + float64(sign)*y
  1218. y = y - bias
  1219. if !(y != 0) {
  1220. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 34
  1221. }
  1222. return Xscalbnl(tls, y, int32(e2))
  1223. }
  1224. func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */
  1225. var sign int32 = 1
  1226. var i size_t
  1227. var bits int32
  1228. var emin int32
  1229. var c int32
  1230. switch prec {
  1231. case 0:
  1232. bits = 24
  1233. emin = -125 - bits
  1234. break
  1235. case 1:
  1236. bits = 53
  1237. emin = -1021 - bits
  1238. break
  1239. case 2:
  1240. bits = 53
  1241. emin = -1021 - bits
  1242. break
  1243. default:
  1244. return float64(0)
  1245. }
  1246. for __isspace(tls, AssignInt32(&c, func() int32 {
  1247. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1248. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1249. }
  1250. return X__shgetc(tls, f)
  1251. }())) != 0 {
  1252. }
  1253. if c == '+' || c == '-' {
  1254. sign = sign - 2*Bool32(c == '-')
  1255. c = func() int32 {
  1256. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1257. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1258. }
  1259. return X__shgetc(tls, f)
  1260. }()
  1261. }
  1262. for i = uint64(0); i < uint64(8) && c|32 == int32(*(*uint8)(unsafe.Pointer(ts /* "infinity" */ + uintptr(i)))); i++ {
  1263. if i < uint64(7) {
  1264. c = func() int32 {
  1265. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1266. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1267. }
  1268. return X__shgetc(tls, f)
  1269. }()
  1270. }
  1271. }
  1272. if i == uint64(3) || i == uint64(8) || i > uint64(3) && pok != 0 {
  1273. if i != uint64(8) {
  1274. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  1275. (*FILE)(unsafe.Pointer(f)).rpos--
  1276. } else {
  1277. }
  1278. if pok != 0 {
  1279. for ; i > uint64(3); i-- {
  1280. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  1281. (*FILE)(unsafe.Pointer(f)).rpos--
  1282. } else {
  1283. }
  1284. }
  1285. }
  1286. }
  1287. return float64(float32(sign) * X__builtin_inff(tls))
  1288. }
  1289. if !(i != 0) {
  1290. for i = uint64(0); i < uint64(3) && c|32 == int32(*(*uint8)(unsafe.Pointer(ts + 9 /* "nan" */ + uintptr(i)))); i++ {
  1291. if i < uint64(2) {
  1292. c = func() int32 {
  1293. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1294. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1295. }
  1296. return X__shgetc(tls, f)
  1297. }()
  1298. }
  1299. }
  1300. }
  1301. if i == uint64(3) {
  1302. if func() int32 {
  1303. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1304. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1305. }
  1306. return X__shgetc(tls, f)
  1307. }() != '(' {
  1308. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  1309. (*FILE)(unsafe.Pointer(f)).rpos--
  1310. } else {
  1311. }
  1312. return float64(X__builtin_nanf(tls, ts+13))
  1313. }
  1314. for i = uint64(1); ; i++ {
  1315. c = func() int32 {
  1316. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1317. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1318. }
  1319. return X__shgetc(tls, f)
  1320. }()
  1321. if uint32(c-'0') < 10 || uint32(c-'A') < 26 || uint32(c-'a') < 26 || c == '_' {
  1322. continue
  1323. }
  1324. if c == ')' {
  1325. return float64(X__builtin_nanf(tls, ts+13))
  1326. }
  1327. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  1328. (*FILE)(unsafe.Pointer(f)).rpos--
  1329. } else {
  1330. }
  1331. if !(pok != 0) {
  1332. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22
  1333. X__shlim(tls, f, int64(0))
  1334. return float64(0)
  1335. }
  1336. for PostDecUint64(&i, 1) != 0 {
  1337. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  1338. (*FILE)(unsafe.Pointer(f)).rpos--
  1339. } else {
  1340. }
  1341. }
  1342. return float64(X__builtin_nanf(tls, ts+13))
  1343. }
  1344. return float64(X__builtin_nanf(tls, ts+13))
  1345. }
  1346. if i != 0 {
  1347. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  1348. (*FILE)(unsafe.Pointer(f)).rpos--
  1349. } else {
  1350. }
  1351. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22
  1352. X__shlim(tls, f, int64(0))
  1353. return float64(0)
  1354. }
  1355. if c == '0' {
  1356. c = func() int32 {
  1357. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1358. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1359. }
  1360. return X__shgetc(tls, f)
  1361. }()
  1362. if c|32 == 'x' {
  1363. return hexfloat(tls, f, bits, emin, sign, pok)
  1364. }
  1365. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  1366. (*FILE)(unsafe.Pointer(f)).rpos--
  1367. } else {
  1368. }
  1369. c = '0'
  1370. }
  1371. return decfloat(tls, f, c, bits, emin, sign, pok)
  1372. }
  1373. // Lookup table for digit values. -1==255>=36 -> invalid
  1374. var table1 = [257]uint8{Uint8FromInt32(-1),
  1375. Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1),
  1376. Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1),
  1377. Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1),
  1378. uint8(0), uint8(1), uint8(2), uint8(3), uint8(4), uint8(5), uint8(6), uint8(7), uint8(8), uint8(9), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1),
  1379. Uint8FromInt32(-1), uint8(10), uint8(11), uint8(12), uint8(13), uint8(14), uint8(15), uint8(16), uint8(17), uint8(18), uint8(19), uint8(20), uint8(21), uint8(22), uint8(23), uint8(24),
  1380. uint8(25), uint8(26), uint8(27), uint8(28), uint8(29), uint8(30), uint8(31), uint8(32), uint8(33), uint8(34), uint8(35), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1),
  1381. Uint8FromInt32(-1), uint8(10), uint8(11), uint8(12), uint8(13), uint8(14), uint8(15), uint8(16), uint8(17), uint8(18), uint8(19), uint8(20), uint8(21), uint8(22), uint8(23), uint8(24),
  1382. uint8(25), uint8(26), uint8(27), uint8(28), uint8(29), uint8(30), uint8(31), uint8(32), uint8(33), uint8(34), uint8(35), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1),
  1383. Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1),
  1384. Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1),
  1385. Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1),
  1386. Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1),
  1387. Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1),
  1388. Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1),
  1389. Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1),
  1390. Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1),
  1391. } /* intscan.c:7:28 */
  1392. func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */
  1393. var val uintptr
  1394. var c int32
  1395. var neg int32
  1396. var x uint32
  1397. var y uint64
  1398. var bs int32
  1399. val = uintptr(unsafe.Pointer(&table1)) + uintptr(1)
  1400. neg = 0
  1401. if !(base > uint32(36) || base == uint32(1)) {
  1402. goto __1
  1403. }
  1404. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22
  1405. return uint64(0)
  1406. __1:
  1407. ;
  1408. __2:
  1409. if !(__isspace(tls, AssignInt32(&c, func() int32 {
  1410. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1411. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1412. }
  1413. return X__shgetc(tls, f)
  1414. }())) != 0) {
  1415. goto __3
  1416. }
  1417. goto __2
  1418. __3:
  1419. ;
  1420. if !(c == '+' || c == '-') {
  1421. goto __4
  1422. }
  1423. neg = -Bool32(c == '-')
  1424. c = func() int32 {
  1425. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1426. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1427. }
  1428. return X__shgetc(tls, f)
  1429. }()
  1430. __4:
  1431. ;
  1432. if !((base == uint32(0) || base == uint32(16)) && c == '0') {
  1433. goto __5
  1434. }
  1435. c = func() int32 {
  1436. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1437. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1438. }
  1439. return X__shgetc(tls, f)
  1440. }()
  1441. if !(c|32 == 'x') {
  1442. goto __7
  1443. }
  1444. c = func() int32 {
  1445. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1446. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1447. }
  1448. return X__shgetc(tls, f)
  1449. }()
  1450. if !(int32(*(*uint8)(unsafe.Pointer(val + uintptr(c)))) >= 16) {
  1451. goto __9
  1452. }
  1453. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  1454. (*FILE)(unsafe.Pointer(f)).rpos--
  1455. } else {
  1456. }
  1457. if !(pok != 0) {
  1458. goto __10
  1459. }
  1460. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  1461. (*FILE)(unsafe.Pointer(f)).rpos--
  1462. } else {
  1463. }
  1464. goto __11
  1465. __10:
  1466. X__shlim(tls, f, int64(0))
  1467. __11:
  1468. ;
  1469. return uint64(0)
  1470. __9:
  1471. ;
  1472. base = uint32(16)
  1473. goto __8
  1474. __7:
  1475. if !(base == uint32(0)) {
  1476. goto __12
  1477. }
  1478. base = uint32(8)
  1479. __12:
  1480. ;
  1481. __8:
  1482. ;
  1483. goto __6
  1484. __5:
  1485. if !(base == uint32(0)) {
  1486. goto __13
  1487. }
  1488. base = uint32(10)
  1489. __13:
  1490. ;
  1491. if !(uint32(*(*uint8)(unsafe.Pointer(val + uintptr(c)))) >= base) {
  1492. goto __14
  1493. }
  1494. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  1495. (*FILE)(unsafe.Pointer(f)).rpos--
  1496. } else {
  1497. }
  1498. X__shlim(tls, f, int64(0))
  1499. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22
  1500. return uint64(0)
  1501. __14:
  1502. ;
  1503. __6:
  1504. ;
  1505. if !(base == uint32(10)) {
  1506. goto __15
  1507. }
  1508. x = uint32(0)
  1509. __17:
  1510. if !(uint32(c-'0') < 10 && x <= 0xffffffff/uint32(10)-uint32(1)) {
  1511. goto __19
  1512. }
  1513. x = x*uint32(10) + uint32(c-'0')
  1514. goto __18
  1515. __18:
  1516. c = func() int32 {
  1517. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1518. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1519. }
  1520. return X__shgetc(tls, f)
  1521. }()
  1522. goto __17
  1523. goto __19
  1524. __19:
  1525. ;
  1526. y = uint64(x)
  1527. __20:
  1528. if !(uint32(c-'0') < 10 && y <= (2*uint64(0x7fffffffffffffff)+uint64(1))/uint64(10) && uint64(10)*y <= 2*uint64(0x7fffffffffffffff)+uint64(1)-uint64(c-'0')) {
  1529. goto __22
  1530. }
  1531. y = y*uint64(10) + uint64(c-'0')
  1532. goto __21
  1533. __21:
  1534. c = func() int32 {
  1535. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1536. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1537. }
  1538. return X__shgetc(tls, f)
  1539. }()
  1540. goto __20
  1541. goto __22
  1542. __22:
  1543. ;
  1544. if !(uint32(c-'0') >= 10) {
  1545. goto __23
  1546. }
  1547. goto done
  1548. __23:
  1549. ;
  1550. goto __16
  1551. __15:
  1552. if !!(base&(base-uint32(1)) != 0) {
  1553. goto __24
  1554. }
  1555. bs = int32(*(*uint8)(unsafe.Pointer(ts + 14 + uintptr(uint32(0x17)*base>>5&uint32(7)))))
  1556. x = uint32(0)
  1557. __26:
  1558. if !(uint32(*(*uint8)(unsafe.Pointer(val + uintptr(c)))) < base && x <= 0xffffffff/uint32(32)) {
  1559. goto __28
  1560. }
  1561. x = x<<bs | uint32(*(*uint8)(unsafe.Pointer(val + uintptr(c))))
  1562. goto __27
  1563. __27:
  1564. c = func() int32 {
  1565. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1566. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1567. }
  1568. return X__shgetc(tls, f)
  1569. }()
  1570. goto __26
  1571. goto __28
  1572. __28:
  1573. ;
  1574. y = uint64(x)
  1575. __29:
  1576. if !(uint32(*(*uint8)(unsafe.Pointer(val + uintptr(c)))) < base && y <= uint64(2*uint64(0x7fffffffffffffff)+uint64(1))>>bs) {
  1577. goto __31
  1578. }
  1579. y = y<<bs | uint64(*(*uint8)(unsafe.Pointer(val + uintptr(c))))
  1580. goto __30
  1581. __30:
  1582. c = func() int32 {
  1583. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1584. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1585. }
  1586. return X__shgetc(tls, f)
  1587. }()
  1588. goto __29
  1589. goto __31
  1590. __31:
  1591. ;
  1592. goto __25
  1593. __24:
  1594. x = uint32(0)
  1595. __32:
  1596. if !(uint32(*(*uint8)(unsafe.Pointer(val + uintptr(c)))) < base && x <= 0xffffffff/uint32(36)-uint32(1)) {
  1597. goto __34
  1598. }
  1599. x = x*base + uint32(*(*uint8)(unsafe.Pointer(val + uintptr(c))))
  1600. goto __33
  1601. __33:
  1602. c = func() int32 {
  1603. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1604. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1605. }
  1606. return X__shgetc(tls, f)
  1607. }()
  1608. goto __32
  1609. goto __34
  1610. __34:
  1611. ;
  1612. y = uint64(x)
  1613. __35:
  1614. if !(uint32(*(*uint8)(unsafe.Pointer(val + uintptr(c)))) < base && y <= (2*uint64(0x7fffffffffffffff)+uint64(1))/uint64(base) && uint64(base)*y <= 2*uint64(0x7fffffffffffffff)+uint64(1)-uint64(*(*uint8)(unsafe.Pointer(val + uintptr(c))))) {
  1615. goto __37
  1616. }
  1617. y = y*uint64(base) + uint64(*(*uint8)(unsafe.Pointer(val + uintptr(c))))
  1618. goto __36
  1619. __36:
  1620. c = func() int32 {
  1621. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1622. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1623. }
  1624. return X__shgetc(tls, f)
  1625. }()
  1626. goto __35
  1627. goto __37
  1628. __37:
  1629. ;
  1630. __25:
  1631. ;
  1632. __16:
  1633. ;
  1634. if !(uint32(*(*uint8)(unsafe.Pointer(val + uintptr(c)))) < base) {
  1635. goto __38
  1636. }
  1637. __39:
  1638. if !(uint32(*(*uint8)(unsafe.Pointer(val + uintptr(c)))) < base) {
  1639. goto __41
  1640. }
  1641. goto __40
  1642. __40:
  1643. c = func() int32 {
  1644. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  1645. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  1646. }
  1647. return X__shgetc(tls, f)
  1648. }()
  1649. goto __39
  1650. goto __41
  1651. __41:
  1652. ;
  1653. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 34
  1654. y = lim
  1655. if !(lim&uint64(1) != 0) {
  1656. goto __42
  1657. }
  1658. neg = 0
  1659. __42:
  1660. ;
  1661. __38:
  1662. ;
  1663. done:
  1664. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  1665. (*FILE)(unsafe.Pointer(f)).rpos--
  1666. } else {
  1667. }
  1668. if !(y >= lim) {
  1669. goto __43
  1670. }
  1671. if !(!(lim&uint64(1) != 0) && !(neg != 0)) {
  1672. goto __44
  1673. }
  1674. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 34
  1675. return lim - uint64(1)
  1676. goto __45
  1677. __44:
  1678. if !(y > lim) {
  1679. goto __46
  1680. }
  1681. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 34
  1682. return lim
  1683. __46:
  1684. ;
  1685. __45:
  1686. ;
  1687. __43:
  1688. ;
  1689. return y ^ uint64(neg) - uint64(neg)
  1690. }
  1691. // The shcnt field stores the number of bytes read so far, offset by
  1692. // the value of buf-rpos at the last function call (__shlim or __shgetc),
  1693. // so that between calls the inline shcnt macro can add rpos-buf to get
  1694. // the actual count.
  1695. func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */
  1696. (*FILE)(unsafe.Pointer(f)).shlim = lim
  1697. (*FILE)(unsafe.Pointer(f)).shcnt = (int64((*FILE)(unsafe.Pointer(f)).buf) - int64((*FILE)(unsafe.Pointer(f)).rpos)) / 1
  1698. // If lim is nonzero, rend must be a valid pointer.
  1699. if lim != 0 && (int64((*FILE)(unsafe.Pointer(f)).rend)-int64((*FILE)(unsafe.Pointer(f)).rpos))/1 > lim {
  1700. (*FILE)(unsafe.Pointer(f)).shend = (*FILE)(unsafe.Pointer(f)).rpos + uintptr(lim)
  1701. } else {
  1702. (*FILE)(unsafe.Pointer(f)).shend = (*FILE)(unsafe.Pointer(f)).rend
  1703. }
  1704. }
  1705. func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */
  1706. var c int32
  1707. var cnt off_t = (*FILE)(unsafe.Pointer(f)).shcnt + (int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1
  1708. if (*FILE)(unsafe.Pointer(f)).shlim != 0 && cnt >= (*FILE)(unsafe.Pointer(f)).shlim || AssignInt32(&c, X__uflow(tls, f)) < 0 {
  1709. (*FILE)(unsafe.Pointer(f)).shcnt = (int64((*FILE)(unsafe.Pointer(f)).buf)-int64((*FILE)(unsafe.Pointer(f)).rpos))/1 + cnt
  1710. (*FILE)(unsafe.Pointer(f)).shend = (*FILE)(unsafe.Pointer(f)).rpos
  1711. (*FILE)(unsafe.Pointer(f)).shlim = int64(-1)
  1712. return -1
  1713. }
  1714. cnt++
  1715. if (*FILE)(unsafe.Pointer(f)).shlim != 0 && (int64((*FILE)(unsafe.Pointer(f)).rend)-int64((*FILE)(unsafe.Pointer(f)).rpos))/1 > (*FILE)(unsafe.Pointer(f)).shlim-cnt {
  1716. (*FILE)(unsafe.Pointer(f)).shend = (*FILE)(unsafe.Pointer(f)).rpos + uintptr((*FILE)(unsafe.Pointer(f)).shlim-cnt)
  1717. } else {
  1718. (*FILE)(unsafe.Pointer(f)).shend = (*FILE)(unsafe.Pointer(f)).rend
  1719. }
  1720. (*FILE)(unsafe.Pointer(f)).shcnt = (int64((*FILE)(unsafe.Pointer(f)).buf)-int64((*FILE)(unsafe.Pointer(f)).rpos))/1 + cnt
  1721. if (*FILE)(unsafe.Pointer(f)).rpos <= (*FILE)(unsafe.Pointer(f)).buf {
  1722. *(*uint8)(unsafe.Pointer((*FILE)(unsafe.Pointer(f)).rpos + UintptrFromInt32(-1))) = uint8(c)
  1723. }
  1724. return c
  1725. }
  1726. type lconv = struct {
  1727. decimal_point uintptr
  1728. thousands_sep uintptr
  1729. grouping uintptr
  1730. int_curr_symbol uintptr
  1731. currency_symbol uintptr
  1732. mon_decimal_point uintptr
  1733. mon_thousands_sep uintptr
  1734. mon_grouping uintptr
  1735. positive_sign uintptr
  1736. negative_sign uintptr
  1737. int_frac_digits uint8
  1738. frac_digits uint8
  1739. p_cs_precedes uint8
  1740. p_sep_by_space uint8
  1741. n_cs_precedes uint8
  1742. n_sep_by_space uint8
  1743. p_sign_posn uint8
  1744. n_sign_posn uint8
  1745. int_p_cs_precedes uint8
  1746. int_p_sep_by_space uint8
  1747. int_n_cs_precedes uint8
  1748. int_n_sep_by_space uint8
  1749. int_p_sign_posn uint8
  1750. int_n_sign_posn uint8
  1751. _ [2]byte
  1752. } /* locale.h:24:1 */
  1753. // Support signed or unsigned plain-char
  1754. // Implementation choices...
  1755. // Arbitrary numbers...
  1756. // POSIX/SUS requirements follow. These numbers come directly
  1757. // from SUS and have nothing to do with the host system.
  1758. var posix_lconv = lconv{decimal_point: ts + 23, thousands_sep: ts + 13, grouping: ts + 13, int_curr_symbol: ts + 13, currency_symbol: ts + 13, mon_decimal_point: ts + 13, mon_thousands_sep: ts + 13, mon_grouping: ts + 13, positive_sign: ts + 13, negative_sign: ts + 13, int_frac_digits: uint8(255), frac_digits: uint8(255), p_cs_precedes: uint8(255), p_sep_by_space: uint8(255), n_cs_precedes: uint8(255), n_sep_by_space: uint8(255), p_sign_posn: uint8(255), n_sign_posn: uint8(255), int_p_cs_precedes: uint8(255), int_p_sep_by_space: uint8(255), int_n_cs_precedes: uint8(255), int_n_sep_by_space: uint8(255), int_p_sign_posn: uint8(255), int_n_sign_posn: uint8(255)} /* localeconv.c:4:27 */
  1759. func Xlocaleconv(tls *TLS) uintptr { /* localeconv.c:31:14: */
  1760. return uintptr(unsafe.Pointer(&posix_lconv))
  1761. }
  1762. func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */
  1763. bp := tls.Alloc(8)
  1764. defer tls.Free(8)
  1765. *(*struct{ f float64 })(unsafe.Pointer(bp)) = func() (r struct{ f float64 }) {
  1766. *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = x
  1767. return r
  1768. }()
  1769. var e int32 = int32(*(*uint64_t)(unsafe.Pointer(bp)) >> 52 & uint64(0x7ff))
  1770. if !(e != 0) {
  1771. if *(*uint64_t)(unsafe.Pointer(bp))<<1 != 0 {
  1772. return 3
  1773. }
  1774. return 2
  1775. }
  1776. if e == 0x7ff {
  1777. if *(*uint64_t)(unsafe.Pointer(bp))<<12 != 0 {
  1778. return 0
  1779. }
  1780. return 1
  1781. }
  1782. return 4
  1783. }
  1784. func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */
  1785. bp := tls.Alloc(4)
  1786. defer tls.Free(4)
  1787. *(*struct{ f float32 })(unsafe.Pointer(bp)) = func() (r struct{ f float32 }) {
  1788. *(*float32)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = x
  1789. return r
  1790. }()
  1791. var e int32 = int32(*(*uint32_t)(unsafe.Pointer(bp)) >> 23 & uint32_t(0xff))
  1792. if !(e != 0) {
  1793. if *(*uint32_t)(unsafe.Pointer(bp))<<1 != 0 {
  1794. return 3
  1795. }
  1796. return 2
  1797. }
  1798. if e == 0xff {
  1799. if *(*uint32_t)(unsafe.Pointer(bp))<<9 != 0 {
  1800. return 0
  1801. }
  1802. return 1
  1803. }
  1804. return 4
  1805. }
  1806. func X__fpclassifyl(tls *TLS, x float64) int32 { /* __fpclassifyl.c:4:5: */
  1807. return X__fpclassify(tls, x)
  1808. }
  1809. func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */
  1810. return Xcopysign(tls, x, y)
  1811. }
  1812. func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */
  1813. return Xfabs(tls, x)
  1814. }
  1815. func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */
  1816. return Xfmod(tls, x, y)
  1817. }
  1818. func Xnanf(tls *TLS, s uintptr) float32 { /* nanf.c:3:7: */
  1819. return X__builtin_nanf(tls, ts+13)
  1820. }
  1821. var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */
  1822. func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */
  1823. bp := tls.Alloc(8)
  1824. defer tls.Free(8)
  1825. *(*struct{ f float64 })(unsafe.Pointer(bp)) = func() (r struct{ f float64 }) {
  1826. *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = x
  1827. return r
  1828. }()
  1829. var e int32 = int32(*(*uint64_t)(unsafe.Pointer(bp)) >> 52 & uint64(0x7ff))
  1830. var s int32 = int32(*(*uint64_t)(unsafe.Pointer(bp)) >> 63)
  1831. var y double_t
  1832. if e >= 0x3ff+52 {
  1833. return x
  1834. }
  1835. if s != 0 {
  1836. y = x - toint + toint
  1837. } else {
  1838. y = x + toint - toint
  1839. }
  1840. if y == float64(0) {
  1841. if s != 0 {
  1842. return -Float64FromFloat64(0.0)
  1843. }
  1844. return float64(0)
  1845. }
  1846. return y
  1847. }
  1848. func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */
  1849. bp := tls.Alloc(8)
  1850. defer tls.Free(8)
  1851. // var u struct {f float64;} at bp, 8
  1852. var y double_t = x
  1853. if n > 1023 {
  1854. y = y * 0x1p1023
  1855. n = n - 1023
  1856. if n > 1023 {
  1857. y = y * 0x1p1023
  1858. n = n - 1023
  1859. if n > 1023 {
  1860. n = 1023
  1861. }
  1862. }
  1863. } else if n < -1022 {
  1864. // make sure final n < -53 to avoid double
  1865. // rounding in the subnormal range
  1866. y = y * (float64(0x1p-1022) * 0x1p53)
  1867. n = n + (1022 - 53)
  1868. if n < -1022 {
  1869. y = y * (float64(0x1p-1022) * 0x1p53)
  1870. n = n + (1022 - 53)
  1871. if n < -1022 {
  1872. n = -1022
  1873. }
  1874. }
  1875. }
  1876. *(*uint64_t)(unsafe.Pointer(bp)) = uint64_t(0x3ff+n) << 52
  1877. x = y * *(*float64)(unsafe.Pointer(bp))
  1878. return x
  1879. }
  1880. func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */
  1881. return Xscalbn(tls, x, n)
  1882. }
  1883. // Support signed or unsigned plain-char
  1884. // Implementation choices...
  1885. // Arbitrary numbers...
  1886. // POSIX/SUS requirements follow. These numbers come directly
  1887. // from SUS and have nothing to do with the host system.
  1888. type __locale_map = struct {
  1889. __map uintptr
  1890. map_size size_t
  1891. name [24]uint8
  1892. next uintptr
  1893. } /* alltypes.h:335:9 */
  1894. type tls_module = struct {
  1895. next uintptr
  1896. image uintptr
  1897. len size_t
  1898. size size_t
  1899. align size_t
  1900. offset size_t
  1901. } /* libc.h:14:1 */
  1902. type __libc = struct {
  1903. can_do_threads uint8
  1904. threaded uint8
  1905. secure uint8
  1906. need_locks int8
  1907. threads_minus_1 int32
  1908. auxv uintptr
  1909. tls_head uintptr
  1910. tls_size size_t
  1911. tls_align size_t
  1912. tls_cnt size_t
  1913. page_size size_t
  1914. global_locale struct{ cat [6]uintptr }
  1915. } /* libc.h:20:1 */
  1916. type time_t = int64 /* alltypes.h:77:16 */
  1917. type clockid_t = int32 /* alltypes.h:206:13 */
  1918. type timespec = struct {
  1919. tv_sec time_t
  1920. tv_nsec int64
  1921. } /* alltypes.h:221:1 */
  1922. type pthread_t = uintptr /* alltypes.h:265:26 */
  1923. type pthread_once_t = int32 /* alltypes.h:271:13 */
  1924. type pthread_key_t = uint32 /* alltypes.h:276:18 */
  1925. type pthread_spinlock_t = int32 /* alltypes.h:281:13 */
  1926. type pthread_mutexattr_t = struct{ __attr uint32 } /* alltypes.h:286:37 */
  1927. type pthread_condattr_t = struct{ __attr uint32 } /* alltypes.h:291:37 */
  1928. type pthread_barrierattr_t = struct{ __attr uint32 } /* alltypes.h:296:37 */
  1929. type pthread_rwlockattr_t = struct{ __attr [2]uint32 } /* alltypes.h:301:40 */
  1930. type __sigset_t = struct{ __bits [16]uint64 } /* alltypes.h:341:9 */
  1931. type sigset_t = __sigset_t /* alltypes.h:341:71 */
  1932. type pthread_attr_t = struct {
  1933. __u struct {
  1934. _ [0]uint64
  1935. __i [14]int32
  1936. }
  1937. } /* alltypes.h:364:147 */
  1938. type pthread_mutex_t = struct {
  1939. __u struct {
  1940. _ [0]uint64
  1941. __i [10]int32
  1942. }
  1943. } /* alltypes.h:369:157 */
  1944. type pthread_cond_t = struct {
  1945. __u struct {
  1946. _ [0]uint64
  1947. __i [12]int32
  1948. }
  1949. } /* alltypes.h:379:112 */
  1950. type pthread_rwlock_t = struct {
  1951. __u struct {
  1952. _ [0]uint64
  1953. __i [14]int32
  1954. }
  1955. } /* alltypes.h:389:139 */
  1956. type pthread_barrier_t = struct {
  1957. __u struct {
  1958. _ [0]uint64
  1959. __i [8]int32
  1960. }
  1961. } /* alltypes.h:394:137 */
  1962. type sched_param = struct {
  1963. sched_priority int32
  1964. __reserved1 int32
  1965. __reserved2 [2]struct {
  1966. __reserved1 time_t
  1967. __reserved2 int64
  1968. }
  1969. __reserved3 int32
  1970. _ [4]byte
  1971. } /* sched.h:19:1 */
  1972. type timer_t = uintptr /* alltypes.h:201:14 */
  1973. type clock_t = int64 /* alltypes.h:211:14 */
  1974. type tm = struct {
  1975. tm_sec int32
  1976. tm_min int32
  1977. tm_hour int32
  1978. tm_mday int32
  1979. tm_mon int32
  1980. tm_year int32
  1981. tm_wday int32
  1982. tm_yday int32
  1983. tm_isdst int32
  1984. _ [4]byte
  1985. tm_gmtoff int64
  1986. tm_zone uintptr
  1987. } /* time.h:38:1 */
  1988. type itimerspec = struct {
  1989. it_interval struct {
  1990. tv_sec time_t
  1991. tv_nsec int64
  1992. }
  1993. it_value struct {
  1994. tv_sec time_t
  1995. tv_nsec int64
  1996. }
  1997. } /* time.h:80:1 */
  1998. type sigevent = struct {
  1999. sigev_value struct {
  2000. _ [0]uint64
  2001. sival_int int32
  2002. _ [4]byte
  2003. }
  2004. sigev_signo int32
  2005. sigev_notify int32
  2006. sigev_notify_function uintptr
  2007. sigev_notify_attributes uintptr
  2008. __pad [32]uint8
  2009. } /* time.h:107:1 */
  2010. type __ptcb = struct {
  2011. __f uintptr
  2012. __x uintptr
  2013. __next uintptr
  2014. } /* alltypes.h:265:9 */
  2015. type sigaltstack = struct {
  2016. ss_sp uintptr
  2017. ss_flags int32
  2018. _ [4]byte
  2019. ss_size size_t
  2020. } /* signal.h:44:9 */
  2021. type stack_t = sigaltstack /* signal.h:44:28 */
  2022. type greg_t = uint64 /* signal.h:11:23 */
  2023. type gregset_t = [48]uint64 /* signal.h:11:31 */
  2024. type fpregset_t = [33]float64 /* signal.h:12:16 */
  2025. type vrregset_t = struct {
  2026. vrregs [32][4]uint32
  2027. vscr struct {
  2028. vscr_word uint32
  2029. _pad [3]uint32
  2030. }
  2031. vrsave uint32
  2032. _pad [3]uint32
  2033. } /* signal.h:27:3 */
  2034. type sigcontext = struct {
  2035. _unused [4]uint64
  2036. signal int32
  2037. _pad0 int32
  2038. handler uint64
  2039. oldmask uint64
  2040. regs uintptr
  2041. gp_regs gregset_t
  2042. fp_regs fpregset_t
  2043. v_regs uintptr
  2044. vmx_reserve [101]int64
  2045. } /* signal.h:29:9 */
  2046. type mcontext_t = sigcontext /* signal.h:40:3 */
  2047. type __ucontext = struct {
  2048. uc_flags uint64
  2049. uc_link uintptr
  2050. uc_stack stack_t
  2051. uc_sigmask sigset_t
  2052. uc_mcontext mcontext_t
  2053. } /* signal.h:56:9 */
  2054. type ucontext_t = __ucontext /* signal.h:62:3 */
  2055. type sigval = struct {
  2056. _ [0]uint64
  2057. sival_int int32
  2058. _ [4]byte
  2059. } /* time.h:107:1 */
  2060. type siginfo_t = struct {
  2061. si_signo int32
  2062. si_errno int32
  2063. si_code int32
  2064. _ [4]byte
  2065. __si_fields struct {
  2066. _ [0]uint64
  2067. __pad [112]uint8
  2068. }
  2069. } /* signal.h:145:3 */
  2070. type sigaction = struct {
  2071. __sa_handler struct{ sa_handler uintptr }
  2072. sa_mask sigset_t
  2073. sa_flags int32
  2074. _ [4]byte
  2075. sa_restorer uintptr
  2076. } /* signal.h:167:1 */
  2077. type sig_t = uintptr /* signal.h:251:14 */
  2078. type sig_atomic_t = int32 /* signal.h:269:13 */
  2079. func a_ll(tls *TLS, p uintptr) int32 { /* atomic_arch.h:2:19: */
  2080. var v int32
  2081. panic(`arch/powerpc64/atomic_arch.h:5:2: assembler statements not supported`)
  2082. return v
  2083. }
  2084. func a_sc(tls *TLS, p uintptr, v int32) int32 { /* atomic_arch.h:10:19: */
  2085. var r int32
  2086. panic(`arch/powerpc64/atomic_arch.h:13:2: assembler statements not supported`)
  2087. return r & 0x20000000 // "bit 2" of "cr0" (backwards bit order)
  2088. }
  2089. func a_ll_p(tls *TLS, p uintptr) uintptr { /* atomic_arch.h:20:20: */
  2090. var v uintptr
  2091. panic(`arch/powerpc64/atomic_arch.h:23:2: assembler statements not supported`)
  2092. return v
  2093. }
  2094. func a_sc_p(tls *TLS, p uintptr, v uintptr) int32 { /* atomic_arch.h:28:19: */
  2095. var r int32
  2096. panic(`arch/powerpc64/atomic_arch.h:31:2: assembler statements not supported`)
  2097. return r & 0x20000000 // "bit 2" of "cr0" (backwards bit order)
  2098. }
  2099. func a_barrier(tls *TLS) { /* atomic_arch.h:38:20: */
  2100. panic(`arch/powerpc64/atomic_arch.h:40:2: assembler statements not supported`)
  2101. }
  2102. func a_post_llsc(tls *TLS) { /* atomic_arch.h:46:20: */
  2103. panic(`arch/powerpc64/atomic_arch.h:48:2: assembler statements not supported`)
  2104. }
  2105. func a_cas(tls *TLS, p uintptr, t int32, s int32) int32 { /* atomic.h:20:19: */
  2106. var old int32
  2107. a_barrier(tls)
  2108. for __ccgo := true; __ccgo; __ccgo = old == t && !(a_sc(tls, p, s) != 0) {
  2109. old = a_ll(tls, p)
  2110. }
  2111. a_post_llsc(tls)
  2112. return old
  2113. }
  2114. func a_swap(tls *TLS, p uintptr, v int32) int32 { /* atomic.h:33:19: */
  2115. var old int32
  2116. a_barrier(tls)
  2117. for __ccgo := true; __ccgo; __ccgo = !(a_sc(tls, p, v) != 0) {
  2118. old = a_ll(tls, p)
  2119. }
  2120. a_post_llsc(tls)
  2121. return old
  2122. }
  2123. func a_fetch_add(tls *TLS, p uintptr, v int32) int32 { /* atomic.h:46:19: */
  2124. var old int32
  2125. a_barrier(tls)
  2126. for __ccgo := true; __ccgo; __ccgo = !(a_sc(tls, p, int32(uint32(old)+uint32(v))) != 0) {
  2127. old = a_ll(tls, p)
  2128. }
  2129. a_post_llsc(tls)
  2130. return old
  2131. }
  2132. func a_fetch_and(tls *TLS, p uintptr, v int32) int32 { /* atomic.h:59:19: */
  2133. var old int32
  2134. a_barrier(tls)
  2135. for __ccgo := true; __ccgo; __ccgo = !(a_sc(tls, p, old&v) != 0) {
  2136. old = a_ll(tls, p)
  2137. }
  2138. a_post_llsc(tls)
  2139. return old
  2140. }
  2141. func a_fetch_or(tls *TLS, p uintptr, v int32) int32 { /* atomic.h:72:19: */
  2142. var old int32
  2143. a_barrier(tls)
  2144. for __ccgo := true; __ccgo; __ccgo = !(a_sc(tls, p, old|v) != 0) {
  2145. old = a_ll(tls, p)
  2146. }
  2147. a_post_llsc(tls)
  2148. return old
  2149. }
  2150. func a_and(tls *TLS, p uintptr, v int32) { /* atomic.h:151:20: */
  2151. a_fetch_and(tls, p, v)
  2152. }
  2153. func a_or(tls *TLS, p uintptr, v int32) { /* atomic.h:159:20: */
  2154. a_fetch_or(tls, p, v)
  2155. }
  2156. func a_or_64(tls *TLS, p uintptr, v uint64_t) { /* atomic.h:220:20: */
  2157. bp := tls.Alloc(8)
  2158. defer tls.Free(8)
  2159. *(*struct{ v uint64_t })(unsafe.Pointer(bp)) = func() (r struct{ v uint64_t }) {
  2160. *(*uint64_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = v
  2161. return r
  2162. }()
  2163. if *(*uint32_t)(unsafe.Pointer(bp)) != 0 {
  2164. a_or(tls, p, int32(*(*uint32_t)(unsafe.Pointer(bp))))
  2165. }
  2166. if *(*uint32_t)(unsafe.Pointer(bp + 1*4)) != 0 {
  2167. a_or(tls, p+uintptr(1)*4, int32(*(*uint32_t)(unsafe.Pointer(bp + 1*4))))
  2168. }
  2169. }
  2170. func a_ctz_32(tls *TLS, x uint32_t) int32 { /* atomic.h:256:19: */
  2171. return int32(_sdebruijn328[x&-x*uint32_t(0x076be629)>>27])
  2172. }
  2173. var _sdebruijn328 = [32]uint8{
  2174. uint8(0), uint8(1), uint8(23), uint8(2), uint8(29), uint8(24), uint8(19), uint8(3), uint8(30), uint8(27), uint8(25), uint8(11), uint8(20), uint8(8), uint8(4), uint8(13),
  2175. uint8(31), uint8(22), uint8(28), uint8(18), uint8(26), uint8(10), uint8(7), uint8(12), uint8(21), uint8(17), uint8(9), uint8(6), uint8(16), uint8(5), uint8(15), uint8(14),
  2176. } /* atomic.h:261:20 */
  2177. func a_ctz_64(tls *TLS, x uint64_t) int32 { /* atomic.h:272:19: */
  2178. if uint64(unsafe.Sizeof(int64(0))) < uint64(8) {
  2179. var y uint32_t = uint32_t(x)
  2180. if !(y != 0) {
  2181. y = uint32_t(x >> 32)
  2182. return 32 + a_ctz_32(tls, y)
  2183. }
  2184. return a_ctz_32(tls, y)
  2185. }
  2186. return int32(_sdebruijn648[uint64(x&-x)*0x022fdd63cc95386d>>58])
  2187. }
  2188. var _sdebruijn648 = [64]uint8{
  2189. uint8(0), uint8(1), uint8(2), uint8(53), uint8(3), uint8(7), uint8(54), uint8(27), uint8(4), uint8(38), uint8(41), uint8(8), uint8(34), uint8(55), uint8(48), uint8(28),
  2190. uint8(62), uint8(5), uint8(39), uint8(46), uint8(44), uint8(42), uint8(22), uint8(9), uint8(24), uint8(35), uint8(59), uint8(56), uint8(49), uint8(18), uint8(29), uint8(11),
  2191. uint8(63), uint8(52), uint8(6), uint8(26), uint8(37), uint8(40), uint8(33), uint8(47), uint8(61), uint8(45), uint8(43), uint8(21), uint8(23), uint8(58), uint8(17), uint8(10),
  2192. uint8(51), uint8(25), uint8(36), uint8(32), uint8(60), uint8(20), uint8(57), uint8(16), uint8(50), uint8(31), uint8(19), uint8(15), uint8(30), uint8(14), uint8(13), uint8(12),
  2193. } /* atomic.h:274:20 */
  2194. type __timer = struct {
  2195. timerid int32
  2196. _ [4]byte
  2197. thread pthread_t
  2198. } /* pthread_impl.h:64:1 */
  2199. func __pthread_self(tls *TLS) uintptr { /* pthread_arch.h:1:30: */
  2200. var tp uintptr
  2201. panic(`arch/powerpc64/pthread_arch.h:4:2: assembler statements not supported`)
  2202. return tp - uintptr(0x7000) - uintptr(uint64(unsafe.Sizeof(__pthread{})))
  2203. }
  2204. func __wake(tls *TLS, addr uintptr, cnt int32, priv int32) { /* pthread_impl.h:155:20: */
  2205. if priv != 0 {
  2206. priv = 128
  2207. }
  2208. if cnt < 0 {
  2209. cnt = 0x7fffffff
  2210. }
  2211. _ = Bool32(__syscall3(tls, int64(221), int64(addr), int64(1|priv), int64(cnt)) != int64(-38) || __syscall3(tls, int64(221), int64(addr), int64(1), int64(cnt)) != 0)
  2212. }
  2213. func __futexwait(tls *TLS, addr uintptr, val int32, priv int32) { /* pthread_impl.h:162:20: */
  2214. if priv != 0 {
  2215. priv = 128
  2216. }
  2217. _ = Bool32(__syscall4(tls, int64(221), int64(addr), int64(0|priv), int64(val), int64(0)) != int64(-38) || __syscall4(tls, int64(221), int64(addr), int64(0), int64(val), int64(0)) != 0)
  2218. }
  2219. var X__fsmu8 = [51]uint32_t{
  2220. func() uint32 {
  2221. if 0x2 < 2 {
  2222. return Uint32FromInt32(-1)
  2223. }
  2224. return func() uint32 {
  2225. if Int32(0x80) == Int32(0x80) {
  2226. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2227. }
  2228. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2229. }()<<23 | uint32_t(0x2)
  2230. }(), func() uint32 {
  2231. if 0x3 < 2 {
  2232. return Uint32FromInt32(-1)
  2233. }
  2234. return func() uint32 {
  2235. if Int32(0x80) == Int32(0x80) {
  2236. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2237. }
  2238. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2239. }()<<23 | uint32_t(0x3)
  2240. }(), func() uint32 {
  2241. if 0x4 < 2 {
  2242. return Uint32FromInt32(-1)
  2243. }
  2244. return func() uint32 {
  2245. if Int32(0x80) == Int32(0x80) {
  2246. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2247. }
  2248. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2249. }()<<23 | uint32_t(0x4)
  2250. }(), func() uint32 {
  2251. if 0x5 < 2 {
  2252. return Uint32FromInt32(-1)
  2253. }
  2254. return func() uint32 {
  2255. if Int32(0x80) == Int32(0x80) {
  2256. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2257. }
  2258. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2259. }()<<23 | uint32_t(0x5)
  2260. }(), func() uint32 {
  2261. if 0x6 < 2 {
  2262. return Uint32FromInt32(-1)
  2263. }
  2264. return func() uint32 {
  2265. if Int32(0x80) == Int32(0x80) {
  2266. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2267. }
  2268. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2269. }()<<23 | uint32_t(0x6)
  2270. }(), func() uint32 {
  2271. if 0x7 < 2 {
  2272. return Uint32FromInt32(-1)
  2273. }
  2274. return func() uint32 {
  2275. if Int32(0x80) == Int32(0x80) {
  2276. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2277. }
  2278. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2279. }()<<23 | uint32_t(0x7)
  2280. }(),
  2281. func() uint32 {
  2282. if 0x8 < 2 {
  2283. return Uint32FromInt32(-1)
  2284. }
  2285. return func() uint32 {
  2286. if Int32(0x80) == Int32(0x80) {
  2287. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2288. }
  2289. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2290. }()<<23 | uint32_t(0x8)
  2291. }(), func() uint32 {
  2292. if 0x9 < 2 {
  2293. return Uint32FromInt32(-1)
  2294. }
  2295. return func() uint32 {
  2296. if Int32(0x80) == Int32(0x80) {
  2297. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2298. }
  2299. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2300. }()<<23 | uint32_t(0x9)
  2301. }(), func() uint32 {
  2302. if 0xa < 2 {
  2303. return Uint32FromInt32(-1)
  2304. }
  2305. return func() uint32 {
  2306. if Int32(0x80) == Int32(0x80) {
  2307. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2308. }
  2309. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2310. }()<<23 | uint32_t(0xa)
  2311. }(), func() uint32 {
  2312. if 0xb < 2 {
  2313. return Uint32FromInt32(-1)
  2314. }
  2315. return func() uint32 {
  2316. if Int32(0x80) == Int32(0x80) {
  2317. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2318. }
  2319. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2320. }()<<23 | uint32_t(0xb)
  2321. }(), func() uint32 {
  2322. if 0xc < 2 {
  2323. return Uint32FromInt32(-1)
  2324. }
  2325. return func() uint32 {
  2326. if Int32(0x80) == Int32(0x80) {
  2327. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2328. }
  2329. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2330. }()<<23 | uint32_t(0xc)
  2331. }(), func() uint32 {
  2332. if 0xd < 2 {
  2333. return Uint32FromInt32(-1)
  2334. }
  2335. return func() uint32 {
  2336. if Int32(0x80) == Int32(0x80) {
  2337. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2338. }
  2339. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2340. }()<<23 | uint32_t(0xd)
  2341. }(), func() uint32 {
  2342. if 0xe < 2 {
  2343. return Uint32FromInt32(-1)
  2344. }
  2345. return func() uint32 {
  2346. if Int32(0x80) == Int32(0x80) {
  2347. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2348. }
  2349. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2350. }()<<23 | uint32_t(0xe)
  2351. }(), func() uint32 {
  2352. if 0xf < 2 {
  2353. return Uint32FromInt32(-1)
  2354. }
  2355. return func() uint32 {
  2356. if Int32(0x80) == Int32(0x80) {
  2357. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2358. }
  2359. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2360. }()<<23 | uint32_t(0xf)
  2361. }(),
  2362. func() uint32 {
  2363. if 0x0+16 < 2 {
  2364. return Uint32FromInt32(-1)
  2365. }
  2366. return func() uint32 {
  2367. if Int32(0x80) == Int32(0x80) {
  2368. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2369. }
  2370. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2371. }()<<23 | uint32_t(0x0+16)
  2372. }(), func() uint32 {
  2373. if 0x1+16 < 2 {
  2374. return Uint32FromInt32(-1)
  2375. }
  2376. return func() uint32 {
  2377. if Int32(0x80) == Int32(0x80) {
  2378. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2379. }
  2380. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2381. }()<<23 | uint32_t(0x1+16)
  2382. }(), func() uint32 {
  2383. if 0x2+16 < 2 {
  2384. return Uint32FromInt32(-1)
  2385. }
  2386. return func() uint32 {
  2387. if Int32(0x80) == Int32(0x80) {
  2388. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2389. }
  2390. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2391. }()<<23 | uint32_t(0x2+16)
  2392. }(), func() uint32 {
  2393. if 0x3+16 < 2 {
  2394. return Uint32FromInt32(-1)
  2395. }
  2396. return func() uint32 {
  2397. if Int32(0x80) == Int32(0x80) {
  2398. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2399. }
  2400. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2401. }()<<23 | uint32_t(0x3+16)
  2402. }(), func() uint32 {
  2403. if 0x4+16 < 2 {
  2404. return Uint32FromInt32(-1)
  2405. }
  2406. return func() uint32 {
  2407. if Int32(0x80) == Int32(0x80) {
  2408. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2409. }
  2410. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2411. }()<<23 | uint32_t(0x4+16)
  2412. }(), func() uint32 {
  2413. if 0x5+16 < 2 {
  2414. return Uint32FromInt32(-1)
  2415. }
  2416. return func() uint32 {
  2417. if Int32(0x80) == Int32(0x80) {
  2418. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2419. }
  2420. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2421. }()<<23 | uint32_t(0x5+16)
  2422. }(), func() uint32 {
  2423. if 0x6+16 < 2 {
  2424. return Uint32FromInt32(-1)
  2425. }
  2426. return func() uint32 {
  2427. if Int32(0x80) == Int32(0x80) {
  2428. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2429. }
  2430. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2431. }()<<23 | uint32_t(0x6+16)
  2432. }(), func() uint32 {
  2433. if 0x7+16 < 2 {
  2434. return Uint32FromInt32(-1)
  2435. }
  2436. return func() uint32 {
  2437. if Int32(0x80) == Int32(0x80) {
  2438. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2439. }
  2440. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2441. }()<<23 | uint32_t(0x7+16)
  2442. }(),
  2443. func() uint32 {
  2444. if 0x8+16 < 2 {
  2445. return Uint32FromInt32(-1)
  2446. }
  2447. return func() uint32 {
  2448. if Int32(0x80) == Int32(0x80) {
  2449. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2450. }
  2451. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2452. }()<<23 | uint32_t(0x8+16)
  2453. }(), func() uint32 {
  2454. if 0x9+16 < 2 {
  2455. return Uint32FromInt32(-1)
  2456. }
  2457. return func() uint32 {
  2458. if Int32(0x80) == Int32(0x80) {
  2459. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2460. }
  2461. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2462. }()<<23 | uint32_t(0x9+16)
  2463. }(), func() uint32 {
  2464. if 0xa+16 < 2 {
  2465. return Uint32FromInt32(-1)
  2466. }
  2467. return func() uint32 {
  2468. if Int32(0x80) == Int32(0x80) {
  2469. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2470. }
  2471. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2472. }()<<23 | uint32_t(0xa+16)
  2473. }(), func() uint32 {
  2474. if 0xb+16 < 2 {
  2475. return Uint32FromInt32(-1)
  2476. }
  2477. return func() uint32 {
  2478. if Int32(0x80) == Int32(0x80) {
  2479. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2480. }
  2481. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2482. }()<<23 | uint32_t(0xb+16)
  2483. }(), func() uint32 {
  2484. if 0xc+16 < 2 {
  2485. return Uint32FromInt32(-1)
  2486. }
  2487. return func() uint32 {
  2488. if Int32(0x80) == Int32(0x80) {
  2489. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2490. }
  2491. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2492. }()<<23 | uint32_t(0xc+16)
  2493. }(), func() uint32 {
  2494. if 0xd+16 < 2 {
  2495. return Uint32FromInt32(-1)
  2496. }
  2497. return func() uint32 {
  2498. if Int32(0x80) == Int32(0x80) {
  2499. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2500. }
  2501. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2502. }()<<23 | uint32_t(0xd+16)
  2503. }(), func() uint32 {
  2504. if 0xe+16 < 2 {
  2505. return Uint32FromInt32(-1)
  2506. }
  2507. return func() uint32 {
  2508. if Int32(0x80) == Int32(0x80) {
  2509. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2510. }
  2511. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2512. }()<<23 | uint32_t(0xe+16)
  2513. }(), func() uint32 {
  2514. if 0xf+16 < 2 {
  2515. return Uint32FromInt32(-1)
  2516. }
  2517. return func() uint32 {
  2518. if Int32(0x80) == Int32(0x80) {
  2519. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2520. }
  2521. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2522. }()<<23 | uint32_t(0xf+16)
  2523. }(),
  2524. func() uint32 {
  2525. if 0x0 == 0 {
  2526. return func() uint32 {
  2527. if Int32(0xa0) == Int32(0x80) {
  2528. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2529. }
  2530. return Uint32(Uint32(0) - Uint32FromInt32(0xa0))
  2531. }() << 23
  2532. }
  2533. return func() uint32 {
  2534. if 0x0 == 0xd {
  2535. return func() uint32 {
  2536. if Int32(0x80) == Int32(0x80) {
  2537. return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))
  2538. }
  2539. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2540. }() << 23
  2541. }
  2542. return func() uint32 {
  2543. if Int32(0x80) == Int32(0x80) {
  2544. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2545. }
  2546. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2547. }() << 23
  2548. }()
  2549. }() | uint32_t(func() uint32 {
  2550. if Int32(0x80) == Int32(0x80) {
  2551. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2552. }
  2553. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2554. }()<<23)>>6 | uint32_t(0x0), func() uint32 {
  2555. if 0x1 == 0 {
  2556. return func() uint32 {
  2557. if Int32(0xa0) == Int32(0x80) {
  2558. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2559. }
  2560. return Uint32(Uint32(0) - Uint32FromInt32(0xa0))
  2561. }() << 23
  2562. }
  2563. return func() uint32 {
  2564. if 0x1 == 0xd {
  2565. return func() uint32 {
  2566. if Int32(0x80) == Int32(0x80) {
  2567. return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))
  2568. }
  2569. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2570. }() << 23
  2571. }
  2572. return func() uint32 {
  2573. if Int32(0x80) == Int32(0x80) {
  2574. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2575. }
  2576. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2577. }() << 23
  2578. }()
  2579. }() | uint32_t(func() uint32 {
  2580. if Int32(0x80) == Int32(0x80) {
  2581. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2582. }
  2583. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2584. }()<<23)>>6 | uint32_t(0x1), func() uint32 {
  2585. if 0x2 == 0 {
  2586. return func() uint32 {
  2587. if Int32(0xa0) == Int32(0x80) {
  2588. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2589. }
  2590. return Uint32(Uint32(0) - Uint32FromInt32(0xa0))
  2591. }() << 23
  2592. }
  2593. return func() uint32 {
  2594. if 0x2 == 0xd {
  2595. return func() uint32 {
  2596. if Int32(0x80) == Int32(0x80) {
  2597. return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))
  2598. }
  2599. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2600. }() << 23
  2601. }
  2602. return func() uint32 {
  2603. if Int32(0x80) == Int32(0x80) {
  2604. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2605. }
  2606. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2607. }() << 23
  2608. }()
  2609. }() | uint32_t(func() uint32 {
  2610. if Int32(0x80) == Int32(0x80) {
  2611. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2612. }
  2613. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2614. }()<<23)>>6 | uint32_t(0x2), func() uint32 {
  2615. if 0x3 == 0 {
  2616. return func() uint32 {
  2617. if Int32(0xa0) == Int32(0x80) {
  2618. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2619. }
  2620. return Uint32(Uint32(0) - Uint32FromInt32(0xa0))
  2621. }() << 23
  2622. }
  2623. return func() uint32 {
  2624. if 0x3 == 0xd {
  2625. return func() uint32 {
  2626. if Int32(0x80) == Int32(0x80) {
  2627. return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))
  2628. }
  2629. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2630. }() << 23
  2631. }
  2632. return func() uint32 {
  2633. if Int32(0x80) == Int32(0x80) {
  2634. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2635. }
  2636. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2637. }() << 23
  2638. }()
  2639. }() | uint32_t(func() uint32 {
  2640. if Int32(0x80) == Int32(0x80) {
  2641. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2642. }
  2643. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2644. }()<<23)>>6 | uint32_t(0x3), func() uint32 {
  2645. if 0x4 == 0 {
  2646. return func() uint32 {
  2647. if Int32(0xa0) == Int32(0x80) {
  2648. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2649. }
  2650. return Uint32(Uint32(0) - Uint32FromInt32(0xa0))
  2651. }() << 23
  2652. }
  2653. return func() uint32 {
  2654. if 0x4 == 0xd {
  2655. return func() uint32 {
  2656. if Int32(0x80) == Int32(0x80) {
  2657. return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))
  2658. }
  2659. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2660. }() << 23
  2661. }
  2662. return func() uint32 {
  2663. if Int32(0x80) == Int32(0x80) {
  2664. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2665. }
  2666. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2667. }() << 23
  2668. }()
  2669. }() | uint32_t(func() uint32 {
  2670. if Int32(0x80) == Int32(0x80) {
  2671. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2672. }
  2673. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2674. }()<<23)>>6 | uint32_t(0x4), func() uint32 {
  2675. if 0x5 == 0 {
  2676. return func() uint32 {
  2677. if Int32(0xa0) == Int32(0x80) {
  2678. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2679. }
  2680. return Uint32(Uint32(0) - Uint32FromInt32(0xa0))
  2681. }() << 23
  2682. }
  2683. return func() uint32 {
  2684. if 0x5 == 0xd {
  2685. return func() uint32 {
  2686. if Int32(0x80) == Int32(0x80) {
  2687. return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))
  2688. }
  2689. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2690. }() << 23
  2691. }
  2692. return func() uint32 {
  2693. if Int32(0x80) == Int32(0x80) {
  2694. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2695. }
  2696. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2697. }() << 23
  2698. }()
  2699. }() | uint32_t(func() uint32 {
  2700. if Int32(0x80) == Int32(0x80) {
  2701. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2702. }
  2703. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2704. }()<<23)>>6 | uint32_t(0x5), func() uint32 {
  2705. if 0x6 == 0 {
  2706. return func() uint32 {
  2707. if Int32(0xa0) == Int32(0x80) {
  2708. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2709. }
  2710. return Uint32(Uint32(0) - Uint32FromInt32(0xa0))
  2711. }() << 23
  2712. }
  2713. return func() uint32 {
  2714. if 0x6 == 0xd {
  2715. return func() uint32 {
  2716. if Int32(0x80) == Int32(0x80) {
  2717. return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))
  2718. }
  2719. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2720. }() << 23
  2721. }
  2722. return func() uint32 {
  2723. if Int32(0x80) == Int32(0x80) {
  2724. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2725. }
  2726. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2727. }() << 23
  2728. }()
  2729. }() | uint32_t(func() uint32 {
  2730. if Int32(0x80) == Int32(0x80) {
  2731. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2732. }
  2733. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2734. }()<<23)>>6 | uint32_t(0x6), func() uint32 {
  2735. if 0x7 == 0 {
  2736. return func() uint32 {
  2737. if Int32(0xa0) == Int32(0x80) {
  2738. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2739. }
  2740. return Uint32(Uint32(0) - Uint32FromInt32(0xa0))
  2741. }() << 23
  2742. }
  2743. return func() uint32 {
  2744. if 0x7 == 0xd {
  2745. return func() uint32 {
  2746. if Int32(0x80) == Int32(0x80) {
  2747. return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))
  2748. }
  2749. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2750. }() << 23
  2751. }
  2752. return func() uint32 {
  2753. if Int32(0x80) == Int32(0x80) {
  2754. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2755. }
  2756. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2757. }() << 23
  2758. }()
  2759. }() | uint32_t(func() uint32 {
  2760. if Int32(0x80) == Int32(0x80) {
  2761. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2762. }
  2763. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2764. }()<<23)>>6 | uint32_t(0x7),
  2765. func() uint32 {
  2766. if 0x8 == 0 {
  2767. return func() uint32 {
  2768. if Int32(0xa0) == Int32(0x80) {
  2769. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2770. }
  2771. return Uint32(Uint32(0) - Uint32FromInt32(0xa0))
  2772. }() << 23
  2773. }
  2774. return func() uint32 {
  2775. if 0x8 == 0xd {
  2776. return func() uint32 {
  2777. if Int32(0x80) == Int32(0x80) {
  2778. return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))
  2779. }
  2780. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2781. }() << 23
  2782. }
  2783. return func() uint32 {
  2784. if Int32(0x80) == Int32(0x80) {
  2785. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2786. }
  2787. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2788. }() << 23
  2789. }()
  2790. }() | uint32_t(func() uint32 {
  2791. if Int32(0x80) == Int32(0x80) {
  2792. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2793. }
  2794. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2795. }()<<23)>>6 | uint32_t(0x8), func() uint32 {
  2796. if 0x9 == 0 {
  2797. return func() uint32 {
  2798. if Int32(0xa0) == Int32(0x80) {
  2799. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2800. }
  2801. return Uint32(Uint32(0) - Uint32FromInt32(0xa0))
  2802. }() << 23
  2803. }
  2804. return func() uint32 {
  2805. if 0x9 == 0xd {
  2806. return func() uint32 {
  2807. if Int32(0x80) == Int32(0x80) {
  2808. return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))
  2809. }
  2810. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2811. }() << 23
  2812. }
  2813. return func() uint32 {
  2814. if Int32(0x80) == Int32(0x80) {
  2815. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2816. }
  2817. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2818. }() << 23
  2819. }()
  2820. }() | uint32_t(func() uint32 {
  2821. if Int32(0x80) == Int32(0x80) {
  2822. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2823. }
  2824. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2825. }()<<23)>>6 | uint32_t(0x9), func() uint32 {
  2826. if 0xa == 0 {
  2827. return func() uint32 {
  2828. if Int32(0xa0) == Int32(0x80) {
  2829. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2830. }
  2831. return Uint32(Uint32(0) - Uint32FromInt32(0xa0))
  2832. }() << 23
  2833. }
  2834. return func() uint32 {
  2835. if 0xa == 0xd {
  2836. return func() uint32 {
  2837. if Int32(0x80) == Int32(0x80) {
  2838. return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))
  2839. }
  2840. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2841. }() << 23
  2842. }
  2843. return func() uint32 {
  2844. if Int32(0x80) == Int32(0x80) {
  2845. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2846. }
  2847. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2848. }() << 23
  2849. }()
  2850. }() | uint32_t(func() uint32 {
  2851. if Int32(0x80) == Int32(0x80) {
  2852. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2853. }
  2854. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2855. }()<<23)>>6 | uint32_t(0xa), func() uint32 {
  2856. if 0xb == 0 {
  2857. return func() uint32 {
  2858. if Int32(0xa0) == Int32(0x80) {
  2859. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2860. }
  2861. return Uint32(Uint32(0) - Uint32FromInt32(0xa0))
  2862. }() << 23
  2863. }
  2864. return func() uint32 {
  2865. if 0xb == 0xd {
  2866. return func() uint32 {
  2867. if Int32(0x80) == Int32(0x80) {
  2868. return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))
  2869. }
  2870. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2871. }() << 23
  2872. }
  2873. return func() uint32 {
  2874. if Int32(0x80) == Int32(0x80) {
  2875. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2876. }
  2877. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2878. }() << 23
  2879. }()
  2880. }() | uint32_t(func() uint32 {
  2881. if Int32(0x80) == Int32(0x80) {
  2882. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2883. }
  2884. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2885. }()<<23)>>6 | uint32_t(0xb), func() uint32 {
  2886. if 0xc == 0 {
  2887. return func() uint32 {
  2888. if Int32(0xa0) == Int32(0x80) {
  2889. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2890. }
  2891. return Uint32(Uint32(0) - Uint32FromInt32(0xa0))
  2892. }() << 23
  2893. }
  2894. return func() uint32 {
  2895. if 0xc == 0xd {
  2896. return func() uint32 {
  2897. if Int32(0x80) == Int32(0x80) {
  2898. return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))
  2899. }
  2900. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2901. }() << 23
  2902. }
  2903. return func() uint32 {
  2904. if Int32(0x80) == Int32(0x80) {
  2905. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2906. }
  2907. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2908. }() << 23
  2909. }()
  2910. }() | uint32_t(func() uint32 {
  2911. if Int32(0x80) == Int32(0x80) {
  2912. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2913. }
  2914. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2915. }()<<23)>>6 | uint32_t(0xc), func() uint32 {
  2916. if 0xd == 0 {
  2917. return func() uint32 {
  2918. if Int32(0xa0) == Int32(0x80) {
  2919. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2920. }
  2921. return Uint32(Uint32(0) - Uint32FromInt32(0xa0))
  2922. }() << 23
  2923. }
  2924. return func() uint32 {
  2925. if 0xd == 0xd {
  2926. return func() uint32 {
  2927. if Int32(0x80) == Int32(0x80) {
  2928. return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))
  2929. }
  2930. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2931. }() << 23
  2932. }
  2933. return func() uint32 {
  2934. if Int32(0x80) == Int32(0x80) {
  2935. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2936. }
  2937. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2938. }() << 23
  2939. }()
  2940. }() | uint32_t(func() uint32 {
  2941. if Int32(0x80) == Int32(0x80) {
  2942. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2943. }
  2944. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2945. }()<<23)>>6 | uint32_t(0xd), func() uint32 {
  2946. if 0xe == 0 {
  2947. return func() uint32 {
  2948. if Int32(0xa0) == Int32(0x80) {
  2949. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2950. }
  2951. return Uint32(Uint32(0) - Uint32FromInt32(0xa0))
  2952. }() << 23
  2953. }
  2954. return func() uint32 {
  2955. if 0xe == 0xd {
  2956. return func() uint32 {
  2957. if Int32(0x80) == Int32(0x80) {
  2958. return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))
  2959. }
  2960. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2961. }() << 23
  2962. }
  2963. return func() uint32 {
  2964. if Int32(0x80) == Int32(0x80) {
  2965. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2966. }
  2967. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2968. }() << 23
  2969. }()
  2970. }() | uint32_t(func() uint32 {
  2971. if Int32(0x80) == Int32(0x80) {
  2972. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2973. }
  2974. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2975. }()<<23)>>6 | uint32_t(0xe), func() uint32 {
  2976. if 0xf == 0 {
  2977. return func() uint32 {
  2978. if Int32(0xa0) == Int32(0x80) {
  2979. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2980. }
  2981. return Uint32(Uint32(0) - Uint32FromInt32(0xa0))
  2982. }() << 23
  2983. }
  2984. return func() uint32 {
  2985. if 0xf == 0xd {
  2986. return func() uint32 {
  2987. if Int32(0x80) == Int32(0x80) {
  2988. return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))
  2989. }
  2990. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2991. }() << 23
  2992. }
  2993. return func() uint32 {
  2994. if Int32(0x80) == Int32(0x80) {
  2995. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  2996. }
  2997. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  2998. }() << 23
  2999. }()
  3000. }() | uint32_t(func() uint32 {
  3001. if Int32(0x80) == Int32(0x80) {
  3002. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3003. }
  3004. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3005. }()<<23)>>6 | uint32_t(0xf),
  3006. func() uint32 {
  3007. if 0x0 >= 5 {
  3008. return uint32(0)
  3009. }
  3010. return func() uint32 {
  3011. if 0x0 == 0 {
  3012. return func() uint32 {
  3013. if Int32(0x90) == Int32(0x80) {
  3014. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3015. }
  3016. return Uint32(Uint32(0) - Uint32FromInt32(0x90))
  3017. }() << 23
  3018. }
  3019. return func() uint32 {
  3020. if 0x0 == 4 {
  3021. return func() uint32 {
  3022. if Int32(0x80) == Int32(0x80) {
  3023. return Uint32(Uint32(0x40) - Uint32FromInt32(0x90))
  3024. }
  3025. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3026. }() << 23
  3027. }
  3028. return func() uint32 {
  3029. if Int32(0x80) == Int32(0x80) {
  3030. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3031. }
  3032. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3033. }() << 23
  3034. }()
  3035. }()
  3036. }() | uint32_t(func() uint32 {
  3037. if Int32(0x80) == Int32(0x80) {
  3038. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3039. }
  3040. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3041. }()<<23)>>6 | uint32_t(func() uint32 {
  3042. if Int32(0x80) == Int32(0x80) {
  3043. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3044. }
  3045. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3046. }()<<23)>>12 | uint32_t(0x0), func() uint32 {
  3047. if 0x1 >= 5 {
  3048. return uint32(0)
  3049. }
  3050. return func() uint32 {
  3051. if 0x1 == 0 {
  3052. return func() uint32 {
  3053. if Int32(0x90) == Int32(0x80) {
  3054. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3055. }
  3056. return Uint32(Uint32(0) - Uint32FromInt32(0x90))
  3057. }() << 23
  3058. }
  3059. return func() uint32 {
  3060. if 0x1 == 4 {
  3061. return func() uint32 {
  3062. if Int32(0x80) == Int32(0x80) {
  3063. return Uint32(Uint32(0x40) - Uint32FromInt32(0x90))
  3064. }
  3065. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3066. }() << 23
  3067. }
  3068. return func() uint32 {
  3069. if Int32(0x80) == Int32(0x80) {
  3070. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3071. }
  3072. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3073. }() << 23
  3074. }()
  3075. }()
  3076. }() | uint32_t(func() uint32 {
  3077. if Int32(0x80) == Int32(0x80) {
  3078. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3079. }
  3080. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3081. }()<<23)>>6 | uint32_t(func() uint32 {
  3082. if Int32(0x80) == Int32(0x80) {
  3083. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3084. }
  3085. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3086. }()<<23)>>12 | uint32_t(0x1), func() uint32 {
  3087. if 0x2 >= 5 {
  3088. return uint32(0)
  3089. }
  3090. return func() uint32 {
  3091. if 0x2 == 0 {
  3092. return func() uint32 {
  3093. if Int32(0x90) == Int32(0x80) {
  3094. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3095. }
  3096. return Uint32(Uint32(0) - Uint32FromInt32(0x90))
  3097. }() << 23
  3098. }
  3099. return func() uint32 {
  3100. if 0x2 == 4 {
  3101. return func() uint32 {
  3102. if Int32(0x80) == Int32(0x80) {
  3103. return Uint32(Uint32(0x40) - Uint32FromInt32(0x90))
  3104. }
  3105. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3106. }() << 23
  3107. }
  3108. return func() uint32 {
  3109. if Int32(0x80) == Int32(0x80) {
  3110. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3111. }
  3112. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3113. }() << 23
  3114. }()
  3115. }()
  3116. }() | uint32_t(func() uint32 {
  3117. if Int32(0x80) == Int32(0x80) {
  3118. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3119. }
  3120. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3121. }()<<23)>>6 | uint32_t(func() uint32 {
  3122. if Int32(0x80) == Int32(0x80) {
  3123. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3124. }
  3125. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3126. }()<<23)>>12 | uint32_t(0x2), func() uint32 {
  3127. if 0x3 >= 5 {
  3128. return uint32(0)
  3129. }
  3130. return func() uint32 {
  3131. if 0x3 == 0 {
  3132. return func() uint32 {
  3133. if Int32(0x90) == Int32(0x80) {
  3134. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3135. }
  3136. return Uint32(Uint32(0) - Uint32FromInt32(0x90))
  3137. }() << 23
  3138. }
  3139. return func() uint32 {
  3140. if 0x3 == 4 {
  3141. return func() uint32 {
  3142. if Int32(0x80) == Int32(0x80) {
  3143. return Uint32(Uint32(0x40) - Uint32FromInt32(0x90))
  3144. }
  3145. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3146. }() << 23
  3147. }
  3148. return func() uint32 {
  3149. if Int32(0x80) == Int32(0x80) {
  3150. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3151. }
  3152. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3153. }() << 23
  3154. }()
  3155. }()
  3156. }() | uint32_t(func() uint32 {
  3157. if Int32(0x80) == Int32(0x80) {
  3158. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3159. }
  3160. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3161. }()<<23)>>6 | uint32_t(func() uint32 {
  3162. if Int32(0x80) == Int32(0x80) {
  3163. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3164. }
  3165. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3166. }()<<23)>>12 | uint32_t(0x3), func() uint32 {
  3167. if 0x4 >= 5 {
  3168. return uint32(0)
  3169. }
  3170. return func() uint32 {
  3171. if 0x4 == 0 {
  3172. return func() uint32 {
  3173. if Int32(0x90) == Int32(0x80) {
  3174. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3175. }
  3176. return Uint32(Uint32(0) - Uint32FromInt32(0x90))
  3177. }() << 23
  3178. }
  3179. return func() uint32 {
  3180. if 0x4 == 4 {
  3181. return func() uint32 {
  3182. if Int32(0x80) == Int32(0x80) {
  3183. return Uint32(Uint32(0x40) - Uint32FromInt32(0x90))
  3184. }
  3185. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3186. }() << 23
  3187. }
  3188. return func() uint32 {
  3189. if Int32(0x80) == Int32(0x80) {
  3190. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3191. }
  3192. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3193. }() << 23
  3194. }()
  3195. }()
  3196. }() | uint32_t(func() uint32 {
  3197. if Int32(0x80) == Int32(0x80) {
  3198. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3199. }
  3200. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3201. }()<<23)>>6 | uint32_t(func() uint32 {
  3202. if Int32(0x80) == Int32(0x80) {
  3203. return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))
  3204. }
  3205. return Uint32(Uint32(0) - Uint32FromInt32(0x80))
  3206. }()<<23)>>12 | uint32_t(0x4),
  3207. } /* internal.c:18:16 */
  3208. type wint_t = uint32 /* alltypes.h:190:18 */
  3209. type wctype_t = uint64 /* alltypes.h:195:23 */
  3210. type __mbstate_t = struct {
  3211. __opaque1 uint32
  3212. __opaque2 uint32
  3213. } /* alltypes.h:329:9 */
  3214. type mbstate_t = __mbstate_t /* alltypes.h:329:63 */
  3215. func Xmbrtowc(tls *TLS, wc uintptr, src uintptr, n size_t, st uintptr) size_t { /* mbrtowc.c:6:8: */
  3216. bp := tls.Alloc(4)
  3217. defer tls.Free(4)
  3218. var c uint32
  3219. var s uintptr
  3220. var N uint32
  3221. // var dummy wchar_t at bp, 4
  3222. s = src
  3223. N = uint32(n)
  3224. if !!(st != 0) {
  3225. goto __1
  3226. }
  3227. st = uintptr(unsafe.Pointer(&_sinternal_state))
  3228. __1:
  3229. ;
  3230. c = *(*uint32)(unsafe.Pointer(st))
  3231. if !!(s != 0) {
  3232. goto __2
  3233. }
  3234. if !(c != 0) {
  3235. goto __4
  3236. }
  3237. goto ilseq
  3238. __4:
  3239. ;
  3240. return uint64(0)
  3241. goto __3
  3242. __2:
  3243. if !!(wc != 0) {
  3244. goto __5
  3245. }
  3246. wc = bp /* &dummy */
  3247. __5:
  3248. ;
  3249. __3:
  3250. ;
  3251. if !!(n != 0) {
  3252. goto __6
  3253. }
  3254. return Uint64FromInt32(-2)
  3255. __6:
  3256. ;
  3257. if !!(c != 0) {
  3258. goto __7
  3259. }
  3260. if !(int32(*(*uint8)(unsafe.Pointer(s))) < 0x80) {
  3261. goto __8
  3262. }
  3263. return BoolUint64(!!(AssignPtrInt32(wc, wchar_t(*(*uint8)(unsafe.Pointer(s)))) != 0))
  3264. __8:
  3265. ;
  3266. if !(func() int32 {
  3267. if !!(int32(*(*uintptr)(unsafe.Pointer((*__pthread)(unsafe.Pointer(__pthread_self(tls))).locale))) != 0) {
  3268. return 4
  3269. }
  3270. return 1
  3271. }() == 1) {
  3272. goto __9
  3273. }
  3274. *(*wchar_t)(unsafe.Pointer(wc)) = 0xdfff & int32(int8(*(*uint8)(unsafe.Pointer(s))))
  3275. return 1
  3276. __9:
  3277. ;
  3278. if !(uint32(*(*uint8)(unsafe.Pointer(s)))-0xc2 > 0xf4-0xc2) {
  3279. goto __10
  3280. }
  3281. goto ilseq
  3282. __10:
  3283. ;
  3284. c = X__fsmu8[uint32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&s, 1))))-0xc2]
  3285. n--
  3286. __7:
  3287. ;
  3288. if !(n != 0) {
  3289. goto __11
  3290. }
  3291. if !((int32(*(*uint8)(unsafe.Pointer(s)))>>3-0x10|(int32(*(*uint8)(unsafe.Pointer(s)))>>3+int32_t(c)>>26))&CplInt32(7) != 0) {
  3292. goto __12
  3293. }
  3294. goto ilseq
  3295. __12:
  3296. ;
  3297. loop:
  3298. c = c<<6 | uint32(int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&s, 1))))-0x80)
  3299. n--
  3300. if !!(c&(uint32(1)<<31) != 0) {
  3301. goto __13
  3302. }
  3303. *(*uint32)(unsafe.Pointer(st)) = uint32(0)
  3304. *(*wchar_t)(unsafe.Pointer(wc)) = wchar_t(c)
  3305. return size_t(N) - n
  3306. __13:
  3307. ;
  3308. if !(n != 0) {
  3309. goto __14
  3310. }
  3311. if !(uint32(*(*uint8)(unsafe.Pointer(s)))-0x80 >= uint32(0x40)) {
  3312. goto __15
  3313. }
  3314. goto ilseq
  3315. __15:
  3316. ;
  3317. goto loop
  3318. __14:
  3319. ;
  3320. __11:
  3321. ;
  3322. *(*uint32)(unsafe.Pointer(st)) = c
  3323. return Uint64FromInt32(-2)
  3324. ilseq:
  3325. *(*uint32)(unsafe.Pointer(st)) = uint32(0)
  3326. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 84
  3327. return Uint64FromInt32(-1)
  3328. }
  3329. var _sinternal_state uint32 /* mbrtowc.c:8:18: */
  3330. func Xmbsinit(tls *TLS, st uintptr) int32 { /* mbsinit.c:3:5: */
  3331. return Bool32(!(st != 0) || !(int32(*(*uint32)(unsafe.Pointer(st))) != 0))
  3332. }
  3333. type imaxdiv_t = struct {
  3334. quot intmax_t
  3335. rem intmax_t
  3336. } /* inttypes.h:14:40 */
  3337. type socklen_t = uint32 /* alltypes.h:353:18 */
  3338. type sa_family_t = uint16 /* alltypes.h:358:24 */
  3339. type msghdr = struct {
  3340. msg_name uintptr
  3341. msg_namelen socklen_t
  3342. _ [4]byte
  3343. msg_iov uintptr
  3344. msg_iovlen int32
  3345. __pad1 int32
  3346. msg_control uintptr
  3347. msg_controllen socklen_t
  3348. __pad2 int32
  3349. msg_flags int32
  3350. _ [4]byte
  3351. } /* socket.h:22:1 */
  3352. type cmsghdr = struct {
  3353. cmsg_len socklen_t
  3354. __pad1 int32
  3355. cmsg_level int32
  3356. cmsg_type int32
  3357. } /* socket.h:44:1 */
  3358. type linger = struct {
  3359. l_onoff int32
  3360. l_linger int32
  3361. } /* socket.h:74:1 */
  3362. type sockaddr = struct {
  3363. sa_family sa_family_t
  3364. sa_data [14]uint8
  3365. } /* socket.h:367:1 */
  3366. type sockaddr_storage = struct {
  3367. ss_family sa_family_t
  3368. __ss_padding [118]uint8
  3369. __ss_align uint64
  3370. } /* socket.h:372:1 */
  3371. type in_port_t = uint16_t /* in.h:12:18 */
  3372. type in_addr_t = uint32_t /* in.h:13:18 */
  3373. type in_addr = struct{ s_addr in_addr_t } /* in.h:14:1 */
  3374. type sockaddr_in = struct {
  3375. sin_family sa_family_t
  3376. sin_port in_port_t
  3377. sin_addr struct{ s_addr in_addr_t }
  3378. sin_zero [8]uint8_t
  3379. } /* in.h:16:1 */
  3380. type in6_addr = struct {
  3381. __in6_union struct {
  3382. _ [0]uint32
  3383. __s6_addr [16]uint8_t
  3384. }
  3385. } /* in.h:23:1 */
  3386. type sockaddr_in6 = struct {
  3387. sin6_family sa_family_t
  3388. sin6_port in_port_t
  3389. sin6_flowinfo uint32_t
  3390. sin6_addr struct {
  3391. __in6_union struct {
  3392. _ [0]uint32
  3393. __s6_addr [16]uint8_t
  3394. }
  3395. }
  3396. sin6_scope_id uint32_t
  3397. } /* in.h:34:1 */
  3398. type ipv6_mreq = struct {
  3399. ipv6mr_multiaddr struct {
  3400. __in6_union struct {
  3401. _ [0]uint32
  3402. __s6_addr [16]uint8_t
  3403. }
  3404. }
  3405. ipv6mr_interface uint32
  3406. } /* in.h:42:1 */
  3407. type ip_opts = struct {
  3408. ip_dst struct{ s_addr in_addr_t }
  3409. ip_opts [40]uint8
  3410. } /* in.h:229:1 */
  3411. type ip_mreq = struct {
  3412. imr_multiaddr struct{ s_addr in_addr_t }
  3413. imr_interface struct{ s_addr in_addr_t }
  3414. } /* in.h:247:1 */
  3415. type ip_mreqn = struct {
  3416. imr_multiaddr struct{ s_addr in_addr_t }
  3417. imr_address struct{ s_addr in_addr_t }
  3418. imr_ifindex int32
  3419. } /* in.h:252:1 */
  3420. type ip_mreq_source = struct {
  3421. imr_multiaddr struct{ s_addr in_addr_t }
  3422. imr_interface struct{ s_addr in_addr_t }
  3423. imr_sourceaddr struct{ s_addr in_addr_t }
  3424. } /* in.h:258:1 */
  3425. type ip_msfilter = struct {
  3426. imsf_multiaddr struct{ s_addr in_addr_t }
  3427. imsf_interface struct{ s_addr in_addr_t }
  3428. imsf_fmode uint32_t
  3429. imsf_numsrc uint32_t
  3430. imsf_slist [1]struct{ s_addr in_addr_t }
  3431. } /* in.h:264:1 */
  3432. type group_req = struct {
  3433. gr_interface uint32_t
  3434. _ [4]byte
  3435. gr_group struct {
  3436. ss_family sa_family_t
  3437. __ss_padding [118]uint8
  3438. __ss_align uint64
  3439. }
  3440. } /* in.h:275:1 */
  3441. type group_source_req = struct {
  3442. gsr_interface uint32_t
  3443. _ [4]byte
  3444. gsr_group struct {
  3445. ss_family sa_family_t
  3446. __ss_padding [118]uint8
  3447. __ss_align uint64
  3448. }
  3449. gsr_source struct {
  3450. ss_family sa_family_t
  3451. __ss_padding [118]uint8
  3452. __ss_align uint64
  3453. }
  3454. } /* in.h:280:1 */
  3455. type group_filter = struct {
  3456. gf_interface uint32_t
  3457. _ [4]byte
  3458. gf_group struct {
  3459. ss_family sa_family_t
  3460. __ss_padding [118]uint8
  3461. __ss_align uint64
  3462. }
  3463. gf_fmode uint32_t
  3464. gf_numsrc uint32_t
  3465. gf_slist [1]struct {
  3466. ss_family sa_family_t
  3467. __ss_padding [118]uint8
  3468. __ss_align uint64
  3469. }
  3470. } /* in.h:286:1 */
  3471. type in_pktinfo = struct {
  3472. ipi_ifindex int32
  3473. ipi_spec_dst struct{ s_addr in_addr_t }
  3474. ipi_addr struct{ s_addr in_addr_t }
  3475. } /* in.h:297:1 */
  3476. type in6_pktinfo = struct {
  3477. ipi6_addr struct {
  3478. __in6_union struct {
  3479. _ [0]uint32
  3480. __s6_addr [16]uint8_t
  3481. }
  3482. }
  3483. ipi6_ifindex uint32
  3484. } /* in.h:303:1 */
  3485. type ip6_mtuinfo = struct {
  3486. ip6m_addr struct {
  3487. sin6_family sa_family_t
  3488. sin6_port in_port_t
  3489. sin6_flowinfo uint32_t
  3490. sin6_addr struct {
  3491. __in6_union struct {
  3492. _ [0]uint32
  3493. __s6_addr [16]uint8_t
  3494. }
  3495. }
  3496. sin6_scope_id uint32_t
  3497. }
  3498. ip6m_mtu uint32_t
  3499. } /* in.h:308:1 */
  3500. type addrinfo = struct {
  3501. ai_flags int32
  3502. ai_family int32
  3503. ai_socktype int32
  3504. ai_protocol int32
  3505. ai_addrlen socklen_t
  3506. _ [4]byte
  3507. ai_addr uintptr
  3508. ai_canonname uintptr
  3509. ai_next uintptr
  3510. } /* netdb.h:16:1 */
  3511. // Legacy functions follow (marked OBsolete in SUS)
  3512. type netent = struct {
  3513. n_name uintptr
  3514. n_aliases uintptr
  3515. n_addrtype int32
  3516. n_net uint32_t
  3517. } /* netdb.h:62:1 */
  3518. type hostent = struct {
  3519. h_name uintptr
  3520. h_aliases uintptr
  3521. h_addrtype int32
  3522. h_length int32
  3523. h_addr_list uintptr
  3524. } /* netdb.h:69:1 */
  3525. type servent = struct {
  3526. s_name uintptr
  3527. s_aliases uintptr
  3528. s_port int32
  3529. _ [4]byte
  3530. s_proto uintptr
  3531. } /* netdb.h:78:1 */
  3532. type protoent = struct {
  3533. p_name uintptr
  3534. p_aliases uintptr
  3535. p_proto int32
  3536. _ [4]byte
  3537. } /* netdb.h:85:1 */
  3538. type aibuf = struct {
  3539. ai struct {
  3540. ai_flags int32
  3541. ai_family int32
  3542. ai_socktype int32
  3543. ai_protocol int32
  3544. ai_addrlen socklen_t
  3545. _ [4]byte
  3546. ai_addr uintptr
  3547. ai_canonname uintptr
  3548. ai_next uintptr
  3549. }
  3550. sa struct {
  3551. sin struct {
  3552. sin_family sa_family_t
  3553. sin_port in_port_t
  3554. sin_addr struct{ s_addr in_addr_t }
  3555. sin_zero [8]uint8_t
  3556. }
  3557. _ [12]byte
  3558. }
  3559. lock [1]int32
  3560. slot int16
  3561. ref int16
  3562. _ [4]byte
  3563. } /* lookup.h:10:1 */
  3564. type sa = struct {
  3565. sin struct {
  3566. sin_family sa_family_t
  3567. sin_port in_port_t
  3568. sin_addr struct{ s_addr in_addr_t }
  3569. sin_zero [8]uint8_t
  3570. }
  3571. _ [12]byte
  3572. } /* lookup.h:10:1 */
  3573. type address = struct {
  3574. family int32
  3575. scopeid uint32
  3576. addr [16]uint8_t
  3577. sortkey int32
  3578. } /* lookup.h:20:1 */
  3579. type service = struct {
  3580. port uint16_t
  3581. proto uint8
  3582. socktype uint8
  3583. } /* lookup.h:27:1 */
  3584. type resolvconf = struct {
  3585. ns [3]struct {
  3586. family int32
  3587. scopeid uint32
  3588. addr [16]uint8_t
  3589. sortkey int32
  3590. }
  3591. nns uint32
  3592. attempts uint32
  3593. ndots uint32
  3594. timeout uint32
  3595. } /* lookup.h:34:1 */
  3596. func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */
  3597. var cnt size_t
  3598. cnt = uint64(1)
  3599. __1:
  3600. if !((*addrinfo)(unsafe.Pointer(p)).ai_next != 0) {
  3601. goto __3
  3602. }
  3603. goto __2
  3604. __2:
  3605. cnt++
  3606. p = (*addrinfo)(unsafe.Pointer(p)).ai_next
  3607. goto __1
  3608. goto __3
  3609. __3:
  3610. ;
  3611. var b uintptr = p - uintptr(uint64(uintptr(0)))
  3612. b -= 88 * uintptr((*aibuf)(unsafe.Pointer(b)).slot)
  3613. //TODO LOCK(b->lock);
  3614. if !(int32(AssignSubPtrInt16(b+82, int16(cnt))) != 0) {
  3615. Xfree(tls, b)
  3616. }
  3617. //TODO else UNLOCK(b->lock);
  3618. }
  3619. func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */
  3620. bp := tls.Alloc(1608)
  3621. defer tls.Free(1608)
  3622. // var ports [2]service at bp, 8
  3623. // var addrs [48]address at bp+8, 1344
  3624. // var canon [256]uint8 at bp+1352, 256
  3625. var outcanon uintptr
  3626. var nservs int32
  3627. var naddrs int32
  3628. var nais int32
  3629. var canon_len int32
  3630. var i int32
  3631. var j int32
  3632. var k int32
  3633. var family int32 = 0
  3634. var flags int32 = 0
  3635. var proto int32 = 0
  3636. var socktype int32 = 0
  3637. var out uintptr
  3638. if !(host != 0) && !(serv != 0) {
  3639. return -2
  3640. }
  3641. if hint != 0 {
  3642. family = (*addrinfo)(unsafe.Pointer(hint)).ai_family
  3643. flags = (*addrinfo)(unsafe.Pointer(hint)).ai_flags
  3644. proto = (*addrinfo)(unsafe.Pointer(hint)).ai_protocol
  3645. socktype = (*addrinfo)(unsafe.Pointer(hint)).ai_socktype
  3646. var mask int32 = 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x400
  3647. if flags&mask != flags {
  3648. return -1
  3649. }
  3650. switch family {
  3651. case 2:
  3652. fallthrough
  3653. case 10:
  3654. fallthrough
  3655. case 0:
  3656. break
  3657. fallthrough
  3658. default:
  3659. return -6
  3660. }
  3661. }
  3662. if flags&0x20 != 0 {
  3663. Xabort(tls) //TODO-
  3664. // /* Define the "an address is configured" condition for address
  3665. // * families via ability to create a socket for the family plus
  3666. // * routability of the loopback address for the family. */
  3667. // static const struct sockaddr_in lo4 = {
  3668. // .sin_family = AF_INET, .sin_port = 65535,
  3669. // .sin_addr.s_addr = __BYTE_ORDER == __BIG_ENDIAN
  3670. // ? 0x7f000001 : 0x0100007f
  3671. // };
  3672. // static const struct sockaddr_in6 lo6 = {
  3673. // .sin6_family = AF_INET6, .sin6_port = 65535,
  3674. // .sin6_addr = IN6ADDR_LOOPBACK_INIT
  3675. // };
  3676. // int tf[2] = { AF_INET, AF_INET6 };
  3677. // const void *ta[2] = { &lo4, &lo6 };
  3678. // socklen_t tl[2] = { sizeof lo4, sizeof lo6 };
  3679. // for (i=0; i<2; i++) {
  3680. // if (family==tf[1-i]) continue;
  3681. // int s = socket(tf[i], SOCK_CLOEXEC|SOCK_DGRAM,
  3682. // IPPROTO_UDP);
  3683. // if (s>=0) {
  3684. // int cs;
  3685. // pthread_setcancelstate(
  3686. // PTHREAD_CANCEL_DISABLE, &cs);
  3687. // int r = connect(s, ta[i], tl[i]);
  3688. // pthread_setcancelstate(cs, 0);
  3689. // close(s);
  3690. // if (!r) continue;
  3691. // }
  3692. // switch (errno) {
  3693. // case EADDRNOTAVAIL:
  3694. // case EAFNOSUPPORT:
  3695. // case EHOSTUNREACH:
  3696. // case ENETDOWN:
  3697. // case ENETUNREACH:
  3698. // break;
  3699. // default:
  3700. // return EAI_SYSTEM;
  3701. // }
  3702. // if (family == tf[i]) return EAI_NONAME;
  3703. // family = tf[1-i];
  3704. // }
  3705. }
  3706. nservs = X__lookup_serv(tls, bp, serv, proto, socktype, flags)
  3707. if nservs < 0 {
  3708. return nservs
  3709. }
  3710. naddrs = X__lookup_name(tls, bp+8, bp+1352, host, family, flags)
  3711. if naddrs < 0 {
  3712. return naddrs
  3713. }
  3714. nais = nservs * naddrs
  3715. canon_len = int32(Xstrlen(tls, bp+1352))
  3716. out = Xcalloc(tls, uint64(1), uint64(nais)*uint64(unsafe.Sizeof(aibuf{}))+uint64(canon_len)+uint64(1))
  3717. if !(out != 0) {
  3718. return -10
  3719. }
  3720. if canon_len != 0 {
  3721. outcanon = out + uintptr(nais)*88
  3722. Xmemcpy(tls, outcanon, bp+1352, uint64(canon_len+1))
  3723. } else {
  3724. outcanon = uintptr(0)
  3725. }
  3726. for k = AssignInt32(&i, 0); i < naddrs; i++ {
  3727. j = 0
  3728. __1:
  3729. if !(j < nservs) {
  3730. goto __3
  3731. }
  3732. {
  3733. (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).slot = int16(k)
  3734. //TODO out[k].ai = (struct addrinfo){
  3735. //TODO .ai_family = addrs[i].family,
  3736. //TODO .ai_socktype = ports[j].socktype,
  3737. //TODO .ai_protocol = ports[j].proto,
  3738. //TODO .ai_addrlen = addrs[i].family == AF_INET
  3739. //TODO ? sizeof(struct sockaddr_in)
  3740. //TODO : sizeof(struct sockaddr_in6),
  3741. //TODO .ai_addr = (void *)&out[k].sa,
  3742. //TODO .ai_canonname = outcanon };
  3743. (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).ai.ai_family = (*address)(unsafe.Pointer(bp + 8 + uintptr(i)*28)).family
  3744. (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).ai.ai_socktype = int32((*service)(unsafe.Pointer(bp + uintptr(j)*4)).socktype)
  3745. (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).ai.ai_protocol = int32((*service)(unsafe.Pointer(bp + uintptr(j)*4)).proto)
  3746. (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).ai.ai_addrlen = func() uint32 {
  3747. if (*address)(unsafe.Pointer(bp+8+uintptr(i)*28)).family == 2 {
  3748. return uint32(unsafe.Sizeof(sockaddr_in{}))
  3749. }
  3750. return uint32(unsafe.Sizeof(sockaddr_in6{}))
  3751. }()
  3752. (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).ai.ai_addr = out + uintptr(k)*88 + 48
  3753. (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).ai.ai_canonname = outcanon
  3754. if k != 0 {
  3755. (*aibuf)(unsafe.Pointer(out + uintptr(k-1)*88)).ai.ai_next = out + uintptr(k)*88
  3756. }
  3757. switch (*address)(unsafe.Pointer(bp + 8 + uintptr(i)*28)).family {
  3758. case 2:
  3759. (*sockaddr_in)(unsafe.Pointer(out + uintptr(k)*88 + 48)).sin_family = sa_family_t(2)
  3760. (*sockaddr_in)(unsafe.Pointer(out + uintptr(k)*88 + 48)).sin_port = Xhtons(tls, (*service)(unsafe.Pointer(bp+uintptr(j)*4)).port)
  3761. Xmemcpy(tls, out+uintptr(k)*88+48+4, bp+8+uintptr(i)*28+8, uint64(4))
  3762. break
  3763. case 10:
  3764. (*sockaddr_in6)(unsafe.Pointer(out + uintptr(k)*88 + 48)).sin6_family = sa_family_t(10)
  3765. (*sockaddr_in6)(unsafe.Pointer(out + uintptr(k)*88 + 48)).sin6_port = Xhtons(tls, (*service)(unsafe.Pointer(bp+uintptr(j)*4)).port)
  3766. (*sockaddr_in6)(unsafe.Pointer(out + uintptr(k)*88 + 48)).sin6_scope_id = (*address)(unsafe.Pointer(bp + 8 + uintptr(i)*28)).scopeid
  3767. Xmemcpy(tls, out+uintptr(k)*88+48+8, bp+8+uintptr(i)*28+8, uint64(16))
  3768. break
  3769. }
  3770. }
  3771. goto __2
  3772. __2:
  3773. j++
  3774. k++
  3775. goto __1
  3776. goto __3
  3777. __3:
  3778. }
  3779. (*aibuf)(unsafe.Pointer(out)).ref = int16(nais)
  3780. *(*uintptr)(unsafe.Pointer(res)) = out
  3781. return 0
  3782. }
  3783. type ucred = struct {
  3784. pid pid_t
  3785. uid uid_t
  3786. gid gid_t
  3787. } /* socket.h:57:1 */
  3788. type mmsghdr = struct {
  3789. msg_hdr struct {
  3790. msg_name uintptr
  3791. msg_namelen socklen_t
  3792. _ [4]byte
  3793. msg_iov uintptr
  3794. msg_iovlen int32
  3795. __pad1 int32
  3796. msg_control uintptr
  3797. msg_controllen socklen_t
  3798. __pad2 int32
  3799. msg_flags int32
  3800. _ [4]byte
  3801. }
  3802. msg_len uint32
  3803. _ [4]byte
  3804. } /* socket.h:63:1 */
  3805. func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */
  3806. bp := tls.Alloc(8)
  3807. defer tls.Free(8)
  3808. var size size_t = uint64(63)
  3809. // var res uintptr at bp, 8
  3810. var err int32
  3811. for __ccgo := true; __ccgo; __ccgo = err == 34 {
  3812. Xfree(tls, _sh)
  3813. _sh = Xmalloc(tls, AssignAddUint64(&size, size+uint64(1)))
  3814. if !(_sh != 0) {
  3815. *(*int32)(unsafe.Pointer(X__h_errno_location(tls))) = 3
  3816. return uintptr(0)
  3817. }
  3818. err = Xgethostbyaddr_r(tls, a, l, af, _sh,
  3819. _sh+uintptr(1)*32, size-size_t(unsafe.Sizeof(hostent{})), bp, X__h_errno_location(tls))
  3820. }
  3821. if err != 0 {
  3822. return uintptr(0)
  3823. }
  3824. return _sh
  3825. }
  3826. var _sh uintptr /* gethostbyaddr.c:9:24: */
  3827. func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */
  3828. bp := tls.Alloc(28)
  3829. defer tls.Free(28)
  3830. //TODO union {
  3831. //TODO struct sockaddr_in sin;
  3832. //TODO struct sockaddr_in6 sin6;
  3833. //TODO } sa = { .sin.sin_family = af };
  3834. *(*struct {
  3835. sin sockaddr_in
  3836. _ [12]byte
  3837. })(unsafe.Pointer(bp)) = struct {
  3838. sin sockaddr_in
  3839. _ [12]byte
  3840. }{} //TODO-
  3841. (*sockaddr_in)(unsafe.Pointer(bp)).sin_family = sa_family_t(af) //TODO-
  3842. var sl socklen_t
  3843. if af == 10 {
  3844. sl = uint32(unsafe.Sizeof(sockaddr_in6{}))
  3845. } else {
  3846. sl = uint32(unsafe.Sizeof(sockaddr_in{}))
  3847. }
  3848. var i int32
  3849. *(*uintptr)(unsafe.Pointer(res)) = uintptr(0)
  3850. // Load address argument into sockaddr structure
  3851. if af == 10 && l == socklen_t(16) {
  3852. Xmemcpy(tls, bp+8, a, uint64(16))
  3853. } else if af == 2 && l == socklen_t(4) {
  3854. Xmemcpy(tls, bp+4, a, uint64(4))
  3855. } else {
  3856. *(*int32)(unsafe.Pointer(err)) = 3
  3857. return 22
  3858. }
  3859. // Align buffer and check for space for pointers and ip address
  3860. i = int32(uintptr_t(buf) & (uint64(unsafe.Sizeof(uintptr(0))) - uint64(1)))
  3861. if !(i != 0) {
  3862. i = int32(unsafe.Sizeof(uintptr(0)))
  3863. }
  3864. if buflen <= uint64(5)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(i)+uint64(l) {
  3865. return 34
  3866. }
  3867. buf += uintptr(uint64(unsafe.Sizeof(uintptr(0))) - uint64(i))
  3868. buflen = buflen - (uint64(5)*uint64(unsafe.Sizeof(uintptr(0))) - uint64(i) + uint64(l))
  3869. (*hostent)(unsafe.Pointer(h)).h_addr_list = buf
  3870. buf += uintptr(uint64(2) * uint64(unsafe.Sizeof(uintptr(0))))
  3871. (*hostent)(unsafe.Pointer(h)).h_aliases = buf
  3872. buf += uintptr(uint64(2) * uint64(unsafe.Sizeof(uintptr(0))))
  3873. *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_addr_list)) = buf
  3874. Xmemcpy(tls, *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_addr_list)), a, uint64(l))
  3875. buf += uintptr(l)
  3876. *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_addr_list + 1*8)) = uintptr(0)
  3877. *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases)) = buf
  3878. *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases + 1*8)) = uintptr(0)
  3879. switch Xgetnameinfo(tls, bp, sl, buf, uint32(buflen), uintptr(0), uint32(0), 0) {
  3880. case -3:
  3881. *(*int32)(unsafe.Pointer(err)) = 2
  3882. return 11
  3883. case -12:
  3884. return 34
  3885. default:
  3886. fallthrough
  3887. case -10:
  3888. fallthrough
  3889. case -11:
  3890. fallthrough
  3891. case -4:
  3892. *(*int32)(unsafe.Pointer(err)) = 3
  3893. return *(*int32)(unsafe.Pointer(X___errno_location(tls)))
  3894. case 0:
  3895. break
  3896. }
  3897. (*hostent)(unsafe.Pointer(h)).h_addrtype = af
  3898. (*hostent)(unsafe.Pointer(h)).h_length = int32(l)
  3899. (*hostent)(unsafe.Pointer(h)).h_name = *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases))
  3900. *(*uintptr)(unsafe.Pointer(res)) = h
  3901. return 0
  3902. }
  3903. func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */
  3904. return Xgethostbyname2(tls, name, 2)
  3905. }
  3906. func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */
  3907. bp := tls.Alloc(8)
  3908. defer tls.Free(8)
  3909. var size size_t = uint64(63)
  3910. // var res uintptr at bp, 8
  3911. var err int32
  3912. for __ccgo := true; __ccgo; __ccgo = err == 34 {
  3913. Xfree(tls, _sh1)
  3914. _sh1 = Xmalloc(tls, AssignAddUint64(&size, size+uint64(1)))
  3915. if !(_sh1 != 0) {
  3916. *(*int32)(unsafe.Pointer(X__h_errno_location(tls))) = 3
  3917. return uintptr(0)
  3918. }
  3919. err = Xgethostbyname2_r(tls, name, af, _sh1,
  3920. _sh1+uintptr(1)*32, size-size_t(unsafe.Sizeof(hostent{})), bp, X__h_errno_location(tls))
  3921. }
  3922. if err != 0 {
  3923. return uintptr(0)
  3924. }
  3925. return _sh1
  3926. }
  3927. var _sh1 uintptr /* gethostbyname2.c:10:24: */
  3928. func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */
  3929. bp := tls.Alloc(1600)
  3930. defer tls.Free(1600)
  3931. // var addrs [48]address at bp, 1344
  3932. // var canon [256]uint8 at bp+1344, 256
  3933. var i int32
  3934. var cnt int32
  3935. var align size_t
  3936. var need size_t
  3937. *(*uintptr)(unsafe.Pointer(res)) = uintptr(0)
  3938. cnt = X__lookup_name(tls, bp, bp+1344, name, af, 0x02)
  3939. if cnt < 0 {
  3940. switch cnt {
  3941. case -2:
  3942. *(*int32)(unsafe.Pointer(err)) = 1
  3943. return 2
  3944. fallthrough
  3945. case -3:
  3946. *(*int32)(unsafe.Pointer(err)) = 2
  3947. return 11
  3948. fallthrough
  3949. default:
  3950. fallthrough
  3951. case -4:
  3952. *(*int32)(unsafe.Pointer(err)) = 3
  3953. return 74
  3954. fallthrough
  3955. case -10:
  3956. fallthrough
  3957. case -11:
  3958. *(*int32)(unsafe.Pointer(err)) = 3
  3959. return *(*int32)(unsafe.Pointer(X___errno_location(tls)))
  3960. }
  3961. }
  3962. (*hostent)(unsafe.Pointer(h)).h_addrtype = af
  3963. (*hostent)(unsafe.Pointer(h)).h_length = func() int32 {
  3964. if af == 10 {
  3965. return 16
  3966. }
  3967. return 4
  3968. }()
  3969. // Align buffer
  3970. align = -uintptr_t(buf) & (uint64(unsafe.Sizeof(uintptr(0))) - uint64(1))
  3971. need = uint64(4) * uint64(unsafe.Sizeof(uintptr(0)))
  3972. need = need + uint64(cnt+1)*(uint64(unsafe.Sizeof(uintptr(0)))+uint64((*hostent)(unsafe.Pointer(h)).h_length))
  3973. need = need + (Xstrlen(tls, name) + uint64(1))
  3974. need = need + (Xstrlen(tls, bp+1344) + uint64(1))
  3975. need = need + align
  3976. if need > buflen {
  3977. return 34
  3978. }
  3979. buf += uintptr(align)
  3980. (*hostent)(unsafe.Pointer(h)).h_aliases = buf
  3981. buf += uintptr(uint64(3) * uint64(unsafe.Sizeof(uintptr(0))))
  3982. (*hostent)(unsafe.Pointer(h)).h_addr_list = buf
  3983. buf += uintptr(uint64(cnt+1) * uint64(unsafe.Sizeof(uintptr(0))))
  3984. for i = 0; i < cnt; i++ {
  3985. *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_addr_list + uintptr(i)*8)) = buf
  3986. buf += uintptr((*hostent)(unsafe.Pointer(h)).h_length)
  3987. Xmemcpy(tls, *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_addr_list + uintptr(i)*8)), bp+uintptr(i)*28+8, uint64((*hostent)(unsafe.Pointer(h)).h_length))
  3988. }
  3989. *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_addr_list + uintptr(i)*8)) = uintptr(0)
  3990. (*hostent)(unsafe.Pointer(h)).h_name = AssignPtrUintptr((*hostent)(unsafe.Pointer(h)).h_aliases, buf)
  3991. Xstrcpy(tls, (*hostent)(unsafe.Pointer(h)).h_name, bp+1344)
  3992. buf += uintptr(Xstrlen(tls, (*hostent)(unsafe.Pointer(h)).h_name) + uint64(1))
  3993. if Xstrcmp(tls, (*hostent)(unsafe.Pointer(h)).h_name, name) != 0 {
  3994. *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases + 1*8)) = buf
  3995. Xstrcpy(tls, *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases + 1*8)), name)
  3996. buf += uintptr(Xstrlen(tls, *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases + 1*8))) + uint64(1))
  3997. } else {
  3998. *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases + 1*8)) = uintptr(0)
  3999. }
  4000. *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases + 2*8)) = uintptr(0)
  4001. *(*uintptr)(unsafe.Pointer(res)) = h
  4002. return 0
  4003. }
  4004. func Xgethostbyname_r(tls *TLS, name uintptr, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname_r.c:6:5: */
  4005. return Xgethostbyname2_r(tls, name, 2, h, buf, buflen, res, err)
  4006. }
  4007. type if_nameindex = struct {
  4008. if_index uint32
  4009. _ [4]byte
  4010. if_name uintptr
  4011. } /* if.h:12:1 */
  4012. type ifaddr = struct {
  4013. ifa_addr struct {
  4014. sa_family sa_family_t
  4015. sa_data [14]uint8
  4016. }
  4017. ifa_ifu struct {
  4018. ifu_broadaddr struct {
  4019. sa_family sa_family_t
  4020. sa_data [14]uint8
  4021. }
  4022. }
  4023. ifa_ifp uintptr
  4024. ifa_next uintptr
  4025. } /* if.h:51:1 */
  4026. type ifmap = struct {
  4027. mem_start uint64
  4028. mem_end uint64
  4029. base_addr uint16
  4030. irq uint8
  4031. dma uint8
  4032. port uint8
  4033. _ [3]byte
  4034. } /* if.h:64:1 */
  4035. type ifreq = struct {
  4036. ifr_ifrn struct{ ifrn_name [16]uint8 }
  4037. ifr_ifru struct {
  4038. _ [0]uint64
  4039. ifru_addr struct {
  4040. sa_family sa_family_t
  4041. sa_data [14]uint8
  4042. }
  4043. _ [8]byte
  4044. }
  4045. } /* if.h:76:1 */
  4046. type ifconf = struct {
  4047. ifc_len int32
  4048. _ [4]byte
  4049. ifc_ifcu struct{ ifcu_buf uintptr }
  4050. } /* if.h:116:1 */
  4051. type ns_sect = uint32 /* nameser.h:37:3 */
  4052. type __ns_msg = struct {
  4053. _msg uintptr
  4054. _eom uintptr
  4055. _id uint16_t
  4056. _flags uint16_t
  4057. _counts [4]uint16_t
  4058. _ [4]byte
  4059. _sections [4]uintptr
  4060. _sect ns_sect
  4061. _rrnum int32
  4062. _msg_ptr uintptr
  4063. } /* nameser.h:39:9 */
  4064. type ns_msg = __ns_msg /* nameser.h:46:3 */
  4065. type _ns_flagdata = struct {
  4066. mask int32
  4067. shift int32
  4068. } /* nameser.h:48:1 */
  4069. type __ns_rr = struct {
  4070. name [1025]uint8
  4071. _ [1]byte
  4072. __type uint16_t
  4073. rr_class uint16_t
  4074. _ [2]byte
  4075. ttl uint32_t
  4076. rdlength uint16_t
  4077. _ [2]byte
  4078. rdata uintptr
  4079. } /* nameser.h:59:9 */
  4080. type ns_rr = __ns_rr /* nameser.h:66:3 */
  4081. type ns_flag = uint32 /* nameser.h:87:3 */
  4082. type ns_opcode = uint32 /* nameser.h:96:3 */
  4083. type ns_rcode = uint32 /* nameser.h:115:3 */
  4084. type ns_update_operation = uint32 /* nameser.h:121:3 */
  4085. type ns_tsig_key1 = struct {
  4086. name [1025]uint8
  4087. alg [1025]uint8
  4088. _ [6]byte
  4089. data uintptr
  4090. len int32
  4091. _ [4]byte
  4092. } /* nameser.h:123:1 */
  4093. type ns_tsig_key = ns_tsig_key1 /* nameser.h:128:28 */
  4094. type ns_tcp_tsig_state1 = struct {
  4095. counter int32
  4096. _ [4]byte
  4097. key uintptr
  4098. ctx uintptr
  4099. sig [512]uint8
  4100. siglen int32
  4101. _ [4]byte
  4102. } /* nameser.h:130:1 */
  4103. type ns_tcp_tsig_state = ns_tcp_tsig_state1 /* nameser.h:137:34 */
  4104. type ns_type = uint32 /* nameser.h:200:3 */
  4105. type ns_class = uint32 /* nameser.h:219:3 */
  4106. type ns_key_types = uint32 /* nameser.h:226:3 */
  4107. type ns_cert_types = uint32 /* nameser.h:234:3 */
  4108. type HEADER = struct {
  4109. _ [0]uint32
  4110. id uint32 /* unsigned id: 16, unsigned rd: 1, unsigned tc: 1, unsigned aa: 1, unsigned opcode: 4, unsigned qr: 1, unsigned rcode: 4, unsigned cd: 1, unsigned ad: 1, unsigned unused: 1, unsigned ra: 1 */
  4111. qdcount uint32 /* unsigned qdcount: 16, unsigned ancount: 16 */
  4112. nscount uint32 /* unsigned nscount: 16, unsigned arcount: 16 */
  4113. } /* nameser.h:353:3 */
  4114. // unused; purely for broken apps
  4115. type __res_state = struct {
  4116. retrans int32
  4117. retry int32
  4118. options uint64
  4119. nscount int32
  4120. nsaddr_list [3]struct {
  4121. sin_family sa_family_t
  4122. sin_port in_port_t
  4123. sin_addr struct{ s_addr in_addr_t }
  4124. sin_zero [8]uint8_t
  4125. }
  4126. id uint16
  4127. _ [2]byte
  4128. dnsrch [7]uintptr
  4129. defdname [256]uint8
  4130. pfcode uint64
  4131. ndots uint32 /* unsigned ndots: 4, unsigned nsort: 4, unsigned ipv6_unavail: 1, unsigned unused: 23 */
  4132. _ [4]byte
  4133. sort_list [10]struct {
  4134. addr struct{ s_addr in_addr_t }
  4135. mask uint32_t
  4136. }
  4137. qhook uintptr
  4138. rhook uintptr
  4139. res_h_errno int32
  4140. _vcsock int32
  4141. _flags uint32
  4142. _ [4]byte
  4143. _u struct {
  4144. _ [0]uint64
  4145. pad [52]uint8
  4146. _ [4]byte
  4147. }
  4148. } /* resolv.h:26:9 */
  4149. // unused; purely for broken apps
  4150. type res_state = uintptr /* resolv.h:62:3 */
  4151. type res_sym = struct {
  4152. number int32
  4153. _ [4]byte
  4154. name uintptr
  4155. humanname uintptr
  4156. } /* resolv.h:70:1 */
  4157. func itoa(tls *TLS, p uintptr, x uint32) uintptr { /* getnameinfo.c:18:13: */
  4158. p += uintptr(uint64(3) * uint64(unsafe.Sizeof(int32(0))))
  4159. *(*uint8)(unsafe.Pointer(PreDecUintptr(&p, 1))) = uint8(0)
  4160. for __ccgo := true; __ccgo; __ccgo = x != 0 {
  4161. *(*uint8)(unsafe.Pointer(PreDecUintptr(&p, 1))) = uint8(uint32('0') + x%uint32(10))
  4162. x = x / uint32(10)
  4163. }
  4164. return p
  4165. }
  4166. func mkptr4(tls *TLS, s uintptr, ip uintptr) { /* getnameinfo.c:28:13: */
  4167. bp := tls.Alloc(32)
  4168. defer tls.Free(32)
  4169. Xsprintf(tls, s, ts+25,
  4170. VaList(bp, int32(*(*uint8)(unsafe.Pointer(ip + 3))), int32(*(*uint8)(unsafe.Pointer(ip + 2))), int32(*(*uint8)(unsafe.Pointer(ip + 1))), int32(*(*uint8)(unsafe.Pointer(ip)))))
  4171. }
  4172. func mkptr6(tls *TLS, s uintptr, ip uintptr) { /* getnameinfo.c:34:13: */
  4173. var i int32
  4174. for i = 15; i >= 0; i-- {
  4175. *(*uint8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = _sxdigits[int32(*(*uint8)(unsafe.Pointer(ip + uintptr(i))))&15]
  4176. *(*uint8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = uint8('.')
  4177. *(*uint8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = _sxdigits[int32(*(*uint8)(unsafe.Pointer(ip + uintptr(i))))>>4]
  4178. *(*uint8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = uint8('.')
  4179. }
  4180. Xstrcpy(tls, s, ts+50)
  4181. }
  4182. var _sxdigits = *(*[17]uint8)(unsafe.Pointer(ts + 59)) /* getnameinfo.c:36:20 */
  4183. func reverse_hosts(tls *TLS, buf uintptr, a uintptr, scopeid uint32, family int32) { /* getnameinfo.c:45:13: */
  4184. bp := tls.Alloc(556)
  4185. defer tls.Free(556)
  4186. // var line [512]uint8 at bp+16, 512
  4187. var p uintptr
  4188. var z uintptr
  4189. var _buf [1032]uint8
  4190. _ = _buf
  4191. // var atmp [16]uint8 at bp, 16
  4192. // var iplit address at bp+528, 28
  4193. //TODO FILE _f, *f = __fopen_rb_ca("/etc/hosts", &_f, _buf, sizeof _buf);
  4194. var f uintptr = Xfopen(tls, ts+76, ts+87)
  4195. if !(f != 0) {
  4196. return
  4197. }
  4198. if family == 2 {
  4199. Xmemcpy(tls, bp+uintptr(12), a, uint64(4))
  4200. Xmemcpy(tls, bp, ts+90, uint64(12))
  4201. a = bp /* &atmp[0] */
  4202. }
  4203. for Xfgets(tls, bp+16, int32(unsafe.Sizeof([512]uint8{})), f) != 0 {
  4204. if AssignUintptr(&p, Xstrchr(tls, bp+16, '#')) != 0 {
  4205. *(*uint8)(unsafe.Pointer(PostIncUintptr(&p, 1))) = uint8('\n')
  4206. *(*uint8)(unsafe.Pointer(p)) = uint8(0)
  4207. }
  4208. for p = bp + 16; /* &line[0] */ *(*uint8)(unsafe.Pointer(p)) != 0 && !(__isspace(tls, int32(*(*uint8)(unsafe.Pointer(p)))) != 0); p++ {
  4209. }
  4210. *(*uint8)(unsafe.Pointer(PostIncUintptr(&p, 1))) = uint8(0)
  4211. if X__lookup_ipliteral(tls, bp+528, bp+16, 0) <= 0 {
  4212. continue
  4213. }
  4214. if (*address)(unsafe.Pointer(bp+528)).family == 2 {
  4215. Xmemcpy(tls, bp+528+8+uintptr(12), bp+528+8, uint64(4))
  4216. Xmemcpy(tls, bp+528+8, ts+90, uint64(12))
  4217. (*address)(unsafe.Pointer(bp + 528 /* &iplit */)).scopeid = uint32(0)
  4218. }
  4219. if Xmemcmp(tls, a, bp+528+8, uint64(16)) != 0 || (*address)(unsafe.Pointer(bp+528)).scopeid != scopeid {
  4220. continue
  4221. }
  4222. for ; *(*uint8)(unsafe.Pointer(p)) != 0 && __isspace(tls, int32(*(*uint8)(unsafe.Pointer(p)))) != 0; p++ {
  4223. }
  4224. for z = p; *(*uint8)(unsafe.Pointer(z)) != 0 && !(__isspace(tls, int32(*(*uint8)(unsafe.Pointer(z)))) != 0); z++ {
  4225. }
  4226. *(*uint8)(unsafe.Pointer(z)) = uint8(0)
  4227. if (int64(z)-int64(p))/1 < int64(256) {
  4228. Xmemcpy(tls, buf, p, uint64((int64(z)-int64(p))/1+int64(1)))
  4229. break
  4230. }
  4231. }
  4232. //TODO __fclose_ca(f);
  4233. Xfclose(tls, f)
  4234. }
  4235. func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getnameinfo.c:87:13: */
  4236. Xabort(tls) //TODO-
  4237. // unsigned long svport;
  4238. // char line[128], *p, *z;
  4239. // unsigned char _buf[1032];
  4240. // FILE _f, *f = __fopen_rb_ca("/etc/services", &_f, _buf, sizeof _buf);
  4241. // if (!f) return;
  4242. // while (fgets(line, sizeof line, f)) {
  4243. // if ((p=strchr(line, '#'))) *p++='\n', *p=0;
  4244. // for (p=line; *p && !isspace(*p); p++);
  4245. // if (!*p) continue;
  4246. // *p++ = 0;
  4247. // svport = strtoul(p, &z, 10);
  4248. // if (svport != port || z==p) continue;
  4249. // if (dgram && strncmp(z, "/udp", 4)) continue;
  4250. // if (!dgram && strncmp(z, "/tcp", 4)) continue;
  4251. // if (p-line > 32) continue;
  4252. // memcpy(buf, line, p-line);
  4253. // break;
  4254. // }
  4255. // __fclose_ca(f);
  4256. }
  4257. func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen socklen_t, serv uintptr, servlen socklen_t, flags int32) int32 { /* getnameinfo.c:125:5: */
  4258. bp := tls.Alloc(347)
  4259. defer tls.Free(347)
  4260. // var ptr [78]uint8 at bp, 78
  4261. // var buf [256]uint8 at bp+78, 256
  4262. // var num [13]uint8 at bp+334, 13
  4263. var af int32 = int32((*sockaddr)(unsafe.Pointer(sa1)).sa_family)
  4264. var a uintptr
  4265. var scopeid uint32
  4266. switch af {
  4267. case 2:
  4268. a = sa1 + 4
  4269. if uint64(sl) < uint64(unsafe.Sizeof(sockaddr_in{})) {
  4270. return -6
  4271. }
  4272. mkptr4(tls, bp, a)
  4273. scopeid = uint32(0)
  4274. break
  4275. case 10:
  4276. a = sa1 + 8
  4277. if uint64(sl) < uint64(unsafe.Sizeof(sockaddr_in6{})) {
  4278. return -6
  4279. }
  4280. if Xmemcmp(tls, a, ts+90, uint64(12)) != 0 {
  4281. mkptr6(tls, bp, a)
  4282. } else {
  4283. mkptr4(tls, bp, a+uintptr(12))
  4284. }
  4285. scopeid = (*sockaddr_in6)(unsafe.Pointer(sa1)).sin6_scope_id
  4286. break
  4287. default:
  4288. return -6
  4289. }
  4290. if node != 0 && nodelen != 0 {
  4291. *(*uint8)(unsafe.Pointer(bp + 78)) = uint8(0)
  4292. if !(flags&0x01 != 0) {
  4293. reverse_hosts(tls, bp+78, a, scopeid, af)
  4294. }
  4295. if !(int32(*(*uint8)(unsafe.Pointer(bp + 78))) != 0) && !(flags&0x01 != 0) {
  4296. Xabort(tls) //TODO-
  4297. // unsigned char query[18+PTR_MAX], reply[512];
  4298. // int qlen = __res_mkquery(0, ptr, 1, RR_PTR,
  4299. // 0, 0, 0, query, sizeof query);
  4300. // query[3] = 0; /* don't need AD flag */
  4301. // int rlen = __res_send(query, qlen, reply, sizeof reply);
  4302. // buf[0] = 0;
  4303. // if (rlen > 0)
  4304. // __dns_parse(reply, rlen, dns_parse_callback, buf);
  4305. }
  4306. if !(int32(*(*uint8)(unsafe.Pointer(bp + 78))) != 0) {
  4307. if flags&0x08 != 0 {
  4308. return -2
  4309. }
  4310. Xinet_ntop(tls, af, a, bp+78, uint32(unsafe.Sizeof([256]uint8{})))
  4311. if scopeid != 0 {
  4312. Xabort(tls) //TODO-
  4313. // char *p = 0, tmp[IF_NAMESIZE+1];
  4314. // if (!(flags & NI_NUMERICSCOPE) &&
  4315. // (IN6_IS_ADDR_LINKLOCAL(a) ||
  4316. // IN6_IS_ADDR_MC_LINKLOCAL(a)))
  4317. // p = if_indextoname(scopeid, tmp+1);
  4318. // if (!p)
  4319. // p = itoa(num, scopeid);
  4320. // *--p = '%';
  4321. // strcat(buf, p);
  4322. }
  4323. }
  4324. if Xstrlen(tls, bp+78) >= size_t(nodelen) {
  4325. return -12
  4326. }
  4327. Xstrcpy(tls, node, bp+78)
  4328. }
  4329. if serv != 0 && servlen != 0 {
  4330. var p uintptr = bp + 78 /* buf */
  4331. var port int32 = int32(Xntohs(tls, (*sockaddr_in)(unsafe.Pointer(sa1)).sin_port))
  4332. *(*uint8)(unsafe.Pointer(bp + 78)) = uint8(0)
  4333. if !(flags&0x02 != 0) {
  4334. reverse_services(tls, bp+78, port, flags&0x10)
  4335. }
  4336. if !(int32(*(*uint8)(unsafe.Pointer(p))) != 0) {
  4337. p = itoa(tls, bp+334, uint32(port))
  4338. }
  4339. if Xstrlen(tls, p) >= size_t(servlen) {
  4340. return -12
  4341. }
  4342. Xstrcpy(tls, serv, p)
  4343. }
  4344. return 0
  4345. }
  4346. var Xh_errno int32 /* h_errno.c:4:5: */
  4347. func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */
  4348. return uintptr(unsafe.Pointer(&Xh_errno))
  4349. }
  4350. func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */
  4351. bp := tls.Alloc(40)
  4352. defer tls.Free(40)
  4353. var s uintptr = s0
  4354. var d uintptr = dest
  4355. *(*[4]uint64)(unsafe.Pointer(bp /* a */)) = [4]uint64{0: uint64(0)}
  4356. // var z uintptr at bp+32, 8
  4357. var i int32
  4358. for i = 0; i < 4; i++ {
  4359. *(*uint64)(unsafe.Pointer(bp + uintptr(i)*8)) = Xstrtoul(tls, s, bp+32, 0)
  4360. if *(*uintptr)(unsafe.Pointer(bp + 32)) == s || *(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)))) != 0 && int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32))))) != '.' || !(func() int32 {
  4361. if 0 != 0 {
  4362. return Xisdigit(tls, int32(*(*uint8)(unsafe.Pointer(s))))
  4363. }
  4364. return Bool32(uint32(*(*uint8)(unsafe.Pointer(s)))-uint32('0') < uint32(10))
  4365. }() != 0) {
  4366. return 0
  4367. }
  4368. if !(int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32))))) != 0) {
  4369. break
  4370. }
  4371. s = *(*uintptr)(unsafe.Pointer(bp + 32)) + uintptr(1)
  4372. }
  4373. if i == 4 {
  4374. return 0
  4375. }
  4376. switch i {
  4377. case 0:
  4378. *(*uint64)(unsafe.Pointer(bp + 1*8)) = *(*uint64)(unsafe.Pointer(bp)) & uint64(0xffffff)
  4379. AssignShrPtrUint64(bp, int(24))
  4380. fallthrough
  4381. case 1:
  4382. *(*uint64)(unsafe.Pointer(bp + 2*8)) = *(*uint64)(unsafe.Pointer(bp + 1*8)) & uint64(0xffff)
  4383. AssignShrPtrUint64(bp+1*8, int(16))
  4384. fallthrough
  4385. case 2:
  4386. *(*uint64)(unsafe.Pointer(bp + 3*8)) = *(*uint64)(unsafe.Pointer(bp + 2*8)) & uint64(0xff)
  4387. AssignShrPtrUint64(bp+2*8, int(8))
  4388. }
  4389. for i = 0; i < 4; i++ {
  4390. if *(*uint64)(unsafe.Pointer(bp + uintptr(i)*8)) > uint64(255) {
  4391. return 0
  4392. }
  4393. *(*uint8)(unsafe.Pointer(d + uintptr(i))) = uint8(*(*uint64)(unsafe.Pointer(bp + uintptr(i)*8)))
  4394. }
  4395. return 1
  4396. }
  4397. func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */
  4398. bp := tls.Alloc(276)
  4399. defer tls.Free(276)
  4400. var a uintptr = a0
  4401. var i int32
  4402. var j int32
  4403. var max int32
  4404. var best int32
  4405. // var buf [100]uint8 at bp+176, 100
  4406. switch af {
  4407. case 2:
  4408. if socklen_t(Xsnprintf(tls, s, uint64(l), ts+103, VaList(bp, int32(*(*uint8)(unsafe.Pointer(a))), int32(*(*uint8)(unsafe.Pointer(a + 1))), int32(*(*uint8)(unsafe.Pointer(a + 2))), int32(*(*uint8)(unsafe.Pointer(a + 3)))))) < l {
  4409. return s
  4410. }
  4411. break
  4412. case 10:
  4413. if Xmemcmp(tls, a, ts+90, uint64(12)) != 0 {
  4414. Xsnprintf(tls, bp+176, uint64(unsafe.Sizeof([100]uint8{})),
  4415. ts+115,
  4416. VaList(bp+32, 256*int32(*(*uint8)(unsafe.Pointer(a)))+int32(*(*uint8)(unsafe.Pointer(a + 1))), 256*int32(*(*uint8)(unsafe.Pointer(a + 2)))+int32(*(*uint8)(unsafe.Pointer(a + 3))),
  4417. 256*int32(*(*uint8)(unsafe.Pointer(a + 4)))+int32(*(*uint8)(unsafe.Pointer(a + 5))), 256*int32(*(*uint8)(unsafe.Pointer(a + 6)))+int32(*(*uint8)(unsafe.Pointer(a + 7))),
  4418. 256*int32(*(*uint8)(unsafe.Pointer(a + 8)))+int32(*(*uint8)(unsafe.Pointer(a + 9))), 256*int32(*(*uint8)(unsafe.Pointer(a + 10)))+int32(*(*uint8)(unsafe.Pointer(a + 11))),
  4419. 256*int32(*(*uint8)(unsafe.Pointer(a + 12)))+int32(*(*uint8)(unsafe.Pointer(a + 13))), 256*int32(*(*uint8)(unsafe.Pointer(a + 14)))+int32(*(*uint8)(unsafe.Pointer(a + 15)))))
  4420. } else {
  4421. Xsnprintf(tls, bp+176, uint64(unsafe.Sizeof([100]uint8{})),
  4422. ts+139,
  4423. VaList(bp+96, 256*int32(*(*uint8)(unsafe.Pointer(a)))+int32(*(*uint8)(unsafe.Pointer(a + 1))), 256*int32(*(*uint8)(unsafe.Pointer(a + 2)))+int32(*(*uint8)(unsafe.Pointer(a + 3))),
  4424. 256*int32(*(*uint8)(unsafe.Pointer(a + 4)))+int32(*(*uint8)(unsafe.Pointer(a + 5))), 256*int32(*(*uint8)(unsafe.Pointer(a + 6)))+int32(*(*uint8)(unsafe.Pointer(a + 7))),
  4425. 256*int32(*(*uint8)(unsafe.Pointer(a + 8)))+int32(*(*uint8)(unsafe.Pointer(a + 9))), 256*int32(*(*uint8)(unsafe.Pointer(a + 10)))+int32(*(*uint8)(unsafe.Pointer(a + 11))),
  4426. int32(*(*uint8)(unsafe.Pointer(a + 12))), int32(*(*uint8)(unsafe.Pointer(a + 13))), int32(*(*uint8)(unsafe.Pointer(a + 14))), int32(*(*uint8)(unsafe.Pointer(a + 15)))))
  4427. }
  4428. // Replace longest /(^0|:)[:0]{2,}/ with "::"
  4429. i = AssignInt32(&best, 0)
  4430. max = 2
  4431. for ; *(*uint8)(unsafe.Pointer(bp + 176 + uintptr(i))) != 0; i++ {
  4432. if i != 0 && int32(*(*uint8)(unsafe.Pointer(bp + 176 + uintptr(i)))) != ':' {
  4433. continue
  4434. }
  4435. j = int32(Xstrspn(tls, bp+176+uintptr(i), ts+169))
  4436. if j > max {
  4437. best = i
  4438. max = j
  4439. }
  4440. }
  4441. if max > 3 {
  4442. *(*uint8)(unsafe.Pointer(bp + 176 + uintptr(best))) = AssignPtrUint8(bp+176+uintptr(best+1), uint8(':'))
  4443. Xmemmove(tls, bp+176+uintptr(best)+uintptr(2), bp+176+uintptr(best)+uintptr(max), uint64(i-best-max+1))
  4444. }
  4445. if Xstrlen(tls, bp+176) < size_t(l) {
  4446. Xstrcpy(tls, s, bp+176)
  4447. return s
  4448. }
  4449. break
  4450. default:
  4451. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 97
  4452. return uintptr(0)
  4453. }
  4454. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 28
  4455. return uintptr(0)
  4456. }
  4457. func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */
  4458. if c-uint32('0') < uint32(10) {
  4459. return int32(c - uint32('0'))
  4460. }
  4461. c = c | uint32(32)
  4462. if c-uint32('a') < uint32(6) {
  4463. return int32(c - uint32('a') + uint32(10))
  4464. }
  4465. return -1
  4466. }
  4467. func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */
  4468. bp := tls.Alloc(16)
  4469. defer tls.Free(16)
  4470. // var ip [8]uint16_t at bp, 16
  4471. var a uintptr = a0
  4472. var i int32
  4473. var j int32
  4474. var v int32
  4475. var d int32
  4476. var brk int32 = -1
  4477. var need_v4 int32 = 0
  4478. if af == 2 {
  4479. for i = 0; i < 4; i++ {
  4480. for v = AssignInt32(&j, 0); j < 3 && func() int32 {
  4481. if 0 != 0 {
  4482. return Xisdigit(tls, int32(*(*uint8)(unsafe.Pointer(s + uintptr(j)))))
  4483. }
  4484. return Bool32(uint32(*(*uint8)(unsafe.Pointer(s + uintptr(j))))-uint32('0') < uint32(10))
  4485. }() != 0; j++ {
  4486. v = 10*v + int32(*(*uint8)(unsafe.Pointer(s + uintptr(j)))) - '0'
  4487. }
  4488. if j == 0 || j > 1 && int32(*(*uint8)(unsafe.Pointer(s))) == '0' || v > 255 {
  4489. return 0
  4490. }
  4491. *(*uint8)(unsafe.Pointer(a + uintptr(i))) = uint8(v)
  4492. if int32(*(*uint8)(unsafe.Pointer(s + uintptr(j)))) == 0 && i == 3 {
  4493. return 1
  4494. }
  4495. if int32(*(*uint8)(unsafe.Pointer(s + uintptr(j)))) != '.' {
  4496. return 0
  4497. }
  4498. s += uintptr(j + 1)
  4499. }
  4500. return 0
  4501. } else if af != 10 {
  4502. *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 97
  4503. return -1
  4504. }
  4505. if int32(*(*uint8)(unsafe.Pointer(s))) == ':' && int32(*(*uint8)(unsafe.Pointer(PreIncUintptr(&s, 1)))) != ':' {
  4506. return 0
  4507. }
  4508. for i = 0; ; i++ {
  4509. if int32(*(*uint8)(unsafe.Pointer(s))) == ':' && brk < 0 {
  4510. brk = i
  4511. *(*uint16_t)(unsafe.Pointer(bp + uintptr(i&7)*2)) = uint16_t(0)
  4512. if !(int32(*(*uint8)(unsafe.Pointer(PreIncUintptr(&s, 1)))) != 0) {
  4513. break
  4514. }
  4515. if i == 7 {
  4516. return 0
  4517. }
  4518. continue
  4519. }
  4520. for v = AssignInt32(&j, 0); j < 4 && AssignInt32(&d, hexval(tls, uint32(*(*uint8)(unsafe.Pointer(s + uintptr(j)))))) >= 0; j++ {
  4521. v = 16*v + d
  4522. }
  4523. if j == 0 {
  4524. return 0
  4525. }
  4526. *(*uint16_t)(unsafe.Pointer(bp + uintptr(i&7)*2)) = uint16_t(v)
  4527. if !(int32(*(*uint8)(unsafe.Pointer(s + uintptr(j)))) != 0) && (brk >= 0 || i == 7) {
  4528. break
  4529. }
  4530. if i == 7 {
  4531. return 0
  4532. }
  4533. if int32(*(*uint8)(unsafe.Pointer(s + uintptr(j)))) != ':' {
  4534. if int32(*(*uint8)(unsafe.Pointer(s + uintptr(j)))) != '.' || i < 6 && brk < 0 {
  4535. return 0
  4536. }
  4537. need_v4 = 1
  4538. i++
  4539. break
  4540. }
  4541. s += uintptr(j + 1)
  4542. }
  4543. if brk >= 0 {
  4544. Xmemmove(tls, bp+uintptr(brk)*2+uintptr(7)*2-uintptr(i)*2, bp+uintptr(brk)*2, uint64(2*(i+1-brk)))
  4545. for j = 0; j < 7-i; j++ {
  4546. *(*uint16_t)(unsafe.Pointer(bp + uintptr(brk+j)*2)) = uint16_t(0)
  4547. }
  4548. }
  4549. for j = 0; j < 8; j++ {
  4550. *(*uint8)(unsafe.Pointer(PostIncUintptr(&a, 1))) = uint8(int32(*(*uint16_t)(unsafe.Pointer(bp + uintptr(j)*2))) >> 8)
  4551. *(*uint8)(unsafe.Pointer(PostIncUintptr(&a, 1))) = uint8(*(*uint16_t)(unsafe.Pointer(bp + uintptr(j)*2)))
  4552. }
  4553. if need_v4 != 0 && Xinet_pton(tls, 2, s, a-uintptr(4)) <= 0 {
  4554. return 0
  4555. }
  4556. return 1
  4557. }
  4558. func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */
  4559. bp := tls.Alloc(96)
  4560. defer tls.Free(96)
  4561. // var a4 in_addr at bp, 4
  4562. // var a6 in6_addr at bp+68, 16
  4563. if X__inet_aton(tls, name, bp) > 0 {
  4564. if family == 10 { // wrong family
  4565. return -2
  4566. }
  4567. Xmemcpy(tls, buf+8, bp, uint64(unsafe.Sizeof(in_addr{})))
  4568. (*address)(unsafe.Pointer(buf)).family = 2
  4569. (*address)(unsafe.Pointer(buf)).scopeid = uint32(0)
  4570. return 1
  4571. }
  4572. // var tmp [64]uint8 at bp+4, 64
  4573. var p uintptr = Xstrchr(tls, name, '%')
  4574. // var z uintptr at bp+88, 8
  4575. var scopeid uint64 = uint64(0)
  4576. if p != 0 && (int64(p)-int64(name))/1 < int64(64) {
  4577. Xmemcpy(tls, bp+4, name, uint64((int64(p)-int64(name))/1))
  4578. *(*uint8)(unsafe.Pointer(bp + 4 + uintptr((int64(p)-int64(name))/1))) = uint8(0)
  4579. name = bp + 4 /* &tmp[0] */
  4580. }
  4581. if Xinet_pton(tls, 10, name, bp+68) <= 0 {
  4582. return 0
  4583. }
  4584. if family == 2 { // wrong family
  4585. return -2
  4586. }
  4587. Xmemcpy(tls, buf+8, bp+68, uint64(unsafe.Sizeof(in6_addr{})))
  4588. (*address)(unsafe.Pointer(buf)).family = 10
  4589. if p != 0 {
  4590. if func() int32 {
  4591. if 0 != 0 {
  4592. return Xisdigit(tls, int32(*(*uint8)(unsafe.Pointer(PreIncUintptr(&p, 1)))))
  4593. }
  4594. return Bool32(uint32(*(*uint8)(unsafe.Pointer(PreIncUintptr(&p, 1))))-uint32('0') < uint32(10))
  4595. }() != 0 {
  4596. scopeid = Xstrtoull(tls, p, bp+88, 10)
  4597. } else {
  4598. *(*uintptr)(unsafe.Pointer(bp + 88 /* z */)) = p - uintptr(1)
  4599. }
  4600. if *(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))) != 0 {
  4601. Xabort(tls) //TODO-
  4602. // if (!IN6_IS_ADDR_LINKLOCAL(&a6) &&
  4603. // !IN6_IS_ADDR_MC_LINKLOCAL(&a6))
  4604. // return EAI_NONAME;
  4605. // scopeid = if_nametoindex(p);
  4606. // if (!scopeid) return EAI_NONAME;
  4607. }
  4608. if scopeid > uint64(0xffffffff) {
  4609. return -2
  4610. }
  4611. }
  4612. (*address)(unsafe.Pointer(buf)).scopeid = uint32(scopeid)
  4613. return 1
  4614. }
  4615. func is_valid_hostname(tls *TLS, host uintptr) int32 { /* lookup_name.c:18:12: */
  4616. var s uintptr
  4617. //TODO if (strnlen(host, 255)-1 >= 254 || mbstowcs(0, host, 0) == -1) return 0;
  4618. if Xstrnlen(tls, host, uint64(255))-uint64(1) >= uint64(254) {
  4619. return 0
  4620. }
  4621. for s = host; int32(*(*uint8)(unsafe.Pointer(s))) >= 0x80 || int32(*(*uint8)(unsafe.Pointer(s))) == '.' || int32(*(*uint8)(unsafe.Pointer(s))) == '-' || Xisalnum(tls, int32(*(*uint8)(unsafe.Pointer(s)))) != 0; s++ {
  4622. }
  4623. return BoolInt32(!(*(*uint8)(unsafe.Pointer(s)) != 0))
  4624. }
  4625. var Xzero_struct_address address /* lookup_name.c:27:16: */
  4626. func name_from_null(tls *TLS, buf uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:29:12: */
  4627. var cnt int32 = 0
  4628. if name != 0 {
  4629. return 0
  4630. }
  4631. if flags&0x01 != 0 {
  4632. //TODO if (family != AF_INET6)
  4633. //TODO buf[cnt++] = (struct address){ .family = AF_INET };
  4634. if family != 10 {
  4635. var x = Xzero_struct_address
  4636. x.family = 2
  4637. *(*address)(unsafe.Pointer(buf + uintptr(PostIncInt32(&cnt, 1))*28)) = x
  4638. }
  4639. //TODO if (family != AF_INET)
  4640. //TODO buf[cnt++] = (struct address){ .family = AF_INET6 };
  4641. if family != 2 {
  4642. var x = Xzero_struct_address
  4643. x.family = 10
  4644. *(*address)(unsafe.Pointer(buf + uintptr(PostIncInt32(&cnt, 1))*28)) = x
  4645. }
  4646. } else {
  4647. Xabort(tls) //TODO-
  4648. // if (family != AF_INET6)
  4649. // buf[cnt++] = (struct address){ .family = AF_INET, .addr = { 127,0,0,1 } };
  4650. // if (family != AF_INET)
  4651. // buf[cnt++] = (struct address){ .family = AF_INET6, .addr = { [15] = 1 } };
  4652. }
  4653. return cnt
  4654. }
  4655. func name_from_numeric(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_name.c:58:12: */
  4656. return X__lookup_ipliteral(tls, buf, name, family)
  4657. }
  4658. func name_from_hosts(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32) int32 { /* lookup_name.c:63:12: */
  4659. bp := tls.Alloc(512)
  4660. defer tls.Free(512)
  4661. // var line [512]uint8 at bp, 512
  4662. var l size_t = Xstrlen(tls, name)
  4663. var cnt int32 = 0
  4664. var badfam int32 = 0
  4665. var _buf [1032]uint8
  4666. _ = _buf
  4667. //TODO FILE _f, *f = __fopen_rb_ca("/etc/hosts", &_f, _buf, sizeof _buf);
  4668. var _f FILE
  4669. _ = _f
  4670. var f uintptr = Xfopen(tls, ts+76, ts+87)
  4671. if !(f != 0) {
  4672. switch *(*int32)(unsafe.Pointer(X___errno_location(tls))) {
  4673. case 2:
  4674. fallthrough
  4675. case 20:
  4676. fallthrough
  4677. case 13:
  4678. return 0
  4679. fallthrough
  4680. default:
  4681. return -11
  4682. }
  4683. }
  4684. for Xfgets(tls, bp, int32(unsafe.Sizeof([512]uint8{})), f) != 0 && cnt < 48 {
  4685. var p uintptr
  4686. var z uintptr
  4687. if AssignUintptr(&p, Xstrchr(tls, bp, '#')) != 0 {
  4688. *(*uint8)(unsafe.Pointer(PostIncUintptr(&p, 1))) = uint8('\n')
  4689. *(*uint8)(unsafe.Pointer(p)) = uint8(0)
  4690. }
  4691. for p = bp + uintptr(1); AssignUintptr(&p, Xstrstr(tls, p, name)) != 0 && (!(__isspace(tls, int32(*(*uint8)(unsafe.Pointer(p + UintptrFromInt32(-1))))) != 0) || !(__isspace(tls, int32(*(*uint8)(unsafe.Pointer(p + uintptr(l))))) != 0)); p++ {
  4692. }
  4693. if !(p != 0) {
  4694. continue
  4695. }
  4696. // Isolate IP address to parse
  4697. for p = bp; /* &line[0] */ *(*uint8)(unsafe.Pointer(p)) != 0 && !(__isspace(tls, int32(*(*uint8)(unsafe.Pointer(p)))) != 0); p++ {
  4698. }
  4699. *(*uint8)(unsafe.Pointer(PostIncUintptr(&p, 1))) = uint8(0)
  4700. switch name_from_numeric(tls, buf+uintptr(cnt)*28, bp, family) {
  4701. case 1:
  4702. cnt++
  4703. break
  4704. case 0:
  4705. continue
  4706. default:
  4707. badfam = -2
  4708. continue
  4709. }
  4710. // Extract first name as canonical name
  4711. for ; *(*uint8)(unsafe.Pointer(p)) != 0 && __isspace(tls, int32(*(*uint8)(unsafe.Pointer(p)))) != 0; p++ {
  4712. }
  4713. for z = p; *(*uint8)(unsafe.Pointer(z)) != 0 && !(__isspace(tls, int32(*(*uint8)(unsafe.Pointer(z)))) != 0); z++ {
  4714. }
  4715. *(*uint8)(unsafe.Pointer(z)) = uint8(0)
  4716. if is_valid_hostname(tls, p) != 0 {
  4717. Xmemcpy(tls, canon, p, uint64((int64(z)-int64(p))/1+int64(1)))
  4718. }
  4719. }
  4720. //TODO __fclose_ca(f);
  4721. Xfclose(tls, f)
  4722. if cnt != 0 {
  4723. return cnt
  4724. }
  4725. return badfam
  4726. }
  4727. type dpc_ctx = struct {
  4728. addrs uintptr
  4729. canon uintptr
  4730. cnt int32
  4731. _ [4]byte
  4732. } /* lookup_name.c:112:1 */
  4733. func name_from_dns_search(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32) int32 { /* lookup_name.c:191:12: */
  4734. return -1 //TODO-
  4735. Xabort(tls)
  4736. return int32(0) //TODO-
  4737. // char search[256];
  4738. // struct resolvconf conf;
  4739. // size_t l, dots;
  4740. // char *p, *z;
  4741. // if (__get_resolv_conf(&conf, search, sizeof search) < 0) return -1;
  4742. // /* Count dots, suppress search when >=ndots or name ends in
  4743. // * a dot, which is an explicit request for global scope. */
  4744. // for (dots=l=0; name[l]; l++) if (name[l]=='.') dots++;
  4745. // if (dots >= conf.ndots || name[l-1]=='.') *search = 0;
  4746. // /* Strip final dot for canon, fail if multiple trailing dots. */
  4747. // if (name[l-1]=='.') l--;
  4748. // if (!l || name[l-1]=='.') return EAI_NONAME;
  4749. // /* This can never happen; the caller already checked length. */
  4750. // if (l >= 256) return EAI_NONAME;
  4751. // /* Name with search domain appended is setup in canon[]. This both
  4752. // * provides the desired default canonical name (if the requested
  4753. // * name is not a CNAME record) and serves as a buffer for passing
  4754. // * the full requested name to name_from_dns. */
  4755. // memcpy(canon, name, l);
  4756. // canon[l] = '.';
  4757. // for (p=search; *p; p=z) {
  4758. // for (; isspace(*p); p++);
  4759. // for (z=p; *z && !isspace(*z); z++);
  4760. // if (z==p) break;
  4761. // if (z-p < 256 - l - 1) {
  4762. // memcpy(canon+l+1, p, z-p);
  4763. // canon[z-p+1+l] = 0;
  4764. // int cnt = name_from_dns(buf, canon, canon, family, &conf);
  4765. // if (cnt) return cnt;
  4766. // }
  4767. // }
  4768. // canon[l] = 0;
  4769. // return name_from_dns(buf, canon, name, family, &conf);
  4770. }
  4771. type policy = struct {
  4772. addr [16]uint8
  4773. len uint8
  4774. mask uint8
  4775. prec uint8
  4776. label uint8
  4777. } /* lookup_name.c:237:14 */
  4778. var defpolicy = [6]policy{
  4779. {addr: *(*[16]uint8)(unsafe.Pointer(ts + 172)), len: uint8(15), mask: uint8(0xff), prec: uint8(50)},
  4780. {addr: *(*[16]uint8)(unsafe.Pointer(ts + 189)), len: uint8(11), mask: uint8(0xff), prec: uint8(35), label: uint8(4)},
  4781. {addr: *(*[16]uint8)(unsafe.Pointer(ts + 205)), len: uint8(1), mask: uint8(0xff), prec: uint8(30), label: uint8(2)},
  4782. {addr: *(*[16]uint8)(unsafe.Pointer(ts + 221)), len: uint8(3), mask: uint8(0xff), prec: uint8(5), label: uint8(5)},
  4783. {addr: *(*[16]uint8)(unsafe.Pointer(ts + 237)), mask: uint8(0xfe), prec: uint8(3), label: uint8(13)},
  4784. // Last rule must match all addresses to stop loop.
  4785. {addr: *(*[16]uint8)(unsafe.Pointer(ts + 253)), prec: uint8(40), label: uint8(1)},
  4786. } /* lookup_name.c:241:3 */
  4787. func policyof(tls *TLS, a uintptr) uintptr { /* lookup_name.c:259:28: */
  4788. var i int32
  4789. for i = 0; ; i++ {
  4790. if Xmemcmp(tls, a, uintptr(unsafe.Pointer(&defpolicy))+uintptr(i)*20, uint64(defpolicy[i].len)) != 0 {
  4791. continue
  4792. }
  4793. if int32(*(*uint8_t)(unsafe.Pointer(a + uintptr(defpolicy[i].len))))&int32(defpolicy[i].mask) !=
  4794. int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&defpolicy)) + uintptr(i)*20 + uintptr(defpolicy[i].len)))) {
  4795. continue
  4796. }
  4797. return uintptr(unsafe.Pointer(&defpolicy)) + uintptr(i)*20
  4798. }
  4799. return uintptr(0)
  4800. }
  4801. func labelof(tls *TLS, a uintptr) int32 { /* lookup_name.c:272:12: */
  4802. return int32((*policy)(unsafe.Pointer(policyof(tls, a))).label)
  4803. }
  4804. func scopeof(tls *TLS, a uintptr) int32 { /* lookup_name.c:277:12: */
  4805. if int32(*(*uint8_t)(unsafe.Pointer(a))) == 0xff {
  4806. return int32(*(*uint8_t)(unsafe.Pointer(a + 1))) & 15
  4807. }
  4808. if int32(*(*uint8_t)(unsafe.Pointer(a))) == 0xfe && int32(*(*uint8_t)(unsafe.Pointer(a + 1)))&0xc0 == 0x80 {
  4809. return 2
  4810. }
  4811. if *(*uint32_t)(unsafe.Pointer(a)) == uint32_t(0) && *(*uint32_t)(unsafe.Pointer(a + 1*4)) == uint32_t(0) && *(*uint32_t)(unsafe.Pointer(a + 2*4)) == uint32_t(0) && int32(*(*uint8_t)(unsafe.Pointer(a + 12))) == 0 && int32(*(*uint8_t)(unsafe.Pointer(a + 13))) == 0 && int32(*(*uint8_t)(unsafe.Pointer(a + 14))) == 0 && int32(*(*uint8_t)(unsafe.Pointer(a + 15))) == 1 {
  4812. return 2
  4813. }
  4814. if int32(*(*uint8_t)(unsafe.Pointer(a))) == 0xfe && int32(*(*uint8_t)(unsafe.Pointer(a + 1)))&0xc0 == 0xc0 {
  4815. return 5
  4816. }
  4817. return 14
  4818. }
  4819. func prefixmatch(tls *TLS, s uintptr, d uintptr) int32 { /* lookup_name.c:286:12: */
  4820. // FIXME: The common prefix length should be limited to no greater
  4821. // than the nominal length of the prefix portion of the source
  4822. // address. However the definition of the source prefix length is
  4823. // not clear and thus this limiting is not yet implemented.
  4824. var i uint32
  4825. for i = uint32(0); i < uint32(128) && !((int32(*(*uint8_t)(unsafe.Pointer(s /* &.__in6_union */ /* &.__s6_addr */ + uintptr(i/uint32(8)))))^int32(*(*uint8_t)(unsafe.Pointer(d /* &.__in6_union */ /* &.__s6_addr */ + uintptr(i/uint32(8))))))&(int32(128)>>(i%uint32(8))) != 0); i++ {
  4826. }
  4827. return int32(i)
  4828. }
  4829. func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: */
  4830. var a uintptr = _a
  4831. var b uintptr = _b
  4832. return (*address)(unsafe.Pointer(b)).sortkey - (*address)(unsafe.Pointer(a)).sortkey
  4833. }
  4834. func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */
  4835. bp := tls.Alloc(92)
  4836. defer tls.Free(92)
  4837. var cnt int32 = 0
  4838. var i int32
  4839. var j int32
  4840. _ = j
  4841. *(*uint8)(unsafe.Pointer(canon)) = uint8(0)
  4842. if name != 0 {
  4843. // reject empty name and check len so it fits into temp bufs
  4844. var l size_t = Xstrnlen(tls, name, uint64(255))
  4845. if l-uint64(1) >= uint64(254) {
  4846. return -2
  4847. }
  4848. Xmemcpy(tls, canon, name, l+uint64(1))
  4849. }
  4850. // Procedurally, a request for v6 addresses with the v4-mapped
  4851. // flag set is like a request for unspecified family, followed
  4852. // by filtering of the results.
  4853. if flags&0x08 != 0 {
  4854. if family == 10 {
  4855. family = 0
  4856. } else {
  4857. flags = flags - 0x08
  4858. }
  4859. }
  4860. // Try each backend until there's at least one result.
  4861. cnt = name_from_null(tls, buf, name, family, flags)
  4862. if !(cnt != 0) {
  4863. cnt = name_from_numeric(tls, buf, name, family)
  4864. }
  4865. if !(cnt != 0) && !(flags&0x04 != 0) {
  4866. cnt = name_from_hosts(tls, buf, canon, name, family)
  4867. if !(cnt != 0) {
  4868. cnt = name_from_dns_search(tls, buf, canon, name, family)
  4869. }
  4870. }
  4871. if cnt <= 0 {
  4872. if cnt != 0 {
  4873. return cnt
  4874. }
  4875. return -2
  4876. }
  4877. // Filter/transform results for v4-mapped lookup, if requested.
  4878. if flags&0x08 != 0 {
  4879. Xabort(tls) //TODO-
  4880. // if (!(flags & AI_ALL)) {
  4881. // /* If any v6 results exist, remove v4 results. */
  4882. // for (i=0; i<cnt && buf[i].family != AF_INET6; i++);
  4883. // if (i<cnt) {
  4884. // for (j=0; i<cnt; i++) {
  4885. // if (buf[i].family == AF_INET6)
  4886. // buf[j++] = buf[i];
  4887. // }
  4888. // cnt = i = j;
  4889. // }
  4890. // }
  4891. // /* Translate any remaining v4 results to v6 */
  4892. // for (i=0; i<cnt; i++) {
  4893. // if (buf[i].family != AF_INET) continue;
  4894. // memcpy(buf[i].addr+12, buf[i].addr, 4);
  4895. // memcpy(buf[i].addr, "\0\0\0\0\0\0\0\0\0\0\xff\xff", 12);
  4896. // buf[i].family = AF_INET6;
  4897. // }
  4898. }
  4899. // No further processing is needed if there are fewer than 2
  4900. // results or if there are only IPv4 results.
  4901. if cnt < 2 || family == 2 {
  4902. return cnt
  4903. }
  4904. for i = 0; i < cnt; i++ {
  4905. if (*address)(unsafe.Pointer(buf+uintptr(i)*28)).family != 2 {
  4906. break
  4907. }
  4908. }
  4909. if i == cnt {
  4910. return cnt
  4911. }
  4912. var cs int32
  4913. _ = cs
  4914. //TODO pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs);
  4915. // The following implements a subset of RFC 3484/6724 destination
  4916. // address selection by generating a single 31-bit sort key for
  4917. // each address. Rules 3, 4, and 7 are omitted for having
  4918. // excessive runtime and code size cost and dubious benefit.
  4919. // So far the label/precedence table cannot be customized.
  4920. for i = 0; i < cnt; i++ {
  4921. var family int32 = (*address)(unsafe.Pointer(buf + uintptr(i)*28)).family
  4922. var key int32 = 0
  4923. *(*sockaddr_in6)(unsafe.Pointer(bp + 28 /* sa6 */)) = sockaddr_in6{}
  4924. *(*sockaddr_in6)(unsafe.Pointer(bp /* da6 */)) = sockaddr_in6{sin6_family: sa_family_t(10), sin6_port: in_port_t(65535), sin6_scope_id: (*address)(unsafe.Pointer(buf + uintptr(i)*28)).scopeid}
  4925. *(*sockaddr_in)(unsafe.Pointer(bp + 72 /* sa4 */)) = sockaddr_in{}
  4926. *(*sockaddr_in)(unsafe.Pointer(bp + 56 /* da4 */)) = sockaddr_in{sin_family: sa_family_t(2), sin_port: in_port_t(65535)}
  4927. var sa1 uintptr
  4928. var da uintptr
  4929. // var salen socklen_t at bp+88, 4
  4930. var dalen socklen_t
  4931. if family == 10 {
  4932. Xmemcpy(tls, bp+8, buf+uintptr(i)*28+8, uint64(16))
  4933. da = bp /* &da6 */
  4934. dalen = socklen_t(unsafe.Sizeof(sockaddr_in6{}))
  4935. sa1 = bp + 28 /* &sa6 */
  4936. *(*socklen_t)(unsafe.Pointer(bp + 88 /* salen */)) = socklen_t(unsafe.Sizeof(sockaddr_in6{}))
  4937. } else {
  4938. Xmemcpy(tls, bp+28+8,
  4939. ts+90, uint64(12))
  4940. Xmemcpy(tls, bp+8+uintptr(12), buf+uintptr(i)*28+8, uint64(4))
  4941. Xmemcpy(tls, bp+8,
  4942. ts+90, uint64(12))
  4943. Xmemcpy(tls, bp+8+uintptr(12), buf+uintptr(i)*28+8, uint64(4))
  4944. Xmemcpy(tls, bp+56+4, buf+uintptr(i)*28+8, uint64(4))
  4945. da = bp + 56 /* &da4 */
  4946. dalen = socklen_t(unsafe.Sizeof(sockaddr_in{}))
  4947. sa1 = bp + 72 /* &sa4 */
  4948. *(*socklen_t)(unsafe.Pointer(bp + 88 /* salen */)) = socklen_t(unsafe.Sizeof(sockaddr_in{}))
  4949. }
  4950. var dpolicy uintptr = policyof(tls, bp+8)
  4951. var dscope int32 = scopeof(tls, bp+8)
  4952. var dlabel int32 = int32((*policy)(unsafe.Pointer(dpolicy)).label)
  4953. var dprec int32 = int32((*policy)(unsafe.Pointer(dpolicy)).prec)
  4954. var prefixlen int32 = 0
  4955. var fd int32 = Xsocket(tls, family, 2|02000000, 17)
  4956. if fd >= 0 {
  4957. if !(Xconnect(tls, fd, da, dalen) != 0) {
  4958. key = key | 0x40000000
  4959. if !(Xgetsockname(tls, fd, sa1, bp+88) != 0) {
  4960. if family == 2 {
  4961. Xmemcpy(tls,
  4962. bp+28+8+uintptr(12),
  4963. bp+72+4, uint64(4))
  4964. }
  4965. if dscope == scopeof(tls, bp+28+8) {
  4966. key = key | 0x20000000
  4967. }
  4968. if dlabel == labelof(tls, bp+28+8) {
  4969. key = key | 0x10000000
  4970. }
  4971. prefixlen = prefixmatch(tls, bp+28+8,
  4972. bp+8)
  4973. }
  4974. }
  4975. Xclose(tls, fd)
  4976. }
  4977. key = key | dprec<<20
  4978. key = key | (15-dscope)<<16
  4979. key = key | prefixlen<<8
  4980. key = key | (48-i)<<0
  4981. (*address)(unsafe.Pointer(buf + uintptr(i)*28)).sortkey = key
  4982. }
  4983. Xqsort(tls, buf, uint64(cnt), uint64(unsafe.Sizeof(address{})), *(*uintptr)(unsafe.Pointer(&struct {
  4984. f func(*TLS, uintptr, uintptr) int32
  4985. }{addrcmp})))
  4986. //TODO pthread_setcancelstate(cs, 0);
  4987. return cnt
  4988. }
  4989. func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */
  4990. bp := tls.Alloc(8)
  4991. defer tls.Free(8)
  4992. var line [128]uint8
  4993. _ = line
  4994. var cnt int32 = 0
  4995. var p uintptr
  4996. _ = p
  4997. *(*uintptr)(unsafe.Pointer(bp /* z */)) = ts + 13 /* "" */
  4998. var port uint64 = uint64(0)
  4999. switch socktype {
  5000. case 1:
  5001. switch proto {
  5002. case 0:
  5003. proto = 6
  5004. fallthrough
  5005. case 6:
  5006. break
  5007. default:
  5008. return -8
  5009. }
  5010. break
  5011. case 2:
  5012. switch proto {
  5013. case 0:
  5014. proto = 17
  5015. fallthrough
  5016. case 17:
  5017. break
  5018. default:
  5019. return -8
  5020. }
  5021. fallthrough
  5022. case 0:
  5023. break
  5024. default:
  5025. if name != 0 {
  5026. return -8
  5027. }
  5028. (*service)(unsafe.Pointer(buf)).port = uint16_t(0)
  5029. (*service)(unsafe.Pointer(buf)).proto = uint8(proto)
  5030. (*service)(unsafe.Pointer(buf)).socktype = uint8(socktype)
  5031. return 1
  5032. }
  5033. if name != 0 {
  5034. if !(int32(*(*uint8)(unsafe.Pointer(name))) != 0) {
  5035. return -8
  5036. }
  5037. port = Xstrtoul(tls, name, bp, 10)
  5038. }
  5039. if !(int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) != 0) {
  5040. if port > uint64(65535) {
  5041. return -8
  5042. }
  5043. if proto != 17 {
  5044. (*service)(unsafe.Pointer(buf + uintptr(cnt)*4)).port = uint16_t(port)
  5045. (*service)(unsafe.Pointer(buf + uintptr(cnt)*4)).socktype = uint8(1)
  5046. (*service)(unsafe.Pointer(buf + uintptr(PostIncInt32(&cnt, 1))*4)).proto = uint8(6)
  5047. }
  5048. if proto != 6 {
  5049. (*service)(unsafe.Pointer(buf + uintptr(cnt)*4)).port = uint16_t(port)
  5050. (*service)(unsafe.Pointer(buf + uintptr(cnt)*4)).socktype = uint8(2)
  5051. (*service)(unsafe.Pointer(buf + uintptr(PostIncInt32(&cnt, 1))*4)).proto = uint8(17)
  5052. }
  5053. return cnt
  5054. }
  5055. if flags&0x400 != 0 {
  5056. return -2
  5057. }
  5058. var l size_t = Xstrlen(tls, name)
  5059. _ = l
  5060. Xabort(tls) //TODO-
  5061. // unsigned char _buf[1032];
  5062. // FILE _f, *f = __fopen_rb_ca("/etc/services", &_f, _buf, sizeof _buf);
  5063. // if (!f) switch (errno) {
  5064. // case ENOENT:
  5065. // case ENOTDIR:
  5066. // case EACCES:
  5067. // return EAI_SERVICE;
  5068. // default:
  5069. // return EAI_SYSTEM;
  5070. // }
  5071. Xabort(tls) //TODO-
  5072. // while (fgets(line, sizeof line, f) && cnt < MAXSERVS) {
  5073. // if ((p=strchr(line, '#'))) *p++='\n', *p=0;
  5074. // /* Find service name */
  5075. // for(p=line; (p=strstr(p, name)); p++) {
  5076. // if (p>line && !isspace(p[-1])) continue;
  5077. // if (p[l] && !isspace(p[l])) continue;
  5078. // break;
  5079. // }
  5080. // if (!p) continue;
  5081. // /* Skip past canonical name at beginning of line */
  5082. // for (p=line; *p && !isspace(*p); p++);
  5083. // port = strtoul(p, &z, 10);
  5084. // if (port > 65535 || z==p) continue;
  5085. // if (!strncmp(z, "/udp", 4)) {
  5086. // if (proto == IPPROTO_TCP) continue;
  5087. // buf[cnt].port = port;
  5088. // buf[cnt].socktype = SOCK_DGRAM;
  5089. // buf[cnt++].proto = IPPROTO_UDP;
  5090. // }
  5091. // if (!strncmp(z, "/tcp", 4)) {
  5092. // if (proto == IPPROTO_UDP) continue;
  5093. // buf[cnt].port = port;
  5094. // buf[cnt].socktype = SOCK_STREAM;
  5095. // buf[cnt++].proto = IPPROTO_TCP;
  5096. // }
  5097. // }
  5098. // __fclose_ca(f);
  5099. // return cnt > 0 ? cnt : EAI_SERVICE;
  5100. Xabort(tls)
  5101. return int32(0) //TODO-
  5102. }
  5103. func temper(tls *TLS, x uint32) uint32 { /* rand_r.c:3:17: */
  5104. x = x ^ x>>11
  5105. x = x ^ x<<7&0x9D2C5680
  5106. x = x ^ x<<15&0xEFC60000
  5107. x = x ^ x>>18
  5108. return x
  5109. }
  5110. func Xrand_r(tls *TLS, seed uintptr) int32 { /* rand_r.c:12:5: */
  5111. return int32(temper(tls, AssignPtrUint32(seed, *(*uint32)(unsafe.Pointer(seed))*uint32(1103515245)+uint32(12345))) / uint32(2))
  5112. }
  5113. func X__lockfile(tls *TLS, f uintptr) int32 { /* __lockfile.c:4:5: */
  5114. var owner int32 = (*FILE)(unsafe.Pointer(f)).lock
  5115. var tid int32 = (*__pthread)(unsafe.Pointer(__pthread_self(tls))).tid
  5116. if owner&CplInt32(0x40000000) == tid {
  5117. return 0
  5118. }
  5119. owner = a_cas(tls, f+140, 0, tid)
  5120. if !(owner != 0) {
  5121. return 1
  5122. }
  5123. for AssignInt32(&owner, a_cas(tls, f+140, 0, tid|0x40000000)) != 0 {
  5124. if owner&0x40000000 != 0 || a_cas(tls, f+140, owner, owner|0x40000000) == owner {
  5125. __futexwait(tls, f+140, owner|0x40000000, 1)
  5126. }
  5127. }
  5128. return 1
  5129. }
  5130. func X__unlockfile(tls *TLS, f uintptr) { /* __lockfile.c:19:6: */
  5131. if a_swap(tls, f+140, 0)&0x40000000 != 0 {
  5132. __wake(tls, f+140, 1, 1)
  5133. }
  5134. }
  5135. func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */
  5136. *(*int32)(unsafe.Pointer(f + 136)) |= (*FILE)(unsafe.Pointer(f)).mode - 1
  5137. if (*FILE)(unsafe.Pointer(f)).wpos != (*FILE)(unsafe.Pointer(f)).wbase {
  5138. (*struct {
  5139. f func(*TLS, uintptr, uintptr, size_t) size_t
  5140. })(unsafe.Pointer(&struct{ uintptr }{(*FILE)(unsafe.Pointer(f)).write})).f(tls, f, uintptr(0), uint64(0))
  5141. }
  5142. (*FILE)(unsafe.Pointer(f)).wpos = AssignPtrUintptr(f+56, AssignPtrUintptr(f+32, uintptr(0)))
  5143. if (*FILE)(unsafe.Pointer(f)).flags&uint32(4) != 0 {
  5144. *(*uint32)(unsafe.Pointer(f)) |= uint32(32)
  5145. return -1
  5146. }
  5147. (*FILE)(unsafe.Pointer(f)).rpos = AssignPtrUintptr(f+16, (*FILE)(unsafe.Pointer(f)).buf+uintptr((*FILE)(unsafe.Pointer(f)).buf_size))
  5148. if (*FILE)(unsafe.Pointer(f)).flags&uint32(16) != 0 {
  5149. return -1
  5150. }
  5151. return 0
  5152. }
  5153. func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */
  5154. X__builtin_abort(tls) //TODO-
  5155. // __stdio_exit_needed();
  5156. }
  5157. // This function assumes it will never be called if there is already
  5158. // data buffered for reading.
  5159. func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */
  5160. bp := tls.Alloc(1)
  5161. defer tls.Free(1)
  5162. // var c uint8 at bp, 1
  5163. if !(X__toread(tls, f) != 0) && (*struct {
  5164. f func(*TLS, uintptr, uintptr, size_t) size_t
  5165. })(unsafe.Pointer(&struct{ uintptr }{(*FILE)(unsafe.Pointer(f)).read})).f(tls, f, bp, uint64(1)) == uint64(1) {
  5166. return int32(*(*uint8)(unsafe.Pointer(bp)))
  5167. }
  5168. return -1
  5169. }
  5170. func Xsscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) int32 { /* sscanf.c:4:5: */
  5171. var ret int32
  5172. var ap va_list
  5173. _ = ap
  5174. ap = va
  5175. ret = Xvsscanf(tls, s, fmt, ap)
  5176. _ = ap
  5177. return ret
  5178. }
  5179. type wctrans_t = uintptr /* wctype.h:20:19 */
  5180. func store_int(tls *TLS, dest uintptr, size int32, i uint64) { /* vfscanf.c:22:13: */
  5181. if !(dest != 0) {
  5182. return
  5183. }
  5184. switch size {
  5185. case -2:
  5186. *(*uint8)(unsafe.Pointer(dest)) = uint8(i)
  5187. break
  5188. case -1:
  5189. *(*int16)(unsafe.Pointer(dest)) = int16(i)
  5190. break
  5191. case 0:
  5192. *(*int32)(unsafe.Pointer(dest)) = int32(i)
  5193. break
  5194. case 1:
  5195. *(*int64)(unsafe.Pointer(dest)) = int64(i)
  5196. break
  5197. case 3:
  5198. *(*int64)(unsafe.Pointer(dest)) = int64(i)
  5199. break
  5200. }
  5201. }
  5202. func arg_n(tls *TLS, ap va_list, n uint32) uintptr { /* vfscanf.c:44:13: */
  5203. var p uintptr
  5204. var i uint32
  5205. var ap2 va_list
  5206. _ = ap2
  5207. ap2 = ap
  5208. for i = n; i > uint32(1); i-- {
  5209. VaUintptr(&ap2)
  5210. }
  5211. p = VaUintptr(&ap2)
  5212. _ = ap2
  5213. return p
  5214. }
  5215. func Xvfscanf(tls *TLS, f uintptr, fmt uintptr, ap va_list) int32 { /* vfscanf.c:56:5: */
  5216. bp := tls.Alloc(276)
  5217. defer tls.Free(276)
  5218. var width int32
  5219. var size int32
  5220. var alloc int32
  5221. var base int32
  5222. var p uintptr
  5223. var c int32
  5224. var t int32
  5225. var s uintptr
  5226. var wcs uintptr
  5227. // var st mbstate_t at bp+268, 8
  5228. var dest uintptr
  5229. var invert int32
  5230. var matches int32
  5231. var x uint64
  5232. var y float64
  5233. var pos off_t
  5234. // var scanset [257]uint8 at bp, 257
  5235. var i size_t
  5236. var k size_t
  5237. // var wc wchar_t at bp+260, 4
  5238. var __need_unlock int32
  5239. var tmp uintptr
  5240. var tmp1 uintptr
  5241. alloc = 0
  5242. dest = uintptr(0)
  5243. matches = 0
  5244. pos = int64(0)
  5245. __need_unlock = func() int32 {
  5246. if (*FILE)(unsafe.Pointer(f)).lock >= 0 {
  5247. return X__lockfile(tls, f)
  5248. }
  5249. return 0
  5250. }()
  5251. if !!(int32((*FILE)(unsafe.Pointer(f)).rpos) != 0) {
  5252. goto __1
  5253. }
  5254. X__toread(tls, f)
  5255. __1:
  5256. ;
  5257. if !!(int32((*FILE)(unsafe.Pointer(f)).rpos) != 0) {
  5258. goto __2
  5259. }
  5260. goto input_fail
  5261. __2:
  5262. ;
  5263. p = fmt
  5264. __3:
  5265. if !(*(*uint8)(unsafe.Pointer(p)) != 0) {
  5266. goto __5
  5267. }
  5268. alloc = 0
  5269. if !(__isspace(tls, int32(*(*uint8)(unsafe.Pointer(p)))) != 0) {
  5270. goto __6
  5271. }
  5272. __7:
  5273. if !(__isspace(tls, int32(*(*uint8)(unsafe.Pointer(p + 1)))) != 0) {
  5274. goto __8
  5275. }
  5276. p++
  5277. goto __7
  5278. __8:
  5279. ;
  5280. X__shlim(tls, f, int64(0))
  5281. __9:
  5282. if !(__isspace(tls, func() int32 {
  5283. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  5284. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  5285. }
  5286. return X__shgetc(tls, f)
  5287. }()) != 0) {
  5288. goto __10
  5289. }
  5290. goto __9
  5291. __10:
  5292. ;
  5293. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  5294. (*FILE)(unsafe.Pointer(f)).rpos--
  5295. } else {
  5296. }
  5297. pos = pos + ((*FILE)(unsafe.Pointer(f)).shcnt + (int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1)
  5298. goto __4
  5299. __6:
  5300. ;
  5301. if !(int32(*(*uint8)(unsafe.Pointer(p))) != '%' || int32(*(*uint8)(unsafe.Pointer(p + 1))) == '%') {
  5302. goto __11
  5303. }
  5304. X__shlim(tls, f, int64(0))
  5305. if !(int32(*(*uint8)(unsafe.Pointer(p))) == '%') {
  5306. goto __12
  5307. }
  5308. p++
  5309. __14:
  5310. if !(__isspace(tls, AssignInt32(&c, func() int32 {
  5311. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  5312. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  5313. }
  5314. return X__shgetc(tls, f)
  5315. }())) != 0) {
  5316. goto __15
  5317. }
  5318. goto __14
  5319. __15:
  5320. ;
  5321. goto __13
  5322. __12:
  5323. c = func() int32 {
  5324. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  5325. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  5326. }
  5327. return X__shgetc(tls, f)
  5328. }()
  5329. __13:
  5330. ;
  5331. if !(c != int32(*(*uint8)(unsafe.Pointer(p)))) {
  5332. goto __16
  5333. }
  5334. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  5335. (*FILE)(unsafe.Pointer(f)).rpos--
  5336. } else {
  5337. }
  5338. if !(c < 0) {
  5339. goto __17
  5340. }
  5341. goto input_fail
  5342. __17:
  5343. ;
  5344. goto match_fail
  5345. __16:
  5346. ;
  5347. pos = pos + ((*FILE)(unsafe.Pointer(f)).shcnt + (int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1)
  5348. goto __4
  5349. __11:
  5350. ;
  5351. p++
  5352. if !(int32(*(*uint8)(unsafe.Pointer(p))) == '*') {
  5353. goto __18
  5354. }
  5355. dest = uintptr(0)
  5356. p++
  5357. goto __19
  5358. __18:
  5359. if !(func() int32 {
  5360. if 0 != 0 {
  5361. return Xisdigit(tls, int32(*(*uint8)(unsafe.Pointer(p))))
  5362. }
  5363. return Bool32(uint32(*(*uint8)(unsafe.Pointer(p)))-uint32('0') < uint32(10))
  5364. }() != 0 && int32(*(*uint8)(unsafe.Pointer(p + 1))) == '$') {
  5365. goto __20
  5366. }
  5367. dest = arg_n(tls, ap, uint32(int32(*(*uint8)(unsafe.Pointer(p)))-'0'))
  5368. p += uintptr(2)
  5369. goto __21
  5370. __20:
  5371. dest = VaUintptr(&ap)
  5372. __21:
  5373. ;
  5374. __19:
  5375. ;
  5376. width = 0
  5377. __22:
  5378. if !(func() int32 {
  5379. if 0 != 0 {
  5380. return Xisdigit(tls, int32(*(*uint8)(unsafe.Pointer(p))))
  5381. }
  5382. return Bool32(uint32(*(*uint8)(unsafe.Pointer(p)))-uint32('0') < uint32(10))
  5383. }() != 0) {
  5384. goto __24
  5385. }
  5386. width = 10*width + int32(*(*uint8)(unsafe.Pointer(p))) - '0'
  5387. goto __23
  5388. __23:
  5389. p++
  5390. goto __22
  5391. goto __24
  5392. __24:
  5393. ;
  5394. if !(int32(*(*uint8)(unsafe.Pointer(p))) == 'm') {
  5395. goto __25
  5396. }
  5397. wcs = uintptr(0)
  5398. s = uintptr(0)
  5399. alloc = BoolInt32(!!(dest != 0))
  5400. p++
  5401. goto __26
  5402. __25:
  5403. alloc = 0
  5404. __26:
  5405. ;
  5406. size = 0
  5407. switch int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&p, 1)))) {
  5408. case 'h':
  5409. goto __28
  5410. case 'l':
  5411. goto __29
  5412. case 'j':
  5413. goto __30
  5414. case 'z':
  5415. goto __31
  5416. case 't':
  5417. goto __32
  5418. case 'L':
  5419. goto __33
  5420. case 'd':
  5421. goto __34
  5422. case 'i':
  5423. goto __35
  5424. case 'o':
  5425. goto __36
  5426. case 'u':
  5427. goto __37
  5428. case 'x':
  5429. goto __38
  5430. case 'a':
  5431. goto __39
  5432. case 'e':
  5433. goto __40
  5434. case 'f':
  5435. goto __41
  5436. case 'g':
  5437. goto __42
  5438. case 'A':
  5439. goto __43
  5440. case 'E':
  5441. goto __44
  5442. case 'F':
  5443. goto __45
  5444. case 'G':
  5445. goto __46
  5446. case 'X':
  5447. goto __47
  5448. case 's':
  5449. goto __48
  5450. case 'c':
  5451. goto __49
  5452. case '[':
  5453. goto __50
  5454. case 'S':
  5455. goto __51
  5456. case 'C':
  5457. goto __52
  5458. case 'p':
  5459. goto __53
  5460. case 'n':
  5461. goto __54
  5462. default:
  5463. goto __55
  5464. }
  5465. goto __27
  5466. __28:
  5467. if !(int32(*(*uint8)(unsafe.Pointer(p))) == 'h') {
  5468. goto __56
  5469. }
  5470. p++
  5471. size = -2
  5472. goto __57
  5473. __56:
  5474. size = -1
  5475. __57:
  5476. ;
  5477. goto __27
  5478. __29:
  5479. if !(int32(*(*uint8)(unsafe.Pointer(p))) == 'l') {
  5480. goto __58
  5481. }
  5482. p++
  5483. size = 3
  5484. goto __59
  5485. __58:
  5486. size = 1
  5487. __59:
  5488. ;
  5489. goto __27
  5490. __30:
  5491. size = 3
  5492. goto __27
  5493. __31:
  5494. __32:
  5495. size = 1
  5496. goto __27
  5497. __33:
  5498. size = 2
  5499. goto __27
  5500. __34:
  5501. __35:
  5502. __36:
  5503. __37:
  5504. __38:
  5505. __39:
  5506. __40:
  5507. __41:
  5508. __42:
  5509. __43:
  5510. __44:
  5511. __45:
  5512. __46:
  5513. __47:
  5514. __48:
  5515. __49:
  5516. __50:
  5517. __51:
  5518. __52:
  5519. __53:
  5520. __54:
  5521. p--
  5522. goto __27
  5523. __55:
  5524. goto fmt_fail
  5525. __27:
  5526. ;
  5527. t = int32(*(*uint8)(unsafe.Pointer(p)))
  5528. // C or S
  5529. if !(t&0x2f == 3) {
  5530. goto __60
  5531. }
  5532. t = t | 32
  5533. size = 1
  5534. __60:
  5535. ;
  5536. switch t {
  5537. case 'c':
  5538. goto __62
  5539. case '[':
  5540. goto __63
  5541. case 'n':
  5542. goto __64
  5543. default:
  5544. goto __65
  5545. }
  5546. goto __61
  5547. __62:
  5548. if !(width < 1) {
  5549. goto __66
  5550. }
  5551. width = 1
  5552. __66:
  5553. ;
  5554. __63:
  5555. goto __61
  5556. __64:
  5557. store_int(tls, dest, size, uint64(pos))
  5558. // do not increment match count, etc!
  5559. goto __4
  5560. __65:
  5561. X__shlim(tls, f, int64(0))
  5562. __67:
  5563. if !(__isspace(tls, func() int32 {
  5564. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  5565. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  5566. }
  5567. return X__shgetc(tls, f)
  5568. }()) != 0) {
  5569. goto __68
  5570. }
  5571. goto __67
  5572. __68:
  5573. ;
  5574. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  5575. (*FILE)(unsafe.Pointer(f)).rpos--
  5576. } else {
  5577. }
  5578. pos = pos + ((*FILE)(unsafe.Pointer(f)).shcnt + (int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1)
  5579. __61:
  5580. ;
  5581. X__shlim(tls, f, int64(width))
  5582. if !(func() int32 {
  5583. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  5584. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  5585. }
  5586. return X__shgetc(tls, f)
  5587. }() < 0) {
  5588. goto __69
  5589. }
  5590. goto input_fail
  5591. __69:
  5592. ;
  5593. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  5594. (*FILE)(unsafe.Pointer(f)).rpos--
  5595. } else {
  5596. }
  5597. switch t {
  5598. case 's':
  5599. goto __71
  5600. case 'c':
  5601. goto __72
  5602. case '[':
  5603. goto __73
  5604. case 'p':
  5605. goto __74
  5606. case 'X':
  5607. goto __75
  5608. case 'x':
  5609. goto __76
  5610. case 'o':
  5611. goto __77
  5612. case 'd':
  5613. goto __78
  5614. case 'u':
  5615. goto __79
  5616. case 'i':
  5617. goto __80
  5618. case 'a':
  5619. goto __81
  5620. case 'A':
  5621. goto __82
  5622. case 'e':
  5623. goto __83
  5624. case 'E':
  5625. goto __84
  5626. case 'f':
  5627. goto __85
  5628. case 'F':
  5629. goto __86
  5630. case 'g':
  5631. goto __87
  5632. case 'G':
  5633. goto __88
  5634. }
  5635. goto __70
  5636. __71:
  5637. __72:
  5638. __73:
  5639. if !(t == 'c' || t == 's') {
  5640. goto __89
  5641. }
  5642. Xmemset(tls, bp, -1, uint64(unsafe.Sizeof([257]uint8{})))
  5643. *(*uint8)(unsafe.Pointer(bp)) = uint8(0)
  5644. if !(t == 's') {
  5645. goto __91
  5646. }
  5647. *(*uint8)(unsafe.Pointer(bp + 10)) = uint8(0)
  5648. *(*uint8)(unsafe.Pointer(bp + 11)) = uint8(0)
  5649. *(*uint8)(unsafe.Pointer(bp + 12)) = uint8(0)
  5650. *(*uint8)(unsafe.Pointer(bp + 13)) = uint8(0)
  5651. *(*uint8)(unsafe.Pointer(bp + 14)) = uint8(0)
  5652. *(*uint8)(unsafe.Pointer(bp + 33)) = uint8(0)
  5653. __91:
  5654. ;
  5655. goto __90
  5656. __89:
  5657. if !(int32(*(*uint8)(unsafe.Pointer(PreIncUintptr(&p, 1)))) == '^') {
  5658. goto __92
  5659. }
  5660. p++
  5661. invert = 1
  5662. goto __93
  5663. __92:
  5664. invert = 0
  5665. __93:
  5666. ;
  5667. Xmemset(tls, bp, invert, uint64(unsafe.Sizeof([257]uint8{})))
  5668. *(*uint8)(unsafe.Pointer(bp)) = uint8(0)
  5669. if !(int32(*(*uint8)(unsafe.Pointer(p))) == '-') {
  5670. goto __94
  5671. }
  5672. p++
  5673. *(*uint8)(unsafe.Pointer(bp + 46)) = uint8(1 - invert)
  5674. goto __95
  5675. __94:
  5676. if !(int32(*(*uint8)(unsafe.Pointer(p))) == ']') {
  5677. goto __96
  5678. }
  5679. p++
  5680. *(*uint8)(unsafe.Pointer(bp + 94)) = uint8(1 - invert)
  5681. __96:
  5682. ;
  5683. __95:
  5684. ;
  5685. __97:
  5686. if !(int32(*(*uint8)(unsafe.Pointer(p))) != ']') {
  5687. goto __99
  5688. }
  5689. if !!(int32(*(*uint8)(unsafe.Pointer(p))) != 0) {
  5690. goto __100
  5691. }
  5692. goto fmt_fail
  5693. __100:
  5694. ;
  5695. if !(int32(*(*uint8)(unsafe.Pointer(p))) == '-' && *(*uint8)(unsafe.Pointer(p + 1)) != 0 && int32(*(*uint8)(unsafe.Pointer(p + 1))) != ']') {
  5696. goto __101
  5697. }
  5698. c = int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&p, 1) + UintptrFromInt32(-1))))
  5699. __102:
  5700. if !(c < int32(*(*uint8)(unsafe.Pointer(p)))) {
  5701. goto __104
  5702. }
  5703. *(*uint8)(unsafe.Pointer(bp + uintptr(1+c))) = uint8(1 - invert)
  5704. goto __103
  5705. __103:
  5706. c++
  5707. goto __102
  5708. goto __104
  5709. __104:
  5710. ;
  5711. __101:
  5712. ;
  5713. *(*uint8)(unsafe.Pointer(bp + uintptr(1+int32(*(*uint8)(unsafe.Pointer(p)))))) = uint8(1 - invert)
  5714. goto __98
  5715. __98:
  5716. p++
  5717. goto __97
  5718. goto __99
  5719. __99:
  5720. ;
  5721. __90:
  5722. ;
  5723. wcs = uintptr(0)
  5724. s = uintptr(0)
  5725. i = uint64(0)
  5726. if t == 'c' {
  5727. k = uint64(uint32(width) + 1)
  5728. } else {
  5729. k = uint64(31)
  5730. }
  5731. if !(size == 1) {
  5732. goto __105
  5733. }
  5734. if !(alloc != 0) {
  5735. goto __107
  5736. }
  5737. wcs = Xmalloc(tls, k*size_t(unsafe.Sizeof(wchar_t(0))))
  5738. if !!(wcs != 0) {
  5739. goto __109
  5740. }
  5741. goto alloc_fail
  5742. __109:
  5743. ;
  5744. goto __108
  5745. __107:
  5746. wcs = dest
  5747. __108:
  5748. ;
  5749. *(*mbstate_t)(unsafe.Pointer(bp + 268 /* st */)) = mbstate_t{}
  5750. __110:
  5751. if !(*(*uint8)(unsafe.Pointer(bp + uintptr(AssignInt32(&c, func() int32 {
  5752. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  5753. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  5754. }
  5755. return X__shgetc(tls, f)
  5756. }())+1))) != 0) {
  5757. goto __111
  5758. }
  5759. switch Xmbrtowc(tls, bp+260, func() uintptr { *(*uint8)(unsafe.Pointer(bp + 264)) = uint8(c); return bp + 264 }(), uint64(1), bp+268 /* &st */) {
  5760. case Uint64FromInt32(-1):
  5761. goto __113
  5762. case Uint64FromInt32(-2):
  5763. goto __114
  5764. }
  5765. goto __112
  5766. __113:
  5767. goto input_fail
  5768. __114:
  5769. goto __110
  5770. __112:
  5771. ;
  5772. if !(wcs != 0) {
  5773. goto __115
  5774. }
  5775. *(*wchar_t)(unsafe.Pointer(wcs + uintptr(PostIncUint64(&i, 1))*4)) = *(*wchar_t)(unsafe.Pointer(bp + 260 /* wc */))
  5776. __115:
  5777. ;
  5778. if !(alloc != 0 && i == k) {
  5779. goto __116
  5780. }
  5781. k = k + (k + uint64(1))
  5782. tmp = Xrealloc(tls, wcs, k*size_t(unsafe.Sizeof(wchar_t(0))))
  5783. if !!(tmp != 0) {
  5784. goto __117
  5785. }
  5786. goto alloc_fail
  5787. __117:
  5788. ;
  5789. wcs = tmp
  5790. __116:
  5791. ;
  5792. goto __110
  5793. __111:
  5794. ;
  5795. if !!(Xmbsinit(tls, bp+268) != 0) {
  5796. goto __118
  5797. }
  5798. goto input_fail
  5799. __118:
  5800. ;
  5801. goto __106
  5802. __105:
  5803. if !(alloc != 0) {
  5804. goto __119
  5805. }
  5806. s = Xmalloc(tls, k)
  5807. if !!(s != 0) {
  5808. goto __121
  5809. }
  5810. goto alloc_fail
  5811. __121:
  5812. ;
  5813. __122:
  5814. if !(*(*uint8)(unsafe.Pointer(bp + uintptr(AssignInt32(&c, func() int32 {
  5815. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  5816. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  5817. }
  5818. return X__shgetc(tls, f)
  5819. }())+1))) != 0) {
  5820. goto __123
  5821. }
  5822. *(*uint8)(unsafe.Pointer(s + uintptr(PostIncUint64(&i, 1)))) = uint8(c)
  5823. if !(i == k) {
  5824. goto __124
  5825. }
  5826. k = k + (k + uint64(1))
  5827. tmp1 = Xrealloc(tls, s, k)
  5828. if !!(tmp1 != 0) {
  5829. goto __125
  5830. }
  5831. goto alloc_fail
  5832. __125:
  5833. ;
  5834. s = tmp1
  5835. __124:
  5836. ;
  5837. goto __122
  5838. __123:
  5839. ;
  5840. goto __120
  5841. __119:
  5842. if !(AssignUintptr(&s, dest) != 0) {
  5843. goto __126
  5844. }
  5845. __128:
  5846. if !(*(*uint8)(unsafe.Pointer(bp + uintptr(AssignInt32(&c, func() int32 {
  5847. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  5848. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  5849. }
  5850. return X__shgetc(tls, f)
  5851. }())+1))) != 0) {
  5852. goto __129
  5853. }
  5854. *(*uint8)(unsafe.Pointer(s + uintptr(PostIncUint64(&i, 1)))) = uint8(c)
  5855. goto __128
  5856. __129:
  5857. ;
  5858. goto __127
  5859. __126:
  5860. __130:
  5861. if !(*(*uint8)(unsafe.Pointer(bp + uintptr(AssignInt32(&c, func() int32 {
  5862. if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend {
  5863. return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1))))
  5864. }
  5865. return X__shgetc(tls, f)
  5866. }())+1))) != 0) {
  5867. goto __131
  5868. }
  5869. goto __130
  5870. __131:
  5871. ;
  5872. __127:
  5873. ;
  5874. __120:
  5875. ;
  5876. __106:
  5877. ;
  5878. if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) {
  5879. (*FILE)(unsafe.Pointer(f)).rpos--
  5880. } else {
  5881. }
  5882. if !!((*FILE)(unsafe.Pointer(f)).shcnt+(int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1 != 0) {
  5883. goto __132
  5884. }
  5885. goto match_fail
  5886. __132:
  5887. ;
  5888. if !(t == 'c' && (*FILE)(unsafe.Pointer(f)).shcnt+(int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1 != off_t(width)) {
  5889. goto __133
  5890. }
  5891. goto match_fail
  5892. __133:
  5893. ;
  5894. if !(alloc != 0) {
  5895. goto __134
  5896. }
  5897. if !(size == 1) {
  5898. goto __135
  5899. }
  5900. *(*uintptr)(unsafe.Pointer(dest)) = wcs
  5901. goto __136
  5902. __135:
  5903. *(*uintptr)(unsafe.Pointer(dest)) = s
  5904. __136:
  5905. ;
  5906. __134:
  5907. ;
  5908. if !(t != 'c') {
  5909. goto __137
  5910. }
  5911. if !(wcs != 0) {
  5912. goto __138
  5913. }
  5914. *(*wchar_t)(unsafe.Pointer(wcs + uintptr(i)*4)) = 0
  5915. __138:
  5916. ;
  5917. if !(s != 0) {
  5918. goto __139
  5919. }
  5920. *(*uint8)(unsafe.Pointer(s + uintptr(i))) = uint8(0)
  5921. __139:
  5922. ;
  5923. __137:
  5924. ;
  5925. goto __70
  5926. __74:
  5927. __75:
  5928. __76:
  5929. base = 16
  5930. goto int_common
  5931. __77:
  5932. base = 8
  5933. goto int_common
  5934. __78:
  5935. __79:
  5936. base = 10
  5937. goto int_common
  5938. __80:
  5939. base = 0
  5940. int_common:
  5941. x = X__intscan(tls, f, uint32(base), 0, 2*uint64(0x7fffffffffffffff)+uint64(1))
  5942. if !!((*FILE)(unsafe.Pointer(f)).shcnt+(int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1 != 0) {
  5943. goto __140
  5944. }
  5945. goto match_fail
  5946. __140:
  5947. ;
  5948. if !(t == 'p' && dest != 0) {
  5949. goto __141
  5950. }
  5951. *(*uintptr)(unsafe.Pointer(dest)) = uintptr(uintptr_t(x))
  5952. goto __142
  5953. __141:
  5954. store_int(tls, dest, size, x)
  5955. __142:
  5956. ;
  5957. goto __70
  5958. __81:
  5959. __82:
  5960. __83:
  5961. __84:
  5962. __85:
  5963. __86:
  5964. __87:
  5965. __88:
  5966. y = X__floatscan(tls, f, size, 0)
  5967. if !!((*FILE)(unsafe.Pointer(f)).shcnt+(int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1 != 0) {
  5968. goto __143
  5969. }
  5970. goto match_fail
  5971. __143:
  5972. ;
  5973. if !(dest != 0) {
  5974. goto __144
  5975. }
  5976. switch size {
  5977. case 0:
  5978. goto __146
  5979. case 1:
  5980. goto __147
  5981. case 2:
  5982. goto __148
  5983. }
  5984. goto __145
  5985. __146:
  5986. *(*float32)(unsafe.Pointer(dest)) = float32(y)
  5987. goto __145
  5988. __147:
  5989. *(*float64)(unsafe.Pointer(dest)) = y
  5990. goto __145
  5991. __148:
  5992. *(*float64)(unsafe.Pointer(dest)) = y
  5993. goto __145
  5994. __145:
  5995. ;
  5996. __144:
  5997. ;
  5998. goto __70
  5999. __70:
  6000. ;
  6001. pos = pos + ((*FILE)(unsafe.Pointer(f)).shcnt + (int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1)
  6002. if !(dest != 0) {
  6003. goto __149
  6004. }
  6005. matches++
  6006. __149:
  6007. ;
  6008. goto __4
  6009. __4:
  6010. p++
  6011. goto __3
  6012. goto __5
  6013. __5:
  6014. ;
  6015. if !(0 != 0) {
  6016. goto __150
  6017. }
  6018. fmt_fail:
  6019. alloc_fail:
  6020. input_fail:
  6021. if !!(matches != 0) {
  6022. goto __151
  6023. }
  6024. matches--
  6025. __151:
  6026. ;
  6027. match_fail:
  6028. if !(alloc != 0) {
  6029. goto __152
  6030. }
  6031. Xfree(tls, s)
  6032. Xfree(tls, wcs)
  6033. __152:
  6034. ;
  6035. __150:
  6036. ;
  6037. __153:
  6038. if !(__need_unlock != 0) {
  6039. goto __156
  6040. }
  6041. X__unlockfile(tls, f)
  6042. __156:
  6043. ;
  6044. goto __154
  6045. __154:
  6046. if 0 != 0 {
  6047. goto __153
  6048. }
  6049. goto __155
  6050. __155:
  6051. ;
  6052. return matches
  6053. }
  6054. func string_read(tls *TLS, f uintptr, buf uintptr, len size_t) size_t { /* vsscanf.c:4:15: */
  6055. var src uintptr = (*FILE)(unsafe.Pointer(f)).cookie
  6056. var k size_t = len + uint64(256)
  6057. var end uintptr = Xmemchr(tls, src, 0, k)
  6058. if end != 0 {
  6059. k = size_t((int64(end) - int64(src)) / 1)
  6060. }
  6061. if k < len {
  6062. len = k
  6063. }
  6064. Xmemcpy(tls, buf, src, len)
  6065. (*FILE)(unsafe.Pointer(f)).rpos = src + uintptr(len)
  6066. (*FILE)(unsafe.Pointer(f)).rend = src + uintptr(k)
  6067. (*FILE)(unsafe.Pointer(f)).cookie = src + uintptr(k)
  6068. return len
  6069. }
  6070. func Xvsscanf(tls *TLS, s uintptr, fmt uintptr, ap va_list) int32 { /* vsscanf.c:18:5: */
  6071. bp := tls.Alloc(232)
  6072. defer tls.Free(232)
  6073. *(*FILE)(unsafe.Pointer(bp /* f */)) = FILE{read: *(*uintptr)(unsafe.Pointer(&struct {
  6074. f func(*TLS, uintptr, uintptr, size_t) size_t
  6075. }{string_read})), buf: s, lock: -1, cookie: s}
  6076. return Xvfscanf(tls, bp, fmt, ap)
  6077. }
  6078. func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */
  6079. var try uintptr
  6080. var sign int32
  6081. for nel > uint64(0) {
  6082. try = base + uintptr(width*(nel/uint64(2)))
  6083. sign = (*struct {
  6084. f func(*TLS, uintptr, uintptr) int32
  6085. })(unsafe.Pointer(&struct{ uintptr }{cmp})).f(tls, key, try)
  6086. if sign < 0 {
  6087. nel = nel / uint64(2)
  6088. } else if sign > 0 {
  6089. base = try + uintptr(width)
  6090. nel = nel - (nel/uint64(2) + uint64(1))
  6091. } else {
  6092. return try
  6093. }
  6094. }
  6095. return uintptr(0)
  6096. }
  6097. func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6:20: */
  6098. bp := tls.Alloc(232)
  6099. defer tls.Free(232)
  6100. // var f FILE at bp, 232
  6101. (*FILE)(unsafe.Pointer(bp)).buf = AssignPtrUintptr(bp+8, s)
  6102. (*FILE)(unsafe.Pointer(bp)).rend = UintptrFromInt32(-1)
  6103. X__shlim(tls, bp, int64(0))
  6104. var y float64 = X__floatscan(tls, bp, prec, 1)
  6105. var cnt off_t = (*FILE)(unsafe.Pointer(bp)).shcnt + (int64((*FILE)(unsafe.Pointer(bp)).rpos)-int64((*FILE)(unsafe.Pointer(bp)).buf))/1
  6106. if p != 0 {
  6107. *(*uintptr)(unsafe.Pointer(p)) = func() uintptr {
  6108. if cnt != 0 {
  6109. return s + uintptr(cnt)
  6110. }
  6111. return s
  6112. }()
  6113. }
  6114. return y
  6115. }
  6116. func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */
  6117. return float32(strtox(tls, s, p, 0))
  6118. }
  6119. func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */
  6120. return strtox(tls, s, p, 1)
  6121. }
  6122. func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */
  6123. return strtox(tls, s, p, 2)
  6124. }
  6125. func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* strtol.c:8:27: */
  6126. bp := tls.Alloc(232)
  6127. defer tls.Free(232)
  6128. // var f FILE at bp, 232
  6129. (*FILE)(unsafe.Pointer(bp)).buf = AssignPtrUintptr(bp+8, s)
  6130. (*FILE)(unsafe.Pointer(bp)).rend = UintptrFromInt32(-1)
  6131. X__shlim(tls, bp, int64(0))
  6132. var y uint64 = X__intscan(tls, bp, uint32(base), 1, lim)
  6133. if p != 0 {
  6134. var cnt size_t = size_t((*FILE)(unsafe.Pointer(bp)).shcnt + (int64((*FILE)(unsafe.Pointer(bp)).rpos)-int64((*FILE)(unsafe.Pointer(bp)).buf))/1)
  6135. *(*uintptr)(unsafe.Pointer(p)) = s + uintptr(cnt)
  6136. }
  6137. return y
  6138. }
  6139. func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */
  6140. return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1))
  6141. }
  6142. func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */
  6143. return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1))))
  6144. }
  6145. func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:31:15: */
  6146. return uint64(strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)))
  6147. }
  6148. func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:36:6: */
  6149. return int64(strtox1(tls, s, p, base, 0+Uint64FromInt64(Int64(-Int64(0x7fffffffffffffff))-Int64FromInt32(1))))
  6150. }
  6151. func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */
  6152. return intmax_t(Xstrtoll(tls, s, p, base))
  6153. }
  6154. func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */
  6155. return uintmax_t(Xstrtoull(tls, s, p, base))
  6156. }
  6157. func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */
  6158. var l size_t = Xstrlen(tls, s)
  6159. var d uintptr = Xmalloc(tls, l+uint64(1))
  6160. if !(d != 0) {
  6161. return uintptr(0)
  6162. }
  6163. return Xmemcpy(tls, d, s, l+uint64(1))
  6164. }
  6165. func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4:8: */
  6166. var l size_t = Xstrnlen(tls, d, n)
  6167. if l == n {
  6168. return l + Xstrlen(tls, s)
  6169. }
  6170. return l + Xstrlcpy(tls, d+uintptr(l), s, n-l)
  6171. }
  6172. // Support signed or unsigned plain-char
  6173. // Implementation choices...
  6174. // Arbitrary numbers...
  6175. // POSIX/SUS requirements follow. These numbers come directly
  6176. // from SUS and have nothing to do with the host system.
  6177. func Xstrlcpy(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcpy.c:11:8: */
  6178. var d0 uintptr
  6179. var wd uintptr
  6180. var ws uintptr
  6181. d0 = d
  6182. if !!(int32(PostDecUint64(&n, 1)) != 0) {
  6183. goto __1
  6184. }
  6185. goto finish
  6186. __1:
  6187. ;
  6188. if !(uintptr_t(s)&(uint64(unsafe.Sizeof(size_t(0)))-uint64(1)) == uintptr_t(d)&(uint64(unsafe.Sizeof(size_t(0)))-uint64(1))) {
  6189. goto __2
  6190. }
  6191. __3:
  6192. if !(uintptr_t(s)&(uint64(unsafe.Sizeof(size_t(0)))-uint64(1)) != 0 && n != 0 && AssignPtrUint8(d, *(*uint8)(unsafe.Pointer(s))) != 0) {
  6193. goto __5
  6194. }
  6195. goto __4
  6196. __4:
  6197. n--
  6198. s++
  6199. d++
  6200. goto __3
  6201. goto __5
  6202. __5:
  6203. ;
  6204. if !(n != 0 && *(*uint8)(unsafe.Pointer(s)) != 0) {
  6205. goto __6
  6206. }
  6207. wd = d
  6208. ws = s
  6209. __7:
  6210. if !(n >= size_t(unsafe.Sizeof(size_t(0))) && !((*(*uint64)(unsafe.Pointer(ws))-Uint64(Uint64FromInt32(-1))/uint64(255)) & ^*(*uint64)(unsafe.Pointer(ws)) & (Uint64(Uint64FromInt32(-1))/uint64(255)*uint64(255/2+1)) != 0)) {
  6211. goto __9
  6212. }
  6213. *(*size_t)(unsafe.Pointer(wd)) = *(*uint64)(unsafe.Pointer(ws))
  6214. goto __8
  6215. __8:
  6216. n = n - size_t(unsafe.Sizeof(size_t(0)))
  6217. ws += 8
  6218. wd += 8
  6219. goto __7
  6220. goto __9
  6221. __9:
  6222. ;
  6223. d = wd
  6224. s = ws
  6225. __6:
  6226. ;
  6227. __2:
  6228. ;
  6229. __10:
  6230. if !(n != 0 && AssignPtrUint8(d, *(*uint8)(unsafe.Pointer(s))) != 0) {
  6231. goto __12
  6232. }
  6233. goto __11
  6234. __11:
  6235. n--
  6236. s++
  6237. d++
  6238. goto __10
  6239. goto __12
  6240. __12:
  6241. ;
  6242. *(*uint8)(unsafe.Pointer(d)) = uint8(0)
  6243. finish:
  6244. return size_t((int64(d)-int64(d0))/1) + Xstrlen(tls, s)
  6245. }
  6246. func Xstrncasecmp(tls *TLS, _l uintptr, _r uintptr, n size_t) int32 { /* strncasecmp.c:4:5: */
  6247. var l uintptr = _l
  6248. var r uintptr = _r
  6249. if !(int32(PostDecUint64(&n, 1)) != 0) {
  6250. return 0
  6251. }
  6252. __1:
  6253. if !(*(*uint8)(unsafe.Pointer(l)) != 0 && *(*uint8)(unsafe.Pointer(r)) != 0 && n != 0 && (int32(*(*uint8)(unsafe.Pointer(l))) == int32(*(*uint8)(unsafe.Pointer(r))) || Xtolower(tls, int32(*(*uint8)(unsafe.Pointer(l)))) == Xtolower(tls, int32(*(*uint8)(unsafe.Pointer(r)))))) {
  6254. goto __3
  6255. }
  6256. goto __2
  6257. __2:
  6258. l++
  6259. r++
  6260. n--
  6261. goto __1
  6262. goto __3
  6263. __3:
  6264. ;
  6265. return Xtolower(tls, int32(*(*uint8)(unsafe.Pointer(l)))) - Xtolower(tls, int32(*(*uint8)(unsafe.Pointer(r))))
  6266. }
  6267. func X__strncasecmp_l(tls *TLS, l uintptr, r uintptr, n size_t, loc locale_t) int32 { /* strncasecmp.c:12:5: */
  6268. return Xstrncasecmp(tls, l, r, n)
  6269. }
  6270. func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3:6: */
  6271. var a uintptr = d
  6272. d += uintptr(Xstrlen(tls, d))
  6273. for n != 0 && *(*uint8)(unsafe.Pointer(s)) != 0 {
  6274. n--
  6275. *(*uint8)(unsafe.Pointer(PostIncUintptr(&d, 1))) = *(*uint8)(unsafe.Pointer(PostIncUintptr(&s, 1)))
  6276. }
  6277. *(*uint8)(unsafe.Pointer(PostIncUintptr(&d, 1))) = uint8(0)
  6278. return a
  6279. }
  6280. func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */
  6281. var p uintptr = Xmemchr(tls, s, 0, n)
  6282. if p != 0 {
  6283. return uint64((int64(p) - int64(s)) / 1)
  6284. }
  6285. return n
  6286. }
  6287. func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */
  6288. bp := tls.Alloc(32)
  6289. defer tls.Free(32)
  6290. var a uintptr = s
  6291. *(*[4]size_t)(unsafe.Pointer(bp /* byteset */)) = [4]size_t{0: uint64(0)}
  6292. if !(int32(*(*uint8)(unsafe.Pointer(c))) != 0) {
  6293. return uint64(0)
  6294. }
  6295. if !(int32(*(*uint8)(unsafe.Pointer(c + 1))) != 0) {
  6296. for ; int32(*(*uint8)(unsafe.Pointer(s))) == int32(*(*uint8)(unsafe.Pointer(c))); s++ {
  6297. }
  6298. return size_t((int64(s) - int64(a)) / 1)
  6299. }
  6300. for ; *(*uint8)(unsafe.Pointer(c)) != 0 && AssignOrPtrUint64(bp+uintptr(size_t(*(*uint8)(unsafe.Pointer(c)))/(uint64(8)*uint64(unsafe.Sizeof(size_t(0)))))*8, size_t(uint64(1))<<(size_t(*(*uint8)(unsafe.Pointer(c)))%(uint64(8)*uint64(unsafe.Sizeof(size_t(0)))))) != 0; c++ {
  6301. }
  6302. for ; *(*uint8)(unsafe.Pointer(s)) != 0 && *(*size_t)(unsafe.Pointer(bp + uintptr(size_t(*(*uint8)(unsafe.Pointer(s)))/(uint64(8)*uint64(unsafe.Sizeof(size_t(0)))))*8))&(size_t(uint64(1))<<(size_t(*(*uint8)(unsafe.Pointer(s)))%(uint64(8)*uint64(unsafe.Sizeof(size_t(0)))))) != 0; s++ {
  6303. }
  6304. return size_t((int64(s) - int64(a)) / 1)
  6305. }
  6306. func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */
  6307. if !(s != 0) && !(int32(AssignUintptr(&s, _sp)) != 0) {
  6308. return uintptr(0)
  6309. }
  6310. s += uintptr(Xstrspn(tls, s, sep))
  6311. if !(int32(*(*uint8)(unsafe.Pointer(s))) != 0) {
  6312. return AssignPtrUintptr(uintptr(unsafe.Pointer(&_sp)), uintptr(0))
  6313. }
  6314. _sp = s + uintptr(Xstrcspn(tls, s, sep))
  6315. if *(*uint8)(unsafe.Pointer(_sp)) != 0 {
  6316. *(*uint8)(unsafe.Pointer(PostIncUintptr(&_sp, 1))) = uint8(0)
  6317. } else {
  6318. _sp = uintptr(0)
  6319. }
  6320. return s
  6321. }
  6322. var _sp uintptr /* strtok.c:5:14: */
  6323. func X__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:3:5: */
  6324. return *(*int32)(unsafe.Pointer(a + 6*4))
  6325. }
  6326. func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* pthread_attr_get.c:7:5: */
  6327. *(*int32)(unsafe.Pointer(state)) = *(*int32)(unsafe.Pointer(a + 6*4))
  6328. return 0
  6329. }
  6330. //
  6331. // int pthread_attr_getguardsize(const pthread_attr_t *restrict a, size_t *restrict size)
  6332. // {
  6333. // *size = a->_a_guardsize;
  6334. // return 0;
  6335. // }
  6336. //
  6337. // int pthread_attr_getinheritsched(const pthread_attr_t *restrict a, int *restrict inherit)
  6338. // {
  6339. // *inherit = a->_a_sched;
  6340. // return 0;
  6341. // }
  6342. //
  6343. // int pthread_attr_getschedparam(const pthread_attr_t *restrict a, struct sched_param *restrict param)
  6344. // {
  6345. // param->sched_priority = a->_a_prio;
  6346. // return 0;
  6347. // }
  6348. //
  6349. // int pthread_attr_getschedpolicy(const pthread_attr_t *restrict a, int *restrict policy)
  6350. // {
  6351. // *policy = a->_a_policy;
  6352. // return 0;
  6353. // }
  6354. //
  6355. // int pthread_attr_getscope(const pthread_attr_t *restrict a, int *restrict scope)
  6356. // {
  6357. // *scope = PTHREAD_SCOPE_SYSTEM;
  6358. // return 0;
  6359. // }
  6360. //
  6361. // int pthread_attr_getstack(const pthread_attr_t *restrict a, void **restrict addr, size_t *restrict size)
  6362. // {
  6363. // if (!a->_a_stackaddr)
  6364. // return EINVAL;
  6365. // *size = a->_a_stacksize;
  6366. // *addr = (void *)(a->_a_stackaddr - *size);
  6367. // return 0;
  6368. // }
  6369. //
  6370. // int pthread_attr_getstacksize(const pthread_attr_t *restrict a, size_t *restrict size)
  6371. // {
  6372. // *size = a->_a_stacksize;
  6373. // return 0;
  6374. // }
  6375. //
  6376. // int pthread_barrierattr_getpshared(const pthread_barrierattr_t *restrict a, int *restrict pshared)
  6377. // {
  6378. // *pshared = !!a->__attr;
  6379. // return 0;
  6380. // }
  6381. //
  6382. // int pthread_condattr_getclock(const pthread_condattr_t *restrict a, clockid_t *restrict clk)
  6383. // {
  6384. // *clk = a->__attr & 0x7fffffff;
  6385. // return 0;
  6386. // }
  6387. //
  6388. // int pthread_condattr_getpshared(const pthread_condattr_t *restrict a, int *restrict pshared)
  6389. // {
  6390. // *pshared = a->__attr>>31;
  6391. // return 0;
  6392. // }
  6393. //
  6394. // int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *restrict a, int *restrict protocol)
  6395. // {
  6396. // *protocol = PTHREAD_PRIO_NONE;
  6397. // return 0;
  6398. // }
  6399. // int pthread_mutexattr_getpshared(const pthread_mutexattr_t *restrict a, int *restrict pshared)
  6400. // {
  6401. // *pshared = a->__attr / 128U % 2;
  6402. // return 0;
  6403. // }
  6404. //
  6405. // int pthread_mutexattr_getrobust(const pthread_mutexattr_t *restrict a, int *restrict robust)
  6406. // {
  6407. // *robust = a->__attr / 4U % 2;
  6408. // return 0;
  6409. // }
  6410. func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:93:5: */
  6411. return int32((*pthread_mutexattr_t)(unsafe.Pointer(a)).__attr & uint32(3))
  6412. }
  6413. // int pthread_mutexattr_gettype(const pthread_mutexattr_t *restrict a, int *restrict type)
  6414. // {
  6415. // *type = a->__attr & 3;
  6416. // return 0;
  6417. // }
  6418. //
  6419. // int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *restrict a, int *restrict pshared)
  6420. // {
  6421. // *pshared = a->__attr[0];
  6422. // return 0;
  6423. // }
  6424. func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* pthread_attr_setdetachstate.c:3:5: */
  6425. if uint32(state) > 1 {
  6426. return 22
  6427. }
  6428. *(*int32)(unsafe.Pointer(a + 6*4)) = state
  6429. return 0
  6430. }
  6431. func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3:5: */
  6432. return *(*int32)(unsafe.Pointer(m)) & 15
  6433. }
  6434. // int __pthread_mutex_lock(pthread_mutex_t *m)
  6435. // {
  6436. // if ((m->_m_type&15) == PTHREAD_MUTEX_NORMAL
  6437. // && !a_cas(&m->_m_lock, 0, EBUSY))
  6438. // return 0;
  6439. //
  6440. // return __pthread_mutex_timedlock(m, 0);
  6441. // }
  6442. //
  6443. // weak_alias(__pthread_mutex_lock, pthread_mutex_lock);
  6444. func Xpthread_mutexattr_destroy(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_destroy.c:3:5: */
  6445. return 0
  6446. }
  6447. func Xpthread_mutexattr_init(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_init.c:3:5: */
  6448. *(*pthread_mutexattr_t)(unsafe.Pointer(a)) = pthread_mutexattr_t{}
  6449. return 0
  6450. }
  6451. func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 { /* pthread_mutexattr_settype.c:3:5: */
  6452. if uint32(type1) > uint32(2) {
  6453. return 22
  6454. }
  6455. (*pthread_mutexattr_t)(unsafe.Pointer(a)).__attr = (*pthread_mutexattr_t)(unsafe.Pointer(a)).__attr&Uint32FromInt32(CplInt32(3)) | uint32(type1)
  6456. return 0
  6457. }
  6458. func init() {
  6459. *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&ptable)) + 0)) = uintptr(unsafe.Pointer(&table)) + uintptr(128)*2 // __ctype_b_loc.c:36:45:
  6460. }
  6461. var ts1 = "infinity\x00nan\x00\x00\x00\x01\x02\x04\a\x03\x06\x05\x00.\x00%d.%d.%d.%d.in-addr.arpa\x00ip6.arpa\x000123456789abcdef\x00/etc/hosts\x00rb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00%d.%d.%d.%d\x00%x:%x:%x:%x:%x:%x:%x:%x\x00%x:%x:%x:%x:%x:%x:%d.%d.%d.%d\x00:0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\x00\x00 \x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
  6462. var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data