	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_EXI_SelectSD                   ## -- Begin function EXI_SelectSD
	.p2align	4, 0x90
_EXI_SelectSD:                          ## @EXI_SelectSD
	.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	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	_eximap@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	callq	__CPU_ISR_Disable
	leaq	(,%r13,2), %r12
	addq	%r13, %r12
	movl	(%rbx,%r12,8), %eax
	movq	_EXI_FLAG_SELECT@GOTPCREL(%rip), %rdi
	movl	(%rdi), %ecx
	testl	%eax, %ecx
	je	LBB0_2
LBB0_1:
	callq	__CPU_ISR_Restore
	xorl	%eax, %eax
	jmp	LBB0_19
LBB0_2:
	leaq	(%rbx,%r12,8), %rsi
	movq	_EXI_CHANNEL_2@GOTPCREL(%rip), %rdx
	cmpq	%r13, (%rdx)
	je	LBB0_12
## %bb.3:
	movq	_EXI_DEVICE_0@GOTPCREL(%rip), %rcx
	cmpq	%r15, (%rcx)
	jne	LBB0_9
## %bb.4:
	movq	_EXI_FLAG_ATTACH@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_9
## %bb.5:
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	callq	___exi_probe
	cmpq	$1, %rax
	jne	LBB0_8
## %bb.6:
	cmpl	$0, 16(%rbx,%r12,8)
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	_EXI_FLAG_SELECT@GOTPCREL(%rip), %rdi
	movq	_EXI_DEVICE_0@GOTPCREL(%rip), %rax
	jne	LBB0_9
## %bb.7:
	movq	(%rax), %rsi
	leaq	-52(%rbp), %rdx
	movq	%r13, %rdi
	callq	_EXI_GetID
LBB0_8:
	testq	%rax, %rax
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	_EXI_FLAG_SELECT@GOTPCREL(%rip), %rdi
	je	LBB0_1
LBB0_9:
	movl	(%rsi), %eax
	movq	_EXI_FLAG_LOCKED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_1
## %bb.10:
	cmpq	%r15, 8(%rbx,%r12,8)
	jne	LBB0_1
## %bb.11:
	movl	(%rdi), %ecx
LBB0_12:
	orl	%ecx, %eax
	movl	%eax, (%rsi)
	movq	__exiReg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(,%r13,4), %rcx
	addq	%r13, %rcx
	movl	$1029, %edx                     ## imm = 0x405
	andl	(%rax,%rcx,4), %edx
	shll	$4, %r14d
	orl	%edx, %r14d
	movl	%r14d, (%rax,%rcx,4)
	movq	_EXI_FLAG_ATTACH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rsi)
	je	LBB0_18
## %bb.13:
	movq	_EXI_CHANNEL_0@GOTPCREL(%rip), %rax
	cmpq	%r13, (%rax)
	jne	LBB0_15
## %bb.14:
	movq	_IRQ_EXI0_EXT@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_15:
	movq	_EXI_CHANNEL_1@GOTPCREL(%rip), %rax
	cmpq	%r13, (%rax)
	jne	LBB0_18
## %bb.16:
	movq	_IRQ_EXI1_EXT@GOTPCREL(%rip), %rax
LBB0_17:
	movl	(%rax), %edi
	callq	_IRQMASK
	movl	%eax, %edi
	callq	___MaskIrq
LBB0_18:
	callq	__CPU_ISR_Restore
	movl	$1, %eax
LBB0_19:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_eximap,8,3                     ## @eximap
	.comm	_EXI_FLAG_SELECT,4,2            ## @EXI_FLAG_SELECT
	.comm	_EXI_CHANNEL_2,8,3              ## @EXI_CHANNEL_2
	.comm	_EXI_DEVICE_0,8,3               ## @EXI_DEVICE_0
	.comm	_EXI_FLAG_ATTACH,4,2            ## @EXI_FLAG_ATTACH
	.comm	_EXI_FLAG_LOCKED,4,2            ## @EXI_FLAG_LOCKED
	.comm	__exiReg,8,3                    ## @_exiReg
	.comm	_EXI_CHANNEL_0,8,3              ## @EXI_CHANNEL_0
	.comm	_IRQ_EXI0_EXT,4,2               ## @IRQ_EXI0_EXT
	.comm	_EXI_CHANNEL_1,8,3              ## @EXI_CHANNEL_1
	.comm	_IRQ_EXI1_EXT,4,2               ## @IRQ_EXI1_EXT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_EXI_SelectSD                   ; -- Begin function EXI_SelectSD
	.p2align	2
_EXI_SelectSD:                          ; @EXI_SelectSD
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _eximap@GOTPAGE
Lloh1:
	ldr	x8, [x8, _eximap@GOTPAGEOFF]
Lloh2:
	ldr	x23, [x8]
	bl	__CPU_ISR_Disable
	mov	w8, #24
	madd	x22, x19, x8, x23
	ldr	w8, [x22]
Lloh3:
	adrp	x24, _EXI_FLAG_SELECT@GOTPAGE
