	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setexposure
_setexposure:                           ## @setexposure
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movl	(%rdi), %eax
	movq	_EXPOSURE_IDX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	btl	%ecx, %eax
	jae	LBB0_1
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	_CAM_TYPE_CIF@GOTPCREL(%rip), %rdx
	movl	8(%rdi), %ecx
	cmpq	(%rdx), %rax
	jne	LBB0_6
## %bb.2:
	cmpl	$1, %ecx
	jne	LBB0_6
## %bb.3:
	imull	$9267, 12(%rbx), %eax           ## imm = 0x2433
	cltq
	imulq	$1759218605, %rax, %rax         ## imm = 0x68DB8BAD
	movq	%rax, %rcx
	sarq	$44, %rcx
	shrq	$63, %rax
	leal	(%rcx,%rax), %r14d
	addl	$300, %r14d                     ## imm = 0x12C
	movl	%r14d, %edx
	sarl	$4, %edx
	movq	%rbx, %rdi
	movl	$3, %esi
	callq	_sensor_write1
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_12
## %bb.4:
	andl	$15, %r14d
	movq	%rbx, %rdi
	movl	$4, %esi
	movl	%r14d, %edx
	jmp	LBB0_5
LBB0_6:
	movl	12(%rbx), %r15d
	cmpl	$2, %ecx
	jne	LBB0_9
## %bb.7:
	movl	%r15d, %edx
	sarl	$11, %edx
	movq	%rbx, %rdi
	movl	$3, %esi
	callq	_sensor_write1
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_12
## %bb.8:
	shrl	$3, %r15d
	movzbl	%r15b, %edx
	movq	%rbx, %rdi
	movl	$4, %esi
LBB0_5:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sensor_write1                  ## TAILCALL
LBB0_9:
	movq	%rax, %rcx
	shrq	$32, %rcx
	imull	$60, %r15d, %edx
	addl	$7999, %edx                     ## imm = 0x1F3F
	movslq	%edx, %rdx
	imulq	$274877907, %rdx, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rsi
	shrq	$63, %rsi
	sarq	$41, %rdx
	addl	%esi, %edx
	cmpl	$3, %edx
	movl	$2, %esi
	cmovgel	%edx, %esi
	movl	16(%rbx), %edi
	cmpl	$320, %ecx                      ## imm = 0x140
	movl	%esi, %ecx
	cmovgel	%edi, %ecx
	cmpl	%edi, %edx
	cmovgel	%esi, %ecx
	movq	_CAM_TYPE_VGA@GOTPCREL(%rip), %rdx
	cmpl	$4, %ecx
	movl	$4, %r14d
	cmovgel	%ecx, %r14d
	cmpq	(%rdx), %rax
	cmovnel	%ecx, %r14d
	imull	$30660, %r15d, %eax             ## imm = 0x77C4
	imull	$8000, %r14d, %ecx              ## imm = 0x1F40
	cltd
	idivl	%ecx
	cmpl	$511, %eax                      ## imm = 0x1FF
	movl	$511, %ecx                      ## imm = 0x1FF
	cmovgel	%ecx, %eax
	subl	%eax, %ecx
	movzbl	%cl, %eax
	movl	%eax, -40(%rbp)
	shrl	$8, %ecx
	movl	%ecx, -36(%rbp)
	leaq	-40(%rbp), %rcx
	movq	%rbx, %rdi
	movl	$14, %esi
	xorl	%edx, %edx
	movl	$2, %r8d
	callq	_sensor_write_reg
	movq	%rbx, %rdi
	movl	$2, %esi
	movl	%r14d, %edx
	callq	_sensor_write1
	jmp	LBB0_10
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MR97310A_EXPOSURE_DEFAULT,4,2  ## @MR97310A_EXPOSURE_DEFAULT
	.comm	_EXPOSURE_IDX,4,2               ## @EXPOSURE_IDX
	.comm	_CAM_TYPE_CIF,8,3               ## @CAM_TYPE_CIF
	.comm	_CAM_TYPE_VGA,8,3               ## @CAM_TYPE_VGA
	.no_dead_strip	_setexposure
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setexposure
_setexposure:                           ; @setexposure
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #8]
	ldr	w8, [x0]
