	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_emu10k1x_pcm_prepare
_snd_emu10k1x_pcm_prepare:              ## @snd_emu10k1x_pcm_prepare
	.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
	movq	%rdi, %rbx
	callq	_snd_pcm_substream_chip
	movq	%rax, %r15
	movq	(%rbx), %r13
	movq	16(%r13), %rax
	movq	(%rax), %rax
	movslq	(%rax), %r14
	movq	8(%r15), %rbx
	movq	%r14, %r12
	shlq	$10, %r12
	movl	8(%r13), %esi
	movq	%r13, %rdi
	callq	_frames_to_bytes
	cmpl	$0, (%r13)
	jle	LBB0_3
## %bb.1:
	addq	%r12, %rbx
	movl	%eax, %ecx
	shll	$16, %ecx
	xorl	%edx, %edx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%r13), %edi
	addl	%edx, %edi
	movl	%edi, (%rbx,%rsi,8)
	movl	%ecx, 4(%rbx,%rsi,8)
	incq	%rsi
	addl	%eax, %edx
	cmpl	(%r13), %esi
	jl	LBB0_2
LBB0_3:
	movq	_PLAYBACK_LIST_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %ecx
	addl	%r12d, %ecx
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_snd_emu10k1x_ptr_write
	movq	_PLAYBACK_LIST_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13), %ecx
	shll	$19, %ecx
	addl	$-524288, %ecx                  ## imm = 0xFFF80000
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_snd_emu10k1x_ptr_write
	movq	_PLAYBACK_LIST_PTR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	xorl	%ecx, %ecx
	callq	_snd_emu10k1x_ptr_write
	movq	_PLAYBACK_POINTER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	xorl	%ecx, %ecx
	callq	_snd_emu10k1x_ptr_write
	movq	_PLAYBACK_UNKNOWN1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	xorl	%ecx, %ecx
	callq	_snd_emu10k1x_ptr_write
	movq	_PLAYBACK_UNKNOWN2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	xorl	%ecx, %ecx
	callq	_snd_emu10k1x_ptr_write
	movq	_PLAYBACK_DMA_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r13), %ecx
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_snd_emu10k1x_ptr_write
	movq	_PLAYBACK_PERIOD_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	8(%r13), %esi
	movq	%r13, %rdi
	callq	_frames_to_bytes
	shll	$16, %eax
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%r14d, %edx
	movl	%eax, %ecx
	callq	_snd_emu10k1x_ptr_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	_PLAYBACK_LIST_ADDR,4,2         ## @PLAYBACK_LIST_ADDR
	.comm	_PLAYBACK_LIST_SIZE,4,2         ## @PLAYBACK_LIST_SIZE
	.comm	_PLAYBACK_LIST_PTR,4,2          ## @PLAYBACK_LIST_PTR
	.comm	_PLAYBACK_POINTER,4,2           ## @PLAYBACK_POINTER
	.comm	_PLAYBACK_UNKNOWN1,4,2          ## @PLAYBACK_UNKNOWN1
	.comm	_PLAYBACK_UNKNOWN2,4,2          ## @PLAYBACK_UNKNOWN2
	.comm	_PLAYBACK_DMA_ADDR,4,2          ## @PLAYBACK_DMA_ADDR
	.comm	_PLAYBACK_PERIOD_SIZE,4,2       ## @PLAYBACK_PERIOD_SIZE
	.no_dead_strip	_snd_emu10k1x_pcm_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_emu10k1x_pcm_prepare
_snd_emu10k1x_pcm_prepare:              ; @snd_emu10k1x_pcm_prepare
	.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	x20, x0
	bl	_snd_pcm_substream_chip
	mov	x19, x0
	ldr	x21, [x20]
	ldr	x8, [x21, #16]
	ldr	x8, [x8]
	ldrsw	x20, [x8]
	ldr	x23, [x0, #8]
	lsl	x22, x20, #10
	ldr	w1, [x21, #8]
	mov	x0, x21
	bl	_frames_to_bytes
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	w8, #0
	mov	w9, #0
	add	x10, x23, x22
	lsl	w11, w0, #16
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x21, #4]
	add	w12, w8, w12
	stp	w12, w11, [x10], #8
	add	w9, w9, #1
	ldr	w12, [x21]
	add	w8, w8, w0
	cmp	w9, w12
	b.lt	LBB0_2
LBB0_3:
Lloh0:
	adrp	x8, _PLAYBACK_LIST_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PLAYBACK_LIST_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	w8, [x19]
	add	w3, w8, w22
	mov	x0, x19
	mov	x2, x20
	bl	_snd_emu10k1x_ptr_write
Lloh3:
	adrp	x8, _PLAYBACK_LIST_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PLAYBACK_LIST_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	ldr	w8, [x21]
	lsl	w8, w8, #19
	sub	w3, w8, #128, lsl #12           ; =524288
	mov	x0, x19
	mov	x2, x20
	bl	_snd_emu10k1x_ptr_write
Lloh6:
	adrp	x8, _PLAYBACK_LIST_PTR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PLAYBACK_LIST_PTR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	mov	w3, #0
	bl	_snd_emu10k1x_ptr_write
Lloh9:
	adrp	x8, _PLAYBACK_POINTER@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PLAYBACK_POINTER@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	mov	w3, #0
	bl	_snd_emu10k1x_ptr_write
Lloh12:
	adrp	x8, _PLAYBACK_UNKNOWN1@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PLAYBACK_UNKNOWN1@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	mov	w3, #0
	bl	_snd_emu10k1x_ptr_write
Lloh15:
	adrp	x8, _PLAYBACK_UNKNOWN2@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PLAYBACK_UNKNOWN2@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	mov	w3, #0
	bl	_snd_emu10k1x_ptr_write
Lloh18:
	adrp	x8, _PLAYBACK_DMA_ADDR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PLAYBACK_DMA_ADDR@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	ldr	w3, [x21, #4]
	mov	x0, x19
	mov	x2, x20
	bl	_snd_emu10k1x_ptr_write
Lloh21:
	adrp	x8, _PLAYBACK_PERIOD_SIZE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _PLAYBACK_PERIOD_SIZE@GOTPAGEOFF]
Lloh23:
	ldr	w22, [x8]
	ldr	w1, [x21, #8]
	mov	x0, x21
	bl	_frames_to_bytes
	lsl	w3, w0, #16
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	bl	_snd_emu10k1x_ptr_write
	mov	w0, #0
	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
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PLAYBACK_LIST_ADDR,4,2         ; @PLAYBACK_LIST_ADDR
	.comm	_PLAYBACK_LIST_SIZE,4,2         ; @PLAYBACK_LIST_SIZE
	.comm	_PLAYBACK_LIST_PTR,4,2          ; @PLAYBACK_LIST_PTR
	.comm	_PLAYBACK_POINTER,4,2           ; @PLAYBACK_POINTER
	.comm	_PLAYBACK_UNKNOWN1,4,2          ; @PLAYBACK_UNKNOWN1
	.comm	_PLAYBACK_UNKNOWN2,4,2          ; @PLAYBACK_UNKNOWN2
	.comm	_PLAYBACK_DMA_ADDR,4,2          ; @PLAYBACK_DMA_ADDR
	.comm	_PLAYBACK_PERIOD_SIZE,4,2       ; @PLAYBACK_PERIOD_SIZE
	.no_dead_strip	_snd_emu10k1x_pcm_prepare
.subsections_via_symbols
