531 lines
6.9 KiB
ArmAsm
531 lines
6.9 KiB
ArmAsm
.file "28_side_effect2.sy"
|
|
.option pic
|
|
.attribute arch, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
|
|
.attribute unaligned_access, 0
|
|
.attribute stack_align, 16
|
|
.text
|
|
.align 1
|
|
.globl f
|
|
.type f, @function
|
|
f:
|
|
lla a4,.LANCHOR0
|
|
lw a3,0(a4)
|
|
mv a5,a0
|
|
addiw a3,a3,1
|
|
sw a3,0(a4)
|
|
bge a0,a1,.L4
|
|
li a3,19
|
|
li a0,0
|
|
bgt a5,a3,.L2
|
|
slli a3,a5,2
|
|
add a3,a4,a3
|
|
li a2,1
|
|
sw a2,8(a3)
|
|
beq a5,zero,.L6
|
|
addiw a5,a5,-1
|
|
slli a5,a5,2
|
|
add a4,a4,a5
|
|
.L6:
|
|
lw a0,8(a4)
|
|
ret
|
|
.L4:
|
|
li a0,0
|
|
.L2:
|
|
ret
|
|
.size f, .-f
|
|
.align 1
|
|
.globl g
|
|
.type g, @function
|
|
g:
|
|
lla a4,.LANCHOR0
|
|
lw a3,0(a4)
|
|
mv a5,a0
|
|
addiw a3,a3,2
|
|
sw a3,0(a4)
|
|
bge a0,a1,.L11
|
|
li a3,19
|
|
li a0,1
|
|
bgt a5,a3,.L9
|
|
slli a3,a5,2
|
|
add a3,a4,a3
|
|
sw zero,8(a3)
|
|
beq a5,zero,.L13
|
|
addiw a5,a5,-1
|
|
slli a5,a5,2
|
|
add a4,a4,a5
|
|
.L13:
|
|
lw a0,8(a4)
|
|
ret
|
|
.L11:
|
|
li a0,1
|
|
.L9:
|
|
ret
|
|
.size g, .-g
|
|
.align 1
|
|
.globl h
|
|
.type h, @function
|
|
h:
|
|
lla a5,.LANCHOR0
|
|
lw a4,0(a5)
|
|
addiw a4,a4,3
|
|
sw a4,0(a5)
|
|
li a4,19
|
|
bgtu a0,a4,.L16
|
|
slli a0,a0,2
|
|
add a5,a5,a0
|
|
lw a0,8(a5)
|
|
ret
|
|
.L16:
|
|
li a0,0
|
|
ret
|
|
.size h, .-h
|
|
.section .text.startup,"ax",@progbits
|
|
.align 1
|
|
.globl main
|
|
.type main, @function
|
|
main:
|
|
lla a2,.LANCHOR0
|
|
lw a5,0(a2)
|
|
addi sp,sp,-16
|
|
sd ra,8(sp)
|
|
li a4,2
|
|
li a3,2
|
|
addiw a5,a5,3
|
|
li a1,3
|
|
.L18:
|
|
bne a4,a3,.L19
|
|
addiw a5,a5,3
|
|
li a4,3
|
|
.L19:
|
|
beq a4,a1,.L113
|
|
li a0,4
|
|
beq a4,a0,.L114
|
|
li a0,5
|
|
beq a4,a0,.L115
|
|
li a0,6
|
|
beq a4,a0,.L116
|
|
li a0,7
|
|
beq a4,a0,.L117
|
|
li a0,8
|
|
beq a4,a0,.L118
|
|
li a0,9
|
|
beq a4,a0,.L119
|
|
li a0,10
|
|
beq a4,a0,.L120
|
|
li a0,11
|
|
beq a4,a0,.L121
|
|
li a0,12
|
|
beq a4,a0,.L122
|
|
li a0,13
|
|
beq a4,a0,.L123
|
|
li a0,14
|
|
beq a4,a0,.L124
|
|
li a0,15
|
|
beq a4,a0,.L125
|
|
li a0,16
|
|
beq a4,a0,.L126
|
|
li a0,17
|
|
beq a4,a0,.L127
|
|
li a0,18
|
|
beq a4,a0,.L128
|
|
addiw a5,a5,22
|
|
li a4,1
|
|
li a3,1
|
|
.L37:
|
|
beq a4,a3,.L129
|
|
li a1,2
|
|
beq a4,a1,.L130
|
|
li a1,3
|
|
beq a4,a1,.L131
|
|
sw zero,.LANCHOR0+20,a1
|
|
li a1,4
|
|
beq a4,a1,.L132
|
|
sw zero,.LANCHOR0+24,a1
|
|
li a1,5
|
|
beq a4,a1,.L133
|
|
sw zero,.LANCHOR0+28,a1
|
|
li a1,6
|
|
beq a4,a1,.L134
|
|
sw zero,.LANCHOR0+32,a1
|
|
li a1,7
|
|
beq a4,a1,.L135
|
|
sw zero,.LANCHOR0+36,a1
|
|
li a1,8
|
|
beq a4,a1,.L136
|
|
sw zero,.LANCHOR0+40,a1
|
|
li a1,9
|
|
beq a4,a1,.L137
|
|
sw zero,.LANCHOR0+44,a1
|
|
li a1,10
|
|
beq a4,a1,.L138
|
|
sw zero,.LANCHOR0+48,a1
|
|
li a1,11
|
|
beq a4,a1,.L139
|
|
sw zero,.LANCHOR0+52,a1
|
|
li a1,12
|
|
beq a4,a1,.L140
|
|
sw zero,.LANCHOR0+56,a1
|
|
li a1,13
|
|
beq a4,a1,.L141
|
|
sw zero,.LANCHOR0+60,a1
|
|
li a1,14
|
|
beq a4,a1,.L142
|
|
sw zero,.LANCHOR0+64,a1
|
|
li a1,15
|
|
beq a4,a1,.L143
|
|
sw zero,.LANCHOR0+68,a1
|
|
li a1,16
|
|
beq a4,a1,.L144
|
|
sw zero,.LANCHOR0+72,a1
|
|
li a1,17
|
|
beq a4,a1,.L145
|
|
sw zero,.LANCHOR0+76,a1
|
|
li a1,18
|
|
beq a4,a1,.L146
|
|
sw zero,.LANCHOR0+80,a4
|
|
sd zero,.LANCHOR0+8,a4
|
|
sw zero,.LANCHOR0+16,a4
|
|
addiw a7,a5,40
|
|
lla a4,.LANCHOR0+8
|
|
li a3,0
|
|
li a0,1
|
|
addiw a5,a5,41
|
|
li t1,19
|
|
.L57:
|
|
sw a0,0(a4)
|
|
addw a1,a7,a3
|
|
bne a3,zero,.L59
|
|
lw a1,8(a2)
|
|
addi a4,a4,4
|
|
li a3,1
|
|
beq a1,zero,.L60
|
|
sw a0,0(a4)
|
|
mv a1,a5
|
|
.L59:
|
|
lw a6,-4(a4)
|
|
addiw a3,a3,1
|
|
addi a4,a4,4
|
|
beq a6,zero,.L58
|
|
bne a3,t1,.L57
|
|
.L58:
|
|
lw a5,8(a2)
|
|
addiw a4,a1,4
|
|
sw a4,0(a2)
|
|
beq a5,zero,.L65
|
|
lw a4,12(a2)
|
|
addiw a1,a1,7
|
|
sw a1,0(a2)
|
|
bne a4,zero,.L66
|
|
.L65:
|
|
lw a4,0(a2)
|
|
lw a3,16(a2)
|
|
addiw a1,a4,3
|
|
sw a1,0(a2)
|
|
beq a3,zero,.L66
|
|
addiw a4,a4,6
|
|
sw a4,0(a2)
|
|
.L66:
|
|
lw a4,0(a2)
|
|
lw a3,24(a2)
|
|
addiw a1,a4,3
|
|
sw a1,0(a2)
|
|
beq a3,zero,.L68
|
|
lw a1,28(a2)
|
|
addiw a0,a4,6
|
|
sw a0,0(a2)
|
|
beq a1,zero,.L70
|
|
lw a1,32(a2)
|
|
addiw a0,a4,9
|
|
sw a0,0(a2)
|
|
bne a1,zero,.L70
|
|
lw a1,36(a2)
|
|
addiw a4,a4,12
|
|
sw a4,0(a2)
|
|
bne a1,zero,.L68
|
|
.L70:
|
|
lw a4,0(a2)
|
|
addiw a4,a4,3
|
|
sw a4,0(a2)
|
|
.L68:
|
|
lw a4,0(a2)
|
|
lw a1,44(a2)
|
|
addiw a0,a4,3
|
|
sw a0,0(a2)
|
|
beq a1,zero,.L75
|
|
lw a1,48(a2)
|
|
addiw a4,a4,6
|
|
sw a4,0(a2)
|
|
beq a1,zero,.L76
|
|
.L75:
|
|
lw a4,0(a2)
|
|
lw a1,52(a2)
|
|
addiw a0,a4,3
|
|
sw a0,0(a2)
|
|
beq a1,zero,.L76
|
|
lw a1,56(a2)
|
|
addiw a0,a4,6
|
|
sw a0,0(a2)
|
|
beq a1,zero,.L76
|
|
lw a1,60(a2)
|
|
addiw a0,a4,9
|
|
sw a0,0(a2)
|
|
beq a1,zero,.L76
|
|
lw a1,64(a2)
|
|
addiw a0,a4,12
|
|
sw a0,0(a2)
|
|
beq a1,zero,.L76
|
|
addiw a4,a4,15
|
|
sw a4,0(a2)
|
|
.L76:
|
|
lw a4,0(a2)
|
|
bne a5,zero,.L77
|
|
addiw a4,a4,3
|
|
sw a4,0(a2)
|
|
.L80:
|
|
lw a5,0(a2)
|
|
lw a4,28(a2)
|
|
addiw a3,a5,3
|
|
sw a3,0(a2)
|
|
bne a4,zero,.L78
|
|
lw a4,32(a2)
|
|
addiw a3,a5,6
|
|
sw a3,0(a2)
|
|
beq a4,zero,.L83
|
|
lw a4,36(a2)
|
|
addiw a5,a5,9
|
|
sw a5,0(a2)
|
|
beq a4,zero,.L78
|
|
.L83:
|
|
lw a4,0(a2)
|
|
lw a5,40(a2)
|
|
addiw a4,a4,3
|
|
sw a4,0(a2)
|
|
snez a5,a5
|
|
.L81:
|
|
lw a0,0(a2)
|
|
addw a0,a0,a5
|
|
call putint@plt
|
|
ld ra,8(sp)
|
|
li a0,0
|
|
addi sp,sp,16
|
|
jr ra
|
|
.L113:
|
|
addiw a5,a5,4
|
|
li a4,4
|
|
j .L18
|
|
.L114:
|
|
addiw a5,a5,5
|
|
li a4,5
|
|
j .L18
|
|
.L115:
|
|
addiw a5,a5,6
|
|
li a4,6
|
|
j .L18
|
|
.L116:
|
|
addiw a5,a5,7
|
|
li a4,7
|
|
j .L18
|
|
.L129:
|
|
addiw a5,a5,4
|
|
li a4,2
|
|
j .L37
|
|
.L130:
|
|
addiw a5,a5,6
|
|
li a4,3
|
|
j .L37
|
|
.L77:
|
|
lw a5,16(a2)
|
|
addiw a1,a4,6
|
|
sw a1,0(a2)
|
|
beq a5,zero,.L80
|
|
lw a5,20(a2)
|
|
addiw a1,a4,9
|
|
sw a1,0(a2)
|
|
bne a5,zero,.L80
|
|
addiw a4,a4,12
|
|
sw a4,0(a2)
|
|
bne a3,zero,.L80
|
|
.L78:
|
|
li a5,1
|
|
j .L81
|
|
.L131:
|
|
addiw a5,a5,8
|
|
li a4,4
|
|
j .L37
|
|
.L60:
|
|
addiw a7,a7,4
|
|
sw a7,0(a2)
|
|
mv a5,a1
|
|
j .L65
|
|
.L132:
|
|
addiw a5,a5,10
|
|
li a4,5
|
|
j .L37
|
|
.L133:
|
|
addiw a5,a5,12
|
|
li a4,6
|
|
j .L37
|
|
.L134:
|
|
addiw a5,a5,14
|
|
li a4,7
|
|
j .L37
|
|
.L117:
|
|
addiw a5,a5,8
|
|
li a4,8
|
|
j .L18
|
|
.L135:
|
|
addiw a5,a5,16
|
|
li a4,8
|
|
j .L37
|
|
.L118:
|
|
addiw a5,a5,9
|
|
li a4,9
|
|
j .L18
|
|
.L136:
|
|
addiw a5,a5,18
|
|
li a4,9
|
|
j .L37
|
|
.L119:
|
|
addiw a5,a5,10
|
|
li a4,10
|
|
j .L18
|
|
.L128:
|
|
addiw a5,a5,19
|
|
li a4,19
|
|
j .L18
|
|
.L138:
|
|
addiw a5,a5,22
|
|
li a4,11
|
|
j .L37
|
|
.L137:
|
|
addiw a5,a5,20
|
|
li a4,10
|
|
j .L37
|
|
.L127:
|
|
addiw a5,a5,18
|
|
li a4,18
|
|
j .L18
|
|
.L126:
|
|
addiw a5,a5,17
|
|
li a4,17
|
|
j .L18
|
|
.L125:
|
|
addiw a5,a5,16
|
|
li a4,16
|
|
j .L18
|
|
.L124:
|
|
addiw a5,a5,15
|
|
li a4,15
|
|
j .L18
|
|
.L123:
|
|
addiw a5,a5,14
|
|
li a4,14
|
|
j .L18
|
|
.L122:
|
|
addiw a5,a5,13
|
|
li a4,13
|
|
j .L18
|
|
.L121:
|
|
addiw a5,a5,12
|
|
li a4,12
|
|
j .L18
|
|
.L120:
|
|
addiw a5,a5,11
|
|
li a4,11
|
|
j .L18
|
|
.L146:
|
|
addiw a5,a5,38
|
|
li a4,19
|
|
j .L37
|
|
.L145:
|
|
addiw a5,a5,36
|
|
li a4,18
|
|
j .L37
|
|
.L144:
|
|
addiw a5,a5,34
|
|
li a4,17
|
|
j .L37
|
|
.L143:
|
|
addiw a5,a5,32
|
|
li a4,16
|
|
j .L37
|
|
.L142:
|
|
addiw a5,a5,30
|
|
li a4,15
|
|
j .L37
|
|
.L141:
|
|
addiw a5,a5,28
|
|
li a4,14
|
|
j .L37
|
|
.L140:
|
|
addiw a5,a5,26
|
|
li a4,13
|
|
j .L37
|
|
.L139:
|
|
addiw a5,a5,24
|
|
li a4,12
|
|
j .L37
|
|
.size main, .-main
|
|
.globl array
|
|
.globl sum
|
|
.globl _sysy_idx
|
|
.globl _sysy_us
|
|
.globl _sysy_s
|
|
.globl _sysy_m
|
|
.globl _sysy_h
|
|
.globl _sysy_l2
|
|
.globl _sysy_l1
|
|
.globl _sysy_end
|
|
.globl _sysy_start
|
|
.bss
|
|
.align 3
|
|
.set .LANCHOR0,. + 0
|
|
.type sum, @object
|
|
.size sum, 4
|
|
sum:
|
|
.zero 4
|
|
.zero 4
|
|
.type array, @object
|
|
.size array, 80
|
|
array:
|
|
.zero 80
|
|
.type _sysy_idx, @object
|
|
.size _sysy_idx, 4
|
|
_sysy_idx:
|
|
.zero 4
|
|
.zero 4
|
|
.type _sysy_us, @object
|
|
.size _sysy_us, 4096
|
|
_sysy_us:
|
|
.zero 4096
|
|
.type _sysy_s, @object
|
|
.size _sysy_s, 4096
|
|
_sysy_s:
|
|
.zero 4096
|
|
.type _sysy_m, @object
|
|
.size _sysy_m, 4096
|
|
_sysy_m:
|
|
.zero 4096
|
|
.type _sysy_h, @object
|
|
.size _sysy_h, 4096
|
|
_sysy_h:
|
|
.zero 4096
|
|
.type _sysy_l2, @object
|
|
.size _sysy_l2, 4096
|
|
_sysy_l2:
|
|
.zero 4096
|
|
.type _sysy_l1, @object
|
|
.size _sysy_l1, 4096
|
|
_sysy_l1:
|
|
.zero 4096
|
|
.type _sysy_end, @object
|
|
.size _sysy_end, 16
|
|
_sysy_end:
|
|
.zero 16
|
|
.type _sysy_start, @object
|
|
.size _sysy_start, 16
|
|
_sysy_start:
|
|
.zero 16
|
|
.ident "GCC: (Debian 12.2.0-13) 12.2.0"
|
|
.section .note.GNU-stack,"",@progbits
|