	.file	"extr_exi.c_EXI_SelectSD.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	EXI_SelectSD
	.type	EXI_SelectSD, @function
EXI_SelectSD:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdx
	lea	rdx, [rdi+rdi*2]
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdi
	xor	edi, edi
	sub	rsp, 24
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR eximap[rip]
	lea	r13, [rax+rdx*8]
	call	_CPU_ISR_Disable@PLT
	mov	edx, DWORD PTR 0[r13]
	mov	eax, DWORD PTR EXI_FLAG_SELECT[rip]
	test	edx, eax
	jne	.L8
	cmp	QWORD PTR EXI_CHANNEL_2[rip], rbx
	je	.L4
	cmp	QWORD PTR EXI_DEVICE_0[rip], r12
	je	.L24
.L5:
	test	DWORD PTR EXI_FLAG_LOCKED[rip], edx
	je	.L8
	cmp	QWORD PTR 8[r13], r12
	jne	.L8
	mov	eax, DWORD PTR EXI_FLAG_SELECT[rip]
.L4:
	or	eax, edx
	mov	rdx, QWORD PTR _exiReg[rip]
	sal	ebp, 4
	mov	DWORD PTR 0[r13], eax
	lea	rax, [rbx+rbx*4]
	lea	rdx, [rdx+rax*4]
	mov	eax, DWORD PTR [rdx]
	and	eax, 1029
	or	ebp, eax
	mov	DWORD PTR [rdx], ebp
	mov	eax, DWORD PTR 0[r13]
	test	DWORD PTR EXI_FLAG_ATTACH[rip], eax
	je	.L9
	cmp	QWORD PTR EXI_CHANNEL_0[rip], rbx
	je	.L25
	cmp	QWORD PTR EXI_CHANNEL_1[rip], rbx
	je	.L26
.L9:
	xor	edi, edi
	call	_CPU_ISR_Restore@PLT
	mov	eax, 1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L8:
	xor	edi, edi
	call	_CPU_ISR_Restore@PLT
	xor	eax, eax
