sysy-data/functional_c/asm/63_big_int_mul.s

287 lines
4.0 KiB
ArmAsm

.text
.attribute 4, 16
.attribute 5, "rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0"
.file "63_big_int_mul.sy"
.globl main
.p2align 1
.type main,@function
main:
addi sp, sp, -400
sd ra, 392(sp)
sd s0, 384(sp)
sd s1, 376(sp)
sd s2, 368(sp)
sd s3, 360(sp)
lui a0, %hi(.L__const.main.mult1)
addi a1, a0, %lo(.L__const.main.mult1)
addi a0, sp, 260
li a2, 80
call memcpy@plt
lui a0, %hi(.L__const.main.mult2)
addi a1, a0, %lo(.L__const.main.mult2)
addi a0, sp, 160
li a2, 80
addi s2, sp, 160
call memcpy@plt
mv a0, sp
li a2, 160
mv s3, sp
li a1, 0
call memset@plt
li a0, 39
li a5, 19
addi a7, sp, 336
li t0, 10
lui a1, 838861
addiw a1, a1, -819
slli t1, a1, 32
li a4, -80
j .LBB0_2
.LBB0_1:
addi a5, a6, -1
beqz a6, .LBB0_6
.LBB0_2:
li s0, 0
mv a6, a5
slli a1, a5, 2
add a1, a1, s2
lw a5, 0(a1)
sext.w a1, a0
addi a0, a1, 19
slli a1, a1, 2
add s1, s3, a1
j .LBB0_4
.LBB0_3:
addi s0, s0, -4
addi a0, a0, -1
beq s0, a4, .LBB0_1
.LBB0_4:
add a1, s1, s0
add a2, a7, s0
lw a2, 0(a2)
lw a3, 0(a1)
mulw a2, a2, a5
addw a2, a2, a3
sw a2, 0(a1)
blt a2, t0, .LBB0_3
lw a3, -4(a1)
slli a2, a2, 32
mulhu a2, a2, t1
srli a2, a2, 35
addw a2, a2, a3
sw a2, -4(a1)
j .LBB0_3
.LBB0_6:
lw a0, 0(sp)
beqz a0, .LBB0_8
call putint
.LBB0_8:
lw a0, 4(sp)
call putint
lw a0, 8(sp)
call putint
lw a0, 12(sp)
call putint
lw a0, 16(sp)
call putint
lw a0, 20(sp)
call putint
lw a0, 24(sp)
call putint
lw a0, 28(sp)
call putint
lw a0, 32(sp)
call putint
lw a0, 36(sp)
call putint
lw a0, 40(sp)
call putint
lw a0, 44(sp)
call putint
lw a0, 48(sp)
call putint
lw a0, 52(sp)
call putint
lw a0, 56(sp)
call putint
lw a0, 60(sp)
call putint
lw a0, 64(sp)
call putint
lw a0, 68(sp)
call putint
lw a0, 72(sp)
call putint
lw a0, 76(sp)
call putint
lw a0, 80(sp)
call putint
lw a0, 84(sp)
call putint
lw a0, 88(sp)
call putint
lw a0, 92(sp)
call putint
lw a0, 96(sp)
call putint
lw a0, 100(sp)
call putint
lw a0, 104(sp)
call putint
lw a0, 108(sp)
call putint
lw a0, 112(sp)
call putint
lw a0, 116(sp)
call putint
lw a0, 120(sp)
call putint
lw a0, 124(sp)
call putint
lw a0, 128(sp)
call putint
lw a0, 132(sp)
call putint
lw a0, 136(sp)
call putint
lw a0, 140(sp)
call putint
lw a0, 144(sp)
call putint
lw a0, 148(sp)
call putint
lw a0, 152(sp)
call putint
lw a0, 156(sp)
call putint
li a0, 0
ld ra, 392(sp)
ld s0, 384(sp)
ld s1, 376(sp)
ld s2, 368(sp)
ld s3, 360(sp)
addi sp, sp, 400
ret
.Lfunc_end0:
.size main, .Lfunc_end0-main
.type .L__const.main.mult1,@object
.section .rodata,"a",@progbits
.p2align 2
.L__const.main.mult1:
.word 1
.word 2
.word 3
.word 4
.word 5
.word 6
.word 7
.word 8
.word 9
.word 0
.word 1
.word 2
.word 3
.word 4
.word 5
.word 6
.word 7
.word 8
.word 9
.word 0
.size .L__const.main.mult1, 80
.type .L__const.main.mult2,@object
.p2align 2
.L__const.main.mult2:
.word 2
.word 3
.word 4
.word 2
.word 5
.word 7
.word 9
.word 9
.word 0
.word 1
.word 9
.word 8
.word 7
.word 6
.word 4
.word 3
.word 2
.word 1
.word 2
.word 2
.size .L__const.main.mult2, 80
.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