	.file	"extr_xway_nand.c_xway_select_chip.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	xway_select_chip, @function
xway_select_chip:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	ebx, esi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	nand_get_controller_data@PLT
	mov	rbp, rax
	cmp	ebx, -1
	je	.L2
	test	ebx, ebx
	je	.L3
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	jmp	BUG@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	edx, DWORD PTR EBU_NAND_CON[rip]
	mov	edi, DWORD PTR NAND_CON_CE[rip]
	xor	esi, esi
	call	ltq_ebu_w32_mask@PLT
	mov	edi, DWORD PTR NAND_CON_NANDM[rip]
	mov	edx, DWORD PTR EBU_NAND_CON[rip]
	xor	esi, esi
	call	ltq_ebu_w32_mask@PLT
	mov	esi, DWORD PTR 0[rbp]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	lea	rdi, ebu_lock[rip]
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	jmp	spin_unlock_irqrestore@PLT
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	mov	esi, DWORD PTR [rax]
	lea	rdi, ebu_lock[rip]
	call	spin_lock_irqsave@PLT
	mov	edx, DWORD PTR EBU_NAND_CON[rip]
	mov	esi, DWORD PTR NAND_CON_NANDM[rip]
	xor	edi, edi
	call	ltq_ebu_w32_mask@PLT
	mov	edx, DWORD PTR EBU_NAND_CON[rip]
	mov	esi, DWORD PTR NAND_CON_CE[rip]
	xor	edi, edi
	add	rsp, 8
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	jmp	ltq_ebu_w32_mask@PLT
	.cfi_endproc
.LFE0:
	.size	xway_select_chip, .-xway_select_chip
	.comm	ebu_lock,4,4
	.comm	NAND_CON_NANDM,4,4
	.comm	NAND_CON_CE,4,4
	.comm	EBU_NAND_CON,4,4
	.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_xway_nand.c_xway_select_chip.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	xway_select_chip, %function
xway_select_chip:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r4, r1
	bl	nand_get_controller_data
	cmn	r4, #1
	mov	r5, r0
	beq	.L2
	cmp	r4, #0
	beq	.L3
	pop	{r4, r5, r6, lr}
	b	BUG
.L2:
	ldr	r4, .L8
	ldr	r3, .L8+4
	ldr	r2, [r4]
	mov	r1, #0
	ldr	r0, [r3]
	bl	ltq_ebu_w32_mask
	ldr	r3, .L8+8
	mov	r1, #0
	ldr	r2, [r4]
	ldr	r0, [r3]
	bl	ltq_ebu_w32_mask
	ldr	r1, [r5]
	ldr	r0, .L8+12
	pop	{r4, r5, r6, lr}
	b	spin_unlock_irqrestore
.L3:
	ldr	r1, [r0]
	ldr	r0, .L8+12
	bl	spin_lock_irqsave
	ldr	r5, .L8
	ldr	r3, .L8+8
	ldr	r2, [r5]
	ldr	r1, [r3]
	mov	r0, r4
	bl	ltq_ebu_w32_mask
	ldr	r3, .L8+4
	mov	r0, r4
	ldr	r2, [r5]
	ldr	r1, [r3]
	pop	{r4, r5, r6, lr}
	b	ltq_ebu_w32_mask
.L9:
	.align	2
.L8:
	.word	EBU_NAND_CON
	.word	NAND_CON_CE
	.word	NAND_CON_NANDM
	.word	ebu_lock
	.size	xway_select_chip, .-xway_select_chip
	.comm	ebu_lock,4,4
	.comm	NAND_CON_NANDM,4,4
	.comm	NAND_CON_CE,4,4
	.comm	EBU_NAND_CON,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
