-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasicopt1.dump
451 lines (423 loc) · 17.2 KB
/
basicopt1.dump
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
./test/test.om: file format elf32-littleriscv
Disassembly of section .rom:
00000000 <.rom>:
0: 00020137 lui sp,0x20
4: 040010ef jal ra,1044 <main>
8: 0ff00513 li a0,255
c: 000306b7 lui a3,0x30
10: 00a68223 sb a0,4(a3) # 30004 <__heap_start+0x2e004>
14: ff9ff06f j c <printInt-0xff4>
Disassembly of section .text:
00001000 <printInt>:
1000: 00001737 lui a4,0x1
1004: 27c72783 lw a5,636(a4) # 127c <__bss_end>
1008: 00f54533 xor a0,a0,a5
100c: 0ad50513 addi a0,a0,173
1010: 26a72e23 sw a0,636(a4)
1014: 00008067 ret
00001018 <printStr>:
1018: 00054783 lbu a5,0(a0)
101c: 02078263 beqz a5,1040 <printStr+0x28>
1020: 00001737 lui a4,0x1
1024: 27c72683 lw a3,636(a4) # 127c <__bss_end>
1028: 00d7c7b3 xor a5,a5,a3
102c: 20978793 addi a5,a5,521
1030: 26f72e23 sw a5,636(a4)
1034: 00150513 addi a0,a0,1
1038: 00054783 lbu a5,0(a0)
103c: fe0794e3 bnez a5,1024 <printStr+0xc>
1040: 00008067 ret
00001044 <main>:
1044: 81010113 addi sp,sp,-2032 # 1f810 <__heap_start+0x1d810>
1048: 7e112623 sw ra,2028(sp)
104c: 7e812423 sw s0,2024(sp)
1050: 7e912223 sw s1,2020(sp)
1054: 7f212023 sw s2,2016(sp)
1058: 7d312e23 sw s3,2012(sp)
105c: 7d412c23 sw s4,2008(sp)
1060: 7d512a23 sw s5,2004(sp)
1064: 7d612823 sw s6,2000(sp)
1068: 7d712623 sw s7,1996(sp)
106c: 7d812423 sw s8,1992(sp)
1070: ffff7337 lui t1,0xffff7
1074: b8030313 addi t1,t1,-1152 # ffff6b80 <__heap_start+0xffff4b80>
1078: 00610133 add sp,sp,t1
107c: ffff6437 lui s0,0xffff6
1080: 0000a737 lui a4,0xa
1084: c4070793 addi a5,a4,-960 # 9c40 <__heap_start+0x7c40>
1088: 002787b3 add a5,a5,sp
108c: 00878433 add s0,a5,s0
1090: 55040413 addi s0,s0,1360 # ffff6550 <__heap_start+0xffff4550>
1094: dd070793 addi a5,a4,-560
1098: 00f10933 add s2,sp,a5
109c: 00040713 mv a4,s0
10a0: 00c0006f j 10ac <main+0x68>
10a4: 19070713 addi a4,a4,400
10a8: 01270c63 beq a4,s2,10c0 <main+0x7c>
10ac: e7070793 addi a5,a4,-400
10b0: 0007a023 sw zero,0(a5)
10b4: 00478793 addi a5,a5,4
10b8: fee79ce3 bne a5,a4,10b0 <main+0x6c>
10bc: fe9ff06f j 10a4 <main+0x60>
10c0: 00100493 li s1,1
10c4: 03a00a13 li s4,58
10c8: 06300993 li s3,99
10cc: ffff6b37 lui s6,0xffff6
10d0: 0000a7b7 lui a5,0xa
10d4: c4078793 addi a5,a5,-960 # 9c40 <__heap_start+0x7c40>
10d8: 002787b3 add a5,a5,sp
10dc: 01678b33 add s6,a5,s6
10e0: 05c0006f j 113c <main+0xf8>
10e4: 00000b93 li s7,0
10e8: 01900593 li a1,25
10ec: 000b8513 mv a0,s7
10f0: 0d4000ef jal ra,11c4 <__divsi3>
10f4: 01550c33 add s8,a0,s5
10f8: 06400593 li a1,100
10fc: 002b9513 slli a0,s7,0x2
1100: 148000ef jal ra,1248 <__modsi3>
1104: 001c1793 slli a5,s8,0x1
1108: 018787b3 add a5,a5,s8
110c: 00379793 slli a5,a5,0x3
1110: 018787b3 add a5,a5,s8
1114: 00279793 slli a5,a5,0x2
1118: 00a787b3 add a5,a5,a0
111c: 00279793 slli a5,a5,0x2
1120: 00fb07b3 add a5,s6,a5
1124: 032b8713 addi a4,s7,50
1128: 3ce7a023 sw a4,960(a5)
112c: 001b8b93 addi s7,s7,1
1130: 06400793 li a5,100
1134: fafb9ae3 bne s7,a5,10e8 <main+0xa4>
1138: 00148493 addi s1,s1,1
113c: fff48a93 addi s5,s1,-1
1140: fea48793 addi a5,s1,-22
1144: fafa70e3 bgeu s4,a5,10e4 <main+0xa0>
1148: fe99d8e3 bge s3,s1,1138 <main+0xf4>
114c: 00000513 li a0,0
1150: 00c0006f j 115c <main+0x118>
1154: 19040413 addi s0,s0,400
1158: 01240e63 beq s0,s2,1174 <main+0x130>
115c: e7040793 addi a5,s0,-400
1160: 0007a703 lw a4,0(a5)
1164: 00e50533 add a0,a0,a4
1168: 00478793 addi a5,a5,4
116c: fe879ae3 bne a5,s0,1160 <main+0x11c>
1170: fe5ff06f j 1154 <main+0x110>
1174: e8dff0ef jal ra,1000 <printInt>
1178: 0fd00593 li a1,253
117c: 000017b7 lui a5,0x1
1180: 27c7a503 lw a0,636(a5) # 127c <__bss_end>
1184: 0c4000ef jal ra,1248 <__modsi3>
1188: 00009337 lui t1,0x9
118c: 48030313 addi t1,t1,1152 # 9480 <__heap_start+0x7480>
1190: 00610133 add sp,sp,t1
1194: 7ec12083 lw ra,2028(sp)
1198: 7e812403 lw s0,2024(sp)
119c: 7e412483 lw s1,2020(sp)
11a0: 7e012903 lw s2,2016(sp)
11a4: 7dc12983 lw s3,2012(sp)
11a8: 7d812a03 lw s4,2008(sp)
11ac: 7d412a83 lw s5,2004(sp)
11b0: 7d012b03 lw s6,2000(sp)
11b4: 7cc12b83 lw s7,1996(sp)
11b8: 7c812c03 lw s8,1992(sp)
11bc: 7f010113 addi sp,sp,2032
11c0: 00008067 ret
000011c4 <__divsi3>:
11c4: 06054063 bltz a0,1224 <__umodsi3+0x10>
11c8: 0605c663 bltz a1,1234 <__umodsi3+0x20>
000011cc <__udivsi3>:
11cc: 00058613 mv a2,a1
11d0: 00050593 mv a1,a0
11d4: fff00513 li a0,-1
11d8: 02060c63 beqz a2,1210 <__udivsi3+0x44>
11dc: 00100693 li a3,1
11e0: 00b67a63 bgeu a2,a1,11f4 <__udivsi3+0x28>
11e4: 00c05863 blez a2,11f4 <__udivsi3+0x28>
11e8: 00161613 slli a2,a2,0x1
11ec: 00169693 slli a3,a3,0x1
11f0: feb66ae3 bltu a2,a1,11e4 <__udivsi3+0x18>
11f4: 00000513 li a0,0
11f8: 00c5e663 bltu a1,a2,1204 <__udivsi3+0x38>
11fc: 40c585b3 sub a1,a1,a2
1200: 00d56533 or a0,a0,a3
1204: 0016d693 srli a3,a3,0x1
1208: 00165613 srli a2,a2,0x1
120c: fe0696e3 bnez a3,11f8 <__udivsi3+0x2c>
1210: 00008067 ret
00001214 <__umodsi3>:
1214: 00008293 mv t0,ra
1218: fb5ff0ef jal ra,11cc <__udivsi3>
121c: 00058513 mv a0,a1
1220: 00028067 jr t0
1224: 40a00533 neg a0,a0
1228: 0005d863 bgez a1,1238 <__umodsi3+0x24>
122c: 40b005b3 neg a1,a1
1230: f9dff06f j 11cc <__udivsi3>
1234: 40b005b3 neg a1,a1
1238: 00008293 mv t0,ra
123c: f91ff0ef jal ra,11cc <__udivsi3>
1240: 40a00533 neg a0,a0
1244: 00028067 jr t0
00001248 <__modsi3>:
1248: 00008293 mv t0,ra
124c: 0005ca63 bltz a1,1260 <__modsi3+0x18>
1250: 00054c63 bltz a0,1268 <__modsi3+0x20>
1254: f79ff0ef jal ra,11cc <__udivsi3>
1258: 00058513 mv a0,a1
125c: 00028067 jr t0
1260: 40b005b3 neg a1,a1
1264: fe0558e3 bgez a0,1254 <__modsi3+0xc>
1268: 40a00533 neg a0,a0
126c: f61ff0ef jal ra,11cc <__udivsi3>
1270: 40b00533 neg a0,a1
1274: 00028067 jr t0
Disassembly of section .srodata:
00001278 <Mod>:
1278: 00fd addi ra,ra,31
...
Disassembly of section .sbss:
0000127c <judgeResult>:
127c: 0000 unimp
...
Disassembly of section .comment:
00000000 <.comment>:
0: 3a434347 fmsub.d ft6,ft6,ft4,ft7,rmm
4: 2820 fld fs0,80(s0)
6: 29554e47 fmsub.s ft8,fa0,fs5,ft5,rmm
a: 3820 fld fs0,112(s0)
c: 332e fld ft6,232(sp)
e: 302e fld ft0,232(sp)
...
Disassembly of section .debug_line:
00000000 <.debug_line>:
0: 0164 addi s1,sp,140
2: 0000 unimp
4: 0002 c.slli64 zero
6: 0045 c.nop 17
8: 0000 unimp
a: 0101 addi sp,sp,0
c: 000d0efb 0xd0efb
10: 0101 addi sp,sp,0
12: 0101 addi sp,sp,0
14: 0000 unimp
16: 0100 addi s0,sp,128
18: 0000 unimp
1a: 2e01 jal 32a <printInt-0xcd6>
1c: 2f2e fld ft10,200(sp)
1e: 2e2e fld ft8,200(sp)
20: 2f2e2e2f 0x2f2e2e2f
24: 2f2e fld ft10,200(sp)
26: 6972 flw fs2,28(sp)
28: 2d766373 csrrsi t1,0x2d7,12
2c: 2f636367 0x2f636367
30: 696c flw fa1,84(a0)
32: 6762 flw fa4,24(sp)
34: 632f6363 bltu t5,s2,65a <printInt-0x9a6>
38: 69666e6f jal t3,666ce <__heap_start+0x646ce>
3c: 69722f67 0x69722f67
40: 00766373 csrrsi t1,0x7,12
44: 6400 flw fs0,8(s0)
46: 7669 lui a2,0xffffa
48: 532e lw t1,232(sp)
4a: 0100 addi s0,sp,128
4c: 0000 unimp
4e: 0000 unimp
50: 0205 addi tp,tp,1
52: 11c4 addi s1,sp,228
54: 0000 unimp
56: 0100c403 lbu s0,16(ra)
5a: 04090103 lb sp,64(s2)
5e: 0100 addi s0,sp,128
60: 04090403 lb s0,64(s2)
64: 0100 addi s0,sp,128
66: 04090103 lb sp,64(s2)
6a: 0100 addi s0,sp,128
6c: 04090103 lb sp,64(s2)
70: 0100 addi s0,sp,128
72: 04090103 lb sp,64(s2)
76: 0100 addi s0,sp,128
78: 04090103 lb sp,64(s2)
7c: 0100 addi s0,sp,128
7e: 04090103 lb sp,64(s2)
82: 0100 addi s0,sp,128
84: 04090203 lb tp,64(s2)
88: 0100 addi s0,sp,128
8a: 04090103 lb sp,64(s2)
8e: 0100 addi s0,sp,128
90: 04090103 lb sp,64(s2)
94: 0100 addi s0,sp,128
96: 04090103 lb sp,64(s2)
9a: 0100 addi s0,sp,128
9c: 04090203 lb tp,64(s2)
a0: 0100 addi s0,sp,128
a2: 04090203 lb tp,64(s2)
a6: 0100 addi s0,sp,128
a8: 04090103 lb sp,64(s2)
ac: 0100 addi s0,sp,128
ae: 04090103 lb sp,64(s2)
b2: 0100 addi s0,sp,128
b4: 04090203 lb tp,64(s2)
b8: 0100 addi s0,sp,128
ba: 04090103 lb sp,64(s2)
be: 0100 addi s0,sp,128
c0: 04090103 lb sp,64(s2)
c4: 0100 addi s0,sp,128
c6: 04090203 lb tp,64(s2)
ca: 0100 addi s0,sp,128
cc: 04090503 lb a0,64(s2)
d0: 0100 addi s0,sp,128
d2: 04090103 lb sp,64(s2)
d6: 0100 addi s0,sp,128
d8: 04090103 lb sp,64(s2)
dc: 0100 addi s0,sp,128
de: 04090103 lb sp,64(s2)
e2: 0100 addi s0,sp,128
e4: 04090503 lb a0,64(s2)
e8: 0100 addi s0,sp,128
ea: 04090103 lb sp,64(s2)
ee: 0100 addi s0,sp,128
f0: 04090103 lb sp,64(s2)
f4: 0100 addi s0,sp,128
f6: 04090103 lb sp,64(s2)
fa: 0100 addi s0,sp,128
fc: 04090203 lb tp,64(s2)
100: 0100 addi s0,sp,128
102: 04090203 lb tp,64(s2)
106: 0100 addi s0,sp,128
108: 04090103 lb sp,64(s2)
10c: 0100 addi s0,sp,128
10e: 04090103 lb sp,64(s2)
112: 0100 addi s0,sp,128
114: 04090103 lb sp,64(s2)
118: 0100 addi s0,sp,128
11a: 04090403 lb s0,64(s2)
11e: 0100 addi s0,sp,128
120: 04090103 lb sp,64(s2)
124: 0100 addi s0,sp,128
126: 04090103 lb sp,64(s2)
12a: 0100 addi s0,sp,128
12c: 04090203 lb tp,64(s2)
130: 0100 addi s0,sp,128
132: 04090103 lb sp,64(s2)
136: 0100 addi s0,sp,128
138: 04090103 lb sp,64(s2)
13c: 0100 addi s0,sp,128
13e: 04090203 lb tp,64(s2)
142: 0100 addi s0,sp,128
144: 04090103 lb sp,64(s2)
148: 0100 addi s0,sp,128
14a: 04090203 lb tp,64(s2)
14e: 0100 addi s0,sp,128
150: 04090103 lb sp,64(s2)
154: 0100 addi s0,sp,128
156: 04090103 lb sp,64(s2)
15a: 0100 addi s0,sp,128
15c: 04090103 lb sp,64(s2)
160: 0100 addi s0,sp,128
162: 0409 addi s0,s0,2
164: 0000 unimp
166: 0101 addi sp,sp,0
Disassembly of section .debug_info:
00000000 <.debug_info>:
0: 0022 c.slli zero,0x8
2: 0000 unimp
4: 0002 c.slli64 zero
6: 0000 unimp
8: 0000 unimp
a: 0104 addi s1,sp,128
c: 0000 unimp
e: 0000 unimp
10: 11c4 addi s1,sp,228
12: 0000 unimp
14: 1278 addi a4,sp,300
16: 0000 unimp
18: 0000 unimp
1a: 0000 unimp
1c: 0000002f 0x2f
20: 0088 addi a0,sp,64
22: 0000 unimp
24: 8001 c.srli64 s0
Disassembly of section .debug_abbrev:
00000000 <.debug_abbrev>:
0: 1101 addi sp,sp,-32
2: 1000 addi s0,sp,32
4: 1106 slli sp,sp,0x21
6: 1201 addi tp,tp,-32
8: 0301 addi t1,t1,0
a: 1b0e slli s6,s6,0x23
c: 250e fld fa0,192(sp)
e: 130e slli t1,t1,0x23
10: 0005 c.nop 1
...
Disassembly of section .debug_aranges:
00000000 <.debug_aranges>:
0: 001c 0x1c
2: 0000 unimp
4: 0002 c.slli64 zero
6: 0000 unimp
8: 0000 unimp
a: 0004 0x4
c: 0000 unimp
e: 0000 unimp
10: 11c4 addi s1,sp,228
12: 0000 unimp
14: 00b4 addi a3,sp,72
...
Disassembly of section .debug_str:
00000000 <.debug_str>:
0: 2e2e fld ft8,200(sp)
2: 2f2e2e2f 0x2f2e2e2f
6: 2e2e fld ft8,200(sp)
8: 722f2e2f 0x722f2e2f
c: 7369 lui t1,0xffffa
e: 672d7663 bgeu s10,s2,67a <printInt-0x986>
12: 6c2f6363 bltu t5,sp,6d8 <printInt-0x928>
16: 6269 lui tp,0x1a
18: 2f636367 0x2f636367
1c: 666e6f63 bltu t3,t1,69a <printInt-0x966>
20: 6769 lui a4,0x1a
22: 7369722f 0x7369722f
26: 642f7663 bgeu t5,sp,672 <printInt-0x98e>
2a: 7669 lui a2,0xffffa
2c: 532e lw t1,232(sp)
2e: 2f00 fld fs0,24(a4)
30: 6f68 flw fa0,92(a4)
32: 656d lui a0,0x1b
34: 2d75772f 0x2d75772f
38: 6971 lui s2,0x1c
3a: 676e flw fa4,216(sp)
3c: 312d jal fffffc66 <__heap_start+0xffffdc66>
3e: 3735 jal ffffff6a <__heap_start+0xffffdf6a>
40: 7369722f 0x7369722f
44: 672d7663 bgeu s10,s2,6b0 <printInt-0x950>
48: 756e flw fa0,248(sp)
4a: 742d lui s0,0xfffeb
4c: 636c6f6f jal t5,c6682 <__heap_start+0xc4682>
50: 6168 flw fa0,68(a0)
52: 6e69 lui t3,0x1a
54: 6975622f 0x6975622f
58: 646c flw fa1,76(s0)
5a: 672d lui a4,0xb
5c: 6e2d6363 bltu s10,sp,742 <printInt-0x8be>
60: 7765 lui a4,0xffff9
62: 696c flw fa1,84(a0)
64: 2d62 fld fs10,24(sp)
66: 67617473 csrrci s0,0x676,2
6a: 3265 jal fffffa12 <__heap_start+0xffffda12>
6c: 7369722f 0x7369722f
70: 32337663 bgeu t1,gp,39c <printInt-0xc64>
74: 752d lui a0,0xfffeb
76: 6b6e flw fs6,216(sp)
78: 6f6e flw ft10,216(sp)
7a: 652d6e77 0x652d6e77
7e: 666c flw fa1,76(a2)
80: 62696c2f 0x62696c2f
84: 00636367 0x636367
88: 20554e47 fmsub.s ft8,fa0,ft5,ft4,rmm
8c: 5341 li t1,-16
8e: 3220 fld fs0,96(a2)
90: 332e fld ft6,232(sp)
92: 2e31 jal 3ae <printInt-0xc52>
94: 0031 c.nop 12