	.file	"extr_ni_mio_common.c_ni_ai_reset.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ni_ai_reset, @function
ni_ai_reset:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	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
	call	ni_release_ai_mite_channel@PLT
	mov	rax, QWORD PTR devpriv[rip]
	mov	esi, DWORD PTR AI_Configuration_Start[rip]
	mov	rdi, rbp
	or	esi, DWORD PTR AI_Reset[rip]
	mov	edx, DWORD PTR Joint_Reset_Register[rip]
	call	[QWORD PTR [rax]]
	mov	esi, DWORD PTR Interrupt_A_Enable_Register[rip]
	xor	ecx, ecx
	mov	edx, DWORD PTR AI_SC_TC_Interrupt_Enable[rip]
	mov	rdi, rbp
	or	edx, DWORD PTR AI_START1_Interrupt_Enable[rip]
	or	edx, DWORD PTR AI_START2_Interrupt_Enable[rip]
	or	edx, DWORD PTR AI_START_Interrupt_Enable[rip]
	or	edx, DWORD PTR AI_STOP_Interrupt_Enable[rip]
	or	edx, DWORD PTR AI_Error_Interrupt_Enable[rip]
	or	edx, DWORD PTR AI_FIFO_Interrupt_Enable[rip]
	call	ni_set_bits@PLT
	mov	rdi, rbp
	call	ni_clear_ai_fifo@PLT
	mov	rax, QWORD PTR ni_reg_6143[rip]
	cmp	QWORD PTR boardtype[rip], rax
	je	.L2
	mov	esi, DWORD PTR Misc_Command[rip]
	xor	edi, edi
	call	ni_writeb@PLT
.L2:
	mov	rax, QWORD PTR devpriv[rip]
	mov	edx, DWORD PTR AI_Command_1_Register[rip]
	mov	rdi, rbp
	mov	esi, DWORD PTR AI_Disarm[rip]
	call	[QWORD PTR [rax]]
	mov	rax, QWORD PTR devpriv[rip]
	mov	esi, DWORD PTR AI_Start_Stop[rip]
	mov	rdi, rbp
	or	esi, DWORD PTR AI_Mode_1_Reserved[rip]
	mov	edx, DWORD PTR AI_Mode_1_Register[rip]
	call	[QWORD PTR [rax]]
	mov	rax, QWORD PTR devpriv[rip]
	xor	esi, esi
	mov	rdi, rbp
	mov	edx, DWORD PTR AI_Mode_2_Register[rip]
	call	[QWORD PTR [rax]]
	mov	rax, QWORD PTR devpriv[rip]
	xor	esi, esi
	mov	rdi, rbp
	mov	edx, DWORD PTR AI_Mode_3_Register[rip]
	call	[QWORD PTR [rax]]
	mov	rdx, QWORD PTR boardtype[rip]
	cmp	rdx, QWORD PTR ni_reg_611x[rip]
	je	.L11
	mov	rax, QWORD PTR devpriv[rip]
	mov	esi, DWORD PTR AI_SHIFTIN_Pulse_Width[rip]
	or	esi, DWORD PTR AI_SOC_Polarity[rip]
	cmp	rdx, QWORD PTR ni_reg_6143[rip]
	mov	rcx, QWORD PTR [rax]
	mov	r8d, DWORD PTR AI_Personal_Register[rip]
	mov	eax, DWORD PTR AI_LOCALMUX_CLK_Pulse_Width[rip]
	je	.L12
	or	eax, DWORD PTR AI_CONVERT_Pulse_Width[rip]
	mov	edx, r8d
	mov	rdi, rbp
	or	esi, eax
	call	rcx
	mov	edi, 3
	call	AI_SCAN_IN_PROG_Output_Select@PLT
	xor	edi, edi
	mov	ebx, eax
	call	AI_EXTMUX_CLK_Output_Select@PLT
	mov	edi, 2
	or	ebx, eax
	call	AI_LOCALMUX_CLK_Output_Select@PLT
	mov	edi, 3
	or	ebx, eax
	call	AI_SC_TC_Output_Select@PLT
	or	ebx, eax
	mov	rax, QWORD PTR ni_reg_622x[rip]
	cmp	QWORD PTR boardtype[rip], rax
	je	.L13
	mov	edi, DWORD PTR AI_CONVERT_Output_Enable_Low[rip]
	call	AI_CONVERT_Output_Select@PLT
	or	ebx, eax
	mov	esi, ebx
