	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx2341x_ext_ctrls              ## -- Begin function cx2341x_ext_ctrls
	.p2align	4, 0x90
_cx2341x_ext_ctrls:                     ## @cx2341x_ext_ctrls
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rdi, %r14
	movq	_VIDIOC_G_EXT_CTRLS@GOTPCREL(%rip), %rax
	movl	(%rdx), %edx
	cmpl	%ecx, (%rax)
	jne	LBB0_1
## %bb.3:
	testl	%edx, %edx
	jle	LBB0_22
## %bb.4:
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rsi
	addq	%rbx, %rsi
	movq	%r14, %rdi
	callq	_cx2341x_get_ctrl
	testl	%eax, %eax
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	incq	%r15
	movslq	(%r13), %rax
	addq	$4, %rbx
	cmpq	%rax, %r15
	jl	LBB0_5
	jmp	LBB0_22
LBB0_1:
	testl	%edx, %edx
	jle	LBB0_2
## %bb.8:
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rbx
	movl	(%rbx,%r12,4), %eax
	movl	%eax, -56(%rbp)
	movq	%r14, %rdi
	leaq	-64(%rbp), %rsi
	callq	_cx2341x_ctrl_query
	testl	%eax, %eax
	jne	LBB0_20
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	addq	%r15, %rbx
	movq	-64(%rbp), %rax
	movq	_V4L2_CTRL_TYPE_MENU@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	-56(%rbp), %esi
	movq	%r14, %rdi
	callq	_cx2341x_ctrl_get_menu
	movq	%rax, %rdx
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	xorl	%edx, %edx
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%rbx, %rdi
	leaq	-64(%rbp), %rsi
	callq	_v4l2_ctrl_check
	testl	%eax, %eax
	jne	LBB0_20
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	%rbx, %rdx
	callq	_cx2341x_set_ctrl
	testl	%eax, %eax
	jne	LBB0_20
## %bb.15:                              ##   in Loop: Header=BB0_9 Depth=1
	incq	%r12
	movslq	(%r13), %rdx
	addq	$4, %r15
	cmpq	%rdx, %r12
	jl	LBB0_9
	jmp	LBB0_16
LBB0_2:
	xorl	%r12d, %r12d
LBB0_16:
	movq	(%r14), %rax
	movq	_V4L2_MPEG_VIDEO_BITRATE_MODE_VBR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_21
## %bb.17:
	movq	8(%r14), %rax
	cmpq	16(%r14), %rax
	jge	LBB0_21
## %bb.18:
	movq	_ERANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%edx, 4(%r13)
	testl	%eax, %eax
	je	LBB0_21
## %bb.19:
	negl	%eax
LBB0_20:
	movl	%r12d, 4(%r13)
	jmp	LBB0_23
LBB0_21:
	movq	%r14, %rdi
	callq	_cx2341x_calc_audio_properties
LBB0_22:
	xorl	%eax, %eax
	jmp	LBB0_23
LBB0_6:
	movl	%r15d, 4(%r13)
LBB0_23:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VIDIOC_G_EXT_CTRLS,4,2         ## @VIDIOC_G_EXT_CTRLS
	.comm	_V4L2_CTRL_TYPE_MENU,8,3        ## @V4L2_CTRL_TYPE_MENU
	.comm	_V4L2_MPEG_VIDEO_BITRATE_MODE_VBR,8,3 ## @V4L2_MPEG_VIDEO_BITRATE_MODE_VBR
	.comm	_ERANGE,4,2                     ## @ERANGE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx2341x_ext_ctrls              ; -- Begin function cx2341x_ext_ctrls
	.p2align	2
_cx2341x_ext_ctrls:                     ; @cx2341x_ext_ctrls
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x2
	mov	x20, x0
Lloh0:
	adrp	x8, _VIDIOC_G_EXT_CTRLS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VIDIOC_G_EXT_CTRLS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
	ldr	w8, [x2]
	cmp	w9, w3
	b.ne	LBB0_5
; %bb.1:
	cmp	w8, #1
	b.lt	LBB0_21
; %bb.2:
	mov	x22, #0
	mov	x21, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x1, x8, x22
	mov	x0, x20
	bl	_cx2341x_get_ctrl
	cbnz	w0, LBB0_22
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x19]
	add	x22, x22, #4
	cmp	x21, x8
	b.lt	LBB0_3
	b	LBB0_21
LBB0_5:
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.6:
	mov	x21, x1
	mov	x24, #0
	mov	x23, #0
Lloh3:
	adrp	x25, _V4L2_CTRL_TYPE_MENU@GOTPAGE
Lloh4:
	ldr	x25, [x25, _V4L2_CTRL_TYPE_MENU@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x22, [x19, #8]
	ldr	w8, [x22, x23, lsl #2]
	str	w8, [sp, #8]
	mov	x1, sp
	mov	x0, x20
	bl	_cx2341x_ctrl_query
	cbnz	w0, LBB0_19
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [sp]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w1, [sp, #8]
	mov	x0, x20
	bl	_cx2341x_ctrl_get_menu
	mov	x2, x0
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x2, #0
LBB0_11:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x22, x22, x24
	mov	x1, sp
	mov	x0, x22
	bl	_v4l2_ctrl_check
	cbnz	w0, LBB0_19
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	_cx2341x_set_ctrl
	cbnz	w0, LBB0_19
; %bb.13:                               ;   in Loop: Header=BB0_7 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x19]
	add	x24, x24, #4
	cmp	x23, x8
	b.lt	LBB0_7
	b	LBB0_15
LBB0_14:
	mov	w23, #0
LBB0_15:
	ldr	x9, [x20]
Lloh5:
	adrp	x10, _V4L2_MPEG_VIDEO_BITRATE_MODE_VBR@GOTPAGE
Lloh6:
	ldr	x10, [x10, _V4L2_MPEG_VIDEO_BITRATE_MODE_VBR@GOTPAGEOFF]
Lloh7:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_20
; %bb.16:
	ldp	x9, x10, [x20, #8]
	cmp	x9, x10
	b.ge	LBB0_20
; %bb.17:
Lloh8:
	adrp	x9, _ERANGE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ERANGE@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	str	w8, [x19, #4]
	cbz	w9, LBB0_20
; %bb.18:
	neg	w0, w9
LBB0_19:
	str	w23, [x19, #4]
	b	LBB0_23
LBB0_20:
	mov	x0, x20
	bl	_cx2341x_calc_audio_properties
LBB0_21:
	mov	w0, #0
	b	LBB0_23
LBB0_22:
	str	w21, [x19, #4]
LBB0_23:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_VIDIOC_G_EXT_CTRLS,4,2         ; @VIDIOC_G_EXT_CTRLS
	.comm	_V4L2_CTRL_TYPE_MENU,8,3        ; @V4L2_CTRL_TYPE_MENU
	.comm	_V4L2_MPEG_VIDEO_BITRATE_MODE_VBR,8,3 ; @V4L2_MPEG_VIDEO_BITRATE_MODE_VBR
	.comm	_ERANGE,4,2                     ; @ERANGE
.subsections_via_symbols
