	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ROMCheatUpdate                 ## -- Begin function ROMCheatUpdate
	.p2align	4, 0x90
_ROMCheatUpdate:                        ## @ROMCheatUpdate
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	.cfi_offset %rbx, -24
	movq	_maxROMcheats@GOTPCREL(%rip), %rax
	movslq	(%rax), %r11
	testq	%r11, %r11
	je	LBB0_7
## %bb.1:
	movq	_MAX_CHEATS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rcx
	subq	%r11, %rcx
	movq	_cheatIndexes@GOTPCREL(%rip), %r8
	movq	_cheatlist@GOTPCREL(%rip), %r10
	movq	_z80_readmap@GOTPCREL(%rip), %r9
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rcx
	decl	%r11d
	je	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r8), %rax
	movslq	(%rax,%rcx,4), %rdx
	movq	(%r10), %rdi
	shlq	$5, %rdx
	movq	(%rdi,%rdx), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%rdi,%rdx), %rsi
	addq	%rdx, %rdi
	movq	%rsi, (%rax)
	movq	$0, (%rdi)
	movq	(%r10), %rdi
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r9), %rax
	movl	16(%rdi,%rdx), %esi
	movl	%esi, %ebx
	sarl	$10, %ebx
	movslq	%ebx, %rbx
	movq	(%rax,%rbx,8), %rax
	andl	$1023, %esi                     ## imm = 0x3FF
	movq	8(%rdi,%rdx), %rbx
	cmpq	(%rax,%rsi,8), %rbx
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	(%rax,%rsi,8), %rax
	movq	24(%rdi,%rdx), %rsi
	movq	%rsi, (%rax)
	movq	%rax, (%rdi,%rdx)
	jmp	LBB0_6
LBB0_7:
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_maxROMcheats,4,2               ## @maxROMcheats
	.comm	_cheatIndexes,8,3               ## @cheatIndexes
	.comm	_MAX_CHEATS,4,2                 ## @MAX_CHEATS
	.comm	_cheatlist,8,3                  ## @cheatlist
	.comm	_z80_readmap,8,3                ## @z80_readmap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ROMCheatUpdate                 ; -- Begin function ROMCheatUpdate
	.p2align	2
_ROMCheatUpdate:                        ; @ROMCheatUpdate
	.cfi_startproc
; %bb.0:
Lloh0:
	adrp	x8, _maxROMcheats@GOTPAGE
Lloh1:
	ldr	x8, [x8, _maxROMcheats@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_7
; %bb.1:
	sxtw	x9, w8
Lloh3:
	adrp	x10, _MAX_CHEATS@GOTPAGE
Lloh4:
	ldr	x10, [x10, _MAX_CHEATS@GOTPAGEOFF]
Lloh5:
	ldrsw	x10, [x10]
	lsl	x10, x10, #2
	sub	x9, x10, x9, lsl #2
Lloh6:
	adrp	x10, _cheatIndexes@GOTPAGE
Lloh7:
	ldr	x10, [x10, _cheatIndexes@GOTPAGEOFF]
Lloh8:
	adrp	x11, _cheatlist@GOTPAGE
Lloh9:
	ldr	x11, [x11, _cheatlist@GOTPAGEOFF]
Lloh10:
	adrp	x12, _z80_readmap@GOTPAGE
Lloh11:
	ldr	x12, [x12, _z80_readmap@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x9, x9, #4
	subs	w8, w8, #1
	b.eq	LBB0_7
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x13, [x10]
	ldrsw	x13, [x13, x9]
	ldr	x14, [x11]
	add	x15, x14, x13, lsl #5
	ldr	x16, [x15]
	cbz	x16, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x14, [x15, #8]
	str	x14, [x16]
	str	xzr, [x15]
	ldr	x14, [x11]
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x15, [x12]
	add	x13, x14, x13, lsl #5
	ldr	w14, [x13, #16]
	asr	w16, w14, #10
	ldr	x15, [x15, w16, sxtw #3]
	and	x14, x14, #0x3ff
	add	x14, x15, x14, lsl #3
	ldr	x15, [x13, #8]
	ldr	x16, [x14]
	cmp	x15, x16
	b.ne	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x15, [x13, #24]
	str	x15, [x14]
	str	x14, [x13]
	b	LBB0_2
LBB0_7:
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_maxROMcheats,4,2               ; @maxROMcheats
	.comm	_cheatIndexes,8,3               ; @cheatIndexes
	.comm	_MAX_CHEATS,4,2                 ; @MAX_CHEATS
	.comm	_cheatlist,8,3                  ; @cheatlist
	.comm	_z80_readmap,8,3                ; @z80_readmap
.subsections_via_symbols
