sysy-data/functional_c/asm/93_nested_calls.s

282 lines
4.0 KiB
ArmAsm

.text
.attribute 4, 16
.attribute 5, "rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0"
.file "93_nested_calls.sy"
.globl func1
.p2align 1
.type func1,@function
func1:
subw a1, a1, a2
mulw a0, a1, a0
ret
.Lfunc_end0:
.size func1, .Lfunc_end0-func1
.globl func2
.p2align 1
.type func2,@function
func2:
beqz a1, .LBB1_2
remw a0, a0, a1
.LBB1_2:
ret
.Lfunc_end1:
.size func2, .Lfunc_end1-func2
.globl func3
.p2align 1
.type func3,@function
func3:
addw a0, a0, a1
addiw a0, a0, 1
ret
.Lfunc_end2:
.size func3, .Lfunc_end2-func3
.globl func4
.p2align 1
.type func4,@function
func4:
beqz a0, .LBB3_2
mv a2, a1
.LBB3_2:
mv a0, a2
ret
.Lfunc_end3:
.size func4, .Lfunc_end3-func4
.globl func5
.p2align 1
.type func5,@function
func5:
negw a0, a0
ret
.Lfunc_end4:
.size func5, .Lfunc_end4-func5
.globl func6
.p2align 1
.type func6,@function
func6:
snez a0, a0
snez a1, a1
and a0, a0, a1
ret
.Lfunc_end5:
.size func6, .Lfunc_end5-func6
.globl func7
.p2align 1
.type func7,@function
func7:
seqz a0, a0
ret
.Lfunc_end6:
.size func7, .Lfunc_end6-func7
.globl main
.p2align 1
.type main,@function
main:
addi sp, sp, -112
sd ra, 104(sp)
sd s0, 96(sp)
sd s1, 88(sp)
sd s2, 80(sp)
sd s3, 72(sp)
sd s4, 64(sp)
sd s5, 56(sp)
sd s6, 48(sp)
sd s7, 40(sp)
sd s8, 32(sp)
sd s9, 24(sp)
sd s10, 16(sp)
sd s11, 8(sp)
call getint
mv s4, a0
call getint
mv s1, a0
call getint
mv s2, a0
call getint
mv s11, a0
call getint
sd a0, 0(sp)
call getint
mv s7, a0
call getint
mv s6, a0
call getint
mv s3, a0
call getint
mv s5, a0
call getint
mv s10, a0
call getint
mv s0, a0
call getint
mv s8, a0
call getint
mv s9, a0
call getint
seqz a1, s4
snez a2, s1
and a1, a1, a2
beqz s2, .LBB7_2
remw a1, a1, s2
.LBB7_2:
li a2, 0
bnez s10, .LBB7_8
bnez s7, .LBB7_9
.LBB7_4:
not a3, a1
addw a1, s0, a2
addiw a1, a1, 1
beqz s8, .LBB7_6
.LBB7_5:
remw a1, a1, s8
.LBB7_6:
seqz a2, s2
beq s11, a3, .LBB7_10
ld a3, 0(sp)
mv a1, a3
addw a2, a2, s11
addiw a2, a2, 1
bnez a2, .LBB7_11
j .LBB7_12
.LBB7_8:
mv a2, s5
beqz s7, .LBB7_4
.LBB7_9:
seqz a2, s3
snez a3, s6
and a2, a2, a3
not a3, a1
addw a1, s0, a2
addiw a1, a1, 1
bnez s8, .LBB7_5
j .LBB7_6
.LBB7_10:
seqz a3, a0
subw a4, s9, s4
addw a3, a3, a4
addiw a3, a3, 1
mulw a1, a3, a1
ld a3, 0(sp)
addw a2, a2, s11
addiw a2, a2, 1
beqz a2, .LBB7_12
.LBB7_11:
remw s1, s1, a2
.LBB7_12:
addw a1, a1, s1
addiw a1, a1, 1
subw a2, a3, s7
mulw a1, a1, a2
beqz s6, .LBB7_14
remw a1, a1, s6
.LBB7_14:
subw a2, s5, s10
addiw a2, a2, 1
beqz s0, .LBB7_16
negw a3, s0
remw a2, a2, a3
.LBB7_16:
seqz a3, s9
subw a3, s8, a3
mulw a2, a2, a3
beqz a0, .LBB7_18
negw a0, a0
remw a2, a2, a0
.LBB7_18:
not a0, s4
addw a0, s3, a0
subw a0, a0, a2
mulw a0, a0, a1
ld ra, 104(sp)
ld s0, 96(sp)
ld s1, 88(sp)
ld s2, 80(sp)
ld s3, 72(sp)
ld s4, 64(sp)
ld s5, 56(sp)
ld s6, 48(sp)
ld s7, 40(sp)
ld s8, 32(sp)
ld s9, 24(sp)
ld s10, 16(sp)
ld s11, 8(sp)
addi sp, sp, 112
ret
.Lfunc_end7:
.size main, .Lfunc_end7-main
.type _sysy_start,@object
.bss
.globl _sysy_start
.p2align 3
_sysy_start:
.zero 16
.size _sysy_start, 16
.type _sysy_end,@object
.globl _sysy_end
.p2align 3
_sysy_end:
.zero 16
.size _sysy_end, 16
.type _sysy_l1,@object
.globl _sysy_l1
.p2align 2
_sysy_l1:
.zero 4096
.size _sysy_l1, 4096
.type _sysy_l2,@object
.globl _sysy_l2
.p2align 2
_sysy_l2:
.zero 4096
.size _sysy_l2, 4096
.type _sysy_h,@object
.globl _sysy_h
.p2align 2
_sysy_h:
.zero 4096
.size _sysy_h, 4096
.type _sysy_m,@object
.globl _sysy_m
.p2align 2
_sysy_m:
.zero 4096
.size _sysy_m, 4096
.type _sysy_s,@object
.globl _sysy_s
.p2align 2
_sysy_s:
.zero 4096
.size _sysy_s, 4096
.type _sysy_us,@object
.globl _sysy_us
.p2align 2
_sysy_us:
.zero 4096
.size _sysy_us, 4096
.type _sysy_idx,@object
.section .sbss,"aw",@nobits
.globl _sysy_idx
.p2align 2
_sysy_idx:
.word 0
.size _sysy_idx, 4
.ident "Debian clang version 14.0.6"
.section ".note.GNU-stack","",@progbits
.addrsig