sysy-data/hidden_functional_c/asm/17_maximal_clique.s

360 lines
5.1 KiB
ArmAsm
Raw Permalink Normal View History

2024-06-14 13:34:46 +08:00
.text
.attribute 4, 16
.attribute 5, "rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0"
.file "17_maximal_clique.sy"
.globl is_clique
.p2align 1
.type is_clique,@function
is_clique:
mv a1, a0
li a2, 2
li a0, 1
blt a1, a2, .LBB0_8
slli a0, a1, 32
srli a7, a0, 32
li t0, 1
lui a0, %hi(store)
addi a6, a0, %lo(store)
addi t2, a6, 8
li t1, 120
lui a0, %hi(graph)
addi t3, a0, %lo(graph)
j .LBB0_3
.LBB0_2:
addi a2, a2, 1
addi t2, t2, 4
beq t0, a7, .LBB0_9
.LBB0_3:
mv a0, t0
addi t0, t0, 1
bgeu t0, a7, .LBB0_2
slli a0, a0, 2
add a0, a0, a6
lw a0, 0(a0)
mv a3, a7
mv a4, t2
.LBB0_5:
lw a5, 0(a4)
mul a1, a0, t1
slli a5, a5, 2
add a1, a1, a5
add a1, a1, t3
lw a1, 0(a1)
beqz a1, .LBB0_7
addi a3, a3, -1
addi a4, a4, 4
bne a2, a3, .LBB0_5
j .LBB0_2
.LBB0_7:
li a0, 0
.LBB0_8:
ret
.LBB0_9:
li a0, 1
ret
.Lfunc_end0:
.size is_clique, .Lfunc_end0-is_clique
.globl maxCliques
.p2align 1
.type maxCliques,@function
maxCliques:
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)
lui a0, %hi(n)
lw a6, %lo(n)(a0)
blez a6, .LBB1_15
mv s3, a1
lui a0, %hi(store)
addi s6, a0, %lo(store)
slli a0, a1, 2
add s4, a0, s6
addiw s2, a1, 1
li a0, 0
blez a1, .LBB1_17
slli a1, s2, 32
srli s7, a1, 32
li a1, 1
addi s5, s6, 8
li s10, 120
lui a2, %hi(graph)
addi s11, a2, %lo(graph)
lui s8, %hi(n)
j .LBB1_5
.LBB1_3:
lw a6, %lo(n)(s8)
.LBB1_4:
addiw a1, s9, 1
bge s9, a6, .LBB1_16
.LBB1_5:
mv s9, a1
sw a1, 0(s4)
li a1, 2
mv a2, s5
li a3, 1
j .LBB1_7
.LBB1_6:
addi a1, a1, 1
addi a2, a2, 4
mv a3, a7
beq a7, s7, .LBB1_11
.LBB1_7:
addi a7, a3, 1
bgeu a7, s7, .LBB1_6
slli a3, a3, 2
add a3, a3, s6
lw a5, 0(a3)
mv a3, a2
mv s0, s7
.LBB1_9:
lw a4, 0(a3)
mul s1, a5, s10
slli a4, a4, 2
add a4, a4, s1
add a4, a4, s11
lw a4, 0(a4)
beqz a4, .LBB1_4
addi s0, s0, -1
addi a3, a3, 4
bne a1, s0, .LBB1_9
j .LBB1_6
.LBB1_11:
sext.w a1, a0
mv s0, s3
blt a1, s3, .LBB1_13
mv s0, a0
.LBB1_13:
sext.w s1, s0
li a0, 0
mv a1, s2
call maxCliques
blt s1, a0, .LBB1_3
mv a0, s0
j .LBB1_3
.LBB1_15:
li a0, 0
.LBB1_16:
sext.w a0, a0
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
.LBB1_17:
li a1, 1
lui s5, %hi(n)
j .LBB1_19
.LBB1_18:
lw a2, %lo(n)(s5)
addiw a1, s1, 1
bge s1, a2, .LBB1_16
.LBB1_19:
mv s1, a1
sext.w a1, a0
sw s1, 0(s4)
mv s0, s3
blt a1, s3, .LBB1_21
mv s0, a0
.LBB1_21:
sext.w s6, s0
li a0, 0
mv a1, s2
call maxCliques
blt s6, a0, .LBB1_18
mv a0, s0
j .LBB1_18
.Lfunc_end1:
.size maxCliques, .Lfunc_end1-maxCliques
.globl main
.p2align 1
.type main,@function
main:
addi sp, sp, -2032
sd ra, 2024(sp)
sd s0, 2016(sp)
sd s1, 2008(sp)
sd s2, 2000(sp)
lui a0, 1
addiw a0, a0, -1280
sub sp, sp, a0
call getint
lui a1, %hi(n)
sw a0, %lo(n)(a1)
call getint
lui s2, %hi(m)
sw a0, %lo(m)(s2)
blez a0, .LBB2_6
li s1, 0
addi s0, sp, 20
.LBB2_2:
call getint
sw a0, -4(s0)
call getint
lwu a1, %lo(m)(s2)
sw a0, 0(s0)
addi s1, s1, 1
sext.w a0, a1
addi s0, s0, 8
blt s1, a0, .LBB2_2
blez a0, .LBB2_6
addi a0, sp, 20
li a6, 120
lui a3, %hi(graph)
addi a3, a3, %lo(graph)
li a4, 1
.LBB2_5:
lw a5, -4(a0)
lw s1, 0(a0)
mul s0, a5, a6
slli a2, s1, 2
add a2, a2, s0
add a2, a2, a3
sw a4, 0(a2)
mul a2, s1, a6
slli a5, a5, 2
add a2, a2, a5
add a2, a2, a3
sw a4, 0(a2)
addi a1, a1, -1
addi a0, a0, 8
bnez a1, .LBB2_5
.LBB2_6:
li a1, 1
li a0, 0
call maxCliques
call putint
li a0, 0
lui a1, 1
addiw a1, a1, -1280
add sp, sp, a1
ld ra, 2024(sp)
ld s0, 2016(sp)
ld s1, 2008(sp)
ld s2, 2000(sp)
addi sp, sp, 2032
ret
.Lfunc_end2:
.size main, .Lfunc_end2-main
.type graph,@object
.bss
.globl graph
.p2align 2
graph:
.zero 3600
.size graph, 3600
.type store,@object
.globl store
.p2align 2
store:
.zero 120
.size store, 120
.type n,@object
.section .sbss,"aw",@nobits
.globl n
.p2align 2
n:
.word 0
.size n, 4
.type m,@object
.globl m
.p2align 2
m:
.word 0
.size m, 4
.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