	.file	"extr_rtd520.c_rtd_interrupt.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	rtd_interrupt, @function
rtd_interrupt:
.LFB0:
	.cfi_startproc
	endbr64
	mov	eax, DWORD PTR 8[rsi]
	test	eax, eax
	jne	.L2
	mov	eax, DWORD PTR IRQ_NONE[rip]
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	rdi, QWORD PTR LAS0_ADC[rip]
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	add	rdi, QWORD PTR [rsi]
	mov	r12, QWORD PTR 24[rsi]
	mov	r13, QWORD PTR 16[rsi]
	call	readl@PLT
	mov	ebx, eax
	test	DWORD PTR FS_ADC_NOT_FULL[rip], eax
	je	.L4
	mov	rdi, QWORD PTR LAS0_IT[rip]
	add	rdi, QWORD PTR 0[rbp]
	call	readw@PLT
	mov	r14d, eax
	test	eax, eax
	je	.L22
	test	DWORD PTR IRQM_ADC_ABOUT_CNT[rip], eax
	je	.L6
	test	DWORD PTR FS_ADC_HEMPTY[rip], ebx
	je	.L28
	mov	edx, DWORD PTR 16[r13]
	test	edx, edx
	jle	.L6
	test	DWORD PTR FS_ADC_NOT_EMPTY[rip], ebx
	je	.L6
.L26:
	mov	rsi, r12
	mov	rdi, rbp
	call	ai_read_n@PLT
	test	rax, rax
	js	.L4
	cmp	QWORD PTR 8[r13], 0
	jne	.L6
	mov	rdx, QWORD PTR [r12]
	mov	eax, DWORD PTR [rdx]
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rdx, QWORD PTR [r12]
	mov	eax, DWORD PTR [rdx]
	or	eax, DWORD PTR COMEDI_CB_ERROR[rip]
	mov	DWORD PTR [rdx], eax
.L8:
	or	eax, DWORD PTR COMEDI_CB_EOA[rip]
	mov	rdi, QWORD PTR LAS0_IT[rip]
	mov	DWORD PTR [rdx], eax
	add	rdi, QWORD PTR 0[rbp]
	call	readw@PLT
	mov	rsi, QWORD PTR LAS0_CLEAR[rip]
	add	rsi, QWORD PTR 0[rbp]
	mov	edi, eax
	call	writew@PLT
	mov	rdi, QWORD PTR LAS0_CLEAR[rip]
	add	rdi, QWORD PTR 0[rbp]
	call	readw@PLT
	mov	rdi, QWORD PTR LAS0_ADC[rip]
	add	rdi, QWORD PTR 0[rbp]
	call	readl@PLT
	mov	rdi, QWORD PTR LAS0_OVERRUN[rip]
	add	rdi, QWORD PTR 0[rbp]
	call	readl@PLT
	mov	rsi, r12
	mov	rdi, rbp
	call	comedi_handle_events@PLT
