	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_carthw_realtec_startup         ## -- Begin function carthw_realtec_startup
	.p2align	4, 0x90
_carthw_realtec_startup:                ## @carthw_realtec_startup
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_EL_STATUS@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_elprintf
	movq	_Pico@GOTPCREL(%rip), %r15
	movq	_M68K_BANK_SIZE@GOTPCREL(%rip), %r14
	movslq	(%r14), %rdi
	addq	(%r15), %rdi
	callq	_PicoCartResize
	testl	%eax, %eax
	je	LBB0_1
## %bb.5:
	movl	(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_elprintf                       ## TAILCALL
LBB0_1:
	cmpl	$0, (%r14)
	jle	LBB0_4
## %bb.2:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movq	8(%r15), %rcx
	leaq	(%rax,%rcx), %rdi
	addq	%rbx, %rdi
	leaq	(%rax,%rcx), %rsi
	addq	$-8192, %rsi                    ## imm = 0xE000
	movl	$8192, %edx                     ## imm = 0x2000
	callq	_memcpy
	addq	$8192, %rbx                     ## imm = 0x2000
	cmpl	%ebx, (%r14)
	jg	LBB0_3
LBB0_4:
	movq	_carthw_realtec_reset@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_PicoResetHook@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EL_STATUS,4,2                  ## @EL_STATUS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Realtec mapper startup"

	.comm	_Pico,16,3                      ## @Pico
	.comm	_M68K_BANK_SIZE,4,2             ## @M68K_BANK_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"OOM"

	.comm	_carthw_realtec_reset,4,2       ## @carthw_realtec_reset
	.comm	_PicoResetHook,4,2              ## @PicoResetHook
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_carthw_realtec_startup         ; -- Begin function carthw_realtec_startup
	.p2align	2
_carthw_realtec_startup:                ; @carthw_realtec_startup
	.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	x21, _EL_STATUS@GOTPAGE
Lloh1:
	ldr	x21, [x21, _EL_STATUS@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elprintf
Lloh4:
	adrp	x19, _Pico@GOTPAGE
Lloh5:
	ldr	x19, [x19, _Pico@GOTPAGEOFF]
	ldr	x8, [x19]
Lloh6:
	adrp	x20, _M68K_BANK_SIZE@GOTPAGE
Lloh7:
	ldr	x20, [x20, _M68K_BANK_SIZE@GOTPAGEOFF]
	ldrsw	x9, [x20]
	add	x0, x8, x9
	bl	_PicoCartResize
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x21]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	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	_elprintf
LBB0_2:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.3:
	mov	x21, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x9, x8, [x19]
	add	x8, x9, x8
	add	x0, x21, x8
	sub	x1, x8, #2, lsl #12             ; =8192
	mov	w2, #8192
	bl	_memcpy
	add	x21, x21, #2, lsl #12           ; =8192
	ldr	w8, [x20]
	cmp	w8, w21
	b.gt	LBB0_4
LBB0_5:
Lloh10:
	adrp	x8, _carthw_realtec_reset@GOTPAGE
Lloh11:
	ldr	x8, [x8, _carthw_realtec_reset@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _PicoResetHook@GOTPAGE
Lloh14:
	ldr	x9, [x9, _PicoResetHook@GOTPAGEOFF]
Lloh15:
	str	w8, [x9]
	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
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotStr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EL_STATUS,4,2                  ; @EL_STATUS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Realtec mapper startup"

	.comm	_Pico,16,3                      ; @Pico
	.comm	_M68K_BANK_SIZE,4,2             ; @M68K_BANK_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"OOM"

	.comm	_carthw_realtec_reset,4,2       ; @carthw_realtec_reset
	.comm	_PicoResetHook,4,2              ; @PicoResetHook
.subsections_via_symbols
