	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov7675_set_framerate
_ov7675_set_framerate:                  ## @ov7675_set_framerate
	.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
	movq	%rsi, %r15
	movq	%rdi, %r14
	callq	_to_state
	movq	%rax, %rbx
	movl	(%r15), %eax
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movl	4(%r15), %ecx
	testl	%ecx, %ecx
	je	LBB0_3
## %bb.2:
	cmpq	$0, 24(%rbx)
	movq	_PLL_FACTOR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	leal	(%rdx,%rdx,4), %edx
	movl	$5, %esi
	cmovel	%edx, %esi
	imull	(%rbx), %eax
	imull	%esi, %eax
	shll	$2, %ecx
	cltd
	idivl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	movq	16(%rbx), %rcx
	movq	(%rcx), %rcx
	movq	_MEDIA_BUS_FMT_SBGGR8_1X8@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	sete	%cl
	shll	%cl, %eax
	leal	-1(%rax), %edx
	movq	_CLK_SCALE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %edx
	cmovll	%edx, %ecx
	cmpl	$1, %eax
	jg	LBB0_4
LBB0_3:
	movq	_CLK_EXT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_4:
	movl	%ecx, 4(%rbx)
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_ov7675_get_framerate
	cmpq	$0, 8(%rbx)
	je	LBB0_5
## %bb.6:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ov7675_apply_framerate         ## TAILCALL
LBB0_5:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PLL_FACTOR,4,2                 ## @PLL_FACTOR
	.comm	_MEDIA_BUS_FMT_SBGGR8_1X8,8,3   ## @MEDIA_BUS_FMT_SBGGR8_1X8
	.comm	_CLK_EXT,4,2                    ## @CLK_EXT
	.comm	_CLK_SCALE,4,2                  ## @CLK_SCALE
	.no_dead_strip	_ov7675_set_framerate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov7675_set_framerate
_ov7675_set_framerate:                  ; @ov7675_set_framerate
	.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	x20, x1
	mov	x19, x0
	bl	_to_state
	mov	x21, x0
	ldr	w8, [x20]
	cbz	w8, LBB0_3
; %bb.1:
	ldr	w9, [x20, #4]
	cbz	w9, LBB0_3
; %bb.2:
Lloh0:
	adrp	x10, _PLL_FACTOR@GOTPAGE
Lloh1:
	ldr	x10, [x10, _PLL_FACTOR@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	add	w10, w10, w10, lsl #2
	ldp	x12, x11, [x21, #16]
	cmp	x11, #0
	mov	w11, #5
	csel	w10, w10, w11, eq
	ldr	w11, [x21]
	mul	w8, w11, w8
	mul	w8, w8, w10
	lsl	w9, w9, #2
	sdiv	w8, w8, w9
Lloh3:
	adrp	x9, _MEDIA_BUS_FMT_SBGGR8_1X8@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MEDIA_BUS_FMT_SBGGR8_1X8@GOTPAGEOFF]
	ldr	x10, [x12]
Lloh5:
	ldr	x9, [x9]
	cmp	x10, x9
	cset	w9, eq
	lsl	w9, w8, w9
	subs	w8, w9, #1
Lloh6:
	adrp	x10, _CLK_SCALE@GOTPAGE
Lloh7:
	ldr	x10, [x10, _CLK_SCALE@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	cmp	w8, w10
	csel	w8, w8, w10, lt
	cmp	w9, #1
	b.gt	LBB0_4
LBB0_3:
Lloh9:
	adrp	x8, _CLK_EXT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CLK_EXT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
LBB0_4:
	str	w8, [x21, #4]
	mov	x0, x19
	mov	x1, x20
	bl	_ov7675_get_framerate
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_6
; %bb.5:
	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	_ov7675_apply_framerate
LBB0_6:
	mov	w0, #0
	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
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_PLL_FACTOR,4,2                 ; @PLL_FACTOR
	.comm	_MEDIA_BUS_FMT_SBGGR8_1X8,8,3   ; @MEDIA_BUS_FMT_SBGGR8_1X8
	.comm	_CLK_EXT,4,2                    ; @CLK_EXT
	.comm	_CLK_SCALE,4,2                  ; @CLK_SCALE
	.no_dead_strip	_ov7675_set_framerate
.subsections_via_symbols
