	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function midi_synth_input
_midi_synth_input:                      ## @midi_synth_input
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
                                        ## kill: def $esi killed $esi def $rsi
	testl	%edi, %edi
	js	LBB0_27
## %bb.1:
	movl	%edi, %eax
	movq	_num_midis@GOTPCREL(%rip), %rcx
	cmpl	%edi, (%rcx)
	jl	LBB0_27
## %bb.2:
	movq	_midi_devs@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movl	%eax, %ecx
	movq	(%rdx,%rcx,8), %rbx
	testq	%rbx, %rbx
	je	LBB0_27
## %bb.3:
	cmpb	$-2, %sil
	jne	LBB0_4
LBB0_27:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_4:
	movl	(%rbx), %edx
	cmpl	$128, %edx
	je	LBB0_24
## %bb.5:
	movq	_midi2synth@GOTPCREL(%rip), %rdi
	movq	(%rdi), %rdi
	movl	(%rdi,%rcx,4), %edi
	cmpl	$130, %edx
	je	LBB0_22
## %bb.6:
	movzbl	%sil, %ecx
	cmpl	$129, %edx
	jne	LBB0_26
## %bb.7:
	testb	$-128, %sil
	jne	LBB0_8
## %bb.17:
	cmpb	$0, 24(%rbx)
	jns	LBB0_27
## %bb.18:
	movl	$2, 4(%rbx)
	movq	16(%rbx), %rax
	movb	%sil, 1(%rax)
	movb	24(%rbx), %al
	movq	16(%rbx), %rcx
	movb	%al, (%rcx)
	movq	16(%rbx), %rsi
	movzbl	(%rsi), %eax
	shrq	$4, %rax
	leaq	_midi_synth_input.len_tab(%rip), %rcx
	movzbl	-8(%rax,%rcx), %ecx
	addq	$-8, %rax
	decl	%ecx
	movl	%ecx, 8(%rbx)
	movl	$79, %ecx
	btq	%rax, %rcx
	jb	LBB0_19
## %bb.20:
	movl	$129, (%rbx)
	jmp	LBB0_21
LBB0_24:
	cmpb	$-9, %sil
	jne	LBB0_27
## %bb.25:
	movq	$129, (%rbx)
	movl	$0, 8(%rbx)
	jmp	LBB0_27
LBB0_22:
	movq	16(%rbx), %rax
	movslq	4(%rbx), %rcx
	leal	1(%rcx), %edx
	movl	%edx, 4(%rbx)
	movb	%sil, (%rax,%rcx)
	movl	8(%rbx), %eax
	leal	-1(%rax), %ecx
	movl	%ecx, 8(%rbx)
	cmpl	$1, %eax
	jg	LBB0_27
## %bb.23:
	movl	$129, (%rbx)
	movq	16(%rbx), %rsi
LBB0_21:
	movl	4(%rbx), %edx
	callq	_do_midi_msg
	movl	$0, 4(%rbx)
	jmp	LBB0_27
LBB0_26:
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_printk
	movl	$129, (%rbx)
	jmp	LBB0_27
LBB0_8:
	movl	%ecx, %eax
	notl	%eax
	testb	$-16, %al
	jne	LBB0_16
## %bb.9:
	leal	16(%rsi), %eax
	cmpb	$3, %al
	ja	LBB0_15
## %bb.10:
	movzbl	%al, %eax
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_12:
	movabsq	$4294967426, %rax               ## imm = 0x100000082
	movq	%rax, (%rbx)
	movl	$1, 8(%rbx)
	jmp	LBB0_13
LBB0_16:
	movabsq	$4294967426, %rax               ## imm = 0x100000082
	movq	%rax, (%rbx)
	shrl	$4, %ecx
	addl	$-8, %ecx
	leaq	_midi_synth_input.len_tab(%rip), %rax
	movzbl	(%rcx,%rax), %eax
	movl	%eax, 8(%rbx)
	movb	%sil, 24(%rbx)
LBB0_13:
	movq	16(%rbx), %rax
	movb	%sil, (%rax)
	jmp	LBB0_27
