	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function seq_chn_voice_event
_seq_chn_voice_event:                   ## @seq_chn_voice_event
	.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
	movzbl	1(%rdi), %ecx
	movq	_max_synthdev@GOTPCREL(%rip), %rax
	cmpl	%ecx, (%rax)
	jl	LBB0_33
## %bb.1:
	movq	%rdi, %rbx
	movq	_synth_devs@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movl	%ecx, %edi
	movq	(%rax,%rdi,8), %rax
	testq	%rax, %rax
	je	LBB0_33
## %bb.2:
	movq	_synth_open_mask@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	btl	%ecx, %edx
	jae	LBB0_33
## %bb.3:
	movq	_seq_mode@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	movq	_SEQ_2@GOTPCREL(%rip), %r13
	cmpq	(%r13), %rcx
	jne	LBB0_4
## %bb.21:
	cmpq	$0, 48(%rax)
	je	LBB0_22
## %bb.23:
	movzbl	3(%rbx), %esi
	movzbl	4(%rbx), %edx
	callq	_find_voice
	movl	%eax, %r14d
	jmp	LBB0_24
LBB0_4:
	movb	2(%rbx), %al
	movl	$-1, %r14d
	jmp	LBB0_5
LBB0_22:
	movl	$-1, %r14d
LBB0_24:
	movb	2(%rbx), %al
	cmpb	$-128, %al
	jne	LBB0_5
## %bb.25:
	cmpb	$0, 5(%rbx)
	jne	LBB0_8
## %bb.26:
	movb	$-127, 2(%rbx)
	movb	$64, 5(%rbx)
	jmp	LBB0_27
LBB0_5:
	cmpb	$-126, %al
	je	LBB0_30
## %bb.6:
	cmpb	$-127, %al
	je	LBB0_27
## %bb.7:
	cmpb	$-128, %al
	jne	LBB0_33
LBB0_8:
	movzbl	4(%rbx), %edx
	cmpb	$-1, %dl
	jl	LBB0_33
## %bb.9:
	cmpl	$-1, %r14d
	jne	LBB0_14
## %bb.10:
	movq	(%r12), %rax
	cmpq	(%r13), %rax
	jne	LBB0_13
## %bb.11:
	movq	(%r15), %rax
	movzbl	1(%rbx), %edi
	movq	(%rax,%rdi,8), %rax
	cmpq	$0, 48(%rax)
	je	LBB0_13
## %bb.12:
	movzbl	3(%rbx), %esi
	callq	_alloc_voice
	movl	%eax, %r14d
	cmpl	$-1, %eax
	jne	LBB0_14
LBB0_13:
	movzbl	3(%rbx), %r14d
LBB0_14:
	movq	(%r12), %rax
	cmpq	(%r13), %rax
	jne	LBB0_19
## %bb.15:
	movzbl	1(%rbx), %edi
	movq	_num_synths@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	jle	LBB0_19
## %bb.16:
	movb	3(%rbx), %cl
	movq	(%r15), %rax
	cmpb	$9, %cl
	jne	LBB0_18
## %bb.17:
	movq	(%rax,%rdi,8), %rax
	movzbl	4(%rbx), %edx
	subl	$-128, %edx
	movl	%r14d, %esi
	callq	*40(%rax)
	movzbl	4(%rbx), %ecx
	subl	$-128, %ecx
	movq	(%r15), %rax
	movzbl	1(%rbx), %edx
	movq	(%rax,%rdx,8), %rdx
	movq	32(%rdx), %rdx
	movzbl	3(%rbx), %esi
	movl	%ecx, (%rdx,%rsi,4)
	movb	1(%rbx), %dil
	movb	3(%rbx), %cl
LBB0_18:
	movzbl	%dil, %edi
	movq	(%rax,%rdi,8), %rax
	movzbl	%cl, %edx
	movl	%r14d, %esi
	callq	*24(%rax)
LBB0_19:
	movq	(%r15), %rax
	movzbl	1(%rbx), %edi
	movq	(%rax,%rdi,8), %rax
	movq	16(%rax), %rax
	jmp	LBB0_20
