sysy-data/hidden_functional_c/asm/23_json.s

899 lines
12 KiB
ArmAsm
Raw Normal View History

2024-06-14 13:10:27 +08:00
.file "23_json.sy"
.option pic
.attribute arch, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.attribute unaligned_access, 0
.attribute stack_align, 16
.text
.align 1
.globl is_number
.type is_number, @function
is_number:
addiw a0,a0,-48
sltiu a0,a0,10
ret
.size is_number, .-is_number
.align 1
.globl skip_space
.type skip_space, @function
skip_space:
lla a3,.LANCHOR0
lw a4,0(a3)
ble a1,a4,.L3
slli a5,a4,2
add a0,a0,a5
addiw a4,a4,1
li a2,32
li a6,9
li a7,10
li t1,13
.L5:
lw a5,0(a0)
beq a5,a2,.L11
beq a5,a6,.L11
beq a5,a7,.L11
bne a5,t1,.L3
.L11:
sext.w a5,a4
sw a5,0(a3)
addi a0,a0,4
addiw a4,a4,1
bgt a1,a5,.L5
.L3:
ret
.size skip_space, .-skip_space
.align 1
.globl detect_item
.type detect_item, @function
detect_item:
addi sp,sp,-80
sd s1,56(sp)
lla s1,.LANCHOR0
lw t3,0(s1)
sd ra,72(sp)
sd s0,64(sp)
sd s2,48(sp)
sd s3,40(sp)
sd s4,32(sp)
sd s5,24(sp)
sd s6,16(sp)
sd s7,8(sp)
ble a2,t3,.L26
mv s0,a2
mv s2,a1
li a2,32
li a7,9
li t1,10
li t4,13
li a1,123
li t5,91
li t6,34
li t2,110
li s3,116
li t0,102
.L13:
slli a3,t3,2
add a3,s2,a3
addiw a6,t3,1
mv a5,t3
.L17:
lw a4,0(a3)
beq a4,a2,.L23
beq a4,a7,.L23
beq a4,t1,.L23
bne a4,t4,.L224
.L23:
sext.w a5,a6
sw a5,0(s1)
addi a3,a3,4
addiw a6,a6,1
bgt s0,a5,.L17
mv a4,a5
.L18:
bne a0,zero,.L16
slli a5,a5,2
add a5,s2,a5
lw a5,0(a5)
beq a5,a1,.L149
beq a5,t5,.L150
beq a5,t6,.L151
addiw a6,a5,-48
sext.w a3,a5
li a0,1
bgtu a6,a7,.L225
.L24:
ble s0,a4,.L26
ble s0,t3,.L147
mv t3,a4
j .L13
.L225:
beq a5,t2,.L153
bgt a5,t2,.L25
beq a5,t0,.L154
ble a5,t0,.L226
.L26:
li a0,0
.L187:
ld ra,72(sp)
ld s0,64(sp)
ld s1,56(sp)
ld s2,48(sp)
ld s3,40(sp)
ld s4,32(sp)
ld s5,24(sp)
ld s6,16(sp)
ld s7,8(sp)
addi sp,sp,80
jr ra
.L226:
addiw a5,a3,-43
andi a5,a5,-3
sext.w a5,a5
bne a5,zero,.L26
li a0,1
j .L24
.L149:
li a0,4
j .L24
.L224:
mv a4,a5
addiw a5,a6,-1
j .L18
.L150:
li a0,3
j .L24
.L25:
bne a5,s3,.L26
li a0,5
j .L24
.L151:
li a0,2
j .L24
.L154:
li a0,6
j .L24
.L147:
mv a5,a4
.L16:
li a3,7
bgtu a0,a3,.L26
lla a2,.L28
slli a3,a0,2
add a3,a3,a2
lw a3,0(a3)
add a3,a3,a2
jr a3
.section .rodata
.align 2
.align 2
.L28:
.word .L26-.L28
.word .L34-.L28
.word .L33-.L28
.word .L32-.L28
.word .L31-.L28
.word .L30-.L28
.word .L29-.L28
.word .L27-.L28
.text
.L153:
li a0,7
j .L24
.L34:
slli a3,a5,2
add a3,s2,a3
lw a3,0(a3)
li a2,43
beq a3,a2,.L194
li a2,45
beq a3,a2,.L194
.L36:
ble s0,a4,.L26
slli a5,a4,2
add a5,s2,a5
lw a3,0(a5)
li a2,9
addiw a3,a3,-48
bgtu a3,a2,.L26
.L38:
lw a3,0(a5)
addiw a3,a3,-48
bgtu a3,a2,.L37
addiw a4,a4,1
sw a4,0(s1)
addi a5,a5,4
bne a4,s0,.L38
.L59:
li a0,1
j .L187
.L33:
addiw a4,a5,1
sw a4,0(s1)
bge a4,s0,.L26
li a2,34
li a3,92
j .L51
.L49:
addiw a4,a4,1
.L50:
sw a4,0(s1)
ble s0,a4,.L26
.L51:
slli a5,a4,2
add a5,s2,a5
lw a5,0(a5)
beq a5,a2,.L48
bne a5,a3,.L49
addiw a4,a4,2
j .L50
.L32:
addiw a4,a5,1
sw a4,0(s1)
bge a4,s0,.L52
slli a4,a4,2
add a4,s2,a4
addiw a5,a5,2
li a2,32
li a1,9
li a6,10
li a0,13
.L53:
lw a3,0(a4)
beq a3,a2,.L196
beq a3,a1,.L196
beq a3,a6,.L196
bne a3,a0,.L58
.L196:
sext.w a3,a5
sw a3,0(s1)
addi a4,a4,4
addiw a5,a5,1
bgt s0,a3,.L53
.L52:
mv a2,s0
mv a1,s2
li a0,0
call detect_item
beq a0,zero,.L26
lw a5,0(s1)
ble s0,a5,.L60
slli a3,a5,2
add a3,s2,a3
addiw a4,a5,1
li a7,32
li a6,9
li a0,10
li a1,13
.L62:
lw a2,0(a3)
beq a2,a7,.L198
beq a2,a6,.L198
beq a2,a0,.L198
bne a2,a1,.L60
.L198:
sext.w a5,a4
sw a5,0(s1)
addi a3,a3,4
addiw a4,a4,1
bgt s0,a5,.L62
.L60:
slli a4,a5,2
add a4,s2,a4
lw a4,0(a4)
li a3,44
bne a4,a3,.L64
li s3,32
li s4,9
li s5,10
li s6,13
li s7,44
.L63:
addiw a4,a5,1
sw a4,0(s1)
bge a4,s0,.L69
slli a4,a4,2
add a4,s2,a4
addiw a5,a5,2
.L70:
lw a3,0(a4)
beq a3,s3,.L200
beq a3,s4,.L200
beq a3,s5,.L200
bne a3,s6,.L69
.L200:
sext.w a3,a5
sw a3,0(s1)
addi a4,a4,4
addiw a5,a5,1
bgt s0,a3,.L70
.L69:
mv a2,s0
mv a1,s2
li a0,0
call detect_item
beq a0,zero,.L26
lw a5,0(s1)
ble s0,a5,.L75
slli a4,a5,2
add a4,s2,a4
addiw a2,a5,1
.L76:
lw a3,0(a4)
beq a3,s3,.L202
beq a3,s4,.L202
beq a3,s5,.L202
bne a3,s6,.L75
.L202:
sext.w a5,a2
sw a5,0(s1)
addi a4,a4,4
addiw a2,a2,1
bgt s0,a5,.L76
.L75:
slli a4,a5,2
add a4,s2,a4
lw a4,0(a4)
beq a4,s7,.L63
.L64:
ble s0,a5,.L26
addiw a5,a5,1
li a0,32
li a1,9
li a2,10
li a3,13
.L82:
beq a4,a0,.L204
beq a4,a1,.L204
beq a4,a2,.L204
bne a4,a3,.L87
.L204:
sext.w a4,a5
sw a4,0(s1)
addiw a5,a5,1
ble s0,a4,.L26
slli a4,a4,2
add a4,s2,a4
lw a4,0(a4)
j .L82
.L31:
addiw a4,a5,1
sw a4,0(s1)
bge a4,s0,.L88
slli a4,a4,2
add a4,s2,a4
addiw a5,a5,2
li a2,32
li a1,9
li a6,10
li a0,13
.L89:
lw a3,0(a4)
beq a3,a2,.L206
beq a3,a1,.L206
beq a3,a6,.L206
bne a3,a0,.L94
.L206:
sext.w a3,a5
sw a3,0(s1)
addi a4,a4,4
addiw a5,a5,1
bgt s0,a3,.L89
.L88:
mv a2,s0
mv a1,s2
li a0,2
call detect_item
beq a0,zero,.L26
lw a5,0(s1)
ble s0,a5,.L26
slli a4,a5,2
add a4,s2,a4
addiw a5,a5,1
li a6,32
li a0,9
li a1,10
li a2,13
.L97:
lw a3,0(a4)
beq a3,a6,.L210
beq a3,a0,.L210
beq a3,a1,.L210
bne a3,a2,.L102
.L210:
sext.w a3,a5
sw a3,0(s1)
addi a4,a4,4
addiw a5,a5,1
bgt s0,a3,.L97
j .L26
.L30:
addiw a4,a5,3
bge a4,s0,.L26
slli a4,a5,2
add a4,s2,a4
lw a2,0(a4)
li a3,116
bne a2,a3,.L26
lw a2,4(a4)
li a3,114
bne a2,a3,.L26
lw a2,8(a4)
li a3,117
bne a2,a3,.L26
lw a3,12(a4)
li a4,101
bne a3,a4,.L26
.L208:
addiw a5,a5,4
sw a5,0(s1)
li a0,1
j .L187
.L29:
addiw a4,a5,4
bge a4,s0,.L26
slli a4,a5,2
add a4,s2,a4
lw a2,0(a4)
li a3,102
bne a2,a3,.L26
lw a2,4(a4)
li a3,97
bne a2,a3,.L26
lw a2,8(a4)
li a3,108
bne a2,a3,.L26
lw a2,12(a4)
li a3,115
bne a2,a3,.L26
lw a3,16(a4)
li a4,101
bne a3,a4,.L26
addiw a5,a5,5
sw a5,0(s1)
li a0,1
j .L187
.L27:
addiw a4,a5,3
bge a4,s0,.L26
slli a4,a5,2
add a4,s2,a4
lw a2,0(a4)
li a3,110
bne a2,a3,.L26
lw a2,4(a4)
li a3,117
bne a2,a3,.L26
lw a3,8(a4)
li a2,108
bne a3,a2,.L26
lw a4,12(a4)
bne a4,a3,.L26
j .L208
.L194:
addiw a4,a5,1
sw a4,0(s1)
j .L36
.L48:
ble s0,a4,.L26
addiw a4,a4,1
sw a4,0(s1)
li a0,1
j .L187
.L58:
addiw a4,a5,-1
ble s0,a4,.L52
slli a4,a4,2
add a4,s2,a4
lw a3,0(a4)
li a4,93
bne a3,a4,.L52
sw a5,0(s1)
.L227:
li a0,1
j .L187
.L94:
addiw a4,a5,-1
ble s0,a4,.L88
slli a4,a4,2
add a4,s2,a4
lw a3,0(a4)
li a4,125
bne a3,a4,.L88
sw a5,0(s1)
j .L227
.L37:
ble s0,a4,.L59
slli a3,a4,2
add a5,s2,a3
lw a2,0(a5)
li a5,46
beq a2,a5,.L228
.L40:
add a5,s2,a3
lw a2,0(a5)
li a5,101
bne a2,a5,.L59
addiw a5,a4,1
sw a5,0(s1)
bge a5,s0,.L59
addi a2,a3,4
add a2,s2,a2
lw a0,0(a2)
li a1,43
beq a0,a1,.L229
.L46:
lw a3,0(a2)
li a4,45
beq a3,a4,.L230
lw a5,0(s1)
.L143:
slli a4,a5,2
add a4,s2,a4
li a2,9
.L47:
lw a3,0(a4)
addiw a3,a3,-48
bgtu a3,a2,.L59
addiw a5,a5,1
sw a5,0(s1)
addi a4,a4,4
bne a5,s0,.L47
li a0,1
j .L187
.L102:
addiw a4,a5,-1
ble s0,a4,.L26
slli a4,a4,2
add a3,s2,a4
lw a2,0(a3)
li a3,58
bne a2,a3,.L26
sext.w a3,a5
sw a3,0(s1)
bge a3,s0,.L103
addi a4,a4,4
add a4,s2,a4
addiw a5,a5,1
li a6,32
li a0,9
li a1,10
li a2,13
.L104:
lw a3,0(a4)
beq a3,a6,.L212
beq a3,a0,.L212
beq a3,a1,.L212
bne a3,a2,.L103
.L212:
sext.w a3,a5
sw a3,0(s1)
addi a4,a4,4
addiw a5,a5,1
bgt s0,a3,.L104
.L103:
mv a2,s0
mv a1,s2
li a0,0
call detect_item
beq a0,zero,.L26
lw a5,0(s1)
ble s0,a5,.L109
slli a3,a5,2
add a3,s2,a3
addiw a4,a5,1
li a7,32
li a6,9
li a0,10
li a1,13
.L111:
lw a2,0(a3)
beq a2,a7,.L214
beq a2,a6,.L214
beq a2,a0,.L214
bne a2,a1,.L109
.L214:
sext.w a5,a4
sw a5,0(s1)
addi a3,a3,4
addiw a4,a4,1
bgt s0,a5,.L111
.L109:
slli a4,a5,2
add a4,s2,a4
lw a3,0(a4)
li a4,44
bne a3,a4,.L142
li s7,32
li s6,9
li s5,10
li s4,13
li s3,58
.L112:
addiw a4,a5,1
sw a4,0(s1)
bge a4,s0,.L118
slli a4,a4,2
add a4,s2,a4
addiw a5,a5,2
.L119:
lw a3,0(a4)
beq a3,s7,.L216
beq a3,s6,.L216
beq a3,s5,.L216
bne a3,s4,.L118
.L216:
sext.w a3,a5
sw a3,0(s1)
addi a4,a4,4
addiw a5,a5,1
bgt s0,a3,.L119
.L118:
mv a2,s0
mv a1,s2
li a0,2
call detect_item
beq a0,zero,.L26
lw a5,0(s1)
ble s0,a5,.L26
slli a3,a5,2
add a3,s2,a3
addiw a5,a5,1
.L124:
lw a4,0(a3)
beq a4,s7,.L218
beq a4,s6,.L218
beq a4,s5,.L218
bne a4,s4,.L129
.L218:
sext.w a4,a5
sw a4,0(s1)
addi a3,a3,4
addiw a5,a5,1
bgt s0,a4,.L124
j .L26
.L230:
addiw a5,a5,1
sw a5,0(s1)
blt a5,s0,.L143
li a0,1
j .L187
.L129:
bne a4,s3,.L26
sext.w a4,a5
sw a4,0(s1)
bge a4,s0,.L130
slli a4,a4,2
add a4,s2,a4
addiw a5,a5,1
.L131:
lw a3,0(a4)
beq a3,s7,.L220
beq a3,s6,.L220
beq a3,s5,.L220
bne a3,s4,.L130
.L220:
sext.w a3,a5
sw a3,0(s1)
addi a4,a4,4
addiw a5,a5,1
bgt s0,a3,.L131
.L130:
mv a2,s0
mv a1,s2
li a0,0
call detect_item
beq a0,zero,.L26
lw a5,0(s1)
ble s0,a5,.L136
slli a3,a5,2
add a3,s2,a3
addiw a4,a5,1
.L137:
lw a2,0(a3)
beq a2,s7,.L222
beq a2,s6,.L222
beq a2,s5,.L222
bne a2,s4,.L136
.L222:
sext.w a5,a4
sw a5,0(s1)
addi a3,a3,4
addiw a4,a4,1
bgt s0,a5,.L137
.L136:
slli a4,a5,2
add a4,s2,a4
lw a3,0(a4)
li a4,44
beq a3,a4,.L112
.L142:
mv a1,s0
mv a0,s2
call skip_space
lw a5,0(s1)
bge a5,s0,.L26
slli a4,a5,2
add a4,s2,a4
lw a3,0(a4)
li a4,125
bne a3,a4,.L26
addiw a5,a5,1
sw a5,0(s1)
li a0,1
j .L187
.L87:
addiw a4,a5,-1
ble s0,a4,.L26
slli a4,a4,2
add a4,s2,a4
lw a3,0(a4)
li a4,93
bne a3,a4,.L26
sw a5,0(s1)
j .L227
.L229:
addiw a5,a4,2
sw a5,0(s1)
bge a5,s0,.L59
addi a2,a3,8
add a2,s2,a2
j .L46
.L228:
addiw a2,a4,1
sw a2,0(s1)
bge a2,s0,.L59
addi a5,a3,4
add a5,s2,a5
addiw a3,a4,2
sext.w a1,s0
li a2,9
.L44:
lw a4,0(a5)
addiw a4,a4,-48
bgtu a4,a2,.L231
sext.w a4,a3
sw a4,0(s1)
addiw a0,a3,1
addi a5,a5,4
beq a1,a3,.L43
mv a3,a0
j .L44
.L231:
lw a4,0(s1)
.L43:
ble s0,a4,.L59
slli a3,a4,2
j .L40
.size detect_item, .-detect_item
.section .text.startup,"ax",@progbits
.align 1
.globl main
.type main, @function
main:
addi sp,sp,-32
sd ra,24(sp)
sd s0,16(sp)
sd s1,8(sp)
sd s2,0(sp)
call getch@plt
li a5,35
beq a0,a5,.L237
lla s0,buffer
li s1,0
li s2,35
.L234:
sw a0,0(s0)
call getch@plt
addiw s1,s1,1
addi s0,s0,4
bne a0,s2,.L234
.L233:
mv a1,s1
lla a0,buffer
call skip_space
lla a1,buffer
mv a2,s1
li a0,0
call detect_item
mv s0,a0
mv a1,s1
lla a0,buffer
call skip_space
beq s0,zero,.L235
li a0,111
call putch@plt
li a0,107
call putch@plt
li a0,10
call putch@plt
li a0,0
.L236:
ld ra,24(sp)
ld s0,16(sp)
ld s1,8(sp)
ld s2,0(sp)
addi sp,sp,32
jr ra
.L235:
li a0,110
call putch@plt
li a0,111
call putch@plt
li a0,116
call putch@plt
li a0,32
call putch@plt
li a0,111
call putch@plt
li a0,107
call putch@plt
li a0,10
call putch@plt
li a0,1
j .L236
.L237:
li s1,0
j .L233
.size main, .-main
.globl buffer
.globl pos
.globl _sysy_idx
.globl _sysy_us
.globl _sysy_s
.globl _sysy_m
.globl _sysy_h
.globl _sysy_l2
.globl _sysy_l1
.globl _sysy_end
.globl _sysy_start
.bss
.align 3
.set .LANCHOR0,. + 0
.type pos, @object
.size pos, 4
pos:
.zero 4
.zero 4
.type buffer, @object
.size buffer, 200000000
buffer:
.zero 200000000
.type _sysy_idx, @object
.size _sysy_idx, 4
_sysy_idx:
.zero 4
.zero 4
.type _sysy_us, @object
.size _sysy_us, 4096
_sysy_us:
.zero 4096
.type _sysy_s, @object
.size _sysy_s, 4096
_sysy_s:
.zero 4096
.type _sysy_m, @object
.size _sysy_m, 4096
_sysy_m:
.zero 4096
.type _sysy_h, @object
.size _sysy_h, 4096
_sysy_h:
.zero 4096
.type _sysy_l2, @object
.size _sysy_l2, 4096
_sysy_l2:
.zero 4096
.type _sysy_l1, @object
.size _sysy_l1, 4096
_sysy_l1:
.zero 4096
.type _sysy_end, @object
.size _sysy_end, 16
_sysy_end:
.zero 16
.type _sysy_start, @object
.size _sysy_start, 16
_sysy_start:
.zero 16
.ident "GCC: (Debian 12.2.0-13) 12.2.0"
.section .note.GNU-stack,"",@progbits