LBB0_19:
	movl	$130, (%rbx)
	jmp	LBB0_27
LBB0_15:
	movq	16(%rbx), %rax
	movb	%sil, (%rax)
	movl	$1, 4(%rbx)
	movq	16(%rbx), %rsi
	movl	$1, %edx
	callq	_do_midi_msg
	movq	$0, 4(%rbx)
	jmp	LBB0_27
LBB0_11:
	movl	$128, (%rbx)
	jmp	LBB0_27
LBB0_14:
	movabsq	$4294967426, %rax               ## imm = 0x100000082
	movq	%rax, (%rbx)
	movl	$2, 8(%rbx)
	movq	16(%rbx), %rax
	movb	$-14, (%rax)
	jmp	LBB0_27
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_12, LBB0_12-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
LJTI0_0:
	.long	L0_0_set_11
	.long	L0_0_set_12
	.long	L0_0_set_14
	.long	L0_0_set_12
	.end_data_region
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
_midi_synth_input.len_tab:              ## @midi_synth_input.len_tab
	.asciz	"\002\002\002\002\001\001\002"

	.comm	_num_midis,4,2                  ## @num_midis
	.comm	_midi_devs,8,3                  ## @midi_devs
	.comm	_midi2synth,8,3                 ## @midi2synth
L_.str:                                 ## @.str
	.asciz	"MIDI%d: Unexpected state %d (%02x)\n"

	.no_dead_strip	_midi_synth_input
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function midi_synth_input
lCPI0_0:
	.long	129                             ; 0x81
	.long	0                               ; 0x0
lCPI0_1:
	.long	130                             ; 0x82
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_midi_synth_input:                      ; @midi_synth_input
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	tbnz	w0, #31, LBB0_24
; %bb.1:
	mov	x3, x1
	mov	x1, x0
Lloh0:
	adrp	x8, _num_midis@GOTPAGE
