	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setup_spdif_playback
_setup_spdif_playback:                  ## @setup_spdif_playback
	.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
	movl	%ecx, %r13d
	movl	%edx, %r14d
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	(%rsi), %rax
	movl	(%rax), %r15d
	testl	%edx, %edx
	je	LBB0_3
## %bb.1:
	testl	%r13d, %r13d
	je	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	_save_mixer_state
	testl	%eax, %eax
	js	LBB0_15
LBB0_3:
	leaq	4(%rbx), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irq
	movl	%r14d, (%rbx)
	testl	%r14d, %r14d
	je	LBB0_13
## %bb.4:
	cmpq	$0, 8(%rbx)
	je	LBB0_6
## %bb.5:
	movq	_CM_REG_FUNCTRL1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CM_PLAYBACK_SPDF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_snd_cmipci_set_bit
LBB0_6:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	%r13d, %edx
	movl	%r15d, %ecx
	callq	_setup_ac3
	cmpl	$96000, %r15d                   ## imm = 0x17700
	je	LBB0_8
## %bb.7:
	cmpl	$48000, %r15d                   ## imm = 0xBB80
	jne	LBB0_9
LBB0_8:
	movq	_CM_REG_MISC_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CM_SPDIF48K@GOTPCREL(%rip), %rax
	movq	_CM_SPDF_AC97@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_snd_cmipci_set_bit
	jmp	LBB0_10
LBB0_13:
	movq	_CM_REG_CHFORMAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CM_DBLSPDS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_snd_cmipci_clear_bit
	movq	_CM_REG_FUNCTRL1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CM_PLAYBACK_SPDF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_snd_cmipci_clear_bit
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_setup_ac3
	jmp	LBB0_14
LBB0_9:
	movq	_CM_REG_MISC_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CM_SPDIF48K@GOTPCREL(%rip), %rax
	movq	_CM_SPDF_AC97@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_snd_cmipci_clear_bit
LBB0_10:
	movq	_CM_REG_CHFORMAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CM_DBLSPDS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	cmpl	$48001, %r15d                   ## imm = 0xBB81
	jl	LBB0_12
## %bb.11:
	callq	_snd_cmipci_set_bit
	jmp	LBB0_14
LBB0_12:
	callq	_snd_cmipci_clear_bit
LBB0_14:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irq
	xorl	%eax, %eax
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CM_REG_FUNCTRL1,4,2            ## @CM_REG_FUNCTRL1
	.comm	_CM_PLAYBACK_SPDF,4,2           ## @CM_PLAYBACK_SPDF
	.comm	_CM_REG_MISC_CTRL,4,2           ## @CM_REG_MISC_CTRL
	.comm	_CM_SPDIF48K,4,2                ## @CM_SPDIF48K
	.comm	_CM_SPDF_AC97,4,2               ## @CM_SPDF_AC97
	.comm	_CM_REG_CHFORMAT,4,2            ## @CM_REG_CHFORMAT
	.comm	_CM_DBLSPDS,4,2                 ## @CM_DBLSPDS
	.no_dead_strip	_setup_spdif_playback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setup_spdif_playback
_setup_spdif_playback:                  ; @setup_spdif_playback
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x23, x3
	mov	x24, x2
	mov	x22, x1
	mov	x20, x0
	ldr	x8, [x1]
	ldr	w21, [x8]
	cbz	w2, LBB0_3
; %bb.1:
	cbz	w23, LBB0_3
; %bb.2:
	mov	x0, x20
	bl	_save_mixer_state
	tbnz	w0, #31, LBB0_14
LBB0_3:
	add	x19, x20, #4
	mov	x0, x19
	bl	_spin_lock_irq
	str	w24, [x20]
	cbz	w24, LBB0_8
; %bb.4:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_6
; %bb.5:
Lloh0:
	adrp	x8, _CM_REG_FUNCTRL1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CM_REG_FUNCTRL1@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _CM_PLAYBACK_SPDF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CM_PLAYBACK_SPDF@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_snd_cmipci_set_bit
