	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ctr_check_dspfirm
_ctr_check_dspfirm:                     ## @ctr_check_dspfirm
	.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
	leaq	L_.str(%rip), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %rdi
	jmp	LBB0_2
LBB0_3:
	leaq	L_.str.2(%rip), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_14
## %bb.4:
	movq	%rax, %r15
	movq	_SEEK_END@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_fseek
	movq	%r15, %rdi
	callq	_ftell
	movq	%rax, %rbx
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_fseek
	movq	%rbx, %rdi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_13
## %bb.5:
	movq	%rax, %r14
	movq	%rax, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movq	%r15, %rcx
	callq	_fread
	cmpq	$260, %rbx                      ## imm = 0x104
	jb	LBB0_12
## %bb.6:
	andq	$-4, %rbx
	leaq	(%r14,%rbx,2), %rax
	movq	%r14, %rbx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$827347780, 512(%rbx)           ## imm = 0x31505344
	je	LBB0_8
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	leaq	8(%rbx), %rcx
	addq	$520, %rbx                      ## imm = 0x208
	cmpq	%rax, %rbx
	movq	%rcx, %rbx
	jb	LBB0_7
	jmp	LBB0_12
LBB0_14:
	leaq	L_.str.4(%rip), %rbx
	movq	%rbx, %rdi
	callq	_RARCH_WARN
	movq	%rbx, %rdi
	callq	_RARCH_WARN
	leaq	L_.str.5(%rip), %rdi
	callq	_RARCH_WARN
	leaq	L_.str.6(%rip), %rdi
	callq	_RARCH_WARN
	leaq	L_.str.7(%rip), %rdi
	callq	_RARCH_WARN
	leaq	L_.str.8(%rip), %rdi
	callq	_RARCH_WARN
	movq	%rbx, %rdi
	callq	_RARCH_WARN
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_RARCH_WARN                     ## TAILCALL
LBB0_8:
	movq	520(%rbx), %r12
	movq	%r12, %rcx
	andq	$-4, %rcx
	leaq	(%rbx,%rcx,2), %rcx
	cmpq	%rax, %rcx
	ja	LBB0_12
## %bb.9:
	leaq	L_.str(%rip), %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:
	movq	%rax, %r13
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movq	%rax, %rcx
	callq	_fwrite
	movq	%r13, %rdi
	callq	_fclose
LBB0_12:
	movq	%r14, %rdi
	callq	_free
LBB0_13:
	movq	%r15, %rdi
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_fclose                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sdmc:/3ds/dspfirm.cdc"

L_.str.1:                               ## @.str.1
	.asciz	"rb"

L_.str.2:                               ## @.str.2
	.asciz	"sdmc:/3ds/code.bin"

	.comm	_SEEK_END,4,2                   ## @SEEK_END
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
L_.str.3:                               ## @.str.3
	.asciz	"wb"

L_.str.4:                               ## @.str.4
	.asciz	"\n"

L_.str.5:                               ## @.str.5
	.asciz	"Warning:\n"

L_.str.6:                               ## @.str.6
	.asciz	"3DS DSP dump is missing.\n"

L_.str.7:                               ## @.str.7
	.asciz	"A working DSP dump is required\n"

L_.str.8:                               ## @.str.8
	.asciz	"for correct operation.\n"

	.no_dead_strip	_ctr_check_dspfirm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ctr_check_dspfirm
_ctr_check_dspfirm:                     ; @ctr_check_dspfirm
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fopen
	cbnz	x0, LBB0_13
; %bb.1:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_7
; %bb.2:
	mov	x19, x0
Lloh8:
	adrp	x8, _SEEK_END@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SEEK_END@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_fseek
	mov	x0, x19
	bl	_ftell
	mov	x21, x0
Lloh11:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_fseek
	mov	x0, x21
	bl	_malloc
	cbz	x0, LBB0_12
; %bb.3:
	mov	x20, x0
	mov	w1, #1
	mov	x2, x21
	mov	x3, x19
	bl	_fread
	cmp	x21, #260
	b.lo	LBB0_11
; %bb.4:
	lsl	x8, x21, #1
	and	x8, x8, #0xfffffffffffffff8
	add	x8, x20, x8
	mov	w9, #21316
	movk	w9, #12624, lsl #16
	mov	x21, x20
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x21, #512]
	cmp	x10, x9
	b.eq	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x10, x21, #520
	add	x21, x21, #8
	cmp	x10, x8
	b.lo	LBB0_5
	b	LBB0_11
LBB0_7:
Lloh14:
	adrp	x19, l_.str.4@PAGE
Lloh15:
	add	x19, x19, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_RARCH_WARN
	mov	x0, x19
	bl	_RARCH_WARN
Lloh16:
	adrp	x0, l_.str.5@PAGE
Lloh17:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_RARCH_WARN
Lloh18:
	adrp	x0, l_.str.6@PAGE
Lloh19:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_RARCH_WARN
Lloh20:
	adrp	x0, l_.str.7@PAGE
Lloh21:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_RARCH_WARN
Lloh22:
	adrp	x0, l_.str.8@PAGE
Lloh23:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_RARCH_WARN
	mov	x0, x19
	bl	_RARCH_WARN
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_RARCH_WARN
LBB0_8:
	ldr	x22, [x21, #520]
	lsl	x9, x22, #1
	and	x9, x9, #0xfffffffffffffff8
	add	x9, x21, x9
	cmp	x9, x8
	b.hi	LBB0_11
; %bb.9:
Lloh24:
	adrp	x0, l_.str@PAGE
Lloh25:
	add	x0, x0, l_.str@PAGEOFF
Lloh26:
	adrp	x1, l_.str.3@PAGE
Lloh27:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_11
; %bb.10:
	mov	x23, x0
	mov	x0, x21
	mov	w1, #1
	mov	x2, x22
	mov	x3, x23
	bl	_fwrite
	mov	x0, x23
	bl	_fclose
LBB0_11:
	mov	x0, x20
	bl	_free
LBB0_12:
	mov	x0, x19
LBB0_13:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_fclose
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sdmc:/3ds/dspfirm.cdc"

l_.str.1:                               ; @.str.1
	.asciz	"rb"

l_.str.2:                               ; @.str.2
	.asciz	"sdmc:/3ds/code.bin"

	.comm	_SEEK_END,4,2                   ; @SEEK_END
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
l_.str.3:                               ; @.str.3
	.asciz	"wb"

l_.str.4:                               ; @.str.4
	.asciz	"\n"

l_.str.5:                               ; @.str.5
	.asciz	"Warning:\n"

l_.str.6:                               ; @.str.6
	.asciz	"3DS DSP dump is missing.\n"

l_.str.7:                               ; @.str.7
	.asciz	"A working DSP dump is required\n"

l_.str.8:                               ; @.str.8
	.asciz	"for correct operation.\n"

	.no_dead_strip	_ctr_check_dspfirm
.subsections_via_symbols
