	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cd_cart_init                   ## -- Begin function cd_cart_init
	.p2align	4, 0x90
_cd_cart_init:                          ## @cd_cart_init
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_scd@GOTPCREL(%rip), %r14
	xorl	%eax, %eax
	cmpq	$0, 16(%r14)
	movl	$6, %ecx
	cmovnel	%eax, %ecx
	movl	%ecx, (%r14)
	je	LBB0_1
## %bb.7:
	xorl	%eax, %eax
	callq	_md_cart_init
	cmpq	$0, 16(%r14)
	jne	LBB0_10
## %bb.8:
	movq	_m68k@GOTPCREL(%rip), %rcx
	movl	$2592, %eax                     ## imm = 0xA20
	addq	(%rcx), %rax
	movq	$-1024, %rcx                    ## imm = 0xFC00
	movq	_zbank_memory_map@GOTPCREL(%rip), %rdx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movups	-2568(%rax), %xmm0
	movups	%xmm0, -8(%rax)
	movl	-2576(%rax), %esi
	movl	%esi, -16(%rax)
	movq	-2584(%rax), %rsi
	movq	%rsi, -24(%rax)
	movl	-2592(%rax), %esi
	movl	%esi, -32(%rax)
	movq	(%rdx), %rsi
	movq	1032(%rsi,%rcx), %rdi
	movq	%rdi, 2056(%rsi,%rcx)
	movq	(%rdx), %rsi
	movq	1024(%rsi,%rcx), %rdi
	movq	%rdi, 2048(%rsi,%rcx)
	addq	$40, %rax
	addq	$16, %rcx
	jne	LBB0_9
	jmp	LBB0_10
