	.file	"extr_wbsd.c_wbsd_set_ios.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	wbsd_set_ios, @function
wbsd_set_ios:
.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
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	mmc_priv@PLT
	lea	r13, 16[rax]
	mov	rbx, rax
	mov	rdi, r13
	call	spin_lock_bh@PLT
	mov	rax, QWORD PTR MMC_POWER_OFF[rip]
	cmp	QWORD PTR 0[rbp], rax
	je	.L16
.L2:
	mov	eax, DWORD PTR 8[rbp]
	mov	r12, QWORD PTR WBSD_CLK_24M[rip]
	cmp	eax, 23999999
	jg	.L4
	mov	r12, QWORD PTR WBSD_CLK_16M[rip]
	cmp	eax, 15999999
	jle	.L17
.L4:
	cmp	QWORD PTR [rbx], r12
	je	.L7
	mov	esi, DWORD PTR WBSD_IDX_CLK[rip]
	mov	rdx, r12
	mov	rdi, rbx
	call	wbsd_write_index@PLT
	mov	QWORD PTR [rbx], r12
.L7:
	mov	rax, QWORD PTR MMC_POWER_OFF[rip]
	cmp	QWORD PTR 0[rbp], rax
	je	.L8
	mov	rdi, QWORD PTR WBSD_CSR[rip]
	add	rdi, QWORD PTR 32[rbx]
	call	inb@PLT
	mov	rdi, QWORD PTR WBSD_POWER_N[rip]
	mov	rsi, QWORD PTR WBSD_CSR[rip]
	add	rsi, QWORD PTR 32[rbx]
	not	rdi
	and	rdi, rax
	call	outb@PLT
.L8:
	mov	esi, DWORD PTR WBSD_IDX_SETUP[rip]
	mov	rdi, rbx
	call	wbsd_read_index@PLT
	mov	r12, rax
	mov	rax, QWORD PTR MMC_CS_HIGH[rip]
	cmp	QWORD PTR 16[rbp], rax
	je	.L18
	mov	rax, QWORD PTR WBSD_DAT3_H[rip]
	test	rax, r12
	jne	.L19
.L10:
	mov	esi, DWORD PTR WBSD_IDX_SETUP[rip]
	mov	rdi, rbx
	mov	rdx, r12
	call	wbsd_write_index@PLT
	mov	rax, QWORD PTR 24[rbp]
	mov	rdi, r13
	mov	QWORD PTR 8[rbx], rax
	add	rsp, 8
	.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
	jmp	spin_unlock_bh@PLT
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	mov	r12, QWORD PTR WBSD_CLK_12M[rip]
	cmp	eax, 11999999
	cmovle	r12, QWORD PTR WBSD_CLK_375K[rip]
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L19:
	movsx	rsi, DWORD PTR HZ[rip]
	not	rax
	lea	rdi, 20[rbx]
	and	r12, rax
	mov	rax, rsi
	imul	rsi, rsi, 1374389535
	sar	eax, 31
	sar	rsi, 37
	sub	esi, eax
	movsx	rsi, esi
	add	rsi, QWORD PTR jiffies[rip]
	call	mod_timer@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L16:
	mov	rdi, rbx
	call	wbsd_init_device@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L18:
	mov	rax, QWORD PTR MMC_BUS_WIDTH_1[rip]
	xor	edi, edi
	cmp	QWORD PTR 24[rbp], rax
	setne	dil
	call	BUG_ON@PLT
	mov	eax, DWORD PTR WBSD_FIGNORE_DETECT[rip]
	or	DWORD PTR 24[rbx], eax
	or	r12, QWORD PTR WBSD_DAT3_H[rip]
	jmp	.L10
	.cfi_endproc
.LFE0:
	.size	wbsd_set_ios, .-wbsd_set_ios
	.comm	jiffies,8,8
	.comm	WBSD_POWER_N,8,8
	.comm	WBSD_IDX_SETUP,4,4
	.comm	WBSD_IDX_CLK,4,4
	.comm	WBSD_FIGNORE_DETECT,4,4
	.comm	WBSD_DAT3_H,8,8
	.comm	WBSD_CSR,8,8
	.comm	WBSD_CLK_375K,8,8
	.comm	WBSD_CLK_24M,8,8
	.comm	WBSD_CLK_16M,8,8
	.comm	WBSD_CLK_12M,8,8
	.comm	MMC_POWER_OFF,8,8
	.comm	MMC_CS_HIGH,8,8
	.comm	MMC_BUS_WIDTH_1,8,8
	.comm	HZ,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_wbsd.c_wbsd_set_ios.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	wbsd_set_ios, %function
wbsd_set_ios:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r1
	bl	mmc_priv
	ldr	r8, .L19
	add	r7, r0, #8
	mov	r4, r0
	mov	r0, r7
	bl	spin_lock_bh
	ldr	r2, [r5]
	ldr	r3, [r8]
	cmp	r2, r3
	beq	.L16
