	.file	"extr_cheats.c_clear_cheats.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	clear_cheats, @function
clear_cheats:
.LFB0:
	.cfi_startproc
	endbr64
	mov	ecx, DWORD PTR maxcheats[rip]
	test	ecx, ecx
	jle	.L1
	mov	rsi, QWORD PTR cheatlist[rip]
	movsx	rdx, ecx
	sub	ecx, 1
	mov	rdi, QWORD PTR cart[rip+8]
	sal	rdx, 5
	sal	rcx, 5
	lea	rax, [rsi+rdx]
	lea	rdx, -32[rsi+rdx]
	sub	rdx, rcx
	.p2align 4,,10
	.p2align 3
.L5:
	cmp	QWORD PTR -8[rax], 0
	je	.L3
	mov	ecx, DWORD PTR -32[rax]
	cmp	ecx, DWORD PTR cart[rip]
	jge	.L3
	mov	esi, DWORD PTR system_hw[rip]
	and	esi, DWORD PTR SYSTEM_PBC[rip]
	cmp	esi, DWORD PTR SYSTEM_MD[rip]
	je	.L11
	mov	rcx, QWORD PTR -24[rax]
	test	rcx, rcx
	je	.L3
	mov	esi, DWORD PTR -16[rax]
	mov	DWORD PTR [rcx], esi
	mov	QWORD PTR -24[rax], 0
	.p2align 4,,10
	.p2align 3
.L3:
	sub	rax, 32
	cmp	rax, rdx
	jne	.L5
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	mov	esi, DWORD PTR -16[rax]
	and	ecx, 16777214
	mov	DWORD PTR [rcx+rdi], esi
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	clear_cheats, .-clear_cheats
	.comm	system_hw,4,4
	.comm	maxcheats,4,4
	.comm	cheatlist,8,8
	.comm	cart,16,16
	.comm	SYSTEM_PBC,4,4
	.comm	SYSTEM_MD,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_cheats.c_clear_cheats.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	clear_cheats, %function
clear_cheats:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L18
	ldr	r3, [r3]
	cmp	r3, #0
	bxle	lr
	ldr	r2, .L18+4
	ldr	ip, .L18+8
	ldr	r1, [r2]
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	add	r3, r1, r3, lsl #4
	mov	r6, #0
	ldr	r8, [ip, #4]
	ldr	r5, .L18+12
	ldr	r4, .L18+16
	ldr	lr, .L18+20
	ldr	r7, .L18+24
	b	.L5
.L4:
	ldr	r2, [r3, #-12]
	cmp	r2, #0
	ldrne	r0, [r3, #-8]
	strne	r0, [r2]
	strne	r6, [r3, #-12]
.L3:
	sub	r3, r3, #16
	cmp	r3, r1
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
.L5:
	ldr	r2, [r3, #-4]
	cmp	r2, #0
	beq	.L3
	ldr	r2, [r3, #-16]
	ldr	r0, [ip]
	cmp	r2, r0
	bge	.L3
	ldr	r0, [r5]
	ldr	r10, [r4]
	ldr	r9, [lr]
	and	r0, r0, r10
	cmp	r0, r9
	bne	.L4
	ldr	r0, [r3, #-8]
	and	r2, r2, r7
	str	r0, [r2, r8]
	b	.L3
.L19:
	.align	2
.L18:
	.word	maxcheats
	.word	cheatlist
	.word	cart
	.word	system_hw
	.word	SYSTEM_PBC
	.word	SYSTEM_MD
	.word	16777214
	.size	clear_cheats, .-clear_cheats
	.comm	system_hw,4,4
	.comm	maxcheats,4,4
	.comm	cheatlist,4,4
	.comm	cart,8,4
	.comm	SYSTEM_PBC,4,4
	.comm	SYSTEM_MD,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