LBB0_6:
	mov	x0, x20
	mov	x1, x22
	mov	x2, x23
	mov	x3, x21
	bl	_setup_ac3
	mov	w8, #30464
	movk	w8, #1, lsl #16
	cmp	w21, w8
	mov	w8, #48000
	ccmp	w21, w8, #4, ne
	b.ne	LBB0_9
; %bb.7:
Lloh6:
	adrp	x8, _CM_REG_MISC_CTRL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CM_REG_MISC_CTRL@GOTPAGEOFF]
Lloh8:
	adrp	x9, _CM_SPDIF48K@GOTPAGE
Lloh9:
	ldr	x9, [x9, _CM_SPDIF48K@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	ldr	w8, [x9]
Lloh12:
	adrp	x9, _CM_SPDF_AC97@GOTPAGE
Lloh13:
	ldr	x9, [x9, _CM_SPDF_AC97@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x20
	bl	_snd_cmipci_set_bit
	b	LBB0_10
LBB0_8:
Lloh15:
	adrp	x8, _CM_REG_CHFORMAT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CM_REG_CHFORMAT@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x8, _CM_DBLSPDS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CM_DBLSPDS@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_snd_cmipci_clear_bit
Lloh21:
	adrp	x8, _CM_REG_FUNCTRL1@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CM_REG_FUNCTRL1@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _CM_PLAYBACK_SPDF@GOTPAGE
Lloh25:
	ldr	x8, [x8, _CM_PLAYBACK_SPDF@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_snd_cmipci_clear_bit
	mov	x0, x20
	mov	x1, x22
	mov	w2, #0
	mov	w3, #0
	bl	_setup_ac3
	b	LBB0_13
LBB0_9:
Lloh27:
	adrp	x8, _CM_REG_MISC_CTRL@GOTPAGE
Lloh28:
	ldr	x8, [x8, _CM_REG_MISC_CTRL@GOTPAGEOFF]
Lloh29:
	adrp	x9, _CM_SPDIF48K@GOTPAGE
Lloh30:
	ldr	x9, [x9, _CM_SPDIF48K@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
Lloh32:
	ldr	w8, [x9]
Lloh33:
	adrp	x9, _CM_SPDF_AC97@GOTPAGE
Lloh34:
	ldr	x9, [x9, _CM_SPDF_AC97@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x20
	bl	_snd_cmipci_clear_bit
LBB0_10:
Lloh36:
	adrp	x8, _CM_REG_CHFORMAT@GOTPAGE
Lloh37:
	ldr	x8, [x8, _CM_REG_CHFORMAT@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
Lloh39:
	adrp	x8, _CM_DBLSPDS@GOTPAGE
Lloh40:
	ldr	x8, [x8, _CM_DBLSPDS@GOTPAGEOFF]
Lloh41:
	ldr	w2, [x8]
	mov	w8, #48001
	mov	x0, x20
	cmp	w21, w8
	b.lt	LBB0_12
; %bb.11:
	bl	_snd_cmipci_set_bit
	b	LBB0_13
LBB0_12:
	bl	_snd_cmipci_clear_bit
LBB0_13:
	mov	x0, x19
	bl	_spin_unlock_irq
	mov	w0, #0
LBB0_14:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh31
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_CM_REG_FUNCTRL1,4,2            ; @CM_REG_FUNCTRL1
	.comm	_CM_PLAYBACK_SPDF,4,2           ; @CM_PLAYBACK_SPDF
	.comm	_CM_REG_MISC_CTRL,4,2           ; @CM_REG_MISC_CTRL
	.comm	_CM_SPDIF48K,4,2                ; @CM_SPDIF48K
	.comm	_CM_SPDF_AC97,4,2               ; @CM_SPDF_AC97
	.comm	_CM_REG_CHFORMAT,4,2            ; @CM_REG_CHFORMAT
	.comm	_CM_DBLSPDS,4,2                 ; @CM_DBLSPDS
	.no_dead_strip	_setup_spdif_playback
.subsections_via_symbols
