	.file	"extr_dscan.c_kirai.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	kirai
	.type	kirai, @function
kirai:
.LFB0:
	.cfi_startproc
	endbr64
	cmp	QWORD PTR MAX_KT[rip], 0
	je	.L16
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12d, 3
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xor	ebx, ebx
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	.p2align 4,,10
	.p2align 3
.L2:
	mov	rax, QWORD PTR kf[rip]
	lea	rbp, 0[0+rbx*4]
	add	rax, rbp
	mov	esi, DWORD PTR [rax]
	test	esi, esi
	je	.L3
	mov	rcx, QWORD PTR ky[rip]
	lea	r13, 0[0+rbx*8]
	add	rcx, r13
	mov	rdx, QWORD PTR [rcx]
	sub	rdx, 1
	mov	QWORD PTR [rcx], rdx
	cmp	esi, 2
	jle	.L4
	mov	rdi, QWORD PTR kx[rip]
	add	esi, 1
	mov	DWORD PTR [rax], esi
	mov	edx, DWORD PTR px[rip]
	add	rdi, rbp
	mov	r8d, DWORD PTR [rdi]
	lea	r9d, -4[rdx]
	cmp	r9d, r8d
	jg	.L5
	add	edx, 11
	cmp	r8d, edx
	jg	.L5
	cmp	DWORD PTR pf[rip], 1
	jle	.L20
	.p2align 4,,10
	.p2align 3
.L5:
	cmp	esi, 5
	jle	.L6
	mov	DWORD PTR [rax], 0
	mov	edx, DWORD PTR DEF_KX[rip]
	mov	DWORD PTR [rdi], edx
	mov	rdx, QWORD PTR DEF_KY[rip]
	mov	esi, DWORD PTR [rax]
	mov	QWORD PTR [rcx], rdx
.L6:
	mov	rdi, QWORD PTR DEF_KS[rip]
	add	esi, DWORD PTR DEF_KC[rip]
	add	rdi, rbx
	call	set_sprite_tile@PLT
	mov	rdx, QWORD PTR kf[rip]
	mov	eax, DWORD PTR DEF_KC[rip]
	mov	rdi, QWORD PTR DEF_KS[rip]
	add	eax, DWORD PTR [rdx+rbp]
	mov	rdx, QWORD PTR foreCGB[rip]
	cdqe
	add	rdi, rbx
	mov	esi, DWORD PTR [rdx+rax*4]
	call	set_sprite_attrb@PLT
	mov	rax, QWORD PTR ky[rip]
	mov	rdi, QWORD PTR DEF_KS[rip]
	mov	rdx, QWORD PTR [rax+r13]
	mov	rax, QWORD PTR kx[rip]
	add	rdi, rbx
	mov	esi, DWORD PTR [rax+rbp]
	call	move_sprite@PLT
.L3:
	add	rbx, 1
	cmp	QWORD PTR MAX_KT[rip], rbx
	ja	.L2
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	cmp	rdx, QWORD PTR MIN_KY[rip]
	jg	.L7
	mov	DWORD PTR [rax], 3
	mov	esi, 3
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	mov	ecx, r12d
	sub	ecx, esi
	mov	DWORD PTR [rax], ecx
	mov	esi, ecx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L20:
	mov	DWORD PTR pf[rip], 2
	mov	esi, DWORD PTR [rax]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	ret
	.cfi_endproc
.LFE0:
	.size	kirai, .-kirai
	.comm	px,4,4
	.comm	pf,4,4
	.comm	ky,8,8
	.comm	kx,8,8
	.comm	kf,8,8
	.comm	foreCGB,8,8
	.comm	MIN_KY,8,8
	.comm	MAX_KT,8,8
	.comm	DEF_KY,8,8
	.comm	DEF_KX,4,4
	.comm	DEF_KS,8,8
	.comm	DEF_KC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_dscan.c_kirai.c"
	.text
	.align	2
	.global	kirai
	.syntax unified
	.arm
	.fpu softvfp
	.type	kirai, %function
kirai:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r8, .L17
	sub	sp, sp, #12
	ldr	r3, [r8]
	cmp	r3, #0
	beq	.L1
	mov	r4, #0
	ldr	r7, .L17+4
	ldr	r9, .L17+8
	ldr	r10, .L17+12
	ldr	r6, .L17+16
	ldr	fp, .L17+20
	b	.L2
.L16:
	ldr	ip, [fp]
	add	r1, r1, #1
	str	r1, [r3, r5]
	str	ip, [sp, #4]
	ldr	ip, [ip, r5]
	ldr	r0, .L17+24
	mov	lr, ip
	ldr	r0, [r0]
	sub	ip, r0, #4
	cmp	ip, lr
	bgt	.L5
	add	r0, r0, #11
	cmp	lr, r0
	bgt	.L5
	ldr	r0, .L17+28
	ldr	ip, [r0]
	cmp	ip, #1
	movle	r1, #2
	strle	r1, [r0]
	ldrle	r1, [r3, r5]
.L5:
	cmp	r1, #5
	ble	.L6
	mov	r0, #0
	ldr	r1, .L17+32
	str	r0, [r3, r5]
	ldr	r0, .L17+36
	ldr	r1, [r1]
	ldr	ip, [sp, #4]
	ldr	r0, [r0]
	str	r1, [ip, r5]
	ldr	r1, [r3, r5]
	str	r0, [r2, r5]
.L6:
	ldr	r3, [r10]
	ldr	r0, [r6]
	add	r1, r1, r3
	add	r0, r4, r0
	bl	set_sprite_tile
	ldr	r3, [r7]
	ldr	r2, .L17+40
	ldr	r1, [r10]
	ldr	r3, [r3, r5]
	ldr	r2, [r2]
	ldr	r0, [r6]
	add	r3, r3, r1
	ldr	r1, [r2, r3, lsl #2]
	add	r0, r4, r0
	bl	set_sprite_attrb
	ldr	r2, [r9]
	ldr	r3, [fp]
	ldr	r0, [r6]
	ldr	r2, [r2, r5]
	ldr	r1, [r3, r5]
	add	r0, r4, r0
	bl	move_sprite
.L3:
	ldr	r3, [r8]
	add	r4, r4, #1
	cmp	r3, r4
	bls	.L1
.L2:
	ldr	r3, [r7]
	lsl	r5, r4, #2
	ldr	r1, [r3, r4, lsl #2]
	cmp	r1, #0
	beq	.L3
	ldr	r2, [r9]
	cmp	r1, #2
	ldr	r0, [r2, r4, lsl #2]
	sub	r0, r0, #1
	str	r0, [r2, r4, lsl #2]
	bgt	.L16
	ldr	r2, .L17+44
	ldr	r2, [r2]
	cmp	r0, r2
	movle	r1, #3
	rsbgt	r1, r1, #3
	str	r1, [r3, r5]
	b	.L6
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L18:
	.align	2
.L17:
	.word	MAX_KT
	.word	kf
	.word	ky
	.word	DEF_KC
	.word	DEF_KS
	.word	kx
	.word	px
	.word	pf
	.word	DEF_KX
	.word	DEF_KY
	.word	foreCGB
	.word	MIN_KY
	.size	kirai, .-kirai
	.comm	px,4,4
	.comm	pf,4,4
	.comm	ky,4,4
	.comm	kx,4,4
	.comm	kf,4,4
	.comm	foreCGB,4,4
	.comm	MIN_KY,4,4
	.comm	MAX_KT,4,4
	.comm	DEF_KY,4,4
	.comm	DEF_KX,4,4
	.comm	DEF_KS,4,4
	.comm	DEF_KC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
