	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov965x_update_exposure_ctrl
_ov965x_update_exposure_ctrl:           ## @ov965x_update_exposure_ctrl
	.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	%rdi, %rbx
	movq	40(%rdi), %r14
	leaq	20(%rdi), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	testq	%r14, %r14
	je	LBB0_1
## %bb.2:
	xorl	%edi, %edi
	cmpq	$0, 24(%rbx)
	sete	%dil
	jmp	LBB0_3
LBB0_1:
	movl	$1, %edi
LBB0_3:
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_4
## %bb.9:
	movq	%r15, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
LBB0_4:
	movq	_DEF_CLKRC@GOTPCREL(%rip), %rax
	movq	32(%rbx), %rcx
	movl	(%rcx), %r12d
	addl	(%rax), %r12d
	movl	%r12d, %eax
	sarl	$7, %eax
	incl	%eax
	imull	(%rbx), %eax
	movl	%r12d, %ecx
	andl	$63, %ecx
	addl	%ecx, %ecx
	addl	$2, %ecx
	cltd
	idivl	%ecx
	movl	%eax, %ecx
	movslq	%eax, %rdx
	movl	$3040000000, %eax               ## imm = 0xB532B800
	cmpq	%rax, %rdx
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	ja	LBB0_5
## %bb.6:
	movl	$-1254967296, %eax              ## imm = 0xB532B800
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %r14d
	jmp	LBB0_7
LBB0_5:
	xorl	%r14d, %r14d
LBB0_7:
	movq	24(%rbx), %rax
	movl	(%rax), %r13d
	imull	%r14d, %r13d
	movq	%r14, 8(%rbx)
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addq	$16, %rbx
	leaq	L_.str(%rip), %rcx
	movl	$1, %edi
	movq	%rbx, %rdx
	movl	%r12d, %r8d
	movq	-48(%rbp), %r9                  ## 8-byte Reload
	pushq	%r13
	pushq	%r14
	callq	_v4l2_dbg
	addq	$16, %rsp
	leal	100(%r14), %eax
	imulq	$1374389535, %rax, %rsi         ## imm = 0x51EB851F
	shrq	$37, %rsi
	addl	$-100, %r13d
	movslq	%r13d, %rax
	imulq	$1374389535, %rax, %rdx         ## imm = 0x51EB851F
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$37, %rdx
	addl	%eax, %edx
	movl	%edx, %eax
	subl	%esi, %eax
	movl	%eax, %r8d
	shrl	$31, %r8d
	addl	%eax, %r8d
	sarl	%r8d
	addl	%esi, %r8d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
                                        ## kill: def $edx killed $edx killed $rdx
	movl	$1, %ecx
	callq	_v4l2_ctrl_modify_range
	testq	%rax, %rax
	je	LBB0_8
## %bb.10:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_v4l2_err                       ## TAILCALL
LBB0_8:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DEF_CLKRC,4,2                  ## @DEF_CLKRC
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"clkrc: %#x, fi: %lu, tr: %lu, %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Exposure ctrl range update failed\n"

	.no_dead_strip	_ov965x_update_exposure_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov965x_update_exposure_ctrl
_ov965x_update_exposure_ctrl:           ; @ov965x_update_exposure_ctrl
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x0
	ldr	x19, [x0, #40]
	add	x21, x0, #20
	mov	x0, x21
	bl	_mutex_lock
	cbz	x19, LBB0_3
; %bb.1:
	ldr	x8, [x20, #24]
	cmp	x8, #0
	cset	w0, eq
	bl	_WARN_ON
	cbz	x0, LBB0_4
LBB0_2:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_mutex_unlock
LBB0_3:
	mov	w0, #1
	bl	_WARN_ON
	cbnz	x0, LBB0_2
LBB0_4:
Lloh0:
	adrp	x8, _DEF_CLKRC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DEF_CLKRC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldp	x10, x9, [x20, #24]
	ldr	w9, [x9]
	add	w22, w9, w8
	ldr	w8, [x20]
	asr	w9, w22, #7
	madd	w8, w8, w9, w8
	ubfiz	w9, w22, #1, #6
	add	w9, w9, #2
	sdiv	w8, w8, w9
	sxtw	x23, w8
	mov	w8, #47104
	movk	w8, #46386, lsl #16
	udiv	x24, x8, x23
	ldr	w8, [x10]
	mul	w25, w8, w24
	str	x24, [x20, #8]
	mov	x0, x21
	bl	_mutex_unlock
Lloh3:
	adrp	x8, _debug@GOTPAGE
Lloh4:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x20, x20, #16
Lloh6:
	adrp	x3, l_.str@PAGE
Lloh7:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x20
	mov	x4, x22
	mov	x5, x23
	mov	x6, x24
	mov	x7, x25
	bl	_v4l2_dbg
	add	w8, w24, #100
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	umull	x8, w8, w9
	lsr	x1, x8, #37
	sub	w8, w25, #100
	smull	x8, w8, w9
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w2, w8, w9, asr #5
	sub	w8, w2, w1
	cmp	w8, #0
	cinc	w8, w8, lt
	add	w4, w1, w8, asr #1
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	w3, #1
	bl	_v4l2_ctrl_modify_range
	cbz	x0, LBB0_6
; %bb.5:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_v4l2_err
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_DEF_CLKRC,4,2                  ; @DEF_CLKRC
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"clkrc: %#x, fi: %lu, tr: %lu, %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Exposure ctrl range update failed\n"

	.no_dead_strip	_ov965x_update_exposure_ctrl
.subsections_via_symbols