LBB0_33:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_27:
	cmpl	$-1, %r14d
	jne	LBB0_29
## %bb.28:
	movzbl	3(%rbx), %r14d
LBB0_29:
	movq	(%r15), %rax
	movzbl	1(%rbx), %edi
	movq	(%rax,%rdi,8), %rax
	movq	8(%rax), %rax
LBB0_20:
	movzbl	4(%rbx), %edx
	movzbl	5(%rbx), %ecx
	movl	%r14d, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
LBB0_30:
	cmpl	$-1, %r14d
	jne	LBB0_32
## %bb.31:
	movzbl	3(%rbx), %r14d
LBB0_32:
	movq	(%r15), %rax
	movzbl	1(%rbx), %edi
	movq	(%rax,%rdi,8), %rax
	movq	(%rax), %rax
	movzbl	5(%rbx), %edx
	movl	%r14d, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_max_synthdev,4,2               ## @max_synthdev
	.comm	_synth_devs,8,3                 ## @synth_devs
	.comm	_synth_open_mask,4,2            ## @synth_open_mask
	.comm	_seq_mode,8,3                   ## @seq_mode
	.comm	_SEQ_2,8,3                      ## @SEQ_2
	.comm	_num_synths,4,2                 ## @num_synths
	.comm	_chn,4,2                        ## @chn
	.comm	_cmd,4,2                        ## @cmd
	.comm	_dev,8,3                        ## @dev
	.comm	_note,4,2                       ## @note
	.comm	_parm,4,2                       ## @parm
	.no_dead_strip	_seq_chn_voice_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function seq_chn_voice_event
