	.file	"extr_ni_mio_common.c_ni_ai_drain_dma.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"timed out\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.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	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	xor	esi, esi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	r12, QWORD PTR 8[rdi]
	mov	rdi, r12
	call	spin_lock_irqsave@PLT
	cmp	QWORD PTR 8[r12], 0
	je	.L2
	mov	ebx, 10000
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	mov	edi, 5
	call	udelay@PLT
	sub	ebx, 1
	je	.L13
.L4:
	mov	esi, DWORD PTR NISTC_AI_STATUS1_REG[rip]
	mov	rdi, rbp
	call	ni_stc_readw@PLT
	test	DWORD PTR NISTC_AI_STATUS1_FIFO_E[rip], eax
	je	.L6
	mov	rdi, QWORD PTR 8[r12]
	call	mite_bytes_in_transit@PLT
	test	rax, rax
	jne	.L6
.L2:
	xor	r13d, r13d
.L7:
	mov	rdi, r12
	xor	esi, esi
	call	spin_unlock_irqrestore@PLT
	mov	rdi, rbp
	call	ni_sync_ai_dma@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	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
	ret
.L13:
	.cfi_restore_state
	mov	edi, DWORD PTR 0[rbp]
	lea	rsi, .LC0[rip]
	xor	eax, eax
	call	dev_err@PLT
	mov	esi, DWORD PTR NISTC_AI_STATUS1_REG[rip]
	mov	rdi, rbp
	call	ni_stc_readw@PLT
	mov	rdi, QWORD PTR 8[r12]
	mov	r13d, eax
	call	mite_bytes_in_transit@PLT
	mov	edi, DWORD PTR 0[rbp]
	mov	ecx, r13d
	lea	rsi, .LC1[rip]
	mov	rdx, rax
	xor	eax, eax
	mov	r13d, -1
	call	dev_err@PLT
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	ni_ai_drain_dma, .-ni_ai_drain_dma
	.comm	NISTC_AI_STATUS1_REG,4,4
	.comm	NISTC_AI_STATUS1_FIFO_E,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	"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, lr}
	ldr	r8, [r0, #4]
	mov	r5, r0
	mov	r1, #0
	mov	r0, r8
	bl	spin_lock_irqsave
	ldr	r3, [r8, #4]
	cmp	r3, #0
	beq	.L2
	ldr	r4, .L17
	ldr	r6, .L17+4
	ldr	r7, .L17+8
	b	.L4
.L6:
	mov	r0, #5
	bl	udelay
	subs	r4, r4, #1
	beq	.L16
.L4:
	mov	r0, r5
	ldr	r1, [r6]
	bl	ni_stc_readw
	ldr	r3, [r7]
	tst	r0, r3
	beq	.L6
	ldr	r0, [r8, #4]
	bl	mite_bytes_in_transit
	cmp	r0, #0
	bne	.L6
.L2:
	mov	r4, #0
.L7:
	mov	r1, #0
	mov	r0, r8
	bl	spin_unlock_irqrestore
	mov	r0, r5
	bl	ni_sync_ai_dma
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L16:
	ldr	r1, .L17+12
	ldr	r0, [r5]
	bl	dev_err
	ldr	r0, [r8, #4]
	ldr	r7, [r5]
	bl	mite_bytes_in_transit
	ldr	r1, [r6]
	mov	r4, r0
	mov	r0, r5
	bl	ni_stc_readw
	mov	r2, r4
	mov	r3, r0
	ldr	r1, .L17+16
	mov	r0, r7
	bl	dev_err
	mvn	r4, #0
	b	.L7
.L18:
	.align	2
.L17:
	.word	10000
	.word	NISTC_AI_STATUS1_REG
	.word	NISTC_AI_STATUS1_FIFO_E
	.word	.LC0
	.word	.LC1
	.size	ni_ai_drain_dma, .-ni_ai_drain_dma
	.comm	NISTC_AI_STATUS1_REG,4,4
	.comm	NISTC_AI_STATUS1_FIFO_E,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
