	.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, %r13
	cltq
	leaq	l_switch.table.dsp_set_digital_mode(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movl	24(%rdi), %ecx
	cmpl	(%rax), %ecx
	jne	LBB0_3
## %bb.4:
	movq	_TRUE@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_1:
	movslq	%r14d, %rdi
	callq	_DE_ACT
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_14
LBB0_3:
	movq	_FALSE@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %r15d
	leaq	8(%r13), %r12
	movq	%r12, %rdi
	callq	_spin_lock_irq
	testl	%r15d, %r15d
	je	LBB0_7
## %bb.6:
	movl	$48000, (%r13)                  ## imm = 0xBB80
	movq	_ECHO_CLOCK_INTERNAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_set_input_clock
LBB0_7:
	movq	16(%r13), %rax
	movl	(%rax), %edi
	callq	_le32_to_cpu
	movl	%eax, %ebx
	movq	_E3G_DIGITAL_MODE_CLEAR_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	cmpl	$130, %r14d
	je	LBB0_10
## %bb.8:
	cmpl	$129, %r14d
	jne	LBB0_11
## %bb.9:
	movq	_E3G_SPDIF_OPTICAL_MODE@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	jmp	LBB0_11
LBB0_10:
	movq	_E3G_ADAT_MODE@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_E3G_DOUBLE_SPEED_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, %ebx
LBB0_11:
	movq	%r13, %rdi
	callq	_get_frq_reg
	movq	%r13, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	movl	$1, %ecx
	callq	_write_control_reg
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_spin_unlock_irq
	testl	%ebx, %ebx
	js	LBB0_12
## %bb.13:
	movl	%r14d, 4(%r13)
	movl	%r14d, %edi
	callq	_DE_ACT
	jmp	LBB0_14
LBB0_12:
	movl	%ebx, %r15d
LBB0_14:
	movl	%r15d, %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	_ECHO_CLOCK_SPDIF,4,2           ## @ECHO_CLOCK_SPDIF
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ECHO_CLOCK_INTERNAL,4,2        ## @ECHO_CLOCK_INTERNAL
	.comm	_E3G_DIGITAL_MODE_CLEAR_MASK,4,2 ## @E3G_DIGITAL_MODE_CLEAR_MASK
	.comm	_E3G_SPDIF_OPTICAL_MODE,4,2     ## @E3G_SPDIF_OPTICAL_MODE
	.comm	_E3G_ADAT_MODE,4,2              ## @E3G_ADAT_MODE
	.comm	_E3G_DOUBLE_SPEED_MODE,4,2      ## @E3G_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

.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_6
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x9, _FALSE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _FALSE@GOTPAGEOFF]
Lloh2:
	adrp	x10, l_switch.table.dsp_set_digital_mode@PAGE
Lloh3:
	add	x10, x10, l_switch.table.dsp_set_digital_mode@PAGEOFF
	ldr	x8, [x10, w8, sxtw #3]
	ldr	w10, [x0, #24]
	ldr	w8, [x8]
Lloh4:
	adrp	x11, _TRUE@GOTPAGE
Lloh5:
	ldr	x11, [x11, _TRUE@GOTPAGEOFF]
	cmp	w10, w8
	csel	x8, x11, x9, eq
	ldr	w23, [x8]
	add	x21, x0, #8
	mov	x0, x21
	bl	_spin_lock_irq
	cbz	w23, LBB0_3
; %bb.2:
	mov	w8, #48000
	str	w8, [x20]
Lloh6:
	adrp	x8, _ECHO_CLOCK_INTERNAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ECHO_CLOCK_INTERNAL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_set_input_clock
LBB0_3:
	ldr	x8, [x20, #16]
	ldr	w0, [x8]
	bl	_le32_to_cpu
Lloh9:
	adrp	x8, _E3G_DIGITAL_MODE_CLEAR_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _E3G_DIGITAL_MODE_CLEAR_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	and	w22, w8, w0
	cmp	w19, #130
	b.eq	LBB0_7
; %bb.4:
	cmp	w19, #129
	b.ne	LBB0_8
; %bb.5:
Lloh12:
	adrp	x8, _E3G_SPDIF_OPTICAL_MODE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _E3G_SPDIF_OPTICAL_MODE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	orr	w22, w8, w22
	b	LBB0_8
LBB0_6:
	sxtw	x0, w19
	bl	_DE_ACT
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_10
LBB0_7:
Lloh18:
	adrp	x8, _E3G_ADAT_MODE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _E3G_ADAT_MODE@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	orr	w8, w8, w22
Lloh21:
	adrp	x9, _E3G_DOUBLE_SPEED_MODE@GOTPAGE
Lloh22:
	ldr	x9, [x9, _E3G_DOUBLE_SPEED_MODE@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	bic	w22, w8, w9
LBB0_8:
	mov	x0, x20
	bl	_get_frq_reg
	mov	x2, x0
	mov	x0, x20
	mov	x1, x22
	mov	w3, #1
	bl	_write_control_reg
	mov	x22, x0
	mov	x0, x21
	bl	_spin_unlock_irq
	tbnz	w22, #31, LBB0_10
; %bb.9:
	str	w19, [x20, #4]
	mov	w0, w19
	bl	_DE_ACT
	mov	x22, x23
LBB0_10:
	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 AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_ECHO_CLOCK_ADAT,4,2            ; @ECHO_CLOCK_ADAT
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_ECHO_CLOCK_SPDIF,4,2           ; @ECHO_CLOCK_SPDIF
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ECHO_CLOCK_INTERNAL,4,2        ; @ECHO_CLOCK_INTERNAL
	.comm	_E3G_DIGITAL_MODE_CLEAR_MASK,4,2 ; @E3G_DIGITAL_MODE_CLEAR_MASK
	.comm	_E3G_SPDIF_OPTICAL_MODE,4,2     ; @E3G_SPDIF_OPTICAL_MODE
	.comm	_E3G_ADAT_MODE,4,2              ; @E3G_ADAT_MODE
	.comm	_E3G_DOUBLE_SPEED_MODE,4,2      ; @E3G_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

.subsections_via_symbols
