	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function update_8000_9fff
_update_8000_9fff:                      ## @update_8000_9fff
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_not_right_cartridge_rd4_control@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_1
LBB0_4:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_not_rom_output_enable@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.5:
	movq	_MEMORY_mem@GOTPCREL(%rip), %rax
	movl	$32768, %edi                    ## imm = 0x8000
	addq	(%rax), %rdi
	movl	$255, %esi
	movl	$8192, %edx                     ## imm = 0x2000
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_memset                         ## TAILCALL
LBB0_2:
	movl	$32768, %ebx                    ## imm = 0x8000
	movq	_MEMORY_mem@GOTPCREL(%rip), %r14
	movq	_af80_rom@GOTPCREL(%rip), %r15
	movq	_rom_bank_select@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	addq	%rbx, %rdi
	movl	(%r12), %eax
	shll	$8, %eax
	movslq	%eax, %rsi
	addq	(%r15), %rsi
	movl	$256, %edx                      ## imm = 0x100
	callq	_memcpy
	addq	$256, %rbx                      ## imm = 0x100
	cmpq	$40960, %rbx                    ## imm = 0xA000
	jne	LBB0_3
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_not_right_cartridge_rd4_control,8,3 ## @not_right_cartridge_rd4_control
	.comm	_not_rom_output_enable,8,3      ## @not_rom_output_enable
	.comm	_MEMORY_mem,8,3                 ## @MEMORY_mem
	.comm	_af80_rom,8,3                   ## @af80_rom
	.comm	_rom_bank_select,4,2            ## @rom_bank_select
	.no_dead_strip	_update_8000_9fff
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function update_8000_9fff
_update_8000_9fff:                      ; @update_8000_9fff
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
Lloh0:
	adrp	x8, _not_right_cartridge_rd4_control@GOTPAGE
Lloh1:
	ldr	x8, [x8, _not_right_cartridge_rd4_control@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
LBB0_1:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_2:
Lloh3:
	adrp	x8, _not_rom_output_enable@GOTPAGE
Lloh4:
	ldr	x8, [x8, _not_rom_output_enable@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.3:
Lloh6:
	adrp	x8, _MEMORY_mem@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MEMORY_mem@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	add	x0, x8, #8, lsl #12             ; =32768
	mov	w1, #255
	mov	w2, #8192
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_memset
LBB0_4:
	mov	w19, #32768
Lloh9:
	adrp	x20, _MEMORY_mem@GOTPAGE
Lloh10:
	ldr	x20, [x20, _MEMORY_mem@GOTPAGEOFF]
Lloh11:
	adrp	x21, _af80_rom@GOTPAGE
Lloh12:
	ldr	x21, [x21, _af80_rom@GOTPAGEOFF]
Lloh13:
	adrp	x22, _rom_bank_select@GOTPAGE
Lloh14:
	ldr	x22, [x22, _rom_bank_select@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	add	x0, x19, x8
	ldr	x8, [x21]
	ldr	w9, [x22]
	lsl	w9, w9, #8
	add	x1, x8, w9, sxtw
	mov	w2, #256
	bl	_memcpy
	add	x19, x19, #256
	cmp	x19, #10, lsl #12               ; =40960
	b.ne	LBB0_5
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_not_right_cartridge_rd4_control,8,3 ; @not_right_cartridge_rd4_control
	.comm	_not_rom_output_enable,8,3      ; @not_rom_output_enable
	.comm	_MEMORY_mem,8,3                 ; @MEMORY_mem
	.comm	_af80_rom,8,3                   ; @af80_rom
	.comm	_rom_bank_select,4,2            ; @rom_bank_select
	.no_dead_strip	_update_8000_9fff
.subsections_via_symbols
