	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov7670_set_framerate_legacy
_ov7670_set_framerate_legacy:           ## @ov7670_set_framerate_legacy
	.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, %rcx
	movl	(%r15), %eax
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	4(%r15), %edi
	testl	%edi, %edi
	je	LBB0_2
## %bb.3:
	movl	(%rcx), %esi
	imull	%esi, %eax
	cltd
	idivl	%edi
	movq	_CLK_SCALE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	cmpl	%edx, %eax
	cmovll	%eax, %edx
	testl	%eax, %eax
	movl	$1, %edi
	cmovnel	%edx, %edi
	jmp	LBB0_4
LBB0_2:
	movq	_CLK_SCALE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	movl	$1, %edi
	cmovlel	%eax, %edi
	movl	(%rcx), %esi
LBB0_4:
	movl	$128, %ebx
	andl	4(%rcx), %ebx
	orl	%edi, %ebx
	movl	%ebx, 4(%rcx)
	movl	$1, (%r15)
	movl	%esi, %eax
	cltd
	idivl	%edi
	movl	%eax, 4(%r15)
	cmpq	$0, 8(%rcx)
	je	LBB0_5
## %bb.6:
	movq	_REG_CLKRC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ov7670_write                   ## TAILCALL
LBB0_5:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CLK_SCALE,4,2                  ## @CLK_SCALE
	.comm	_REG_CLKRC,4,2                  ## @REG_CLKRC
	.no_dead_strip	_ov7670_set_framerate_legacy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov7670_set_framerate_legacy
_ov7670_set_framerate_legacy:           ; @ov7670_set_framerate_legacy
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
	bl	_to_state
	ldr	w9, [x20]
	cbz	w9, LBB0_3
; %bb.1:
	ldr	w10, [x20, #4]
	cbz	w10, LBB0_3
; %bb.2:
	ldr	w8, [x0]
	mul	w9, w8, w9
Lloh0:
	adrp	x11, _CLK_SCALE@GOTPAGE
Lloh1:
	ldr	x11, [x11, _CLK_SCALE@GOTPAGEOFF]
	sdiv	w9, w9, w10
Lloh2:
	ldr	w10, [x11]
	cmp	w9, w10
	csel	w10, w9, w10, lt
	cmp	w9, #0
	csinc	w9, w10, wzr, ne
	b	LBB0_4
LBB0_3:
Lloh3:
	adrp	x8, _CLK_SCALE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CLK_SCALE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, #1
	csinc	w9, w8, wzr, lt
	ldr	w8, [x0]
LBB0_4:
	ldr	w10, [x0, #4]
	and	w10, w10, #0x80
	orr	w2, w10, w9
	str	w2, [x0, #4]
	mov	w10, #1
	sdiv	w8, w8, w9
	stp	w10, w8, [x20]
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_6
; %bb.5:
Lloh6:
	adrp	x8, _REG_CLKRC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _REG_CLKRC@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_ov7670_write
LBB0_6:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_CLK_SCALE,4,2                  ; @CLK_SCALE
	.comm	_REG_CLKRC,4,2                  ; @REG_CLKRC
	.no_dead_strip	_ov7670_set_framerate_legacy
.subsections_via_symbols
