	.file	"extr_cx231xx-avcore.c_cx231xx_afe_set_input_mux.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	cx231xx_afe_set_input_mux
	.type	cx231xx_afe_set_input_mux, @function
cx231xx_afe_set_input_mux:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	ebx, esi
	sar	ebx, 16
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	DWORD PTR 4[rsp], 0
	test	esi, esi
	jne	.L16
.L2:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L17
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	mov	ebp, esi
	lea	r14, 4[rsp]
	mov	esi, DWORD PTR ADC_INPUT_CH1[rip]
	mov	r13, rdi
	mov	rdx, r14
	sub	r12d, 1
	sar	ebp, 8
	call	afe_read_byte@PLT
	mov	edx, DWORD PTR INPUT_SEL_MASK[rip]
	sal	r12d, 4
	mov	rdi, r13
	mov	esi, DWORD PTR ADC_INPUT_CH1[rip]
	not	edx
	and	edx, DWORD PTR 4[rsp]
	or	r12d, edx
	movzx	edx, r12b
	mov	DWORD PTR 4[rsp], edx
	call	afe_write_byte@PLT
	mov	r12d, eax
	test	ebp, ebp
	je	.L3
	mov	esi, DWORD PTR ADC_INPUT_CH2[rip]
	mov	rdx, r14
	mov	rdi, r13
	sub	ebp, 1
	sal	ebp, 4
	call	afe_read_byte@PLT
	mov	edx, DWORD PTR INPUT_SEL_MASK[rip]
	mov	esi, DWORD PTR ADC_INPUT_CH2[rip]
	mov	rdi, r13
	not	edx
	and	edx, DWORD PTR 4[rsp]
	or	edx, ebp
	movzx	edx, dl
	mov	DWORD PTR 4[rsp], edx
	call	afe_write_byte@PLT
	mov	r12d, eax
.L3:
	test	ebx, ebx
	je	.L2
	mov	esi, DWORD PTR ADC_INPUT_CH3[rip]
	mov	rdx, r14
	mov	rdi, r13
	sub	ebx, 1
	sal	ebx, 4
	call	afe_read_byte@PLT
	mov	edx, DWORD PTR INPUT_SEL_MASK[rip]
	mov	esi, DWORD PTR ADC_INPUT_CH3[rip]
	mov	rdi, r13
	not	edx
	and	edx, DWORD PTR 4[rsp]
	or	edx, ebx
	movzx	edx, dl
	mov	DWORD PTR 4[rsp], edx
	call	afe_write_byte@PLT
	mov	r12d, eax
	jmp	.L2
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	cx231xx_afe_set_input_mux, .-cx231xx_afe_set_input_mux
	.comm	INPUT_SEL_MASK,4,4
	.comm	ADC_INPUT_CH3,4,4
	.comm	ADC_INPUT_CH2,4,4
	.comm	ADC_INPUT_CH1,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_cx231xx-avcore.c_cx231xx_afe_set_input_mux.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	cx231xx_afe_set_input_mux
	.syntax unified
	.arm
	.fpu softvfp
	.type	cx231xx_afe_set_input_mux, %function
cx231xx_afe_set_input_mux:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r3, #0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r2, .L18
	sub	sp, sp, #8
	cmp	r1, r3
	ldr	r2, [r2]
	str	r2, [sp, #4]
	mov	r2,#0
	mov	r4, r1
	str	r3, [sp]
	bne	.L16
.L2:
	ldr	r3, .L18
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L17
	mov	r0, r4
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L16:
	mov	r5, r0
	ldr	r8, .L18+4
	ldr	r7, .L18+8
	mov	r2, sp
	asr	r6, r1, #16
	ldr	r1, [r8]
	bl	afe_read_byte
	ldr	r1, [r7]
	ldr	r2, [sp]
	sub	r3, r4, #1
	bic	r2, r2, r1
	orr	r2, r2, r3, lsl #4
	ldr	r1, [r8]
	and	r2, r2, #255
	mov	r0, r5
	str	r2, [sp]
	bl	afe_write_byte
	asr	r8, r4, #8
	cmp	r8, #0
	mov	r4, r0
	beq	.L3
	ldr	r4, .L18+12
	mov	r2, sp
	ldr	r1, [r4]
	mov	r0, r5
	bl	afe_read_byte
	ldr	r2, [sp]
	ldr	r3, [r7]
	sub	r8, r8, #1
	bic	r2, r2, r3
	orr	r2, r2, r8, lsl #4
	ldr	r1, [r4]
	and	r2, r2, #255
	mov	r0, r5
	str	r2, [sp]
	bl	afe_write_byte
	mov	r4, r0
.L3:
	cmp	r6, #0
	beq	.L2
	ldr	r4, .L18+16
	mov	r2, sp
	ldr	r1, [r4]
	mov	r0, r5
	bl	afe_read_byte
	ldr	r2, [sp]
	ldr	r3, [r7]
	sub	r6, r6, #1
	bic	r2, r2, r3
	orr	r2, r2, r6, lsl #4
	ldr	r1, [r4]
	and	r2, r2, #255
	mov	r0, r5
	str	r2, [sp]
	bl	afe_write_byte
	mov	r4, r0
	b	.L2
.L17:
	bl	__stack_chk_fail
.L19:
	.align	2
.L18:
	.word	.LC0
	.word	ADC_INPUT_CH1
	.word	INPUT_SEL_MASK
	.word	ADC_INPUT_CH2
	.word	ADC_INPUT_CH3
	.size	cx231xx_afe_set_input_mux, .-cx231xx_afe_set_input_mux
	.comm	INPUT_SEL_MASK,4,4
	.comm	ADC_INPUT_CH3,4,4
	.comm	ADC_INPUT_CH2,4,4
	.comm	ADC_INPUT_CH1,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