Lloh1:
	ldr	x8, [x8, _num_midis@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w0
	b.lt	LBB0_24
; %bb.2:
Lloh3:
	adrp	x8, _midi_devs@GOTPAGE
Lloh4:
	ldr	x8, [x8, _midi_devs@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	x19, [x8, w1, uxtw #3]
	cbz	x19, LBB0_24
; %bb.3:
	cmp	w3, #254
	b.eq	LBB0_24
; %bb.4:
	ldr	w2, [x19]
	cmp	w2, #128
	b.eq	LBB0_11
; %bb.5:
	mov	w8, w1
Lloh6:
	adrp	x9, _midi2synth@GOTPAGE
Lloh7:
	ldr	x9, [x9, _midi2synth@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	ldr	w0, [x9, x8, lsl #2]
	cmp	w2, #130
	b.eq	LBB0_13
; %bb.6:
	cmp	w2, #129
	b.ne	LBB0_16
; %bb.7:
	tbnz	w3, #7, LBB0_18
; %bb.8:
	ldrsb	w8, [x19, #24]
	tbz	w8, #31, LBB0_24
; %bb.9:
	mov	w8, #2
	str	w8, [x19, #4]
	ldr	x8, [x19, #16]
	strb	w3, [x8, #1]
	ldrb	w8, [x19, #24]
	ldr	x9, [x19, #16]
	strb	w8, [x9]
	ldr	x1, [x19, #16]
	ldrb	w8, [x1]
	lsr	x8, x8, #4
	sub	x8, x8, #8
Lloh9:
	adrp	x9, _midi_synth_input.len_tab@PAGE
Lloh10:
	add	x9, x9, _midi_synth_input.len_tab@PAGEOFF
	ldrb	w9, [x9, x8]
	sub	w9, w9, #1
	str	w9, [x19, #8]
	mov	w9, #79
	lsr	x8, x9, x8
	tbnz	w8, #0, LBB0_25
; %bb.10:
	mov	w8, #129
	str	w8, [x19]
	b	LBB0_15
LBB0_11:
	cmp	w3, #247
	b.ne	LBB0_24
; %bb.12:
	str	wzr, [x19, #8]
Lloh11:
	adrp	x8, lCPI0_0@PAGE
Lloh12:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x19]
	b	LBB0_24
LBB0_13:
	ldr	x8, [x19, #16]
	ldrsw	x9, [x19, #4]
	add	w10, w9, #1
	str	w10, [x19, #4]
	strb	w3, [x8, x9]
	ldr	w8, [x19, #8]
	subs	w8, w8, #1
	str	w8, [x19, #8]
	b.gt	LBB0_24
; %bb.14:
	mov	w8, #129
	str	w8, [x19]
	ldr	x1, [x19, #16]
LBB0_15:
	ldr	w2, [x19, #4]
	bl	_do_midi_msg
	str	wzr, [x19, #4]
	b	LBB0_24
LBB0_16:
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printk
	mov	w8, #129
LBB0_17:
	str	w8, [x19]
	b	LBB0_24
LBB0_18:
	mvn	w8, w3
	tst	w8, #0xf0
	b.ne	LBB0_22
; %bb.19:
	sub	w8, w3, #240
	cmp	w8, #3
	b.hi	LBB0_26
; %bb.20:
Lloh15:
	adrp	x9, lJTI0_0@PAGE
Lloh16:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_21
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_21:
Lloh17:
	adrp	x8, lCPI0_1@PAGE
Lloh18:
	ldr	d0, [x8, lCPI0_1@PAGEOFF]
	str	d0, [x19]
	mov	w8, #1
	str	w8, [x19, #8]
	b	LBB0_23
LBB0_22:
Lloh19:
	adrp	x8, lCPI0_1@PAGE
Lloh20:
	ldr	d0, [x8, lCPI0_1@PAGEOFF]
	str	d0, [x19]
	lsr	w8, w3, #4
	sub	w8, w8, #8
Lloh21:
	adrp	x9, _midi_synth_input.len_tab@PAGE
Lloh22:
	add	x9, x9, _midi_synth_input.len_tab@PAGEOFF
	ldrb	w8, [x9, w8, uxtw]
	str	w8, [x19, #8]
	strb	w3, [x19, #24]
LBB0_23:
	ldr	x8, [x19, #16]
	strb	w3, [x8]
LBB0_24:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_25:
	mov	w8, #130
	b	LBB0_17
LBB0_26:
	ldr	x8, [x19, #16]
	strb	w3, [x8]
	mov	w8, #1
	str	w8, [x19, #4]
	ldr	x1, [x19, #16]
	mov	w2, #1
	bl	_do_midi_msg
	stp	wzr, wzr, [x19, #4]
	b	LBB0_24
LBB0_27:
	mov	w8, #128
	b	LBB0_17
LBB0_28:
Lloh23:
	adrp	x8, lCPI0_1@PAGE
Lloh24:
	ldr	d0, [x8, lCPI0_1@PAGEOFF]
	str	d0, [x19]
	mov	w8, #2
	str	w8, [x19, #8]
	ldr	x8, [x19, #16]
	mov	w9, #242
	strb	w9, [x8]
	b	LBB0_24
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdr	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdr	Lloh17, Lloh18
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdr	Lloh19, Lloh20
	.loh AdrpLdr	Lloh23, Lloh24
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_27-LBB0_21)>>2
	.byte	(LBB0_21-LBB0_21)>>2
	.byte	(LBB0_28-LBB0_21)>>2
	.byte	(LBB0_21-LBB0_21)>>2
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
_midi_synth_input.len_tab:              ; @midi_synth_input.len_tab
	.asciz	"\002\002\002\002\001\001\002"

	.comm	_num_midis,4,2                  ; @num_midis
	.comm	_midi_devs,8,3                  ; @midi_devs
	.comm	_midi2synth,8,3                 ; @midi2synth
l_.str:                                 ; @.str
	.asciz	"MIDI%d: Unexpected state %d (%02x)\n"

	.no_dead_strip	_midi_synth_input
.subsections_via_symbols
