	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __card_domount
___card_domount:                        ## @__card_domount
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_EXI_CHANNEL_0@GOTPCREL(%rip), %rax
	cmpq	%rdi, (%rax)
	ja	LBB0_2
## %bb.1:
	movq	%rdi, %r14
	movq	_EXI_CHANNEL_2@GOTPCREL(%rip), %rax
	cmpq	%rdi, (%rax)
	jbe	LBB0_2
## %bb.3:
	movq	_cardmap@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	leaq	(%r14,%r14,2), %rbx
	shlq	$4, %rbx
	leaq	(%r15,%rbx), %r12
	movl	(%r15,%rbx), %eax
	testl	%eax, %eax
	je	LBB0_4
## %bb.16:
	cmpl	$1, %eax
	jne	LBB0_18
LBB0_17:
	movl	$2, (%r12)
	movq	%r14, %rdi
	movl	$1, %esi
	callq	___card_enableinterrupt
	movq	___card_exihandler@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_EXI_RegisterEXICallback
	movq	%r14, %rdi
	callq	_EXI_Unlock
	movq	24(%r15,%rbx), %rdi
	movl	$40960, %esi                    ## imm = 0xA000
	callq	_DCInvalidateRange
	movl	(%r12), %eax
LBB0_18:
	movl	12(%r15,%rbx), %edx
	addl	$-2, %eax
	movl	%eax, %esi
	imull	%edx, %esi
	shll	$13, %eax
	movslq	%eax, %rcx
	addq	24(%r15,%rbx), %rcx
	movq	___card_mountcallback@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r14, %rdi
	callq	___card_read
	movq	%rax, %r12
	jmp	LBB0_19
LBB0_2:
	movq	_CARD_ERROR_NOCARD@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
LBB0_19:
	movq	%r12, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	$0, -44(%rbp)
	movq	_EXI_DEVICE_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	callq	_EXI_GetID
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movl	-44(%rbp), %edi
	callq	___card_iscard
LBB0_6:
	movl	-44(%rbp), %eax
	movl	%eax, 4(%r15,%rbx)
	movl	$252, %eax
	andl	-44(%rbp), %eax
	movl	%eax, 8(%r15,%rbx)
	je	LBB0_15
## %bb.7:
	leaq	(%r15,%rbx), %r13
	addq	$8, %r13
	movl	-44(%rbp), %edi
	movl	$23, %esi
	callq	__ROTL
                                        ## kill: def $eax killed $eax def $rax
	movq	_card_sector_size@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	shrl	$2, %eax
	andl	$7, %eax
	movl	(%rcx,%rax,4), %ecx
	movl	%ecx, 12(%r15,%rbx)
	movl	(%r13), %eax
	shll	$20, %eax
	sarl	$3, %eax
	cltd
	idivl	%ecx
	movl	%eax, 16(%r15,%rbx)
	cmpl	$9, %eax
	jl	LBB0_15
## %bb.8:
	movl	-44(%rbp), %edi
	movl	$26, %esi
	callq	__ROTL
                                        ## kill: def $eax killed $eax def $rax
	movq	_card_latency@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	shrl	$2, %eax
	andl	$7, %eax
	movl	(%rcx,%rax,4), %eax
	movl	%eax, 40(%r15,%rbx)
	movq	%r14, %rdi
	callq	___card_clearstatus
	leaq	-52(%rbp), %rsi
	movq	%r14, %rdi
	callq	___card_readstatus
	movq	%r14, %rdi
	callq	_EXI_Probe
	testq	%rax, %rax
	je	LBB0_9
## %bb.11:
	movq	_CARD_STATUS_UNLOCKED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -52(%rbp)
	je	LBB0_12
## %bb.13:
	movl	$1, (%r12)
	xorl	%eax, %eax
	callq	___SYS_LockSramEx
	movq	(%rax), %rcx
	movq	8(%rax), %rax
	movq	(%rcx,%r14,8), %rcx
	movdqu	(%rcx), %xmm0
	movdqu	16(%rcx), %xmm1
	movdqu	32(%rcx), %xmm2
	paddd	%xmm1, %xmm2
	pshufd	$238, %xmm2, %xmm1              ## xmm1 = xmm2[2,3,2,3]
	paddd	%xmm2, %xmm1
	pshufd	$85, %xmm1, %xmm2               ## xmm2 = xmm1[1,1,1,1]
	paddd	%xmm1, %xmm2
	movd	%xmm2, %ecx
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	paddd	%xmm0, %xmm1
	pshufd	$85, %xmm1, %xmm0               ## xmm0 = xmm1[1,1,1,1]
	paddd	%xmm1, %xmm0
	movd	%xmm0, %r13d
	addl	%ecx, %r13d
	notl	%r13d
	movl	(%rax,%r14,4), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	xorl	%edi, %edi
	callq	___SYS_UnlockSramEx
	movzbl	%r13b, %eax
	movl	%eax, %ecx
	shll	$8, %ecx
	orl	%eax, %ecx
	cmpl	%ecx, -48(%rbp)                 ## 4-byte Folded Reload
	jne	LBB0_14