.L2:
	ldr	r3, [r5, #4]
	ldr	r2, .L19+4
	cmp	r3, r2
	ble	.L3
	ldr	r3, .L19+8
	ldr	r6, [r3]
.L4:
	ldr	r3, [r4]
	cmp	r3, r6
	beq	.L7
	ldr	r3, .L19+12
	mov	r2, r6
	mov	r0, r4
	ldr	r1, [r3]
	bl	wbsd_write_index
	str	r6, [r4]
.L7:
	ldr	r3, [r8]
	ldr	r2, [r5]
	cmp	r2, r3
	beq	.L8
	ldr	r6, .L19+16
	ldr	r0, [r4, #20]
	ldr	r3, [r6]
	add	r0, r0, r3
	bl	inb
	ldr	r3, .L19+20
	ldr	r2, [r6]
	ldr	r1, [r4, #20]
	ldr	r3, [r3]
	add	r1, r1, r2
	bic	r0, r0, r3
	bl	outb
.L8:
	ldr	r8, .L19+24
	mov	r0, r4
	ldr	r1, [r8]
	bl	wbsd_read_index
	ldr	r3, .L19+28
	ldr	r1, [r5, #8]
	ldr	r3, [r3]
	mov	r6, r0
	cmp	r1, r3
	beq	.L17
	ldr	r3, .L19+32
	ldr	r3, [r3]
	tst	r3, r0
	bne	.L18
.L10:
	mov	r2, r6
	mov	r0, r4
	ldr	r1, [r8]
	bl	wbsd_write_index
	ldr	r3, [r5, #12]
	mov	r0, r7
	str	r3, [r4, #4]
	pop	{r4, r5, r6, r7, r8, lr}
	b	spin_unlock_bh
.L3:
	ldr	r2, .L19+36
	cmp	r3, r2
	ldrge	r3, .L19+40
	ldrge	r6, [r3]
	bge	.L4
.L5:
	ldr	r2, .L19+44
	cmp	r3, r2
	ldrge	r3, .L19+48
	ldrlt	r3, .L19+52
	ldr	r6, [r3]
	b	.L4
.L18:
	ldr	r2, .L19+56
	ldr	r1, .L19+60
	ldr	r2, [r2]
	bic	r6, r0, r3
	smull	r0, r3, r1, r2
	ldr	r1, .L19+64
	asr	r2, r2, #31
	ldr	r1, [r1]
	rsb	r2, r2, r3, asr #5
	add	r1, r2, r1
	add	r0, r4, #12
	bl	mod_timer
	b	.L10
.L17:
	ldr	r3, .L19+68
	ldr	r0, [r5, #12]
	ldr	r3, [r3]
	subs	r0, r0, r3
	movne	r0, #1
	bl	BUG_ON
	ldr	r3, .L19+72
	ldr	r2, .L19+32
	ldr	r1, [r3]
	ldr	r3, [r4, #16]
	ldr	r2, [r2]
	orr	r3, r3, r1
	str	r3, [r4, #16]
	orr	r6, r6, r2
	b	.L10
.L16:
	mov	r0, r4
	bl	wbsd_init_device
	b	.L2
.L20:
	.align	2
.L19:
	.word	MMC_POWER_OFF
	.word	23999999
	.word	WBSD_CLK_24M
	.word	WBSD_IDX_CLK
	.word	WBSD_CSR
	.word	WBSD_POWER_N
	.word	WBSD_IDX_SETUP
	.word	MMC_CS_HIGH
	.word	WBSD_DAT3_H
	.word	16000000
	.word	WBSD_CLK_16M
	.word	12000000
	.word	WBSD_CLK_12M
	.word	WBSD_CLK_375K
	.word	HZ
	.word	1374389535
	.word	jiffies
	.word	MMC_BUS_WIDTH_1
	.word	WBSD_FIGNORE_DETECT
	.size	wbsd_set_ios, .-wbsd_set_ios
	.comm	jiffies,4,4
	.comm	WBSD_POWER_N,4,4
	.comm	WBSD_IDX_SETUP,4,4
	.comm	WBSD_IDX_CLK,4,4
	.comm	WBSD_FIGNORE_DETECT,4,4
	.comm	WBSD_DAT3_H,4,4
	.comm	WBSD_CSR,4,4
	.comm	WBSD_CLK_375K,4,4
	.comm	WBSD_CLK_24M,4,4
	.comm	WBSD_CLK_16M,4,4
	.comm	WBSD_CLK_12M,4,4
	.comm	MMC_POWER_OFF,4,4
	.comm	MMC_CS_HIGH,4,4
	.comm	MMC_BUS_WIDTH_1,4,4
	.comm	HZ,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
