	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pcxhr_set_audio_source
_pcxhr_set_audio_source:                ## @pcxhr_set_audio_source
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movslq	(%rdi), %rax
	cmpq	$4, %rax
	jae	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	leaq	l_switch.table.pcxhr_set_audio_source(%rip), %rcx
	movq	(%rcx,%rax,8), %rcx
	leaq	l_switch.table.pcxhr_set_audio_source.1(%rip), %rdx
	movq	(%rdx,%rax,8), %rax
	movl	(%rax), %r15d
	movl	(%rcx), %esi
	movl	4(%rdi), %edx
	testl	%edx, %edx
	cmovnel	%esi, %edx
	movq	8(%rdi), %rdi
	leaq	-52(%rbp), %rcx
	callq	_pcxhr_write_io_num_reg_cont
	cmpl	$0, -52(%rbp)
	je	LBB0_4
## %bb.3:
	movq	_CMD_RESYNC_AUDIO_INPUTS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %r14
	movq	%r14, %rdi
	callq	_pcxhr_init_rmh
	movb	(%rbx), %cl
	movl	$1, %eax
	shll	%cl, %eax
	movq	-48(%rbp), %rcx
	orl	%eax, (%rcx)
	movq	8(%rbx), %rdi
	movq	%r14, %rsi
	callq	_pcxhr_send_msg
	testl	%eax, %eax
	jne	LBB0_15
LBB0_4:
	movq	8(%rbx), %rcx
	cmpq	$0, 16(%rcx)
	je	LBB0_12
## %bb.5:
	movl	(%rcx), %edx
	xorl	%eax, %eax
	testl	%edx, %edx
	cmovgl	%edx, %eax
	jle	LBB0_6
## %bb.7:
	movq	8(%rcx), %rcx
	movq	(%rcx), %rdx
	xorl	%esi, %esi
	cmpl	$2, (%rdx)
	sete	%sil
	leal	192(,%rsi,8), %r15d
	cmpl	$1, %eax
	je	LBB0_11
## %bb.8:
	movq	8(%rcx), %rdx
	xorl	%esi, %esi
	cmpl	$2, (%rdx)
	sete	%sil
	shll	$2, %esi
	orl	%esi, %r15d
	cmpl	$2, %eax
	je	LBB0_11
## %bb.9:
	movq	16(%rcx), %rdx
	xorl	%esi, %esi
	cmpl	$2, (%rdx)
	sete	%sil
	addl	%esi, %esi
	orl	%esi, %r15d
	cmpl	$3, %eax
	je	LBB0_11
## %bb.10:
	movq	24(%rcx), %rax
	xorl	%ecx, %ecx
	cmpl	$2, (%rax)
	sete	%cl
	orl	%ecx, %r15d
	jmp	LBB0_11
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_15
LBB0_12:
	movl	4(%rbx), %r12d
	movq	_CMD_ACCESS_IO_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %r14
	movq	%r14, %rdi
	callq	_pcxhr_init_rmh
	movl	$3, -40(%rbp)
	movq	_IO_NUM_UER_CHIP_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-48(%rbp), %rcx
	orl	%eax, (%rcx)
	movl	%r15d, 4(%rcx)
	movq	_CS8420_DATA_FLOW_CTL@GOTPCREL(%rip), %rax
	movq	_CHIP_SIG_AND_MAP_SPI@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	andl	(%rax), %edx
	cmpl	$2, %r12d
	movl	$65, %eax
	movl	$84, %esi
	cmovel	%eax, %esi
	orl	%edx, %esi
	movl	%esi, 8(%rcx)
	movq	8(%rbx), %rdi
	movq	%r14, %rsi
	callq	_pcxhr_send_msg
	testl	%eax, %eax
	jne	LBB0_15
