	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alsa_midi_read
_alsa_midi_read:                        ## @alsa_midi_read
	.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
	movq	%rsi, %r14
	movl	(%rdi), %edi
	leaq	-24(%rbp), %rsi
	callq	_snd_seq_event_input
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	-24(%rbp), %rdi
	movq	(%rdi), %rcx
	movq	_SND_SEQ_EVENT_NOTEOFF@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_6
## %bb.3:
	movl	$128, %ecx
	jmp	LBB0_4
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_28
LBB0_6:
	movq	_SND_SEQ_EVENT_NOTEON@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_8
## %bb.7:
	movl	$144, %ecx
	jmp	LBB0_4
LBB0_8:
	movq	_SND_SEQ_EVENT_KEYPRESS@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_10
## %bb.9:
	movl	$160, %ecx
LBB0_4:
	orl	36(%rdi), %ecx
	movq	(%r14), %rdx
	movl	%ecx, (%rdx)
	movl	40(%rdi), %ecx
	movl	%ecx, 4(%rdx)
	movl	44(%rdi), %ecx
LBB0_5:
	movl	%ecx, 8(%rdx)
	movl	$3, 8(%r14)
LBB0_26:
	movl	%eax, %ebx
LBB0_27:
	movq	$0, 16(%r14)
	callq	_snd_seq_free_event
	notl	%ebx
	shrl	$31, %ebx
LBB0_28:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_10:
	movq	_SND_SEQ_EVENT_CONTROLLER@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_12
## %bb.11:
	movl	$176, %ecx
	orl	24(%rdi), %ecx
	movq	(%r14), %rdx
	movl	%ecx, (%rdx)
	movl	28(%rdi), %ecx
	movl	%ecx, 4(%rdx)
	movl	32(%rdi), %ecx
	jmp	LBB0_5
LBB0_12:
	movq	_SND_SEQ_EVENT_PGMCHANGE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_15
## %bb.13:
	movl	$192, %ecx
	jmp	LBB0_14
LBB0_15:
	movq	_SND_SEQ_EVENT_CHANPRESS@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_17
## %bb.16:
	movl	$208, %ecx
LBB0_14:
	orl	24(%rdi), %ecx
	movq	(%r14), %rdx
	movl	%ecx, (%rdx)
	movl	32(%rdi), %ecx
	movl	%ecx, 4(%rdx)
	movl	$2, 8(%r14)
	jmp	LBB0_26
LBB0_17:
	movq	_SND_SEQ_EVENT_PITCHBEND@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_19
## %bb.18:
	movl	$224, %ecx
	orl	24(%rdi), %ecx
	movq	(%r14), %rdx
	movl	%ecx, (%rdx)
	movl	32(%rdi), %ecx
	andl	$127, %ecx
	movl	%ecx, 4(%rdx)
	movl	32(%rdi), %ecx
	sarl	$7, %ecx
	jmp	LBB0_5
LBB0_19:
	movq	_SND_SEQ_EVENT_SYSEX@GOTPCREL(%rip), %rdx
	movl	$-1, %ebx
	cmpq	(%rdx), %rcx
	jne	LBB0_27
## %bb.20:
	movl	8(%rdi), %ecx
	cmpl	8(%r14), %ecx
	jg	LBB0_26
## %bb.21:
	testl	%ecx, %ecx
	je	LBB0_22
## %bb.23:
	movq	16(%rdi), %rcx
	movq	(%r14), %rdx
	xorl	%esi, %esi
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%rsi,4), %ebx
	movl	%ebx, (%rdx,%rsi,4)
	incq	%rsi
	movslq	8(%rdi), %rbx
	cmpq	%rbx, %rsi
	jb	LBB0_24
	jmp	LBB0_25
LBB0_22:
	xorl	%ebx, %ebx
LBB0_25:
	movl	%ebx, 8(%r14)
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_SND_SEQ_EVENT_NOTEOFF,8,3      ## @SND_SEQ_EVENT_NOTEOFF
	.comm	_SND_SEQ_EVENT_NOTEON,8,3       ## @SND_SEQ_EVENT_NOTEON
	.comm	_SND_SEQ_EVENT_KEYPRESS,8,3     ## @SND_SEQ_EVENT_KEYPRESS
	.comm	_SND_SEQ_EVENT_CONTROLLER,8,3   ## @SND_SEQ_EVENT_CONTROLLER
	.comm	_SND_SEQ_EVENT_PGMCHANGE,8,3    ## @SND_SEQ_EVENT_PGMCHANGE
	.comm	_SND_SEQ_EVENT_CHANPRESS,8,3    ## @SND_SEQ_EVENT_CHANPRESS
	.comm	_SND_SEQ_EVENT_PITCHBEND,8,3    ## @SND_SEQ_EVENT_PITCHBEND
	.comm	_SND_SEQ_EVENT_SYSEX,8,3        ## @SND_SEQ_EVENT_SYSEX
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.no_dead_strip	_alsa_midi_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alsa_midi_read
_alsa_midi_read:                        ; @alsa_midi_read
	.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
	mov	x19, x1
	ldr	w0, [x0]
	add	x1, sp, #8
	bl	_snd_seq_event_input
	tbnz	w0, #31, LBB0_3
