	.file	"extr_fm801.c_snd_fm801_interrupt.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	snd_fm801_interrupt, @function
snd_fm801_interrupt:
.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
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	ebp, edi
	mov	rdi, r12
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	esi, DWORD PTR IRQ_STATUS[rip]
	call	fm801_readw@PLT
	mov	r8d, eax
	movzx	eax, WORD PTR FM801_IRQ_PLAYBACK[rip]
	or	ax, WORD PTR FM801_IRQ_CAPTURE[rip]
	or	ax, WORD PTR FM801_IRQ_MPU[rip]
	or	ax, WORD PTR FM801_IRQ_VOLUME[rip]
	and	ax, r8w
	jne	.L2
	mov	eax, DWORD PTR IRQ_NONE[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L2:
	.cfi_restore_state
	mov	esi, DWORD PTR IRQ_STATUS[rip]
	movzx	edx, ax
	mov	rdi, r12
	mov	ebx, eax
	call	fm801_writew@PLT
	cmp	QWORD PTR 64[r12], 0
	je	.L5
	test	WORD PTR FM801_IRQ_PLAYBACK[rip], bx
	je	.L9
	cmp	QWORD PTR 72[r12], 0
	jne	.L23
.L9:
	test	WORD PTR FM801_IRQ_CAPTURE[rip], bx
	jne	.L7
.L5:
	mov	rax, QWORD PTR 32[r12]
	test	rax, rax
	je	.L14
	test	WORD PTR FM801_IRQ_MPU[rip], bx
	jne	.L24
.L14:
	mov	eax, DWORD PTR IRQ_HANDLED[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L7:
	.cfi_restore_state
	cmp	QWORD PTR 40[r12], 0
	je	.L5
	lea	r13, 48[r12]
	mov	rdi, r13
	call	spin_lock@PLT
	mov	eax, DWORD PTR 16[r12]
	mov	ecx, DWORD PTR 24[r12]
	xor	edx, edx
	mov	edi, DWORD PTR 28[r12]
	lea	esi, 1[rax]
	mov	eax, DWORD PTR 20[r12]
	mov	DWORD PTR 16[r12], esi
	add	eax, ecx
	div	edi
	lea	eax, [rcx+rdx]
	mov	DWORD PTR 20[r12], edx
	xor	edx, edx
	div	edi
	mov	edx, edx
	add	rdx, QWORD PTR 56[r12]
	and	esi, 1
	je	.L12
	mov	esi, DWORD PTR CAP_BUF1[rip]
	mov	rdi, r12
	call	fm801_writel@PLT
.L13:
	mov	rdi, r13
	call	spin_unlock@PLT
	mov	rdi, QWORD PTR 40[r12]
	call	snd_pcm_period_elapsed@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L24:
	mov	esi, DWORD PTR [rax]
	mov	edi, ebp
	call	snd_mpu401_uart_interrupt@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L23:
	lea	r13, 48[r12]
	mov	rdi, r13
	call	spin_lock@PLT
	mov	eax, DWORD PTR [r12]
	mov	ecx, DWORD PTR 8[r12]
	xor	edx, edx
	mov	edi, DWORD PTR 12[r12]
	lea	esi, 1[rax]
	mov	eax, DWORD PTR 4[r12]
	mov	DWORD PTR [r12], esi
	add	eax, ecx
	div	edi
	lea	eax, [rcx+rdx]
	mov	DWORD PTR 4[r12], edx
	xor	edx, edx
	div	edi
	mov	edx, edx
	add	rdx, QWORD PTR 80[r12]
	and	esi, 1
	je	.L10
	mov	esi, DWORD PTR PLY_BUF1[rip]
	mov	rdi, r12
	call	fm801_writel@PLT
.L11:
	mov	rdi, r13
	call	spin_unlock@PLT
	mov	rdi, QWORD PTR 72[r12]
	call	snd_pcm_period_elapsed@PLT
	cmp	QWORD PTR 64[r12], 0
	jne	.L9
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L10:
	mov	esi, DWORD PTR PLY_BUF2[rip]
	mov	rdi, r12
	call	fm801_writel@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	mov	esi, DWORD PTR CAP_BUF2[rip]
	mov	rdi, r12
	call	fm801_writel@PLT
	jmp	.L13
	.cfi_endproc
.LFE0:
	.size	snd_fm801_interrupt, .-snd_fm801_interrupt
	.comm	PLY_BUF2,4,4
	.comm	PLY_BUF1,4,4
	.comm	IRQ_STATUS,4,4
	.comm	IRQ_NONE,4,4
	.comm	IRQ_HANDLED,4,4
	.comm	FM801_IRQ_VOLUME,2,2
	.comm	FM801_IRQ_PLAYBACK,2,2
	.comm	FM801_IRQ_MPU,2,2
	.comm	FM801_IRQ_CAPTURE,2,2
	.comm	CAP_BUF2,4,4
	.comm	CAP_BUF1,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_fm801.c_snd_fm801_interrupt.c"
	.text
	.global	__aeabi_uidivmod
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	snd_fm801_interrupt, %function
snd_fm801_interrupt:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r10, .L31
	mov	r5, r1
	mov	r6, r0
	sub	sp, sp, #12
	mov	r0, r1
	ldr	r1, [r10]
	bl	fm801_readw
	ldr	r9, .L31+4
	ldr	r8, .L31+8
	ldr	r7, .L31+12
	ldrh	r1, [r8]
	ldrh	r3, [r9]
	ldr	r2, .L31+16
	orr	r3, r3, r1
	ldrh	r1, [r7]
	ldrh	r2, [r2]
	orr	r3, r3, r1
	orr	r3, r3, r2
	ands	r4, r0, r3
	bne	.L2
	ldr	r3, .L31+20
	ldr	r0, [r3]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	mov	r2, r4
	mov	r0, r5
	ldr	r1, [r10]
	bl	fm801_writew
	ldr	r3, [r5, #48]
	cmp	r3, #0
	beq	.L5
	ldrh	r3, [r9]
	tst	r4, r3
	beq	.L9
	ldr	r3, [r5, #52]
	cmp	r3, #0
	bne	.L29
.L9:
	ldrh	r3, [r8]
	tst	r4, r3
	bne	.L7
.L5:
	ldr	r3, [r5, #32]
	cmp	r3, #0
	beq	.L14
	ldrh	r2, [r7]
	tst	r4, r2
	bne	.L30
.L14:
	ldr	r3, .L31+24
	ldr	r0, [r3]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	ldr	r3, [r5, #36]
	cmp	r3, #0
	beq	.L5
	add	r9, r5, #40
	mov	r0, r9
	bl	spin_lock
	ldr	r8, [r5, #16]
	add	r0, r5, #20
	add	r8, r8, #1
	ldm	r0, {r0, r10, fp}
	str	r8, [r5, #16]
	mov	r1, fp
	add	r0, r10, r0
	bl	__aeabi_uidivmod
	mov	r0, r1
	mov	r1, fp
	str	r0, [r5, #20]
	add	r0, r10, r0
	bl	__aeabi_uidivmod
	tst	r8, #1
	ldrne	r3, .L31+28
	ldreq	r3, .L31+32
	ldr	r2, [r5, #44]
	mov	r0, r5
	add	r2, r1, r2
	ldr	r1, [r3]
	bl	fm801_writel
	mov	r0, r9
	bl	spin_unlock
	ldr	r0, [r5, #36]
	bl	snd_pcm_period_elapsed
	b	.L5
.L30:
	mov	r0, r6
	ldr	r1, [r3]
	bl	snd_mpu401_uart_interrupt
	b	.L14
.L29:
	add	r10, r5, #40
	mov	r0, r10
	bl	spin_lock
	ldmib	r5, {r0, fp}
	ldr	r9, [r5]
	ldr	r3, [r5, #12]
	add	r9, r9, #1
	mov	r1, r3
	str	r9, [r5]
	add	r0, fp, r0
	str	r3, [sp, #4]
	bl	__aeabi_uidivmod
	mov	r0, r1
	ldr	r3, [sp, #4]
	str	r0, [r5, #4]
	mov	r1, r3
	add	r0, fp, r0
	bl	__aeabi_uidivmod
	tst	r9, #1
	ldrne	r3, .L31+36
	ldreq	r3, .L31+40
	ldr	r2, [r5, #56]
	mov	r0, r5
	add	r2, r1, r2
	ldr	r1, [r3]
	bl	fm801_writel
	mov	r0, r10
	bl	spin_unlock
	ldr	r0, [r5, #52]
	bl	snd_pcm_period_elapsed
	ldr	r3, [r5, #48]
	cmp	r3, #0
	bne	.L9
	b	.L5
.L32:
	.align	2
.L31:
	.word	IRQ_STATUS
	.word	FM801_IRQ_PLAYBACK
	.word	FM801_IRQ_CAPTURE
	.word	FM801_IRQ_MPU
	.word	FM801_IRQ_VOLUME
	.word	IRQ_NONE
	.word	IRQ_HANDLED
	.word	CAP_BUF1
	.word	CAP_BUF2
	.word	PLY_BUF1
	.word	PLY_BUF2
	.size	snd_fm801_interrupt, .-snd_fm801_interrupt
	.comm	PLY_BUF2,4,4
	.comm	PLY_BUF1,4,4
	.comm	IRQ_STATUS,4,4
	.comm	IRQ_NONE,4,4
	.comm	IRQ_HANDLED,4,4
	.comm	FM801_IRQ_VOLUME,2,2
	.comm	FM801_IRQ_PLAYBACK,2,2
	.comm	FM801_IRQ_MPU,2,2
	.comm	FM801_IRQ_CAPTURE,2,2
	.comm	CAP_BUF2,4,4
	.comm	CAP_BUF1,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
