sysy-data/functional_c/asm/83_long_array.s

327 lines
5.0 KiB
ArmAsm

.text
.attribute 4, 16
.attribute 5, "rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0"
.file "83_long_array.sy"
.globl long_array
.p2align 1
.type long_array,@function
long_array:
addi sp, sp, -2032
sd ra, 2024(sp)
sd s0, 2016(sp)
sd s1, 2008(sp)
sd s2, 2000(sp)
sd s3, 1992(sp)
sd s4, 1984(sp)
sd s5, 1976(sp)
sd s6, 1968(sp)
sd s7, 1960(sp)
sd s8, 1952(sp)
sd s9, 1944(sp)
sd s10, 1936(sp)
sd s11, 1928(sp)
lui a1, 29
addiw a1, a1, -672
sub sp, sp, a1
sd a0, 24(sp)
li a0, 0
lui a1, 20
addiw a1, a1, -1880
add a1, a1, sp
lui a2, 838861
addiw a2, a2, -819
slli a2, a2, 32
li a3, 10
lui a4, 2
addiw a4, a4, 1808
.LBB0_1:
mulw a5, a0, a0
slli s1, a5, 32
mulhu s1, s1, a2
srli s1, s1, 35
mulw s1, s1, a3
subw a5, a5, s1
sw a5, 0(a1)
addi a0, a0, 1
addi a1, a1, 4
bne a0, a4, .LBB0_1
lui a0, 10
addiw a0, a0, -920
add a0, a0, sp
lui a1, 20
addiw a1, a1, -1880
add a1, a1, sp
lui a2, 2
addiw a2, a2, 1808
lui a3, 838861
addiw a3, a3, -819
slli a3, a3, 32
li a4, 10
.LBB0_3:
lw a5, 0(a1)
mulw a5, a5, a5
slli s1, a5, 32
mulhu s1, s1, a3
srli s1, s1, 35
mulw s1, s1, a4
subw a5, a5, s1
sw a5, 0(a0)
addi a0, a0, 4
addi a2, a2, -1
addi a1, a1, 4
bnez a2, .LBB0_3
addi a0, sp, 40
lui a1, 20
addiw a1, a1, -1880
add a1, a1, sp
lui a2, 10
addiw a2, a2, -920
add a2, a2, sp
lui a3, 2
addiw a3, a3, 1808
lui a4, 335544
addiw a4, a4, 1311
slli a4, a4, 32
li a6, 100
.LBB0_5:
lw s1, 0(a2)
mulw s1, s1, s1
slli s0, s1, 32
mulhu s0, s0, a4
lw a5, 0(a1)
srli s0, s0, 37
mulw s0, s0, a6
subw s1, s1, s0
addw a5, a5, s1
sw a5, 0(a0)
addi a0, a0, 4
addi a1, a1, 4
addi a3, a3, -1
addi a2, a2, 4
bnez a3, .LBB0_5
li s0, 0
li s1, 0
lui a0, 5
addiw a0, a0, -480
lui a1, 20
addiw a1, a1, -1880
add s3, sp, a1
add a0, a0, s3
sd a0, 32(sp)
li s5, 9
addi s6, sp, 40
lui a0, 201377
addiw s7, a0, -261
lui a0, 2
addiw s9, a0, 1808
lui a0, 1
addiw s11, a0, 904
li s2, 1117
li s8, 625
lui a0, 80533
addiw s10, a0, -1433
lui a0, 3
addiw s4, a0, 1045
lui a0, 343639
addiw a0, a0, -1555
sd a0, 16(sp)
lui a0, 24
addiw a0, a0, 1684
sd a0, 8(sp)
j .LBB0_9
.LBB0_7:
slli a0, s0, 2
add a0, a0, s6
lw a0, 0(a0)
addw a0, a0, s1
mul a1, a0, s7
srli a2, a1, 63
srai a1, a1, 40
addw a1, a1, a2
li a2, 1333
mulw a1, a1, a2
subw s1, a0, a1
.LBB0_8:
mv a0, s1
call putint
addi s0, s0, 1
beq s0, s9, .LBB0_19
.LBB0_9:
bgeu s5, s0, .LBB0_7
li a0, 19
bltu a0, s0, .LBB0_13
slli a0, s0, 2
add a0, a0, s6
lw a0, 0(a0)
mv a1, s11
ld a2, 32(sp)
.LBB0_12:
lw a3, 0(a2)
addw a4, a0, s1
subw s1, a4, a3
addi a1, a1, -1
addi a2, a2, 4
bnez a1, .LBB0_12
j .LBB0_8
.LBB0_13:
li a0, 29
bltu a0, s0, .LBB0_18
slli a1, s0, 2
add a0, s3, a1
lui a2, 10
addiw a2, a2, -920
add a2, a2, sp
add a1, a1, a2
mv a2, s11
j .LBB0_16
.LBB0_15:
lw a3, 0(a0)
slli a4, a2, 32
srli a4, a4, 30
add a4, a4, s6
lw a4, 0(a4)
addw a3, a3, s1
addw a3, a3, a4
mul a4, a3, s10
srli a5, a4, 63
srai a4, a4, 42
addw a4, a4, a5
mulw a4, a4, s4
subw s1, a3, a4
li a3, 2
addw a2, a2, a3
srliw a3, a2, 4
bgeu a3, s8, .LBB0_8
.LBB0_16:
srliw a3, a2, 1
bltu a3, s2, .LBB0_15
lw a3, 0(a1)
slli a4, a2, 32
srli a4, a4, 30
add a4, a4, s3
lw a4, 0(a4)
addw a3, a3, s1
subw s1, a3, a4
li a3, 1
addw a2, a2, a3
srliw a3, a2, 4
bltu a3, s8, .LBB0_16
j .LBB0_8
.LBB0_18:
slli a0, s0, 2
add a0, a0, s6
lw a0, 0(a0)
ld a1, 24(sp)
mulw a0, a0, a1
addw a0, a0, s1
ld a1, 16(sp)
mul a1, a0, a1
srli a2, a1, 63
srai a1, a1, 47
addw a1, a1, a2
ld a2, 8(sp)
mulw a1, a1, a2
subw s1, a0, a1
addi s0, s0, 1
bne s0, s9, .LBB0_9
.LBB0_19:
mv a0, s1
lui a1, 29
addiw a1, a1, -672
add sp, sp, a1
ld ra, 2024(sp)
ld s0, 2016(sp)
ld s1, 2008(sp)
ld s2, 2000(sp)
ld s3, 1992(sp)
ld s4, 1984(sp)
ld s5, 1976(sp)
ld s6, 1968(sp)
ld s7, 1960(sp)
ld s8, 1952(sp)
ld s9, 1944(sp)
ld s10, 1936(sp)
ld s11, 1928(sp)
addi sp, sp, 2032
ret
.Lfunc_end0:
.size long_array, .Lfunc_end0-long_array
.globl main
.p2align 1
.type main,@function
main:
li a0, 9
tail long_array
.Lfunc_end1:
.size main, .Lfunc_end1-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