	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __card_exihandler
___card_exihandler:                     ## @__card_exihandler
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_EXI_CHANNEL_0@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	jg	LBB0_17
## %bb.1:
	movl	%edi, %ebx
	movq	_EXI_CHANNEL_2@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	jle	LBB0_17
## %bb.2:
	movq	_cardmap@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movslq	%ebx, %r12
	shlq	$5, %r12
	movl	24(%r15,%r12), %edi
	callq	_SYS_CancelAlarm
	cmpq	$0, 16(%r15,%r12)
	je	LBB0_17
## %bb.3:
	movq	_EXI_DEVICE_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	xorl	%edx, %edx
	callq	_EXI_Lock
	cmpl	$1, %eax
	jne	LBB0_14
## %bb.4:
	leaq	-36(%rbp), %rsi
	movl	%ebx, %edi
	callq	___card_readstatus
	testl	%eax, %eax
	js	LBB0_5
## %bb.7:
	movl	%ebx, %edi
	callq	___card_clearstatus
	testl	%eax, %eax
	js	LBB0_5
## %bb.8:
	testb	$24, -36(%rbp)
	movq	_CARD_ERROR_IOERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %r14d
	jne	LBB0_10
## %bb.9:
	movq	_CARD_ERROR_READY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
LBB0_10:
	cmpl	%eax, %r14d
	jne	LBB0_6
## %bb.11:
	movq	(%r15,%r12), %rcx
	leaq	-1(%rcx), %rdx
	movq	%rdx, (%r15,%r12)
	movl	%eax, %r14d
	cmpq	$2, %rcx
	jl	LBB0_6
## %bb.12:
	movl	%ebx, %edi
	callq	___retry
	testl	%eax, %eax
	jns	LBB0_17
## %bb.13:
	movl	%eax, %r14d
	jmp	LBB0_15
LBB0_14:
	movq	_CARD_ERROR_FATAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_15
LBB0_5:
	movl	%eax, %r14d
LBB0_6:
	movl	%ebx, %edi
	callq	_EXI_Unlock
LBB0_15:
	movq	8(%r15,%r12), %rax
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	leaq	(%r15,%r12), %rcx
	addq	$8, %rcx
	movq	$0, (%rcx)
	movl	%ebx, %edi
	movl	%r14d, %esi
	callq	*%rax
LBB0_17:
	movl	$1, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CARD_ERROR_READY,4,2           ## @CARD_ERROR_READY
	.comm	_EXI_CHANNEL_0,4,2              ## @EXI_CHANNEL_0
	.comm	_EXI_CHANNEL_2,4,2              ## @EXI_CHANNEL_2
	.comm	_cardmap,8,3                    ## @cardmap
	.comm	_EXI_DEVICE_0,4,2               ## @EXI_DEVICE_0
	.comm	_CARD_ERROR_IOERROR,4,2         ## @CARD_ERROR_IOERROR
	.comm	_CARD_ERROR_FATAL_ERROR,4,2     ## @CARD_ERROR_FATAL_ERROR
	.no_dead_strip	___card_exihandler
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __card_exihandler
___card_exihandler:                     ; @__card_exihandler
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
Lloh0:
	adrp	x8, _EXI_CHANNEL_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EXI_CHANNEL_0@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _EXI_CHANNEL_2@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EXI_CHANNEL_2@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w0
	ccmp	w9, w0, #4, le
	b.le	LBB0_14
; %bb.1:
	mov	x19, x0
Lloh6:
	adrp	x8, _cardmap@GOTPAGE
Lloh7:
	ldr	x8, [x8, _cardmap@GOTPAGEOFF]
Lloh8:
	ldr	x21, [x8]
	sxtw	x22, w19
	add	x20, x21, x22, lsl #5
	ldr	w0, [x20, #24]
	bl	_SYS_CancelAlarm
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_14
; %bb.2:
Lloh9:
	adrp	x8, _EXI_DEVICE_0@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EXI_DEVICE_0@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, #0
	bl	_EXI_Lock
	cmp	w0, #1
	b.ne	LBB0_9
; %bb.3:
	add	x1, sp, #12
	mov	x0, x19
	bl	___card_readstatus
	tbnz	w0, #31, LBB0_10
; %bb.4:
	mov	x0, x19
	bl	___card_clearstatus
	tbnz	w0, #31, LBB0_10
; %bb.5:
Lloh12:
	adrp	x8, _CARD_ERROR_READY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CARD_ERROR_READY@GOTPAGEOFF]
Lloh14:
	adrp	x9, _CARD_ERROR_IOERROR@GOTPAGE
Lloh15:
	ldr	x9, [x9, _CARD_ERROR_IOERROR@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x8]
Lloh17:
	ldr	w8, [x9]
	ldrb	w9, [sp, #12]
	tst	w9, #0x18
	csel	w20, w10, w8, eq
	cmp	w20, w8
	b.ne	LBB0_11
; %bb.6:
	lsl	x9, x22, #5
	ldr	x10, [x21, x9]
	sub	x11, x10, #1
	str	x11, [x21, x9]
	mov	x20, x8
	cmp	x10, #2
	b.lt	LBB0_11
; %bb.7:
	mov	x0, x19
	bl	___retry
	tbz	w0, #31, LBB0_14
; %bb.8:
	mov	x20, x0
	b	LBB0_12
LBB0_9:
Lloh18:
	adrp	x8, _CARD_ERROR_FATAL_ERROR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CARD_ERROR_FATAL_ERROR@GOTPAGEOFF]
Lloh20:
	ldr	w20, [x8]
	b	LBB0_12
LBB0_10:
	mov	x20, x0
LBB0_11:
	mov	x0, x19
	bl	_EXI_Unlock
LBB0_12:
	add	x9, x21, x22, lsl #5
	ldr	x8, [x9, #8]!
	cbz	x8, LBB0_14
; %bb.13:
	str	xzr, [x9]
	mov	x0, x19
	mov	x1, x20
	blr	x8
LBB0_14:
	mov	w0, #1
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh16
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_CARD_ERROR_READY,4,2           ; @CARD_ERROR_READY
	.comm	_EXI_CHANNEL_0,4,2              ; @EXI_CHANNEL_0
	.comm	_EXI_CHANNEL_2,4,2              ; @EXI_CHANNEL_2
	.comm	_cardmap,8,3                    ; @cardmap
	.comm	_EXI_DEVICE_0,4,2               ; @EXI_DEVICE_0
	.comm	_CARD_ERROR_IOERROR,4,2         ; @CARD_ERROR_IOERROR
	.comm	_CARD_ERROR_FATAL_ERROR,4,2     ; @CARD_ERROR_FATAL_ERROR
	.no_dead_strip	___card_exihandler
.subsections_via_symbols
