	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sections
_sections:                              ## @sections
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	movaps	%xmm0, -80(%rbp)
	movl	4(%rdi), %edi
	movq	_SFC_HDR_SIZE@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	leaq	-80(%rbp), %rdx
	movl	$32704, %esi                    ## imm = 0x7FC0
	callq	_r_buf_read_at
	leaq	L_.str(%rip), %rbx
	cmpl	(%r15), %eax
	jne	LBB0_16
## %bb.1:
	movq	-64(%rbp), %rcx
	notq	%rcx
	cmpq	%rcx, -80(%rbp)
	jne	LBB0_3
## %bb.2:
	testb	$1, -72(%rbp)
	jne	LBB0_3
## %bb.12:
	xorl	%eax, %eax
	callq	_r_list_new
	testq	%rax, %rax
	je	LBB0_17
## %bb.13:
	movq	%rax, %r15
	cmpl	$32768, (%r14)                  ## imm = 0x8000
	jl	LBB0_18
## %bb.14:
	xorl	%r12d, %r12d
	movl	$32768, %ebx                    ## imm = 0x8000
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	leaq	L_.str.2(%rip), %rsi
	movl	%r13d, %edx
	movl	%r12d, %ecx
	movl	%ebx, %r8d
	movl	$32768, %r9d                    ## imm = 0x8000
	callq	_addrom
	incl	%r13d
	movl	(%r14), %eax
	leal	32767(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$15, %ecx
	addl	$32768, %r12d                   ## imm = 0x8000
	addl	$65536, %ebx                    ## imm = 0x10000
	cmpl	%ecx, %r13d
	jl	LBB0_15
	jmp	LBB0_18
LBB0_3:
	movl	4(%r14), %edi
	leaq	-80(%rbp), %rdx
	movl	$65472, %esi                    ## imm = 0xFFC0
	movl	%eax, %ecx
	callq	_r_buf_read_at
	cmpl	(%r15), %eax
	jne	LBB0_16
## %bb.4:
	movq	-64(%rbp), %rax
	notq	%rax
	leaq	L_.str.1(%rip), %rbx
	cmpq	%rax, -80(%rbp)
	jne	LBB0_16
## %bb.5:
	testb	$1, -72(%rbp)
	jne	LBB0_6
LBB0_16:
	movq	%rbx, %rdi
	callq	_eprintf
LBB0_17:
	xorl	%r15d, %r15d
LBB0_18:
	movq	%r15, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	xorl	%eax, %eax
	callq	_r_list_new
	testq	%rax, %rax
	je	LBB0_17
## %bb.7:
	movq	%rax, %r15
	cmpl	$32768, (%r14)                  ## imm = 0x8000
	jl	LBB0_18
## %bb.8:
	xorl	%ebx, %ebx
	leaq	L_.str.2(%rip), %r12
	xorl	%r13d, %r13d
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	incl	%r13d
	movl	(%r14), %eax
	leal	32767(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$15, %ecx
	addl	$32768, %ebx                    ## imm = 0x8000
	cmpl	%ecx, %r13d
	jge	LBB0_18
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	leal	4194304(%rbx), %r8d
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	%r13d, %edx
	movl	%ebx, %ecx
	movl	$32768, %r9d                    ## imm = 0x8000
	callq	_addrom
	testb	$1, %r13b
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r15, %rdi
	leaq	L_.str.3(%rip), %rsi
	movl	%r13d, %edx
	movl	%ebx, %ecx
	movl	%ebx, %r8d
	movl	$32768, %r9d                    ## imm = 0x8000
	callq	_addrom
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_SFC_HDR_SIZE,4,2               ## @SFC_HDR_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to read SFC/SNES header\n"

L_.str.1:                               ## @.str.1
	.asciz	"Cannot determine if this is a LoROM or HiROM file\n"

L_.str.2:                               ## @.str.2
	.asciz	"ROM"

L_.str.3:                               ## @.str.3
	.asciz	"ROM_MIRROR"

	.no_dead_strip	_sections
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sections
_sections:                              ; @sections
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x0
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp]
	ldr	w0, [x0, #4]
Lloh0:
	adrp	x20, _SFC_HDR_SIZE@GOTPAGE
Lloh1:
	ldr	x20, [x20, _SFC_HDR_SIZE@GOTPAGEOFF]
	ldr	w3, [x20]
	mov	x2, sp
	mov	w1, #32704
	bl	_r_buf_read_at
	ldr	w8, [x20]
	cmp	w0, w8
	b.ne	LBB0_11
; %bb.1:
	mov	x3, x0
	ldr	x8, [sp]
	ldr	x9, [sp, #16]
	mvn	x9, x9
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.2:
	ldrb	w8, [sp, #8]
	tbnz	w8, #0, LBB0_7
; %bb.3:
	bl	_r_list_new
	mov	x20, x0
	cbz	x0, LBB0_13
; %bb.4:
	ldr	w8, [x19]
	cmp	w8, #8, lsl #12                 ; =32768
	b.lt	LBB0_13
; %bb.5:
	mov	w21, #0
	mov	w22, #0
	mov	w23, #32768
	mov	w25, #32767
Lloh2:
	adrp	x24, l_.str.2@PAGE
Lloh3:
	add	x24, x24, l_.str.2@PAGEOFF
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x24
	mov	x2, x22
	mov	x3, x21
	mov	x4, x23
	mov	w5, #32768
	bl	_addrom
	add	w22, w22, #1
	ldr	w8, [x19]
	add	w9, w8, w25
	cmp	w8, #0
	csel	w8, w9, w8, lt
	add	w21, w21, #8, lsl #12           ; =32768
	add	w23, w23, #16, lsl #12          ; =65536
	cmp	w22, w8, asr #15
	b.lt	LBB0_6
	b	LBB0_13
LBB0_7:
	ldr	w0, [x19, #4]
	mov	x2, sp
	mov	w1, #65472
	bl	_r_buf_read_at
	ldr	w8, [x20]
	cmp	w0, w8
	b.ne	LBB0_11
; %bb.8:
	ldr	x8, [sp]
	ldr	x9, [sp, #16]
	mvn	x9, x9
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.9:
	ldrb	w8, [sp, #8]
	tbnz	w8, #0, LBB0_14
LBB0_10:
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_11:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
LBB0_12:
	bl	_eprintf
	mov	x20, #0
LBB0_13:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_14:
	bl	_r_list_new
	mov	x20, x0
	cbz	x0, LBB0_13
; %bb.15:
	ldr	w8, [x19]
	cmp	w8, #8, lsl #12                 ; =32768
	b.lt	LBB0_13
; %bb.16:
	mov	w21, #0
	mov	w22, #0
Lloh8:
	adrp	x23, l_.str.2@PAGE
Lloh9:
	add	x23, x23, l_.str.2@PAGEOFF
	mov	w25, #32767
Lloh10:
	adrp	x24, l_.str.3@PAGE
Lloh11:
	add	x24, x24, l_.str.3@PAGEOFF
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=1
	add	w22, w22, #1
	ldr	w8, [x19]
	add	w9, w8, w25
	cmp	w8, #0
	csel	w8, w9, w8, lt
	add	w21, w21, #8, lsl #12           ; =32768
	cmp	w22, w8, asr #15
	b.ge	LBB0_13
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	add	w4, w21, #1024, lsl #12         ; =4194304
	mov	x0, x20
	mov	x1, x23
	mov	x2, x22
	mov	x3, x21
	mov	w5, #32768
	bl	_addrom
	tbz	w22, #0, LBB0_17
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	mov	x0, x20
	mov	x1, x24
	mov	x2, x22
	mov	x3, x21
	mov	x4, x21
	mov	w5, #32768
	bl	_addrom
	b	LBB0_17
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_SFC_HDR_SIZE,4,2               ; @SFC_HDR_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to read SFC/SNES header\n"

l_.str.1:                               ; @.str.1
	.asciz	"Cannot determine if this is a LoROM or HiROM file\n"

l_.str.2:                               ; @.str.2
	.asciz	"ROM"

l_.str.3:                               ; @.str.3
	.asciz	"ROM_MIRROR"

	.no_dead_strip	_sections
.subsections_via_symbols
