	.file	"extr_ni_mio_common.c_ni_ai_setup_MITE_dma.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ni_ai_setup_MITE_dma, @function
ni_ai_setup_MITE_dma:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movsx	rbx, DWORD PTR NI_AI_SUBDEV[rip]
	mov	rbp, QWORD PTR [rdi]
	call	ni_request_ai_mite_channel@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L10
.L1:
	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
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	mov	rdi, QWORD PTR 0[rbp+rbx*8]
	mov	esi, DWORD PTR [rdi]
	call	comedi_buf_write_alloc@PLT
	mov	rdi, QWORD PTR devpriv[rip]
	xor	esi, esi
	call	spin_lock_irqsave@PLT
	mov	r8, QWORD PTR devpriv[rip]
	mov	rdi, QWORD PTR 8[r8]
	test	rdi, rdi
	je	.L11
	mov	eax, DWORD PTR boardtype[rip]
	cmp	eax, 128
	je	.L4
	sub	eax, 129
	mov	edx, 16
	cmp	eax, 1
	ja	.L5
.L8:
	mov	esi, 32
	call	mite_prep_dma@PLT
.L6:
	mov	rax, QWORD PTR devpriv[rip]
	mov	rdi, QWORD PTR 8[rax]
	call	mite_dma_arm@PLT
	mov	rdi, QWORD PTR devpriv[rip]
	xor	esi, esi
	call	spin_unlock_irqrestore@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
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	edx, 32
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	mov	esi, 16
	call	mite_prep_dma@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L11:
	xor	esi, esi
	mov	rdi, r8
	call	spin_unlock_irqrestore@PLT
	mov	r12d, DWORD PTR EIO[rip]
	neg	r12d
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	ni_ai_setup_MITE_dma, .-ni_ai_setup_MITE_dma
	.comm	devpriv,8,8
	.comm	boardtype,4,4
	.comm	NI_AI_SUBDEV,4,4
	.comm	EIO,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_setup_MITE_dma.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ni_ai_setup_MITE_dma, %function
ni_ai_setup_MITE_dma:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L11
	push	{r4, r5, r6, lr}
	ldr	r5, [r0]
	ldr	r6, [r3]
	bl	ni_request_ai_mite_channel
	subs	r4, r0, #0
	beq	.L9
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, pc}
.L9:
	ldr	r0, [r5, r6, lsl #2]
	ldr	r5, .L11+4
	ldr	r1, [r0]
	bl	comedi_buf_write_alloc
	mov	r1, #0
	ldr	r0, [r5]
	bl	spin_lock_irqsave
	ldr	r3, [r5]
	ldr	r0, [r3, #4]
	cmp	r0, #0
	beq	.L10
	ldr	r3, .L11+8
	ldr	r3, [r3]
	cmp	r3, #128
	beq	.L4
	sub	r3, r3, #129
	cmp	r3, #1
	mov	r2, #16
	bhi	.L5
	mov	r1, #32
	bl	mite_prep_dma
.L6:
	ldr	r3, [r5]
	ldr	r0, [r3, #4]
	bl	mite_dma_arm
	mov	r1, #0
	ldr	r0, [r5]
	bl	spin_unlock_irqrestore
	mov	r0, r4
	pop	{r4, r5, r6, pc}
.L4:
	mov	r2, #32
	mov	r1, r2
	bl	mite_prep_dma
	b	.L6
.L5:
	mov	r1, r2
	bl	mite_prep_dma
	b	.L6
.L10:
	mov	r0, r3
	mov	r1, #0
	bl	spin_unlock_irqrestore
	ldr	r3, .L11+12
	ldr	r0, [r3]
	rsb	r4, r0, #0
	b	.L1
.L12:
	.align	2
.L11:
	.word	NI_AI_SUBDEV
	.word	devpriv
	.word	boardtype
	.word	EIO
	.size	ni_ai_setup_MITE_dma, .-ni_ai_setup_MITE_dma
	.comm	devpriv,4,4
	.comm	boardtype,4,4
	.comm	NI_AI_SUBDEV,4,4
	.comm	EIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
