	.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_spdif_prepare
LCPI0_0:
	.long	3                               ## 0x3
	.long	127                             ## 0x7f
	.long	127                             ## 0x7f
	.long	1                               ## 0x1
LCPI0_1:
	.long	127                             ## 0x7f
	.long	1023                            ## 0x3ff
	.long	0                               ## 0x0
	.long	0                               ## 0x0
LCPI0_2:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_snd_trident_spdif_prepare:             ## @snd_trident_spdif_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	$24, %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, %r13
	movq	(%r14), %r15
	movq	8(%r14), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	16(%rax), %rbx
	movq	120(%rbx), %r12
	movq	24(%r13), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	16(%r13), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irq
	movq	(%r13), %rax
	movq	_TRIDENT_DEVICE_ID_SI7018@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.4:
	movl	$2048, (%rbx)                   ## imm = 0x800
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %esi
	movl	$48000, %edi                    ## imm = 0xBB80
	callq	_snd_trident_spurious_threshold
	movq	%rax, 104(%rbx)
	movq	112(%rbx), %rax
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	leaq	8(%rdx), %rcx
	testq	%rax, %rax
	cmovneq	%rax, %rcx
	movl	(%rcx), %eax
	movl	%eax, 4(%rbx)
	movl	$0, 56(%rbx)
	movl	12(%rdx), %eax
	decl	%eax
	movl	%eax, 24(%rbx)
	movq	%r14, %rdi
	callq	_snd_trident_control_mode
	movq	%rax, 96(%rbx)
	movl	$3, 32(%rbx)
	movl	$1, 44(%rbx)
	shlq	$4, %r15
	xorps	%xmm0, %xmm0
	movups	%xmm0, 72(%rbx)
	movq	$0, 88(%rbx)
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx,%r15), %eax
	movl	%eax, 52(%rbx)
	movl	4(%rcx,%r15), %eax
	movl	%eax, 36(%rbx)
	movl	8(%rcx,%r15), %eax
	movl	%eax, 40(%rbx)
	movl	12(%rcx,%r15), %eax
	movl	%eax, 48(%rbx)
	movl	$23552, 60(%rbx)                ## imm = 0x5C00
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_snd_trident_write_voice_regs
	testq	%r12, %r12
	je	LBB0_6
## %bb.5:
	movl	(%rbx), %eax
	movl	%eax, (%r12)
	movl	4(%rbx), %eax
	movl	%eax, 4(%r12)
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movl	4(%r14), %eax
	leal	3(%rax,%rax), %eax
	movl	%eax, 24(%r12)
	movups	96(%rbx), %xmm0
	movups	%xmm0, 96(%r12)
	movl	$3, 32(%r12)
	movq	(%r13), %rax
	xorl	%ecx, %ecx
	movq	_TRIDENT_DEVICE_ID_SI7018@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	setne	%cl
	movl	%ecx, 44(%r12)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 72(%r12)
	movq	$0, 88(%r12)
	movabsq	$545460846719, %rax             ## imm = 0x7F0000007F
	movq	%rax, 36(%r12)
	movaps	LCPI0_1(%rip), %xmm0            ## xmm0 = [127,1023,0,0]
	movups	%xmm0, 48(%r12)
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_snd_trident_write_voice_regs
	movl	$1, 64(%r12)
	movl	4(%r14), %eax
	movl	%eax, 16(%r12)
	addl	%eax, %eax
	decl	%eax
	movl	%eax, 24(%r12)
LBB0_6:
	movl	12(%r13), %ebx
	movq	_SI_SPDIF_CS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r13, %rdi
	callq	_TRID_REG
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_outl
	movq	_T4D_LFO_GC_CIR@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	movq	%r13, %rdi
	callq	_TRID_REG
	movl	%eax, %edi
	callq	_inl
	movl	%eax, %ebx
	andl	$-524289, %ebx                  ## imm = 0xFFF7FFFF
	movq	(%r14), %rsi
	movq	%r13, %rdi
	callq	_TRID_REG
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_outl
	movq	_SI_SERIAL_INTF_CTRL@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	movq	%r13, %rdi
	callq	_TRID_REG
	movl	%eax, %edi
	callq	_inl
	movl	%eax, %ebx
	movq	_SPDIF_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	jmp	LBB0_7
LBB0_1:
	movq	%r14, %r15
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movl	(%r14), %edi
	callq	_snd_trident_convert_rate
	movl	%eax, (%rbx)
	movl	(%r14), %edi
	movl	4(%r14), %esi
	callq	_snd_trident_spurious_threshold
	movq	%rax, 104(%rbx)
	movl	8(%r14), %r12d
	movq	112(%rbx), %rcx
	movl	%r12d, %eax
	testq	%rcx, %rcx
	movq	%r14, %rdx
	je	LBB0_3