.L7:
	mov	rax, QWORD PTR devpriv[rip]
	mov	edx, DWORD PTR AI_Output_Control_Register[rip]
	mov	rdi, rbp
	call	[QWORD PTR [rax]]
.L4:
	mov	rax, QWORD PTR devpriv[rip]
	mov	rdi, rbp
	mov	esi, DWORD PTR AI_SC_TC_Error_Confirm[rip]
	mov	edx, DWORD PTR Interrupt_A_Ack_Register[rip]
	or	esi, DWORD PTR AI_START_Interrupt_Ack[rip]
	or	esi, DWORD PTR AI_START2_Interrupt_Ack[rip]
	or	esi, DWORD PTR AI_START1_Interrupt_Ack[rip]
	or	esi, DWORD PTR AI_SC_TC_Interrupt_Ack[rip]
	or	esi, DWORD PTR AI_Error_Interrupt_Ack[rip]
	or	esi, DWORD PTR AI_STOP_Interrupt_Ack[rip]
	call	[QWORD PTR [rax]]
	mov	rax, QWORD PTR devpriv[rip]
	mov	rdi, rbp
	mov	edx, DWORD PTR Joint_Reset_Register[rip]
	mov	esi, DWORD PTR AI_Configuration_End[rip]
	call	[QWORD PTR [rax]]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xor	eax, eax
	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
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	or	esi, eax
	mov	edx, r8d
	mov	rdi, rbp
	call	rcx
	mov	rax, QWORD PTR devpriv[rip]
	mov	edi, 3
	mov	r13d, DWORD PTR AI_Output_Control_Register[rip]
	mov	r12, QWORD PTR [rax]
	call	AI_SCAN_IN_PROG_Output_Select@PLT
	xor	edi, edi
	mov	ebx, eax
	call	AI_EXTMUX_CLK_Output_Select@PLT
	mov	edi, 2
	or	ebx, eax
	call	AI_LOCALMUX_CLK_Output_Select@PLT
	mov	edi, 3
	or	ebx, eax
	call	AI_SC_TC_Output_Select@PLT
	mov	edi, DWORD PTR AI_CONVERT_Output_Enable_Low[rip]
	or	ebx, eax
.L9:
	call	AI_CONVERT_Output_Select@PLT
	mov	edx, r13d
	mov	rdi, rbp
	or	ebx, eax
	mov	esi, ebx
	call	r12
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rax, QWORD PTR devpriv[rip]
	mov	edx, DWORD PTR AI_Personal_Register[rip]
	mov	rdi, rbp
	mov	esi, DWORD PTR AI_SHIFTIN_Pulse_Width[rip]
	or	esi, DWORD PTR AI_SOC_Polarity[rip]
	or	esi, DWORD PTR AI_LOCALMUX_CLK_Pulse_Width[rip]
	call	[QWORD PTR [rax]]
	mov	rax, QWORD PTR devpriv[rip]
	mov	edi, 3
	mov	r13d, DWORD PTR AI_Output_Control_Register[rip]
	mov	r12, QWORD PTR [rax]
	call	AI_SCAN_IN_PROG_Output_Select@PLT
	xor	edi, edi
	mov	ebx, eax
	call	AI_EXTMUX_CLK_Output_Select@PLT
	mov	edi, 2
	or	ebx, eax
	call	AI_LOCALMUX_CLK_Output_Select@PLT
	mov	edi, 3
	or	ebx, eax
	call	AI_SC_TC_Output_Select@PLT
	mov	edi, DWORD PTR AI_CONVERT_Output_Enable_High[rip]
	or	ebx, eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L13:
	mov	edi, DWORD PTR AI_CONVERT_Output_Enable_High[rip]
	call	AI_CONVERT_Output_Select@PLT
	or	ebx, eax
	mov	esi, ebx
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	ni_ai_reset, .-ni_ai_reset
	.comm	ni_reg_622x,8,8
	.comm	ni_reg_6143,8,8
	.comm	ni_reg_611x,8,8
	.comm	devpriv,8,8
	.comm	boardtype,8,8
	.comm	Misc_Command,4,4
	.comm	Joint_Reset_Register,4,4
	.comm	Interrupt_A_Enable_Register,4,4
	.comm	Interrupt_A_Ack_Register,4,4
	.comm	AI_Start_Stop,4,4
	.comm	AI_STOP_Interrupt_Enable,4,4
	.comm	AI_STOP_Interrupt_Ack,4,4
	.comm	AI_START_Interrupt_Enable,4,4
	.comm	AI_START_Interrupt_Ack,4,4
	.comm	AI_START2_Interrupt_Enable,4,4
	.comm	AI_START2_Interrupt_Ack,4,4
	.comm	AI_START1_Interrupt_Enable,4,4
	.comm	AI_START1_Interrupt_Ack,4,4
	.comm	AI_SOC_Polarity,4,4
	.comm	AI_SHIFTIN_Pulse_Width,4,4
	.comm	AI_SC_TC_Interrupt_Enable,4,4
	.comm	AI_SC_TC_Interrupt_Ack,4,4
	.comm	AI_SC_TC_Error_Confirm,4,4
	.comm	AI_Reset,4,4
	.comm	AI_Personal_Register,4,4
	.comm	AI_Output_Control_Register,4,4
	.comm	AI_Mode_3_Register,4,4
	.comm	AI_Mode_2_Register,4,4
	.comm	AI_Mode_1_Reserved,4,4
	.comm	AI_Mode_1_Register,4,4
	.comm	AI_LOCALMUX_CLK_Pulse_Width,4,4
	.comm	AI_FIFO_Interrupt_Enable,4,4
	.comm	AI_Error_Interrupt_Enable,4,4
	.comm	AI_Error_Interrupt_Ack,4,4
	.comm	AI_Disarm,4,4
	.comm	AI_Configuration_Start,4,4
	.comm	AI_Configuration_End,4,4
	.comm	AI_Command_1_Register,4,4
	.comm	AI_CONVERT_Pulse_Width,4,4
	.comm	AI_CONVERT_Output_Enable_Low,4,4
	.comm	AI_CONVERT_Output_Enable_High,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_reset.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ni_ai_reset, %function