.L22:
	mov	eax, DWORD PTR IRQ_HANDLED[rip]
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	mov	rdi, QWORD PTR LAS0_OVERRUN[rip]
	add	rdi, QWORD PTR 0[rbp]
	call	readl@PLT
	test	ax, ax
	jne	.L4
	mov	rsi, QWORD PTR LAS0_CLEAR[rip]
	mov	edi, r14d
	add	rsi, QWORD PTR 0[rbp]
	call	writew@PLT
	mov	rdi, QWORD PTR LAS0_CLEAR[rip]
	add	rdi, QWORD PTR 0[rbp]
	call	readw@PLT
	mov	rsi, r12
	mov	rdi, rbp
	call	comedi_handle_events@PLT
	mov	eax, DWORD PTR IRQ_HANDLED[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L28:
	mov	eax, DWORD PTR 0[r13]
	mov	edx, eax
	shr	edx, 31
	add	edx, eax
	sar	edx
	jmp	.L26
	.cfi_endproc
.LFE0:
	.size	rtd_interrupt, .-rtd_interrupt
	.comm	LAS0_OVERRUN,8,8
	.comm	LAS0_IT,8,8
	.comm	LAS0_CLEAR,8,8
	.comm	LAS0_ADC,8,8
	.comm	IRQ_NONE,4,4
	.comm	IRQ_HANDLED,4,4
	.comm	IRQM_ADC_ABOUT_CNT,4,4
	.comm	FS_ADC_NOT_FULL,4,4
	.comm	FS_ADC_NOT_EMPTY,4,4
	.comm	FS_ADC_HEMPTY,4,4
	.comm	COMEDI_CB_ERROR,4,4
	.comm	COMEDI_CB_EOA,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_rtd520.c_rtd_interrupt.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rtd_interrupt, %function
rtd_interrupt:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, [r1, #4]
	cmp	r3, #0
	bne	.L2
	ldr	r3, .L33
	ldr	r0, [r3]
	bx	lr
.L2:
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r6, .L33+4
	ldr	r0, [r1]
	ldr	r3, [r6]
	mov	r4, r1
	add	r0, r0, r3
	ldr	r7, [r1, #12]
	ldr	r8, [r1, #8]
	bl	readl
	ldr	r3, .L33+8
	mov	r5, r0
	ldr	r3, [r3]
	ldr	r9, .L33+12
	tst	r0, r3
	beq	.L26
	ldr	r0, [r4]
	ldr	r3, [r9]
	add	r0, r0, r3
	bl	readw
	subs	r10, r0, #0
	beq	.L28
	ldr	r3, .L33+16
	ldr	r3, [r3]
	tst	r10, r3
	beq	.L6
	ldr	r3, .L33+20
	ldr	r3, [r3]
	tst	r5, r3
	beq	.L32
	ldr	r2, [r8, #8]
	cmp	r2, #0
	ble	.L6
	ldr	r3, .L33+24
	ldr	r3, [r3]
	tst	r5, r3
	beq	.L6
	mov	r1, r7
	mov	r0, r4
	bl	ai_read_n
	cmp	r0, #0
	blt	.L26
.L21:
	ldr	r3, [r8, #4]
	cmp	r3, #0
	bne	.L6
	ldr	r1, [r7]
	ldr	r5, .L33+28
	ldr	r3, [r1]
	b	.L8
.L32:
	ldr	r2, [r8]
	mov	r1, r7
	add	r2, r2, r2, lsr #31
	mov	r0, r4
	asr	r2, r2, #1
	bl	ai_read_n
	cmp	r0, #0
	bge	.L21
.L26:
	ldr	r5, .L33+28
.L4:
	ldr	r1, [r7]
	ldr	r2, .L33+32
	ldr	r3, [r1]
	ldr	r2, [r2]
	orr	r3, r3, r2
	str	r3, [r1]
.L8:
	ldr	r2, .L33+36
	ldr	ip, [r4]
	ldr	r2, [r2]
	ldr	r0, [r9]
	orr	r3, r2, r3
	ldr	r8, .L33+40
	add	r0, ip, r0
	str	r3, [r1]
	bl	readw
	ldr	r3, [r8]
	ldr	r1, [r4]
	add	r1, r1, r3
	bl	writew
	ldr	r3, [r8]
	ldr	r0, [r4]
	add	r0, r0, r3
	bl	readw
	ldr	r3, [r6]
	ldr	r0, [r4]
	add	r0, r0, r3
	bl	readl
	ldr	r3, [r5]
	ldr	r0, [r4]
	add	r0, r0, r3
	bl	readl
.L29:
	mov	r1, r7
	mov	r0, r4
	bl	comedi_handle_events
.L28:
	ldr	r3, .L33+44
	ldr	r0, [r3]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L6:
	ldr	r5, .L33+28
	ldr	r0, [r4]
	ldr	r3, [r5]
	add	r0, r0, r3
	bl	readl
	lsl	r0, r0, #16
	lsr	r0, r0, #16
	cmp	r0, #0
	bne	.L4
	ldr	r5, .L33+40
	ldr	r1, [r4]
	ldr	r3, [r5]
	mov	r0, r10
	add	r1, r1, r3
	bl	writew
	ldr	r3, [r5]
	ldr	r0, [r4]
	add	r0, r0, r3
	bl	readw
	b	.L29
.L34:
	.align	2
.L33:
	.word	IRQ_NONE
	.word	LAS0_ADC
	.word	FS_ADC_NOT_FULL
	.word	LAS0_IT
	.word	IRQM_ADC_ABOUT_CNT
	.word	FS_ADC_HEMPTY
	.word	FS_ADC_NOT_EMPTY
	.word	LAS0_OVERRUN
	.word	COMEDI_CB_ERROR
	.word	COMEDI_CB_EOA
	.word	LAS0_CLEAR
	.word	IRQ_HANDLED
	.size	rtd_interrupt, .-rtd_interrupt
	.comm	LAS0_OVERRUN,4,4
	.comm	LAS0_IT,4,4
	.comm	LAS0_CLEAR,4,4
	.comm	LAS0_ADC,4,4
	.comm	IRQ_NONE,4,4
	.comm	IRQ_HANDLED,4,4
	.comm	IRQM_ADC_ABOUT_CNT,4,4
	.comm	FS_ADC_NOT_FULL,4,4
	.comm	FS_ADC_NOT_EMPTY,4,4
	.comm	FS_ADC_HEMPTY,4,4
	.comm	COMEDI_CB_ERROR,4,4
	.comm	COMEDI_CB_EOA,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
