	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov5640_set_ctrl_exposure
_ov5640_set_ctrl_exposure:              ## @ov5640_set_ctrl_exposure
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_V4L2_EXPOSURE_AUTO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	8(%rdi), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	xorl	%esi, %esi
	cmpl	%r15d, %ebx
	sete	%sil
	movq	%r14, %rdi
	callq	_ov5640_set_autoexposure
	testl	%eax, %eax
	jne	LBB0_10
## %bb.3:
	cmpl	%r15d, %ebx
	jne	LBB0_4
	jmp	LBB0_10
LBB0_2:
	xorl	%eax, %eax
	cmpl	%r15d, %ebx
	je	LBB0_10
LBB0_4:
	movq	(%r14), %rax
	cmpq	$0, 8(%rax)
	je	LBB0_5
## %bb.6:
	movq	_OV5640_REG_AEC_PK_VTS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rdx
	movq	%r14, %rdi
	callq	_ov5640_read_reg16
	testl	%eax, %eax
	jne	LBB0_10
## %bb.7:
	movq	%r14, %rdi
	callq	_ov5640_get_vts
	testl	%eax, %eax
	js	LBB0_10
## %bb.8:
	movl	%eax, %ecx
	addq	-32(%rbp), %rcx
	movq	%rcx, -32(%rbp)
	movq	(%r14), %rax
	movq	(%rax), %rsi
	xorl	%eax, %eax
	cmpq	%rcx, %rsi
	jge	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	callq	_ov5640_set_exposure
	jmp	LBB0_10
LBB0_5:
	xorl	%eax, %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_EXPOSURE_AUTO,4,2         ## @V4L2_EXPOSURE_AUTO
	.comm	_OV5640_REG_AEC_PK_VTS,4,2      ## @OV5640_REG_AEC_PK_VTS
	.no_dead_strip	_ov5640_set_ctrl_exposure
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov5640_set_ctrl_exposure
_ov5640_set_ctrl_exposure:              ; @ov5640_set_ctrl_exposure
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _V4L2_EXPOSURE_AUTO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_EXPOSURE_AUTO@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	ldr	x8, [x0, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
	cmp	w21, w20
	cset	w1, eq
	mov	x0, x19
	bl	_ov5640_set_autoexposure
	cmp	w0, #0
	ccmp	w21, w20, #4, eq
	b.ne	LBB0_3
	b	LBB0_9
LBB0_2:
	cmp	w21, w20
	b.eq	LBB0_8
LBB0_3:
	ldr	x8, [x19]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_8
; %bb.4:
Lloh3:
	adrp	x8, _OV5640_REG_AEC_PK_VTS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _OV5640_REG_AEC_PK_VTS@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_ov5640_read_reg16
	cbnz	w0, LBB0_9
; %bb.5:
	mov	x0, x19
	bl	_ov5640_get_vts
	tbnz	w0, #31, LBB0_9
; %bb.6:
	ldr	x8, [sp, #8]
	add	x8, x8, w0, uxtw
	str	x8, [sp, #8]
	ldr	x9, [x19]
	ldr	x1, [x9]
	cmp	x1, x8
	b.ge	LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_ov5640_set_exposure
	b	LBB0_9
LBB0_8:
	mov	w0, #0
LBB0_9:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_EXPOSURE_AUTO,4,2         ; @V4L2_EXPOSURE_AUTO
	.comm	_OV5640_REG_AEC_PK_VTS,4,2      ; @OV5640_REG_AEC_PK_VTS
	.no_dead_strip	_ov5640_set_ctrl_exposure
.subsections_via_symbols