Lloh4:
	ldr	x24, [x24, _EXI_FLAG_SELECT@GOTPAGEOFF]
	ldr	w9, [x24]
	tst	w9, w8
	b.eq	LBB0_2
LBB0_1:
	bl	__CPU_ISR_Restore
	mov	x0, #0
	b	LBB0_19
LBB0_2:
Lloh5:
	adrp	x10, _EXI_CHANNEL_2@GOTPAGE
Lloh6:
	ldr	x10, [x10, _EXI_CHANNEL_2@GOTPAGEOFF]
Lloh7:
	ldr	x10, [x10]
	cmp	x10, x19
	b.eq	LBB0_12
; %bb.3:
Lloh8:
	adrp	x25, _EXI_DEVICE_0@GOTPAGE
Lloh9:
	ldr	x25, [x25, _EXI_DEVICE_0@GOTPAGEOFF]
	ldr	x9, [x25]
	cmp	x9, x21
	b.ne	LBB0_9
; %bb.4:
Lloh10:
	adrp	x9, _EXI_FLAG_ATTACH@GOTPAGE
Lloh11:
	ldr	x9, [x9, _EXI_FLAG_ATTACH@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_9
; %bb.5:
	mov	x0, x19
	bl	___exi_probe
	cmp	x0, #1
	b.ne	LBB0_8
; %bb.6:
	mov	w8, #24
	madd	x8, x19, x8, x23
	ldr	w8, [x8, #16]
	cbnz	w8, LBB0_9
; %bb.7:
	ldr	x1, [x25]
	add	x2, sp, #12
	mov	x0, x19
	bl	_EXI_GetID
LBB0_8:
	cbz	x0, LBB0_1
LBB0_9:
	ldr	w8, [x22]
Lloh13:
	adrp	x9, _EXI_FLAG_LOCKED@GOTPAGE
Lloh14:
	ldr	x9, [x9, _EXI_FLAG_LOCKED@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_1
; %bb.10:
	mov	w9, #24
	madd	x9, x19, x9, x23
	ldr	x9, [x9, #8]
	cmp	x9, x21
	b.ne	LBB0_1
; %bb.11:
	ldr	w9, [x24]
LBB0_12:
	orr	w8, w8, w9
Lloh16:
	adrp	x9, __exiReg@GOTPAGE
Lloh17:
	ldr	x9, [x9, __exiReg@GOTPAGEOFF]
	str	w8, [x22]
Lloh18:
	ldr	x8, [x9]
	mov	w9, #20
	mul	x9, x19, x9
	ldr	w10, [x8, x9]
	mov	w11, #1029
	and	w10, w10, w11
	orr	w10, w10, w20, lsl #4
	str	w10, [x8, x9]
	ldr	w8, [x22]
Lloh19:
	adrp	x9, _EXI_FLAG_ATTACH@GOTPAGE
Lloh20:
	ldr	x9, [x9, _EXI_FLAG_ATTACH@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_18
; %bb.13:
Lloh22:
	adrp	x8, _EXI_CHANNEL_0@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EXI_CHANNEL_0@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	cmp	x8, x19
	b.ne	LBB0_15
; %bb.14:
Lloh25:
	adrp	x8, _IRQ_EXI0_EXT@GOTPAGE
Lloh26:
	ldr	x8, [x8, _IRQ_EXI0_EXT@GOTPAGEOFF]
	b	LBB0_17
LBB0_15:
Lloh27:
	adrp	x8, _EXI_CHANNEL_1@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EXI_CHANNEL_1@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
	cmp	x8, x19
	b.ne	LBB0_18
; %bb.16:
Lloh30:
	adrp	x8, _IRQ_EXI1_EXT@GOTPAGE
Lloh31:
	ldr	x8, [x8, _IRQ_EXI1_EXT@GOTPAGEOFF]
LBB0_17:
	ldr	w0, [x8]
	bl	_IRQMASK
	bl	___MaskIrq
LBB0_18:
	bl	__CPU_ISR_Restore
	mov	w0, #1
LBB0_19:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_eximap,8,3                     ; @eximap
	.comm	_EXI_FLAG_SELECT,4,2            ; @EXI_FLAG_SELECT
	.comm	_EXI_CHANNEL_2,8,3              ; @EXI_CHANNEL_2
	.comm	_EXI_DEVICE_0,8,3               ; @EXI_DEVICE_0
	.comm	_EXI_FLAG_ATTACH,4,2            ; @EXI_FLAG_ATTACH
	.comm	_EXI_FLAG_LOCKED,4,2            ; @EXI_FLAG_LOCKED
	.comm	__exiReg,8,3                    ; @_exiReg
	.comm	_EXI_CHANNEL_0,8,3              ; @EXI_CHANNEL_0
	.comm	_IRQ_EXI0_EXT,4,2               ; @IRQ_EXI0_EXT
	.comm	_EXI_CHANNEL_1,8,3              ; @EXI_CHANNEL_1
	.comm	_IRQ_EXI1_EXT,4,2               ; @IRQ_EXI1_EXT
.subsections_via_symbols
