	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx231xx_afe_set_input_mux      ## -- Begin function cx231xx_afe_set_input_mux
	.p2align	4, 0x90
_cx231xx_afe_set_input_mux:             ## @cx231xx_afe_set_input_mux
	.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	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$0, -36(%rbp)
	testl	%esi, %esi
	je	LBB0_1
## %bb.2:
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_ADC_INPUT_CH1@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-36(%rbp), %rdx
	callq	_afe_read_byte
	movq	_INPUT_SEL_MASK@GOTPCREL(%rip), %r15
	movzbl	(%r15), %eax
	xorl	$255, %eax
	movzbl	-36(%rbp), %ecx
	andl	%eax, %ecx
	movl	%ebx, %eax
	shll	$4, %eax
	addl	$240, %eax
	movzbl	%al, %edx
	orl	%ecx, %edx
	movl	%edx, -36(%rbp)
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_afe_write_byte
	cmpl	$256, %ebx                      ## imm = 0x100
	jb	LBB0_5
## %bb.3:
	movq	_ADC_INPUT_CH2@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-36(%rbp), %rdx
	movq	%r14, %rdi
	callq	_afe_read_byte
	movzbl	(%r15), %eax
	notl	%eax
	movzbl	-36(%rbp), %ecx
	andl	%eax, %ecx
	movl	%ebx, %edx
	shrl	$4, %edx
	addl	$240, %edx
	andl	$240, %edx
	orl	%ecx, %edx
	movl	%edx, -36(%rbp)
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_afe_write_byte
	cmpl	$65536, %ebx                    ## imm = 0x10000
	jb	LBB0_5
## %bb.4:
	movq	_ADC_INPUT_CH3@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-36(%rbp), %rdx
	movq	%r14, %rdi
	callq	_afe_read_byte
	movzbl	(%r15), %eax
	notl	%eax
	movzbl	-36(%rbp), %ecx
	andl	%eax, %ecx
	shrl	$12, %ebx
	addl	$240, %ebx
	andl	$240, %ebx
	orl	%ecx, %ebx
	movl	%ebx, -36(%rbp)
	movl	(%r12), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_afe_write_byte
	jmp	LBB0_5
LBB0_1:
	xorl	%eax, %eax
LBB0_5:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ADC_INPUT_CH1,4,2              ## @ADC_INPUT_CH1
	.comm	_INPUT_SEL_MASK,4,2             ## @INPUT_SEL_MASK
	.comm	_ADC_INPUT_CH2,4,2              ## @ADC_INPUT_CH2
	.comm	_ADC_INPUT_CH3,4,2              ## @ADC_INPUT_CH3
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx231xx_afe_set_input_mux      ; -- Begin function cx231xx_afe_set_input_mux
	.p2align	2
_cx231xx_afe_set_input_mux:             ; @cx231xx_afe_set_input_mux
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	str	wzr, [sp, #12]
	cbz	w1, LBB0_4
; %bb.1:
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x22, _ADC_INPUT_CH1@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ADC_INPUT_CH1@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	bl	_afe_read_byte
Lloh2:
	adrp	x21, _INPUT_SEL_MASK@GOTPAGE
Lloh3:
	ldr	x21, [x21, _INPUT_SEL_MASK@GOTPAGEOFF]
	ldrb	w8, [x21]
	eor	w8, w8, #0xff
	ldrb	w9, [sp, #12]
	and	w8, w9, w8
	lsl	w9, w20, #4
	add	w9, w9, #240
	and	w9, w9, #0xf0
	orr	w2, w8, w9
	str	w2, [sp, #12]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_afe_write_byte
	cmp	w20, #256
	b.lo	LBB0_5
; %bb.2:
Lloh4:
	adrp	x22, _ADC_INPUT_CH2@GOTPAGE
Lloh5:
	ldr	x22, [x22, _ADC_INPUT_CH2@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x19
	bl	_afe_read_byte
	ldrb	w8, [x21]
	ldrb	w9, [sp, #12]
	lsr	w10, w20, #4
	add	w10, w10, #240
	and	w10, w10, #0xf0
	bic	w8, w9, w8
	orr	w2, w8, w10
	str	w2, [sp, #12]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_afe_write_byte
	cmp	w20, #16, lsl #12               ; =65536
	b.lo	LBB0_5
; %bb.3:
Lloh6:
	adrp	x22, _ADC_INPUT_CH3@GOTPAGE
Lloh7:
	ldr	x22, [x22, _ADC_INPUT_CH3@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x19
	bl	_afe_read_byte
	ldrb	w8, [x21]
	ldrb	w9, [sp, #12]
	lsr	w10, w20, #12
	add	w10, w10, #240
	and	w10, w10, #0xf0
	bic	w8, w9, w8
	orr	w2, w8, w10
	str	w2, [sp, #12]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_afe_write_byte
	b	LBB0_5
LBB0_4:
	mov	w0, #0
LBB0_5:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_ADC_INPUT_CH1,4,2              ; @ADC_INPUT_CH1
	.comm	_INPUT_SEL_MASK,4,2             ; @INPUT_SEL_MASK
	.comm	_ADC_INPUT_CH2,4,2              ; @ADC_INPUT_CH2
	.comm	_ADC_INPUT_CH3,4,2              ; @ADC_INPUT_CH3
.subsections_via_symbols
