	.file	"extr_mzpokeysnd.c_advance_ticks.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	advance_ticks, @function
advance_ticks:
.LFB0:
	.cfi_startproc
	endbr64
	test	esi, esi
	jle	.L73
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, esi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	cmp	QWORD PTR 264[rdi], 0
	jne	.L78
.L4:
	mov	DWORD PTR 16[rsp], 0
	xor	r13d, r13d
	mov	DWORD PTR 20[rsp], 0
	mov	DWORD PTR 8[rsp], 0
	mov	DWORD PTR 12[rsp], 0
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L83:
	sub	ebp, r12d
	mov	r13d, 1
.L10:
	test	esi, esi
	jne	.L11
	mov	esi, r10d
	sub	esi, r12d
	mov	DWORD PTR 48[rbx], esi
.L11:
	test	ecx, ecx
	jne	.L12
	mov	ecx, r9d
	sub	ecx, r12d
	mov	DWORD PTR 52[rbx], ecx
.L12:
	test	edx, edx
	jne	.L13
	mov	edx, r15d
	sub	edx, r12d
	mov	DWORD PTR 56[rbx], edx
.L13:
	test	eax, eax
	jne	.L14
	mov	eax, r14d
	sub	eax, r12d
	mov	DWORD PTR 60[rbx], eax
.L14:
	mov	esi, r12d
	mov	rdi, rbx
	mov	DWORD PTR 4[rsp], r9d
	mov	DWORD PTR [rsp], r10d
	call	advance_polies@PLT
	mov	esi, r12d
	mov	rdi, rbx
	call	bump_qe_subticks@PLT
	test	r13d, r13d
	je	.L15
	mov	rdx, QWORD PTR 64[rbx]
	mov	rax, QWORD PTR poly5tbl[rip]
	mov	r10d, DWORD PTR [rsp]
	mov	r9d, DWORD PTR 4[rsp]
	mov	esi, DWORD PTR [rax+rdx*4]
	mov	rdx, QWORD PTR 72[rbx]
	mov	rax, QWORD PTR poly4tbl[rip]
	and	esi, 1
	mov	edx, DWORD PTR [rax+rdx*4]
	and	edx, 1
	cmp	QWORD PTR 256[rbx], 0
	je	.L16
	mov	rcx, QWORD PTR 80[rbx]
	mov	rax, QWORD PTR poly9tbl[rip]
	mov	ecx, DWORD PTR [rax+rcx*4]
	and	ecx, 1
.L17:
	mov	eax, DWORD PTR 248[rbx]
	test	eax, eax
	jne	.L18
	cmp	r12d, r10d
	je	.L79
.L18:
	mov	eax, DWORD PTR 232[rbx]
	test	eax, eax
	jne	.L19
	cmp	r12d, r9d
	je	.L80
.L19:
	mov	eax, DWORD PTR 208[rbx]
	test	eax, eax
	jne	.L21
	cmp	r12d, r15d
	je	.L81
.L21:
	mov	r15d, DWORD PTR 184[rbx]
	test	r15d, r15d
	jne	.L23
	cmp	r12d, r14d
	je	.L34
.L23:
	mov	r11d, DWORD PTR 12[rsp]
	test	r11d, r11d
	jne	.L33
.L26:
	mov	r10d, DWORD PTR 8[rsp]
	test	r10d, r10d
	jne	.L35
.L27:
	mov	r9d, DWORD PTR 20[rsp]
	test	r9d, r9d
	je	.L28
	mov	rdi, rbx
	call	[QWORD PTR 144[rbx]]
	add	rax, rax
	mov	QWORD PTR 16[rbx], rax
.L28:
	mov	r8d, DWORD PTR 16[rsp]
	test	r8d, r8d
	jne	.L29
	mov	rax, QWORD PTR 24[rbx]
.L30:
	mov	rsi, QWORD PTR 8[rbx]
	add	rsi, QWORD PTR [rbx]
	add	rsi, QWORD PTR 16[rbx]
	add	rsi, rax
	cmp	QWORD PTR 40[rbx], rsi
	je	.L15
	mov	QWORD PTR 40[rbx], rsi
	mov	rdi, rbx
	call	add_change@PLT
.L15:
	test	ebp, ebp
	jle	.L82
.L31:
	mov	esi, DWORD PTR 248[rbx]
	mov	r10d, DWORD PTR 48[rbx]
	lea	r12d, 1[rbp]
	mov	r9d, DWORD PTR 52[rbx]
	mov	r15d, DWORD PTR 56[rbx]
	mov	r14d, DWORD PTR 60[rbx]
	test	esi, esi
	jne	.L6
	cmp	r12d, r10d
	cmovg	r12d, r10d