ni_ai_reset:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	ldr	r5, .L13
	bl	ni_release_ai_mite_channel
	ldr	r2, .L13+4
	ldr	r3, .L13+8
	ldr	r1, [r2]
	ldr	r6, .L13+12
	ldr	r2, [r3]
	ldr	r3, [r5]
	orr	r1, r1, r2
	ldr	r3, [r3]
	ldr	r2, [r6]
	mov	r0, r4
	blx	r3
	ldr	r1, .L13+16
	ldr	r3, .L13+20
	ldr	r2, .L13+24
	ldr	ip, [r1]
	ldr	r3, [r3]
	ldr	r0, .L13+28
	ldr	r1, [r2]
	ldr	r2, .L13+32
	orr	r3, r3, ip
	ldr	ip, [r0]
	ldr	r0, .L13+36
	ldr	r2, [r2]
	orr	r3, r3, r1
	ldr	r1, .L13+40
	ldr	r0, [r0]
	orr	r3, r3, ip
	orr	r3, r3, r2
	ldr	r2, [r1]
	ldr	r1, .L13+44
	orr	r3, r3, r0
	orr	r2, r3, r2
	ldr	r1, [r1]
	mov	r3, #0
	mov	r0, r4
	ldr	r8, .L13+48
	ldr	r7, .L13+52
	bl	ni_set_bits
	mov	r0, r4
	bl	ni_clear_ai_fifo
	ldr	r2, [r8]
	ldr	r3, [r7]
	cmp	r2, r3
	beq	.L2
	ldr	r3, .L13+56
	mov	r0, #0
	ldr	r1, [r3]
	bl	ni_writeb
