	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_sample_rate
_set_sample_rate:                       ## @set_sample_rate
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	_ECHO_CLOCK_INTERNAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.3:
	xorl	%edi, %edi
	cmpl	$50000, %r14d                   ## imm = 0xC350
	jl	LBB0_5
## %bb.4:
	movq	16(%rbx), %rax
	movq	_DIGITAL_MODE_ADAT@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
LBB0_5:
	callq	_snd_BUG_ON
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_2
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_DE_ACT
	movl	%r14d, %edi
	callq	_cpu_to_le32
	movq	24(%rbx), %rcx
	movq	%rax, (%rcx)
	movl	%r14d, 8(%rbx)
	movq	(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_set_input_clock
	xorl	%eax, %eax
LBB0_2:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	24(%rbx), %rax
	movl	8(%rax), %edi
	callq	_le32_to_cpu
	movq	_E3G_CLOCK_CLEAR_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	cmpl	$47999, %r14d                   ## imm = 0xBB7F
	jle	LBB0_8
## %bb.11:
	cmpl	$48000, %r14d                   ## imm = 0xBB80
	je	LBB0_16
## %bb.12:
	cmpl	$88200, %r14d                   ## imm = 0x15888
	je	LBB0_15
## %bb.13:
	cmpl	$96000, %r14d                   ## imm = 0x17700
	jne	LBB0_18
## %bb.14:
	movq	_E3G_96KHZ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	jmp	LBB0_20
LBB0_8:
	cmpl	$32000, %r14d                   ## imm = 0x7D00
	je	LBB0_17
## %bb.9:
	cmpl	$44100, %r14d                   ## imm = 0xAC44
	jne	LBB0_18
## %bb.10:
	movq	_E3G_44KHZ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	jmp	LBB0_20
LBB0_16:
	movq	_E3G_48KHZ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	jmp	LBB0_20
LBB0_15:
	movq	_E3G_88KHZ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	jmp	LBB0_20
LBB0_17:
	movq	_E3G_32KHZ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	jmp	LBB0_20
LBB0_18:
	movq	_E3G_CONTINUOUS_CLOCK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	cmpl	$50001, %r14d                   ## imm = 0xC351
	jl	LBB0_20
## %bb.19:
	movq	_E3G_DOUBLE_SPEED_MODE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %esi
LBB0_20:
	orl	%eax, %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_set_spdif_bits
	movl	%eax, %r15d
	movl	%r14d, %eax
	cmpl	$50001, %r14d                   ## imm = 0xC351
	jl	LBB0_22
## %bb.21:
	movl	%r14d, %eax
	shrl	$31, %eax
	addl	%r14d, %eax
	sarl	%eax
LBB0_22:
	cmpl	$32001, %eax                    ## imm = 0x7D01
	movl	$32000, %ecx                    ## imm = 0x7D00
	cmovgel	%eax, %ecx
	movq	_E3G_MAGIC_NUMBER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cltd
	idivl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	addl	$-2, %eax
	movq	_E3G_FREQ_REG_MAX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	cmpl	%r12d, %eax
	cmovll	%eax, %r12d
	movl	%r14d, %edi
	callq	_cpu_to_le32
	movq	24(%rbx), %rcx
	movq	%rax, (%rcx)
	movl	%r14d, 8(%rbx)
	movslq	%r15d, %rdi
	callq	_DE_ACT
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%r12d, %edx
	xorl	%ecx, %ecx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_write_control_reg              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ECHO_CLOCK_INTERNAL,8,3        ## @ECHO_CLOCK_INTERNAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"set_sample_rate: Cannot set sample rate - clock not set to CLK_CLOCKININTERNAL\n"

	.comm	_DIGITAL_MODE_ADAT,8,3          ## @DIGITAL_MODE_ADAT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_E3G_CLOCK_CLEAR_MASK,4,2       ## @E3G_CLOCK_CLEAR_MASK
	.comm	_E3G_96KHZ,4,2                  ## @E3G_96KHZ
	.comm	_E3G_88KHZ,4,2                  ## @E3G_88KHZ
	.comm	_E3G_48KHZ,4,2                  ## @E3G_48KHZ
	.comm	_E3G_44KHZ,4,2                  ## @E3G_44KHZ
	.comm	_E3G_32KHZ,4,2                  ## @E3G_32KHZ
	.comm	_E3G_CONTINUOUS_CLOCK,4,2       ## @E3G_CONTINUOUS_CLOCK
	.comm	_E3G_DOUBLE_SPEED_MODE,4,2      ## @E3G_DOUBLE_SPEED_MODE
	.comm	_E3G_MAGIC_NUMBER,4,2           ## @E3G_MAGIC_NUMBER
	.comm	_E3G_FREQ_REG_MAX,4,2           ## @E3G_FREQ_REG_MAX
	.no_dead_strip	_set_sample_rate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_sample_rate
_set_sample_rate:                       ; @set_sample_rate
	.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	x20, x1
	mov	x19, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _ECHO_CLOCK_INTERNAL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ECHO_CLOCK_INTERNAL@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.1:
	mov	w8, #50000
	cmp	w20, w8
	b.lt	LBB0_6
; %bb.2:
	ldr	x8, [x19, #16]
Lloh3:
	adrp	x9, _DIGITAL_MODE_ADAT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DIGITAL_MODE_ADAT@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_snd_BUG_ON
	cbz	x0, LBB0_7
LBB0_3:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_4:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DE_ACT
	mov	x0, x20
	bl	_cpu_to_le32
	ldr	x8, [x19, #24]
	str	x0, [x8]
	str	w20, [x19, #8]
	ldr	x1, [x19]
	mov	x0, x19
	bl	_set_input_clock
	mov	w0, #0
LBB0_5:
	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_6:
	mov	w0, #0
	bl	_snd_BUG_ON
	cbnz	x0, LBB0_3
LBB0_7:
	ldr	x8, [x19, #24]
	ldr	w0, [x8, #8]
	bl	_le32_to_cpu
Lloh11:
	adrp	x8, _E3G_CLOCK_CLEAR_MASK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _E3G_CLOCK_CLEAR_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	and	w8, w8, w0
	mov	w9, #47999
	cmp	w20, w9
	b.le	LBB0_12
; %bb.8:
	mov	w9, #48000
	cmp	w20, w9
	b.eq	LBB0_15
; %bb.9:
	mov	w9, #22664
	movk	w9, #1, lsl #16
	cmp	w20, w9
	b.eq	LBB0_16
; %bb.10:
	mov	w9, #30464
	movk	w9, #1, lsl #16
	cmp	w20, w9
	b.ne	LBB0_18
; %bb.11:
Lloh14:
	adrp	x9, _E3G_96KHZ@GOTPAGE
Lloh15:
	ldr	x9, [x9, _E3G_96KHZ@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	b	LBB0_20
LBB0_12:
	mov	w9, #32000
	cmp	w20, w9
	b.eq	LBB0_17
; %bb.13:
	mov	w9, #44100
	cmp	w20, w9
	b.ne	LBB0_18
; %bb.14:
Lloh17:
	adrp	x9, _E3G_44KHZ@GOTPAGE
Lloh18:
	ldr	x9, [x9, _E3G_44KHZ@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	b	LBB0_20
LBB0_15:
Lloh20:
	adrp	x9, _E3G_48KHZ@GOTPAGE
Lloh21:
	ldr	x9, [x9, _E3G_48KHZ@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	b	LBB0_20
LBB0_16:
Lloh23:
	adrp	x9, _E3G_88KHZ@GOTPAGE
Lloh24:
	ldr	x9, [x9, _E3G_88KHZ@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	b	LBB0_20
LBB0_17:
Lloh26:
	adrp	x9, _E3G_32KHZ@GOTPAGE
Lloh27:
	ldr	x9, [x9, _E3G_32KHZ@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	b	LBB0_20
LBB0_18:
Lloh29:
	adrp	x9, _E3G_CONTINUOUS_CLOCK@GOTPAGE
Lloh30:
	ldr	x9, [x9, _E3G_CONTINUOUS_CLOCK@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	mov	w10, #50001
	cmp	w20, w10
	b.lt	LBB0_20
; %bb.19:
Lloh32:
	adrp	x10, _E3G_DOUBLE_SPEED_MODE@GOTPAGE
Lloh33:
	ldr	x10, [x10, _E3G_DOUBLE_SPEED_MODE@GOTPAGEOFF]
Lloh34:
	ldr	w10, [x10]
	orr	w9, w10, w9
LBB0_20:
	orr	w1, w9, w8
	mov	x0, x19
	mov	x2, x20
	bl	_set_spdif_bits
	mov	x21, x0
	cmp	w20, #0
	cinc	w8, w20, lt
	asr	w8, w8, #1
	mov	w9, #50000
	cmp	w20, w9
	csel	w8, w8, w20, gt
	mov	w9, #32000
	cmp	w8, w9
	csel	w8, w8, w9, gt
Lloh35:
	adrp	x9, _E3G_MAGIC_NUMBER@GOTPAGE
Lloh36:
	ldr	x9, [x9, _E3G_MAGIC_NUMBER@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	sdiv	w8, w9, w8
	sub	w8, w8, #2
Lloh38:
	adrp	x9, _E3G_FREQ_REG_MAX@GOTPAGE
Lloh39:
	ldr	x9, [x9, _E3G_FREQ_REG_MAX@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x9]
	cmp	w8, w9
	csel	w22, w8, w9, lt
	mov	x0, x20
	bl	_cpu_to_le32
	ldr	x8, [x19, #24]
	str	x0, [x8]
	str	w20, [x19, #8]
	sxtw	x0, w21
	bl	_DE_ACT
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	mov	w3, #0
	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
	b	_write_control_reg
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_ECHO_CLOCK_INTERNAL,8,3        ; @ECHO_CLOCK_INTERNAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"set_sample_rate: Cannot set sample rate - clock not set to CLK_CLOCKININTERNAL\n"

	.comm	_DIGITAL_MODE_ADAT,8,3          ; @DIGITAL_MODE_ADAT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_E3G_CLOCK_CLEAR_MASK,4,2       ; @E3G_CLOCK_CLEAR_MASK
	.comm	_E3G_96KHZ,4,2                  ; @E3G_96KHZ
	.comm	_E3G_88KHZ,4,2                  ; @E3G_88KHZ
	.comm	_E3G_48KHZ,4,2                  ; @E3G_48KHZ
	.comm	_E3G_44KHZ,4,2                  ; @E3G_44KHZ
	.comm	_E3G_32KHZ,4,2                  ; @E3G_32KHZ
	.comm	_E3G_CONTINUOUS_CLOCK,4,2       ; @E3G_CONTINUOUS_CLOCK
	.comm	_E3G_DOUBLE_SPEED_MODE,4,2      ; @E3G_DOUBLE_SPEED_MODE
	.comm	_E3G_MAGIC_NUMBER,4,2           ; @E3G_MAGIC_NUMBER
	.comm	_E3G_FREQ_REG_MAX,4,2           ; @E3G_FREQ_REG_MAX
	.no_dead_strip	_set_sample_rate
.subsections_via_symbols
