	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dsp_set_digital_mode
_dsp_set_digital_mode:                  ## @dsp_set_digital_mode
	.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	%esi, %r14d
	leal	-128(%r14), %eax
	cmpl	$3, %eax
	jae	LBB0_1
## %bb.2:
	movq	%rdi, %r15
	cltq
	leaq	l_switch.table.dsp_set_digital_mode(%rip), %rcx
	movq	(%rcx,%rax,8), %rcx
	leaq	l_switch.table.dsp_set_digital_mode.2(%rip), %rdx
	movq	(%rdx,%rax,8), %rax
	movl	24(%rdi), %edx
	cmpl	(%rcx), %edx
	jne	LBB0_3
## %bb.4:
	movq	_TRUE@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_1:
	movslq	%r14d, %rdi
	callq	_DE_ACT
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_3:
	movq	_FALSE@GOTPCREL(%rip), %rcx
LBB0_5:
	movl	(%rcx), %r13d
	movq	_card_fw@GOTPCREL(%rip), %rcx
	movq	(%rax), %rbx
	shlq	$2, %rbx
	addq	(%rcx), %rbx
	testl	%r13d, %r13d
	je	LBB0_7
## %bb.6:
	movl	$48000, (%r15)                  ## imm = 0xBB80
	leaq	8(%r15), %r12
	movq	%r12, %rdi
	callq	_spin_lock_irq
	movq	_ECHO_CLOCK_INTERNAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_set_input_clock
	movq	%r12, %rdi
	callq	_spin_unlock_irq
LBB0_7:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_switch_asic
	testq	%rax, %rax
	js	LBB0_8
## %bb.10:
	leaq	8(%r15), %r12
	movq	%r12, %rdi
	callq	_spin_lock_irq
	movq	16(%r15), %rax
	movl	(%rax), %edi
	callq	_le32_to_cpu
	movq	_GML_DIGITAL_MODE_CLEAR_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	cmpl	$130, %r14d
	je	LBB0_13
## %bb.11:
	cmpl	$129, %r14d
	jne	LBB0_14
## %bb.12:
	movq	_GML_SPDIF_OPTICAL_MODE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	jmp	LBB0_14
LBB0_8:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_9:
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_17
LBB0_13:
	movq	_GML_ADAT_MODE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_GML_DOUBLE_SPEED_MODE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%ecx, %eax
LBB0_14:
	movq	_TRUE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_write_control_reg
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_spin_unlock_irq
	testl	%ebx, %ebx
	js	LBB0_15
## %bb.16:
	movl	%r14d, 4(%r15)
	movl	%r14d, %edi
	callq	_DE_ACT
	jmp	LBB0_17
LBB0_15:
	movl	%ebx, %r13d
LBB0_17:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_ECHO_CLOCK_ADAT,4,2            ## @ECHO_CLOCK_ADAT
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_card_fw,8,3                    ## @card_fw
	.comm	_FW_LAYLA24_2S_ASIC,8,3         ## @FW_LAYLA24_2S_ASIC
	.comm	_ECHO_CLOCK_SPDIF,4,2           ## @ECHO_CLOCK_SPDIF
	.comm	_FW_LAYLA24_2A_ASIC,8,3         ## @FW_LAYLA24_2A_ASIC
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ECHO_CLOCK_INTERNAL,4,2        ## @ECHO_CLOCK_INTERNAL
	.comm	_EIO,4,2                        ## @EIO
	.comm	_GML_DIGITAL_MODE_CLEAR_MASK,4,2 ## @GML_DIGITAL_MODE_CLEAR_MASK
	.comm	_GML_SPDIF_OPTICAL_MODE,4,2     ## @GML_SPDIF_OPTICAL_MODE
	.comm	_GML_ADAT_MODE,4,2              ## @GML_ADAT_MODE
	.comm	_GML_DOUBLE_SPEED_MODE,4,2      ## @GML_DOUBLE_SPEED_MODE
	.no_dead_strip	_dsp_set_digital_mode
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.dsp_set_digital_mode
l_switch.table.dsp_set_digital_mode:
	.quad	_ECHO_CLOCK_ADAT
	.quad	_ECHO_CLOCK_ADAT
	.quad	_ECHO_CLOCK_SPDIF

	.p2align	3                               ## @switch.table.dsp_set_digital_mode.2
l_switch.table.dsp_set_digital_mode.2:
	.quad	_FW_LAYLA24_2S_ASIC
	.quad	_FW_LAYLA24_2S_ASIC
	.quad	_FW_LAYLA24_2A_ASIC

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dsp_set_digital_mode
_dsp_set_digital_mode:                  ; @dsp_set_digital_mode
	.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	x19, x1
	sub	w8, w1, #128
	cmp	w8, #3
	b.hs	LBB0_7
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x9, _FALSE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _FALSE@GOTPAGEOFF]
	sbfiz	x8, x8, #3, #32
Lloh2:
	adrp	x10, l_switch.table.dsp_set_digital_mode@PAGE
