	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cs46xx_dsp_enable_spdif_in     ## -- Begin function cs46xx_dsp_enable_spdif_in
	.p2align	4, 0x90
_cs46xx_dsp_enable_spdif_in:            ## @cs46xx_dsp_enable_spdif_in
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	24(%rdi), %r15
	movl	$1, %esi
	callq	*16(%rdi)
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	*8(%rbx)
	movl	(%r15), %edi
	callq	_snd_BUG_ON
	testq	%rax, %rax
	jne	LBB0_1
## %bb.2:
	xorl	%edi, %edi
	cmpl	$0, 12(%r15)
	sete	%dil
	callq	_snd_BUG_ON
	testq	%rax, %rax
	je	LBB0_3
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	_DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	testl	%eax, 4(%r15)
	jne	LBB0_5
## %bb.4:
	movq	_SP_ASER_COUNTDOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$-2147483643, %edx              ## imm = 0x80000005
	callq	_cs46xx_poke_via_dsp
	movq	_SP_SPDIN_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$-2147482625, %edx              ## imm = 0x800003FF
	callq	_cs46xx_poke_via_dsp
	movl	(%r14), %eax
	orl	%eax, 4(%r15)
LBB0_5:
	movq	_ASYNCRX_SCB_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_SPDIFI_SCB_INST@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_SPDIFI_IP_OUTPUT_BUFFER1@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	12(%r15), %r9d
	movq	_SCB_ON_PARENT_SUBLIST_SCB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_cs46xx_dsp_create_asynch_fg_rx_scb
	movl	%eax, (%r15)
	leaq	4(%rbx), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irq
	movl	12(%r15), %esi
	movq	%rbx, %rdi
	callq	_cs46xx_src_link
	movl	12(%r15), %esi
	movq	%rbx, %rdi
	movl	$32767, %edx                    ## imm = 0x7FFF
	movl	$32767, %ecx                    ## imm = 0x7FFF
	callq	_cs46xx_dsp_scb_set_volume
	movq	%r14, %rdi
	callq	_spin_unlock_irq
	movl	$1, 8(%r15)
	movq	%rbx, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED,4,2 ## @DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED
	.comm	_SP_ASER_COUNTDOWN,4,2          ## @SP_ASER_COUNTDOWN
	.comm	_SP_SPDIN_CONTROL,4,2           ## @SP_SPDIN_CONTROL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"AsynchFGRxSCB"

	.comm	_ASYNCRX_SCB_ADDR,4,2           ## @ASYNCRX_SCB_ADDR
	.comm	_SPDIFI_SCB_INST,4,2            ## @SPDIFI_SCB_INST
	.comm	_SPDIFI_IP_OUTPUT_BUFFER1,4,2   ## @SPDIFI_IP_OUTPUT_BUFFER1
	.comm	_SCB_ON_PARENT_SUBLIST_SCB,4,2  ## @SCB_ON_PARENT_SUBLIST_SCB
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cs46xx_dsp_enable_spdif_in     ; -- Begin function cs46xx_dsp_enable_spdif_in
	.p2align	2
_cs46xx_dsp_enable_spdif_in:            ; @cs46xx_dsp_enable_spdif_in
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldp	x8, x21, [x0, #16]
	mov	w1, #1
	blr	x8
	ldr	x8, [x19, #8]
	mov	x0, x19
	mov	w1, #1
	blr	x8
	ldr	w0, [x21]
	bl	_snd_BUG_ON
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	w8, [x21, #12]
	cmp	w8, #0
	cset	w0, eq
	bl	_snd_BUG_ON
	cbz	x0, LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_4:
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x21, #4]
Lloh3:
	adrp	x20, _DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED@GOTPAGE
Lloh4:
	ldr	x20, [x20, _DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED@GOTPAGEOFF]
	ldr	w9, [x20]
	tst	w9, w8
	b.ne	LBB0_6
; %bb.5:
Lloh5:
	adrp	x8, _SP_ASER_COUNTDOWN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SP_ASER_COUNTDOWN@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #5
	movk	w2, #32768, lsl #16
	bl	_cs46xx_poke_via_dsp
Lloh8:
	adrp	x8, _SP_SPDIN_CONTROL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SP_SPDIN_CONTROL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #-2147482625
	bl	_cs46xx_poke_via_dsp
	ldr	w8, [x20]
	ldr	w9, [x21, #4]
	orr	w8, w9, w8
	str	w8, [x21, #4]
LBB0_6:
Lloh11:
	adrp	x8, _ASYNCRX_SCB_ADDR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ASYNCRX_SCB_ADDR@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
Lloh14:
	adrp	x8, _SPDIFI_SCB_INST@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SPDIFI_SCB_INST@GOTPAGEOFF]
Lloh16:
	adrp	x9, _SPDIFI_IP_OUTPUT_BUFFER1@GOTPAGE
Lloh17:
	ldr	x9, [x9, _SPDIFI_IP_OUTPUT_BUFFER1@GOTPAGEOFF]
Lloh18:
	ldr	w3, [x8]
Lloh19:
	ldr	w4, [x9]
	ldr	w5, [x21, #12]
Lloh20:
	adrp	x8, _SCB_ON_PARENT_SUBLIST_SCB@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SCB_ON_PARENT_SUBLIST_SCB@GOTPAGEOFF]
Lloh22:
	ldr	w6, [x8]
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_cs46xx_dsp_create_asynch_fg_rx_scb
	str	w0, [x21]
	add	x20, x19, #4
	mov	x0, x20
	bl	_spin_lock_irq
	ldr	w1, [x21, #12]
	mov	x0, x19
	bl	_cs46xx_src_link
	ldr	w1, [x21, #12]
	mov	x0, x19
	mov	w2, #32767
	mov	w3, #32767
	bl	_cs46xx_dsp_scb_set_volume
	mov	x0, x20
	bl	_spin_unlock_irq
	mov	w8, #1
	str	w8, [x21, #8]
	mov	x0, x19
	bl	_mutex_unlock
	mov	w0, #0
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh18
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED,4,2 ; @DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED
	.comm	_SP_ASER_COUNTDOWN,4,2          ; @SP_ASER_COUNTDOWN
	.comm	_SP_SPDIN_CONTROL,4,2           ; @SP_SPDIN_CONTROL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"AsynchFGRxSCB"

	.comm	_ASYNCRX_SCB_ADDR,4,2           ; @ASYNCRX_SCB_ADDR
	.comm	_SPDIFI_SCB_INST,4,2            ; @SPDIFI_SCB_INST
	.comm	_SPDIFI_IP_OUTPUT_BUFFER1,4,2   ; @SPDIFI_IP_OUTPUT_BUFFER1
	.comm	_SCB_ON_PARENT_SUBLIST_SCB,4,2  ; @SCB_ON_PARENT_SUBLIST_SCB
.subsections_via_symbols