## %bb.13:
	xorl	%eax, %eax
	cmpl	$2, %r12d
	setne	%al
	movq	_CS8420_CLOCK_SRC_CTL@GOTPCREL(%rip), %rcx
	movl	(%r15), %edx
	andl	(%rcx), %edx
	shll	$3, %eax
	orl	%edx, %eax
	orl	$65, %eax
	movq	-48(%rbp), %rcx
	movl	%eax, 8(%rcx)
	movq	8(%rbx), %rdi
	leaq	-48(%rbp), %rsi
	jmp	LBB0_14
LBB0_6:
	movl	$192, %r15d
LBB0_11:
	movq	_CMD_ACCESS_IO_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %r14
	movq	%r14, %rdi
	callq	_pcxhr_init_rmh
	movl	$2, -40(%rbp)
	movq	_IO_NUM_REG_CONFIG_SRC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-48(%rbp), %rcx
	orl	%eax, (%rcx)
	movl	%r15d, 4(%rcx)
	movq	8(%rbx), %rdi
	movq	%r14, %rsi
LBB0_14:
	callq	_pcxhr_send_msg
LBB0_15:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCXHR_SOURCE_AUDIO01_UER,4,2   ## @PCXHR_SOURCE_AUDIO01_UER
	.comm	_CS8420_01_CS,4,2               ## @CS8420_01_CS
	.comm	_PCXHR_SOURCE_AUDIO23_UER,4,2   ## @PCXHR_SOURCE_AUDIO23_UER
	.comm	_CS8420_23_CS,4,2               ## @CS8420_23_CS
	.comm	_PCXHR_SOURCE_AUDIO45_UER,4,2   ## @PCXHR_SOURCE_AUDIO45_UER
	.comm	_CS8420_45_CS,4,2               ## @CS8420_45_CS
	.comm	_PCXHR_SOURCE_AUDIO67_UER,4,2   ## @PCXHR_SOURCE_AUDIO67_UER
	.comm	_CS8420_67_CS,4,2               ## @CS8420_67_CS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CMD_RESYNC_AUDIO_INPUTS,4,2    ## @CMD_RESYNC_AUDIO_INPUTS
	.comm	_CMD_ACCESS_IO_WRITE,4,2        ## @CMD_ACCESS_IO_WRITE
	.comm	_IO_NUM_REG_CONFIG_SRC,4,2      ## @IO_NUM_REG_CONFIG_SRC
	.comm	_IO_NUM_UER_CHIP_REG,4,2        ## @IO_NUM_UER_CHIP_REG
	.comm	_CS8420_DATA_FLOW_CTL,4,2       ## @CS8420_DATA_FLOW_CTL
	.comm	_CHIP_SIG_AND_MAP_SPI,4,2       ## @CHIP_SIG_AND_MAP_SPI
	.comm	_CS8420_CLOCK_SRC_CTL,4,2       ## @CS8420_CLOCK_SRC_CTL
	.no_dead_strip	_pcxhr_set_audio_source
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.pcxhr_set_audio_source
l_switch.table.pcxhr_set_audio_source:
	.quad	_PCXHR_SOURCE_AUDIO01_UER
	.quad	_PCXHR_SOURCE_AUDIO23_UER
	.quad	_PCXHR_SOURCE_AUDIO45_UER
	.quad	_PCXHR_SOURCE_AUDIO67_UER

	.p2align	3                               ## @switch.table.pcxhr_set_audio_source.1
l_switch.table.pcxhr_set_audio_source.1:
	.quad	_CS8420_01_CS
	.quad	_CS8420_23_CS
	.quad	_CS8420_45_CS
	.quad	_CS8420_67_CS

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pcxhr_set_audio_source
_pcxhr_set_audio_source:                ; @pcxhr_set_audio_source
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldrsw	x8, [x0]
	cmp	w8, #4
	b.hs	LBB0_11
; %bb.1:
	mov	x19, x0
	lsl	x8, x8, #3
Lloh0:
	adrp	x9, l_switch.table.pcxhr_set_audio_source@PAGE