LBB0_15:
	movl	(%r12), %eax
	cmpl	$1, %eax
	je	LBB0_17
	jmp	LBB0_18
LBB0_9:
	movq	_CARD_ERROR_NOCARD@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_12:
	movq	32(%r15,%rbx), %rsi
	movq	%r14, %rdi
	callq	___dounlock
	movq	%rax, %r12
	xorl	%eax, %eax
	callq	___SYS_LockSramEx
	movq	32(%r15,%rbx), %rdx
	movq	(%rax), %rcx
	movq	(%rcx,%r14,8), %rsi
	movl	(%rdx), %edi
	movl	%edi, (%rsi)
	movl	4(%rdx), %ecx
	movl	%ecx, 4(%rsi)
	addl	%edi, %ecx
	movl	8(%rdx), %edi
	movl	%edi, 8(%rsi)
	addl	%edi, %ecx
	movl	12(%rdx), %edi
	movl	%edi, 12(%rsi)
	addl	%edi, %ecx
	movl	16(%rdx), %edi
	movl	%edi, 16(%rsi)
	addl	%edi, %ecx
	movl	20(%rdx), %edi
	movl	%edi, 20(%rsi)
	addl	%edi, %ecx
	movl	24(%rdx), %edi
	movl	%edi, 24(%rsi)
	addl	%edi, %ecx
	movl	28(%rdx), %edi
	movl	%edi, 28(%rsi)
	addl	%edi, %ecx
	movl	32(%rdx), %edi
	movl	%edi, 32(%rsi)
	addl	%edi, %ecx
	movl	36(%rdx), %edi
	movl	%edi, 36(%rsi)
	addl	%edi, %ecx
	movl	40(%rdx), %edi
	movl	%edi, 40(%rsi)
	addl	%edi, %ecx
	movl	44(%rdx), %edx
	movl	%edx, 44(%rsi)
	addl	%edx, %ecx
	notl	%ecx
	movzbl	%cl, %ecx
	movl	%ecx, %edx
	shll	$8, %edx
	orl	%ecx, %edx
	movq	8(%rax), %rax
	movl	%edx, (%rax,%r14,4)
	movl	$1, %edi
	callq	___SYS_UnlockSramEx
	jmp	LBB0_19
LBB0_14:
	movq	_CARD_ERROR_IOERROR@GOTPCREL(%rip), %rax
LBB0_10:
	movq	(%rax), %r12
	movq	%r14, %rdi
	callq	_EXI_Unlock
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	___card_dounmount
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_CARD_ERROR_READY,8,3           ## @CARD_ERROR_READY
	.comm	_EXI_CHANNEL_0,8,3              ## @EXI_CHANNEL_0
	.comm	_EXI_CHANNEL_2,8,3              ## @EXI_CHANNEL_2
	.comm	_CARD_ERROR_NOCARD,8,3          ## @CARD_ERROR_NOCARD
	.comm	_cardmap,8,3                    ## @cardmap
	.comm	_EXI_DEVICE_0,4,2               ## @EXI_DEVICE_0
	.comm	_CARD_ERROR_WRONGDEVICE,8,3     ## @CARD_ERROR_WRONGDEVICE
	.comm	_card_sector_size,8,3           ## @card_sector_size
	.comm	_card_latency,8,3               ## @card_latency
	.comm	_CARD_STATUS_UNLOCKED,4,2       ## @CARD_STATUS_UNLOCKED
	.comm	_CARD_ERROR_IOERROR,8,3         ## @CARD_ERROR_IOERROR
	.comm	___card_exihandler,4,2          ## @__card_exihandler
	.comm	___card_mountcallback,4,2       ## @__card_mountcallback
	.no_dead_strip	___card_domount
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __card_domount
___card_domount:                        ; @__card_domount
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
Lloh0:
	adrp	x8, _EXI_CHANNEL_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EXI_CHANNEL_0@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _EXI_CHANNEL_2@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EXI_CHANNEL_2@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x0
	ccmp	x9, x0, #0, ls
	b.hi	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _CARD_ERROR_NOCARD@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CARD_ERROR_NOCARD@GOTPAGEOFF]
