	.file	"extr_au1550_ac97.c_au1550_read.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	au1550_read, @function
au1550_read:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rbp, QWORD PTR 8[rdi]
	mov	esi, DWORD PTR current[rip]
	mov	edi, DWORD PTR wait[rip]
	call	DECLARE_WAITQUEUE@PLT
	cmp	QWORD PTR 64[rbp], 0
	je	.L2
	mov	eax, DWORD PTR ENXIO[rip]
	neg	eax
	mov	DWORD PTR 16[rsp], eax
.L1:
	mov	eax, DWORD PTR 16[rsp]
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	edi, DWORD PTR VERIFY_WRITE[rip]
	mov	rdx, r12
	mov	rsi, r13
	call	access_ok@PLT
	test	eax, eax
	jne	.L4
	mov	eax, DWORD PTR EFAULT[rip]
	neg	eax
	mov	DWORD PTR 16[rsp], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rdi, rbp
	imul	r12, QWORD PTR 8[rbp]
	call	mutex_lock@PLT
	lea	rax, 8[rbp]
	lea	rsi, wait[rip]
	mov	QWORD PTR [rsp], rax
	lea	rax, 48[rbp]
	mov	rdi, rax
	mov	QWORD PTR 24[rsp], rax
	call	add_wait_queue@PLT
	test	r12, r12
	je	.L16
	mov	DWORD PTR 16[rsp], 0
	lea	rbx, 4[rbp]
	.p2align 4,,10
	.p2align 3
.L12:
	xor	esi, esi
	mov	rdi, rbx
	call	spin_lock_irqsave@PLT
	cmp	QWORD PTR 56[rbp], 0
	jne	.L23
.L7:
	mov	r15d, DWORD PTR 16[rbp]
	test	r15d, r15d
	jle	.L24
	xor	esi, esi
	mov	rdi, rbx
	call	spin_unlock_irqrestore@PLT
	movsx	rdx, r15d
	mov	rdi, QWORD PTR [rsp]
	mov	rsi, r13
	cmp	rdx, r12
	mov	ecx, 1
	cmova	rdx, r12
	call	copy_dmabuf_user@PLT
	mov	ecx, eax
	test	eax, eax
	js	.L25
	xor	esi, esi
	mov	rdi, rbx
	mov	DWORD PTR 20[rsp], ecx
	mov	QWORD PTR 8[rsp], rsi
	call	spin_lock_irqsave@PLT
	movsx	r15, DWORD PTR 20[rsp]
	mov	rdx, QWORD PTR 24[rbp]
	mov	rax, QWORD PTR 40[rbp]
	mov	rdi, QWORD PTR 32[rbp]
	add	rdx, r15
	sub	DWORD PTR 16[rbp], r15d
	mov	rsi, QWORD PTR 8[rsp]
	mov	rcx, rdx
	add	rdi, rax
	sub	rcx, rax
	cmp	rdx, rdi
	mov	rdi, rbx
	mov	rax, rcx
	cmovl	rax, rdx
	mov	QWORD PTR 24[rbp], rax
	call	spin_unlock_irqrestore@PLT
	mov	rax, r15
	xor	edx, edx
	div	QWORD PTR 8[rbp]
	add	DWORD PTR 16[rsp], eax
	add	r13, rax
	sub	r12, r15
	jne	.L12
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rdi, rbp
	call	mutex_unlock@PLT
.L11:
	mov	rdi, QWORD PTR 24[rsp]
	lea	rsi, wait[rip]
	call	remove_wait_queue@PLT
	mov	edi, DWORD PTR TASK_RUNNING[rip]
	call	set_current_state@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L24:
	mov	edi, DWORD PTR TASK_INTERRUPTIBLE[rip]
	call	__set_current_state@PLT
	xor	esi, esi
	mov	rdi, rbx
	call	spin_unlock_irqrestore@PLT
	mov	eax, DWORD PTR [r14]
	test	DWORD PTR O_NONBLOCK[rip], eax
	jne	.L26
	mov	rdi, rbp
	call	mutex_unlock@PLT
	xor	eax, eax
	call	schedule@PLT
	mov	edi, DWORD PTR current[rip]
	call	signal_pending@PLT
	test	rax, rax
	jne	.L27
	mov	rdi, rbp
	call	mutex_lock@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L23:
	mov	rdi, rbp
	call	start_adc@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L26:
	mov	ecx, DWORD PTR 16[rsp]
	test	ecx, ecx
	jne	.L5
	mov	eax, DWORD PTR EAGAIN[rip]
	neg	eax
	mov	DWORD PTR 16[rsp], eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L27:
	mov	edx, DWORD PTR 16[rsp]
	test	edx, edx
	jne	.L11
	mov	eax, DWORD PTR ERESTARTSYS[rip]
	neg	eax
	mov	DWORD PTR 16[rsp], eax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L25:
	mov	eax, DWORD PTR 16[rsp]
	test	eax, eax
	jne	.L5
	mov	eax, DWORD PTR EFAULT[rip]
	neg	eax
	mov	DWORD PTR 16[rsp], eax
	jmp	.L5
