	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_autoexposure
_do_autoexposure:                       ## @do_autoexposure
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	16(%rdi), %rdi
	callq	_v4l2_ctrl_g_ctrl
	movq	%rax, %r14
	movq	16(%rbx), %rdi
	movq	(%rdi), %r12
	movl	(%rbx), %eax
	movslq	%eax, %rsi
	subq	%rsi, %r12
	movq	8(%rdi), %r13
	addq	%rsi, %r13
	movq	_MIN_AVG_LUM@GOTPCREL(%rip), %rcx
	cmpq	%r15, (%rcx)
	jle	LBB0_6
## %bb.1:
	cmpq	%r12, %r14
	jg	LBB0_12
## %bb.2:
	addq	%r14, %rsi
	cmpq	%r12, %rsi
	cmovgeq	%r12, %rsi
	cmpq	%r13, %rsi
	cmovleq	%r13, %rsi
	callq	_v4l2_ctrl_s_ctrl
	movl	(%rbx), %ecx
	movl	8(%rbx), %eax
	movl	%eax, 4(%rbx)
	movl	$1, 8(%rbx)
	cmpl	$1, %eax
	jne	LBB0_3
## %bb.4:
	addl	$2, %ecx
	movl	%ecx, %eax
	jmp	LBB0_5
LBB0_3:
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
LBB0_5:
	movl	%eax, (%rbx)
LBB0_6:
	movq	_MAX_AVG_LUM@GOTPCREL(%rip), %rcx
	cmpq	%r15, (%rcx)
	jge	LBB0_12
## %bb.7:
	cmpq	%r13, %r14
	jl	LBB0_12
## %bb.8:
	cltq
	subq	%rax, %r14
	cmpq	%r12, %r14
	cmovgeq	%r12, %r14
	cmpq	%r13, %r14
	cmovleq	%r13, %r14
	movq	16(%rbx), %rdi
	movq	%r14, %rsi
	callq	_v4l2_ctrl_s_ctrl
	movl	(%rbx), %eax
	movl	8(%rbx), %ecx
	movl	%ecx, 4(%rbx)
	movl	$0, 8(%rbx)
	testl	%ecx, %ecx
	je	LBB0_10
## %bb.9:
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	jmp	LBB0_11
LBB0_10:
	addl	$2, %eax
	movl	%eax, %ecx
LBB0_11:
	movl	%ecx, (%rbx)
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MIN_AVG_LUM,8,3                ## @MIN_AVG_LUM
	.comm	_MAX_AVG_LUM,8,3                ## @MAX_AVG_LUM
	.no_dead_strip	_do_autoexposure
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_autoexposure
_do_autoexposure:                       ; @do_autoexposure
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x19, x0
	ldr	x0, [x0, #16]
	bl	_v4l2_ctrl_g_ctrl
	mov	x21, x0
	ldr	x0, [x19, #16]
	ldr	w8, [x19]
	sxtw	x9, w8
	ldp	x10, x11, [x0]
	sub	x23, x10, x9
	add	x22, x11, x9
Lloh0:
	adrp	x10, _MIN_AVG_LUM@GOTPAGE
Lloh1:
	ldr	x10, [x10, _MIN_AVG_LUM@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x10, x20
	b.le	LBB0_3
; %bb.1:
	cmp	x21, x23
	b.gt	LBB0_5
; %bb.2:
	add	x8, x21, x9
	cmp	x8, x23
	csel	x8, x8, x23, lt
	cmp	x8, x22
	csel	x1, x8, x22, gt
	bl	_v4l2_ctrl_s_ctrl
	ldr	w9, [x19, #8]
	mov	w8, #1
	stp	w9, w8, [x19, #4]
	ldr	w8, [x19]
	add	w10, w8, #2
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	cmp	w9, #1
	csel	w8, w10, w8, eq
	str	w8, [x19]
LBB0_3:
Lloh3:
	adrp	x9, _MAX_AVG_LUM@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MAX_AVG_LUM@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x9, x20
	ccmp	x21, x22, #8, lt
	b.lt	LBB0_5
; %bb.4:
	sub	x8, x21, w8, sxtw
	cmp	x8, x23
	csel	x8, x8, x23, lt
	cmp	x8, x22
	csel	x1, x8, x22, gt
	ldr	x0, [x19, #16]
	bl	_v4l2_ctrl_s_ctrl
	ldr	w8, [x19, #8]
	stp	w8, wzr, [x19, #4]
	ldr	w9, [x19]
	add	w10, w9, #2
	cmp	w9, #0
	cinc	w9, w9, lt
	asr	w9, w9, #1
	cmp	w8, #0
	csel	w9, w10, w9, eq
	str	w9, [x19]
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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MIN_AVG_LUM,8,3                ; @MIN_AVG_LUM
	.comm	_MAX_AVG_LUM,8,3                ; @MAX_AVG_LUM
	.no_dead_strip	_do_autoexposure
.subsections_via_symbols
