	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_fm801_interrupt
_snd_fm801_interrupt:                   ## @snd_fm801_interrupt
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movq	_IRQ_STATUS@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r13, %rdi
	callq	_FM801_REG
	movl	%eax, %edi
	callq	_inw
	movq	_FM801_IRQ_PLAYBACK@GOTPCREL(%rip), %r12
	movq	_FM801_IRQ_CAPTURE@GOTPCREL(%rip), %r15
	movzwl	(%r15), %ebx
	orw	(%r12), %bx
	movq	_FM801_IRQ_MPU@GOTPCREL(%rip), %rcx
	orw	(%rcx), %bx
	movq	_FM801_IRQ_VOLUME@GOTPCREL(%rip), %rcx
	orw	(%rcx), %bx
	andw	%ax, %bx
	je	LBB0_1
## %bb.2:
	movl	(%r14), %esi
	movq	%r13, %rdi
	callq	_FM801_REG
	movzwl	%bx, %edi
	movl	%eax, %esi
	callq	_outw
	cmpq	$0, 64(%r13)
	je	LBB0_15
## %bb.3:
	testw	%bx, (%r12)
	je	LBB0_9
## %bb.4:
	cmpq	$0, 72(%r13)
	je	LBB0_9
## %bb.5:
	leaq	48(%r13), %r14
	movq	%r14, %rdi
	callq	_spin_lock
	movl	(%r13), %esi
	movl	8(%r13), %ecx
	incl	%esi
	movl	%esi, (%r13)
	movl	4(%r13), %eax
	addl	%ecx, %eax
	movl	12(%r13), %edi
	xorl	%edx, %edx
	divl	%edi
	movl	%edx, 4(%r13)
	addl	%edx, %ecx
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%edi
	movl	%edx, %r12d
	addq	80(%r13), %r12
	testb	$1, %sil
	jne	LBB0_6
## %bb.7:
	movq	_PLY_BUF2@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_1:
	movq	_IRQ_NONE@GOTPCREL(%rip), %r14
	jmp	LBB0_18
LBB0_6:
	movq	_PLY_BUF1@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_FM801_REG
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_outl
	movq	%r14, %rdi
	callq	_spin_unlock
	movq	72(%r13), %rdi
	callq	_snd_pcm_period_elapsed
	cmpq	$0, 64(%r13)
	je	LBB0_15
LBB0_9:
	testw	%bx, (%r15)
	je	LBB0_15
## %bb.10:
	cmpq	$0, 40(%r13)
	je	LBB0_15
## %bb.11:
	leaq	48(%r13), %r15
	movq	%r15, %rdi
	callq	_spin_lock
	movl	16(%r13), %esi
	movl	24(%r13), %ecx
	incl	%esi
	movl	%esi, 16(%r13)
	movl	20(%r13), %eax
	addl	%ecx, %eax
	movl	28(%r13), %edi
	xorl	%edx, %edx
	divl	%edi
	movl	%edx, 20(%r13)
	addl	%edx, %ecx
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%edi
	movl	%edx, %r12d
	addq	56(%r13), %r12
	testb	$1, %sil
	jne	LBB0_12
## %bb.13:
	movq	_CAP_BUF2@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_12:
	movq	_CAP_BUF1@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_FM801_REG
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_outl
	movq	%r15, %rdi
	callq	_spin_unlock
	movq	40(%r13), %rdi
	callq	_snd_pcm_period_elapsed
LBB0_15:
	movq	32(%r13), %rax
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %r14
	testq	%rax, %rax
	movq	_FM801_IRQ_MPU@GOTPCREL(%rip), %rcx
	je	LBB0_18
## %bb.16:
	testw	%bx, (%rcx)
	je	LBB0_18