.L1:
	mov	rcx, QWORD PTR 8[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L27
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	test	DWORD PTR EXI_FLAG_ATTACH[rip], edx
	jne	.L5
	mov	rdi, rbx
	call	__exi_probe@PLT
	cmp	rax, 1
	je	.L28
.L6:
	test	rax, rax
	je	.L8
.L22:
	mov	edx, DWORD PTR 0[r13]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L25:
	mov	edi, DWORD PTR IRQ_EXI0_EXT[rip]
	call	IRQMASK@PLT
	mov	edi, eax
	call	__MaskIrq@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L26:
	mov	edi, DWORD PTR IRQ_EXI1_EXT[rip]
	call	IRQMASK@PLT
	mov	edi, eax
	call	__MaskIrq@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L28:
	mov	eax, DWORD PTR 16[r13]
	test	eax, eax
	jne	.L22
	mov	rsi, QWORD PTR EXI_DEVICE_0[rip]
	lea	rdx, 4[rsp]
	mov	rdi, rbx
	call	EXI_GetID@PLT
	jmp	.L6
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	EXI_SelectSD, .-EXI_SelectSD
	.comm	eximap,8,8
	.comm	_exiReg,8,8
	.comm	IRQ_EXI1_EXT,4,4
	.comm	IRQ_EXI0_EXT,4,4
	.comm	EXI_FLAG_SELECT,4,4
	.comm	EXI_FLAG_LOCKED,4,4
	.comm	EXI_FLAG_ATTACH,4,4
	.comm	EXI_DEVICE_0,8,8
	.comm	EXI_CHANNEL_2,8,8
	.comm	EXI_CHANNEL_1,8,8
	.comm	EXI_CHANNEL_0,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_exi.c_EXI_SelectSD.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	EXI_SelectSD
	.syntax unified
	.arm
	.fpu softvfp
	.type	EXI_SelectSD, %function
EXI_SelectSD:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L29
	add	r5, r0, r0, lsl #1
	ldr	r6, [r3]
	ldr	r10, .L29+4
	ldr	r3, .L29+8
	sub	sp, sp, #12
	lsl	r9, r5, #2
	mov	r4, r0
	mov	r0, #0
	mov	r8, r2
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	mov	r7, r1
	bl	_CPU_ISR_Disable
	ldr	r2, [r6, r9]
	ldr	r3, [r10]
	add	r5, r6, r5, lsl #2
	tst	r2, r3
	bne	.L8
	ldr	r1, .L29+12
	ldr	r1, [r1]
	cmp	r1, r4
	beq	.L4
	ldr	fp, .L29+16
	ldr	r3, [fp]
	cmp	r3, r7
	beq	.L24
.L5:
	ldr	r3, .L29+20
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L8
	ldr	r3, [r5, #4]
	cmp	r3, r7
	bne	.L8
	ldr	r3, [r10]
.L4:
	ldr	r1, .L29+24
	orr	r3, r3, r2
	ldr	r1, [r1]
	add	r2, r4, r4, lsl #2
	str	r3, [r6, r9]
	lsl	r3, r2, #2
	ldr	ip, [r1, r3]
	ldr	r2, .L29+28
	ldr	r0, .L29+32
	and	r2, r2, ip
	orr	r8, r2, r8, lsl #4
	str	r8, [r1, r3]
	ldr	r2, [r6, r9]
	ldr	r3, [r0]
	tst	r2, r3
	beq	.L9
	ldr	r3, .L29+36
	ldr	r3, [r3]
	cmp	r3, r4
	beq	.L25
	ldr	r3, .L29+40
	ldr	r3, [r3]
	cmp	r3, r4
	beq	.L26
.L9:
	mov	r0, #0
	bl	_CPU_ISR_Restore
	mov	r0, #1
	b	.L1
.L8:
	mov	r0, #0
	bl	_CPU_ISR_Restore
	mov	r0, #0
.L1:
	ldr	r3, .L29+8
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L27
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L24:
	ldr	r3, .L29+32
	ldr	r3, [r3]
	tst	r2, r3
	bne	.L5
	mov	r0, r4
	bl	__exi_probe
	cmp	r0, #1
	beq	.L28
.L6:
	cmp	r0, #0
	beq	.L8
.L22:
	ldr	r2, [r6, r9]
	b	.L5
.L25:
	ldr	r3, .L29+44
	ldr	r0, [r3]
	bl	IRQMASK
	bl	__MaskIrq
	b	.L9
.L26:
	ldr	r3, .L29+48
	ldr	r0, [r3]
	bl	IRQMASK
	bl	__MaskIrq
	b	.L9
.L28:
	ldr	r3, [r5, #8]
	cmp	r3, #0
	bne	.L22
	mov	r2, sp
	mov	r0, r4
	ldr	r1, [fp]
	bl	EXI_GetID
	b	.L6
.L27:
	bl	__stack_chk_fail
.L30:
	.align	2
.L29:
	.word	eximap
	.word	EXI_FLAG_SELECT
	.word	.LC0
	.word	EXI_CHANNEL_2
	.word	EXI_DEVICE_0
	.word	EXI_FLAG_LOCKED
	.word	_exiReg
	.word	1029
	.word	EXI_FLAG_ATTACH
	.word	EXI_CHANNEL_0
	.word	EXI_CHANNEL_1
	.word	IRQ_EXI0_EXT
	.word	IRQ_EXI1_EXT
	.size	EXI_SelectSD, .-EXI_SelectSD
	.comm	eximap,4,4
	.comm	_exiReg,4,4
	.comm	IRQ_EXI1_EXT,4,4
	.comm	IRQ_EXI0_EXT,4,4
	.comm	EXI_FLAG_SELECT,4,4
	.comm	EXI_FLAG_LOCKED,4,4
	.comm	EXI_FLAG_ATTACH,4,4
	.comm	EXI_DEVICE_0,4,4
	.comm	EXI_CHANNEL_2,4,4
	.comm	EXI_CHANNEL_1,4,4
	.comm	EXI_CHANNEL_0,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