_seq_chn_voice_event:                   ; @seq_chn_voice_event
	.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
	ldrb	w0, [x0, #1]
Lloh0:
	adrp	x8, _max_synthdev@GOTPAGE
Lloh1:
	ldr	x8, [x8, _max_synthdev@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w0
	b.lt	LBB0_26
; %bb.1:
Lloh3:
	adrp	x21, _synth_devs@GOTPAGE
Lloh4:
	ldr	x21, [x21, _synth_devs@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	x8, [x8, w0, uxtw #3]
	cbz	x8, LBB0_26
; %bb.2:
Lloh5:
	adrp	x9, _synth_open_mask@GOTPAGE
Lloh6:
	ldr	x9, [x9, _synth_open_mask@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	lsr	w9, w9, w0
	tbz	w9, #0, LBB0_26
; %bb.3:
Lloh8:
	adrp	x22, _seq_mode@GOTPAGE
Lloh9:
	ldr	x22, [x22, _seq_mode@GOTPAGEOFF]
	ldr	x9, [x22]
Lloh10:
	adrp	x23, _SEQ_2@GOTPAGE
Lloh11:
	ldr	x23, [x23, _SEQ_2@GOTPAGEOFF]
	ldr	x10, [x23]
	cmp	x9, x10
	b.ne	LBB0_6
; %bb.4:
	ldr	x8, [x8, #48]
	cbz	x8, LBB0_7
; %bb.5:
	ldrb	w1, [x19, #3]
	ldrb	w2, [x19, #4]
	bl	_find_voice
	mov	x20, x0
	b	LBB0_8
LBB0_6:
	ldrb	w8, [x19, #2]
	mov	w20, #-1
	b	LBB0_11
LBB0_7:
	mov	w20, #-1
LBB0_8:
	ldrb	w8, [x19, #2]
	cmp	w8, #128
	b.ne	LBB0_11
; %bb.9:
	ldrb	w8, [x19, #5]
	cbnz	w8, LBB0_14
; %bb.10:
	mov	w8, #129
	strb	w8, [x19, #2]
	mov	w8, #64
	strb	w8, [x19, #5]
	b	LBB0_27
LBB0_11:
	cmp	w8, #130
	b.eq	LBB0_31
; %bb.12:
	cmp	w8, #129
	b.eq	LBB0_27
; %bb.13:
	cmp	w8, #128
	b.ne	LBB0_26
LBB0_14:
	ldrsb	w8, [x19, #4]
	cmn	w8, #1
	b.lt	LBB0_26
; %bb.15:
	cmn	w20, #1
	b.ne	LBB0_20
; %bb.16:
	ldr	x9, [x22]
	ldr	x10, [x23]
	cmp	x9, x10
	b.ne	LBB0_19
; %bb.17:
	ldr	x9, [x21]
	ldrb	w0, [x19, #1]
	ldr	x9, [x9, x0, lsl #3]
	ldr	x9, [x9, #48]
	cbz	x9, LBB0_19
; %bb.18:
	and	w2, w8, #0xff
	ldrb	w1, [x19, #3]
	bl	_alloc_voice
	mov	x20, x0
	cmn	w0, #1
	b.ne	LBB0_20
LBB0_19:
	ldrb	w20, [x19, #3]
LBB0_20:
	ldr	x8, [x22]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_25
; %bb.21:
	ldrb	w0, [x19, #1]
Lloh12:
	adrp	x8, _num_synths@GOTPAGE
Lloh13:
	ldr	x8, [x8, _num_synths@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w8, w0
	b.le	LBB0_25
; %bb.22:
	ldrb	w2, [x19, #3]
	ldr	x9, [x21]
	cmp	w2, #9
	b.ne	LBB0_24
; %bb.23:
	ldr	x8, [x9, x0, lsl #3]
	ldr	x8, [x8, #40]
	ldrb	w9, [x19, #4]
	add	w2, w9, #128
	mov	x1, x20
	blr	x8
	ldrb	w8, [x19, #4]
	add	w8, w8, #128
	ldr	x9, [x21]
	ldrb	w10, [x19, #1]
	ldr	x10, [x9, x10, lsl #3]
	ldr	x10, [x10, #32]
	ldrb	w11, [x19, #3]
	str	w8, [x10, x11, lsl #2]
	ldrb	w0, [x19, #1]
	ldrb	w2, [x19, #3]
LBB0_24:
	mov	w8, w0
	ldr	x9, [x9, w0, uxtw #3]
	ldr	x9, [x9, #24]
	mov	x0, x8
	mov	x1, x20
	blr	x9
LBB0_25:
	ldr	x8, [x21]
	ldrb	w0, [x19, #1]
	ldr	x8, [x8, x0, lsl #3]
	ldr	x4, [x8, #16]
	b	LBB0_30
LBB0_26:
	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
LBB0_27:
	cmn	w20, #1
	b.ne	LBB0_29
; %bb.28:
	ldrb	w20, [x19, #3]
LBB0_29:
	ldr	x8, [x21]
	ldrb	w0, [x19, #1]
	ldr	x8, [x8, x0, lsl #3]
	ldr	x4, [x8, #8]
LBB0_30:
	ldrb	w2, [x19, #4]
	ldrb	w3, [x19, #5]
	mov	x1, x20
	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
	br	x4
LBB0_31:
	cmn	w20, #1
	b.ne	LBB0_33
; %bb.32:
	ldrb	w20, [x19, #3]
LBB0_33:
	ldr	x8, [x21]
	ldrb	w0, [x19, #1]
	ldr	x8, [x8, x0, lsl #3]
	ldr	x3, [x8]
	ldrb	w2, [x19, #5]
	mov	x1, x20
	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
	br	x3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_max_synthdev,4,2               ; @max_synthdev
	.comm	_synth_devs,8,3                 ; @synth_devs
	.comm	_synth_open_mask,4,2            ; @synth_open_mask
	.comm	_seq_mode,8,3                   ; @seq_mode
	.comm	_SEQ_2,8,3                      ; @SEQ_2
	.comm	_num_synths,4,2                 ; @num_synths
	.comm	_chn,4,2                        ; @chn
	.comm	_cmd,4,2                        ; @cmd
	.comm	_dev,8,3                        ; @dev
	.comm	_note,4,2                       ; @note
	.comm	_parm,4,2                       ; @parm
	.no_dead_strip	_seq_chn_voice_event
.subsections_via_symbols