Lloh8:
	ldr	x20, [x8]
	b	LBB0_6
LBB0_2:
	mov	x19, x0
Lloh9:
	adrp	x8, _cardmap@GOTPAGE
Lloh10:
	ldr	x8, [x8, _cardmap@GOTPAGEOFF]
Lloh11:
	ldr	x20, [x8]
	mov	w8, #48
	madd	x21, x0, x8, x20
	ldr	w8, [x21]
	cbz	w8, LBB0_7
; %bb.3:
	cmp	w8, #1
	b.ne	LBB0_5
LBB0_4:
	mov	w8, #2
	str	w8, [x21]
	mov	x0, x19
	mov	w1, #1
	bl	___card_enableinterrupt
Lloh12:
	adrp	x8, ___card_exihandler@GOTPAGE
Lloh13:
	ldr	x8, [x8, ___card_exihandler@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_EXI_RegisterEXICallback
	mov	x0, x19
	bl	_EXI_Unlock
	mov	w8, #48
	madd	x8, x19, x8, x20
	ldr	x0, [x8, #24]
	mov	w1, #40960
	bl	_DCInvalidateRange
	ldr	w8, [x21]
LBB0_5:
	mov	w9, #48
	madd	x9, x19, x9, x20
	ldr	w2, [x9, #12]
	sub	w8, w8, #2
	mul	w1, w8, w2
	ldr	x9, [x9, #24]
	lsl	w8, w8, #13
	add	x3, x9, w8, sxtw
Lloh15:
	adrp	x8, ___card_mountcallback@GOTPAGE
Lloh16:
	ldr	x8, [x8, ___card_mountcallback@GOTPAGEOFF]
Lloh17:
	ldr	w4, [x8]
	mov	x0, x19
	bl	___card_read
	mov	x20, x0
LBB0_6:
	mov	x0, x20
	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
	add	sp, sp, #80
	ret
LBB0_7:
	str	wzr, [sp, #8]
Lloh18:
	adrp	x8, _EXI_DEVICE_0@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EXI_DEVICE_0@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_EXI_GetID
	cbz	x0, LBB0_9
; %bb.8:
	ldr	w0, [sp, #8]
	bl	___card_iscard
LBB0_9:
	ldr	w8, [sp, #8]
	mov	w9, #48
	madd	x22, x19, x9, x20
	str	w8, [x22, #4]
	ldr	w8, [sp, #8]
	ands	w8, w8, #0xfc
	str	w8, [x22, #8]!
	b.eq	LBB0_14
; %bb.10:
	ldr	w0, [sp, #8]
	mov	w1, #23
	bl	__ROTL
Lloh21:
	adrp	x8, _card_sector_size@GOTPAGE
Lloh22:
	ldr	x8, [x8, _card_sector_size@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	ubfx	w9, w0, #2, #3
	ldr	w8, [x8, w9, uxtw #2]
	mov	w9, #48
	madd	x9, x19, x9, x20
	ldr	w10, [x22]
	sbfiz	w10, w10, #17, #12
	sdiv	w10, w10, w8
	stp	w8, w10, [x9, #12]
	cmp	w10, #9
	b.lt	LBB0_14
; %bb.11:
	ldr	w0, [sp, #8]
	mov	w1, #26
	bl	__ROTL
Lloh24:
	adrp	x8, _card_latency@GOTPAGE
Lloh25:
	ldr	x8, [x8, _card_latency@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	ubfx	w9, w0, #2, #3
	ldr	w8, [x8, w9, uxtw #2]
	mov	w9, #48
	madd	x9, x19, x9, x20
	str	w8, [x9, #40]
	mov	x0, x19
	bl	___card_clearstatus
	add	x1, sp, #12
	mov	x0, x19
	bl	___card_readstatus
	mov	x0, x19
	bl	_EXI_Probe
	cbz	x0, LBB0_15
; %bb.12:
	ldr	w8, [sp, #12]
Lloh27:
	adrp	x9, _CARD_STATUS_UNLOCKED@GOTPAGE
Lloh28:
	ldr	x9, [x9, _CARD_STATUS_UNLOCKED@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_16
; %bb.13:
	mov	w8, #1
	str	w8, [x21]
	bl	___SYS_LockSramEx
	ldp	x8, x9, [x0]
	ldr	x8, [x8, x19, lsl #3]
	ldp	q2, q0, [x8, #16]
	ldr	q1, [x8]
	add.4s	v0, v2, v0
	add.4s	v0, v0, v1
	addv.4s	s0, v0
	fmov	w8, s0
	mvn	w22, w8
	ldr	w23, [x9, x19, lsl #2]
	mov	w0, #0
	bl	___SYS_UnlockSramEx
	and	w8, w22, #0xff
	bfi	w8, w8, #8, #8
	cmp	w23, w8
	b.ne	LBB0_17
LBB0_14:
	ldr	w8, [x21]
	cmp	w8, #1
	b.eq	LBB0_4
	b	LBB0_5
LBB0_15:
Lloh30:
	adrp	x8, _CARD_ERROR_NOCARD@GOTPAGE
Lloh31:
	ldr	x8, [x8, _CARD_ERROR_NOCARD@GOTPAGEOFF]
	b	LBB0_18
LBB0_16:
	mov	w8, #48
	madd	x21, x19, x8, x20
	ldr	x1, [x21, #32]
	mov	x0, x19
	bl	___dounlock
	mov	x20, x0
	bl	___SYS_LockSramEx
	ldr	x8, [x21, #32]
	ldp	x9, x10, [x0]
	ldr	x9, [x9, x19, lsl #3]
	ldr	w11, [x8]
	str	w11, [x9]
	ldr	w12, [x8, #4]
	str	w12, [x9, #4]
	ldr	w13, [x8, #8]
	str	w13, [x9, #8]
	add	w11, w12, w11
	add	w11, w13, w11
	ldr	w12, [x8, #12]
	str	w12, [x9, #12]
	ldr	w13, [x8, #16]
	str	w13, [x9, #16]
	add	w11, w12, w11
	add	w11, w13, w11
	ldr	w12, [x8, #20]
	str	w12, [x9, #20]
	ldr	w13, [x8, #24]
	str	w13, [x9, #24]
	add	w11, w12, w11
	add	w11, w13, w11
	ldr	w12, [x8, #28]
	str	w12, [x9, #28]
	ldr	w13, [x8, #32]
	str	w13, [x9, #32]
	add	w11, w12, w11
	add	w11, w13, w11
	ldr	w12, [x8, #36]
	str	w12, [x9, #36]
	ldr	w13, [x8, #40]
	str	w13, [x9, #40]
	add	w11, w12, w11
	add	w11, w13, w11
	ldr	w8, [x8, #44]
	str	w8, [x9, #44]
	add	w8, w8, w11
	mvn	w8, w8
	and	w8, w8, #0xff
	bfi	w8, w8, #8, #8
	str	w8, [x10, x19, lsl #2]
	mov	w0, #1
	bl	___SYS_UnlockSramEx
	b	LBB0_6
LBB0_17:
Lloh32:
	adrp	x8, _CARD_ERROR_IOERROR@GOTPAGE
Lloh33:
	ldr	x8, [x8, _CARD_ERROR_IOERROR@GOTPAGEOFF]
LBB0_18:
	ldr	x20, [x8]
	mov	x0, x19
	bl	_EXI_Unlock
	mov	x0, x19
	mov	x1, x20
	bl	___card_dounmount
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_CARD_ERROR_READY,8,3           ; @CARD_ERROR_READY
	.comm	_EXI_CHANNEL_0,8,3              ; @EXI_CHANNEL_0
	.comm	_EXI_CHANNEL_2,8,3              ; @EXI_CHANNEL_2
	.comm	_CARD_ERROR_NOCARD,8,3          ; @CARD_ERROR_NOCARD
	.comm	_cardmap,8,3                    ; @cardmap
	.comm	_EXI_DEVICE_0,4,2               ; @EXI_DEVICE_0
	.comm	_CARD_ERROR_WRONGDEVICE,8,3     ; @CARD_ERROR_WRONGDEVICE
	.comm	_card_sector_size,8,3           ; @card_sector_size
	.comm	_card_latency,8,3               ; @card_latency
	.comm	_CARD_STATUS_UNLOCKED,4,2       ; @CARD_STATUS_UNLOCKED
	.comm	_CARD_ERROR_IOERROR,8,3         ; @CARD_ERROR_IOERROR
	.comm	___card_exihandler,4,2          ; @__card_exihandler
	.comm	___card_mountcallback,4,2       ; @__card_mountcallback
	.no_dead_strip	___card_domount
.subsections_via_symbols
