	.file	"extr_cb_das16_cs.c_das16cs_ai_insn_read.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	das16cs_ai_insn_read, @function
das16cs_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
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rcx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rsi
	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
	mov	rbx, rdi
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	r15, QWORD PTR 8[rdi]
	mov	edi, DWORD PTR 4[rdx]
	call	CR_CHAN@PLT
	mov	edi, DWORD PTR 4[rbp]
	mov	DWORD PTR 12[rsp], eax
	call	CR_RANGE@PLT
	mov	edi, DWORD PTR 4[rbp]
	mov	r14d, eax
	call	CR_AREF@PLT
	mov	r8d, DWORD PTR 12[rsp]
	mov	rsi, QWORD PTR DAS16CS_AI_MUX_REG[rip]
	add	rsi, QWORD PTR [rbx]
	mov	DWORD PTR 8[rsp], eax
	mov	edi, r8d
	mov	QWORD PTR [rsp], rsi
	call	DAS16CS_AI_MUX_SINGLE_CHAN@PLT
	mov	rsi, QWORD PTR [rsp]
	mov	edi, eax
	call	outw@PLT
	mov	eax, DWORD PTR DAS16CS_MISC1_INTE[rip]
	mov	edi, DWORD PTR DAS16CS_MISC1_SEDIFF[rip]
	or	eax, DWORD PTR DAS16CS_MISC1_INT_SRC_MASK[rip]
	or	eax, DWORD PTR DAS16CS_MISC1_AI_CONV_MASK[rip]
	not	eax
	and	eax, DWORD PTR [r15]
	mov	edx, DWORD PTR 8[rsp]
	or	edi, eax
	cmp	DWORD PTR AREF_DIFF[rip], edx
	jne	.L3
	mov	edi, DWORD PTR DAS16CS_MISC1_SEDIFF[rip]
	not	edi
	and	edi, eax
.L3:
	mov	DWORD PTR [r15], edi
	mov	rsi, QWORD PTR DAS16CS_MISC1_REG[rip]
	add	rsi, QWORD PTR [rbx]
	call	outw@PLT
	mov	edi, DWORD PTR DAS16CS_MISC2_BME[rip]
	or	edi, DWORD PTR DAS16CS_MISC2_AI_GAIN_MASK[rip]
	not	edi
	and	edi, DWORD PTR 4[r15]
	mov	DWORD PTR 4[r15], edi
	cmp	r14d, 2
	je	.L4
	jg	.L5
	test	r14d, r14d
	je	.L6
	cmp	r14d, 1
	jne	.L8
	or	edi, DWORD PTR DAS16CS_MISC2_AI_GAIN_2[rip]
	mov	DWORD PTR 4[r15], edi
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rsi, QWORD PTR DAS16CS_MISC2_REG[rip]
	add	rsi, QWORD PTR [rbx]
	call	outw@PLT
	mov	eax, DWORD PTR 0[rbp]
	test	eax, eax
	jle	.L12
	xor	r14d, r14d
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L16:
	mov	rdi, QWORD PTR DAS16CS_AI_DATA_REG[rip]
	add	rdi, QWORD PTR [rbx]
	call	inw@PLT
	mov	DWORD PTR 0[r13+r14*4], eax
	lea	eax, 1[r14]
	add	r14, 1
	cmp	DWORD PTR 0[rbp], r14d
	jle	.L1
.L11:
	xor	edi, edi
	mov	rsi, QWORD PTR DAS16CS_AI_DATA_REG[rip]
	add	rsi, QWORD PTR [rbx]
	call	outw@PLT
	xor	r8d, r8d
	mov	rdx, rbp
	mov	rsi, r12
	mov	ecx, DWORD PTR das16cs_ai_eoc[rip]
	mov	rdi, rbx
	call	comedi_timeout@PLT
	test	eax, eax
	je	.L16
.L1:
	add	rsp, 24
	.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
.L5:
	.cfi_restore_state
	cmp	r14d, 3
	jne	.L8
	or	edi, DWORD PTR DAS16CS_MISC2_AI_GAIN_8[rip]
	mov	DWORD PTR 4[r15], edi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L4:
	or	edi, DWORD PTR DAS16CS_MISC2_AI_GAIN_4[rip]
	mov	DWORD PTR 4[r15], edi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	or	edi, DWORD PTR DAS16CS_MISC2_AI_GAIN_1[rip]
	mov	DWORD PTR 4[r15], edi
	jmp	.L8
.L12:
	xor	eax, eax
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	das16cs_ai_insn_read, .-das16cs_ai_insn_read
	.comm	das16cs_ai_eoc,4,4
	.comm	DAS16CS_MISC2_REG,8,8
	.comm	DAS16CS_MISC2_BME,4,4
	.comm	DAS16CS_MISC2_AI_GAIN_MASK,4,4
	.comm	DAS16CS_MISC2_AI_GAIN_8,4,4
	.comm	DAS16CS_MISC2_AI_GAIN_4,4,4
	.comm	DAS16CS_MISC2_AI_GAIN_2,4,4
	.comm	DAS16CS_MISC2_AI_GAIN_1,4,4
	.comm	DAS16CS_MISC1_SEDIFF,4,4
	.comm	DAS16CS_MISC1_REG,8,8
	.comm	DAS16CS_MISC1_INT_SRC_MASK,4,4
	.comm	DAS16CS_MISC1_INTE,4,4
	.comm	DAS16CS_MISC1_AI_CONV_MASK,4,4
	.comm	DAS16CS_AI_MUX_REG,8,8
	.comm	DAS16CS_AI_DATA_REG,8,8
	.comm	AREF_DIFF,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_cb_das16_cs.c_das16cs_ai_insn_read.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	das16cs_ai_insn_read, %function
