You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

312 lines
5.7 KiB

.data
.globl N
.p2align 2
N:
.word 10000
.text
.globl long_array
.p2align 2
long_array:
.L.long_array.0:
stp x29, x30, [sp, #-16]!
mov x29, sp
movz x13, #54512
movk x13, #1, lsl #16
sub sp, sp, x13
stp x21, x20, [sp, #0]
str x19, [sp, #16]
mov w19, w0
mov w8, #0
mov w9, w8
.L.long_array.1:
mov w8, #10000
cmp w9, w8
b.lt .L.long_array.2
b .L.long_array.3
.L.long_array.2:
mul w8, w9, w9
mov w10, #10
sdiv w14, w8, w10
msub w8, w14, w10, w8
movz x13, #40000
sub x10, x29, x13
sxtw x11, w9
lsl x11, x11, #2
add x10, x10, x11
str w8, [x10]
mov w8, #1
add w8, w9, w8
mov w9, w8
b .L.long_array.1
.L.long_array.3:
mov w8, #0
mov w11, w8
.L.long_array.4:
mov w8, #10000
cmp w11, w8
b.lt .L.long_array.5
b .L.long_array.6
.L.long_array.5:
movz x13, #40000
sub x8, x29, x13
sxtw x9, w11
lsl x9, x9, #2
add x9, x8, x9
ldr w9, [x9]
sxtw x10, w11
lsl x10, x10, #2
add x8, x8, x10
ldr w8, [x8]
mul w8, w9, w8
mov w9, #10
sdiv w14, w8, w9
msub w8, w14, w9, w8
movz x13, #14464
movk x13, #1, lsl #16
sub x9, x29, x13
sxtw x10, w11
lsl x10, x10, #2
add x9, x9, x10
str w8, [x9]
mov w8, #1
add w8, w11, w8
mov w11, w8
b .L.long_array.4
.L.long_array.6:
mov w8, #0
mov w11, w8
.L.long_array.7:
mov w8, #10000
cmp w11, w8
b.lt .L.long_array.8
b .L.long_array.9
.L.long_array.8:
movz x13, #14464
movk x13, #1, lsl #16
sub x8, x29, x13
sxtw x9, w11
lsl x9, x9, #2
add x9, x8, x9
ldr w9, [x9]
sxtw x10, w11
lsl x10, x10, #2
add x8, x8, x10
ldr w8, [x8]
mul w8, w9, w8
mov w9, #100
sdiv w14, w8, w9
msub w8, w14, w9, w8
movz x13, #40000
sub x9, x29, x13
sxtw x10, w11
lsl x10, x10, #2
add x9, x9, x10
ldr w9, [x9]
add w8, w8, w9
movz x13, #54464
movk x13, #1, lsl #16
sub x9, x29, x13
sxtw x10, w11
lsl x10, x10, #2
add x9, x9, x10
str w8, [x9]
mov w8, #1
add w8, w11, w8
mov w11, w8
b .L.long_array.7
.L.long_array.9:
mov w8, #0
mov w11, w8
mov w20, w8
.L.long_array.10:
mov w8, #10000
cmp w20, w8
b.lt .L.long_array.11
b .L.long_array.12
.L.long_array.11:
mov w8, #10
cmp w20, w8
b.lt .L.long_array.13
b .L.long_array.14
.L.long_array.12:
mov w0, w11
ldp x21, x20, [sp, #0]
ldr x19, [sp, #16]
movz x13, #54512
movk x13, #1, lsl #16
add sp, sp, x13
ldp x29, x30, [sp], #16
ret
.L.long_array.13:
movz x13, #54464
movk x13, #1, lsl #16
sub x8, x29, x13
sxtw x9, w20
lsl x9, x9, #2
add x8, x8, x9
ldr w8, [x8]
add w8, w11, w8
mov w9, #1333
sdiv w14, w8, w9
msub w21, w14, w9, w8
mov w0, w21
bl putint
mov w10, w21
mov w8, w20
b .L.long_array.15
.L.long_array.14:
mov w8, #20
cmp w20, w8
b.lt .L.long_array.16
b .L.long_array.17
.L.long_array.15:
mov w9, #1
add w8, w8, w9
mov w11, w10
mov w20, w8
b .L.long_array.10
.L.long_array.16:
mov w8, #5000
mov w12, w8
mov w21, w11
b .L.long_array.19
.L.long_array.17:
mov w8, #30
cmp w20, w8
b.lt .L.long_array.22
b .L.long_array.23
.L.long_array.18:
mov w10, w8
mov w8, w9
b .L.long_array.15
.L.long_array.19:
mov w8, #10000
cmp w12, w8
b.lt .L.long_array.20
b .L.long_array.21
.L.long_array.20:
movz x13, #54464
movk x13, #1, lsl #16
sub x8, x29, x13
sxtw x9, w20
lsl x9, x9, #2
add x8, x8, x9
ldr w8, [x8]
add w9, w21, w8
movz x13, #40000
sub x8, x29, x13
sxtw x10, w12
lsl x10, x10, #2
add x8, x8, x10
ldr w8, [x8]
sub w9, w9, w8
mov w8, #1
add w8, w12, w8
mov w12, w8
mov w21, w9
b .L.long_array.19
.L.long_array.21:
mov w0, w21
bl putint
mov w8, w21
mov w9, w20
b .L.long_array.18
.L.long_array.22:
mov w8, #5000
mov w10, w8
mov w21, w11
b .L.long_array.25
.L.long_array.23:
movz x13, #54464
movk x13, #1, lsl #16
sub x9, x29, x13
sxtw x8, w20
lsl x8, x8, #2
add x8, x9, x8
ldr w8, [x8]
mul w8, w8, w19
add w9, w11, w8
movz w8, #34452
movk w8, #1, lsl #16
sdiv w14, w9, w8
msub w8, w14, w8, w9
mov w9, w20
.L.long_array.24:
b .L.long_array.18
.L.long_array.25:
mov w8, #10000
cmp w10, w8
b.lt .L.long_array.26
b .L.long_array.27
.L.long_array.26:
mov w8, #2233
cmp w10, w8
b.gt .L.long_array.28
b .L.long_array.29
.L.long_array.27:
mov w0, w21
bl putint
mov w8, w21
mov w9, w20
b .L.long_array.24
.L.long_array.28:
movz x13, #14464
movk x13, #1, lsl #16
sub x9, x29, x13
sxtw x8, w20
lsl x8, x8, #2
add x8, x9, x8
ldr w8, [x8]
add w9, w21, w8
movz x13, #40000
sub x8, x29, x13
sxtw x11, w10
lsl x11, x11, #2
add x8, x8, x11
ldr w8, [x8]
sub w9, w9, w8
mov w8, #1
add w8, w10, w8
b .L.long_array.30
.L.long_array.29:
movz x13, #40000
sub x8, x29, x13
sxtw x9, w20
lsl x9, x9, #2
add x8, x8, x9
ldr w8, [x8]
add w8, w21, w8
movz x13, #54464
movk x13, #1, lsl #16
sub x9, x29, x13
sxtw x11, w10
lsl x11, x11, #2
add x9, x9, x11
ldr w9, [x9]
add w8, w8, w9
mov w9, #13333
sdiv w14, w8, w9
msub w9, w14, w9, w8
mov w8, #2
add w8, w10, w8
.L.long_array.30:
mov w10, w8
mov w21, w9
b .L.long_array.25
.text
.globl main
.p2align 2
main:
.L.main.0:
stp x29, x30, [sp, #-16]!
mov x29, sp
mov w8, #9
mov w0, w8
bl long_array
mov w8, w0
mov w0, w8
ldp x29, x30, [sp], #16
ret