	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cs46xx_dsp_enable_spdif_out    ## -- Begin function cs46xx_dsp_enable_spdif_out
	.p2align	4, 0x90
_cs46xx_dsp_enable_spdif_out:           ## @cs46xx_dsp_enable_spdif_out
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	(%rdi), %rbx
	movl	(%rbx), %eax
	movq	_DSP_SPDIF_STATUS_HW_ENABLED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_cs46xx_dsp_enable_spdif_hw
	movl	(%rbx), %eax
LBB0_2:
	movq	_DSP_SPDIF_STATUS_PLAYBACK_OPEN@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.3:
	movq	_DSP_SPDIF_STATUS_OUTPUT_ENABLED@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	jmp	LBB0_6
LBB0_4:
	movl	4(%rbx), %edi
	callq	_snd_BUG_ON
	testq	%rax, %rax
	jne	LBB0_5
## %bb.7:
	movq	32(%rbx), %rax
	movq	(%rax), %rax
	xorl	%edi, %edi
	cmpq	8(%rbx), %rax
	setne	%dil
	callq	_snd_BUG_ON
	testq	%rax, %rax
	je	LBB0_8
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_6:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_8:
	movq	24(%rbx), %rax
	movl	(%rax), %eax
	leal	8(,%rax,4), %esi
	movq	_OUTPUT_SNOOP_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	shll	$16, %edx
	addl	$1048576, %edx                  ## imm = 0x100000
	movq	%r14, %rdi
	callq	_snd_cs46xx_poke
	movq	_ASYNCTX_SCB_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_SPDIFO_SCB_INST@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_SPDIFO_IP_OUTPUT_BUFFER1@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	32(%rbx), %r9
	movq	_SCB_ON_PARENT_NEXT_SCB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_cs46xx_dsp_create_asynch_fg_tx_scb
	movl	%eax, 4(%rbx)
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:
	movq	_PCMSERIALINII_SCB_ADDR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	24(%rbx), %rcx
	movq	_SCB_ON_PARENT_SUBLIST_SCB@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r9d
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %r8d
	callq	_cs46xx_dsp_create_pcm_serial_input_scb
	movl	%eax, 16(%rbx)
	testl	%eax, %eax
	je	LBB0_9
## %bb.11:
	movq	_DSP_SPDIF_STATUS_OUTPUT_ENABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_DSP_SPDIF_STATUS_HW_ENABLED,4,2 ## @DSP_SPDIF_STATUS_HW_ENABLED
	.comm	_DSP_SPDIF_STATUS_PLAYBACK_OPEN,4,2 ## @DSP_SPDIF_STATUS_PLAYBACK_OPEN
	.comm	_DSP_SPDIF_STATUS_OUTPUT_ENABLED,4,2 ## @DSP_SPDIF_STATUS_OUTPUT_ENABLED
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_OUTPUT_SNOOP_BUFFER,4,2        ## @OUTPUT_SNOOP_BUFFER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"AsynchFGTxSCB"

	.comm	_ASYNCTX_SCB_ADDR,4,2           ## @ASYNCTX_SCB_ADDR
	.comm	_SPDIFO_SCB_INST,4,2            ## @SPDIFO_SCB_INST
	.comm	_SPDIFO_IP_OUTPUT_BUFFER1,4,2   ## @SPDIFO_IP_OUTPUT_BUFFER1
	.comm	_SCB_ON_PARENT_NEXT_SCB,4,2     ## @SCB_ON_PARENT_NEXT_SCB
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"PCMSerialInput_II"

	.comm	_PCMSERIALINII_SCB_ADDR,4,2     ## @PCMSERIALINII_SCB_ADDR
	.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_out    ; -- Begin function cs46xx_dsp_enable_spdif_out
	.p2align	2
_cs46xx_dsp_enable_spdif_out:           ; @cs46xx_dsp_enable_spdif_out
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x20, [x0]
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _DSP_SPDIF_STATUS_HW_ENABLED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DSP_SPDIF_STATUS_HW_ENABLED@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_cs46xx_dsp_enable_spdif_hw
	ldr	w8, [x20]
LBB0_2:
Lloh3:
	adrp	x9, _DSP_SPDIF_STATUS_PLAYBACK_OPEN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DSP_SPDIF_STATUS_PLAYBACK_OPEN@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
Lloh6:
	adrp	x9, _DSP_SPDIF_STATUS_OUTPUT_ENABLED@GOTPAGE
Lloh7:
	ldr	x9, [x9, _DSP_SPDIF_STATUS_OUTPUT_ENABLED@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x20]
Lloh9:
	adrp	x8, _EBUSY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_7