.L6:
	mov	ecx, DWORD PTR 232[rbx]
	test	ecx, ecx
	jne	.L7
	cmp	r12d, r9d
	cmovg	r12d, r9d
.L7:
	mov	edx, DWORD PTR 208[rbx]
	test	edx, edx
	jne	.L8
	cmp	r12d, r15d
	cmovg	r12d, r15d
.L8:
	mov	eax, DWORD PTR 184[rbx]
	test	eax, eax
	jne	.L9
	cmp	r12d, r14d
	cmovg	r12d, r14d
.L9:
	cmp	r12d, ebp
	jle	.L83
	mov	r12d, ebp
	xor	ebp, ebp
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L81:
	mov	DWORD PTR 20[rsp], ecx
	mov	rdi, rbx
	mov	DWORD PTR 4[rsp], edx
	mov	DWORD PTR [rsp], esi
	call	[QWORD PTR 200[rbx]]
	mov	eax, DWORD PTR 112[rbx]
	mov	esi, DWORD PTR [rsp]
	cmp	QWORD PTR 192[rbx], 0
	mov	edx, DWORD PTR 4[rsp]
	mov	DWORD PTR 56[rbx], eax
	mov	ecx, DWORD PTR 20[rsp]
	je	.L84
	mov	edi, DWORD PTR 184[rbx]
	mov	DWORD PTR 20[rsp], r13d
	test	edi, edi
	jne	.L33
	cmp	r12d, r14d
	jne	.L33
	mov	DWORD PTR 12[rsp], r13d
	.p2align 4,,10
	.p2align 3
.L34:
	mov	rdi, rbx
	call	[QWORD PTR 176[rbx]]
	mov	eax, DWORD PTR 116[rbx]
	cmp	QWORD PTR 168[rbx], 0
	mov	DWORD PTR 60[rbx], eax
	je	.L24
	mov	eax, DWORD PTR 120[rbx]
	mov	DWORD PTR 56[rbx], eax
.L24:
	cmp	QWORD PTR 160[rbx], 0
	je	.L85
	mov	eax, DWORD PTR 12[rsp]
	test	eax, eax
	jne	.L40
	mov	DWORD PTR 16[rsp], r13d
	.p2align 4,,10
	.p2align 3
.L35:
	mov	rdi, rbx
	call	[QWORD PTR 136[rbx]]
	mov	DWORD PTR 8[rsp], r13d
	add	rax, rax
	mov	QWORD PTR 8[rbx], rax
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L40:
	mov	eax, DWORD PTR 12[rsp]
	mov	DWORD PTR 8[rsp], eax
	mov	DWORD PTR 16[rsp], eax
	.p2align 4,,10
	.p2align 3
.L33:
	mov	rdi, rbx
	call	[QWORD PTR 128[rbx]]
	mov	DWORD PTR 12[rsp], r13d
	add	rax, rax
	mov	QWORD PTR [rbx], rax
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L16:
	mov	rcx, QWORD PTR 88[rbx]
	mov	rax, QWORD PTR poly17tbl[rip]
	mov	ecx, DWORD PTR [rax+rcx*4]
	and	ecx, 1
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L29:
	mov	rdi, rbx
	call	[QWORD PTR 152[rbx]]
	add	rax, rax
	mov	QWORD PTR 24[rbx], rax
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L82:
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L79:
	.cfi_restore_state
	mov	DWORD PTR 28[rsp], r9d
	mov	rdi, rbx
	mov	DWORD PTR 24[rsp], ecx
	mov	DWORD PTR 4[rsp], edx
	mov	DWORD PTR [rsp], esi
	call	[QWORD PTR 240[rbx]]
	mov	eax, DWORD PTR 96[rbx]
	mov	DWORD PTR 12[rsp], r13d
	mov	r9d, DWORD PTR 28[rsp]
	mov	ecx, DWORD PTR 24[rsp]
	mov	edx, DWORD PTR 4[rsp]
	mov	esi, DWORD PTR [rsp]
	mov	DWORD PTR 48[rbx], eax
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L80:
	mov	DWORD PTR 8[rsp], ecx
	mov	rdi, rbx
	mov	DWORD PTR 4[rsp], edx
	mov	DWORD PTR [rsp], esi
	call	[QWORD PTR 224[rbx]]
	mov	eax, DWORD PTR 100[rbx]
	mov	esi, DWORD PTR [rsp]
	cmp	QWORD PTR 216[rbx], 0
	mov	edx, DWORD PTR 4[rsp]
	mov	DWORD PTR 52[rbx], eax
	mov	ecx, DWORD PTR 8[rsp]
	je	.L20
	mov	eax, DWORD PTR 104[rbx]
	mov	DWORD PTR 48[rbx], eax
