	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __card_readsegment
___card_readsegment:                    ## @__card_readsegment
	.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), %rcx
	cmpq	%rdi, (%rax)
	ja	LBB0_7
## %bb.1:
	movq	%rdi, %r13
	movq	_EXI_CHANNEL_2@GOTPCREL(%rip), %rax
	cmpq	%rdi, (%rax)
	jbe	LBB0_7
## %bb.2:
	movq	_cardmap@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	imulq	$56, %r13, %r14
	movq	(%rbx,%r14), %rax
	movl	$82, (%rax)
	movl	8(%rbx,%r14), %ecx
	shrl	$17, %ecx
	andl	$127, %ecx
	movl	%ecx, 4(%rax)
	movl	8(%rbx,%r14), %ecx
	shrl	$9, %ecx
	movzbl	%cl, %ecx
	movl	%ecx, 8(%rax)
	movl	8(%rbx,%r14), %ecx
	shrl	$7, %ecx
	andl	$3, %ecx
	movl	%ecx, 12(%rax)
	movl	8(%rbx,%r14), %ecx
	andl	$127, %ecx
	movl	%ecx, 16(%rax)
	movl	$5, 12(%rbx,%r14)
	movq	_EXI_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx,%r14)
	movq	$0, 48(%rbx,%r14)
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	___card_start
	movq	(%rbx,%r14), %rsi
	movl	12(%rbx,%r14), %edx
	movq	_EXI_WRITE@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	movq	%r13, %rdi
	callq	_EXI_ImmEx
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_CARD_READSIZE@GOTPCREL(%rip), %r12
	movslq	(%r12), %rsi
	shlq	$2, %rsi
	addq	16(%rbx,%r14), %rsi
	movl	24(%rbx,%r14), %edx
	movl	(%r15), %ecx
	movq	%r13, %rdi
	callq	_EXI_ImmEx
	movq	%rax, %r15
	movl	40(%rbx,%r14), %ecx
	movl	44(%rbx,%r14), %esi
	movl	(%r12), %edx
	movq	___card_txhandler@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r13, %rdi
	callq	_EXI_Dma
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	testq	%r15, %r15
	je	LBB0_6
## %bb.4:
	cmpq	$0, -48(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_6
## %bb.5:
	movq	_CARD_ERROR_READY@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_6:
	movq	$0, 32(%rbx,%r14)
	movq	%r13, %rdi
	callq	_EXI_Deselect
	movq	%r13, %rdi
	callq	_EXI_Unlock
	movq	_CARD_ERROR_NOCARD@GOTPCREL(%rip), %rcx
LBB0_7:
	movq	(%rcx), %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_READ,4,2                   ## @EXI_READ
	.comm	_EXI_WRITE,4,2                  ## @EXI_WRITE
	.comm	_CARD_READSIZE,4,2              ## @CARD_READSIZE
	.comm	___card_txhandler,4,2           ## @__card_txhandler
	.comm	_CARD_ERROR_READY,8,3           ## @CARD_ERROR_READY
	.no_dead_strip	___card_readsegment
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __card_readsegment
___card_readsegment:                    ; @__card_readsegment
	.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_6
; %bb.1:
	mov	x19, x0
Lloh6:
	adrp	x8, _cardmap@GOTPAGE
Lloh7:
	ldr	x8, [x8, _cardmap@GOTPAGEOFF]
Lloh8:
	ldr	x22, [x8]
	mov	w8, #56
	madd	x23, x0, x8, x22
	ldr	x8, [x23]
	mov	w9, #82
	str	w9, [x8]
	ldr	w9, [x23, #8]
	ubfx	w9, w9, #17, #7
	str	w9, [x8, #4]
	ldr	w9, [x23, #8]
	ubfx	w9, w9, #9, #8
	str	w9, [x8, #8]
	ldr	w9, [x23, #8]
	ubfx	w9, w9, #7, #2
	str	w9, [x8, #12]
	ldr	w9, [x23, #8]
	and	w9, w9, #0x7f
	str	w9, [x8, #16]
	mov	w8, #5
	str	w8, [x23, #12]
Lloh9:
	adrp	x8, _EXI_READ@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EXI_READ@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [x23, #40]
	str	xzr, [x23, #48]
	mov	x2, #0
	bl	___card_start
	ldr	x1, [x23]
	ldr	w2, [x23, #12]
Lloh12:
	adrp	x21, _EXI_WRITE@GOTPAGE
Lloh13:
	ldr	x21, [x21, _EXI_WRITE@GOTPAGEOFF]
	ldr	w3, [x21]
	mov	x0, x19
	bl	_EXI_ImmEx
	mov	x20, x0
	ldr	x8, [x23, #16]
Lloh14:
	adrp	x24, _CARD_READSIZE@GOTPAGE
Lloh15:
	ldr	x24, [x24, _CARD_READSIZE@GOTPAGEOFF]
	ldrsw	x9, [x24]
	add	x1, x8, x9, lsl #2
	ldr	w2, [x23, #24]
	ldr	w3, [x21]
	mov	x0, x19
	bl	_EXI_ImmEx
	mov	x21, x0
	ldr	w2, [x24]
	ldp	w3, w1, [x23, #40]
Lloh16:
	adrp	x8, ___card_txhandler@GOTPAGE
Lloh17:
	ldr	x8, [x8, ___card_txhandler@GOTPAGEOFF]
Lloh18:
	ldr	w4, [x8]
	mov	x0, x19
	bl	_EXI_Dma
	cbz	x0, LBB0_5
; %bb.2:
	cbz	x21, LBB0_5
; %bb.3:
	cbz	x20, LBB0_5
; %bb.4:
Lloh19:
	adrp	x8, _CARD_ERROR_READY@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CARD_ERROR_READY@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:
	mov	w8, #56
	madd	x8, x19, x8, x22
	str	xzr, [x8, #32]
	mov	x0, x19
	bl	_EXI_Deselect
	mov	x0, x19
	bl	_EXI_Unlock
LBB0_6:
Lloh21:
	adrp	x8, _CARD_ERROR_NOCARD@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CARD_ERROR_NOCARD@GOTPAGEOFF]
LBB0_7:
	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 AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.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_READ,4,2                   ; @EXI_READ
	.comm	_EXI_WRITE,4,2                  ; @EXI_WRITE
	.comm	_CARD_READSIZE,4,2              ; @CARD_READSIZE
	.comm	___card_txhandler,4,2           ; @__card_txhandler
	.comm	_CARD_ERROR_READY,8,3           ; @CARD_ERROR_READY
	.no_dead_strip	___card_readsegment
.subsections_via_symbols
