	.file	"extr_aml8726_sdxc-m8.c_aml8726_sdxc_busy_check.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	aml8726_sdxc_busy_check, @function
aml8726_sdxc_busy_check:
.LFB0:
	.cfi_startproc
	endbr64
	mov	rax, QWORD PTR AML_SDXC_BUSY_POLL_INTVL[rip]
	mov	esi, DWORD PTR AML_SDXC_STATUS_REG[rip]
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rdi
	add	QWORD PTR [rdi], rax
	call	CSR_READ_4@PLT
	test	DWORD PTR AML_SDXC_STATUS_DAT0[rip], eax
	jne	.L7
	mov	rax, QWORD PTR AML_SDXC_BUSY_TIMEOUT[rip]
	cmp	QWORD PTR 0[rbp], rax
	jl	.L8
	mov	rsi, QWORD PTR 8[rbp]
	cmp	rsi, QWORD PTR MMC_ERR_NONE[rip]
	je	.L9
	mov	rdi, rbp
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	aml8726_sdxc_finish_command@PLT
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	mov	rsi, QWORD PTR 8[rbp]
	mov	rdi, rbp
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	aml8726_sdxc_finish_command@PLT
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	mov	rsi, QWORD PTR MMC_ERR_TIMEOUT[rip]
	mov	rdi, rbp
	mov	QWORD PTR 8[rbp], rsi
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	aml8726_sdxc_finish_command@PLT
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	mov	rdi, QWORD PTR AML_SDXC_BUSY_POLL_INTVL[rip]
	call	msecs_to_ticks@PLT
	lea	rdi, 16[rbp]
	mov	rcx, rbp
	lea	rdx, aml8726_sdxc_busy_check[rip]
	mov	esi, eax
	call	callout_reset@PLT
	mov	rdi, rbp
	pop	rbp
	.cfi_def_cfa_offset 8
	jmp	AML_SDXC_UNLOCK@PLT
	.cfi_endproc
.LFE0:
	.size	aml8726_sdxc_busy_check, .-aml8726_sdxc_busy_check
	.comm	MMC_ERR_TIMEOUT,8,8
	.comm	MMC_ERR_NONE,8,8
	.comm	AML_SDXC_STATUS_REG,4,4
	.comm	AML_SDXC_STATUS_DAT0,4,4
	.comm	AML_SDXC_BUSY_TIMEOUT,8,8
	.comm	AML_SDXC_BUSY_POLL_INTVL,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_aml8726_sdxc-m8.c_aml8726_sdxc_busy_check.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	aml8726_sdxc_busy_check, %function
aml8726_sdxc_busy_check:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r5, .L8
	ldr	r3, [r0]
	ldr	r1, [r5]
	ldr	r2, .L8+4
	add	r3, r3, r1
	str	r3, [r0]
	ldr	r1, [r2]
	mov	r4, r0
	bl	CSR_READ_4
	ldr	r3, .L8+8
	ldr	r3, [r3]
	tst	r0, r3
	ldrne	r1, [r4, #4]
	bne	.L3
	ldr	r3, .L8+12
	ldr	r2, [r4]
	ldr	r3, [r3]
	cmp	r2, r3
	blt	.L7
	ldr	r3, .L8+16
	ldr	r1, [r4, #4]
	ldr	r3, [r3]
	cmp	r1, r3
	ldreq	r3, .L8+20
	ldreq	r1, [r3]
	streq	r1, [r4, #4]
.L3:
	mov	r0, r4
	pop	{r4, r5, r6, lr}
	b	aml8726_sdxc_finish_command
.L7:
	ldr	r0, [r5]
	bl	msecs_to_ticks
	mov	r3, r4
	mov	r1, r0
	ldr	r2, .L8+24
	add	r0, r4, #8
	bl	callout_reset
	mov	r0, r4
	pop	{r4, r5, r6, lr}
	b	AML_SDXC_UNLOCK
.L9:
	.align	2
.L8:
	.word	AML_SDXC_BUSY_POLL_INTVL
	.word	AML_SDXC_STATUS_REG
	.word	AML_SDXC_STATUS_DAT0
	.word	AML_SDXC_BUSY_TIMEOUT
	.word	MMC_ERR_NONE
	.word	MMC_ERR_TIMEOUT
	.word	aml8726_sdxc_busy_check
	.size	aml8726_sdxc_busy_check, .-aml8726_sdxc_busy_check
	.comm	MMC_ERR_TIMEOUT,4,4
	.comm	MMC_ERR_NONE,4,4
	.comm	AML_SDXC_STATUS_REG,4,4
	.comm	AML_SDXC_STATUS_DAT0,4,4
	.comm	AML_SDXC_BUSY_TIMEOUT,4,4
	.comm	AML_SDXC_BUSY_POLL_INTVL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
