sysy-data/functional_c/asm/67_reverse_output.s

179 lines
2.6 KiB
ArmAsm

.file "67_reverse_output.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 reverse
.type reverse, @function
reverse:
addi sp,sp,-64
sd ra,56(sp)
sd s0,48(sp)
sd s1,40(sp)
sd s2,32(sp)
sd s3,24(sp)
sd s4,16(sp)
sd s5,8(sp)
li a5,1
ble a0,a5,.L14
mv s0,a0
call getint@plt
li a5,2
mv s1,a0
beq s0,a5,.L15
call getint@plt
li a5,3
mv s2,a0
beq s0,a5,.L16
call getint@plt
li a5,4
mv s3,a0
beq s0,a5,.L17
call getint@plt
li a5,5
mv s4,a0
beq s0,a5,.L18
call getint@plt
mv s5,a0
addiw a0,s0,-5
call reverse
mv a0,s5
call putint@plt
.L10:
mv a0,s4
call putint@plt
.L8:
mv a0,s3
call putint@plt
.L6:
mv a0,s2
call putint@plt
.L4:
mv a0,s1
.L12:
ld s0,48(sp)
ld ra,56(sp)
ld s1,40(sp)
ld s2,32(sp)
ld s3,24(sp)
ld s4,16(sp)
ld s5,8(sp)
addi sp,sp,64
tail putint@plt
.L15:
call getint@plt
call putint@plt
j .L4
.L14:
call getint@plt
j .L12
.L17:
call getint@plt
call putint@plt
j .L8
.L16:
call getint@plt
call putint@plt
j .L6
.L18:
call getint@plt
call putint@plt
j .L10
.size reverse, .-reverse
.section .text.startup,"ax",@progbits
.align 1
.globl main
.type main, @function
main:
addi sp,sp,-48
sd ra,40(sp)
sd s0,32(sp)
sd s1,24(sp)
sd s2,16(sp)
sd s3,8(sp)
sd s4,0(sp)
call getint@plt
mv s0,a0
call getint@plt
mv s1,a0
call getint@plt
mv s2,a0
call getint@plt
mv s3,a0
call getint@plt
mv s4,a0
li a0,195
call reverse
mv a0,s4
call putint@plt
mv a0,s3
call putint@plt
mv a0,s2
call putint@plt
mv a0,s1
call putint@plt
mv a0,s0
call putint@plt
ld ra,40(sp)
ld s0,32(sp)
ld s1,24(sp)
ld s2,16(sp)
ld s3,8(sp)
ld s4,0(sp)
li a0,0
addi sp,sp,48
jr ra
.size main, .-main
.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
.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