LBB0_4:
	ldr	w0, [x20, #4]
	bl	_snd_BUG_ON
	cbnz	x0, LBB0_6
; %bb.5:
	ldr	x8, [x20, #32]
	ldr	x8, [x8]
	ldr	x9, [x20, #8]
	cmp	x8, x9
	cset	w0, ne
	bl	_snd_BUG_ON
	cbz	x0, LBB0_9
LBB0_6:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_9:
	ldr	x8, [x20, #24]
	ldr	w8, [x8]
	lsl	w8, w8, #2
	add	w1, w8, #8
Lloh13:
	adrp	x8, _OUTPUT_SNOOP_BUFFER@GOTPAGE
Lloh14:
	ldr	x8, [x8, _OUTPUT_SNOOP_BUFFER@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	lsl	w8, w8, #16
	add	w2, w8, #256, lsl #12           ; =1048576
	mov	x0, x19
	bl	_snd_cs46xx_poke
Lloh16:
	adrp	x8, _ASYNCTX_SCB_ADDR@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ASYNCTX_SCB_ADDR@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
Lloh19:
	adrp	x8, _SPDIFO_SCB_INST@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SPDIFO_SCB_INST@GOTPAGEOFF]
Lloh21:
	adrp	x9, _SPDIFO_IP_OUTPUT_BUFFER1@GOTPAGE
Lloh22:
	ldr	x9, [x9, _SPDIFO_IP_OUTPUT_BUFFER1@GOTPAGEOFF]
Lloh23:
	ldr	w3, [x8]
Lloh24:
	ldr	w4, [x9]
	ldr	x5, [x20, #32]
Lloh25:
	adrp	x8, _SCB_ON_PARENT_NEXT_SCB@GOTPAGE
Lloh26:
	ldr	x8, [x8, _SCB_ON_PARENT_NEXT_SCB@GOTPAGEOFF]
Lloh27:
	ldr	w6, [x8]
Lloh28:
	adrp	x1, l_.str@PAGE
Lloh29:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_cs46xx_dsp_create_asynch_fg_tx_scb
	str	w0, [x20, #4]
	cbz	w0, LBB0_12
; %bb.10:
	mov	x4, x0
Lloh30:
	adrp	x8, _PCMSERIALINII_SCB_ADDR@GOTPAGE
Lloh31:
	ldr	x8, [x8, _PCMSERIALINII_SCB_ADDR@GOTPAGEOFF]
Lloh32:
	ldr	w2, [x8]
	ldr	x3, [x20, #24]
Lloh33:
	adrp	x8, _SCB_ON_PARENT_SUBLIST_SCB@GOTPAGE
Lloh34:
	ldr	x8, [x8, _SCB_ON_PARENT_SUBLIST_SCB@GOTPAGEOFF]
Lloh35:
	ldr	w5, [x8]
Lloh36:
	adrp	x1, l_.str.1@PAGE
Lloh37:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_cs46xx_dsp_create_pcm_serial_input_scb
	str	w0, [x20, #16]
	cbz	w0, LBB0_12
; %bb.11:
	mov	w0, #0
Lloh38:
	adrp	x8, _DSP_SPDIF_STATUS_OUTPUT_ENABLED@GOTPAGE
Lloh39:
	ldr	x8, [x8, _DSP_SPDIF_STATUS_OUTPUT_ENABLED@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
	b	LBB0_8
LBB0_12:
Lloh41:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh42:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh23
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_DSP_SPDIF_STATUS_HW_ENABLED,4,2 ; @DSP_SPDIF_STATUS_HW_ENABLED
	.comm	_DSP_SPDIF_STATUS_PLAYBACK_OPEN,4,2 ; @DSP_SPDIF_STATUS_PLAYBACK_OPEN
	.comm	_DSP_SPDIF_STATUS_OUTPUT_ENABLED,4,2 ; @DSP_SPDIF_STATUS_OUTPUT_ENABLED
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_OUTPUT_SNOOP_BUFFER,4,2        ; @OUTPUT_SNOOP_BUFFER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"AsynchFGTxSCB"

	.comm	_ASYNCTX_SCB_ADDR,4,2           ; @ASYNCTX_SCB_ADDR
	.comm	_SPDIFO_SCB_INST,4,2            ; @SPDIFO_SCB_INST
	.comm	_SPDIFO_IP_OUTPUT_BUFFER1,4,2   ; @SPDIFO_IP_OUTPUT_BUFFER1
	.comm	_SCB_ON_PARENT_NEXT_SCB,4,2     ; @SCB_ON_PARENT_NEXT_SCB
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"PCMSerialInput_II"

	.comm	_PCMSERIALINII_SCB_ADDR,4,2     ; @PCMSERIALINII_SCB_ADDR
	.comm	_SCB_ON_PARENT_SUBLIST_SCB,4,2  ; @SCB_ON_PARENT_SUBLIST_SCB
.subsections_via_symbols
