	.file	"extr_cx2341x.c_cx2341x_ext_ctrls.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	cx2341x_ext_ctrls
	.type	cx2341x_ext_ctrls, @function
cx2341x_ext_ctrls:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xor	ebx, ebx
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	DWORD PTR 12[rsp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	cmp	DWORD PTR VIDIOC_G_EXT_CTRLS[rip], ecx
	mov	eax, DWORD PTR [rdx]
	je	.L28
	lea	r13, 16[rsp]
	xor	r14d, r14d
	test	eax, eax
	jg	.L9
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rsi, r13
	mov	rdi, r15
	call	v4l2_ctrl_check@PLT
	test	eax, eax
	jne	.L11
.L29:
	mov	esi, DWORD PTR 12[rsp]
	mov	rdx, r15
	mov	rdi, r12
	call	cx2341x_set_ctrl@PLT
	test	eax, eax
	jne	.L11
	mov	r14d, DWORD PTR 8[rsp]
	add	rbx, 1
	add	r14d, 1
	cmp	DWORD PTR 0[rbp], ebx
	jle	.L10
.L9:
	mov	rax, QWORD PTR 8[rbp]
	mov	rsi, r13
	mov	rdi, r12
	mov	DWORD PTR 8[rsp], ebx
	mov	r14d, ebx
	lea	r15, [rax+rbx*4]
	mov	eax, DWORD PTR [r15]
	mov	DWORD PTR 24[rsp], eax
	call	cx2341x_ctrl_query@PLT
	test	eax, eax
	jne	.L11
	mov	rax, QWORD PTR V4L2_CTRL_TYPE_MENU[rip]
	xor	edx, edx
	cmp	QWORD PTR 16[rsp], rax
	jne	.L8
	mov	esi, DWORD PTR 24[rsp]
	mov	rdi, r12
	call	cx2341x_ctrl_get_menu@PLT
	mov	rsi, r13
	mov	rdi, r15
	mov	rdx, rax
	call	v4l2_ctrl_check@PLT
	test	eax, eax
	je	.L29
	.p2align 4,,10
	.p2align 3
.L11:
	mov	DWORD PTR 4[rbp], r14d
.L1:
	mov	rcx, QWORD PTR 40[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L30
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	mov	rax, QWORD PTR V4L2_MPEG_VIDEO_BITRATE_MODE_VBR[rip]
	cmp	QWORD PTR [r12], rax
	je	.L31
.L12:
	mov	rdi, r12
	call	cx2341x_calc_audio_properties@PLT
.L26:
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L28:
	test	eax, eax
	jg	.L3
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L5:
	add	rbx, 1
	cmp	DWORD PTR 0[rbp], ebx
	jle	.L26
.L3:
	mov	rax, QWORD PTR 8[rbp]
	mov	rdi, r12
	lea	rsi, [rax+rbx*4]
	call	cx2341x_get_ctrl@PLT
	test	eax, eax
	je	.L5
	mov	DWORD PTR 4[rbp], ebx
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L31:
	mov	rax, QWORD PTR 16[r12]
	cmp	QWORD PTR 8[r12], rax
	jge	.L12
	mov	edx, DWORD PTR ERANGE[rip]
	mov	ecx, DWORD PTR 0[rbp]
	mov	eax, edx
	mov	DWORD PTR 4[rbp], ecx
	neg	eax
	test	edx, edx
	jne	.L11
	jmp	.L12
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	cx2341x_ext_ctrls, .-cx2341x_ext_ctrls
	.comm	VIDIOC_G_EXT_CTRLS,4,4
	.comm	V4L2_MPEG_VIDEO_BITRATE_MODE_VBR,8,8
	.comm	V4L2_CTRL_TYPE_MENU,8,8
	.comm	ERANGE,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_cx2341x.c_cx2341x_ext_ctrls.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	cx2341x_ext_ctrls
	.syntax unified
	.arm
	.fpu softvfp
	.type	cx2341x_ext_ctrls, %function
cx2341x_ext_ctrls:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r5, r2
	ldr	r2, .L29
	sub	sp, sp, #20
	ldr	r2, [r2]
	mov	r6, r0
	cmp	r2, r3
	ldr	r3, .L29+4
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	ldr	r3, [r5]
	beq	.L26
	cmp	r3, #0
	movle	r4, #0
	ble	.L10
	mov	r7, r1
	mov	r4, #0
	ldr	r8, .L29+8
	b	.L9
.L8:
	mov	r0, r9
	add	r1, sp, #4
	bl	v4l2_ctrl_check
	subs	r2, r0, #0
	bne	.L11
	mov	r2, r9
	mov	r1, r7
	mov	r0, r6
	bl	cx2341x_set_ctrl
	subs	r2, r0, #0
	bne	.L11
	ldr	r3, [r5]
	add	r4, r4, #1
	cmp	r3, r4
	ble	.L10
.L9:
	ldr	r9, [r5, #8]
	mov	r0, r6
	ldr	r3, [r9, r4, lsl #2]
	add	r1, sp, #4
	str	r3, [sp, #8]
	bl	cx2341x_ctrl_query
	subs	r2, r0, #0
	add	r9, r9, r4, lsl #2
	bne	.L11
	ldr	r1, [sp, #4]
	ldr	r3, [r8]
	cmp	r1, r3
	bne	.L8
	mov	r0, r6
	ldr	r1, [sp, #8]
	bl	cx2341x_ctrl_get_menu
	mov	r2, r0
	b	.L8
.L28:
	ldmib	r6, {r1, r2}
	cmp	r1, r2
	bge	.L12
	ldr	r2, .L29+12
	str	r3, [r5, #4]
	ldr	r0, [r2]
	cmp	r0, #0
	rsb	r2, r0, #0
	beq	.L12
.L11:
	str	r4, [r5, #4]
.L1:
	ldr	r3, .L29+4
	ldr	r1, [r3]
	ldr	r3, [sp, #12]
	eors	r1, r3, r1
	mov	r3, #0
	bne	.L27
	mov	r0, r2
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L10:
	ldr	r2, .L29+16
	ldr	r1, [r6]
	ldr	r2, [r2]
	cmp	r1, r2
	beq	.L28
.L12:
	mov	r0, r6
	bl	cx2341x_calc_audio_properties
.L24:
	mov	r2, #0
	b	.L1
.L26:
	cmp	r3, #0
	movgt	r4, #0
	bgt	.L3
	b	.L24
.L5:
	ldr	r3, [r5]
	add	r4, r4, #1
	cmp	r3, r4
	ble	.L24
.L3:
	ldr	r1, [r5, #8]
	mov	r0, r6
	add	r1, r1, r4, lsl #2
	bl	cx2341x_get_ctrl
	subs	r2, r0, #0
	beq	.L5
	b	.L11
.L27:
	bl	__stack_chk_fail
.L30:
	.align	2
.L29:
	.word	VIDIOC_G_EXT_CTRLS
	.word	.LC0
	.word	V4L2_CTRL_TYPE_MENU
	.word	ERANGE
	.word	V4L2_MPEG_VIDEO_BITRATE_MODE_VBR
	.size	cx2341x_ext_ctrls, .-cx2341x_ext_ctrls
	.comm	VIDIOC_G_EXT_CTRLS,4,4
	.comm	V4L2_MPEG_VIDEO_BITRATE_MODE_VBR,4,4
	.comm	V4L2_CTRL_TYPE_MENU,4,4
	.comm	ERANGE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