.L2:
	ldr	r3, [r5]
	ldr	r2, .L13+60
	ldr	r1, .L13+64
	ldr	r2, [r2]
	ldr	r1, [r1]
	ldr	r3, [r3]
	mov	r0, r4
	blx	r3
	ldr	r2, .L13+68
	ldr	r3, .L13+72
	ldr	r0, [r2]
	ldr	r1, [r3]
	ldr	r2, .L13+76
	ldr	r3, [r5]
	orr	r1, r0, r1
	ldr	r2, [r2]
	ldr	r3, [r3]
	mov	r0, r4
	blx	r3
	ldr	r3, [r5]
	ldr	r2, .L13+80
	mov	r1, #0
	ldr	r2, [r2]
	ldr	r3, [r3]
	mov	r0, r4
	blx	r3
	ldr	r3, [r5]
	ldr	r2, .L13+84
	ldr	r3, [r3]
	ldr	r2, [r2]
	mov	r1, #0
	mov	r0, r4
	blx	r3
	ldr	r2, .L13+88
	ldr	r3, [r8]
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L11
	ldr	r2, [r7]
	ldr	r0, .L13+92
	ldr	r1, .L13+96
	ldr	ip, [r0]
	cmp	r3, r2
	ldr	r1, [r1]
	ldr	r0, [r5]
	ldr	r3, .L13+100
	ldr	r2, .L13+104
	ldr	r7, [r0]
	ldr	r3, [r3]
	ldr	r2, [r2]
	orr	r1, ip, r1
	beq	.L12
	ldr	r0, .L13+108
	ldr	ip, [r0]
	mov	r0, r4
	orr	r3, r3, ip
	orr	r1, r3, r1
	blx	r7
	mov	r0, #3
	bl	AI_SCAN_IN_PROG_Output_Select
	mov	r7, r0
	mov	r0, #0
	bl	AI_EXTMUX_CLK_Output_Select
	mov	r1, r0
	mov	r0, #2
	orr	r7, r7, r1
	bl	AI_LOCALMUX_CLK_Output_Select
	mov	r1, r0
	mov	r0, #3
	orr	r7, r7, r1
	bl	AI_SC_TC_Output_Select
	ldr	r3, .L13+112
	ldr	r2, [r8]
	ldr	r3, [r3]
	orr	r7, r7, r0
	cmp	r2, r3
	ldreq	r3, .L13+116
	ldrne	r3, .L13+120
	ldr	r0, [r3]
	bl	AI_CONVERT_Output_Select
	ldr	r2, .L13+124
	ldr	r3, [r5]
	orr	r1, r7, r0
	ldr	r2, [r2]
	mov	r0, r4
	ldr	r3, [r3]
	blx	r3
.L4:
	ldr	r1, .L13+128
	ldr	r3, .L13+132
	ldr	r2, .L13+136
	ldr	ip, [r1]
	ldr	r3, [r3]
	ldr	r0, .L13+140
	ldr	r1, [r2]
	ldr	r2, .L13+144
	orr	r3, r3, ip
	ldr	ip, [r0]
	ldr	r0, .L13+148
	orr	r3, r3, r1
	ldr	r1, [r2]
	ldr	r2, .L13+152
	orr	r3, r3, ip
	ldr	ip, [r0]
	orr	r3, r3, r1
	ldr	r0, [r5]
	ldr	r1, [r2]
	ldr	r2, .L13+156
	orr	r3, r3, ip
	orr	r1, r3, r1
	ldr	r2, [r2]
	ldr	r3, [r0]
	mov	r0, r4
	blx	r3
	ldr	r3, [r5]
	ldr	r1, .L13+160
	mov	r0, r4
	ldr	r3, [r3]
	ldr	r2, [r6]
	ldr	r1, [r1]
	blx	r3
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L12:
	orr	r1, r1, r3
	mov	r0, r4
	blx	r7
	ldr	r3, [r5]
	mov	r0, #3
	ldr	r8, [r3]
	bl	AI_SCAN_IN_PROG_Output_Select
	mov	r7, r0
	mov	r0, #0
	bl	AI_EXTMUX_CLK_Output_Select
	mov	r1, r0
	mov	r0, #2
	orr	r7, r7, r1
	bl	AI_LOCALMUX_CLK_Output_Select
	mov	r1, r0
	mov	r0, #3
	orr	r7, r7, r1
	bl	AI_SC_TC_Output_Select
	ldr	r3, .L13+120
.L9:
	orr	r7, r7, r0
	ldr	r0, [r3]
	bl	AI_CONVERT_Output_Select
	ldr	r3, .L13+124
	orr	r1, r7, r0
	ldr	r2, [r3]
	mov	r0, r4
	blx	r8
	b	.L4
.L11:
	ldr	r1, .L13+96
	ldr	r3, .L13+92
	ldr	r2, .L13+100
	ldr	ip, [r1]
	ldr	r3, [r3]
	ldr	r1, [r2]
	ldr	r0, [r5]
	ldr	r2, .L13+104
	orr	r3, r3, ip
	ldr	r2, [r2]
	orr	r1, r3, r1
	ldr	r3, [r0]
	mov	r0, r4
	blx	r3
	ldr	r3, [r5]
	mov	r0, #3
	ldr	r8, [r3]
	bl	AI_SCAN_IN_PROG_Output_Select
	mov	r7, r0
	mov	r0, #0
	bl	AI_EXTMUX_CLK_Output_Select
	mov	r1, r0
	mov	r0, #2
	orr	r7, r7, r1
	bl	AI_LOCALMUX_CLK_Output_Select
	mov	r1, r0
	mov	r0, #3
	orr	r7, r7, r1
	bl	AI_SC_TC_Output_Select
	ldr	r3, .L13+116
	b	.L9
