	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov5640_set_ae_target
_ov5640_set_ae_target:                  ## @ov5640_set_ae_target
	.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
                                        ## kill: def $esi killed $esi def $rsi
	movq	%rdi, %r14
	leal	(%rsi,%rsi,2), %eax
	shll	$3, %eax
	subl	%esi, %eax
	cltq
	imulq	$1374389535, %rax, %rbx         ## imm = 0x51EB851F
	movq	%rbx, %rax
	shrq	$63, %rax
	sarq	$35, %rbx
	addl	%eax, %ebx
	movl	%ebx, (%rdi)
	leal	(%rsi,%rsi,8), %eax
	leal	(%rax,%rax,2), %eax
	cltq
	imulq	$1374389535, %rax, %rdx         ## imm = 0x51EB851F
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$35, %rdx
	addl	%eax, %edx
	movl	%edx, 4(%rdi)
	leal	(%rdx,%rdx), %eax
	cmpl	$255, %eax
	movl	$255, %r15d
	cmovll	%eax, %r15d
	movq	_OV5640_REG_AEC_CTRL0F@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_ov5640_write_reg
	testl	%eax, %eax
	jne	LBB0_5
## %bb.1:
	movq	_OV5640_REG_AEC_CTRL10@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %edx
	movq	%r14, %rdi
	callq	_ov5640_write_reg
	testl	%eax, %eax
	jne	LBB0_5
## %bb.2:
	movq	_OV5640_REG_AEC_CTRL1B@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r14), %edx
	movq	%r14, %rdi
	callq	_ov5640_write_reg
	testl	%eax, %eax
	jne	LBB0_5
## %bb.3:
	movq	_OV5640_REG_AEC_CTRL1E@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %edx
	movq	%r14, %rdi
	callq	_ov5640_write_reg
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movq	_OV5640_REG_AEC_CTRL11@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_ov5640_write_reg
	testl	%eax, %eax
	je	LBB0_6
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	sarl	%ebx
	movq	_OV5640_REG_AEC_CTRL1F@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ov5640_write_reg               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_OV5640_REG_AEC_CTRL0F,4,2      ## @OV5640_REG_AEC_CTRL0F
	.comm	_OV5640_REG_AEC_CTRL10,4,2      ## @OV5640_REG_AEC_CTRL10
	.comm	_OV5640_REG_AEC_CTRL1B,4,2      ## @OV5640_REG_AEC_CTRL1B
	.comm	_OV5640_REG_AEC_CTRL1E,4,2      ## @OV5640_REG_AEC_CTRL1E
	.comm	_OV5640_REG_AEC_CTRL11,4,2      ## @OV5640_REG_AEC_CTRL11
	.comm	_OV5640_REG_AEC_CTRL1F,4,2      ## @OV5640_REG_AEC_CTRL1F
	.no_dead_strip	_ov5640_set_ae_target
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov5640_set_ae_target
_ov5640_set_ae_target:                  ; @ov5640_set_ae_target
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x0
	mov	w8, #23
	mul	w8, w1, w8
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	smull	x8, w8, w9
	lsr	x10, x8, #63
	asr	x8, x8, #35
	add	w21, w8, w10
	mov	w8, #27
	mul	w8, w1, w8
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #35
	add	w2, w8, w9
	stp	w21, w2, [x0]
	lsl	w8, w2, #1
	mov	w9, #255
	cmp	w8, #255
	csel	w20, w8, w9, lt
Lloh0:
	adrp	x8, _OV5640_REG_AEC_CTRL0F@GOTPAGE
Lloh1:
	ldr	x8, [x8, _OV5640_REG_AEC_CTRL0F@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_ov5640_write_reg
	cbnz	w0, LBB0_5
; %bb.1:
Lloh3:
	adrp	x8, _OV5640_REG_AEC_CTRL10@GOTPAGE
Lloh4:
	ldr	x8, [x8, _OV5640_REG_AEC_CTRL10@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	ldr	w2, [x19]
	mov	x0, x19
	bl	_ov5640_write_reg
	cbnz	w0, LBB0_5
; %bb.2:
Lloh6:
	adrp	x8, _OV5640_REG_AEC_CTRL1B@GOTPAGE
Lloh7:
	ldr	x8, [x8, _OV5640_REG_AEC_CTRL1B@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldr	w2, [x19, #4]
	mov	x0, x19
	bl	_ov5640_write_reg
	cbnz	w0, LBB0_5
; %bb.3:
Lloh9:
	adrp	x8, _OV5640_REG_AEC_CTRL1E@GOTPAGE
Lloh10:
	ldr	x8, [x8, _OV5640_REG_AEC_CTRL1E@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	ldr	w2, [x19]
	mov	x0, x19
	bl	_ov5640_write_reg
	cbnz	w0, LBB0_5
; %bb.4:
Lloh12:
	adrp	x8, _OV5640_REG_AEC_CTRL11@GOTPAGE
Lloh13:
	ldr	x8, [x8, _OV5640_REG_AEC_CTRL11@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_ov5640_write_reg
	cbz	w0, LBB0_6
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
	asr	w2, w21, #1
Lloh15:
	adrp	x8, _OV5640_REG_AEC_CTRL1F@GOTPAGE
Lloh16:
	ldr	x8, [x8, _OV5640_REG_AEC_CTRL1F@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_ov5640_write_reg
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_OV5640_REG_AEC_CTRL0F,4,2      ; @OV5640_REG_AEC_CTRL0F
	.comm	_OV5640_REG_AEC_CTRL10,4,2      ; @OV5640_REG_AEC_CTRL10
	.comm	_OV5640_REG_AEC_CTRL1B,4,2      ; @OV5640_REG_AEC_CTRL1B
	.comm	_OV5640_REG_AEC_CTRL1E,4,2      ; @OV5640_REG_AEC_CTRL1E
	.comm	_OV5640_REG_AEC_CTRL11,4,2      ; @OV5640_REG_AEC_CTRL11
	.comm	_OV5640_REG_AEC_CTRL1F,4,2      ; @OV5640_REG_AEC_CTRL1F
	.no_dead_strip	_ov5640_set_ae_target
.subsections_via_symbols