Lloh3:
	adrp	x9, _EXPOSURE_IDX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EXPOSURE_IDX@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	lsr	w8, w8, w9
	tbz	w8, #0, LBB0_3
LBB0_1:
	ldr	x8, [sp, #8]
Lloh6:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh7:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.2:
	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
LBB0_3:
	mov	x19, x0
	ldr	x8, [x0]
Lloh9:
	adrp	x9, _CAM_TYPE_CIF@GOTPAGE
Lloh10:
	ldr	x9, [x9, _CAM_TYPE_CIF@GOTPAGEOFF]
Lloh11:
	ldr	x10, [x9]
	ldr	w9, [x0, #8]
	cmp	x8, x10
	ccmp	w9, #1, #0, eq
	b.eq	LBB0_7
; %bb.4:
	ldr	w21, [x19, #12]
	cmp	w9, #2
	b.ne	LBB0_10
; %bb.5:
	asr	w2, w21, #11
	mov	x0, x19
	mov	w1, #3
	bl	_sensor_write1
	ldr	x8, [sp, #8]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.6:
	ubfx	w2, w21, #3, #8
	b	LBB0_9
LBB0_7:
	ldr	w8, [x19, #12]
	mov	w9, #9267
	mul	w8, w8, w9
	mov	w9, #35757
	movk	w9, #26843, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #44
	add	w8, w8, w9
	add	w20, w8, #300
	asr	w2, w20, #4
	mov	x0, x19
	mov	w1, #3
	bl	_sensor_write1
	ldr	x8, [sp, #8]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.8:
	and	w2, w20, #0xf
LBB0_9:
	mov	x0, x19
	mov	w1, #4
	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
	b	_sensor_write1
LBB0_10:
	lsr	x9, x8, #32
	mov	w10, #60
	mov	w11, #7999
	madd	w10, w21, w10, w11
	mov	w11, #19923
	movk	w11, #4194, lsl #16
	smull	x10, w10, w11
	lsr	x11, x10, #63
	asr	x10, x10, #41
	add	w10, w10, w11
	ldr	w11, [x19, #16]
	mov	w12, #2
	cmp	w10, #2
	csel	w12, w10, w12, gt
	cmp	w9, #319
	ccmp	w10, w11, #0, gt
	csel	w9, w11, w12, lt
Lloh18:
	adrp	x10, _CAM_TYPE_VGA@GOTPAGE
Lloh19:
	ldr	x10, [x10, _CAM_TYPE_VGA@GOTPAGEOFF]
Lloh20:
	ldr	x10, [x10]
	cmp	w9, #4
	ccmp	x8, x10, #0, lt
	mov	w8, #4
	csel	w20, w8, w9, eq
	mov	w8, #30660
	mul	w8, w21, w8
	mov	w9, #8000
	mul	w9, w20, w9
	sdiv	w8, w8, w9
	mov	w9, #511
	cmp	w8, #511
	csel	w8, w8, w9, lt
	sub	w8, w9, w8
	and	w9, w8, #0xff
	lsr	w8, w8, #8
	stp	w9, w8, [sp]
	mov	x3, sp
	mov	x0, x19
	mov	w1, #14
	mov	w2, #0
	mov	w4, #2
	bl	_sensor_write_reg
	mov	x0, x19
	mov	w1, #2
	mov	x2, x20
	bl	_sensor_write1
	b	LBB0_1
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_MR97310A_EXPOSURE_DEFAULT,4,2  ; @MR97310A_EXPOSURE_DEFAULT
	.comm	_EXPOSURE_IDX,4,2               ; @EXPOSURE_IDX
	.comm	_CAM_TYPE_CIF,8,3               ; @CAM_TYPE_CIF
	.comm	_CAM_TYPE_VGA,8,3               ; @CAM_TYPE_VGA
	.no_dead_strip	_setexposure
.subsections_via_symbols