Lloh3:
	add	x10, x10, l_switch.table.dsp_set_digital_mode@PAGEOFF
	ldr	x10, [x10, x8]
Lloh4:
	adrp	x11, l_switch.table.dsp_set_digital_mode.2@PAGE
Lloh5:
	add	x11, x11, l_switch.table.dsp_set_digital_mode.2@PAGEOFF
	ldr	x8, [x11, x8]
	ldr	w11, [x0, #24]
	ldr	w10, [x10]
Lloh6:
	adrp	x24, _TRUE@GOTPAGE
Lloh7:
	ldr	x24, [x24, _TRUE@GOTPAGEOFF]
	cmp	w11, w10
	csel	x9, x24, x9, eq
	ldr	w23, [x9]
Lloh8:
	adrp	x9, _card_fw@GOTPAGE
Lloh9:
	ldr	x9, [x9, _card_fw@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	ldr	x8, [x8]
	add	x21, x9, x8, lsl #2
	cbz	w23, LBB0_3
; %bb.2:
	mov	w8, #48000
	mov	x22, x20
	str	w8, [x22], #8
	mov	x0, x22
	bl	_spin_lock_irq
Lloh11:
	adrp	x8, _ECHO_CLOCK_INTERNAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ECHO_CLOCK_INTERNAL@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_set_input_clock
	mov	x0, x22
	bl	_spin_unlock_irq
LBB0_3:
	mov	x0, x20
	mov	x1, x21
	bl	_switch_asic
	tbnz	x0, #63, LBB0_8
; %bb.4:
	add	x21, x20, #8
	mov	x0, x21
	bl	_spin_lock_irq
	ldr	x8, [x20, #16]
	ldr	w0, [x8]
	bl	_le32_to_cpu
Lloh14:
	adrp	x8, _GML_DIGITAL_MODE_CLEAR_MASK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _GML_DIGITAL_MODE_CLEAR_MASK@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	and	w1, w8, w0
	cmp	w19, #130
	b.eq	LBB0_10
; %bb.5:
	cmp	w19, #129
	b.ne	LBB0_11
; %bb.6:
Lloh17:
	adrp	x8, _GML_SPDIF_OPTICAL_MODE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _GML_SPDIF_OPTICAL_MODE@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	orr	w1, w8, w1
	b	LBB0_11
LBB0_7:
	sxtw	x0, w19
	bl	_DE_ACT
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh22:
	adrp	x8, _EIO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_13
LBB0_10:
Lloh24:
	adrp	x8, _GML_ADAT_MODE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _GML_ADAT_MODE@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	orr	w8, w8, w1
Lloh27:
	adrp	x9, _GML_DOUBLE_SPEED_MODE@GOTPAGE
Lloh28:
	ldr	x9, [x9, _GML_DOUBLE_SPEED_MODE@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	bic	w1, w8, w9
LBB0_11:
	ldr	w2, [x24]
	mov	x0, x20
	bl	_write_control_reg
	mov	x22, x0
	mov	x0, x21
	bl	_spin_unlock_irq
	tbnz	w22, #31, LBB0_13
; %bb.12:
	str	w19, [x20, #4]
	mov	w0, w19
	bl	_DE_ACT
	mov	x22, x23
LBB0_13:
	mov	x0, x22
	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	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_ECHO_CLOCK_ADAT,4,2            ; @ECHO_CLOCK_ADAT
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_card_fw,8,3                    ; @card_fw
	.comm	_FW_LAYLA24_2S_ASIC,8,3         ; @FW_LAYLA24_2S_ASIC
	.comm	_ECHO_CLOCK_SPDIF,4,2           ; @ECHO_CLOCK_SPDIF
	.comm	_FW_LAYLA24_2A_ASIC,8,3         ; @FW_LAYLA24_2A_ASIC
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ECHO_CLOCK_INTERNAL,4,2        ; @ECHO_CLOCK_INTERNAL
	.comm	_EIO,4,2                        ; @EIO
	.comm	_GML_DIGITAL_MODE_CLEAR_MASK,4,2 ; @GML_DIGITAL_MODE_CLEAR_MASK
	.comm	_GML_SPDIF_OPTICAL_MODE,4,2     ; @GML_SPDIF_OPTICAL_MODE
	.comm	_GML_ADAT_MODE,4,2              ; @GML_ADAT_MODE
	.comm	_GML_DOUBLE_SPEED_MODE,4,2      ; @GML_DOUBLE_SPEED_MODE
	.no_dead_strip	_dsp_set_digital_mode
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.dsp_set_digital_mode
l_switch.table.dsp_set_digital_mode:
	.quad	_ECHO_CLOCK_ADAT
	.quad	_ECHO_CLOCK_ADAT
	.quad	_ECHO_CLOCK_SPDIF

	.p2align	3                               ; @switch.table.dsp_set_digital_mode.2
l_switch.table.dsp_set_digital_mode.2:
	.quad	_FW_LAYLA24_2S_ASIC
	.quad	_FW_LAYLA24_2S_ASIC
	.quad	_FW_LAYLA24_2A_ASIC

.subsections_via_symbols