.L14:
	.align	2
.L13:
	.word	devpriv
	.word	AI_Configuration_Start
	.word	AI_Reset
	.word	Joint_Reset_Register
	.word	AI_START1_Interrupt_Enable
	.word	AI_SC_TC_Interrupt_Enable
	.word	AI_START2_Interrupt_Enable
	.word	AI_START_Interrupt_Enable
	.word	AI_STOP_Interrupt_Enable
	.word	AI_Error_Interrupt_Enable
	.word	AI_FIFO_Interrupt_Enable
	.word	Interrupt_A_Enable_Register
	.word	boardtype
	.word	ni_reg_6143
	.word	Misc_Command
	.word	AI_Command_1_Register
	.word	AI_Disarm
	.word	AI_Start_Stop
	.word	AI_Mode_1_Reserved
	.word	AI_Mode_1_Register
	.word	AI_Mode_2_Register
	.word	AI_Mode_3_Register
	.word	ni_reg_611x
	.word	AI_SHIFTIN_Pulse_Width
	.word	AI_SOC_Polarity
	.word	AI_LOCALMUX_CLK_Pulse_Width
	.word	AI_Personal_Register
	.word	AI_CONVERT_Pulse_Width
	.word	ni_reg_622x
	.word	AI_CONVERT_Output_Enable_High
	.word	AI_CONVERT_Output_Enable_Low
	.word	AI_Output_Control_Register
	.word	AI_START_Interrupt_Ack
	.word	AI_SC_TC_Error_Confirm
	.word	AI_START2_Interrupt_Ack
	.word	AI_START1_Interrupt_Ack
	.word	AI_SC_TC_Interrupt_Ack
	.word	AI_Error_Interrupt_Ack
	.word	AI_STOP_Interrupt_Ack
	.word	Interrupt_A_Ack_Register
	.word	AI_Configuration_End
	.size	ni_ai_reset, .-ni_ai_reset
	.comm	ni_reg_622x,4,4
	.comm	ni_reg_6143,4,4
	.comm	ni_reg_611x,4,4
	.comm	devpriv,4,4
	.comm	boardtype,4,4
	.comm	Misc_Command,4,4
	.comm	Joint_Reset_Register,4,4
	.comm	Interrupt_A_Enable_Register,4,4
	.comm	Interrupt_A_Ack_Register,4,4
	.comm	AI_Start_Stop,4,4
	.comm	AI_STOP_Interrupt_Enable,4,4
	.comm	AI_STOP_Interrupt_Ack,4,4
	.comm	AI_START_Interrupt_Enable,4,4
	.comm	AI_START_Interrupt_Ack,4,4
	.comm	AI_START2_Interrupt_Enable,4,4
	.comm	AI_START2_Interrupt_Ack,4,4
	.comm	AI_START1_Interrupt_Enable,4,4
	.comm	AI_START1_Interrupt_Ack,4,4
	.comm	AI_SOC_Polarity,4,4
	.comm	AI_SHIFTIN_Pulse_Width,4,4
	.comm	AI_SC_TC_Interrupt_Enable,4,4
	.comm	AI_SC_TC_Interrupt_Ack,4,4
	.comm	AI_SC_TC_Error_Confirm,4,4
	.comm	AI_Reset,4,4
	.comm	AI_Personal_Register,4,4
	.comm	AI_Output_Control_Register,4,4
	.comm	AI_Mode_3_Register,4,4
	.comm	AI_Mode_2_Register,4,4
	.comm	AI_Mode_1_Reserved,4,4
	.comm	AI_Mode_1_Register,4,4
	.comm	AI_LOCALMUX_CLK_Pulse_Width,4,4
	.comm	AI_FIFO_Interrupt_Enable,4,4
	.comm	AI_Error_Interrupt_Enable,4,4
	.comm	AI_Error_Interrupt_Ack,4,4
	.comm	AI_Disarm,4,4
	.comm	AI_Configuration_Start,4,4
	.comm	AI_Configuration_End,4,4
	.comm	AI_Command_1_Register,4,4
	.comm	AI_CONVERT_Pulse_Width,4,4
	.comm	AI_CONVERT_Output_Enable_Low,4,4
	.comm	AI_CONVERT_Output_Enable_High,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