.L16:
	mov	DWORD PTR 16[rsp], 0
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	au1550_read, .-au1550_read
	.comm	wait,4,4
	.comm	current,4,4
	.comm	VERIFY_WRITE,4,4
	.comm	TASK_RUNNING,4,4
	.comm	TASK_INTERRUPTIBLE,4,4
	.comm	O_NONBLOCK,4,4
	.comm	ERESTARTSYS,4,4
	.comm	ENXIO,4,4
	.comm	EFAULT,4,4
	.comm	EAGAIN,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_au1550_ac97.c_au1550_read.c"
	.text
	.global	__aeabi_uidiv
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	au1550_read, %function
au1550_read:
	@ 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, .L33
	ldr	r6, .L33+4
	ldr	r4, [r0, #4]
	sub	sp, sp, #12
	mov	r8, r0
	mov	r7, r1
	ldr	r0, [r6]
	ldr	r1, [r3]
	mov	r5, r2
	bl	DECLARE_WAITQUEUE
	ldr	r3, [r4, #36]
	cmp	r3, #0
	str	r3, [sp]
	beq	.L2
	ldr	r3, .L33+8
	ldr	r9, [r3]
	rsb	r3, r9, #0
	str	r3, [sp]
	ldr	r0, [sp]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r3, .L33+12
	mov	r2, r5
	mov	r1, r7
	ldr	r0, [r3]
	bl	access_ok
	cmp	r0, #0
	bne	.L4
	ldr	r3, .L33+16
	ldr	r9, [r3]
	rsb	r3, r9, #0
	str	r3, [sp]
	ldr	r0, [sp]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	ldr	r3, [r4, #8]
	mov	r0, r4
	mul	r5, r3, r5
	add	r3, r4, #28
	mov	r9, r3
	str	r3, [sp, #4]
	bl	mutex_lock
	mov	r1, r6
	mov	r0, r9
	bl	add_wait_queue
	cmp	r5, #0
	add	r10, r4, #8
	beq	.L5
	ldr	fp, .L33+20
	add	r6, r4, #4
.L12:
	mov	r1, #0
	mov	r0, r6
	bl	spin_lock_irqsave
	ldr	r3, [r4, #32]
	cmp	r3, #0
	bne	.L28
.L7:
	ldr	r9, [r4, #12]
	cmp	r9, #0
	ble	.L29
	mov	r1, #0
	mov	r0, r6
	bl	spin_unlock_irqrestore
	cmp	r9, r5
	movcs	r2, r5
	movcc	r2, r9
	mov	r3, #1
	mov	r1, r7
	mov	r0, r10
	bl	copy_dmabuf_user
	subs	r9, r0, #0
	sub	r5, r5, r9
	blt	.L30
	mov	r1, #0
	mov	r0, r6
	bl	spin_lock_irqsave
	ldr	r3, [r4, #16]
	ldr	ip, [r4, #24]
	ldr	r2, [r4, #20]
	add	r3, r9, r3
	add	r2, ip, r2
	cmp	r3, r2
	ldr	r2, [r4, #12]
	str	r3, [r4, #16]
	sub	r2, r2, r9
	subge	r3, r3, ip
	strge	r3, [r4, #16]
	mov	r1, #0
	str	r2, [r4, #12]
	mov	r0, r6
	bl	spin_unlock_irqrestore
	mov	r0, r9
	ldr	r1, [r4, #8]
	bl	__aeabi_uidiv
	ldr	r3, [sp]
	cmp	r5, #0
	add	r3, r3, r0
	add	r7, r7, r0
	str	r3, [sp]
	bne	.L12
.L5:
	mov	r0, r4
	bl	mutex_unlock
.L11:
	ldr	r1, .L33+4
	ldr	r0, [sp, #4]
	bl	remove_wait_queue
	ldr	r3, .L33+24
	ldr	r0, [r3]
	bl	set_current_state
	ldr	r0, [sp]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L29:
	ldr	r3, .L33+28
	ldr	r0, [r3]
	bl	__set_current_state
	mov	r1, #0
	mov	r0, r6
	bl	spin_unlock_irqrestore
	ldr	r2, [r8]
	ldr	r3, [fp]
	tst	r2, r3
	bne	.L31
	mov	r0, r4
	bl	mutex_unlock
	bl	schedule
	ldr	r3, .L33
	ldr	r0, [r3]
	bl	signal_pending
	cmp	r0, #0
	bne	.L32
	mov	r0, r4
	bl	mutex_lock
	b	.L12
.L28:
	mov	r0, r4
	bl	start_adc
	b	.L7
.L31:
	ldr	r3, [sp]
	cmp	r3, #0
	ldreq	r3, .L33+32
	ldreq	r9, [r3]
	rsbeq	r3, r9, #0
	streq	r3, [sp]
	b	.L5
.L32:
	ldr	r3, [sp]
	cmp	r3, #0
	ldreq	r3, .L33+36
	ldreq	r9, [r3]
	rsbeq	r3, r9, #0
	streq	r3, [sp]
	b	.L11
.L30:
	ldr	r3, [sp]
	cmp	r3, #0
	ldreq	r3, .L33+16
	ldreq	r9, [r3]
	rsbeq	r3, r9, #0
	streq	r3, [sp]
	b	.L5
.L34:
	.align	2
.L33:
	.word	current
	.word	wait
	.word	ENXIO
	.word	VERIFY_WRITE
	.word	EFAULT
	.word	O_NONBLOCK
	.word	TASK_RUNNING
	.word	TASK_INTERRUPTIBLE
	.word	EAGAIN
	.word	ERESTARTSYS
	.size	au1550_read, .-au1550_read
	.comm	wait,4,4
	.comm	current,4,4
	.comm	VERIFY_WRITE,4,4
	.comm	TASK_RUNNING,4,4
	.comm	TASK_INTERRUPTIBLE,4,4
	.comm	O_NONBLOCK,4,4
	.comm	ERESTARTSYS,4,4
	.comm	ENXIO,4,4
	.comm	EFAULT,4,4
	.comm	EAGAIN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
