	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov965x_set_exposure
_ov965x_set_exposure:                   ## @ov965x_set_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	_V4L2_EXPOSURE_AUTO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	24(%rdi), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.1:
	movq	_REG_COM8@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-36(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_ov965x_read
	testl	%eax, %eax
	js	LBB0_13
## %bb.2:
	movq	_COM8_AEC@GOTPCREL(%rip), %rax
	movq	_COM8_AGC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	cmpl	%r14d, %r15d
	jne	LBB0_4
## %bb.3:
	orl	-36(%rbp), %edx
	jmp	LBB0_5
LBB0_4:
	notl	%edx
	andl	-36(%rbp), %edx
LBB0_5:
	movl	%edx, -36(%rbp)
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_ov965x_write
	testl	%eax, %eax
	js	LBB0_13
LBB0_6:
	cmpl	%r14d, %r15d
	je	LBB0_12
## %bb.7:
	movq	16(%rbx), %rax
	cmpq	$0, 8(%rax)
	je	LBB0_12
## %bb.8:
	imull	$100, (%rax), %eax
	cltd
	idivl	(%rbx)
	movl	%eax, %r15d
	movq	_REG_COM1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edx
	andl	$3, %edx
	movq	%rbx, %rdi
	callq	_ov965x_write
	testl	%eax, %eax
	jne	LBB0_11
## %bb.9:
	movq	_REG_AECH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %eax
	shrl	$2, %eax
	movzbl	%al, %edx
	movq	%rbx, %rdi
	callq	_ov965x_write
	testl	%eax, %eax
	jne	LBB0_11
## %bb.10:
	movq	_REG_AECHM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edx
	shrl	$10, %edx
	andl	$63, %edx
	movq	%rbx, %rdi
	callq	_ov965x_write
LBB0_11:
	movl	(%rbx), %ecx
	imull	%r15d, %ecx
	addl	$50, %ecx
	imulq	$1374389535, %rcx, %rcx         ## imm = 0x51EB851F
	shrq	$37, %rcx
	movq	16(%rbx), %rdx
	movl	%ecx, (%rdx)
	testl	%eax, %eax
	js	LBB0_13
LBB0_12:
	movl	8(%rbx), %edi
	xorl	%esi, %esi
	testl	%r14d, %r14d
	sete	%sil
	callq	_v4l2_ctrl_activate
	xorl	%eax, %eax
LBB0_13:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_EXPOSURE_AUTO,4,2         ## @V4L2_EXPOSURE_AUTO
	.comm	_REG_COM8,4,2                   ## @REG_COM8
	.comm	_COM8_AEC,4,2                   ## @COM8_AEC
	.comm	_COM8_AGC,4,2                   ## @COM8_AGC
	.comm	_REG_COM1,4,2                   ## @REG_COM1
	.comm	_REG_AECH,4,2                   ## @REG_AECH
	.comm	_REG_AECHM,4,2                  ## @REG_AECHM
	.no_dead_strip	_ov965x_set_exposure
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov965x_set_exposure
_ov965x_set_exposure:                   ; @ov965x_set_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	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _V4L2_EXPOSURE_AUTO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_EXPOSURE_AUTO@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	ldr	x8, [x0, #24]
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.1:
Lloh3:
	adrp	x22, _REG_COM8@GOTPAGE
Lloh4:
	ldr	x22, [x22, _REG_COM8@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x20
	bl	_ov965x_read
	tbnz	w0, #31, LBB0_13
; %bb.2:
Lloh5:
	adrp	x8, _COM8_AEC@GOTPAGE
Lloh6:
	ldr	x8, [x8, _COM8_AEC@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _COM8_AGC@GOTPAGE
Lloh9:
	ldr	x9, [x9, _COM8_AGC@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w9, w8
	cmp	w21, w19
	b.ne	LBB0_4
; %bb.3:
	ldr	w9, [sp, #12]
	orr	w2, w8, w9
	b	LBB0_5
LBB0_4:
	ldr	w9, [sp, #12]
	bic	w2, w9, w8
LBB0_5:
	str	w2, [sp, #12]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_ov965x_write
	tbnz	w0, #31, LBB0_13
LBB0_6:
	cmp	w21, w19
	b.eq	LBB0_12
; %bb.7:
	ldr	x8, [x20, #16]
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_12
; %bb.8:
	ldr	w8, [x8]
	mov	w9, #100
	mul	w8, w8, w9
	ldr	w9, [x20]
	sdiv	w21, w8, w9
Lloh11:
	adrp	x8, _REG_COM1@GOTPAGE
Lloh12:
	ldr	x8, [x8, _REG_COM1@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	and	w2, w21, #0x3
	mov	x0, x20
	bl	_ov965x_write
	cbnz	w0, LBB0_11
; %bb.9:
Lloh14:
	adrp	x8, _REG_AECH@GOTPAGE
Lloh15:
	ldr	x8, [x8, _REG_AECH@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	ubfx	w2, w21, #2, #8
	mov	x0, x20
	bl	_ov965x_write
	cbnz	w0, LBB0_11
; %bb.10:
Lloh17:
	adrp	x8, _REG_AECHM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _REG_AECHM@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	ubfx	w2, w21, #10, #6
	mov	x0, x20
	bl	_ov965x_write
LBB0_11:
	ldr	w8, [x20]
	mul	w8, w8, w21
	add	w8, w8, #50
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	umull	x8, w8, w9
	lsr	x8, x8, #37
	ldr	x9, [x20, #16]
	str	w8, [x9]
	tbnz	w0, #31, LBB0_13
LBB0_12:
	ldr	w0, [x20, #8]
	cmp	w19, #0
	cset	w1, eq
	bl	_v4l2_ctrl_activate
	mov	w0, #0
LBB0_13:
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_EXPOSURE_AUTO,4,2         ; @V4L2_EXPOSURE_AUTO
	.comm	_REG_COM8,4,2                   ; @REG_COM8
	.comm	_COM8_AEC,4,2                   ; @COM8_AEC
	.comm	_COM8_AGC,4,2                   ; @COM8_AGC
	.comm	_REG_COM1,4,2                   ; @REG_COM1
	.comm	_REG_AECH,4,2                   ; @REG_AECH
	.comm	_REG_AECHM,4,2                  ; @REG_AECHM
	.no_dead_strip	_ov965x_set_exposure
.subsections_via_symbols