; %bb.1:
	mov	x20, x0
	ldr	x0, [sp, #8]
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _SND_SEQ_EVENT_NOTEOFF@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SND_SEQ_EVENT_NOTEOFF@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	ldr	w8, [x0, #36]
	orr	w8, w8, #0x80
	b	LBB0_9
LBB0_3:
	mov	w0, #0
	b	LBB0_13
LBB0_4:
Lloh3:
	adrp	x9, _SND_SEQ_EVENT_NOTEON@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SND_SEQ_EVENT_NOTEON@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	ldr	w8, [x0, #36]
	mov	w9, #144
	b	LBB0_8
LBB0_6:
Lloh6:
	adrp	x9, _SND_SEQ_EVENT_KEYPRESS@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SND_SEQ_EVENT_KEYPRESS@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_14
; %bb.7:
	ldr	w8, [x0, #36]
	mov	w9, #160
LBB0_8:
	orr	w8, w8, w9
LBB0_9:
	ldr	x9, [x19]
	str	w8, [x9]
	ldr	w8, [x0, #40]
	str	w8, [x9, #4]
	ldr	w8, [x0, #44]
LBB0_10:
	str	w8, [x9, #8]
	mov	w8, #3
LBB0_11:
	str	w8, [x19, #8]
LBB0_12:
	str	xzr, [x19, #16]
	bl	_snd_seq_free_event
	mvn	w8, w20
	lsr	w0, w8, #31
LBB0_13:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_14:
Lloh9:
	adrp	x9, _SND_SEQ_EVENT_CONTROLLER@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SND_SEQ_EVENT_CONTROLLER@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.15:
	ldr	w8, [x0, #24]
	mov	w9, #176
	orr	w8, w8, w9
	ldr	x9, [x19]
	str	w8, [x9]
	ldr	w8, [x0, #28]
	str	w8, [x9, #4]
	ldr	w8, [x0, #32]
	b	LBB0_10
LBB0_16:
Lloh12:
	adrp	x9, _SND_SEQ_EVENT_PGMCHANGE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _SND_SEQ_EVENT_PGMCHANGE@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_18
; %bb.17:
	ldr	w8, [x0, #24]
	orr	w8, w8, #0xc0
	b	LBB0_20
LBB0_18:
Lloh15:
	adrp	x9, _SND_SEQ_EVENT_CHANPRESS@GOTPAGE
Lloh16:
	ldr	x9, [x9, _SND_SEQ_EVENT_CHANPRESS@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_21
; %bb.19:
	ldr	w8, [x0, #24]
	mov	w9, #208
	orr	w8, w8, w9
LBB0_20:
	ldr	x9, [x19]
	str	w8, [x9]
	ldr	w8, [x0, #32]
	str	w8, [x9, #4]
	mov	w8, #2
	b	LBB0_11
LBB0_21:
Lloh18:
	adrp	x9, _SND_SEQ_EVENT_PITCHBEND@GOTPAGE
Lloh19:
	ldr	x9, [x9, _SND_SEQ_EVENT_PITCHBEND@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_23
; %bb.22:
	ldr	w8, [x0, #24]
	orr	w8, w8, #0xe0
	ldr	x9, [x19]
	str	w8, [x9]
	ldr	w8, [x0, #32]
	and	w8, w8, #0x7f
	str	w8, [x9, #4]
	ldr	w8, [x0, #32]
	asr	w8, w8, #7
	b	LBB0_10
LBB0_23:
Lloh21:
	adrp	x9, _SND_SEQ_EVENT_SYSEX@GOTPAGE
Lloh22:
	ldr	x9, [x9, _SND_SEQ_EVENT_SYSEX@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_28
; %bb.24:
	ldr	w8, [x0, #8]
	ldr	w9, [x19, #8]
	cmp	w8, w9
	b.gt	LBB0_12
; %bb.25:
	cbz	w8, LBB0_29
; %bb.26:
	mov	x8, #0
	ldr	x9, [x0, #16]
	ldr	x10, [x19]
LBB0_27:                                ; =>This Inner Loop Header: Depth=1
	lsl	x11, x8, #2
	ldr	w12, [x9, x11]
	str	w12, [x10, x11]
	add	x8, x8, #1
	ldrsw	x11, [x0, #8]
	cmp	x8, x11
	b.lo	LBB0_27
	b	LBB0_30
LBB0_28:
	mov	w20, #-1
	b	LBB0_12
LBB0_29:
	mov	w11, #0
LBB0_30:
	str	w11, [x19, #8]
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_SND_SEQ_EVENT_NOTEOFF,8,3      ; @SND_SEQ_EVENT_NOTEOFF
	.comm	_SND_SEQ_EVENT_NOTEON,8,3       ; @SND_SEQ_EVENT_NOTEON
	.comm	_SND_SEQ_EVENT_KEYPRESS,8,3     ; @SND_SEQ_EVENT_KEYPRESS
	.comm	_SND_SEQ_EVENT_CONTROLLER,8,3   ; @SND_SEQ_EVENT_CONTROLLER
	.comm	_SND_SEQ_EVENT_PGMCHANGE,8,3    ; @SND_SEQ_EVENT_PGMCHANGE
	.comm	_SND_SEQ_EVENT_CHANPRESS,8,3    ; @SND_SEQ_EVENT_CHANPRESS
	.comm	_SND_SEQ_EVENT_PITCHBEND,8,3    ; @SND_SEQ_EVENT_PITCHBEND
	.comm	_SND_SEQ_EVENT_SYSEX,8,3        ; @SND_SEQ_EVENT_SYSEX
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.no_dead_strip	_alsa_midi_read
.subsections_via_symbols
