	.file	"extr_ni_mio_common.c_ni_ai_drain_dma.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"ni_mio_common: wait for dma drain timed out\n"
	.align 8
.LC1:
	.string	"mite_bytes_in_transit=%i, AI_Status1_Register=0x%x\n"
	.text
	.p2align 4
	.type	ni_ai_drain_dma, @function
ni_ai_drain_dma:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	rax, QWORD PTR devpriv[rip]
	xor	esi, esi
	xor	r12d, r12d
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	lea	rdi, 8[rax]
	call	spin_lock_irqsave@PLT
	mov	rax, QWORD PTR devpriv[rip]
	cmp	QWORD PTR 16[rax], 0
	je	.L2
	mov	ebx, 10000
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	mov	edi, 5
	call	udelay@PLT
	sub	ebx, 1
	je	.L4
	mov	rax, QWORD PTR devpriv[rip]
.L5:
	mov	esi, DWORD PTR AI_Status_1_Register[rip]
	mov	rdi, rbp
	call	[QWORD PTR [rax]]
	test	DWORD PTR AI_FIFO_Empty_St[rip], eax
	je	.L3
	mov	rax, QWORD PTR devpriv[rip]
	mov	rdi, QWORD PTR 16[rax]
	call	mite_bytes_in_transit@PLT
	test	rax, rax
	jne	.L3
	mov	rax, QWORD PTR devpriv[rip]
	xor	r12d, r12d
.L2:
	lea	rdi, 8[rax]
	xor	esi, esi
	call	spin_unlock_irqrestore@PLT
	mov	rdi, rbp
	call	ni_sync_ai_dma@PLT
	mov	eax, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
.L4:
	.cfi_restore_state
	lea	rdi, .LC0[rip]
	xor	eax, eax
	call	printk@PLT
	mov	rax, QWORD PTR devpriv[rip]
	mov	esi, DWORD PTR AI_Status_1_Register[rip]
	mov	rdi, rbp
	call	[QWORD PTR [rax]]
	mov	r12d, eax
	mov	rax, QWORD PTR devpriv[rip]
	mov	rdi, QWORD PTR 16[rax]
	call	mite_bytes_in_transit@PLT
	mov	edx, r12d
	lea	rdi, .LC1[rip]
	mov	r12d, -1
	mov	rsi, rax
	xor	eax, eax
	call	printk@PLT
	mov	rax, QWORD PTR devpriv[rip]
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	ni_ai_drain_dma, .-ni_ai_drain_dma
	.comm	devpriv,8,8
	.comm	AI_Status_1_Register,4,4
	.comm	AI_FIFO_Empty_St,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_ni_mio_common.c_ni_ai_drain_dma.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"ni_mio_common: wait for dma drain timed out\012\000"
	.align	2
.LC1:
	.ascii	"mite_bytes_in_transit=%i, AI_Status1_Register=0x%x\012"
	.ascii	"\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ni_ai_drain_dma, %function
ni_ai_drain_dma:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r5, .L16
	mov	r1, #0
	ldr	r3, [r5]
	mov	r6, r0
	add	r0, r3, #4
	bl	spin_lock_irqsave
	ldr	r0, [r5]
	ldr	r9, [r0, #8]
	cmp	r9, #0
	beq	.L2
	ldr	r4, .L16+4
	ldr	r7, .L16+8
	ldr	r8, .L16+12
	b	.L5
.L3:
	mov	r0, #5
	bl	udelay
	subs	r4, r4, #1
	beq	.L4
	ldr	r0, [r5]
.L5:
	ldr	r3, [r0]
	ldr	r1, [r7]
	mov	r0, r6
	blx	r3
	ldr	r3, [r8]
	tst	r0, r3
	beq	.L3
	ldr	r3, [r5]
	ldr	r0, [r3, #8]
	bl	mite_bytes_in_transit
	subs	r9, r0, #0
	bne	.L3
.L14:
	ldr	r0, [r5]
.L2:
	mov	r1, #0
	add	r0, r0, #4
	bl	spin_unlock_irqrestore
	mov	r0, r6
	bl	ni_sync_ai_dma
	mov	r0, r9
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L4:
	ldr	r0, .L16+16
	bl	printk
	ldr	r3, [r5]
	mvn	r9, #0
	ldr	r0, [r3, #8]
	bl	mite_bytes_in_transit
	ldr	r3, [r5]
	mov	r4, r0
	ldr	r1, [r7]
	mov	r0, r6
	ldr	r3, [r3]
	blx	r3
	mov	r1, r4
	mov	r2, r0
	ldr	r0, .L16+20
	bl	printk
	b	.L14
.L17:
	.align	2
.L16:
	.word	devpriv
	.word	10000
	.word	AI_Status_1_Register
	.word	AI_FIFO_Empty_St
	.word	.LC0
	.word	.LC1
	.size	ni_ai_drain_dma, .-ni_ai_drain_dma
	.comm	devpriv,4,4
	.comm	AI_Status_1_Register,4,4
	.comm	AI_FIFO_Empty_St,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
