	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function emu8k_open_dram_for_pcm
_emu8k_open_dram_for_pcm:               ## @emu8k_open_dram_for_pcm
	.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
	movl	%esi, %r14d
	movq	%rdi, %r15
	movl	(%rdi), %edi
	xorl	%esi, %esi
	callq	_snd_emux_lock_voice
	cmpl	$2, %r14d
	jl	LBB0_2
## %bb.1:
	movl	(%r15), %edi
	movl	$1, %esi
	callq	_snd_emux_lock_voice
LBB0_2:
	leal	1(%r14), %ebx
	movq	_EMU8000_DRAM_VOICES@GOTPCREL(%rip), %r12
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$2, %r14d
	cmovgel	%eax, %edx
	orl	%r13d, %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_snd_emu8000_dma_chan
	incl	%ebx
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	(%r12), %ebx
	jge	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_EMU8000_RAM_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	(%r15), %edi
	movl	%ebx, %esi
	callq	_snd_emux_lock_voice
	xorl	%edx, %edx
	movl	$0, %eax
	testb	$1, %bl
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_EMU8000_RAM_RIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_6
LBB0_7:
	movq	%r15, %rdi
	movl	$30, %esi
	xorl	%edx, %edx
	callq	_EMU8000_VTFT_WRITE
	movq	%r15, %rdi
	movl	$30, %esi
	movl	$472, %edx                      ## imm = 0x1D8
	callq	_EMU8000_PSST_WRITE
	movq	%r15, %rdi
	movl	$30, %esi
	movl	$480, %edx                      ## imm = 0x1E0
	callq	_EMU8000_CSL_WRITE
	movq	%r15, %rdi
	movl	$30, %esi
	movl	$472, %edx                      ## imm = 0x1D8
	callq	_EMU8000_CCCA_WRITE
	movq	%r15, %rdi
	movl	$31, %esi
	xorl	%edx, %edx
	callq	_EMU8000_VTFT_WRITE
	movq	%r15, %rdi
	movl	$31, %esi
	movl	$472, %edx                      ## imm = 0x1D8
	callq	_EMU8000_PSST_WRITE
	movq	%r15, %rdi
	movl	$31, %esi
	movl	$480, %edx                      ## imm = 0x1E0
	callq	_EMU8000_CSL_WRITE
	movq	%r15, %rdi
	movl	$31, %esi
	movl	$472, %edx                      ## imm = 0x1D8
	callq	_EMU8000_CCCA_WRITE
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EMU8000_DRAM_VOICES,4,2        ## @EMU8000_DRAM_VOICES
	.comm	_EMU8000_RAM_WRITE,4,2          ## @EMU8000_RAM_WRITE
	.comm	_EMU8000_RAM_RIGHT,4,2          ## @EMU8000_RAM_RIGHT
	.no_dead_strip	_emu8k_open_dram_for_pcm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function emu8k_open_dram_for_pcm
_emu8k_open_dram_for_pcm:               ; @emu8k_open_dram_for_pcm
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x1
	mov	x19, x0
	ldr	w0, [x0]
	mov	w1, #0
	bl	_snd_emux_lock_voice
	cmp	w20, #2
	b.lt	LBB0_2
; %bb.1:
	ldr	w0, [x19]
	mov	w1, #1
	bl	_snd_emux_lock_voice
LBB0_2:
	add	w21, w20, #1
Lloh0:
	adrp	x22, _EMU8000_DRAM_VOICES@GOTPAGE
Lloh1:
	ldr	x22, [x22, _EMU8000_DRAM_VOICES@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w21, w8
	b.ge	LBB0_5
; %bb.3:
Lloh2:
	adrp	x23, _EMU8000_RAM_WRITE@GOTPAGE
Lloh3:
	ldr	x23, [x23, _EMU8000_RAM_WRITE@GOTPAGEOFF]
Lloh4:
	adrp	x24, _EMU8000_RAM_RIGHT@GOTPAGE
Lloh5:
	ldr	x24, [x24, _EMU8000_RAM_RIGHT@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w20, #1
	cset	w25, gt
	ldr	w26, [x23]
	ldr	w0, [x19]
	mov	x1, x21
	bl	_snd_emux_lock_voice
	ldr	w8, [x24]
	tst	w25, w21
	csel	w8, w8, wzr, ne
	orr	w2, w8, w26
	mov	x0, x19
	mov	x1, x21
	bl	_snd_emu8000_dma_chan
	add	w21, w21, #1
	ldr	w8, [x22]
	cmp	w21, w8
	b.lt	LBB0_4
LBB0_5:
	mov	x0, x19
	mov	w1, #30
	mov	w2, #0
	bl	_EMU8000_VTFT_WRITE
	mov	x0, x19
	mov	w1, #30
	mov	w2, #472
	bl	_EMU8000_PSST_WRITE
	mov	x0, x19
	mov	w1, #30
	mov	w2, #480
	bl	_EMU8000_CSL_WRITE
	mov	x0, x19
	mov	w1, #30
	mov	w2, #472
	bl	_EMU8000_CCCA_WRITE
	mov	x0, x19
	mov	w1, #31
	mov	w2, #0
	bl	_EMU8000_VTFT_WRITE
	mov	x0, x19
	mov	w1, #31
	mov	w2, #472
	bl	_EMU8000_PSST_WRITE
	mov	x0, x19
	mov	w1, #31
	mov	w2, #480
	bl	_EMU8000_CSL_WRITE
	mov	x0, x19
	mov	w1, #31
	mov	w2, #472
	bl	_EMU8000_CCCA_WRITE
	mov	w0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_EMU8000_DRAM_VOICES,4,2        ; @EMU8000_DRAM_VOICES
	.comm	_EMU8000_RAM_WRITE,4,2          ; @EMU8000_RAM_WRITE
	.comm	_EMU8000_RAM_RIGHT,4,2          ; @EMU8000_RAM_RIGHT
	.no_dead_strip	_emu8k_open_dram_for_pcm
.subsections_via_symbols
