-
Notifications
You must be signed in to change notification settings - Fork 14
/
httpd.dcmp
3174 lines (3067 loc) · 178 KB
/
httpd.dcmp
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
/* ~/binutils-tilegx/bin/tilegx-linux-gnu-objdump -x httpd */
httpd: file format elf64-tilegx-le
httpd
architecture: tilegx, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x0000000001000da8
Program Header:
PHDR off 0x0000000000000040 vaddr 0x0000000001000040 paddr 0x0000000001000040 align 2**3
filesz 0x00000000000001c0 memsz 0x00000000000001c0 flags r-x
INTERP off 0x0000000000000200 vaddr 0x0000000001000200 paddr 0x0000000001000200 align 2**0
filesz 0x000000000000000d memsz 0x000000000000000d flags r--
LOAD off 0x0000000000000000 vaddr 0x0000000001000000 paddr 0x0000000001000000 align 2**16
filesz 0x0000000000006f14 memsz 0x0000000000006f14 flags r-x
LOAD off 0x0000000000006f18 vaddr 0x0000000001016f18 paddr 0x0000000001016f18 align 2**16
filesz 0x0000000000000308 memsz 0x0000000000000328 flags rw-
DYNAMIC off 0x0000000000006f40 vaddr 0x0000000001016f40 paddr 0x0000000001016f40 align 2**3
filesz 0x0000000000000190 memsz 0x0000000000000190 flags rw-
NOTE off 0x0000000000000210 vaddr 0x0000000001000210 paddr 0x0000000001000210 align 2**2
filesz 0x0000000000000044 memsz 0x0000000000000044 flags r--
EH_FRAME off 0x00000000000068d8 vaddr 0x00000000010068d8 paddr 0x00000000010068d8 align 2**2
filesz 0x00000000000000ec memsz 0x00000000000000ec flags r--
STACK off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**3
filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw-
/* ~/binutils-tilegx/bin/tilegx-linux-gnu-objdump -d httpd */
0000000001000da8 <.text>:
void _start(void) {
r52 = sp; /* 1000da8: 9e0e4000576bfdb4 { move r52, sp ; ld r1, sp } */
r1 = *(long *)sp;
r12 = sp - 16; /* 1000db0: 180f86c651483000 { addi r12, sp, -16 } */
sp = r12 & (-16); /* 1000db8: 286af006c03f0336 { andi sp, r12, -16 ; lnk r13 } */
r13 = label1;
label1:
r5 = r0; /* 1000dc0: c7f846c6576bf005 { move r5, r0 ; addi r12, sp, 8 ; st sp, zero } */
r12 = sp + 8;
*(long *)sp = 0;
lr = 0; /* 1000dc8: c7f8468154cbfff7 { move lr, zero ; addi r2, r52, 8 ; st r12, zero } */
r2 = r52 + 8;
*r12 = 0;
r6 = sp + 16; /* 1000dd0: 000007e040110d86 { addi r6, sp, 16 ; moveli r0, 0 } */
r0 = 0;
r0 = (r0 << 16) | 0; /* 1000dd8: 000007e1f0000000 { shl16insli r0, r0, 0 ; moveli r3, 0 } */
r3 = 0;
r0 = (r0 << 16) | 0x200; /* 1000de0: 38000061f0200000 { shl16insli r0, r0, 512 ; shl16insli r3, r3, 0 } */
r3 = (r3 << 16) | 0;
r0 += r13; /* 1000de8: 3a754061d00cd000 { add r0, r0, r13 ; shl16insli r3, r3, 20136 } */
r3 = (r3 << 16) | 0x4ea8;
r12 = 0; /* 1000df0: 2806686190000fcc { moveli r12, 0 ; add r3, r3, r13 } */
r3 += r13;
r12 = (r12 << 16) | 0; /* 1000df8: 000007e27000030c { shl16insli r12, r12, 0 ; moveli r4, 0 } */
r4 = 0;
r12 = (r12 << 16) | 0x5588; /* 1000e00: 380000827558830c { shl16insli r12, r12, 21896 ; shl16insli r4, r4, 0 } */
r4 = (r4 << 16) | 0;
r12 += r13; /* 1000e08: 3a750082500cd30c { add r12, r12, r13 ; shl16insli r4, r4, 20128 } */
r4 = (r4 << 16) | 0x4ea0;
r4 += r13;
lr = label2;
jmp r12; /* r12 = 0x1000dc0 + 0x5588 = __libc_start_main */
/* r0 = 0x1000dc0 + 0x200 = 0x1000fc0 = main */
/* r4 = 0x1000dc0 + 0x4ea0 = 0x1005c60 */
}
1000e18: 181817ffd1483000 { info 2 }
1000e20: c7bec6ce576bfd9d { move r29, sp ; addi r28, sp, -40 ; st sp, lr }
1000e28: 180e86db51483000 { addi sp, sp, -48 }
1000e30: c6e906cd05c28d9b { addi r27, sp, 40 ; addi r26, sp, 32 ; st r28, r29 }
1000e38: 28630b6010000fe1 { moveli r33, 0 ; st r27, r33 }
1000e40: 2863034070101861 { shl16insli r33, r33, 257 ; st r26, r32 }
1000e48: 3b910430c0118d99 { addi r25, sp, 24 ; shl16insli r33, r33, 29216 }
1000e50: defe400005910d98 { addi r24, sp, 16 ; st r25, r31 }
1000e58: 5c064000361c3000 { ld1u r0, r33 }
1000e60: def64000358c3000 { st r24, r30 }
1000e68: 17c00009d1483000 { bnez r0, 1000f00 <read@plt-0x4f98> }
1000e70: 000007f010000fdf { moveli r31, 0 ; moveli r32, 0 }
1000e78: 38080c10701017df { shl16insli r31, r31, 257 ; shl16insli r32, r32, 257 }
1000e80: 3b7983ef90000fde { moveli r30, 0 ; shl16insli r31, r31, 28464 }
1000e88: 3b7944107010179e { shl16insli r30, r30, 257 ; shl16insli r32, r32, 28456 }
1000e90: 286903eff722879e { shl16insli r30, r30, 29224 ; sub r31, r31, r32 }
1000e98: 9e0640007de837df { shrsi r31, r31, 3 ; ld r0, r30 }
1000ea0: 180ffbefd1483000 { addi r31, r31, -1 }
1000ea8: 2816f800d1483000 { cmpltu r1, r0, r31 }
1000eb0: 1440002451483000 { beqz r1, 1000ef0 <read@plt-0x4fa8> }
1000eb8: 1808080051483000 { addi r0, r0, 1 }
1000ec0: de06400035ea0001 { shl3add r1, r0, r32 ; st r30, r0 }
1000ec8: 9e064000341c3000 { ld r0, r1 }
1000ed0: 286a600051483000 { jalr r0 }
1000ed8: 9e06400035ec3000 { ld r0, r30 }
1000ee0: 2816f800d1483000 { cmpltu r1, r0, r31 }
1000ee8: 17bff83d51483000 { bnezt r1, 1000eb8 <read@plt-0x4fe0> }
1000ef0: 18080fe051483000 { movei r0, 1 }
1000ef8: dc064000321c3000 { st1 r33, r0 }
1000f00: 180946ce40130d9d { addi r29, sp, 48 ; addi r28, sp, 40 }
1000f08: 87b8c6cd05d20d9b { addi r27, sp, 32 ; addi r26, sp, 24 ; ld lr, r29 }
1000f10: 9f0e400005c10d99 { addi r25, sp, 16 ; ld r33, r28 }
1000f18: 9f06400035bc3000 { ld r32, r27 }
1000f20: 9efe400035ac3000 { ld r31, r26 }
1000f28: 9ef666e005930db6 { addi sp, sp, 48 ; jrp lr ; ld r30, r25 }
1000f30: 286a6ee051483000 { jrp lr }
1000f38: 2863bec010000fc0 { moveli r0, 0 ; st sp, lr }
1000f40: 283bfecef0101000 { shl16insli r0, r0, 257 ; move r29, sp }
1000f48: 3b79c000401f8d9c { addi r28, sp, -8 ; shl16insli r0, r0, 28472 }
1000f50: 180f86db51483000 { addi sp, sp, -16 }
1000f58: 9e0e4000340c3000 { ld r1, r0 }
1000f60: deee400035cc3000 { st r28, r29 }
1000f68: 1440002351483000 { beqz r1, 1000f98 <read@plt-0x4f00> }
1000f70: 000007e0d1483000 { moveli r1, 0 }
1000f78: 38000020d1483000 { shl16insli r1, r1, 0 }
1000f80: 38000020d1483000 { shl16insli r1, r1, 0 }
1000f88: 1440002151483000 { beqz r1, 1000f98 <read@plt-0x4f00> }
1000f90: 286a602051483000 { jalr r1 }
1000f98: 180886ced1483000 { addi r29, sp, 16 }
1000fa0: 9fbe400005d10db6 { addi sp, sp, 16 ; ld lr, r29 }
1000fa8: 286b080051483000 { nop }
1000fb0: 286a6ee051483000 { jrp lr }
1000fb8: 286a6ee051483000 { jrp lr }
FRAME_SIZE = 80;
ARGV = -64;
ARGC = -52;
STDOUT = -48;
STDIN = -40;
ARGV1 = -32;
int main(int argc /* r0 */, char **argv /* r1 */) {
*sp = lr; /* 1000fc0: dfbe4000376c3000 { st sp, lr } */
r29 = r52; /* 1000fc8: 283bfe8ed1483000 { move r29, r52 } */
r52 = sp; /* 1000fd0: 283bfeda51483000 { move r52, sp } */
1000fd8: 180dc6ce51483000 { addi r28, sp, -72 }
sp -= FRAME_SIZE; /* 1000fe0: 180d86db51483000 { addi sp, sp, -80 } */
1000fe8: dfa6400035cc3000 { st r28, r52 }
1000ff0: 180fc68dd1483000 { addi r27, r52, -8 }
1000ff8: deee400035bc3000 { st r27, r29 }
frame[ARGV] = argv; /* 1001000: 180e068151483000 { addi r2, r52, -64 } */
/* 1001008: de0e4000342c3000 { st r2, r1 } */
frame[ARGC] = argc; /* 1001010: 18100000d1483000 { addxi r1, r0, 0 } */
/* 1001018: 180e668051483000 { addi r0, r52, -52 } */
/* 1001020: de0e4000300c3000 { st4 r0, r1 } */
1001028: 180f468051483000 { addi r0, r52, -24 }
1001030: 180f86a0d1483000 { addi r1, tp, -16 }
1001038: 9e164000341c3000 { ld r2, r1 }
1001040: de164000540bffc2 { move r2, zero ; st r0, r2 }
1001048: 180e668051483000 { addi r0, r52, -52 }
1001050: 9c064000340c3000 { ld4s r0, r0 }
1001058: 1820100051483000 { cmpeqi r0, r0, 2 }
if (r0 == 0) { /* 1001060: 17c0000451483000 { bnez r0, 10010a0 <read@plt-0x4df8> } */
r0 = 0x10064c8; /* 1001068: 000007e051483000 { moveli r0, 0 }*/
/* 1001070: 3808000051483000 { shl16insli r0, r0, 256 } */
/* 1001078: 3b26400051483000 { shl16insli r0, r0, 25800 } */
/* "[usage] %s dir" */
1001080: 180e0680d1483000 { addi r1, r52, -64 }
1001088: 9e0e4000341c3000 { ld r1, r1 }
1001090: 9e0e4000341c3000 { ld r1, r1 }
1001098: 2000051ed1483000 { jal 1006280 <printf@plt> }
}
frame[ARGV1] = frame[ARGV][1]; /* 10010a0: 180e068051483000 { addi r0, r52, -64 } */
/* 10010a8: 9e064000340c3000 { ld r0, r0 } */
/* 10010b0: 18084000d1483000 { addi r1, r0, 8 } */
/* 10010b8: 180f068051483000 { addi r0, r52, -32 } */
/* 10010c0: 9e0e4000341c3000 { ld r1, r1 } */
/* 10010c8: de0e4000340c3000 { st r0, r1 } */
10010d0: 180807e051483000 { movei r0, 0 }
r1 = 0x10064d8; /* 10010d8: 000007e0d1483000 { moveli r1, 0 } */
/* 10010e0: 38080020d1483000 { shl16insli r1, r1, 256 } */
/* 10010e8: 3b26c020d1483000 { shl16insli r1, r1, 25816 } */
/* "r" */
frame[STDIN] = fdopen(0, "r"); /* 10010f0: 200004ec51483000 { jal 1005fb0 <fdopen@plt> } */
/* 10010f8: 180ec680d1483000 { addi r1, r52, -40 } */
/* 1001100: de064000341c3000 { st r1, r0 } */
frame[STDOUT] = fdopen(1, "w"); /* 1001108: 18080fe051483000 { movei r0, 1 } */
/* 1001110: 000007e0d1483000 { moveli r1, 0 } */
/* 1001118: 38080020d1483000 { shl16insli r1, r1, 256 } */
/* 1001120: 3b270020d1483000 { shl16insli r1, r1, 25824 } */
/* 1001128: 200004e8d1483000 { jal 1005fb0 <fdopen@plt> } */
/* 1001130: 180e8680d1483000 { addi r1, r52, -48 } */
/* 1001138: de064000341c3000 { st r1, r0 } */
1001140: 1809e7e051483000 { movei r0, 60 }
1001148: 200004f351483000 { jal 1006078 <alarm@plt> }
main_1(frame[STDIN], /* 1001150: 180ec68051483000 { addi r0, r52, -40 } */
frame[STDOUT], /* 1001158: 180e8680d1483000 { addi r1, r52, -48 } */
frame[ARGV1]); /* 1001160: 180f068151483000 { addi r2, r52, -32 } */
/* 1001168: 9e064000340c3000 { ld r0, r0 } */
/* 1001170: 9e0e4000341c3000 { ld r1, r1 } */
/* 1001178: 9e164000342c3000 { ld r2, r2 } */
/* 1001180: 2000000851483000 { jal 1001200 <read@plt-0x4c98> } */
1001188: 180807e051483000 { movei r0, 0 }
1001190: 180f4680d1483000 { addi r1, r52, -24 }
1001198: 180f86a151483000 { addi r2, tp, -16 }
10011a0: 9e1e4000341c3000 { ld r3, r1 }
10011a8: 9e264000342c3000 { ld r4, r2 }
10011b0: 283bffe2501c40c3 { cmpeq r3, r3, r4 ; move r4, zero }
10011b8: 283bf860d1483000 { move r1, r3 }
10011c0: 17c0002151483000 { bnez r1, 10011d0 <read@plt-0x4cc8> }
10011c8: 200004e151483000 { jal 1005fd8 <__stack_chk_fail@plt> }
10011d0: 9fbe4000374c3000 { ld lr, r52 }
10011d8: 180fc68e51483000 { addi r28, r52, -8 }
10011e0: 9eee400035cc3000 { ld r29, r28 }
10011e8: 283bfe9b51483000 { move sp, r52 }
10011f0: 283bfbba51483000 { move r52, r29 }
10011f8: 286a6ee051483000 { jrp lr }
}
FRAME_SIZE = 80;
DIR = -56;
STDOUT = -48;
STDIN = -40;
REQ = -32;
void main_1(FILE *stdin /* r0 */, FILE *stdout /* r1 */, char *dir /* r2 */) {
1001200: dfbe4000376c3000 { st sp, lr }
1001208: 283bfe8ed1483000 { move r29, r52 }
1001210: 283bfeda51483000 { move r52, sp }
1001218: 180dc6ce51483000 { addi r28, sp, -72 }
sp -= FRAME_SIZE; /* 1001220: 180d86db51483000 { addi sp, sp, -80 } */
1001228: dfa6400035cc3000 { st r28, r52 }
1001230: 180fc68dd1483000 { addi r27, r52, -8 }
1001238: deee400035bc3000 { st r27, r29 }
frame[STDIN] = stdin; /* 1001240: 180ec681d1483000 { addi r3, r52, -40 } */
/* 1001248: de064000343c3000 { st r3, r0 } */
frame[STDOUT] = stdout; /* 1001250: 180e868051483000 { addi r0, r52, -48 } */
/* 1001258: de0e4000340c3000 { st r0, r1 } */
frame[DIR] = dir; /* 1001260: 180e468051483000 { addi r0, r52, -56 } */
/* 1001268: de164000340c3000 { st r0, r2 } */
1001270: 180f468051483000 { addi r0, r52, -24 }
1001278: 180f86a0d1483000 { addi r1, tp, -16 }
1001280: 9e164000341c3000 { ld r2, r1 }
1001288: de164000540bffc2 { move r2, zero ; st r0, r2 }
frame[REQ] = read_req(frame[STREAM]); /* 1001290: 180ec68051483000 { addi r0, r52, -40 } */
/* 1001298: 9e064000340c3000 { ld r0, r0 } */
/* 10012a0: 2000000dd1483000 { jal 1001378 <read@plt-0x4b20> } */
/* 10012a8: 180f0680d1483000 { addi r1, r52, -32 } */
/* 10012b0: de064000341c3000 { st r1, r0 } */
handle_req(frame[REQ], /* 10012b8: 180f068051483000 { addi r0, r52, -32 } */
frame[STDOUT], /* 10012c0: 180e8680d1483000 { addi r1, r52, -48 } */
frame[DIR]); /* 10012c8: 180e468151483000 { addi r2, r52, -56 } */
/* 10012d0: 9e064000340c3000 { ld r0, r0 } */
/* 10012d8: 9e0e4000341c3000 { ld r1, r1 } */
/* 10012e0: 9e164000342c3000 { ld r2, r2 } */
/* 10012e8: 20000246d1483000 { jal 1003750 <read@plt-0x2748> } */
free_req(frame[REQ]); /* 10012f0: 180f068051483000 { addi r0, r52, -32 } */
/* 10012f8: 9e064000340c3000 { ld r0, r0 } */
/* 1001300: 200000f751483000 { jal 1002270 <read@plt-0x3c28> } */
1001308: 180f468051483000 { addi r0, r52, -24 }
1001310: 180f86a0d1483000 { addi r1, tp, -16 }
1001318: 9e1e4000340c3000 { ld r3, r0 }
1001320: 9e164000341c3000 { ld r2, r1 }
1001328: 283bffe1501c20c3 { cmpeq r3, r3, r2 ; move r2, zero }
1001330: 283bf86051483000 { move r0, r3 }
1001338: 17c0000151483000 { bnez r0, 1001348 <read@plt-0x4b50> }
1001340: 200004c9d1483000 { jal 1005fd8 <__stack_chk_fail@plt> }
1001348: 9fbe4000374c3000 { ld lr, r52 }
1001350: 180fc68e51483000 { addi r28, r52, -8 }
1001358: 9eee400035cc3000 { ld r29, r28 }
1001360: 283bfe9b51483000 { move sp, r52 }
1001368: 283bfbba51483000 { move r52, r29 }
1001370: 286a6ee051483000 { jrp lr }
struct req {
/* 0x00 */ void *;
/* 0x08 */ void *method;
/* 0x10 */ void *uri;
/* 0x18 */ hdr *hdr;
/* 0x20 */ char *content;
/* 0x28 */ long content_length;
/* 0x30 */ char *host;
/* 0x38 */
};
FRAME_SIZE = 80
STREAM = -56
HDR = -40
REQ = -32
void read_req(FILE *stream) {
1001378: dfbe4000376c3000 { st sp, lr }
1001380: 283bfe8ed1483000 { move r29, r52 }
1001388: 283bfeda51483000 { move r52, sp }
1001390: 180dc6ce51483000 { addi r28, sp, -72 }
sp -= FRAME_SIZE; /* 1001398: 180d86db51483000 { addi sp, sp, -80 } */
10013a0: dfa6400035cc3000 { st r28, r52 }
10013a8: 180fc68dd1483000 { addi r27, r52, -8 }
10013b0: deee400035bc3000 { st r27, r29 }
frame[STREAM] = stream; /* 10013b8: 180e4680d1483000 { addi r1, r52, -56 } */
/* 10013c0: de064000341c3000 { st r1, r0 } */
10013c8: 180f468051483000 { addi r0, r52, -24 }
10013d0: 180f86a0d1483000 { addi r1, tp, -16 }
10013d8: 9e164000341c3000 { ld r2, r1 }
10013e0: de164000540bffc2 { move r2, zero ; st r0, r2 }
frame[REQ] = xmalloc(sizeof(req)); /* 10013e8: 1809c7e051483000 { movei r0, 56 } */
/* 10013f0: 200003f7d1483000 { jal 1005368 <read@plt-0xb30> } */
/* 10013f8: 180f0680d1483000 { addi r1, r52, -32 } */
/* 1001400: de064000341c3000 { st r1, r0 } */
read_first_line(frame[REQ], /* 1001408: 180f068051483000 { addi r0, r52, -32 } */
frame[STREAM]); /* 1001410: 180e4680d1483000 { addi r1, r52, -56 } */
/* 1001418: 9e064000340c3000 { ld r0, r0 } */
/* 1001420: 9e0e4000341c3000 { ld r1, r1 } */
/* 1001428: 2000003351483000 { jal 1001758 <read@plt-0x4740> } */
frame[REQ]->hdr = NULL; /* 1001430: 180f068051483000 { addi r0, r52, -32 } */
/* 1001438: 9e064000340c3000 { ld r0, r0 } */
/* 1001440: 1808c00051483000 { addi r0, r0, 24 } */
/* 1001448: dffe4000340c3000 { st r0, zero } */
1001450: 24000007d1483000 { j 10014c8 <read@plt-0x49d0> }
next_hdr:
r1 = frame[REQ]->hdr; /* 1001458: 180f068051483000 { addi r0, r52, -32 } */
/* 1001460: 9e064000340c3000 { ld r0, r0 } */
/* 1001468: 1808c00051483000 { addi r0, r0, 24 } */
/* 1001470: 9e0e4000340c3000 { ld r1, r0 } */
frame[HDR]->next =r1; /* 1001478: 180ec68051483000 { addi r0, r52, -40 } */
/* 1001480: 9e064000340c3000 { ld r0, r0 } */
/* 1001488: 1808800051483000 { addi r0, r0, 16 } */
/* 1001490: de0e4000340c3000 { st r0, r1 } */
frame[REQ]->hdr = frame[HDR]; /* 1001498: 180f068051483000 { addi r0, r52, -32 } */
/* 10014a0: 9e064000340c3000 { ld r0, r0 } */
/* 10014a8: 1808c00051483000 { addi r0, r0, 24 } */
/* 10014b0: 180ec680d1483000 { addi r1, r52, -40 } */
/* 10014b8: 9e0e4000341c3000 { ld r1, r1 } */
/* 10014c0: de0e4000340c3000 { st r0, r1 } */
frame[HDR] = read_hdr(frame[STREAM]); /* 10014c8: 180e468051483000 { addi r0, r52, -56 } */
/* 10014d0: 9e064000340c3000 { ld r0, r0 } */
/* 10014d8: 20000086d1483000 { jal 1001d40 <read@plt-0x4158> } */
/* 10014e0: 180ec680d1483000 { addi r1, r52, -40 } */
/* 10014e8: de064000341c3000 { st r1, r0 } */
if (frame[HDR] != NULL) /* 10014f0: 180ec68051483000 { addi r0, r52, -40 } */
/* 10014f8: 9e064000340c3000 { ld r0, r0 } */
goto next_hdr; /* 1001500: 17fff815d1483000 { bnez r0, 1001458 <read@plt-0x4a40> } */
frame[REQ]->content_length = get_content_length(frame[REQ]);
/* 1001508: 180f068051483000 { addi r0, r52, -32 } */
/* 1001510: 9e064000340c3000 { ld r0, r0 } */
/* 1001518: 200000ff51483000 { jal 1002508 <read@plt-0x3990> } */
/* 1001520: 180f0680d1483000 { addi r1, r52, -32 } */
/* 1001528: 9e0e4000341c3000 { ld r1, r1 } */
/* 1001530: 18094020d1483000 { addi r1, r1, 40 } */
/* 1001538: de064000341c3000 { st r1, r0 } */
frame[REQ]->host = get_host(frame[REQ]);
/* 1001540: 180f068051483000 { addi r0, r52, -32 } */
/* 1001548: 9e064000340c3000 { ld r0, r0 } */
/* 1001550: 2000016bd1483000 { jal 1002c08 <read@plt-0x3290> } */
/* 1001558: 180f0680d1483000 { addi r1, r52, -32 } */
/* 1001560: 9e0e4000341c3000 { ld r1, r1 } */
/* 1001568: 18098020d1483000 { addi r1, r1, 48 } */
/* 1001570: de064000341c3000 { st r1, r0 } */
if (frame[REQ]->content_length != 0) { /* { addi r0, r52, -32 } */
/* 1001580: 9e064000340c3000 { ld r0, r0 } */
/* 1001588: 1809400051483000 { addi r0, r0, 40 } */
/* 1001590: 9e064000340c3000 { ld r0, r0 } */
/* 1001598: 1440001251483000 { beqz r0, 10016b8 <read@plt-0x47e0> } */
if (frame[REQ]->content_length /* 10015a0: 180f068051483000 { addi r0, r52, -32 } */
>= (1 << 20)) /* 10015a8: 9e064000340c3000 { ld r0, r0 } */
exit(-1); /* 10015b0: 1809400051483000 { addi r0, r0, 40 } */
/* 10015b8: 9e064000340c3000 { ld r0, r0 } */
/* 10015c0: 18080fe1d1483000 { movei r3, 1 } */
/* 10015c8: 3004a061d1483000 { shli r3, r3, 20 } */
/* 10015d0: 2810180051483000 { cmples r0, r0, r3 } */
/* 10015d8: 17c00001d1483000 { bnez r0, 10015f0 <read@plt-0x48a8> } */
/* 10015e0: 180fffe051483000 { movei r0, -1 } */
/* 10015e8: 200004e051483000 { jal 10063e8 <exit@plt> } */
frame[REQ]->content = xmalloc(frame[REQ]->content_length);
/* 10015f0: 180f068051483000 { addi r0, r52, -32 } */
/* 10015f8: 9e064000340c3000 { ld r0, r0 } */
/* 1001600: 1809400051483000 { addi r0, r0, 40 } */
/* 1001608: 9e064000340c3000 { ld r0, r0 } */
/* 1001610: 200003d5d1483000 { jal 1005368 <read@plt-0xb30> } */
/* 1001618: 283bf800d1483000 { move r1, r0 } */
/* 1001620: 180f068051483000 { addi r0, r52, -32 } */
/* 1001628: 9e064000340c3000 { ld r0, r0 } */
/* 1001630: 1809000051483000 { addi r0, r0, 32 } */
/* 1001638: de0e4000340c3000 { st r0, r1 } */
if (fread(frame[REQ]->content, /* 1001640: 180f068051483000 { addi r0, r52, -32 } */
frame[REQ]->content_length,/* 1001648: 9e064000340c3000 { ld r0, r0 } */
frame[STREAM]) == 0) /* 1001650: 1809000051483000 { addi r0, r0, 32 } */
exit(-1); /* 1001658: 9e064000340c3000 { ld r0, r0 } */
/* 1001660: 180f0680d1483000 { addi r1, r52, -32 } */
/* 1001668: 9e0e4000341c3000 { ld r1, r1 } */
/* 1001670: 18094020d1483000 { addi r1, r1, 40 } */
/* 1001678: 9e0e4000341c3000 { ld r1, r1 } */
/* 1001680: 180e4681d1483000 { addi r3, r52, -56 } */
/* 1001688: 18080fe151483000 { movei r2, 1 } */
/* 1001690: 9e1e4000343c3000 { ld r3, r3 } */
/* 1001698: 2000049bd1483000 { jal 1006050 <fread@plt> } */
/* 10016a0: 17c00003d1483000 { bnez r0, 10016d8 <read@plt-0x47c0> } */
/* 10016a8: 180fffe051483000 { movei r0, -1 } */
/* 10016b0: 200004d3d1483000 { jal 10063e8 <exit@plt> } */
} else {
frame[REQ]->content = NULL; /* 10016b8: 180f068051483000 { addi r0, r52, -32 } */
/* 10016c0: 9e064000340c3000 { ld r0, r0 } */
/* 10016c8: 1809000051483000 { addi r0, r0, 32 } */
/* 10016d0: dffe4000340c3000 { st r0, zero } */
}
10016d8: 180f068051483000 { addi r0, r52, -32 }
10016e0: 9e064000340c3000 { ld r0, r0 }
10016e8: 180f4680d1483000 { addi r1, r52, -24 }
10016f0: 180f86a151483000 { addi r2, tp, -16 }
10016f8: 9e264000341c3000 { ld r4, r1 }
1001700: 9e1e4000342c3000 { ld r3, r2 }
1001708: 283bffe1d01c3104 { cmpeq r4, r4, r3 ; move r3, zero }
1001710: 283bf880d1483000 { move r1, r4 }
1001718: 17c0002151483000 { bnez r1, 1001728 <read@plt-0x4770> }
1001720: 2000048bd1483000 { jal 1005fd8 <__stack_chk_fail@plt> }
1001728: 9fbe4000374c3000 { ld lr, r52 }
1001730: 180fc68e51483000 { addi r28, r52, -8 }
1001738: 9eee400035cc3000 { ld r29, r28 }
1001740: 283bfe9b51483000 { move sp, r52 }
1001748: 283bfbba51483000 { move r52, r29 }
1001750: 286a6ee051483000 { jrp lr }
FRAME_SIZE = 4176;
REQ = -4152;
STREAM = -4160;
SEP2 = -4128;
SEP = -4136;
BUF = -4120;
void read_first_line(req *req, FILE *stream) {
1001758: dfbe4000376c3000 { st sp, lr }
1001760: 283bfe8ed1483000 { move r29, r52 }
1001768: 283bfeda51483000 { move r52, sp }
1001770: 077dc6ce51483000 { addli r28, sp, -4168 }
1001778: 077d86db51483000 { addli sp, sp, -4176 }
1001780: dfa6400035cc3000 { st r28, r52 }
1001788: 180fc68dd1483000 { addi r27, r52, -8 }
1001790: deee400035bc3000 { st r27, r29 }
frame[REQ] = req; /* 1001798: 077e468151483000 { addli r2, r52, -4152 } */
/* 10017a0: de064000342c3000 { st r2, r0 } */
frame[STREAM] = stream; /* 10017a8: 077e068051483000 { addli r0, r52, -4160 } */
/* 10017b0: de0e4000340c3000 { st r0, r1 } */
10017b8: 180f468051483000 { addi r0, r52, -24 }
10017c0: 180f86a0d1483000 { addi r1, tp, -16 }
10017c8: 9e164000341c3000 { ld r2, r1 }
10017d0: de164000540bffc2 { move r2, zero ; st r0, r2 }
if (!fgets(&frame[BUF], /* 10017d8: 077f468051483000 { addli r0, r52, -4120 } */
4096, /* 10017e0: 077e068151483000 { addli r2, r52, -4160 } */
frame[STREAM])) /* 10017e8: 008007e0d1483000 { moveli r1, 4096 } */
/* 10017f0: 9e164000342c3000 { ld r2, r2 } */
/* 10017f8: 2000046cd1483000 { jal 1005ec0 <fgets@plt> } */
/* 1001800: 17c00001d1483000 { bnez r0, 1001818 <read@plt-0x4680> } */
exit(-1); /* 1001808: 180fffe051483000 { movei r0, -1 } */
/* 1001810: 200004bdd1483000 { jal 10063e8 <exit@plt> } */
frame[SEP] = strchr(frame[BUF], ' '); /* 1001818: 077f468051483000 { addli r0, r52, -4120 } */
/* 1001820: 180907e0d1483000 { movei r1, 32 } */
/* 1001828: 2000049e51483000 { jal 1006208 <strchr@plt> } */
/* 1001830: 283bf800d1483000 { move r1, r0 } */
/* 1001838: 077ec68051483000 { addli r0, r52, -4136 } */
/* 1001840: de0e4000340c3000 { st r0, r1 } */
if (frame[SEP] == NULL) /* 1001848: 077ec68051483000 { addli r0, r52, -4136 } */
/* 1001850: 9e064000340c3000 { ld r0, r0 } */
/* 1001858: 17c00001d1483000 { bnez r0, 1001870 <read@plt-0x4628> } */
exit(-1); /* 1001860: 180fffe051483000 { movei r0, -1 } */
/* 1001868: 200004b851483000 { jal 10063e8 <exit@plt> } */
*frame[SEP] = 0; /* 1001870: 077ec68051483000 { addli r0, r52, -4136 } */
/* 1001878: 9e064000340c3000 { ld r0, r0 } */
/* 1001880: ddfe4000300c3000 { st1 r0, zero } */
frame[SEP]++; /* 1001888: 077ec68051483000 { addli r0, r52, -4136 } */
/* 1001890: 077ec680d1483000 { addli r1, r52, -4136 } */
/* 1001898: 9e0e4000341c3000 { ld r1, r1 } */
/* 10018a0: 18080820d1483000 { addi r1, r1, 1 } */
/* 10018a8: de0e4000340c3000 { st r0, r1 } */
r1 = xmalloc(frame[SEP] /* 10018b0: 077ec68051483000 { addli r0, r52, -4136 } */
- &frame[BUF] /* 10018b8: 9e0e4000340c3000 { ld r1, r0 } */
+ 1); /* 10018c0: 077f468051483000 { addli r0, r52, -4120 } */
/* 10018c8: 2868002051483000 { sub r0, r1, r0 } */
/* 10018d0: 1808080051483000 { addi r0, r0, 1 } */
/* 10018d8: 200003a951483000 { jal 1005368 <read@plt-0xb30> } */
/* 10018e0: 283bf800d1483000 { move r1, r0 } */
frame[REQ]->method = r1; /* 10018e8: 077e468051483000 { addli r0, r52, -4152 } */
/* 10018f0: 9e064000340c3000 { ld r0, r0 } */
/* 10018f8: 1808400051483000 { addi r0, r0, 8 } */
/* 1001900: de0e4000340c3000 { st r0, r1 } */
strcpy(frame[REQ]->method, /* 1001908: 077e468051483000 { addli r0, r52, -4152 } */
&frame[BUF]); /* 1001910: 9e064000340c3000 { ld r0, r0 } */
/* 1001918: 1808400051483000 { addi r0, r0, 8 } */
/* 1001920: 9e064000340c3000 { ld r0, r0 } */
/* 1001928: 077f4680d1483000 { addli r1, r52, -4120 } */
/* 1001930: 2000049cd1483000 { jal 10062f8 <strcpy@plt> } */
strtoupper(frame[REQ]->method); /* 1001938: 077e468051483000 { addli r0, r52, -4152 } */
/* 1001940: 9e064000340c3000 { ld r0, r0 } */
/* 1001948: 1808400051483000 { addi r0, r0, 8 } */
/* 1001950: 9e064000340c3000 { ld r0, r0 } */
/* 1001958: 20000078d1483000 { jal 10020e0 <read@plt-0x3db8> } */
frame[SEP2] = frame[SEP]; /* 1001960: 077f068051483000 { addli r0, r52, -4128 } */
/* 1001968: 077ec680d1483000 { addli r1, r52, -4136 } */
/* 1001970: 9e0e4000341c3000 { ld r1, r1 } */
/* 1001978: de0e4000340c3000 { st r0, r1 } */
frame[SEP] = strchr(frame[SEP2], ' '); /* 1001980: 077f068051483000 { addli r0, r52, -4128 } */
/* 001988: 9e064000340c3000 { ld r0, r0 } */
/* 1001990: 180907e0d1483000 { movei r1, 32 } */
/* 1001998: 2000048751483000 { jal 1006208 <strchr@plt> } */
/* 10019a0: 077ec680d1483000 { addli r1, r52, -4136 } */
/* 10019a8: de064000341c3000 { st r1, r0 } */
if (frame[SEP] == NULL) /* 10019b0: 077ec68051483000 { addli r0, r52, -4136 } */
/* 10019b8: 9e064000340c3000 { ld r0, r0 } */
/* 10019c0: 17c00001d1483000 { bnez r0, 10019d8 <read@plt-0x44c0> } */
exit(-1); /* 10019c8: 180fffe051483000 { movei r0, -1 } */
/* 10019d0: 200004a1d1483000 { jal 10063e8 <exit@plt> } */
*frame[SEP] = 0; /* 10019d8: 077ec68051483000 { addli r0, r52, -4136 } */
/* 10019e0: 9e064000340c3000 { ld r0, r0 } */
/* 10019e8: ddfe4000300c3000 { st1 r0, zero } */
frame[SEP]++; /* 10019f0: 077ec68051483000 { addli r0, r52, -4136 } */
/* 10019f8: 077ec680d1483000 { addli r1, r52, -4136 } */
/* 1001a00: 9e0e4000341c3000 { ld r1, r1 } */
/* 1001a08: 18080820d1483000 { addi r1, r1, 1 } */
/* 1001a10: de0e4000340c3000 { st r0, r1 } */
r1 = strlen(frame[SEP2]); /* 1001a18: 077f068051483000 { addli r0, r52, -4128 } */
/* 1001a20: 9e064000340c3000 { ld r0, r0 } */
/* 1001a28: 2000048351483000 { jal 1006258 <strlen@plt> } */
/* 1001a30: 283bf800d1483000 { move r1, r0 } */
1001a38: 077e868051483000 { addli r0, r52, -4144 }
1001a40: de0e4000340c3000 { st r0, r1 }
1001a48: 077e868051483000 { addli r0, r52, -4144 }
1001a50: 9e064000340c3000 { ld r0, r0 }
1001a58: 180ff80051483000 { addi r0, r0, -1 }
1001a60: 077f0680d1483000 { addli r1, r52, -4128 }
1001a68: 9e0e4000341c3000 { ld r1, r1 }
1001a70: 2806002051483000 { add r0, r1, r0 }
1001a78: 5c064000340c3000 { ld1u r0, r0 }
1001a80: 1821780051483000 { cmpeqi r0, r0, 47 }
{ /* 1001a88: 1440000fd1483000 { beqz r0, 1001b80 <read@plt-0x4318> } */
1001a90: 077ec68051483000 { addli r0, r52, -4136 }
1001a98: 9e064000340c3000 { ld r0, r0 }
1001aa0: 1808080051483000 { addi r0, r0, 1 }
1001aa8: 283bf800d1483000 { move r1, r0 }
1001ab0: 077f068051483000 { addli r0, r52, -4128 }
1001ab8: 9e064000340c3000 { ld r0, r0 }
1001ac0: 2868002051483000 { sub r0, r1, r0 }
1001ac8: 1808500051483000 { addi r0, r0, 10 }
1001ad0: 20000389d1483000 { jal 1005368 <read@plt-0xb30> }
1001ad8: 283bf800d1483000 { move r1, r0 }
1001ae0: 077e468051483000 { addli r0, r52, -4152 }
1001ae8: 9e064000340c3000 { ld r0, r0 }
1001af0: 1808800051483000 { addi r0, r0, 16 }
1001af8: de0e4000340c3000 { st r0, r1 }
1001b00: 077e468051483000 { addli r0, r52, -4152 }
1001b08: 9e064000340c3000 { ld r0, r0 }
1001b10: 1808800051483000 { addi r0, r0, 16 }
1001b18: 9e064000340c3000 { ld r0, r0 }
1001b20: 077f0680d1483000 { addli r1, r52, -4128 }
1001b28: 9e0e4000341c3000 { ld r1, r1 }
1001b30: 2000047cd1483000 { jal 10062f8 <strcpy@plt> }
1001b38: 077e468051483000 { addli r0, r52, -4152 }
1001b40: 9e064000340c3000 { ld r0, r0 }
1001b48: 1808800051483000 { addi r0, r0, 16 }
1001b50: 9e064000340c3000 { ld r0, r0 }
1001b58: 000007e0d1483000 { moveli r1, 0 }
1001b60: 38080020d1483000 { shl16insli r1, r1, 256 }
1001b68: 3b274020d1483000 { shl16insli r1, r1, 25832 }
1001b70: 2000045ad1483000 { jal 1006118 <strcat@plt> }
1001b78: 2400000ad1483000 { j 1001c20 <read@plt-0x4278> }
}
1001b80: 077ec68051483000 { addli r0, r52, -4136 }
1001b88: 9e064000340c3000 { ld r0, r0 }
1001b90: 1808080051483000 { addi r0, r0, 1 }
1001b98: 283bf800d1483000 { move r1, r0 }
1001ba0: 077f068051483000 { addli r0, r52, -4128 }
1001ba8: 9e064000340c3000 { ld r0, r0 }
1001bb0: 2868002051483000 { sub r0, r1, r0 }
1001bb8: 2000037b51483000 { jal 1005368 <read@plt-0xb30> }
1001bc0: 283bf800d1483000 { move r1, r0 }
1001bc8: 077e468051483000 { addli r0, r52, -4152 }
1001bd0: 9e064000340c3000 { ld r0, r0 }
1001bd8: 1808800051483000 { addi r0, r0, 16 }
1001be0: de0e4000340c3000 { st r0, r1 }
1001be8: 077e468051483000 { addli r0, r52, -4152 }
1001bf0: 9e064000340c3000 { ld r0, r0 }
1001bf8: 1808800051483000 { addi r0, r0, 16 }
1001c00: 9e064000340c3000 { ld r0, r0 }
1001c08: 077f0680d1483000 { addli r1, r52, -4128 }
1001c10: 9e0e4000341c3000 { ld r1, r1 }
1001c18: 2000046e51483000 { jal 10062f8 <strcpy@plt> }
1001c20: 077ec68051483000 { addli r0, r52, -4136 }
1001c28: 9e064000340c3000 { ld r0, r0 }
1001c30: 000007e0d1483000 { moveli r1, 0 }
1001c38: 38080020d1483000 { shl16insli r1, r1, 256 }
1001c40: 3b27c020d1483000 { shl16insli r1, r1, 25848 }
1001c48: 18083fe151483000 { movei r2, 7 }
1001c50: 20000447d1483000 { jal 10060c8 <strncasecmp@plt> }
1001c58: 14400001d1483000 { beqz r0, 1001c70 <read@plt-0x4228> }
1001c60: 180fffe051483000 { movei r0, -1 }
1001c68: 2000047851483000 { jal 10063e8 <exit@plt> }
1001c70: 077ec68051483000 { addli r0, r52, -4136 }
1001c78: 077ec680d1483000 { addli r1, r52, -4136 }
1001c80: 9e0e4000341c3000 { ld r1, r1 }
1001c88: 18083820d1483000 { addi r1, r1, 7 }
1001c90: de0e4000340c3000 { st r0, r1 }
1001c98: 077ec68051483000 { addli r0, r52, -4136 }
1001ca0: 9e064000340c3000 { ld r0, r0 }
1001ca8: 20000444d1483000 { jal 10060f0 <atoi@plt> }
1001cb0: 283bf800d1483000 { move r1, r0 }
1001cb8: 077e468051483000 { addli r0, r52, -4152 }
1001cc0: 9e064000340c3000 { ld r0, r0 }
1001cc8: de0e4000300c3000 { st4 r0, r1 }
1001cd0: 180f468051483000 { addi r0, r52, -24 }
1001cd8: 180f86a0d1483000 { addi r1, tp, -16 }
1001ce0: 9e1e4000340c3000 { ld r3, r0 }
1001ce8: 9e164000341c3000 { ld r2, r1 }
1001cf0: 283bffe1501c20c3 { cmpeq r3, r3, r2 ; move r2, zero }
1001cf8: 283bf86051483000 { move r0, r3 }
1001d00: 17c0000151483000 { bnez r0, 1001d10 <read@plt-0x4188> }
1001d08: 2000042d51483000 { jal 1005fd8 <__stack_chk_fail@plt> }
1001d10: 9fbe4000374c3000 { ld lr, r52 }
1001d18: 180fc68e51483000 { addi r28, r52, -8 }
1001d20: 9eee400035cc3000 { ld r29, r28 }
1001d28: 283bfe9b51483000 { move sp, r52 }
1001d30: 283bfbba51483000 { move r52, r29 }
1001d38: 286a6ee051483000 { jrp lr }
struct hdr {
/* 0x00 */ char *name;
/* 0x08 */ void *value;
/* 0x10 */ hdr *next;
/* 0x18 */
}
FRAME_SIZE = 4176;
STREAM = -4152;
SEP = -4136;
HDR = -4128;
BUF = -4120;
void read_hdr(FILE *stream) {
1001d40: dfbe4000376c3000 { st sp, lr }
1001d48: 283bfe8ed1483000 { move r29, r52 }
1001d50: 283bfeda51483000 { move r52, sp }
1001d58: 077dc6ce51483000 { addli r28, sp, -4168 }
sp -= FRAME_SIZE; /* 1001d60: 077d86db51483000 { addli sp, sp, -4176 } */
1001d68: dfa6400035cc3000 { st r28, r52 }
1001d70: 180fc68dd1483000 { addi r27, r52, -8 }
1001d78: deee400035bc3000 { st r27, r29 }
frame[STREAM] = stream; /* 1001d80: 077e4680d1483000 { addli r1, r52, -4152 } */
/* 1001d88: de064000341c3000 { st r1, r0 } */
1001d90: 180f468051483000 { addi r0, r52, -24 }
1001d98: 180f86a0d1483000 { addi r1, tp, -16 }
1001da0: 9e164000341c3000 { ld r2, r1 }
1001da8: de164000540bffc2 { move r2, zero ; st r0, r2 }
r0 = fgets(&frame[BUF], /* 1001db0: 077f468051483000 { addli r0, r52, -4120 } */
4096, /* 1001db8: 077e468151483000 { addli r2, r52, -4152 } */
frame[STREAM]); /* 1001dc0: 008007e0d1483000 { moveli r1, 4096 } */
/* 1001dc8: 9e164000342c3000 { ld r2, r2 } */
/* 1001dd0: 2000040f51483000 { jal 1005ec0 <fgets@plt> } */
if (r0 == 0) { /* 1001dd8: 17c00001d1483000 { bnez r0, 1001df0 <read@plt-0x40a8> } */
1001de0: 180fffe051483000 { movei r0, -1 }
1001de8: 2000046051483000 { jal 10063e8 <exit@plt> }
}
if (frame[BUF] != '\n') { /* 1001df0: 077f468051483000 { addli r0, r52, -4120 } */
/* 1001df8: 5c064000340c3000 { ld1u r0, r0 } */
/* 1001e00: 1820500051483000 { cmpeqi r0, r0, 10 } */
1001e08: 17c00003d1483000 { bnez r0, 1001e40 <read@plt-0x4058> }
1001e10: 077f468051483000 { addli r0, r52, -4120 }
r1 = 0x1006500; /* 1001e18: 000007e0d1483000 { moveli r1, 0 } */
/* 1001e20: 38080020d1483000 { shl16insli r1, r1, 256 } */
/* 1001e28: 3b280020d1483000 { shl16insli r1, r1, 25856 } */
/* "\r\n" */
if (!strcmp(&frame[BUF], "\r\n")) { /* 1001e30: 2000043651483000 { jal 1006190 <strcmp@plt> } */
/* 1001e38: 17c00001d1483000 { bnez r0, 1001e50 <read@plt-0x4048> } */
return 0; /* 1001e40: 180807e051483000 { movei r0, 0 } */
/* 1001e48: 24000022d1483000 { j 1002070 <read@plt-0x3e28> } */
}
frame[SEP] = strchr(&frame[BUF], ':'); /* 1001e50: 077f468051483000 { addli r0, r52, -4120 } */
/* 1001e58: 1809d7e0d1483000 { movei r1, 58 } */
/* 1001e60: 2000043ad1483000 { jal 1006208 <strchr@plt> } */
/* 1001e68: 077ec680d1483000 { addli r1, r52, -4136 } */
/* 1001e70: de064000341c3000 { st r1, r0 } */
if (frame[SEP] == 0) /* 1001e78: 077ec68051483000 { addli r0, r52, -4136 } */
exit(-1); /* 1001e80: 9e064000340c3000 { ld r0, r0 } */
/* 1001e88: 17c00001d1483000 { bnez r0, 1001ea0 <read@plt-0x3ff8> } */
/* 1001e90: 180fffe051483000 { movei r0, -1 } */
/* 1001e98: 2000045551483000 { jal 10063e8 <exit@plt> } */
*frame[SEP] = 0; /* 1001ea0: 077ec68051483000 { addli r0, r52, -4136 } */
/* 1001ea8: 9e064000340c3000 { ld r0, r0 } */
/* 1001eb0: ddfe4000300c3000 { st1 r0, zero } */
frame[SEP]++; /* 1001eb8: 077ec68051483000 { addli r0, r52, -4136 } */
/* 1001ec0: 077ec680d1483000 { addli r1, r52, -4136 } */
/* 1001ec8: 9e0e4000341c3000 { ld r1, r1 } */
/* 1001ed0: 18080820d1483000 { addi r1, r1, 1 } */
/* 1001ed8: de0e4000340c3000 { st r0, r1 } */
frame[HDR] = xmalloc(sizeof(hdr)); /* 1001ee0: 1808c7e051483000 { movei r0, 24 } */
/* 1001ee8: 2000034851483000 { jal 1005368 <read@plt-0xb30> } */
/* 1001ef0: 077f0680d1483000 { addli r1, r52, -4128 } */
/* 1001ef8: de064000341c3000 { st r1, r0 } */
r1 = xmalloc(frame[SEP] /* 1001f00: 077ec68051483000 { addli r0, r52, -4136 } */
- &frame[BUF] /* 1001f08: 9e0e4000340c3000 { ld r1, r0 } */
+ 1); /* 1001f10: 077f468051483000 { addli r0, r52, -4120 } */
/* 1001f18: 2868002051483000 { sub r0, r1, r0 } */
/* 1001f20: 1808080051483000 { addi r0, r0, 1 } */
/* 1001f28: 2000034451483000 { jal 1005368 <read@plt-0xb30> } */
/* 1001f30: 283bf800d1483000 { move r1, r0 } */
frame[HDR]->name = r1; /* 1001f38: 077f068051483000 { addli r0, r52, -4128 } */
/* 1001f40: 9e064000340c3000 { ld r0, r0 } */
/* 1001f48: de0e4000340c3000 { st r0, r1 } */
strcpy(frame[HDR]->name, &frame[BUF]); /* 1001f50: 077f068051483000 { addli r0, r52, -4128 } */
/* 1001f58: 9e064000340c3000 { ld r0, r0 } */
/* 1001f60: 9e064000340c3000 { ld r0, r0 } */
/* 1001f68: 077f4680d1483000 { addli r1, r52, -4120 } */
/* 1001f70: 20000438d1483000 { jal 10062f8 <strcpy@plt> } */
r1 = strspn(frame[SEP], " \t"); /* 1001f78: 077ec68051483000 { addli r0, r52, -4136 } */
/* 1001f80: 9e064000340c3000 { ld r0, r0 } */
/* 1001f88: 000007e0d1483000 { moveli r1, 0 } */
/* 1001f90: 38080020d1483000 { shl16insli r1, r1, 256 } */
/* 1001f98: 3b284020d1483000 { shl16insli r1, r1, 25864 } */
/* 1001fa0: 2000042951483000 { jal 1006230 <strspn@plt> } */
/* 1001fa8: 283bf800d1483000 { move r1, r0 } */
frame[SEP] += r1; /* 1001fb0: 077ec68051483000 { addli r0, r52, -4136 } */
/* 1001fb8: 077ec68151483000 { addli r2, r52, -4136 } */
/* 1001fc0: 9e164000342c3000 { ld r2, r2 } */
/* 1001fc8: 28060840d1483000 { add r1, r2, r1 } */
/* 1001fd0: de0e4000340c3000 { st r0, r1 } */
r1 = xmalloc(strlen(frame[SEP]) + 1); /* 1001fd8: 077ec68051483000 { addli r0, r52, -4136 } */
/* 1001fe0: 9e064000340c3000 { ld r0, r0 } */
/* 1001fe8: 2000042751483000 { jal 1006258 <strlen@plt> } */
/* 1001ff0: 1808080051483000 { addi r0, r0, 1 } */
/* 1001ff8: 2000033751483000 { jal 1005368 <read@plt-0xb30> } */
/* 1002000: 283bf800d1483000 { move r1, r0 } */
frame[HDR]->value = r1; /* 1002008: 077f068051483000 { addli r0, r52, -4128 } */
/* 1002010: 9e064000340c3000 { ld r0, r0 } */
/* 1002018: 1808400051483000 { addi r0, r0, 8 } */
/* 1002020: de0e4000340c3000 { st r0, r1 } */
strcpy(frame[HDR]->value, frame[SEP]); /* 1002028: 077f068051483000 { addli r0, r52, -4128 } */
/* 1002030: 9e064000340c3000 { ld r0, r0 } */
/* 1002038: 1808400051483000 { addi r0, r0, 8 } */
/* 1002040: 9e064000340c3000 { ld r0, r0 } */
/* 1002048: 077ec680d1483000 { addli r1, r52, -4136 } */
/* 1002050: 9e0e4000341c3000 { ld r1, r1 } */
/* 1002058: 2000042a51483000 { jal 10062f8 <strcpy@plt> } */
1002060: 077f068051483000 { addli r0, r52, -4128 }
1002068: 9e064000340c3000 { ld r0, r0 }
1002070: 180f4680d1483000 { addi r1, r52, -24 }
1002078: 180f86a151483000 { addi r2, tp, -16 }
1002080: 9e1e4000341c3000 { ld r3, r1 }
1002088: 9e264000342c3000 { ld r4, r2 }
1002090: 283bffe2501c40c3 { cmpeq r3, r3, r4 ; move r4, zero }
1002098: 283bf860d1483000 { move r1, r3 }
10020a0: 17c0002151483000 { bnez r1, 10020b0 <read@plt-0x3de8> }
10020a8: 200003f351483000 { jal 1005fd8 <__stack_chk_fail@plt> }
10020b0: 9fbe4000374c3000 { ld lr, r52 }
10020b8: 180fc68e51483000 { addi r28, r52, -8 }
10020c0: 9eee400035cc3000 { ld r29, r28 }
10020c8: 283bfe9b51483000 { move sp, r52 }
10020d0: 283bfbba51483000 { move r52, r29 }
10020d8: 286a6ee051483000 { jrp lr }
FRAME_SIZE = 64;
void strtoupper(char *s) {
10020e0: dfbe4000376c3000 { st sp, lr }
10020e8: 283bfe8ed1483000 { move r29, r52 }
10020f0: 283bfeda51483000 { move r52, sp }
10020f8: 180e46ce51483000 { addi r28, sp, -56 }
sp -= FRAME_SIZE; /* 1002100: 180e06db51483000 { addi sp, sp, -64 } */
1002108: dfa6400035cc3000 { st r28, r52 }
1002110: 180fc68dd1483000 { addi r27, r52, -8 }
1002118: deee400035bc3000 { st r27, r29 }
1002120: 180ec680d1483000 { addi r1, r52, -40 }
1002128: de064000341c3000 { st r1, r0 }
1002130: 180f468051483000 { addi r0, r52, -24 }
1002138: 180f86a0d1483000 { addi r1, tp, -16 }
1002140: 9e164000341c3000 { ld r2, r1 }
1002148: de164000540bffc2 { move r2, zero ; st r0, r2 }
1002150: 180f068051483000 { addi r0, r52, -32 }
1002158: 180ec680d1483000 { addi r1, r52, -40 }
1002160: 9e0e4000341c3000 { ld r1, r1 }
1002168: de0e4000340c3000 { st r0, r1 }
1002170: 2400000751483000 { j 10021e0 <read@plt-0x3cb8> }
1002178: 180f068051483000 { addi r0, r52, -32 }
1002180: 9e064000340c3000 { ld r0, r0 }
1002188: 5c064000340c3000 { ld1u r0, r0 }
1002190: 2000041451483000 { jal 10062d0 <toupper@plt> }
1002198: 286a300035007001 { bfextu r1, r0, 0, 7 }
10021a0: 180f068051483000 { addi r0, r52, -32 }
10021a8: 9e064000340c3000 { ld r0, r0 }
10021b0: dc0e4000300c3000 { st1 r0, r1 }
10021b8: 180f068051483000 { addi r0, r52, -32 }
10021c0: 180f0680d1483000 { addi r1, r52, -32 }
10021c8: 9e0e4000341c3000 { ld r1, r1 }
10021d0: 18080820d1483000 { addi r1, r1, 1 }
10021d8: de0e4000340c3000 { st r0, r1 }
10021e0: 180f068051483000 { addi r0, r52, -32 }
10021e8: 9e064000340c3000 { ld r0, r0 }
10021f0: 5c064000340c3000 { ld1u r0, r0 }
10021f8: 17fff81851483000 { bnez r0, 1002178 <read@plt-0x3d20> }
1002200: 180f468051483000 { addi r0, r52, -24 }
1002208: 180f86a0d1483000 { addi r1, tp, -16 }
1002210: 9e1e4000340c3000 { ld r3, r0 }
1002218: 9e164000341c3000 { ld r2, r1 }
1002220: 283bffe1501c20c3 { cmpeq r3, r3, r2 ; move r2, zero }
1002228: 283bf86051483000 { move r0, r3 }
1002230: 17c0000151483000 { bnez r0, 1002240 <read@plt-0x3c58> }
1002238: 200003da51483000 { jal 1005fd8 <__stack_chk_fail@plt> }
1002240: 9fbe4000374c3000 { ld lr, r52 }
1002248: 180fc68e51483000 { addi r28, r52, -8 }
1002250: 9eee400035cc3000 { ld r29, r28 }
1002258: 283bfe9b51483000 { move sp, r52 }
1002260: 283bfbba51483000 { move r52, r29 }
1002268: 286a6ee051483000 { jrp lr }
void free_req(req *req /* r0 */) {
1002270: dfbe4000376c3000 { st sp, lr }
1002278: 283bfe8ed1483000 { move r29, r52 }
1002280: 283bfeda51483000 { move r52, sp }
1002288: 180dc6ce51483000 { addi r28, sp, -72 }
1002290: 180d86db51483000 { addi sp, sp, -80 }
1002298: dfa6400035cc3000 { st r28, r52 }
10022a0: 180fc68dd1483000 { addi r27, r52, -8 }
10022a8: deee400035bc3000 { st r27, r29 }
10022b0: 180e4680d1483000 { addi r1, r52, -56 }
10022b8: de064000341c3000 { st r1, r0 }
10022c0: 180f468051483000 { addi r0, r52, -24 }
10022c8: 180f86a0d1483000 { addi r1, tp, -16 }
10022d0: 9e164000341c3000 { ld r2, r1 }
10022d8: de164000540bffc2 { move r2, zero ; st r0, r2 }
10022e0: 180ec68051483000 { addi r0, r52, -40 }
10022e8: 180e4680d1483000 { addi r1, r52, -56 }
10022f0: 9e0e4000341c3000 { ld r1, r1 }
10022f8: 1808c020d1483000 { addi r1, r1, 24 }
1002300: 9e0e4000341c3000 { ld r1, r1 }
1002308: de0e4000340c3000 { st r0, r1 }
1002310: 2400000bd1483000 { j 10023c8 <read@plt-0x3ad0> }
1002318: 180f068051483000 { addi r0, r52, -32 }
1002320: 180ec680d1483000 { addi r1, r52, -40 }
1002328: 9e0e4000341c3000 { ld r1, r1 }
1002330: de0e4000340c3000 { st r0, r1 }
1002338: 180ec68051483000 { addi r0, r52, -40 }
1002340: 180ec680d1483000 { addi r1, r52, -40 }
1002348: 9e0e4000341c3000 { ld r1, r1 }
1002350: 18088020d1483000 { addi r1, r1, 16 }
1002358: 9e0e4000341c3000 { ld r1, r1 }
1002360: de0e4000340c3000 { st r0, r1 }
1002368: 180f068051483000 { addi r0, r52, -32 }
1002370: 9e064000340c3000 { ld r0, r0 }
1002378: 9e064000340c3000 { ld r0, r0 }
1002380: 200003bbd1483000 { jal 1005f38 <free@plt> }
1002388: 180f068051483000 { addi r0, r52, -32 }
1002390: 9e064000340c3000 { ld r0, r0 }
1002398: 1808400051483000 { addi r0, r0, 8 }
10023a0: 9e064000340c3000 { ld r0, r0 }
10023a8: 200003b951483000 { jal 1005f38 <free@plt> }
10023b0: 180f068051483000 { addi r0, r52, -32 }
10023b8: 9e064000340c3000 { ld r0, r0 }
10023c0: 200003b7d1483000 { jal 1005f38 <free@plt> }
10023c8: 180ec68051483000 { addi r0, r52, -40 }
10023d0: 9e064000340c3000 { ld r0, r0 }
10023d8: 17fff81451483000 { bnez r0, 1002318 <read@plt-0x3b80> }
10023e0: 180e468051483000 { addi r0, r52, -56 }
10023e8: 9e064000340c3000 { ld r0, r0 }
10023f0: 1808400051483000 { addi r0, r0, 8 }
10023f8: 9e064000340c3000 { ld r0, r0 }
1002400: 200003b3d1483000 { jal 1005f38 <free@plt> }
1002408: 180e468051483000 { addi r0, r52, -56 }
1002410: 9e064000340c3000 { ld r0, r0 }
1002418: 1808800051483000 { addi r0, r0, 16 }
1002420: 9e064000340c3000 { ld r0, r0 }
1002428: 200003b151483000 { jal 1005f38 <free@plt> }
1002430: 180e468051483000 { addi r0, r52, -56 }
1002438: 9e064000340c3000 { ld r0, r0 }
1002440: 1809000051483000 { addi r0, r0, 32 }
1002448: 9e064000340c3000 { ld r0, r0 }
1002450: 200003aed1483000 { jal 1005f38 <free@plt> }
1002458: 180e468051483000 { addi r0, r52, -56 }
1002460: 9e064000340c3000 { ld r0, r0 }
1002468: 1809800051483000 { addi r0, r0, 48 }
1002470: 9e064000340c3000 { ld r0, r0 }
1002478: 200003ac51483000 { jal 1005f38 <free@plt> }
1002480: 180e468051483000 { addi r0, r52, -56 }
1002488: 9e064000340c3000 { ld r0, r0 }
1002490: 200003aad1483000 { jal 1005f38 <free@plt> }
1002498: 180f468051483000 { addi r0, r52, -24 }
10024a0: 180f86a0d1483000 { addi r1, tp, -16 }
10024a8: 9e1e4000340c3000 { ld r3, r0 }
10024b0: 9e164000341c3000 { ld r2, r1 }
10024b8: 283bffe1501c20c3 { cmpeq r3, r3, r2 ; move r2, zero }
10024c0: 283bf86051483000 { move r0, r3 }
10024c8: 17c0000151483000 { bnez r0, 10024d8 <read@plt-0x39c0> }
10024d0: 200003b0d1483000 { jal 1005fd8 <__stack_chk_fail@plt> }
10024d8: 9fbe4000374c3000 { ld lr, r52 }
10024e0: 180fc68e51483000 { addi r28, r52, -8 }
10024e8: 9eee400035cc3000 { ld r29, r28 }
10024f0: 283bfe9b51483000 { move sp, r52 }
10024f8: 283bfbba51483000 { move r52, r29 }
1002500: 286a6ee051483000 { jrp lr }
FRAME_SIZE = 80
REQ = -56
LENGTH = -40
LENGTH_STR = -32
long get_content_length(req *req /* r0 */) {
1002508: dfbe4000376c3000 { st sp, lr }
1002510: 283bfe8ed1483000 { move r29, r52 }
1002518: 283bfeda51483000 { move r52, sp }
1002520: 180dc6ce51483000 { addi r28, sp, -72 }
sp -= FRAME_SIZE; /* 1002528: 180d86db51483000 { addi sp, sp, -80 } */
1002530: dfa6400035cc3000 { st r28, r52 }
1002538: 180fc68dd1483000 { addi r27, r52, -8 }
1002540: deee400035bc3000 { st r27, r29 }
frame[REQ] = req; /* 1002548: 180e4680d1483000 { addi r1, r52, -56 } */
/* 1002550: de064000341c3000 { st r1, r0 } */
1002558: 180f468051483000 { addi r0, r52, -24 }
1002560: 180f86a0d1483000 { addi r1, tp, -16 }
1002568: 9e164000341c3000 { ld r2, r1 }
1002570: de164000540bffc2 { move r2, zero ; st r0, r2 }
frame[LENGTH_STR] = get_header(frame[REQ], "Content-Length");
/* 1002578: 000007e051483000 { moveli r0, 0 } */
/* 1002580: 3808000051483000 { shl16insli r0, r0, 256 } */
/* 1002588: 3b288000d1483000 { shl16insli r1, r0, 25872 } */
/* 1002590: 180e468051483000 { addi r0, r52, -56 } */
/* 1002598: 9e064000340c3000 { ld r0, r0 } */
/* 10025a0: 2000004951483000 { jal 1002a30 <read@plt-0x3468> } */
/* 10025a8: 180f0680d1483000 { addi r1, r52, -32 } */
/* 10025b0: de064000341c3000 { st r1, r0 } */
if (frame[LENGTH_STR] == 0) /* 10025b8: 180f068051483000 { addi r0, r52, -32 } */
return 0; /* 10025c0: 9e064000340c3000 { ld r0, r0 } */
/* 10025c8: 17c00001d1483000 { bnez r0, 10025e0 <read@plt-0x38b8> } */
/* 10025d0: 180807e051483000 { movei r0, 0 } */
/* 10025d8: 2400000751483000 { j 1002648 <read@plt-0x3850> } */
frame[LENGTH] = atol(frame[LENGTH_STR]);
/* 10025e0: 180f068051483000 { addi r0, r52, -32 } */
/* 10025e8: 9e064000340c3000 { ld r0, r0 } */
/* 10025f0: 200003a151483000 { jal 1006000 <atol@plt> } */
/* 10025f8: 283bf800d1483000 { move r1, r0 } */
/* 1002600: 180ec68051483000 { addi r0, r52, -40 } */
/* 1002608: de0e4000340c3000 { st r0, r1 } */
if (frame[LENGTH] < 0) /* 1002610: 180ec68051483000 { addi r0, r52, -40 } */
exit(-1); /* 1002618: 9e064000340c3000 { ld r0, r0 } */
/* 1002620: 14c00001d1483000 { bgez r0, 1002638 <read@plt-0x3860> } */
/* 1002628: 180fffe051483000 { movei r0, -1 } */
/* 1002630: 200003dbd1483000 { jal 10063e8 <exit@plt> } */
1002638: 180ec68051483000 { addi r0, r52, -40 }
1002640: 9e064000340c3000 { ld r0, r0 }
1002648: 180f4680d1483000 { addi r1, r52, -24 }
1002650: 180f86a151483000 { addi r2, tp, -16 }
1002658: 9e1e4000341c3000 { ld r3, r1 }
1002660: 9e264000342c3000 { ld r4, r2 }
1002668: 283bffe2501c40c3 { cmpeq r3, r3, r4 ; move r4, zero }
1002670: 283bf860d1483000 { move r1, r3 }
1002678: 17c0002151483000 { bnez r1, 1002688 <read@plt-0x3810> }
1002680: 20000395d1483000 { jal 1005fd8 <__stack_chk_fail@plt> }
1002688: 9fbe4000374c3000 { ld lr, r52 }
1002690: 180fc68e51483000 { addi r28, r52, -8 }
1002698: 9eee400035cc3000 { ld r29, r28 }
10026a0: 283bfe9b51483000 { move sp, r52 }
10026a8: 283bfbba51483000 { move r52, r29 }
10026b0: 286a6ee051483000 { jrp lr }
FRAME_SIZE = 64
REQ = -40
void get_host(req *req /* r0 */) {
10026b8: dfbe4000376c3000 { st sp, lr }
10026c0: 283bfe8ed1483000 { move r29, r52 }
10026c8: 283bfeda51483000 { move r52, sp }
10026d0: 180e46ce51483000 { addi r28, sp, -56 }
sp -= FRAME_SIZE; /* 10026d8: 180e06db51483000 { addi sp, sp, -64 } */
10026e0: dfa6400035cc3000 { st r28, r52 }
10026e8: 180fc68dd1483000 { addi r27, r52, -8 }
10026f0: deee400035bc3000 { st r27, r29 }
frame[REQ] = req; /* 10026f8: 180ec680d1483000 { addi r1, r52, -40 } */
/* 1002700: de064000341c3000 { st r1, r0 } */
1002708: 180f468051483000 { addi r0, r52, -24 }
1002710: 180f86a0d1483000 { addi r1, tp, -16 }
1002718: 9e164000341c3000 { ld r2, r1 }
1002720: de164000540bffc2 { move r2, zero ; st r0, r2 }
1002728: 000007e051483000 { moveli r0, 0 }
1002730: 3808000051483000 { shl16insli r0, r0, 256 }
1002738: 3b290000d1483000 { shl16insli r1, r0, 25888 }
1002740: 180ec68051483000 { addi r0, r52, -40 }
1002748: 9e064000340c3000 { ld r0, r0 }
1002750: 2000002e51483000 { jal 1002a30 <read@plt-0x3468> }
1002758: 180f0680d1483000 { addi r1, r52, -32 }
1002760: de064000341c3000 { st r1, r0 }
1002768: 180f068051483000 { addi r0, r52, -32 }
1002770: 9e064000340c3000 { ld r0, r0 }
1002778: 17c00001d1483000 { bnez r0, 1002790 <read@plt-0x3708> }
1002780: 180807e051483000 { movei r0, 0 }
1002788: 24000001d1483000 { j 10027a0 <read@plt-0x36f8> }
1002790: 180f068051483000 { addi r0, r52, -32 }
1002798: 9e064000340c3000 { ld r0, r0 }
10027a0: 180f4680d1483000 { addi r1, r52, -24 }
10027a8: 180f86a151483000 { addi r2, tp, -16 }
10027b0: 9e1e4000341c3000 { ld r3, r1 }
10027b8: 9e264000342c3000 { ld r4, r2 }
10027c0: 283bffe2501c40c3 { cmpeq r3, r3, r4 ; move r4, zero }
10027c8: 283bf860d1483000 { move r1, r3 }
10027d0: 17c0002151483000 { bnez r1, 10027e0 <read@plt-0x36b8> }
10027d8: 2000038051483000 { jal 1005fd8 <__stack_chk_fail@plt> }
10027e0: 9fbe4000374c3000 { ld lr, r52 }
10027e8: 180fc68e51483000 { addi r28, r52, -8 }
10027f0: 9eee400035cc3000 { ld r29, r28 }
10027f8: 283bfe9b51483000 { move sp, r52 }
1002800: 283bfbba51483000 { move r52, r29 }
1002808: 286a6ee051483000 { jrp lr }
RESULT = -48
BASIC = -40
AUTH = -32
void get_auth(req *req) {
1002810: dfbe4000376c3000 { st sp, lr }
1002818: 283bfe8ed1483000 { move r29, r52 }
1002820: 283bfeda51483000 { move r52, sp }