	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_sb8dsp_midi_output_open
_snd_sb8dsp_midi_output_open:           ## @snd_sb8dsp_midi_output_open
	.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	%rdi, %r14
	movq	(%rdi), %rax
	movq	(%rax), %rbx
	movq	(%rbx), %rax
	movq	_SB_OPEN_MIDI_INPUT@GOTPCREL(%rip), %rdx
	movq	_SB_OPEN_MIDI_INPUT_TRIGGER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rdx), %ecx
	movq	_SB_HW_20@GOTPCREL(%rip), %rdx
	leaq	12(%rbx), %r15
	cmpq	(%rdx), %rax
	notl	%ecx
	movl	$-1, %r13d
	cmovgel	%ecx, %r13d
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movl	8(%rbx), %r12d
	testl	%r13d, %r12d
	je	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_5
LBB0_2:
	movq	_SB_HW_20@GOTPCREL(%rip), %r13
	movq	_SB_OPEN_MIDI_OUTPUT@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	movl	%r12d, 8(%rbx)
	movq	%r14, 16(%rbx)
	movq	_SB_OPEN_MIDI_INPUT@GOTPCREL(%rip), %rax
	andl	(%rax), %r12d
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%r14d, %r14d
	testl	%r12d, %r12d
	jne	LBB0_5
## %bb.3:
	movq	%rbx, %rdi
	callq	_snd_sbdsp_reset
	movq	(%rbx), %rax
	cmpq	(%r13), %rax
	jl	LBB0_5
## %bb.4:
	movq	_SB_DSP_MIDI_UART_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_snd_sbdsp_command
LBB0_5:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SB_HW_20,8,3                   ## @SB_HW_20
	.comm	_SB_OPEN_MIDI_INPUT,4,2         ## @SB_OPEN_MIDI_INPUT
	.comm	_SB_OPEN_MIDI_INPUT_TRIGGER,4,2 ## @SB_OPEN_MIDI_INPUT_TRIGGER
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_SB_OPEN_MIDI_OUTPUT,4,2        ## @SB_OPEN_MIDI_OUTPUT
	.comm	_SB_DSP_MIDI_UART_IRQ,4,2       ## @SB_DSP_MIDI_UART_IRQ
	.no_dead_strip	_snd_sb8dsp_midi_output_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_sb8dsp_midi_output_open
_snd_sb8dsp_midi_output_open:           ; @snd_sb8dsp_midi_output_open
	.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, x0
	ldr	x8, [x0]
	ldr	x19, [x8]
	ldr	x24, [x19]
Lloh0:
	adrp	x22, _SB_HW_20@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SB_HW_20@GOTPAGEOFF]
	ldr	x25, [x22]
Lloh2:
	adrp	x23, _SB_OPEN_MIDI_INPUT@GOTPAGE
Lloh3:
	ldr	x23, [x23, _SB_OPEN_MIDI_INPUT@GOTPAGEOFF]
	ldr	w8, [x23]
Lloh4:
	adrp	x9, _SB_OPEN_MIDI_INPUT_TRIGGER@GOTPAGE
Lloh5:
	ldr	x9, [x9, _SB_OPEN_MIDI_INPUT_TRIGGER@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	orr	w26, w9, w8
	add	x21, x19, #12
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	w8, [x19, #8]
	cmp	x24, x25
	mov	w9, #-1
	csinv	w9, w9, w26, lt
	tst	w8, w9
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x21
	bl	_spin_unlock_irqrestore
Lloh7:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_2:
Lloh10:
	adrp	x9, _SB_OPEN_MIDI_OUTPUT@GOTPAGE
Lloh11:
	ldr	x9, [x9, _SB_OPEN_MIDI_OUTPUT@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x19, #8]
	str	x20, [x19, #16]
	ldr	w9, [x23]
	and	w20, w9, w8
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	cbnz	w20, LBB0_5
; %bb.3:
	mov	x0, x19
	bl	_snd_sbdsp_reset
	ldr	x8, [x19]
	ldr	x9, [x22]
	cmp	x8, x9
	b.lt	LBB0_5
; %bb.4:
Lloh13:
	adrp	x8, _SB_DSP_MIDI_UART_IRQ@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SB_DSP_MIDI_UART_IRQ@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_snd_sbdsp_command
LBB0_5:
	mov	w0, #0
LBB0_6:
	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 AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_SB_HW_20,8,3                   ; @SB_HW_20
	.comm	_SB_OPEN_MIDI_INPUT,4,2         ; @SB_OPEN_MIDI_INPUT
	.comm	_SB_OPEN_MIDI_INPUT_TRIGGER,4,2 ; @SB_OPEN_MIDI_INPUT_TRIGGER
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_SB_OPEN_MIDI_OUTPUT,4,2        ; @SB_OPEN_MIDI_OUTPUT
	.comm	_SB_DSP_MIDI_UART_IRQ,4,2       ; @SB_DSP_MIDI_UART_IRQ
	.no_dead_strip	_snd_sb8dsp_midi_output_open
.subsections_via_symbols
