	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_MIDIbuf_release                ## -- Begin function MIDIbuf_release
	.p2align	4, 0x90
_MIDIbuf_release:                       ## @MIDIbuf_release
	.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
	movl	%edi, %ebx
	movq	%rsi, %rdi
	callq	_translate_mode
	testl	%ebx, %ebx
	js	LBB0_12
## %bb.1:
	sarl	$4, %ebx
	movq	_num_midis@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	jge	LBB0_12
## %bb.2:
	movq	_midi_devs@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	movslq	%ebx, %r15
	movq	(%rcx,%r15,8), %rcx
	testq	%rcx, %rcx
	je	LBB0_12
## %bb.3:
	movq	_OPEN_READ@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	je	LBB0_9
## %bb.4:
	movl	%ebx, %edi
	movl	$254, %esi
	callq	*16(%rcx)
	movq	_current@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_signal_pending
	testl	%eax, %eax
	jne	LBB0_8
## %bb.5:
	movq	_midi_out_buf@GOTPCREL(%rip), %r13
	leaq	(,%r15,4), %r14
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	movq	(%rax,%r15,8), %rdi
	callq	_DATA_AVAIL
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	_midi_sleeper@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	%r14, %rdi
	callq	_interruptible_sleep_on
	movl	(%r12), %edi
	callq	_signal_pending
	testl	%eax, %eax
	je	LBB0_6
LBB0_8:
	movl	%ebx, %edi
	callq	_drain_midi_queue
	movq	_midi_devs@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	(%rax,%r15,8), %rcx
LBB0_9:
	movl	%ebx, %edi
	callq	*8(%rcx)
	movq	_open_devs@GOTPCREL(%rip), %rax
	decq	(%rax)
	jne	LBB0_11
## %bb.10:
	movq	_poll_timer@GOTPCREL(%rip), %rdi
	callq	_del_timer_sync
LBB0_11:
	movq	_midi_in_buf@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	(%rax,%r15,8), %rdi
	callq	_vfree
	movq	_midi_out_buf@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	(%rax,%r15,8), %rdi
	callq	_vfree
	movq	(%r14), %rax
	movq	$0, (%rax,%r15,8)
	movq	(%rbx), %rax
	movq	$0, (%rax,%r15,8)
	movq	(%r12), %rax
	movq	(%rax,%r15,8), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_module_put                     ## TAILCALL
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_num_midis,4,2                  ## @num_midis
	.comm	_midi_devs,8,3                  ## @midi_devs
	.comm	_OPEN_READ,4,2                  ## @OPEN_READ
	.comm	_current,4,2                    ## @current
	.comm	_midi_out_buf,8,3               ## @midi_out_buf
	.comm	_midi_sleeper,8,3               ## @midi_sleeper
	.comm	_open_devs,8,3                  ## @open_devs
	.comm	_poll_timer,4,2                 ## @poll_timer
	.comm	_midi_in_buf,8,3                ## @midi_in_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_MIDIbuf_release                ; -- Begin function MIDIbuf_release
	.p2align	2
_MIDIbuf_release:                       ; @MIDIbuf_release
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	mov	x0, x1
	bl	_translate_mode
	tbnz	w19, #31, LBB0_12
; %bb.1:
	asr	w19, w19, #4
Lloh0:
	adrp	x8, _num_midis@GOTPAGE
Lloh1:
	ldr	x8, [x8, _num_midis@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w19, w8
	b.ge	LBB0_12
; %bb.2:
Lloh3:
	adrp	x20, _midi_devs@GOTPAGE
Lloh4:
	ldr	x20, [x20, _midi_devs@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	x8, [x8, w19, sxtw #3]
	cbz	x8, LBB0_12
; %bb.3:
	sxtw	x22, w19
Lloh5:
	adrp	x9, _OPEN_READ@GOTPAGE
Lloh6:
	ldr	x9, [x9, _OPEN_READ@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	adrp	x21, _midi_out_buf@GOTPAGE
Lloh9:
	ldr	x21, [x21, _midi_out_buf@GOTPAGEOFF]
	cmp	w0, w9
	b.eq	LBB0_9
; %bb.4:
	ldr	x8, [x8, #16]
	mov	x0, x19
	mov	w1, #254
	blr	x8
Lloh10:
	adrp	x23, _current@GOTPAGE
Lloh11:
	ldr	x23, [x23, _current@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_signal_pending
	cbnz	w0, LBB0_8
; %bb.5:
Lloh12:
	adrp	x24, _midi_sleeper@GOTPAGE
Lloh13:
	ldr	x24, [x24, _midi_sleeper@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	ldr	x0, [x8, x22, lsl #3]
	bl	_DATA_AVAIL
	cbz	x0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x24]
	add	x0, x8, x22, lsl #2
	bl	_interruptible_sleep_on
	ldr	w0, [x23]
	bl	_signal_pending
	cbz	w0, LBB0_6
LBB0_8:
	mov	x0, x19
	bl	_drain_midi_queue
	ldr	x8, [x20]
	ldr	x8, [x8, x22, lsl #3]
LBB0_9:
	ldr	x8, [x8, #8]
	mov	x0, x19
	blr	x8
Lloh14:
	adrp	x8, _open_devs@GOTPAGE
Lloh15:
	ldr	x8, [x8, _open_devs@GOTPAGEOFF]
	ldr	x9, [x8]
	subs	x9, x9, #1
	str	x9, [x8]
	b.ne	LBB0_11
; %bb.10:
Lloh16:
	adrp	x0, _poll_timer@GOTPAGE
Lloh17:
	ldr	x0, [x0, _poll_timer@GOTPAGEOFF]
	bl	_del_timer_sync
LBB0_11:
Lloh18:
	adrp	x19, _midi_in_buf@GOTPAGE
Lloh19:
	ldr	x19, [x19, _midi_in_buf@GOTPAGEOFF]
	ldr	x8, [x19]
	lsl	x22, x22, #3
	ldr	x0, [x8, x22]
	bl	_vfree
	ldr	x8, [x21]
	ldr	x0, [x8, x22]
	bl	_vfree
	ldr	x8, [x19]
	str	xzr, [x8, x22]
	ldr	x8, [x21]
	str	xzr, [x8, x22]
	ldr	x8, [x20]
	ldr	x8, [x8, x22]
	ldr	w0, [x8]
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_module_put
LBB0_12:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_num_midis,4,2                  ; @num_midis
	.comm	_midi_devs,8,3                  ; @midi_devs
	.comm	_OPEN_READ,4,2                  ; @OPEN_READ
	.comm	_current,4,2                    ; @current
	.comm	_midi_out_buf,8,3               ; @midi_out_buf
	.comm	_midi_sleeper,8,3               ; @midi_sleeper
	.comm	_open_devs,8,3                  ; @open_devs
	.comm	_poll_timer,4,2                 ; @poll_timer
	.comm	_midi_in_buf,8,3                ; @midi_in_buf
.subsections_via_symbols