.L20:
	mov	eax, DWORD PTR 108[rbx]
	mov	DWORD PTR 8[rsp], r13d
	and	eax, 136
	cmp	eax, 136
	jne	.L19
	mov	eax, DWORD PTR 96[rbx]
	mov	DWORD PTR 48[rbx], eax
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L78:
	mov	QWORD PTR 264[rdi], 0
	mov	rsi, QWORD PTR 8[rdi]
	add	rsi, QWORD PTR [rdi]
	add	rsi, QWORD PTR 16[rdi]
	add	rsi, QWORD PTR 24[rdi]
	cmp	QWORD PTR 40[rdi], rsi
	je	.L4
	mov	QWORD PTR 40[rdi], rsi
	call	add_change@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L84:
	mov	DWORD PTR 20[rsp], r13d
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L85:
	mov	DWORD PTR 16[rsp], r13d
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L73:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	ret
	.cfi_endproc
.LFE0:
	.size	advance_ticks, .-advance_ticks
	.comm	poly9tbl,8,8
	.comm	poly5tbl,8,8
	.comm	poly4tbl,8,8
	.comm	poly17tbl,8,8
	.comm	pokeymix,8,8
	.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_mzpokeysnd.c_advance_ticks.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	advance_ticks, %function
advance_ticks:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	subs	r6, r1, #0
	sub	sp, sp, #36
	ble	.L1
	ldr	r3, [r0, #152]
	mov	r4, r0
	cmp	r3, #0
	bne	.L72
.L4:
	mov	r9, #0
	str	r9, [sp, #12]
	str	r9, [sp, #16]
	str	r9, [sp, #4]
	str	r9, [sp, #8]
	b	.L31
.L76:
	ldr	r0, [r4, #12]
.L30:
	ldm	r4, {r1, r2, r3}
	add	r1, r1, r2
	add	r1, r1, r3
	ldr	r3, [r4, #20]
	add	r1, r1, r0
	cmp	r3, r1
	beq	.L15
	mov	r0, r4
	str	r1, [r4, #20]
	bl	add_change
.L15:
	cmp	r6, #0
	ble	.L1
.L31:
	ldr	r0, [r4, #144]
	ldr	fp, [r4, #24]
	cmp	r0, #0
	ldr	r8, [r4, #28]
	ldr	r7, [r4, #32]
	ldr	r10, [r4, #36]
	add	r5, r6, #1
	bne	.L6
	cmp	r5, fp
	movge	r5, fp
.L6:
	ldr	r1, [r4, #136]
	cmp	r1, #0
	bne	.L7
	cmp	r5, r8
	movge	r5, r8
.L7:
	ldr	r2, [r4, #124]
	cmp	r2, #0
	bne	.L8
	cmp	r5, r7
	movge	r5, r7
.L8:
	ldr	r3, [r4, #112]
	cmp	r3, #0
	bne	.L9
	cmp	r5, r10
	movge	r5, r10
.L9:
	cmp	r5, r6
	movgt	r5, r6
	movle	r9, #1
	movgt	r6, #0
	suble	r6, r6, r5
	cmp	r0, #0
	subeq	r0, fp, r5
	streq	r0, [r4, #24]
	cmp	r1, #0
	subeq	r1, r8, r5
	streq	r1, [r4, #28]
	cmp	r2, #0
	subeq	r2, r7, r5
	streq	r2, [r4, #32]
	cmp	r3, #0
	subeq	r3, r10, r5
	streq	r3, [r4, #36]
	mov	r1, r5
	mov	r0, r4
	bl	advance_polies
	mov	r1, r5
	mov	r0, r4
	bl	bump_qe_subticks
	cmp	r9, #0
	beq	.L15
	ldr	r3, .L80
	ldr	r1, [r4, #40]
	ldr	r3, [r3]
	ldr	r2, .L80+4
	ldr	r1, [r3, r1, lsl #2]
	ldr	r3, [r4, #148]
	ldr	r0, [r4, #44]
	cmp	r3, #0
	ldrne	r3, .L80+8
	ldreq	r3, .L80+12
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r2, [r2, r0, lsl #2]
	ldrne	r0, [r4, #48]
	ldreq	r0, [r4, #52]
	and	r1, r1, #1
	ldr	r3, [r3, r0, lsl #2]
	ldr	r0, [r4, #144]
	and	r2, r2, #1
	cmp	r0, #0
	cmpeq	r5, fp
	and	r3, r3, #1
	beq	.L73
	ldr	r0, [r4, #136]
	cmp	r0, #0
	cmpeq	r5, r8
	beq	.L74
.L19:
	ldr	r0, [r4, #124]
	cmp	r0, #0
	cmpeq	r5, r7
	beq	.L75
.L21:
	ldr	r0, [r4, #112]
	cmp	r0, #0
	bne	.L23
	cmp	r5, r10
	beq	.L34
.L23:
	ldr	r3, [sp, #8]
	cmp	r3, #0
	bne	.L33
.L26:
	ldr	r3, [sp, #4]
	cmp	r3, #0
	bne	.L35
.L27:
	ldr	r3, [sp, #16]
	cmp	r3, #0
	beq	.L28
	mov	r0, r4
	ldr	r3, [r4, #92]
	blx	r3
	lsl	r0, r0, #1
	str	r0, [r4, #8]
.L28:
	ldr	r3, [sp, #12]
	cmp	r3, #0
	beq	.L76
	mov	r0, r4
	ldr	r3, [r4, #96]
	blx	r3
	lsl	r0, r0, #1
	str	r0, [r4, #12]
	b	.L30
.L75:
	mov	r0, r4
	ldr	r7, [r4, #120]
	str	r3, [sp, #24]
	str	r2, [sp, #20]
	str	r1, [sp, #16]
	blx	r7
	ldr	ip, [r4, #116]
	ldr	r0, [r4, #72]
	add	r1, sp, #16
	cmp	ip, #0
	str	r0, [r4, #32]
	ldm	r1, {r1, r2, r3}
	beq	.L77
	ldr	r0, [r4, #112]
	str	r9, [sp, #16]
	cmp	r0, #0
	bne	.L33
	cmp	r5, r10
	bne	.L33
	str	r9, [sp, #8]
.L34:
	mov	r0, r4
	ldr	r5, [r4, #108]
	blx	r5
	ldr	r2, [r4, #104]
	ldr	r3, [r4, #76]
	cmp	r2, #0
	str	r3, [r4, #36]
	ldrne	r3, [r4, #80]
	strne	r3, [r4, #32]
	ldr	r3, [r4, #100]
	cmp	r3, #0
	beq	.L78
	ldr	r3, [sp, #8]
	cmp	r3, #0
	streq	r9, [sp, #12]
	bne	.L79
.L35:
	mov	r0, r4
	ldr	r3, [r4, #88]
	blx	r3
	lsl	r0, r0, #1
	str	r9, [sp, #4]
	str	r0, [r4, #4]
	b	.L27
.L79:
	ldr	r3, [sp, #8]
	str	r3, [sp, #4]
	str	r3, [sp, #12]
.L33:
	mov	r0, r4
	ldr	r3, [r4, #84]
	blx	r3
	lsl	r0, r0, #1
	str	r9, [sp, #8]
	str	r0, [r4]
	b	.L26
.L1:
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L73:
	mov	r0, r4
	ldr	fp, [r4, #140]
	str	r3, [sp, #28]
	str	r2, [sp, #24]
	str	r1, [sp, #20]
	str	r9, [sp, #8]
	blx	fp
	ldr	r0, [r4, #56]
	add	r1, sp, #20
	str	r0, [r4, #24]
	ldr	r0, [r4, #136]
	ldm	r1, {r1, r2, r3}
	cmp	r0, #0
	cmpeq	r5, r8
	bne	.L19
.L74:
	mov	r0, r4
	ldr	r8, [r4, #132]
	str	r3, [sp, #24]
	str	r2, [sp, #20]
	str	r1, [sp, #4]
	blx	r8
	ldr	ip, [r4, #128]
	ldr	r0, [r4, #60]
	cmp	ip, #0
	str	r0, [r4, #28]
	ldrne	r0, [r4, #64]
	ldr	r1, [sp, #4]
	strne	r0, [r4, #24]
	ldr	r0, [r4, #68]
	ldr	r2, [sp, #20]
	and	r0, r0, #136
	cmp	r0, #136
	ldreq	r0, [r4, #56]
	ldr	r3, [sp, #24]
	streq	r9, [sp, #4]
	streq	r0, [r4, #24]
	strne	r9, [sp, #4]
	b	.L19
.L72:
	mov	r3, #0
	ldm	r0, {r1, r2}
	str	r3, [r0, #152]
	ldr	r3, [r0, #8]
	add	r1, r1, r2
	ldr	r2, [r0, #12]
	add	r1, r1, r3
	ldr	r3, [r0, #20]
	add	r1, r1, r2
	cmp	r3, r1
	beq	.L4
	str	r1, [r0, #20]
	bl	add_change
	b	.L4
.L77:
	str	r9, [sp, #16]
	b	.L21
.L78:
	str	r9, [sp, #12]
	b	.L23
.L81:
	.align	2
.L80:
	.word	poly5tbl
	.word	poly4tbl
	.word	poly9tbl
	.word	poly17tbl
	.size	advance_ticks, .-advance_ticks
	.comm	poly9tbl,4,4
	.comm	poly5tbl,4,4
	.comm	poly4tbl,4,4
	.comm	poly17tbl,4,4
	.comm	pokeymix,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
