	.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_foldback_prepare
LCPI0_0:
	.long	3                               ## 0x3
	.long	127                             ## 0x7f
	.long	127                             ## 0x7f
	.long	1                               ## 0x1
LCPI0_1:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_snd_trident_foldback_prepare:          ## @snd_trident_foldback_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, %r13
	callq	_snd_pcm_substream_chip
	movq	%rax, %r15
	movq	(%r13), %r14
	movq	16(%r14), %rbx
	movq	120(%rbx), %r12
	leaq	8(%rax), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irq
	movq	112(%rbx), %rax
	leaq	8(%r14), %rcx
	testq	%rax, %rax
	cmovneq	%rax, %rcx
	movl	(%rcx), %eax
	movl	%eax, 96(%rbx)
	movl	(%r14), %eax
	decl	%eax
	movl	%eax, (%rbx)
	movl	$4096, 4(%rbx)                  ## imm = 0x1000
	movl	4(%r14), %esi
	movl	$48000, %edi                    ## imm = 0xBB80
	callq	_snd_trident_spurious_threshold
	movl	%eax, 100(%rbx)
	movq	$0, 88(%rbx)
	movq	%r13, %rdi
	callq	_snd_trident_control_mode
	movl	%eax, 80(%rbx)
	movaps	LCPI0_0(%rip), %xmm0            ## xmm0 = [3,127,127,1]
	movups	%xmm0, 8(%rbx)
	movabsq	$4393751543935, %rax            ## imm = 0x3FF0000007F
	movq	%rax, 24(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 48(%rbx)
	movups	%xmm0, 64(%rbx)
	movl	32(%rbx), %r13d
	andl	$63, %r13d
	orl	$128, %r13d
	movq	_T4D_RCI@GOTPCREL(%rip), %rax
	movq	104(%rbx), %rsi
	addq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_TRID_REG
	movl	%r13d, %edi
	movl	%eax, %esi
	callq	_outb
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_snd_trident_write_voice_regs
	testq	%r12, %r12
	je	LBB0_2
## %bb.1:
	movl	4(%rbx), %eax
	movl	%eax, 4(%r12)
	movl	100(%rbx), %eax
	movl	%eax, 100(%r12)
	movl	96(%rbx), %eax
	movl	%eax, 96(%r12)
	movq	$0, 88(%r12)
	movl	4(%r14), %eax
	leal	3(%rax,%rax), %eax
	movl	%eax, (%r12)
	movl	80(%rbx), %eax
	movl	%eax, 80(%r12)
	movl	$3, 8(%r12)
	movq	(%r15), %rax
	movq	_TRIDENT_DEVICE_ID_SI7018@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	setne	%dl
	movl	%edx, 20(%r12)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 56(%r12)
	movq	$0, 72(%r12)
	movabsq	$545460846719, %rax             ## imm = 0x7F0000007F
	movq	%rax, 12(%r12)
	movabsq	$4393751543935, %rax            ## imm = 0x3FF0000007F
	movq	%rax, 24(%r12)
	movq	$0, 48(%r12)
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_snd_trident_write_voice_regs
	movl	$1, 36(%r12)
	movl	4(%r14), %eax
	movl	%eax, 40(%r12)
	addl	%eax, %eax
	decl	%eax
	movl	%eax, (%r12)
LBB0_2:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irq
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_T4D_RCI,8,3                    ## @T4D_RCI
	.comm	_TRIDENT_DEVICE_ID_SI7018,8,3   ## @TRIDENT_DEVICE_ID_SI7018
	.no_dead_strip	_snd_trident_foldback_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_foldback_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
lCPI0_2:
	.long	3                               ; 0x3
	.long	127                             ; 0x7f
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_snd_trident_foldback_prepare:          ; @snd_trident_foldback_prepare
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [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 b8, -72
	.cfi_offset b9, -80
	mov	x23, x0
	bl	_snd_pcm_substream_chip
	mov	x21, x0
	ldr	x24, [x23]
	ldr	x22, [x24, #16]
	ldr	x20, [x22, #120]
	add	x19, x0, #8
	mov	x0, x19
	bl	_spin_lock_irq
	ldr	x8, [x22, #112]
	add	x9, x24, #8
	cmp	x8, #0
	csel	x8, x9, x8, eq
	ldr	w8, [x8]
	str	w8, [x22, #96]
	ldp	w8, w1, [x24]
	sub	w8, w8, #1
	mov	w9, #4096
	stp	w8, w9, [x22]
	mov	w0, #48000
	bl	_snd_trident_spurious_threshold
	str	w0, [x22, #100]
	str	xzr, [x22, #88]
	mov	x0, x23
	bl	_snd_trident_control_mode
	str	w0, [x22, #80]
Lloh0:
	adrp	x8, lCPI0_0@PAGE
Lloh1:
	ldr	q0, [x8, lCPI0_0@PAGEOFF]
	stur	q0, [x22, #8]
Lloh2:
	adrp	x8, lCPI0_1@PAGE
Lloh3:
	ldr	d8, [x8, lCPI0_1@PAGEOFF]
	str	d8, [x22, #24]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x22, #48]
	ldr	w8, [x22, #32]
	mov	w23, #128
	bfxil	w23, w8, #0, #6
Lloh4:
	adrp	x8, _T4D_RCI@GOTPAGE
Lloh5:
	ldr	x8, [x8, _T4D_RCI@GOTPAGEOFF]
Lloh6:
	ldr	x8, [x8]
	ldr	x9, [x22, #104]
	add	x1, x9, x8
	mov	x0, x21
	bl	_TRID_REG
	mov	x1, x0
	mov	x0, x23
	bl	_outb
	mov	x0, x21
	mov	x1, x22
	bl	_snd_trident_write_voice_regs
	cbz	x20, LBB0_2
; %bb.1:
	ldr	w8, [x22, #4]
	str	w8, [x20, #4]
	ldr	d0, [x22, #96]
	str	d0, [x20, #96]
	str	xzr, [x20, #88]
	ldr	w8, [x24, #4]
	lsl	w8, w8, #1
	add	w8, w8, #3
	str	w8, [x20]
	ldr	w8, [x22, #80]
	str	w8, [x20, #80]
	ldr	x8, [x21]
Lloh7:
	adrp	x9, _TRIDENT_DEVICE_ID_SI7018@GOTPAGE
Lloh8:
	ldr	x9, [x9, _TRIDENT_DEVICE_ID_SI7018@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w8, ne
	stp	xzr, xzr, [x20, #64]
	mov	w9, #127
	stp	w9, w8, [x20, #16]
Lloh10:
	adrp	x8, lCPI0_2@PAGE
Lloh11:
	ldr	d0, [x8, lCPI0_2@PAGEOFF]
	str	d0, [x20, #8]
	str	d8, [x20, #24]
	stp	xzr, xzr, [x20, #48]
	mov	x0, x21
	mov	x1, x20
	bl	_snd_trident_write_voice_regs
	mov	w8, #1
	ldr	w9, [x24, #4]
	stp	w8, w9, [x20, #36]
	lsl	w8, w9, #1
	sub	w8, w8, #1
	str	w8, [x20]
LBB0_2:
	mov	x0, x19
	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	d9, d8, [sp], #80               ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdr	Lloh2, Lloh3
	.loh AdrpAdrp	Lloh0, Lloh2
	.loh AdrpLdr	Lloh0, Lloh1
	.loh AdrpLdr	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_T4D_RCI,8,3                    ; @T4D_RCI
	.comm	_TRIDENT_DEVICE_ID_SI7018,8,3   ; @TRIDENT_DEVICE_ID_SI7018
	.no_dead_strip	_snd_trident_foldback_prepare
.subsections_via_symbols