## %bb.2:
	movl	(%rcx), %eax
LBB0_3:
	movl	%eax, 4(%rbx)
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, 8(%rbx)
	movl	4(%rdx), %eax
	movl	%eax, 16(%rbx)
	movl	12(%rdx), %r14d
	movl	%r14d, 20(%rbx)
	decl	%r14d
	addl	%eax, %eax
	addl	$5, %eax
	movl	%eax, 28(%rbx)
	movl	%eax, 24(%rbx)
	movq	%r15, %rdi
	callq	_snd_trident_control_mode
	movq	%rax, 96(%rbx)
	movaps	LCPI0_0(%rip), %xmm0            ## xmm0 = [3,127,127,1]
	movups	%xmm0, 32(%rbx)
	movaps	LCPI0_1(%rip), %xmm0            ## xmm0 = [127,1023,0,0]
	movups	%xmm0, 48(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 72(%rbx)
	movq	$0, 88(%rbx)
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_snd_trident_write_voice_regs
	movzwl	%r14w, %r15d
	movq	_NX_SPESO@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r13, %rdi
	callq	_TRID_REG
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_outw
	shrl	$16, %r14d
	movq	_NX_SPESO@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	$2, %rsi
	movq	%r13, %rdi
	callq	_TRID_REG
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_outb
	andl	$-4, %r12d
	movq	_NX_SPLBA@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r13, %rdi
	callq	_TRID_REG
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_outl
	movzwl	56(%rbx), %r14d
	movq	_NX_SPCTRL_SPCSO@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	movq	%r13, %rdi
	callq	_TRID_REG
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_outw
	movswl	58(%rbx), %ebx
	movq	(%r15), %rsi
	addq	$2, %rsi
	movq	%r13, %rdi
	callq	_TRID_REG
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_outb
	movl	8(%r13), %ebx
	movq	(%r15), %rsi
	addq	$3, %rsi
	movq	%r13, %rdi
	callq	_TRID_REG
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_outb
	movl	12(%r13), %ebx
	movq	_NX_SPCSTATUS@GOTPCREL(%rip), %r14
LBB0_7:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	(%r14), %rsi
	movq	%r13, %rdi
	callq	_TRID_REG
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_outl
	movq	%r15, %rdi
	callq	_spin_unlock_irq
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TRIDENT_DEVICE_ID_SI7018,8,3   ## @TRIDENT_DEVICE_ID_SI7018
	.comm	_NX_SPESO,8,3                   ## @NX_SPESO
	.comm	_NX_SPLBA,8,3                   ## @NX_SPLBA
	.comm	_NX_SPCTRL_SPCSO,8,3            ## @NX_SPCTRL_SPCSO
	.comm	_NX_SPCSTATUS,8,3               ## @NX_SPCSTATUS
	.comm	_SI_SPDIF_CS,8,3                ## @SI_SPDIF_CS
	.comm	_T4D_LFO_GC_CIR,8,3             ## @T4D_LFO_GC_CIR
	.comm	_SI_SERIAL_INTF_CTRL,8,3        ## @SI_SERIAL_INTF_CTRL
	.comm	_SPDIF_EN,4,2                   ## @SPDIF_EN
	.no_dead_strip	_snd_trident_spdif_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_spdif_prepare
lCPI0_0:
	.long	3                               ; 0x3
	.long	127                             ; 0x7f
	.long	127                             ; 0x7f
	.long	1                               ; 0x1
lCPI0_1:
	.long	127                             ; 0x7f
	.long	1023                            ; 0x3ff
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3
lCPI0_2:
	.long	3                               ; 0x3
	.long	127                             ; 0x7f
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_snd_trident_spdif_prepare:             ; @snd_trident_spdif_prepare
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x0
	bl	_snd_pcm_substream_chip
	mov	x20, x0
	ldp	x26, x24, [x23]
	ldr	x21, [x24, #16]
	ldr	x22, [x21, #120]
	ldr	x27, [x0, #24]
	add	x19, x0, #16
	mov	x0, x19
	bl	_spin_lock_irq
	ldr	x8, [x20]
Lloh0:
	adrp	x25, _TRIDENT_DEVICE_ID_SI7018@GOTPAGE
Lloh1:
	ldr	x25, [x25, _TRIDENT_DEVICE_ID_SI7018@GOTPAGEOFF]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.1:
	mov	w8, #2048
	str	w8, [x21]
	ldr	w1, [x24, #4]
	mov	w0, #48000
	bl	_snd_trident_spurious_threshold
	str	x0, [x21, #104]
	ldr	x8, [x21, #112]
	add	x9, x24, #8
	cmp	x8, #0
	csel	x8, x9, x8, eq
	ldr	w8, [x8]
	str	w8, [x21, #4]
	str	wzr, [x21, #56]
	ldr	w8, [x24, #12]
	sub	w8, w8, #1
	str	w8, [x21, #24]
	mov	x0, x23
	bl	_snd_trident_control_mode
	mov	w8, #3
	str	w8, [x21, #32]
	add	x8, x27, x26, lsl #4
	mov	w23, #1
	str	w23, [x21, #44]
	stp	xzr, x0, [x21, #88]
	stp	xzr, xzr, [x21, #72]
	ldr	w9, [x8]
	str	w9, [x21, #52]
	ldur	d0, [x8, #4]
	stur	d0, [x21, #36]
	ldr	w8, [x8, #12]
	str	w8, [x21, #48]
	mov	w8, #23552
	str	w8, [x21, #60]
	mov	x0, x20
	mov	x1, x21
	bl	_snd_trident_write_voice_regs
	cbz	x22, LBB0_3
; %bb.2:
	ldp	x9, x8, [x21, #96]
	str	x8, [x22, #104]
	ldr	d0, [x21]
	str	d0, [x22]
	ldr	w8, [x24, #4]
	lsl	w8, w8, #1
	add	w8, w8, #3
	str	w8, [x22, #24]
	ldr	x8, [x20]
	ldr	x10, [x25]
	cmp	x8, x10
	cset	w8, ne
	stp	xzr, x9, [x22, #88]
	stp	xzr, xzr, [x22, #72]
	mov	w9, #127
	stp	w9, w8, [x22, #40]
Lloh2:
	adrp	x8, lCPI0_2@PAGE
Lloh3:
	ldr	d0, [x8, lCPI0_2@PAGEOFF]
	str	d0, [x22, #32]
Lloh4:
	adrp	x8, lCPI0_1@PAGE
Lloh5:
	ldr	q0, [x8, lCPI0_1@PAGEOFF]
	str	q0, [x22, #48]
	mov	x0, x20
	mov	x1, x22
	bl	_snd_trident_write_voice_regs
	str	w23, [x22, #64]
	ldr	w8, [x24, #4]
	str	w8, [x22, #16]
	lsl	w8, w8, #1
	sub	w8, w8, #1
	str	w8, [x22, #24]
LBB0_3:
	ldr	w21, [x20, #12]
Lloh6:
	adrp	x8, _SI_SPDIF_CS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SI_SPDIF_CS@GOTPAGEOFF]
Lloh8:
	ldr	x1, [x8]
	mov	x0, x20
	bl	_TRID_REG
	mov	x1, x0
	mov	x0, x21
	bl	_outl
Lloh9:
	adrp	x22, _T4D_LFO_GC_CIR@GOTPAGE
Lloh10:
	ldr	x22, [x22, _T4D_LFO_GC_CIR@GOTPAGEOFF]
	ldr	x1, [x22]
	mov	x0, x20
	bl	_TRID_REG
	bl	_inl
	and	w21, w0, #0xfff7ffff
	ldr	x1, [x22]
	mov	x0, x20
	bl	_TRID_REG
	mov	x1, x0
	mov	x0, x21
	bl	_outl
Lloh11:
	adrp	x22, _SI_SERIAL_INTF_CTRL@GOTPAGE
Lloh12:
	ldr	x22, [x22, _SI_SERIAL_INTF_CTRL@GOTPAGEOFF]
	ldr	x1, [x22]
	mov	x0, x20
	bl	_TRID_REG
	bl	_inl
Lloh13:
	adrp	x8, _SPDIF_EN@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SPDIF_EN@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	orr	w21, w8, w0
	b	LBB0_8
LBB0_4:
	ldr	w0, [x24]
	bl	_snd_trident_convert_rate
	str	w0, [x21]
	ldp	w0, w1, [x24]
	bl	_snd_trident_spurious_threshold
	str	x0, [x21, #104]
	ldr	w25, [x24, #8]
	ldr	x8, [x21, #112]
	cbz	x8, LBB0_6
; %bb.5:
	ldr	w8, [x8]
	b	LBB0_7
LBB0_6:
	mov	x8, x25
LBB0_7:
	str	w8, [x21, #4]
	movi.2s	v0, #1
	str	d0, [x21, #8]
	ldr	w8, [x24, #4]
	ldr	w9, [x24, #12]
	stp	w8, w9, [x21, #16]
	sub	w24, w9, #1
	lsl	w8, w8, #1
	add	w8, w8, #5
	stp	w8, w8, [x21, #24]
	mov	x0, x23
	bl	_snd_trident_control_mode
Lloh16:
	adrp	x8, lCPI0_0@PAGE
Lloh17:
	ldr	q0, [x8, lCPI0_0@PAGEOFF]
Lloh18:
	adrp	x8, lCPI0_1@PAGE
Lloh19:
	ldr	q1, [x8, lCPI0_1@PAGEOFF]
	stp	q0, q1, [x21, #32]
	stp	xzr, x0, [x21, #88]
	stp	xzr, xzr, [x21, #72]
	mov	x0, x20
	mov	x1, x21
	bl	_snd_trident_write_voice_regs
	and	w22, w24, #0xffff
Lloh20:
	adrp	x23, _NX_SPESO@GOTPAGE
Lloh21:
	ldr	x23, [x23, _NX_SPESO@GOTPAGEOFF]
	ldr	x1, [x23]
	mov	x0, x20
	bl	_TRID_REG
	mov	x1, x0
	mov	x0, x22
	bl	_outw
	lsr	w22, w24, #16
	ldr	x8, [x23]
	add	x1, x8, #2
	mov	x0, x20
	bl	_TRID_REG
	mov	x1, x0
	mov	x0, x22
	bl	_outb
	and	w22, w25, #0xfffffffc
Lloh22:
	adrp	x8, _NX_SPLBA@GOTPAGE
Lloh23:
	ldr	x8, [x8, _NX_SPLBA@GOTPAGEOFF]
Lloh24:
	ldr	x1, [x8]
	mov	x0, x20
	bl	_TRID_REG
	mov	x1, x0
	mov	x0, x22
	bl	_outl
	ldrh	w22, [x21, #56]
Lloh25:
	adrp	x23, _NX_SPCTRL_SPCSO@GOTPAGE
Lloh26:
	ldr	x23, [x23, _NX_SPCTRL_SPCSO@GOTPAGEOFF]
	ldr	x1, [x23]
	mov	x0, x20
	bl	_TRID_REG
	mov	x1, x0
	mov	x0, x22
	bl	_outw
	ldrsh	w21, [x21, #58]
	ldr	x8, [x23]
	add	x1, x8, #2
	mov	x0, x20
	bl	_TRID_REG
	mov	x1, x0
	mov	x0, x21
	bl	_outb
	ldr	w21, [x20, #8]
	ldr	x8, [x23]
	add	x1, x8, #3
	mov	x0, x20
	bl	_TRID_REG
	mov	x1, x0
	mov	x0, x21
	bl	_outb
	ldr	w21, [x20, #12]
Lloh27:
	adrp	x22, _NX_SPCSTATUS@GOTPAGE
Lloh28:
	ldr	x22, [x22, _NX_SPCSTATUS@GOTPAGEOFF]
LBB0_8:
	ldr	x1, [x22]
	mov	x0, x20
	bl	_TRID_REG
	mov	x1, x0
	mov	x0, x21
	bl	_outl
	mov	x0, x19
	bl	_spin_unlock_irq
	mov	w0, #0
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdr	Lloh4, Lloh5
	.loh AdrpAdrp	Lloh2, Lloh4
	.loh AdrpLdr	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdr	Lloh18, Lloh19
	.loh AdrpAdrp	Lloh16, Lloh18
	.loh AdrpLdr	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_TRIDENT_DEVICE_ID_SI7018,8,3   ; @TRIDENT_DEVICE_ID_SI7018
	.comm	_NX_SPESO,8,3                   ; @NX_SPESO
	.comm	_NX_SPLBA,8,3                   ; @NX_SPLBA
	.comm	_NX_SPCTRL_SPCSO,8,3            ; @NX_SPCTRL_SPCSO
	.comm	_NX_SPCSTATUS,8,3               ; @NX_SPCSTATUS
	.comm	_SI_SPDIF_CS,8,3                ; @SI_SPDIF_CS
	.comm	_T4D_LFO_GC_CIR,8,3             ; @T4D_LFO_GC_CIR
	.comm	_SI_SERIAL_INTF_CTRL,8,3        ; @SI_SERIAL_INTF_CTRL
	.comm	_SPDIF_EN,4,2                   ; @SPDIF_EN
	.no_dead_strip	_snd_trident_spdif_prepare
.subsections_via_symbols