LBB0_1:
	movq	_sram@GOTPCREL(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	24(%r14), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movb	(%r14), %cl
	addb	$13, %cl
	movl	$-1, %eax
	shll	%cl, %eax
	notl	%eax
	movl	%eax, 4(%r14)
	movl	$1, 8(%r14)
	movq	_m68k@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	2592(%rax), %rdx
	movq	_cart_id_read_byte@GOTPCREL(%rip), %r14
	movq	_cart_id_read_word@GOTPCREL(%rip), %r8
	movq	_m68k_unused_8_w@GOTPCREL(%rip), %r9
	movq	_m68k_unused_16_w@GOTPCREL(%rip), %r10
	movq	_zbank_memory_map@GOTPCREL(%rip), %rcx
	movq	_zbank_unused_w@GOTPCREL(%rip), %r11
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	$0, (%rdx)
	movq	(%r14), %rdi
	movq	%rdi, -8(%rdx)
	movl	(%r8), %edi
	movl	%edi, -16(%rdx)
	movq	(%r9), %rdi
	movq	%rdi, -24(%rdx)
	movl	(%r10), %edi
	movl	%edi, -32(%rdx)
	movq	(%r14), %rdi
	movq	(%rcx), %rsi
	movq	%rdi, 1032(%rsi,%rbx)
	movq	(%r11), %rsi
	movq	(%rcx), %rdi
	movq	%rsi, 1024(%rdi,%rbx)
	addq	$40, %rdx
	addq	$16, %rbx
	cmpq	$512, %rbx                      ## imm = 0x200
	jne	LBB0_2
## %bb.3:
	leaq	3872(%rax), %rdx
	xorl	%esi, %esi
	movq	_cart_ram_read_byte@GOTPCREL(%rip), %r10
	movq	_cart_ram_read_word@GOTPCREL(%rip), %r8
	movq	_cart_ram_write_byte@GOTPCREL(%rip), %r11
	movq	_cart_ram_write_word@GOTPCREL(%rip), %r9
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	$0, (%rdx)
	movq	(%r10), %rdi
	movq	%rdi, -8(%rdx)
	movl	(%r8), %edi
	movl	%edi, -16(%rdx)
	movq	(%r11), %rdi
	movq	%rdi, -24(%rdx)
	movl	(%r9), %edi
	movl	%edi, -32(%rdx)
	movq	(%r10), %rdi
	movq	(%rcx), %rbx
	movq	%rdi, 1544(%rbx,%rsi)
	movq	(%r11), %rdi
	movq	(%rcx), %rbx
	movq	%rdi, 1536(%rbx,%rsi)
	addq	$40, %rdx
	addq	$16, %rsi
	cmpq	$256, %rsi                      ## imm = 0x100
	jne	LBB0_4
## %bb.5:
	addq	$4512, %rax                     ## imm = 0x11A0
	xorl	%edx, %edx
	movq	_cart_prot_read_byte@GOTPCREL(%rip), %r10
	movq	_cart_prot_read_word@GOTPCREL(%rip), %r8
	movq	_cart_prot_write_byte@GOTPCREL(%rip), %rbx
	movq	_cart_prot_write_word@GOTPCREL(%rip), %r9
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	$0, (%rax)
	movq	(%r10), %rdi
	movq	%rdi, -8(%rax)
	movl	(%r8), %edi
	movl	%edi, -16(%rax)
	movq	(%rbx), %rdi
	movq	%rdi, -24(%rax)
	movl	(%r9), %edi
	movl	%edi, -32(%rax)
	movq	(%r10), %rdi
	movq	(%rcx), %rsi
	movq	%rdi, 1800(%rsi,%rdx)
	movq	(%rbx), %rsi
	movq	(%rcx), %rdi
	movq	%rsi, 1792(%rdi,%rdx)
	addq	$40, %rax
	addq	$16, %rdx
	cmpq	$256, %rdx                      ## imm = 0x100
	jne	LBB0_6
LBB0_10:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_scd,32,3                       ## @scd
	.comm	_sram,4,2                       ## @sram
	.comm	_m68k,8,3                       ## @m68k
	.comm	_cart_id_read_byte,8,3          ## @cart_id_read_byte
	.comm	_cart_id_read_word,4,2          ## @cart_id_read_word
	.comm	_m68k_unused_8_w,8,3            ## @m68k_unused_8_w
	.comm	_m68k_unused_16_w,4,2           ## @m68k_unused_16_w
	.comm	_zbank_memory_map,8,3           ## @zbank_memory_map
	.comm	_zbank_unused_w,8,3             ## @zbank_unused_w
	.comm	_cart_ram_read_byte,8,3         ## @cart_ram_read_byte
	.comm	_cart_ram_read_word,4,2         ## @cart_ram_read_word
	.comm	_cart_ram_write_byte,8,3        ## @cart_ram_write_byte
	.comm	_cart_ram_write_word,4,2        ## @cart_ram_write_word
	.comm	_cart_prot_read_byte,8,3        ## @cart_prot_read_byte
	.comm	_cart_prot_read_word,4,2        ## @cart_prot_read_word
	.comm	_cart_prot_write_byte,8,3       ## @cart_prot_write_byte
	.comm	_cart_prot_write_word,4,2       ## @cart_prot_write_word
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cd_cart_init                   ; -- Begin function cd_cart_init
	.p2align	2
_cd_cart_init:                          ; @cd_cart_init
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x19, _scd@GOTPAGE
Lloh1:
	ldr	x19, [x19, _scd@GOTPAGEOFF]
	ldr	x8, [x19, #16]
	cmp	x8, #0
	mov	w9, #6
	csel	w9, w9, wzr, eq
	str	w9, [x19]
	cbz	x8, LBB0_4
; %bb.1:
	bl	_md_cart_init
	ldr	x8, [x19, #16]
	cbnz	x8, LBB0_10
; %bb.2:
	mov	x9, #0
Lloh2:
	adrp	x10, _m68k@GOTPAGE
Lloh3:
	ldr	x10, [x10, _m68k@GOTPAGEOFF]
Lloh4:
	ldr	x10, [x10]
Lloh5:
	adrp	x11, _zbank_memory_map@GOTPAGE
Lloh6:
	ldr	x11, [x11, _zbank_memory_map@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	x12, x10, x9
	ldp	x14, x13, [x12, #24]
	str	x13, [x12, #2592]
	str	x14, [x12, #2584]
	ldr	w13, [x12, #16]
	str	w13, [x12, #2576]
	ldr	x13, [x12, #8]
	str	x13, [x12, #2568]
	ldr	w13, [x12]
	str	w13, [x12, #2560]
	ldr	x12, [x11]
	add	x12, x12, x8
	ldr	x13, [x12, #8]
	str	x13, [x12, #1032]
	ldr	x12, [x11]
	add	x12, x12, x8
	ldr	x13, [x12]
	str	x13, [x12, #1024]
	add	x9, x9, #40
	add	x8, x8, #16
	cmp	x9, #2560
	b.ne	LBB0_3
	b	LBB0_10
LBB0_4:
Lloh7:
	adrp	x0, _sram@GOTPAGE
Lloh8:
	ldr	x0, [x0, _sram@GOTPAGEOFF]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	x0, [x19, #24]
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	mov	x10, #0
	ldr	w8, [x19]
	add	w8, w8, #13
	mov	w9, #-1
	lsl	w8, w9, w8
	mvn	w8, w8
	mov	w9, #1
	stp	w8, w9, [x19, #4]
Lloh9:
	adrp	x8, _m68k@GOTPAGE
Lloh10:
	ldr	x8, [x8, _m68k@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	mov	w11, #1032
Lloh12:
	adrp	x12, _cart_id_read_byte@GOTPAGE
Lloh13:
	ldr	x12, [x12, _cart_id_read_byte@GOTPAGEOFF]
Lloh14:
	adrp	x13, _cart_id_read_word@GOTPAGE
Lloh15:
	ldr	x13, [x13, _cart_id_read_word@GOTPAGEOFF]
Lloh16:
	adrp	x14, _m68k_unused_8_w@GOTPAGE
Lloh17:
	ldr	x14, [x14, _m68k_unused_8_w@GOTPAGEOFF]
Lloh18:
	adrp	x15, _m68k_unused_16_w@GOTPAGE
Lloh19:
	ldr	x15, [x15, _m68k_unused_16_w@GOTPAGEOFF]
Lloh20:
	adrp	x9, _zbank_memory_map@GOTPAGE
Lloh21:
	ldr	x9, [x9, _zbank_memory_map@GOTPAGEOFF]
Lloh22:
	adrp	x16, _zbank_unused_w@GOTPAGE
Lloh23:
	ldr	x16, [x16, _zbank_unused_w@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	x17, x8, x10
	str	xzr, [x17, #2592]
	ldr	x0, [x12]
	str	x0, [x17, #2584]
	ldr	w0, [x13]
	str	w0, [x17, #2576]
	ldr	x0, [x14]
	str	x0, [x17, #2568]
	ldr	w0, [x15]
	str	w0, [x17, #2560]
	ldr	x17, [x12]
	ldr	x0, [x9]
	str	x17, [x0, x11]
	ldr	x17, [x16]
	ldr	x0, [x9]
	add	x0, x0, x11
	stur	x17, [x0, #-8]
	add	x10, x10, #40
	add	x11, x11, #16
	cmp	x10, #1280
	b.ne	LBB0_5
; %bb.6:
	mov	x10, #0
	mov	w11, #1544
Lloh24:
	adrp	x12, _cart_ram_read_byte@GOTPAGE
Lloh25:
	ldr	x12, [x12, _cart_ram_read_byte@GOTPAGEOFF]
Lloh26:
	adrp	x13, _cart_ram_read_word@GOTPAGE
Lloh27:
	ldr	x13, [x13, _cart_ram_read_word@GOTPAGEOFF]
Lloh28:
	adrp	x14, _cart_ram_write_byte@GOTPAGE
Lloh29:
	ldr	x14, [x14, _cart_ram_write_byte@GOTPAGEOFF]
Lloh30:
	adrp	x15, _cart_ram_write_word@GOTPAGE
Lloh31:
	ldr	x15, [x15, _cart_ram_write_word@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	add	x16, x8, x10
	str	xzr, [x16, #3872]
	ldr	x17, [x12]
	str	x17, [x16, #3864]
	ldr	w17, [x13]
	str	w17, [x16, #3856]
	ldr	x17, [x14]
	str	x17, [x16, #3848]
	ldr	w17, [x15]
	str	w17, [x16, #3840]
	ldr	x16, [x12]
	ldr	x17, [x9]
	str	x16, [x17, x11]
	ldr	x16, [x14]
	ldr	x17, [x9]
	add	x17, x17, x11
	stur	x16, [x17, #-8]
	add	x10, x10, #40
	add	x11, x11, #16
	cmp	x10, #640
	b.ne	LBB0_7
; %bb.8:
	mov	x10, #0
	mov	w11, #1800
Lloh32:
	adrp	x12, _cart_prot_read_byte@GOTPAGE
Lloh33:
	ldr	x12, [x12, _cart_prot_read_byte@GOTPAGEOFF]
Lloh34:
	adrp	x13, _cart_prot_read_word@GOTPAGE
Lloh35:
	ldr	x13, [x13, _cart_prot_read_word@GOTPAGEOFF]
Lloh36:
	adrp	x14, _cart_prot_write_byte@GOTPAGE
Lloh37:
	ldr	x14, [x14, _cart_prot_write_byte@GOTPAGEOFF]
Lloh38:
	adrp	x15, _cart_prot_write_word@GOTPAGE
Lloh39:
	ldr	x15, [x15, _cart_prot_write_word@GOTPAGEOFF]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	add	x16, x8, x10
	str	xzr, [x16, #4512]
	ldr	x17, [x12]
	str	x17, [x16, #4504]
	ldr	w17, [x13]
	str	w17, [x16, #4496]
	ldr	x17, [x14]
	str	x17, [x16, #4488]
	ldr	w17, [x15]
	str	w17, [x16, #4480]
	ldr	x16, [x12]
	ldr	x17, [x9]
	str	x16, [x17, x11]
	ldr	x16, [x14]
	ldr	x17, [x9]
	add	x17, x17, x11
	stur	x16, [x17, #-8]
	add	x10, x10, #40
	add	x11, x11, #16
	cmp	x10, #640
	b.ne	LBB0_9
LBB0_10:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_scd,32,3                       ; @scd
	.comm	_sram,4,2                       ; @sram
	.comm	_m68k,8,3                       ; @m68k
	.comm	_cart_id_read_byte,8,3          ; @cart_id_read_byte
	.comm	_cart_id_read_word,4,2          ; @cart_id_read_word
	.comm	_m68k_unused_8_w,8,3            ; @m68k_unused_8_w
	.comm	_m68k_unused_16_w,4,2           ; @m68k_unused_16_w
	.comm	_zbank_memory_map,8,3           ; @zbank_memory_map
	.comm	_zbank_unused_w,8,3             ; @zbank_unused_w
	.comm	_cart_ram_read_byte,8,3         ; @cart_ram_read_byte
	.comm	_cart_ram_read_word,4,2         ; @cart_ram_read_word
	.comm	_cart_ram_write_byte,8,3        ; @cart_ram_write_byte
	.comm	_cart_ram_write_word,4,2        ; @cart_ram_write_word
	.comm	_cart_prot_read_byte,8,3        ; @cart_prot_read_byte
	.comm	_cart_prot_read_word,4,2        ; @cart_prot_read_word
	.comm	_cart_prot_write_byte,8,3       ; @cart_prot_write_byte
	.comm	_cart_prot_write_word,4,2       ; @cart_prot_write_word
.subsections_via_symbols
