	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_emu10k1_midi_interrupt
_do_emu10k1_midi_interrupt:             ## @do_emu10k1_midi_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	cmpq	$0, 48(%rsi)
	je	LBB0_14
## %bb.1:
	movl	%edx, %r15d
	leaq	32(%rbx), %r12
	movq	%r12, %rdi
	callq	_spin_lock
	testl	%r15d, 8(%rbx)
	je	LBB0_7
## %bb.2:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_mpu401_input_avail
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	movq	_EMU10K1_MIDI_MODE_INPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 12(%rbx)
	je	LBB0_4
## %bb.5:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_mpu401_read_data
	movb	%al, -33(%rbp)
	movq	40(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.6:
	leaq	-33(%rbp), %rsi
	movl	$1, %edx
	callq	_snd_rawmidi_receive
	jmp	LBB0_7
LBB0_14:
	movl	4(%rbx), %esi
	orl	(%rbx), %esi
	movq	%r14, %rdi
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_snd_emu10k1_intr_disable       ## TAILCALL
LBB0_4:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_mpu401_clear_rx
LBB0_7:
	movq	%r12, %rdi
	callq	_spin_unlock
	leaq	20(%rbx), %r12
	movq	%r12, %rdi
	callq	_spin_lock
	testl	%r15d, 16(%rbx)
	je	LBB0_13
## %bb.8:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_mpu401_output_ready
	testq	%rax, %rax
	je	LBB0_13
## %bb.9:
	movq	24(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.10:
	leaq	-33(%rbp), %rsi
	movl	$1, %edx
	callq	_snd_rawmidi_transmit
	cmpl	$1, %eax
	jne	LBB0_12
## %bb.11:
	movzbl	-33(%rbp), %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_mpu401_write_data
	jmp	LBB0_13
LBB0_12:
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_snd_emu10k1_intr_disable
LBB0_13:
	movq	%r12, %rdi
	callq	_spin_unlock
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EMU10K1_MIDI_MODE_INPUT,4,2    ## @EMU10K1_MIDI_MODE_INPUT
	.no_dead_strip	_do_emu10k1_midi_interrupt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_emu10k1_midi_interrupt
_do_emu10k1_midi_interrupt:             ; @do_emu10k1_midi_interrupt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x1, #48]
	cbz	x8, LBB0_6
; %bb.1:
	mov	x21, x2
	add	x22, x20, #32
	mov	x0, x22
	bl	_spin_lock
	ldr	w8, [x20, #8]
	tst	w8, w21
	b.eq	LBB0_8
; %bb.2:
	mov	x0, x19
	mov	x1, x20
	bl	_mpu401_input_avail
	cbz	x0, LBB0_8
; %bb.3:
	ldr	w8, [x20, #12]
Lloh0:
	adrp	x9, _EMU10K1_MIDI_MODE_INPUT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _EMU10K1_MIDI_MODE_INPUT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	mov	x0, x19
	mov	x1, x20
	tst	w9, w8
	b.eq	LBB0_7
; %bb.4:
	bl	_mpu401_read_data
	strb	w0, [sp, #15]
	ldr	x0, [x20, #40]
	cbz	x0, LBB0_8
; %bb.5:
	add	x1, sp, #15
	mov	w2, #1
	bl	_snd_rawmidi_receive
	b	LBB0_8
LBB0_6:
	ldp	w8, w9, [x20]
	orr	w1, w9, w8
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_snd_emu10k1_intr_disable
LBB0_7:
	bl	_mpu401_clear_rx
LBB0_8:
	mov	x0, x22
	bl	_spin_unlock
	add	x22, x20, #20
	mov	x0, x22
	bl	_spin_lock
	ldr	w8, [x20, #16]
	tst	w8, w21
	b.eq	LBB0_14
; %bb.9:
	mov	x0, x19
	mov	x1, x20
	bl	_mpu401_output_ready
	cbz	x0, LBB0_14
; %bb.10:
	ldr	x0, [x20, #24]
	cbz	x0, LBB0_13
; %bb.11:
	add	x1, sp, #15
	mov	w2, #1
	bl	_snd_rawmidi_transmit
	cmp	w0, #1
	b.ne	LBB0_13
; %bb.12:
	ldrb	w2, [sp, #15]
	mov	x0, x19
	mov	x1, x20
	bl	_mpu401_write_data
	b	LBB0_14
LBB0_13:
	ldr	w1, [x20]
	mov	x0, x19
	bl	_snd_emu10k1_intr_disable
LBB0_14:
	mov	x0, x22
	bl	_spin_unlock
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EMU10K1_MIDI_MODE_INPUT,4,2    ; @EMU10K1_MIDI_MODE_INPUT
	.no_dead_strip	_do_emu10k1_midi_interrupt
.subsections_via_symbols
