	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function voice_alloc
_voice_alloc:                           ## @voice_alloc
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	$0, (%rcx)
	movq	_YDSXG_PLAYBACK_VOICES@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	testl	%r9d, %r9d
	jle	LBB0_19
## %bb.1:
	movq	%rcx, %r15
	movl	%edx, %r12d
	movq	%rdi, %r14
	movq	(%rdi), %r8
	cmpl	$1, %edx
	movl	$2, %r10d
	sbbq	$0, %r10
	movq	%r10, %rax
	shlq	$4, %rax
	xorl	%edi, %edi
	movq	%r8, %rbx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_2 Depth=1
	addq	%r10, %rdi
	addq	%rax, %rbx
	cmpl	%edi, %r9d
	jle	LBB0_19
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	leaq	16(%rbx), %rcx
	testl	%r12d, %r12d
	movl	$0, %edx
	cmovneq	%rcx, %rdx
	cmpl	$0, (%rbx)
	jne	LBB0_18
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	testl	%r12d, %r12d
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, (%rdx)
	jne	LBB0_18
## %bb.6:
	movl	$1, (%rbx)
	movq	%rdx, %rax
	jmp	LBB0_7
LBB0_19:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_20
LBB0_4:
	movq	%rbx, %rax
LBB0_7:
	movl	$1, (%rax)
	movl	%edi, %eax
	cmpl	$128, %esi
	je	LBB0_12
## %bb.8:
	cmpl	$130, %esi
	je	LBB0_13
## %bb.9:
	cmpl	$129, %esi
	jne	LBB0_15
## %bb.10:
	shlq	$4, %rax
	movl	$1, 4(%r8,%rax)
	testl	%r12d, %r12d
	je	LBB0_16
## %bb.11:
	movl	$1, 4(%rdx)
	movq	%r14, %rdi
	callq	_snd_ymfpci_hw_start
	jmp	LBB0_16
LBB0_12:
	shlq	$4, %rax
	addq	%r8, %rax
	addq	$8, %rax
	jmp	LBB0_14
LBB0_13:
	shlq	$4, %rax
	addq	%r8, %rax
	addq	$12, %rax
LBB0_14:
	movl	$1, (%rax)
LBB0_15:
	movq	%r14, %rdi
	callq	_snd_ymfpci_hw_start
	testl	%r12d, %r12d
	je	LBB0_17
LBB0_16:
	movq	%r14, %rdi
	callq	_snd_ymfpci_hw_start
LBB0_17:
	movq	%rbx, (%r15)
	xorl	%eax, %eax
LBB0_20:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_YDSXG_PLAYBACK_VOICES,4,2      ## @YDSXG_PLAYBACK_VOICES
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_voice_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function voice_alloc
_voice_alloc:                           ; @voice_alloc
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	str	xzr, [x3]
Lloh0:
	adrp	x8, _YDSXG_PLAYBACK_VOICES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _YDSXG_PLAYBACK_VOICES@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x8]
	cmp	w10, #1
	b.lt	LBB0_7
; %bb.1:
	mov	x19, x3
	mov	x21, x2
	mov	x20, x0
	mov	x9, #0
	ldr	x8, [x0]
	cmp	w2, #0
	mov	w11, #1
	cinc	x12, x11, ne
	lsl	x13, x12, #4
	mov	x22, x8
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x22, x22, x13
	add	x9, x9, x12
	cmp	w10, w9
	b.le	LBB0_7
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w21, #0
	mov	x11, x22
	ldr	w14, [x11], #16
	csel	x11, xzr, x11, eq
	cbnz	w14, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	cbz	w21, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w14, [x11]
	cbnz	w14, LBB0_2
; %bb.6:
	mov	w10, #1
	str	w10, [x22]
	mov	x10, x11
	b	LBB0_9
LBB0_7:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_20
LBB0_8:
	mov	x10, x22
LBB0_9:
	mov	w12, #1
	str	w12, [x10]
	and	x9, x9, #0xffffffff
	cmp	w1, #128
	b.eq	LBB0_14
; %bb.10:
	cmp	w1, #130
	b.eq	LBB0_15
; %bb.11:
	cmp	w1, #129
	b.ne	LBB0_17
; %bb.12:
	add	x9, x8, x9, lsl #4
	mov	w8, #1
	str	w8, [x9, #4]
	cbz	w21, LBB0_18
; %bb.13:
	str	w8, [x11, #4]
	mov	x0, x20
	bl	_snd_ymfpci_hw_start
	b	LBB0_18
LBB0_14:
	add	x8, x8, x9, lsl #4
	add	x8, x8, #8
	b	LBB0_16
LBB0_15:
	add	x8, x8, x9, lsl #4
	add	x8, x8, #12
LBB0_16:
	mov	w9, #1
	str	w9, [x8]
LBB0_17:
	mov	x0, x20
	bl	_snd_ymfpci_hw_start
	cbz	w21, LBB0_19
LBB0_18:
	mov	x0, x20
	bl	_snd_ymfpci_hw_start
LBB0_19:
	mov	w0, #0
	str	x22, [x19]
LBB0_20:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_YDSXG_PLAYBACK_VOICES,4,2      ; @YDSXG_PLAYBACK_VOICES
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_voice_alloc
.subsections_via_symbols