## %bb.17:
	movl	(%rax), %esi
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_snd_mpu401_uart_interrupt
LBB0_18:
	movl	(%r14), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IRQ_STATUS,4,2                 ## @IRQ_STATUS
	.comm	_FM801_IRQ_PLAYBACK,2,1         ## @FM801_IRQ_PLAYBACK
	.comm	_FM801_IRQ_CAPTURE,2,1          ## @FM801_IRQ_CAPTURE
	.comm	_FM801_IRQ_MPU,2,1              ## @FM801_IRQ_MPU
	.comm	_FM801_IRQ_VOLUME,2,1           ## @FM801_IRQ_VOLUME
	.comm	_IRQ_NONE,4,2                   ## @IRQ_NONE
	.comm	_PLY_BUF1,4,2                   ## @PLY_BUF1
	.comm	_PLY_BUF2,4,2                   ## @PLY_BUF2
	.comm	_CAP_BUF1,4,2                   ## @CAP_BUF1
	.comm	_CAP_BUF2,4,2                   ## @CAP_BUF2
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_snd_fm801_interrupt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_fm801_interrupt
_snd_fm801_interrupt:                   ; @snd_fm801_interrupt
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x23, _IRQ_STATUS@GOTPAGE
Lloh1:
	ldr	x23, [x23, _IRQ_STATUS@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x20
	bl	_FM801_REG
	bl	_inw
Lloh2:
	adrp	x22, _FM801_IRQ_PLAYBACK@GOTPAGE
Lloh3:
	ldr	x22, [x22, _FM801_IRQ_PLAYBACK@GOTPAGEOFF]
Lloh4:
	adrp	x25, _FM801_IRQ_CAPTURE@GOTPAGE
Lloh5:
	ldr	x25, [x25, _FM801_IRQ_CAPTURE@GOTPAGEOFF]
	ldrh	w8, [x22]
	ldrh	w9, [x25]
	orr	w8, w9, w8
Lloh6:
	adrp	x24, _FM801_IRQ_MPU@GOTPAGE
Lloh7:
	ldr	x24, [x24, _FM801_IRQ_MPU@GOTPAGEOFF]
	ldrh	w9, [x24]
	orr	w8, w8, w9
Lloh8:
	adrp	x9, _FM801_IRQ_VOLUME@GOTPAGE
Lloh9:
	ldr	x9, [x9, _FM801_IRQ_VOLUME@GOTPAGEOFF]
	ldrh	w9, [x9]
	orr	w8, w8, w9
	ands	w21, w8, w0
	b.eq	LBB0_12
; %bb.1:
	ldr	w1, [x23]
	mov	x0, x20
	bl	_FM801_REG
	mov	x1, x0
	mov	x0, x21
	bl	_outw
	ldr	x8, [x20, #64]
	cbz	x8, LBB0_8
; %bb.2:
	ldrh	w8, [x22]
	tst	w8, w21
	b.eq	LBB0_5
; %bb.3:
	ldr	x8, [x20, #72]
	cbz	x8, LBB0_5
; %bb.4:
	add	x22, x20, #48
	mov	x0, x22
	bl	_spin_lock
	ldp	w8, w9, [x20]
	add	w8, w8, #1
	ldp	w10, w11, [x20, #8]
	add	w9, w9, w10
	udiv	w12, w9, w11
	msub	w9, w12, w11, w9
	stp	w8, w9, [x20]
	add	w9, w9, w10
	udiv	w10, w9, w11
	msub	w9, w10, w11, w9
	ldr	x10, [x20, #80]
Lloh10:
	adrp	x11, _PLY_BUF2@GOTPAGE
Lloh11:
	ldr	x11, [x11, _PLY_BUF2@GOTPAGEOFF]
	add	x23, x10, x9
Lloh12:
	adrp	x9, _PLY_BUF1@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PLY_BUF1@GOTPAGEOFF]
	tst	w8, #0x1
	csel	x8, x11, x9, eq
	ldr	w1, [x8]
	mov	x0, x20
	bl	_FM801_REG
	mov	x1, x0
	mov	x0, x23
	bl	_outl
	mov	x0, x22
	bl	_spin_unlock
	ldr	x0, [x20, #72]
	bl	_snd_pcm_period_elapsed
	ldr	x8, [x20, #64]
	cbz	x8, LBB0_8
LBB0_5:
	ldrh	w8, [x25]
	tst	w8, w21
	b.eq	LBB0_8
; %bb.6:
	ldr	x8, [x20, #40]
	cbz	x8, LBB0_8
; %bb.7:
	add	x22, x20, #48
	mov	x0, x22
	bl	_spin_lock
	ldp	w8, w9, [x20, #16]
	add	w8, w8, #1
	ldp	w10, w11, [x20, #24]
	add	w9, w9, w10
	udiv	w12, w9, w11
	msub	w9, w12, w11, w9
	stp	w8, w9, [x20, #16]
	add	w9, w9, w10
	udiv	w10, w9, w11
	msub	w9, w10, w11, w9
	ldr	x10, [x20, #56]
Lloh14:
	adrp	x11, _CAP_BUF2@GOTPAGE
Lloh15:
	ldr	x11, [x11, _CAP_BUF2@GOTPAGEOFF]
	add	x23, x10, x9
Lloh16:
	adrp	x9, _CAP_BUF1@GOTPAGE
Lloh17:
	ldr	x9, [x9, _CAP_BUF1@GOTPAGEOFF]
	tst	w8, #0x1
	csel	x8, x11, x9, eq
	ldr	w1, [x8]
	mov	x0, x20
	bl	_FM801_REG
	mov	x1, x0
	mov	x0, x23
	bl	_outl
	mov	x0, x22
	bl	_spin_unlock
	ldr	x0, [x20, #40]
	bl	_snd_pcm_period_elapsed
LBB0_8:
	ldr	x8, [x20, #32]
	cbz	x8, LBB0_11
; %bb.9:
	ldrh	w9, [x24]
	tst	w9, w21
	b.eq	LBB0_11
; %bb.10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_snd_mpu401_uart_interrupt
LBB0_11:
Lloh18:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh19:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:
Lloh20:
	adrp	x8, _IRQ_NONE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _IRQ_NONE@GOTPAGEOFF]
LBB0_13:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_IRQ_STATUS,4,2                 ; @IRQ_STATUS
	.comm	_FM801_IRQ_PLAYBACK,2,1         ; @FM801_IRQ_PLAYBACK
	.comm	_FM801_IRQ_CAPTURE,2,1          ; @FM801_IRQ_CAPTURE
	.comm	_FM801_IRQ_MPU,2,1              ; @FM801_IRQ_MPU
	.comm	_FM801_IRQ_VOLUME,2,1           ; @FM801_IRQ_VOLUME
	.comm	_IRQ_NONE,4,2                   ; @IRQ_NONE
	.comm	_PLY_BUF1,4,2                   ; @PLY_BUF1
	.comm	_PLY_BUF2,4,2                   ; @PLY_BUF2
	.comm	_CAP_BUF1,4,2                   ; @CAP_BUF1
	.comm	_CAP_BUF2,4,2                   ; @CAP_BUF2
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_snd_fm801_interrupt
.subsections_via_symbols
