	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function bram_load
LCPI0_0:
	.long	0                               ## 0x0
	.long	4294967293                      ## 0xfffffffd
	.long	0                               ## 0x0
	.long	4294967293                      ## 0xfffffffd
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_bram_load:                             ## @bram_load
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_region_code@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	$-128, %eax
	cmpl	$2, %eax
	ja	LBB0_15
## %bb.1:
	cltq
	leaq	l_switch.table.bram_load(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_fopen
	movq	_scd@GOTPCREL(%rip), %r12
	movq	24(%r12), %rdi
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%rax, %rbx
	movl	$8192, %esi                     ## imm = 0x2000
	movl	$1, %edx
	movq	%rax, %rcx
	callq	_fread
	movq	%rbx, %rdi
	callq	_fclose
	movq	24(%r12), %rsi
	xorl	%edi, %edi
	movl	$8192, %edx                     ## imm = 0x2000
	callq	_crc32
	movq	_brm_crc@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rax, (%rcx)
	movq	24(%r12), %rdi
	jmp	LBB0_4
LBB0_3:
	movq	$0, 65528(%rdi)
LBB0_4:
	addq	$65280, %rdi                    ## imm = 0xFF00
	movq	_brm_format@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	subq	$-128, %rsi
	movl	$32, %edx
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	24(%r12), %rdi
	xorl	%esi, %esi
	movl	$8128, %edx                     ## imm = 0x1FC0
	callq	_memset
	movq	(%rbx), %rsi
	movaps	LCPI0_0(%rip), %xmm0            ## xmm0 = [0,4294967293,0,4294967293]
	movups	%xmm0, 80(%rsi)
	movups	%xmm0, 64(%rsi)
	movl	$65024, %edi                    ## imm = 0xFE00
	addq	24(%r12), %rdi
	movl	$64, %edx
	callq	_memcpy
	movq	_brm_crc@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	$0, (%rax)
LBB0_6:
	cmpq	$0, 16(%r12)
	je	LBB0_15
## %bb.7:
	movq	_CART_BRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_14
## %bb.8:
	movq	%rax, %r14
	movl	(%r12), %eax
	leal	1(%rax), %r15d
	movq	_CHUNKSIZE@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	xorl	%ebx, %ebx
	cmpl	%esi, %eax
	jl	LBB0_11
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movslq	%ebx, %rbx
	leaq	(,%rbx,8), %rdi
	addq	8(%r12), %rdi
	movl	$1, %edx
	movq	%r14, %rcx
	callq	_fread
	movl	(%r13), %esi
	addl	%esi, %ebx
	subl	%esi, %r15d
	cmpl	%esi, %r15d
	jg	LBB0_9
## %bb.10:
	movslq	%ebx, %rbx
LBB0_11:
	testl	%r15d, %r15d
	je	LBB0_13
## %bb.12:
	shlq	$3, %rbx
	addq	8(%r12), %rbx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	$1, %edx
	movq	%r14, %rcx
	callq	_fread
LBB0_13:
	movq	%r14, %rdi
	callq	_fclose
	movq	8(%r12), %rsi
	movl	(%r12), %edx
	incl	%edx
	xorl	%edi, %edi
	callq	_crc32
	movq	_brm_crc@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rax, 8(%rcx)
	movq	_brm_format@GOTPCREL(%rip), %rbx
LBB0_14:
	movq	8(%r12), %rax
	movslq	(%r12), %rcx
	leaq	(%rax,%rcx,8), %rdi
	addq	$-248, %rdi
	movq	(%rbx), %rsi
	subq	$-128, %rsi
	movl	$32, %edx
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_15
## %bb.16:
	movq	8(%r12), %rdi
	movl	(%r12), %edx
	incl	%edx
	xorl	%esi, %esi
	callq	_memset
	movslq	(%r12), %rax
	leal	1(%rax), %ecx
	leal	64(%rax), %edx
	testl	%ecx, %ecx
	cmovnsl	%ecx, %edx
	sarl	$6, %edx
	leal	-3(%rdx), %ecx
	sarl	$8, %ecx
	movq	(%rbx), %rsi
	movl	%ecx, 88(%rsi)
	movl	%ecx, 80(%rsi)
	movl	%ecx, 72(%rsi)
	movl	%ecx, 64(%rsi)
	addl	$253, %edx
	movzbl	%dl, %ecx
	movl	%ecx, 92(%rsi)
	movl	%ecx, 84(%rsi)
	movl	%ecx, 76(%rsi)
	movl	%ecx, 68(%rsi)
	movq	8(%r12), %rcx
	leaq	(%rcx,%rax,8), %rdi
	addq	$-504, %rdi                     ## imm = 0xFE08
	movl	$64, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_memcpy                         ## TAILCALL
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_region_code,4,2                ## @region_code
	.comm	_CD_BRAM_JP,4,2                 ## @CD_BRAM_JP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rb"

	.comm	_CD_BRAM_EU,4,2                 ## @CD_BRAM_EU
	.comm	_CD_BRAM_US,4,2                 ## @CD_BRAM_US
	.comm	_scd,32,3                       ## @scd
	.comm	_brm_crc,8,3                    ## @brm_crc
	.comm	_brm_format,8,3                 ## @brm_format
	.comm	_CART_BRAM,4,2                  ## @CART_BRAM
	.comm	_CHUNKSIZE,4,2                  ## @CHUNKSIZE
	.no_dead_strip	_bram_load
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.bram_load
l_switch.table.bram_load:
	.quad	_CD_BRAM_US
	.quad	_CD_BRAM_JP
	.quad	_CD_BRAM_EU

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function bram_load
lCPI0_0:
	.long	0                               ; 0x0
	.long	4294967293                      ; 0xfffffffd
	.long	0                               ; 0x0
	.long	4294967293                      ; 0xfffffffd
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_bram_load:                             ; @bram_load
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
Lloh0:
	adrp	x8, _region_code@GOTPAGE
Lloh1:
	ldr	x8, [x8, _region_code@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	sub	w8, w8, #128
	cmp	w8, #2
	b.hi	LBB0_17
; %bb.1:
Lloh3:
	adrp	x9, l_switch.table.bram_load@PAGE
Lloh4:
	add	x9, x9, l_switch.table.bram_load@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	ldr	w0, [x8]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fopen
	mov	x19, x0
Lloh7:
	adrp	x21, _scd@GOTPAGE
Lloh8:
	ldr	x21, [x21, _scd@GOTPAGEOFF]
	ldr	x0, [x21, #24]
Lloh9:
	adrp	x22, _brm_crc@GOTPAGE
Lloh10:
	ldr	x22, [x22, _brm_crc@GOTPAGEOFF]
	cbz	x19, LBB0_3
; %bb.2:
	mov	w1, #8192
	mov	w2, #1
	mov	x3, x19
	bl	_fread
	mov	x0, x19
	bl	_fclose
	ldr	x1, [x21, #24]
	mov	w0, #0
	mov	w2, #8192
	bl	_crc32
	ldr	x8, [x22]
	str	x0, [x8]
	ldr	x0, [x21, #24]
	b	LBB0_4
LBB0_3:
	mov	w8, #65528
	str	xzr, [x0, x8]
LBB0_4:
	mov	w8, #65280
	add	x0, x0, x8
Lloh11:
	adrp	x23, _brm_format@GOTPAGE
Lloh12:
	ldr	x23, [x23, _brm_format@GOTPAGEOFF]
	ldr	x8, [x23]
	add	x1, x8, #128
	mov	w2, #32
	bl	_memcmp
	cbz	x0, LBB0_6
; %bb.5:
	ldr	x0, [x21, #24]
	mov	w1, #0
	mov	w2, #8128
	bl	_memset
	ldr	x1, [x23]
Lloh13:
	adrp	x8, lCPI0_0@PAGE
Lloh14:
	ldr	q0, [x8, lCPI0_0@PAGEOFF]
	stp	q0, q0, [x1, #64]
	ldr	x8, [x21, #24]
	mov	w9, #65024
	add	x0, x8, x9
	mov	w2, #64
	bl	_memcpy
	ldr	x8, [x22]
	str	xzr, [x8]
LBB0_6:
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_17
; %bb.7:
Lloh15:
	adrp	x8, _CART_BRAM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CART_BRAM@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_15
; %bb.8:
	mov	x19, x0
	ldr	w8, [x21]
	add	w20, w8, #1
Lloh20:
	adrp	x24, _CHUNKSIZE@GOTPAGE
Lloh21:
	ldr	x24, [x24, _CHUNKSIZE@GOTPAGEOFF]
	ldr	w1, [x24]
	cmp	w8, w1
	b.ge	LBB0_10
; %bb.9:
	mov	x8, #0
	cbnz	w20, LBB0_13
	b	LBB0_14
LBB0_10:
	mov	w25, #0
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #8]
	add	x0, x8, w25, sxtw #3
	mov	w2, #1
	mov	x3, x19
	bl	_fread
	ldr	w1, [x24]
	add	w25, w1, w25
	sub	w20, w20, w1
	cmp	w20, w1
	b.gt	LBB0_11
; %bb.12:
	sxtw	x8, w25
	cbz	w20, LBB0_14
LBB0_13:
	ldr	x9, [x21, #8]
	add	x0, x9, x8, lsl #3
	mov	x1, x20
	mov	w2, #1
	mov	x3, x19
	bl	_fread
LBB0_14:
	mov	x0, x19
	bl	_fclose
	ldr	x1, [x21, #8]
	ldr	w8, [x21]
	add	w2, w8, #1
	mov	w0, #0
	bl	_crc32
	ldr	x8, [x22]
	str	x0, [x8, #8]
LBB0_15:
	ldr	x8, [x21, #8]
	ldrsw	x9, [x21]
	add	x8, x8, x9, lsl #3
	sub	x0, x8, #248
	ldr	x8, [x23]
	add	x1, x8, #128
	mov	w2, #32
	bl	_memcmp
	cbz	x0, LBB0_17
; %bb.16:
	ldr	x0, [x21, #8]
	ldr	w8, [x21]
	add	w2, w8, #1
	mov	w1, #0
	bl	_memset
	ldrsw	x8, [x21]
	add	w9, w8, #1
	add	w10, w8, #64
	cmp	w9, #0
	csinc	w9, w10, w8, lt
	asr	w9, w9, #6
	sub	w10, w9, #3
	asr	w10, w10, #8
	ldr	x1, [x23]
	add	w9, w9, #253
	and	w9, w9, #0xff
	stp	w10, w9, [x1, #88]
	stp	w10, w9, [x1, #80]
	stp	w10, w9, [x1, #72]
	stp	w10, w9, [x1, #64]
	ldr	x9, [x21, #8]
	add	x8, x9, x8, lsl #3
	sub	x0, x8, #504
	mov	w2, #64
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_memcpy
LBB0_17:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdr	Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_region_code,4,2                ; @region_code
	.comm	_CD_BRAM_JP,4,2                 ; @CD_BRAM_JP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rb"

	.comm	_CD_BRAM_EU,4,2                 ; @CD_BRAM_EU
	.comm	_CD_BRAM_US,4,2                 ; @CD_BRAM_US
	.comm	_scd,32,3                       ; @scd
	.comm	_brm_crc,8,3                    ; @brm_crc
	.comm	_brm_format,8,3                 ; @brm_format
	.comm	_CART_BRAM,4,2                  ; @CART_BRAM
	.comm	_CHUNKSIZE,4,2                  ; @CHUNKSIZE
	.no_dead_strip	_bram_load
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.bram_load
l_switch.table.bram_load:
	.quad	_CD_BRAM_US
	.quad	_CD_BRAM_JP
	.quad	_CD_BRAM_EU

.subsections_via_symbols