das16cs_ai_insn_read:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	sub	sp, sp, #12
	ldr	r0, [r2, #4]
	mov	r6, r2
	mov	r9, r1
	mov	r7, r3
	ldr	r8, [r4, #4]
	bl	CR_CHAN
	mov	fp, r0
	ldr	r0, [r6, #4]
	bl	CR_RANGE
	mov	r5, r0
	ldr	r0, [r6, #4]
	bl	CR_AREF
	mov	r10, r0
	mov	r0, fp
	bl	DAS16CS_AI_MUX_SINGLE_CHAN
	ldr	r3, .L18
	ldr	r1, [r4]
	ldr	r3, [r3]
	add	r1, r1, r3
	bl	outw
	ldr	r2, .L18+4
	ldr	r3, .L18+8
	ldr	r0, .L18+12
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r0, [r0]
	orr	r2, r2, r3
	ldr	r3, [r8]
	orr	r0, r2, r0
	ldr	r1, .L18+16
	bic	r0, r3, r0
	ldr	r3, .L18+20
	ldr	r1, [r1]
	ldr	r3, [r3]
	cmp	r1, r10
	biceq	r0, r0, r3
	orrne	r0, r0, r3
	ldr	r3, .L18+24
	ldr	r1, [r4]
	ldr	r3, [r3]
	str	r0, [r8]
	add	r1, r1, r3
	bl	outw
	ldr	r2, .L18+28
	ldr	r3, .L18+32
	ldr	r0, [r2]
	ldr	r2, [r3]
	ldr	r3, [r8, #4]
	orr	r0, r0, r2
	bic	r0, r3, r0
	str	r0, [r8, #4]
	cmp	r5, #3
	ldrls	pc, [pc, r5, asl #2]
	b	.L4
.L6:
	.word	.L9
	.word	.L8
	.word	.L7
	.word	.L5
.L5:
	ldr	r3, .L18+36
	ldr	r3, [r3]
	orr	r0, r0, r3
	str	r0, [r8, #4]
.L4:
	ldr	r3, .L18+40
	ldr	r1, [r4]
	ldr	r3, [r3]
	add	r1, r1, r3
	bl	outw
	ldr	r3, [r6]
	cmp	r3, #0
	ble	.L12
	mov	r5, #0
	ldr	r8, .L18+44
	mov	fp, r5
	ldr	r10, .L18+48
	sub	r7, r7, #4
	b	.L11
.L17:
	ldr	r3, [r8]
	ldr	r0, [r4]
	add	r0, r0, r3
	bl	inw
	str	r0, [r7, #4]!
	ldr	r3, [r6]
	cmp	r3, r5
	ble	.L16
.L11:
	ldr	r3, [r8]
	ldr	r1, [r4]
	mov	r0, #0
	add	r1, r1, r3
	bl	outw
	str	fp, [sp]
	mov	r2, r6
	mov	r1, r9
	mov	r0, r4
	ldr	r3, [r10]
	bl	comedi_timeout
	cmp	r0, #0
	add	r5, r5, #1
	beq	.L17
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	ldr	r3, .L18+52
	ldr	r3, [r3]
	orr	r0, r0, r3
	str	r0, [r8, #4]
	b	.L4
.L8:
	ldr	r3, .L18+56
	ldr	r3, [r3]
	orr	r0, r0, r3
	str	r0, [r8, #4]
	b	.L4
.L9:
	ldr	r3, .L18+60
	ldr	r3, [r3]
	orr	r0, r0, r3
	str	r0, [r8, #4]
	b	.L4
.L16:
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L12:
	mov	r0, #0
	b	.L1
.L19:
	.align	2
.L18:
	.word	DAS16CS_AI_MUX_REG
	.word	DAS16CS_MISC1_INTE
	.word	DAS16CS_MISC1_INT_SRC_MASK
	.word	DAS16CS_MISC1_AI_CONV_MASK
	.word	AREF_DIFF
	.word	DAS16CS_MISC1_SEDIFF
	.word	DAS16CS_MISC1_REG
	.word	DAS16CS_MISC2_BME
	.word	DAS16CS_MISC2_AI_GAIN_MASK
	.word	DAS16CS_MISC2_AI_GAIN_8
	.word	DAS16CS_MISC2_REG
	.word	DAS16CS_AI_DATA_REG
	.word	das16cs_ai_eoc
	.word	DAS16CS_MISC2_AI_GAIN_4
	.word	DAS16CS_MISC2_AI_GAIN_2
	.word	DAS16CS_MISC2_AI_GAIN_1
	.size	das16cs_ai_insn_read, .-das16cs_ai_insn_read
	.comm	das16cs_ai_eoc,4,4
	.comm	DAS16CS_MISC2_REG,4,4
	.comm	DAS16CS_MISC2_BME,4,4
	.comm	DAS16CS_MISC2_AI_GAIN_MASK,4,4
	.comm	DAS16CS_MISC2_AI_GAIN_8,4,4
	.comm	DAS16CS_MISC2_AI_GAIN_4,4,4
	.comm	DAS16CS_MISC2_AI_GAIN_2,4,4
	.comm	DAS16CS_MISC2_AI_GAIN_1,4,4
	.comm	DAS16CS_MISC1_SEDIFF,4,4
	.comm	DAS16CS_MISC1_REG,4,4
	.comm	DAS16CS_MISC1_INT_SRC_MASK,4,4
	.comm	DAS16CS_MISC1_INTE,4,4
	.comm	DAS16CS_MISC1_AI_CONV_MASK,4,4
	.comm	DAS16CS_AI_MUX_REG,4,4
	.comm	DAS16CS_AI_DATA_REG,4,4
	.comm	AREF_DIFF,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
