	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function snd_trident_capture_prepare
LCPI0_0:
	.long	3                               ## 0x3
	.long	127                             ## 0x7f
	.long	127                             ## 0x7f
	.long	1                               ## 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_snd_trident_capture_prepare:           ## @snd_trident_capture_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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_snd_pcm_substream_chip
	movq	%rax, %rbx
	movq	(%r14), %r15
	movq	24(%r15), %r13
	leaq	4(%rax), %rdi
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irq
	movq	_LEGACY_DMAR15@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_TRID_REG
	xorl	%edi, %edi
	movl	%eax, %esi
	callq	_outb
	movq	_LEGACY_DMAR11@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_TRID_REG
	movl	$84, %edi
	movl	%eax, %esi
	callq	_outb
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movl	(%r15), %r15d
	movl	%r15d, (%r13)
	movq	_LEGACY_DMAR0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_TRID_REG
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_outl
	movq	112(%r13), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	(%rax), %eax
	movl	%eax, (%r13)
LBB0_2:
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_snd_pcm_lib_buffer_bytes
	movl	%eax, %ebx
	leal	-1(%rbx), %r15d
	movl	%r15d, %eax
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	shrl	$16, %eax
	movzbl	%al, %r12d
	movq	_LEGACY_DMAR6@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_TRID_REG
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_outb
	movzwl	%r15w, %r12d
	movq	_LEGACY_DMAR4@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_TRID_REG
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_outw
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movl	4(%r15), %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	addl	$196608000, %eax                ## imm = 0xBB80000
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %r12d
	movq	_T4D_SBDELTA_DELTA_R@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_TRID_REG
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_outw
	movl	20(%r15), %edi
	callq	_snd_pcm_format_width
	shrl	%ebx
	decl	%ebx
	cmpl	$16, %eax
	cmovnel	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	movzwl	%bx, %eax
	movl	%eax, %ebx
	shll	$16, %ebx
	orl	%eax, %ebx
	movq	_T4D_SBBL_SBCL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_TRID_REG
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_outl
	movl	$25, (%r14)
	movl	20(%r15), %edi
	callq	_snd_pcm_format_width
	cmpl	$16, %eax
	jne	LBB0_4
## %bb.3:
	orb	$-128, (%r14)
LBB0_4:
	movl	20(%r15), %edi
	callq	_snd_pcm_format_signed
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	orb	$32, (%r14)
LBB0_6:
	cmpl	$2, 8(%r15)
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	jl	LBB0_8
## %bb.7:
	orb	$64, (%r14)
LBB0_8:
	movl	4(%r15), %edi
	callq	_snd_trident_convert_rate
	movl	%eax, 104(%r13)
	movl	4(%r15), %edi
	movl	12(%r15), %esi
	callq	_snd_trident_spurious_threshold
	movl	%eax, 100(%r13)
	movl	$1, 4(%r13)
	movl	12(%r15), %eax
	movl	%eax, 8(%r13)
	movl	16(%r15), %ecx
	movl	%ecx, 96(%r13)
	movq	$0, 88(%r13)
	leal	5(%rax,%rax), %eax
	movl	%eax, 16(%r13)
	movl	%eax, 12(%r13)
	movq	%rbx, %rdi
	callq	_snd_trident_control_mode
	movl	%eax, 80(%r13)
	movaps	LCPI0_0(%rip), %xmm0            ## xmm0 = [3,127,127,1]
	movups	%xmm0, 20(%r13)
	movabsq	$4393751543935, %rax            ## imm = 0x3FF0000007F
	movq	%rax, 36(%r13)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 48(%r13)
	movups	%xmm0, 64(%r13)
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_snd_trident_write_voice_regs
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irq
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LEGACY_DMAR15,4,2              ## @LEGACY_DMAR15
	.comm	_LEGACY_DMAR11,4,2              ## @LEGACY_DMAR11
	.comm	_LEGACY_DMAR0,4,2               ## @LEGACY_DMAR0
	.comm	_LEGACY_DMAR6,4,2               ## @LEGACY_DMAR6
	.comm	_LEGACY_DMAR4,4,2               ## @LEGACY_DMAR4
	.comm	_T4D_SBDELTA_DELTA_R,4,2        ## @T4D_SBDELTA_DELTA_R
	.comm	_T4D_SBBL_SBCL,4,2              ## @T4D_SBBL_SBCL
	.no_dead_strip	_snd_trident_capture_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function snd_trident_capture_prepare