Lloh1:
	add	x9, x9, l_switch.table.pcxhr_set_audio_source@PAGEOFF
	ldr	x9, [x9, x8]
Lloh2:
	adrp	x10, l_switch.table.pcxhr_set_audio_source.1@PAGE
Lloh3:
	add	x10, x10, l_switch.table.pcxhr_set_audio_source.1@PAGEOFF
	ldr	x8, [x10, x8]
	ldr	w20, [x8]
	ldr	w1, [x9]
	ldr	w8, [x0, #4]
	cmp	w8, #0
	csel	w2, wzr, w1, eq
	ldr	x0, [x0, #8]
	add	x3, sp, #12
	bl	_pcxhr_write_io_num_reg_cont
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_3
; %bb.2:
Lloh4:
	adrp	x8, _CMD_RESYNC_AUDIO_INPUTS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _CMD_RESYNC_AUDIO_INPUTS@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	add	x0, sp, #16
	bl	_pcxhr_init_rmh
	ldr	w8, [x19]
	mov	w9, #1
	lsl	w8, w9, w8
	ldr	x9, [sp, #16]
	ldr	w10, [x9]
	orr	w8, w10, w8
	str	w8, [x9]
	ldr	x0, [x19, #8]
	add	x1, sp, #16
	bl	_pcxhr_send_msg
	cbnz	w0, LBB0_12
LBB0_3:
	ldr	x8, [x19, #8]
	ldr	x9, [x8, #16]
	cbz	x9, LBB0_13
; %bb.4:
	ldr	w10, [x8]
	cmp	w10, #0
	csel	w9, w10, wzr, gt
	mov	w20, #192
	cmp	w10, #1
	b.lt	LBB0_9
; %bb.5:
	ldr	x8, [x8, #8]
	ldr	x10, [x8]
	ldr	w10, [x10]
	mov	w11, #200
	cmp	w10, #2
	csel	w20, w11, w20, eq
	cmp	w9, #1
	b.eq	LBB0_9
; %bb.6:
	ldr	x10, [x8, #8]
	ldr	w10, [x10]
	cmp	w10, #2
	cset	w10, eq
	orr	w20, w20, w10, lsl #2
	cmp	w9, #2
	b.eq	LBB0_9
; %bb.7:
	ldr	x10, [x8, #16]
	ldr	w10, [x10]
	cmp	w10, #2
	cset	w10, eq
	orr	w20, w20, w10, lsl #1
	cmp	w9, #3
	b.eq	LBB0_9
; %bb.8:
	ldr	x8, [x8, #24]
	ldr	w8, [x8]
	cmp	w8, #2
	cset	w8, eq
	orr	w20, w20, w8
LBB0_9:
Lloh7:
	adrp	x8, _CMD_ACCESS_IO_WRITE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CMD_ACCESS_IO_WRITE@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	add	x0, sp, #16
	bl	_pcxhr_init_rmh
	mov	w8, #2
	str	w8, [sp, #24]
Lloh10:
	adrp	x8, _IO_NUM_REG_CONFIG_SRC@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IO_NUM_REG_CONFIG_SRC@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	ldr	x9, [sp, #16]
	ldr	w10, [x9]
	orr	w8, w10, w8
	stp	w8, w20, [x9]
LBB0_10:
	ldr	x0, [x19, #8]
	add	x1, sp, #16
	bl	_pcxhr_send_msg
	b	LBB0_12
LBB0_11:
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_13:
	ldr	w21, [x19, #4]
Lloh16:
	adrp	x8, _CMD_ACCESS_IO_WRITE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CMD_ACCESS_IO_WRITE@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	add	x0, sp, #16
	bl	_pcxhr_init_rmh
	mov	w8, #3
	str	w8, [sp, #24]
Lloh19:
	adrp	x8, _IO_NUM_UER_CHIP_REG@GOTPAGE
Lloh20:
	ldr	x8, [x8, _IO_NUM_UER_CHIP_REG@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	ldr	x9, [sp, #16]
	ldr	w10, [x9]
	orr	w8, w10, w8
	stp	w8, w20, [x9]
Lloh22:
	adrp	x8, _CS8420_DATA_FLOW_CTL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _CS8420_DATA_FLOW_CTL@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x20, _CHIP_SIG_AND_MAP_SPI@GOTPAGE
Lloh26:
	ldr	x20, [x20, _CHIP_SIG_AND_MAP_SPI@GOTPAGEOFF]
	ldr	w10, [x20]
	and	w8, w10, w8
	mov	w10, #84
	mov	w22, #65
	cmp	w21, #2
	csel	w10, w22, w10, eq
	orr	w8, w8, w10
	str	w8, [x9, #8]
	ldr	x0, [x19, #8]
	add	x1, sp, #16
	bl	_pcxhr_send_msg
	cbnz	w0, LBB0_12
; %bb.14:
Lloh27:
	adrp	x8, _CS8420_CLOCK_SRC_CTL@GOTPAGE
Lloh28:
	ldr	x8, [x8, _CS8420_CLOCK_SRC_CTL@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	ldr	w9, [x20]
	and	w8, w9, w8
	mov	w9, #73
	cmp	w21, #2
	csel	w9, w22, w9, eq
	orr	w8, w8, w9
	ldr	x9, [sp, #16]
	str	w8, [x9, #8]
	b	LBB0_10
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_PCXHR_SOURCE_AUDIO01_UER,4,2   ; @PCXHR_SOURCE_AUDIO01_UER
	.comm	_CS8420_01_CS,4,2               ; @CS8420_01_CS
	.comm	_PCXHR_SOURCE_AUDIO23_UER,4,2   ; @PCXHR_SOURCE_AUDIO23_UER
	.comm	_CS8420_23_CS,4,2               ; @CS8420_23_CS
	.comm	_PCXHR_SOURCE_AUDIO45_UER,4,2   ; @PCXHR_SOURCE_AUDIO45_UER
	.comm	_CS8420_45_CS,4,2               ; @CS8420_45_CS
	.comm	_PCXHR_SOURCE_AUDIO67_UER,4,2   ; @PCXHR_SOURCE_AUDIO67_UER
	.comm	_CS8420_67_CS,4,2               ; @CS8420_67_CS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CMD_RESYNC_AUDIO_INPUTS,4,2    ; @CMD_RESYNC_AUDIO_INPUTS
	.comm	_CMD_ACCESS_IO_WRITE,4,2        ; @CMD_ACCESS_IO_WRITE
	.comm	_IO_NUM_REG_CONFIG_SRC,4,2      ; @IO_NUM_REG_CONFIG_SRC
	.comm	_IO_NUM_UER_CHIP_REG,4,2        ; @IO_NUM_UER_CHIP_REG
	.comm	_CS8420_DATA_FLOW_CTL,4,2       ; @CS8420_DATA_FLOW_CTL
	.comm	_CHIP_SIG_AND_MAP_SPI,4,2       ; @CHIP_SIG_AND_MAP_SPI
	.comm	_CS8420_CLOCK_SRC_CTL,4,2       ; @CS8420_CLOCK_SRC_CTL
	.no_dead_strip	_pcxhr_set_audio_source
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.pcxhr_set_audio_source
l_switch.table.pcxhr_set_audio_source:
	.quad	_PCXHR_SOURCE_AUDIO01_UER
	.quad	_PCXHR_SOURCE_AUDIO23_UER
	.quad	_PCXHR_SOURCE_AUDIO45_UER
	.quad	_PCXHR_SOURCE_AUDIO67_UER

	.p2align	3                               ; @switch.table.pcxhr_set_audio_source.1
l_switch.table.pcxhr_set_audio_source.1:
	.quad	_CS8420_01_CS
	.quad	_CS8420_23_CS
	.quad	_CS8420_45_CS
	.quad	_CS8420_67_CS

.subsections_via_symbols
