	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_emu10k1_midi_output_close
_snd_emu10k1_midi_output_close:         ## @snd_emu10k1_midi_output_close
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	movq	(%rax), %r12
	movq	24(%r12), %r14
	xorl	%edi, %edi
	testq	%r14, %r14
	sete	%dil
	callq	_snd_BUG_ON
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ENXIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_3
LBB0_2:
	leaq	4(%r12), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movl	16(%r12), %esi
	movq	%r14, %rdi
	callq	_snd_emu10k1_intr_disable
	movq	_EMU10K1_MIDI_MODE_OUTPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	notl	%ebx
	andl	(%r12), %ebx
	movl	%ebx, (%r12)
	movq	$0, 8(%r12)
	movq	_EMU10K1_MIDI_MODE_INPUT@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
	testl	%ebx, %ebx
	je	LBB0_4
LBB0_3:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_MPU401_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%r12, %rsi
	xorl	%ecx, %ecx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_snd_emu10k1_midi_cmd           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_EMU10K1_MIDI_MODE_OUTPUT,4,2   ## @EMU10K1_MIDI_MODE_OUTPUT
	.comm	_EMU10K1_MIDI_MODE_INPUT,4,2    ## @EMU10K1_MIDI_MODE_INPUT
	.comm	_MPU401_RESET,4,2               ## @MPU401_RESET
	.no_dead_strip	_snd_emu10k1_midi_output_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_emu10k1_midi_output_close
_snd_emu10k1_midi_output_close:         ; @snd_emu10k1_midi_output_close
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x8, [x0]
	ldr	x19, [x8]
	ldr	x20, [x19, #24]
	cmp	x20, #0
	cset	w0, eq
	bl	_snd_BUG_ON
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ENXIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_4
LBB0_2:
	add	x21, x19, #4
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	w1, [x19, #16]
	mov	x0, x20
	bl	_snd_emu10k1_intr_disable
Lloh3:
	adrp	x8, _EMU10K1_MIDI_MODE_OUTPUT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EMU10K1_MIDI_MODE_OUTPUT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
	str	xzr, [x19, #8]
Lloh6:
	adrp	x9, _EMU10K1_MIDI_MODE_INPUT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _EMU10K1_MIDI_MODE_INPUT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	and	w22, w9, w8
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	cbz	w22, LBB0_5
; %bb.3:
	mov	w0, #0
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_5:
Lloh9:
	adrp	x8, _MPU401_RESET@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MPU401_RESET@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x19
	mov	w3, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_snd_emu10k1_midi_cmd
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_EMU10K1_MIDI_MODE_OUTPUT,4,2   ; @EMU10K1_MIDI_MODE_OUTPUT
	.comm	_EMU10K1_MIDI_MODE_INPUT,4,2    ; @EMU10K1_MIDI_MODE_INPUT
	.comm	_MPU401_RESET,4,2               ; @MPU401_RESET
	.no_dead_strip	_snd_emu10k1_midi_output_close
.subsections_via_symbols
