	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_midi_input_callbacks           ## -- Begin function midi_input_callbacks
	.p2align	4, 0x90
_midi_input_callbacks:                  ## @midi_input_callbacks
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r15d
	movl	%ecx, %r12d
	movl	%edx, %r14d
	movl	%esi, %r8d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %rax
	movq	_SYSEX_MESSAGE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.1:
	movq	120(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_31
## %bb.2:
	leal	-1(%r8), %ecx
	movslq	%ecx, %rcx
	imulq	$1431655766, %rcx, %rcx         ## imm = 0x55555556
	movq	%rcx, %rdx
	shrq	$63, %rdx
	shrq	$32, %rcx
	addl	%edx, %ecx
	leal	(%rcx,%rcx,2), %esi
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	movl	%r8d, %edx
	subl	%esi, %edx
	movl	%r14d, -60(%rbp)
	movl	%r12d, -56(%rbp)
	movl	%r15d, -52(%rbp)
	leaq	-60(%rbp), %rcx
	movq	%rdi, %rbx
	callq	*%rax
	movq	%rbx, %rdi
	jmp	LBB0_34
LBB0_3:
	cmpl	$1, %r8d
	je	LBB0_23
## %bb.4:
	cmpl	$2, %r8d
	je	LBB0_10
## %bb.5:
	cmpl	$3, %r8d
	jne	LBB0_30
## %bb.6:
	movl	%r14d, %eax
	notl	%eax
	movl	$3, %r8d
	testb	$-16, %al
	jne	LBB0_31
## %bb.7:
	movq	_MIDI_SONGPOSITION@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_31
## %bb.8:
	movq	72(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_31
## %bb.9:
	movq	%rdi, %rbx
	movl	%r14d, %esi
	movl	%r12d, %edx
	movl	%r15d, %ecx
	callq	*%rax
	movq	%rbx, %rdi
	movl	$3, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_34
LBB0_23:
	movq	%rdi, %r13
	movl	%r14d, %edi
	callq	_midi_is_realtime
	testl	%eax, %eax
	je	LBB0_25
## %bb.24:
	movq	%r13, %rdi
	leaq	32(%r13), %rax
	jmp	LBB0_27
LBB0_10:
	movl	%r14d, %eax
	andb	$-16, %al
	movl	$2, %r8d
	cmpb	$-16, %al
	je	LBB0_13
## %bb.11:
	cmpb	$-128, %al
	jne	LBB0_31
## %bb.12:
	leaq	64(%rdi), %rax
	jmp	LBB0_17
LBB0_30:
	xorl	%eax, %eax
	cmpl	$4, %r8d
	cmovll	%r8d, %eax
	movl	%eax, %r8d
	jmp	LBB0_31
LBB0_25:
	movq	_MIDI_TUNEREQUEST@GOTPCREL(%rip), %rax
	movl	$1, %r8d
	cmpl	%r14d, (%rax)
	movq	%r13, %rdi
	jne	LBB0_31
## %bb.26:
	leaq	24(%rdi), %rax
LBB0_27:
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_28
## %bb.29:
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	*%rcx
	movq	%r13, %rdi
	movl	$1, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_34
LBB0_13:
	movq	_MIDI_SONGSELECT@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_15
## %bb.14:
	leaq	48(%rdi), %rax
	jmp	LBB0_17
LBB0_28:
	movl	$1, %r8d
	jmp	LBB0_31
LBB0_15:
	movq	_MIDI_TC_QUARTERFRAME@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_31
## %bb.16:
	leaq	40(%rdi), %rax
LBB0_17:
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_31
## %bb.18:
	movq	_MIDI_SONGSELECT@GOTPCREL(%rip), %rcx
	cmpl	%r14d, (%rcx)
	je	LBB0_20
## %bb.19:
	movq	_MIDI_TC_QUARTERFRAME@GOTPCREL(%rip), %rcx
	cmpl	%r14d, (%rcx)
	je	LBB0_20
## %bb.22:
	movl	%r14d, %esi
	andl	$15, %esi
	movq	%rdi, %rbx
	jmp	LBB0_21
LBB0_31:
	movl	%r14d, %r13d
	movq	16(%rdi), %rbx
	testq	%rbx, %rbx
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	je	LBB0_33
## %bb.32:
	movq	%rdi, %r14
	movl	%r8d, %esi
	movl	%r13d, %edx
	movl	%r12d, %ecx
	movl	%r15d, %r8d
	callq	*%rbx
	movq	%r14, %rdi
LBB0_33:
	movl	%r13d, %r14d
LBB0_34:
	movq	8(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_36
## %bb.35:
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movl	%r14d, %edx
	movl	%r12d, %ecx
	movl	%r15d, %r8d
	callq	*%rax
LBB0_36:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_38
## %bb.37:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movq	%rdi, %rbx
	movl	%r14d, %esi
LBB0_21:
	movl	%r12d, %edx
	callq	*%rax
	movq	%rbx, %rdi
	movl	$2, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_34
LBB0_38:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SYSEX_MESSAGE,8,3              ## @SYSEX_MESSAGE
	.comm	_MIDI_SONGPOSITION,4,2          ## @MIDI_SONGPOSITION
	.comm	_MIDI_SONGSELECT,4,2            ## @MIDI_SONGSELECT
	.comm	_MIDI_TC_QUARTERFRAME,4,2       ## @MIDI_TC_QUARTERFRAME
	.comm	_MIDI_TUNEREQUEST,4,2           ## @MIDI_TUNEREQUEST
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_midi_input_callbacks           ; -- Begin function midi_input_callbacks
	.p2align	2
_midi_input_callbacks:                  ; @midi_input_callbacks
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x4
	mov	x20, x3
	mov	x21, x2
	mov	x23, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	x8, [x0]
Lloh3:
	adrp	x9, _SYSEX_MESSAGE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SYSEX_MESSAGE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	ldr	x8, [x22, #120]
	cbz	x8, LBB0_30
; %bb.2:
	sub	w9, w23, #1
	mov	w10, #21846
	movk	w10, #21845, lsl #16
	smull	x9, w9, w10
	lsr	x10, x9, #63
	lsr	x9, x9, #32
	add	w9, w9, w10
	add	w1, w9, w9, lsl #1
	sub	w2, w23, w1
	stp	w21, w20, [sp, #12]
	str	w19, [sp, #20]
	add	x3, sp, #12
	mov	x0, x22
	blr	x8
	ldr	x8, [x22, #8]
	cbnz	x8, LBB0_33
	b	LBB0_34
LBB0_3:
	cmp	w23, #1
	b.eq	LBB0_10
; %bb.4:
	cmp	w23, #2
	b.eq	LBB0_12
; %bb.5:
	cmp	w23, #3
	b.ne	LBB0_15
; %bb.6:
	mvn	w8, w21
	tst	w8, #0xf0
	b.ne	LBB0_30
; %bb.7:
Lloh6:
	adrp	x8, _MIDI_SONGPOSITION@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MIDI_SONGPOSITION@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_30
; %bb.8:
	ldr	x8, [x22, #72]
	cbz	x8, LBB0_22
; %bb.9:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x3, x19
	blr	x8
	mov	w23, #3
	ldr	x8, [x22, #8]
	cbnz	x8, LBB0_33
	b	LBB0_34
LBB0_10:
	mov	x0, x21
	bl	_midi_is_realtime
	cbz	w0, LBB0_16
; %bb.11:
	add	x8, x22, #32
	ldr	x8, [x8]
	cbnz	x8, LBB0_18
	b	LBB0_19
LBB0_12:
	and	w8, w21, #0xf0
	cmp	w8, #240
	b.eq	LBB0_20
; %bb.13:
	cmp	w8, #128
	b.ne	LBB0_28
; %bb.14:
	add	x8, x22, #64
	b	LBB0_25
LBB0_15:
	csel	w23, wzr, w23, gt
	ldr	x8, [x22, #16]
	cbnz	x8, LBB0_31
	b	LBB0_32
LBB0_16:
Lloh9:
	adrp	x8, _MIDI_TUNEREQUEST@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MIDI_TUNEREQUEST@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_19
; %bb.17:
	add	x8, x22, #24
	ldr	x8, [x8]
	cbz	x8, LBB0_19
LBB0_18:
	mov	x0, x22
	mov	x1, x21
	blr	x8
	mov	w23, #1
	ldr	x8, [x22, #8]
	cbnz	x8, LBB0_33
	b	LBB0_34
LBB0_19:
	mov	w23, #1
	ldr	x8, [x22, #16]
	cbnz	x8, LBB0_31
	b	LBB0_32
LBB0_20:
Lloh12:
	adrp	x8, _MIDI_SONGSELECT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MIDI_SONGSELECT@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_23
; %bb.21:
	add	x8, x22, #48
	b	LBB0_25
LBB0_22:
	mov	w23, #3
	ldr	x8, [x22, #16]
	cbnz	x8, LBB0_31
	b	LBB0_32
LBB0_23:
Lloh15:
	adrp	x8, _MIDI_TC_QUARTERFRAME@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MIDI_TC_QUARTERFRAME@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_28
; %bb.24:
	add	x8, x22, #40
LBB0_25:
	ldr	x8, [x8]
	cbz	x8, LBB0_29
; %bb.26:
Lloh18:
	adrp	x9, _MIDI_SONGSELECT@GOTPAGE
Lloh19:
	ldr	x9, [x9, _MIDI_SONGSELECT@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
Lloh21:
	adrp	x10, _MIDI_TC_QUARTERFRAME@GOTPAGE
Lloh22:
	ldr	x10, [x10, _MIDI_TC_QUARTERFRAME@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	cmp	w9, w21
	ccmp	w10, w21, #4, ne
	b.ne	LBB0_36
; %bb.27:
	mov	x0, x22
	mov	x1, x21
	b	LBB0_37
LBB0_28:
	mov	w23, #2
	ldr	x8, [x22, #16]
	cbnz	x8, LBB0_31
	b	LBB0_32
LBB0_29:
	mov	w23, #2
LBB0_30:
	ldr	x8, [x22, #16]
	cbz	x8, LBB0_32
LBB0_31:
	mov	x0, x22
	mov	x1, x23
	mov	x2, x21
	mov	x3, x20
	mov	x4, x19
	blr	x8
LBB0_32:
	ldr	x8, [x22, #8]
	cbz	x8, LBB0_34
LBB0_33:
	mov	x0, x22
	mov	x1, x23
	mov	x2, x21
	mov	x3, x20
	mov	x4, x19
	blr	x8
LBB0_34:
	ldr	x8, [sp, #24]
Lloh24:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh25:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_38
; %bb.35:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_36:
	and	w1, w21, #0xf
	mov	x0, x22
LBB0_37:
	mov	x2, x20
	blr	x8
	mov	w23, #2
	ldr	x8, [x22, #8]
	cbnz	x8, LBB0_33
	b	LBB0_34
LBB0_38:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_SYSEX_MESSAGE,8,3              ; @SYSEX_MESSAGE
	.comm	_MIDI_SONGPOSITION,4,2          ; @MIDI_SONGPOSITION
	.comm	_MIDI_SONGSELECT,4,2            ; @MIDI_SONGSELECT
	.comm	_MIDI_TC_QUARTERFRAME,4,2       ; @MIDI_TC_QUARTERFRAME
	.comm	_MIDI_TUNEREQUEST,4,2           ; @MIDI_TUNEREQUEST
.subsections_via_symbols