lCPI0_0:
	.long	3                               ; 0x3
	.long	127                             ; 0x7f
	.long	127                             ; 0x7f
	.long	1                               ; 0x1
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3
lCPI0_1:
	.long	127                             ; 0x7f
	.long	1023                            ; 0x3ff
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_snd_trident_capture_prepare:           ; @snd_trident_capture_prepare
	.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	x22, x0
	bl	_snd_pcm_substream_chip
	mov	x19, x0
	ldr	x25, [x22]
	ldr	x21, [x25, #24]
	add	x20, x0, #4
	mov	x0, x20
	bl	_spin_lock_irq
Lloh0:
	adrp	x8, _LEGACY_DMAR15@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LEGACY_DMAR15@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_TRID_REG
	mov	x1, x0
	mov	w0, #0
	bl	_outb
Lloh3:
	adrp	x8, _LEGACY_DMAR11@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LEGACY_DMAR11@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_TRID_REG
	mov	x1, x0
	mov	w0, #84
	bl	_outb
	ldr	w23, [x25]
	str	w23, [x21]
Lloh6:
	adrp	x8, _LEGACY_DMAR0@GOTPAGE
Lloh7:
	ldr	x8, [x8, _LEGACY_DMAR0@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_TRID_REG
	mov	x1, x0
	mov	x0, x23
	bl	_outl
	ldr	x8, [x21, #112]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w8, [x8]
	str	w8, [x21]
LBB0_2:
	mov	x0, x22
	bl	_snd_pcm_lib_buffer_bytes
	mov	x23, x0
	sub	w26, w0, #1
	ubfx	w24, w26, #16, #8
Lloh9:
	adrp	x8, _LEGACY_DMAR6@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LEGACY_DMAR6@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_TRID_REG
	mov	x1, x0
	mov	x0, x24
	bl	_outb
	and	w24, w26, #0xffff
Lloh12:
	adrp	x8, _LEGACY_DMAR4@GOTPAGE
Lloh13:
	ldr	x8, [x8, _LEGACY_DMAR4@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_TRID_REG
	mov	x1, x0
	mov	x0, x24
	bl	_outw
	ldr	w8, [x25, #4]
	cmp	w8, #0
	cinc	w9, w8, lt
	mov	w10, #196608000
	add	w9, w10, w9, asr #1
Lloh15:
	adrp	x10, _T4D_SBDELTA_DELTA_R@GOTPAGE
Lloh16:
	ldr	x10, [x10, _T4D_SBDELTA_DELTA_R@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x10]
	udiv	w24, w9, w8
	mov	x0, x19
	bl	_TRID_REG
	mov	x1, x0
	mov	x0, x24
	bl	_outw
	ldr	w0, [x25, #20]
	bl	_snd_pcm_format_width
	lsr	w8, w23, #1
	sub	w8, w8, #1
	cmp	w0, #16
	csel	w23, w8, w26, eq
	and	w8, w23, #0xffff
	bfi	w23, w8, #16, #16
Lloh18:
	adrp	x8, _T4D_SBBL_SBCL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _T4D_SBBL_SBCL@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_TRID_REG
	mov	x1, x0
	mov	x0, x23
	bl	_outl
	mov	w8, #25
	str	w8, [x19]
	ldr	w0, [x25, #20]
	bl	_snd_pcm_format_width
	cmp	w0, #16
	b.ne	LBB0_4
; %bb.3:
	ldr	w8, [x19]
	orr	w8, w8, #0x80
	str	w8, [x19]
LBB0_4:
	ldr	w0, [x25, #20]
	bl	_snd_pcm_format_signed
	cbz	x0, LBB0_6
; %bb.5:
	ldr	w8, [x19]
	orr	w8, w8, #0x20
	str	w8, [x19]
LBB0_6:
	ldr	w8, [x25, #8]
	cmp	w8, #2
	b.lt	LBB0_8
; %bb.7:
	ldr	w8, [x19]
	orr	w8, w8, #0x40
	str	w8, [x19]
LBB0_8:
	ldr	w0, [x25, #4]
	bl	_snd_trident_convert_rate
	str	w0, [x21, #104]
	ldr	w0, [x25, #4]
	ldr	w1, [x25, #12]
	bl	_snd_trident_spurious_threshold
	mov	w8, #1
	ldp	w9, w10, [x25, #12]
	stp	w8, w9, [x21, #4]
	stp	w10, w0, [x21, #96]
	str	xzr, [x21, #88]
	lsl	w8, w9, #1
	add	w8, w8, #5
	stp	w8, w8, [x21, #12]
	mov	x0, x22
	bl	_snd_trident_control_mode
	str	w0, [x21, #80]
Lloh21:
	adrp	x8, lCPI0_0@PAGE
Lloh22:
	ldr	q0, [x8, lCPI0_0@PAGEOFF]
	stur	q0, [x21, #20]
Lloh23:
	adrp	x8, lCPI0_1@PAGE
Lloh24:
	ldr	d0, [x8, lCPI0_1@PAGEOFF]
	stur	d0, [x21, #36]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x21, #48]
	mov	x0, x19
	mov	x1, x21
	bl	_snd_trident_write_voice_regs
	mov	x0, x20
	bl	_spin_unlock_irq
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdr	Lloh23, Lloh24
	.loh AdrpAdrp	Lloh21, Lloh23
	.loh AdrpLdr	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_LEGACY_DMAR15,4,2              ; @LEGACY_DMAR15
	.comm	_LEGACY_DMAR11,4,2              ; @LEGACY_DMAR11
	.comm	_LEGACY_DMAR0,4,2               ; @LEGACY_DMAR0
	.comm	_LEGACY_DMAR6,4,2               ; @LEGACY_DMAR6
	.comm	_LEGACY_DMAR4,4,2               ; @LEGACY_DMAR4
	.comm	_T4D_SBDELTA_DELTA_R,4,2        ; @T4D_SBDELTA_DELTA_R
	.comm	_T4D_SBBL_SBCL,4,2              ; @T4D_SBBL_SBCL
	.no_dead_strip	_snd_trident_capture_prepare
.subsections_via_symbols
