-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstdlib.wo
3619 lines (3619 loc) · 65.2 KB
/
stdlib.wo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(module $stdlib
(import "crt" "sp$" (global $crt:sp$ (mut i32)))
(import "crt" "memory" (memory $crt:memory 0))
(import "crt" "sp$" (global $crt:sp$ i32))
(import "string" "memcpy" (func $string:memcpy (param i32) (param i32) (param i32) (result i32)))
(import "string" "strncmp" (func $string:strncmp (param i32) (param i32) (param i32) (result i32)))
(import "string" "memset" (func $string:memset (param i32) (param i32) (param i32) (result i32)))
(import "string" "strlen" (func $string:strlen (param i32) (result i32)))
(import "errno" "errno" (global $errno:errno i32))
(import "string" "memswap" (func $string:memswap (param i32) (param i32) (param i32)))
(import "ctype" "isdigit" (func $ctype:isdigit (param i32) (result i32)))
(import "ctype" "isspace" (func $ctype:isspace (param i32) (result i32)))
(import "ctype" "isxdigit" (func $ctype:isxdigit (param i32) (result i32)))
(import "ctype" "tolower" (func $ctype:tolower (param i32) (result i32)))
(import "math" "ldexp" (func $math:ldexp (param f64) (param i32) (result f64)))
(import "unistd" "sbrk" (func $unistd:sbrk (param i32) (result i32)))
(import "wasi_snapshot_preview1" "fd_write" (func $wasi_snapshot_preview1:fd_write (param i32) (param i32) (param i32) (param i32) (result i32)))
(import "wasi_snapshot_preview1" "environ_get" (func $wasi_snapshot_preview1:environ_get (param i32) (param i32) (result i32)))
(import "wasi_snapshot_preview1" "environ_sizes_get" (func $wasi_snapshot_preview1:environ_sizes_get (param i32) (param i32) (result i32)))
(import "wasi_snapshot_preview1" "proc_exit" (func $wasi_snapshot_preview1:proc_exit (param i32)))
(import "crt" "onterm_funcs" (global $crt:onterm_funcs i32))
(import "crt" "onterm_count" (global $crt:onterm_count i32))
(import "crt" "terminate" (func $crt:terminate (param i32)))
(global $stdlib:_environ (export "_environ") (mut i32) (i32.const 0))
(data $stdlib:ds1$ const align=1 "(NULL)\00")
(data $stdlib:powers_of_10 var align=8 "\00\00\00\00\00\00$@\00\00\00\00\00\00Y@\00\00\00\00\00\88\c3@\00\00\00\00\84\d7\97A\00\80\e07y\c3AC\17n\05\b5\b5\b8\93F\f5\f9?\e9\03O8M2\1d0\f9Hw\82Z<\bfs\7f\ddO\15u")
(data $stdlib:ds11$ const align=1 "INFINITY\00")
(data $stdlib:ds12$ const align=1 "NAN(*)\00")
(data $stdlib:rand48_seed var align=2 size=6)
(data $stdlib:empty_environ var align=4 size=4)
(data $stdlib:ds32$ const align=1 "internal error: unable to retrieve environment strings\n\00")
(data $stdlib:buckets var align=4 size=108)
(data $stdlib:utf8_table var align=4 "\80\00\00\00\00\00\00\00\00\00\00\00\7f\00\00\00\00\00\00\00\e0\00\00\00\c0\00\00\00\06\00\00\00\ff\07\00\00\80\00\00\00\f0\00\00\00\e0\00\00\00\0c\00\00\00\ff\ff\00\00\00\08\00\00\f8\00\00\00\f0\00\00\00\12\00\00\00\ff\ff\1f\00\00\00\01\00\fc\00\00\00\f8\00\00\00\18\00\00\00\ff\ff\ff\03\00\00 \00\fe\00\00\00\fc\00\00\00\1e\00\00\00\ff\ff\ff\7f\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00")
(func $stdlib:panic
(param $s i32) (param $n i32)
(local $fd i32) (local $bp$ i32) (local $fp$ i32) (local $i1$ i32) (local $i2$ i32)
global.get $crt:sp$
local.set $bp$
global.get $crt:sp$
i32.const 16
i32.sub
global.set $crt:sp$
global.get $crt:sp$
local.set $fp$
i32.const 2
local.set $fd
local.get $fp$
local.tee $i1$
local.get $s
i32.store offset=0 align=4
local.get $fp$
i32.const 4
i32.add
local.tee $i2$
local.get $n
i32.store offset=0 align=4
local.get $fd
local.get $fp$
i32.const 1
local.get $fp$
i32.const 8
i32.add
call $wasi_snapshot_preview1:fd_write
drop
local.get $bp$
global.set $crt:sp$
return
)
(func $stdlib:_panicf (export "_panicf")
(param $fmt i32) (param $ap$ i32)
(local $ap i32) (local $s i32) (local $val i32) (local $e i32) (local $p i32) (local $m i32) (local $val#7 i32) (local $e#9 i32) (local $p#10 i32) (local $m#11 i32) (local $val#12 i32) (local $e#14 i32) (local $p#15 i32) (local $m#16 i32) (local $val#17 i32) (local $e#19 i32) (local $p#20 i32) (local $m#21 i32) (local $d i32) (local $bp$ i32) (local $fp$ i32) (local $i1$ i32) (local $i2$ i32) (local $i3$ i32) (local $i4$ i32) (local $i5$ i32) (local $i6$ i32) (local $i7$ i32) (local $i8$ i32) (local $i9$ i32)
global.get $crt:sp$
local.set $bp$
global.get $crt:sp$
i32.const 160
i32.sub
global.set $crt:sp$
global.get $crt:sp$
local.set $fp$
local.get $ap$
local.set $ap
block $1$
loop $2$
local.get $fmt
i32.load8_s offset=0 align=1
if
local.get $fmt
i32.load8_s offset=0 align=1
i32.const 37
i32.ne
if (result i32)
i32.const 1
else
local.get $fmt
i32.const 1
i32.add
local.tee $fmt
i32.load8_s offset=0 align=1
i32.const 37
i32.eq
end
if
local.get $fmt
local.get $fmt
i32.const 1
i32.add
local.set $fmt
i32.const 1
call $stdlib:panic
else
local.get $fmt
i32.load8_s offset=0 align=1
i32.const 115
i32.eq
if
local.get $ap
local.get $ap
i32.const 16
i32.add
local.set $ap
i32.load offset=0 align=4
local.tee $s
i32.const 0
i32.ne
if
local.get $s
local.get $s
call $string:strlen
call $stdlib:panic
else
ref.data $stdlib:ds1$
i32.const 6
call $stdlib:panic
end
local.get $fmt
i32.const 1
i32.add
local.set $fmt
else
local.get $fmt
i32.load8_s offset=0 align=1
i32.const 100
i32.eq
if
local.get $ap
local.get $ap
i32.const 16
i32.add
local.set $ap
i32.load offset=0 align=4
local.set $val
local.get $fp$
i32.const 40
i32.add
local.tee $e
local.set $p
local.get $val
if
local.get $val
i32.const -2147483648
i32.eq
if
i32.const -2147483648
local.set $m
else
local.get $val
i32.const 0
i32.lt_s
if
i32.const 0
local.get $val
i32.sub
local.set $m
else
local.get $val
local.set $m
end
end
block $4$
loop $3$
block $5$
local.get $p
i32.const 1
i32.sub
local.tee $p
local.tee $i1$
local.get $m
i32.const 10
i32.rem_u
i32.const 48
i32.add
i32.store8 offset=0 align=1
end $5$
local.get $m
i32.const 10
i32.div_u
local.tee $m
i32.const 0
i32.gt_u
br_if $3$
end $3$
end $4$
local.get $val
i32.const 0
i32.lt_s
if
local.get $p
i32.const 1
i32.sub
local.tee $p
local.tee $i2$
i32.const 45
i32.store8 offset=0 align=1
end
else
local.get $p
i32.const 1
i32.sub
local.tee $p
local.tee $i3$
i32.const 48
i32.store8 offset=0 align=1
end
local.get $p
local.get $e
local.get $p
i32.sub
call $stdlib:panic
local.get $fmt
i32.const 1
i32.add
local.set $fmt
else
local.get $fmt
i32.load8_s offset=0 align=1
i32.const 117
i32.eq
if
local.get $ap
local.get $ap
i32.const 16
i32.add
local.set $ap
i32.load offset=0 align=4
local.set $val#7
local.get $fp$
i32.const 40
i32.add
i32.const 40
i32.add
local.tee $e#9
local.set $p#10
local.get $val#7
if
local.get $val#7
local.set $m#11
block $7$
loop $6$
block $8$
local.get $p#10
i32.const 1
i32.sub
local.tee $p#10
local.tee $i4$
local.get $m#11
i32.const 10
i32.rem_u
i32.const 48
i32.add
i32.store8 offset=0 align=1
end $8$
local.get $m#11
i32.const 10
i32.div_u
local.tee $m#11
i32.const 0
i32.gt_u
br_if $6$
end $6$
end $7$
else
local.get $p#10
i32.const 1
i32.sub
local.tee $p#10
local.tee $i5$
i32.const 48
i32.store8 offset=0 align=1
end
local.get $p#10
local.get $e#9
local.get $p#10
i32.sub
call $stdlib:panic
local.get $fmt
i32.const 1
i32.add
local.set $fmt
else
local.get $fmt
i32.load8_s offset=0 align=1
i32.const 111
i32.eq
if
local.get $ap
local.get $ap
i32.const 16
i32.add
local.set $ap
i32.load offset=0 align=4
local.set $val#12
local.get $fp$
i32.const 80
i32.add
i32.const 40
i32.add
local.tee $e#14
local.set $p#15
local.get $val#12
if
local.get $val#12
local.set $m#16
block $10$
loop $9$
block $11$
local.get $p#15
i32.const 1
i32.sub
local.tee $p#15
local.tee $i6$
local.get $m#16
i32.const 8
i32.rem_u
i32.const 48
i32.add
i32.store8 offset=0 align=1
end $11$
local.get $m#16
i32.const 8
i32.div_u
local.tee $m#16
i32.const 0
i32.gt_u
br_if $9$
end $9$
end $10$
else
local.get $p#15
i32.const 1
i32.sub
local.tee $p#15
local.tee $i7$
i32.const 48
i32.store8 offset=0 align=1
end
local.get $p#15
local.get $e#14
local.get $p#15
i32.sub
call $stdlib:panic
local.get $fmt
i32.const 1
i32.add
local.set $fmt
else
local.get $fmt
i32.load8_s offset=0 align=1
i32.const 112
i32.eq
if (result i32)
i32.const 1
else
local.get $fmt
i32.load8_s offset=0 align=1
i32.const 120
i32.eq
end
if
local.get $ap
local.get $ap
i32.const 16
i32.add
local.set $ap
i32.load offset=0 align=4
local.set $val#17
local.get $fp$
i32.const 120
i32.add
i32.const 40
i32.add
local.tee $e#19
local.set $p#20
local.get $val#17
if
local.get $val#17
local.set $m#21
block $13$
loop $12$
block $14$
local.get $p#20
i32.const 1
i32.sub
local.tee $p#20
local.tee $i8$
local.get $m#21
i32.const 16
i32.rem_u
local.tee $d
i32.const 10
i32.lt_u
if (result i32)
local.get $d
i32.const 48
i32.add
else
local.get $d
i32.const 10
i32.sub
i32.const 97
i32.add
end
i32.store8 offset=0 align=1
end $14$
local.get $m#21
i32.const 16
i32.div_u
local.tee $m#21
i32.const 0
i32.gt_u
br_if $12$
end $12$
end $13$
else
local.get $p#20
i32.const 1
i32.sub
local.tee $p#20
local.tee $i9$
i32.const 48
i32.store8 offset=0 align=1
end
local.get $p#20
local.get $e#19
local.get $p#20
i32.sub
call $stdlib:panic
local.get $fmt
i32.const 1
i32.add
local.set $fmt
end
end
end
end
end
end
br $2$
end
end $2$
end $1$
local.get $bp$
global.set $crt:sp$
return
)
(func $stdlib:atof (export "atof")
(param $s i32) (result f64)
local.get $s
i32.const 0
call $stdlib:strtod
return
)
(func $stdlib:atoi (export "atoi")
(param $s i32) (result i32)
(local $n i32) (local $neg i32)
i32.const 0
local.set $n
i32.const 0
local.set $neg
block $1$
loop $2$
local.get $s
i32.load8_s offset=0 align=1
call $ctype:isspace
if
local.get $s
local.get $s
i32.const 1
i32.add
local.set $s
drop
br $2$
end
end $2$
end $1$
block $3$
block $5$
block $4$
local.get $s
i32.load8_s offset=0 align=1
i32.const 43
i32.sub
br_table $5$ $3$ $4$ $3$
end $4$
i32.const 1
local.set $neg
end $5$
local.get $s
local.get $s
i32.const 1
i32.add
local.set $s
drop
end $3$
block $6$
loop $7$
local.get $s
i32.load8_s offset=0 align=1
call $ctype:isdigit
if
i32.const 10
local.get $n
i32.mul
local.get $s
local.get $s
i32.const 1
i32.add
local.set $s
i32.load8_s offset=0 align=1
i32.const 48
i32.sub
i32.sub
local.set $n
br $7$
end
end $7$
end $6$
local.get $neg
if (result i32)
local.get $n
else
i32.const 0
local.get $n
i32.sub
end
return
)
(func $stdlib:atol (export "atol")
(param $s i32) (result i32)
(local $n i32) (local $neg i32)
i32.const 0
local.set $n
i32.const 0
local.set $neg
block $1$
loop $2$
local.get $s
i32.load8_s offset=0 align=1
call $ctype:isspace
if
local.get $s
local.get $s
i32.const 1
i32.add
local.set $s
drop
br $2$
end
end $2$
end $1$
block $3$
block $5$
block $4$
local.get $s
i32.load8_s offset=0 align=1
i32.const 43
i32.sub
br_table $5$ $3$ $4$ $3$
end $4$
i32.const 1
local.set $neg
end $5$
local.get $s
local.get $s
i32.const 1
i32.add
local.set $s
drop
end $3$
block $6$
loop $7$
local.get $s
i32.load8_s offset=0 align=1
call $ctype:isdigit
if
i32.const 10
local.get $n
i32.mul
local.get $s
local.get $s
i32.const 1
i32.add
local.set $s
i32.load8_s offset=0 align=1
i32.const 48
i32.sub
i32.sub
local.set $n
br $7$
end
end $7$
end $6$
local.get $neg
if (result i32)
local.get $n
else
i32.const 0
local.get $n
i32.sub
end
return
)
(func $stdlib:atoll (export "atoll")
(param $s i32) (result i64)
(local $n i64) (local $neg i32)
i32.const 0
i64.extend_i32_s
local.set $n
i32.const 0
local.set $neg
block $1$
loop $2$
local.get $s
i32.load8_s offset=0 align=1
call $ctype:isspace
if
local.get $s
local.get $s
i32.const 1
i32.add
local.set $s
drop
br $2$
end
end $2$
end $1$
block $3$
block $5$
block $4$
local.get $s
i32.load8_s offset=0 align=1
i32.const 43
i32.sub
br_table $5$ $3$ $4$ $3$
end $4$
i32.const 1
local.set $neg
end $5$
local.get $s
local.get $s
i32.const 1
i32.add
local.set $s
drop
end $3$
block $6$
loop $7$
local.get $s
i32.load8_s offset=0 align=1
call $ctype:isdigit
if
i32.const 10
i64.extend_i32_s
local.get $n
i64.mul
local.get $s
local.get $s
i32.const 1
i32.add
local.set $s
i32.load8_s offset=0 align=1
i32.const 48
i32.sub
i64.extend_i32_s
i64.sub
local.set $n
br $7$
end
end $7$
end $6$
local.get $neg
if (result i64)
local.get $n
else
i64.const 0
local.get $n
i64.sub
end
return
)
(func $stdlib:strtod_dec
(param $s i32) (param $pc i32) (param $neg i32) (param $endp i32) (result f64)
(local $negexp i32) (local $fraction f64) (local $exponent f64) (local $pd i32) (local $c i32) (local $exp i32) (local $fracexp i32) (local $mantsz i32) (local $dotpos i32) (local $expsz i32) (local $pexp i32) (local $frac i64) (local $i1$ i32) (local $i2$ i32) (local $i3$ i32) (local $i4$ i32)
i32.const 0
local.set $negexp
i32.const 0
local.set $exp
i32.const 0
local.set $fracexp
i32.const 0
local.set $mantsz
i32.const -1
local.set $dotpos
i32.const -1
local.set $expsz
block $1$
loop $2$
i32.const 1
i32.const 0
i32.ne
if
local.get $pc
i32.load8_s offset=0 align=1
local.tee $c
call $ctype:isdigit
i32.eqz
if
local.get $c
i32.const 46
i32.ne
if (result i32)
i32.const 1
else
local.get $dotpos
i32.const 0
i32.ge_s
end
br_if $1$
local.get $mantsz
local.set $dotpos
end
local.get $pc
i32.const 1
i32.add
local.set $pc
local.get $mantsz
i32.const 1
i32.add
local.set $mantsz
br $2$
end
end $2$
end $1$
local.get $pc
local.set $pexp
local.get $pc
local.get $mantsz
i32.sub
local.set $pc
local.get $dotpos
i32.const 0
i32.lt_s
if
local.get $mantsz
local.set $dotpos
else
local.get $mantsz
i32.const 1
i32.sub
local.set $mantsz
end
local.get $mantsz
i32.const 18
i32.gt_s
if
i32.const 18
local.set $mantsz
end
local.get $dotpos
local.get $mantsz
i32.sub
local.set $fracexp
local.get $mantsz
i32.const 0
i32.eq
if
local.get $endp
i32.const 0
i32.ne
if
local.get $endp
local.tee $i1$
local.get $s
i32.store offset=0 align=4
end
f64.const 0x0.0000000000000p+0 (; 0 ;)
return
else
i64.const 0
local.set $frac
block $3$
loop $4$
local.get $mantsz
local.get $mantsz
i32.const 1
i32.sub
local.set $mantsz
i32.const 0
i32.gt_s
if
local.get $pc
local.get $pc
i32.const 1
i32.add
local.set $pc
i32.load8_s offset=0 align=1
local.tee $c
i32.const 46
i32.eq
if
local.get $pc
local.get $pc
i32.const 1
i32.add
local.set $pc
i32.load8_s offset=0 align=1
local.set $c
end
i64.const 10
local.get $frac
i64.mul
local.get $c
i32.const 48
i32.sub
i64.extend_i32_s
i64.add
local.set $frac
br $4$
end
end $4$
end $3$
local.get $frac
f64.convert_i64_s
local.set $fraction
end
local.get $pexp
local.tee $pc
i32.load8_s offset=0 align=1
i32.const 69
i32.eq
if (result i32)
i32.const 1
else
local.get $pc
i32.load8_s offset=0 align=1
i32.const 101
i32.eq
end
if
i32.const 0
local.set $expsz
local.get $pc
i32.const 1
i32.add
local.tee $pc
i32.load8_s offset=0 align=1
i32.const 45
i32.eq
if
local.get $pc
i32.const 1
i32.add
local.set $pc
i32.const 1
local.set $negexp
else
local.get $pc
i32.load8_s offset=0 align=1
i32.const 43
i32.eq
if
local.get $pc
i32.const 1
i32.add
local.set $pc
end
end
block $5$
loop $6$
local.get $pc
i32.load8_s offset=0 align=1
call $ctype:isdigit
if
local.get $exp
i32.const 10
i32.mul
local.get $pc
local.get $pc
i32.const 1
i32.add
local.set $pc
i32.load8_s offset=0 align=1
i32.const 48
i32.sub
i32.add
local.set $exp
local.get $expsz
i32.const 1
i32.add
local.set $expsz
br $6$
end
end $6$
end $5$
end
local.get $expsz
i32.const 0
i32.eq
if
local.get $endp
i32.const 0
i32.ne
if
local.get $endp
local.tee $i2$
local.get $s
i32.store offset=0 align=4
end
f64.const 0x0.0000000000000p+0 (; 0 ;)
return
end
local.get $negexp
i32.eqz
i32.eqz
i32.const 0
i32.ne
if
local.get $fracexp
local.get $exp
i32.sub
local.set $exp
else
local.get $fracexp
local.get $exp
i32.add
local.set $exp
end
local.get $exp
i32.const 0
i32.lt_s
if
i32.const 1
local.set $negexp
i32.const 0
local.get $exp
i32.sub
local.set $exp
else
i32.const 0
local.set $negexp
end
local.get $exp
i32.const 511
i32.gt_s
if
local.get $endp
i32.const 0
i32.ne
if
local.get $endp
local.tee $i3$
local.get $pc
i32.store offset=0 align=4
end
i32.const 68
global.set $errno:errno
f64.const -inf
f64.const +inf
local.get $neg
i32.eqz
i32.eqz
i32.const 0
i32.ne
select
return
end
f64.const 0x1.0000000000000p+0 (; 1 ;)
local.set $exponent
block $8$
ref.data $stdlib:powers_of_10
local.set $pd
loop $7$
local.get $exp
i32.const 0
i32.ne
i32.eqz
br_if $8$
block $9$
local.get $exp
i32.const 1
i32.and