	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function close_substream
_close_substream:                       ## @close_substream
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	decq	48(%rsi)
	jne	LBB0_11
## %bb.1:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	testl	%edx, %edx
	je	LBB0_8
## %bb.2:
	movq	(%rbx), %rax
	movq	_SNDRV_RAWMIDI_STREAM_INPUT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_snd_rawmidi_input_trigger
	jmp	LBB0_8
LBB0_4:
	cmpq	$0, 40(%rbx)
	je	LBB0_6
## %bb.5:
	movb	$-2, -17(%rbp)
	leaq	-17(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_snd_rawmidi_kernel_write
LBB0_6:
	movq	%rbx, %rdi
	callq	_snd_rawmidi_drain_output
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	jne	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_snd_rawmidi_output_trigger
LBB0_8:
	movq	32(%rbx), %rax
	movq	%rbx, %rdi
	callq	*(%rax)
	movq	24(%rbx), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	%rbx, %rdi
	callq	*%rax
LBB0_10:
	movq	%rbx, %rdi
	callq	_snd_rawmidi_runtime_free
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%rbx)
	movq	(%r14), %rax
	movq	(%rbx), %rcx
	decl	(%rax,%rcx,4)
LBB0_11:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SNDRV_RAWMIDI_STREAM_INPUT,8,3 ## @SNDRV_RAWMIDI_STREAM_INPUT
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.no_dead_strip	_close_substream
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function close_substream
_close_substream:                       ; @close_substream
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	ldr	x8, [x1, #48]
	subs	x8, x8, #1
	str	x8, [x1, #48]
	b.ne	LBB0_11
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	cbz	w2, LBB0_8
; %bb.2:
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _SNDRV_RAWMIDI_STREAM_INPUT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SNDRV_RAWMIDI_STREAM_INPUT@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	mov	x0, x19
	mov	w1, #0
	bl	_snd_rawmidi_input_trigger
	b	LBB0_8
LBB0_4:
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_6
; %bb.5:
	mov	w8, #254
	strb	w8, [sp, #15]
	add	x1, sp, #15
	mov	x0, x19
	mov	w2, #1
	bl	_snd_rawmidi_kernel_write
LBB0_6:
	mov	x0, x19
	bl	_snd_rawmidi_drain_output
Lloh3:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_8
; %bb.7:
	mov	x0, x19
	mov	w1, #0
	bl	_snd_rawmidi_output_trigger
LBB0_8:
	ldr	x8, [x19, #32]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	cbz	x8, LBB0_10
; %bb.9:
	mov	x0, x19
	blr	x8
LBB0_10:
	mov	x0, x19
	bl	_snd_rawmidi_runtime_free
	stp	xzr, xzr, [x19, #8]
	ldr	x8, [x20]
	ldr	x9, [x19]
	lsl	x9, x9, #2
	ldr	w10, [x8, x9]
	sub	w10, w10, #1
	str	w10, [x8, x9]
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_SNDRV_RAWMIDI_STREAM_INPUT,8,3 ; @SNDRV_RAWMIDI_STREAM_INPUT
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.no_dead_strip	_close_substream
.subsections_via_symbols
