	.file	"extr_usbdux.c_usbdux_ai_insn_read.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	usbdux_ai_insn_read, @function
usbdux_ai_insn_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, rsi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	r13, QWORD PTR [rdi]
	mov	edi, DWORD PTR 4[rdx]
	mov	QWORD PTR 8[rsp], rcx
	call	CR_CHAN@PLT
	mov	edi, DWORD PTR 4[rbp]
	mov	DWORD PTR [rsp], eax
	call	CR_RANGE@PLT
	mov	r15d, DWORD PTR EBUSY[rip]
	mov	rdi, r13
	mov	DWORD PTR 4[rsp], eax
	call	mutex_lock@PLT
	neg	r15d
	cmp	QWORD PTR 24[r13], 0
	je	.L14
.L4:
	mov	rdi, r13
	call	mutex_unlock@PLT
	test	r15d, r15d
	jne	.L1
	mov	r15d, DWORD PTR 0[rbp]
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r15d
	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
.L14:
	.cfi_restore_state
	mov	esi, DWORD PTR 4[rsp]
	mov	edi, DWORD PTR [rsp]
	mov	rbx, QWORD PTR 16[r13]
	call	create_adc_command@PLT
	mov	esi, DWORD PTR USBDUX_CMD_SINGLE_AI[rip]
	mov	rdi, r12
	mov	DWORD PTR 4[rbx], eax
	call	send_dux_commands@PLT
	mov	r15d, eax
	test	eax, eax
	js	.L3
	mov	eax, DWORD PTR 0[rbp]
	test	eax, eax
	jle	.L4
	xor	ebx, ebx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rax, QWORD PTR 8[rsp]
	mov	DWORD PTR [rax+rbx*4], r9d
	add	rbx, 1
	cmp	DWORD PTR 0[rbp], ebx
	jle	.L4
.L6:
	mov	esi, DWORD PTR USBDUX_CMD_SINGLE_AI[rip]
	mov	rdi, r12
	call	receive_dux_commands@PLT
	mov	r15d, eax
	test	eax, eax
	js	.L3
	mov	rax, QWORD PTR 8[r13]
	mov	edi, DWORD PTR 4[rax]
	call	le16_to_cpu@PLT
	mov	esi, DWORD PTR 4[rsp]
	mov	rdi, r14
	mov	DWORD PTR [rsp], eax
	call	comedi_range_is_bipolar@PLT
	mov	r9d, DWORD PTR [rsp]
	test	rax, rax
	je	.L5
	mov	esi, r9d
	mov	rdi, r14
	call	comedi_offset_munge@PLT
	mov	r9d, eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rdi, r13
	call	mutex_unlock@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	usbdux_ai_insn_read, .-usbdux_ai_insn_read
	.comm	USBDUX_CMD_SINGLE_AI,4,4
	.comm	EBUSY,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_usbdux.c_usbdux_ai_insn_read.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	usbdux_ai_insn_read, %function
usbdux_ai_insn_read:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r8, r0
	sub	sp, sp, #12
	ldr	r0, [r2, #4]
	mov	r6, r2
	mov	r10, r1
	ldr	r9, [r8]
	str	r3, [sp, #4]
	bl	CR_CHAN
	mov	r7, r0
	ldr	r0, [r6, #4]
	bl	CR_RANGE
	ldr	r3, .L15
	mov	fp, r0
	mov	r0, r9
	ldr	r4, [r3]
	bl	mutex_lock
	ldr	r5, [r9, #12]
	cmp	r5, #0
	rsbne	r4, r4, #0
	beq	.L14
.L4:
	mov	r0, r9
	bl	mutex_unlock
	cmp	r4, #0
	ldreq	r4, [r6]
.L1:
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L14:
	mov	r1, fp
	mov	r0, r7
	ldr	r4, [r9, #8]
	bl	create_adc_command
	ldr	r2, .L15+4
	str	r0, [r4, #4]
	ldr	r1, [r2]
	mov	r0, r8
	bl	send_dux_commands
	subs	r4, r0, #0
	blt	.L3
	ldr	r3, [r6]
	cmp	r3, #0
	ble	.L4
	ldr	r3, [sp, #4]
	sub	r7, r3, #4
	b	.L6
.L5:
	str	r3, [r7, #4]!
	ldr	r3, [r6]
	cmp	r3, r5
	ble	.L4
.L6:
	ldr	r3, .L15+4
	mov	r0, r8
	ldr	r1, [r3]
	bl	receive_dux_commands
	subs	r4, r0, #0
	add	r5, r5, #1
	blt	.L3
	ldr	r3, [r9, #4]
	ldr	r0, [r3, #4]
	bl	le16_to_cpu
	mov	r3, r0
	mov	r1, fp
	mov	r0, r10
	str	r3, [sp, #4]
	bl	comedi_range_is_bipolar
	cmp	r0, #0
	ldr	r3, [sp, #4]
	beq	.L5
	mov	r1, r3
	mov	r0, r10
	bl	comedi_offset_munge
	mov	r3, r0
	b	.L5
.L3:
	mov	r0, r9
	bl	mutex_unlock
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L16:
	.align	2
.L15:
	.word	EBUSY
	.word	USBDUX_CMD_SINGLE_AI
	.size	usbdux_ai_insn_read, .-usbdux_ai_insn_read
	.comm	USBDUX_CMD_SINGLE_AI,4,4
	.comm	EBUSY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
