	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __card_writepage
___card_writepage:                      ## @__card_writepage
	.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	_EXI_CHANNEL_0@GOTPCREL(%rip), %rax
	movq	_CARD_ERROR_NOCARD@GOTPCREL(%rip), %r14
	cmpq	%rdi, (%rax)
	ja	LBB0_6
## %bb.1:
	movq	%rdi, %r15
	movq	_EXI_CHANNEL_2@GOTPCREL(%rip), %rax
	cmpq	%rdi, (%rax)
	jbe	LBB0_6
## %bb.2:
	movl	%esi, %edx
	movq	_cardmap@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	leaq	(%r15,%r15,4), %rbx
	movq	(%r12,%rbx,8), %rax
	movl	$242, (%rax)
	movl	8(%r12,%rbx,8), %ecx
	shrl	$17, %ecx
	andl	$63, %ecx
	movl	%ecx, 4(%rax)
	movl	8(%r12,%rbx,8), %ecx
	shrl	$9, %ecx
	movzbl	%cl, %ecx
	movl	%ecx, 8(%rax)
	movl	8(%r12,%rbx,8), %ecx
	shrl	$7, %ecx
	andl	$3, %ecx
	movl	%ecx, 12(%rax)
	movl	8(%r12,%rbx,8), %ecx
	andl	$127, %ecx
	movl	%ecx, 16(%rax)
	movl	$5, 12(%r12,%rbx,8)
	movq	_EXI_WRITE@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	movl	%eax, 32(%r12,%rbx,8)
	movl	$3, 16(%r12,%rbx,8)
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	___card_start
	movq	(%r12,%rbx,8), %rsi
	movl	12(%r12,%rbx,8), %edx
	movl	(%r13), %ecx
	movq	%r15, %rdi
	callq	_EXI_ImmEx
	cmpl	$1, %eax
	jne	LBB0_5
## %bb.3:
	leaq	(%r12,%rbx,8), %rax
	addq	$32, %rax
	movl	36(%r12,%rbx,8), %esi
	movl	(%rax), %ecx
	movq	___card_txhandler@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r15, %rdi
	movl	$128, %edx
	callq	_EXI_Dma
	cmpl	$1, %eax
	jne	LBB0_5
## %bb.4:
	movq	_CARD_ERROR_READY@GOTPCREL(%rip), %r14
	jmp	LBB0_6
LBB0_5:
	movq	$0, 24(%r12,%rbx,8)
	movq	%r15, %rdi
	callq	_EXI_Deselect
	movq	%r15, %rdi
	callq	_EXI_Unlock
LBB0_6:
	movq	(%r14), %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.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_WRITE,4,2                  ## @EXI_WRITE
	.comm	___card_txhandler,4,2           ## @__card_txhandler
	.comm	_CARD_ERROR_READY,8,3           ## @CARD_ERROR_READY
	.no_dead_strip	___card_writepage
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __card_writepage
___card_writepage:                      ; @__card_writepage
	.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	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.ls	LBB0_5
; %bb.1:
	mov	x2, x1
	mov	x19, x0
Lloh6:
	adrp	x8, _cardmap@GOTPAGE
Lloh7:
	ldr	x8, [x8, _cardmap@GOTPAGEOFF]
Lloh8:
	ldr	x20, [x8]
	mov	w8, #40
	madd	x22, x0, x8, x20
	ldr	x8, [x22]
	mov	w9, #242
	str	w9, [x8]
	ldr	w9, [x22, #8]
	ubfx	w9, w9, #17, #6
	str	w9, [x8, #4]
	ldr	w9, [x22, #8]
	ubfx	w9, w9, #9, #8
	str	w9, [x8, #8]
	ldr	w9, [x22, #8]
	ubfx	w9, w9, #7, #2
	str	w9, [x8, #12]
	ldr	w9, [x22, #8]
	and	w9, w9, #0x7f
	str	w9, [x8, #16]
	mov	w8, #5
	str	w8, [x22, #12]
Lloh9:
	adrp	x23, _EXI_WRITE@GOTPAGE
Lloh10:
	ldr	x23, [x23, _EXI_WRITE@GOTPAGEOFF]
	ldr	w8, [x23]
	mov	x21, x22
	str	w8, [x21, #32]!
	mov	w8, #3
	str	w8, [x22, #16]
	mov	x1, #0
	bl	___card_start
	ldr	x1, [x22]
	ldr	w2, [x22, #12]
	ldr	w3, [x23]
	mov	x0, x19
	bl	_EXI_ImmEx
	cmp	w0, #1
	b.ne	LBB0_4
; %bb.2:
	mov	w8, #40
	madd	x8, x19, x8, x20
	ldr	w1, [x8, #36]
	ldr	w3, [x21]
Lloh11:
	adrp	x8, ___card_txhandler@GOTPAGE
Lloh12:
	ldr	x8, [x8, ___card_txhandler@GOTPAGEOFF]
Lloh13:
	ldr	w4, [x8]
	mov	x0, x19
	mov	w2, #128
	bl	_EXI_Dma
	cmp	w0, #1
	b.ne	LBB0_4
; %bb.3:
Lloh14:
	adrp	x8, _CARD_ERROR_READY@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CARD_ERROR_READY@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
	mov	w8, #40
	madd	x8, x19, x8, x20
	str	xzr, [x8, #24]
	mov	x0, x19
	bl	_EXI_Deselect
	mov	x0, x19
	bl	_EXI_Unlock
LBB0_5:
Lloh16:
	adrp	x8, _CARD_ERROR_NOCARD@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CARD_ERROR_NOCARD@GOTPAGEOFF]
LBB0_6:
	ldr	x0, [x8]
	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
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.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_WRITE,4,2                  ; @EXI_WRITE
	.comm	___card_txhandler,4,2           ; @__card_txhandler
	.comm	_CARD_ERROR_READY,8,3           ; @CARD_ERROR_READY
	.no_dead_strip	___card_writepage
.subsections_via_symbols
