	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt9v111_calc_frame_rate
_mt9v111_calc_frame_rate:               ## @mt9v111_calc_frame_rate
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rsi), %ecx
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movl	4(%rsi), %r12d
	testl	%ecx, %ecx
	je	LBB0_2
## %bb.1:
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %r12d
LBB0_2:
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	_mt9v111_frame_intervals@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	callq	_ARRAY_SIZE
	xorl	%r13d, %r13d
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	$-1, %ebx
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	_mt9v111_frame_intervals@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movl	%r12d, %eax
	subl	(%rdi,%r14,4), %eax
	movl	%eax, %r15d
	negl	%r15d
	cmovsl	%eax, %r15d
	cmpl	%ebx, %r15d
	cmovbl	%r15d, %ebx
	cmovbl	%r14d, %r13d
	incq	%r14
	callq	_ARRAY_SIZE
	movl	%eax, %eax
	cmpq	%rax, %r14
	jb	LBB0_5
## %bb.6:
	movl	%r13d, %r13d
	movq	_mt9v111_frame_intervals@GOTPCREL(%rip), %rbx
	jmp	LBB0_7
LBB0_3:
                                        ## implicit-def: $r15d
LBB0_7:
	movq	(%rbx), %rax
	movl	(%rax,%r13,4), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movl	$2, %esi
	callq	_DIV_ROUND_CLOSEST
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	_MT9V111_CORE_R06_MIN_VBLANK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MT9V111_CORE_R06_MAX_VBLANK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edi
	movl	%edi, -48(%rbp)                 ## 4-byte Spill
	jae	LBB0_8
## %bb.9:
	movq	_MT9V111_PIXEL_ARRAY_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_MT9V111_CORE_R04_WIN_H_OFFS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_MT9V111_PIXEL_ARRAY_HEIGHT@GOTPCREL(%rip), %rdx
	movq	_MT9V111_CORE_R03_WIN_V_OFFS@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	movl	(%rdx), %edx
	addl	%edi, %edx
	leal	(%rdx,%rsi), %edi
	addl	%esi, %edx
	addl	$7, %edx
	leal	7(%rax,%rcx), %eax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	leal	(%rdi,%rdi), %eax
	addl	$14, %eax
	leal	(%rax,%rax,4), %r13d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	$-1, %r12d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_12 Depth 2
	movq	_MT9V111_CORE_R05_MIN_HBLANK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_MT9V111_CORE_R05_MAX_HBLANK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	jae	LBB0_16
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	leal	(%rax,%rbx), %r14d
	imull	%edx, %r14d
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_12 Depth=2
	addl	$10, %ebx
	addl	%r13d, %r14d
	movq	_MT9V111_CORE_R05_MAX_HBLANK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jae	LBB0_16
LBB0_12:                                ##   Parent Loop BB0_10 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	movl	%r14d, %esi
	callq	_DIV_ROUND_CLOSEST
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	%ecx, %r15d
	negl	%r15d
	cmovsl	%ecx, %r15d
	cmpl	%r12d, %r15d
	jae	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=2
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%r15d, %r12d
	cmpl	%eax, %edx
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=1
	xorl	%r12d, %r12d
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_10 Depth=1
	testl	%r15d, %r15d
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	incl	%eax
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	incl	%edx
	addl	$10, %r13d
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_MT9V111_CORE_R06_MAX_VBLANK@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jb	LBB0_10
	jmp	LBB0_18
LBB0_8:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%ebx, %ebx
LBB0_18:
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movl	8(%r14), %edi
	movl	%ebx, %esi
	callq	_v4l2_ctrl_s_ctrl_int64
	testl	%eax, %eax
	jne	LBB0_21
## %bb.19:
	movl	4(%r14), %edi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_v4l2_ctrl_s_ctrl_int64
	testl	%eax, %eax
	jne	LBB0_21
## %bb.20:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, 4(%rax)
	xorl	%eax, %eax
LBB0_21:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mt9v111_frame_intervals,8,3    ## @mt9v111_frame_intervals
	.comm	_MT9V111_PIXEL_ARRAY_WIDTH,4,2  ## @MT9V111_PIXEL_ARRAY_WIDTH
	.comm	_MT9V111_CORE_R04_WIN_H_OFFS,4,2 ## @MT9V111_CORE_R04_WIN_H_OFFS
	.comm	_MT9V111_PIXEL_ARRAY_HEIGHT,4,2 ## @MT9V111_PIXEL_ARRAY_HEIGHT
	.comm	_MT9V111_CORE_R03_WIN_V_OFFS,4,2 ## @MT9V111_CORE_R03_WIN_V_OFFS
	.comm	_MT9V111_CORE_R06_MIN_VBLANK,4,2 ## @MT9V111_CORE_R06_MIN_VBLANK
	.comm	_MT9V111_CORE_R06_MAX_VBLANK,4,2 ## @MT9V111_CORE_R06_MAX_VBLANK
	.comm	_MT9V111_CORE_R05_MIN_HBLANK,4,2 ## @MT9V111_CORE_R05_MIN_HBLANK
	.comm	_MT9V111_CORE_R05_MAX_HBLANK,4,2 ## @MT9V111_CORE_R05_MAX_HBLANK
	.no_dead_strip	_mt9v111_calc_frame_rate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt9v111_calc_frame_rate
_mt9v111_calc_frame_rate:               ; @mt9v111_calc_frame_rate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x24, x0
	ldp	w8, w9, [x1]
	str	x1, [sp, #8]                    ; 8-byte Folded Spill
	udiv	w10, w9, w8
	cmp	w8, #0
	csel	w21, w9, w10, eq
Lloh0:
	adrp	x19, _mt9v111_frame_intervals@GOTPAGE
Lloh1:
	ldr	x19, [x19, _mt9v111_frame_intervals@GOTPAGEOFF]
	ldr	x0, [x19]
	bl	_ARRAY_SIZE
	cbz	w0, LBB0_3
; %bb.1:
	mov	x22, #0
	mov	w20, #0
	mov	w23, #-1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19]
	ldr	w8, [x0, x22, lsl #2]
	subs	w8, w21, w8
	cneg	w26, w8, mi
	cmp	w26, w23
	csel	w23, w26, w23, lo
	csel	w20, w22, w20, lo
	add	x22, x22, #1
	bl	_ARRAY_SIZE
	cmp	x22, w0, uxtw
	b.lo	LBB0_2
	b	LBB0_4
LBB0_3:
	mov	x20, #0
                                        ; implicit-def: $w26
LBB0_4:
	ldr	x8, [x19]
	ldr	w27, [x8, x20, lsl #2]
	str	x24, [sp, #16]                  ; 8-byte Folded Spill
	ldr	w0, [x24]
	mov	w1, #2
	bl	_DIV_ROUND_CLOSEST
Lloh2:
	adrp	x8, _MT9V111_CORE_R06_MIN_VBLANK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MT9V111_CORE_R06_MIN_VBLANK@GOTPAGEOFF]
Lloh4:
	ldr	w24, [x8]
Lloh5:
	adrp	x8, _MT9V111_CORE_R06_MAX_VBLANK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MT9V111_CORE_R06_MAX_VBLANK@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w24, w8
	b.hs	LBB0_14
; %bb.5:
	mov	x22, x0
	mov	w25, #0
Lloh8:
	adrp	x8, _MT9V111_PIXEL_ARRAY_WIDTH@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MT9V111_PIXEL_ARRAY_WIDTH@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _MT9V111_CORE_R04_WIN_H_OFFS@GOTPAGE
Lloh12:
	ldr	x9, [x9, _MT9V111_CORE_R04_WIN_H_OFFS@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
Lloh14:
	adrp	x10, _MT9V111_PIXEL_ARRAY_HEIGHT@GOTPAGE
Lloh15:
	ldr	x10, [x10, _MT9V111_PIXEL_ARRAY_HEIGHT@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
Lloh17:
	adrp	x11, _MT9V111_CORE_R03_WIN_V_OFFS@GOTPAGE
Lloh18:
	ldr	x11, [x11, _MT9V111_CORE_R03_WIN_V_OFFS@GOTPAGEOFF]
Lloh19:
	ldr	w11, [x11]
	add	w10, w10, w24
	add	w10, w10, w11
	add	w19, w10, #7
	add	w8, w8, w9
	add	w8, w8, #7
	str	w8, [sp, #24]                   ; 4-byte Folded Spill
	add	w8, w19, w19, lsl #2
	lsl	w28, w8, #1
	mov	w21, #-1
Lloh20:
	adrp	x20, _MT9V111_CORE_R05_MAX_HBLANK@GOTPAGE
Lloh21:
	ldr	x20, [x20, _MT9V111_CORE_R05_MAX_HBLANK@GOTPAGEOFF]
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	str	w24, [sp, #28]                  ; 4-byte Folded Spill
Lloh22:
	adrp	x8, _MT9V111_CORE_R05_MIN_HBLANK@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MT9V111_CORE_R05_MIN_HBLANK@GOTPAGEOFF]
Lloh24:
	ldr	w23, [x8]
	ldr	w8, [x20]
	cmp	w23, w8
	b.hs	LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [sp, #24]                   ; 4-byte Folded Reload
	add	w8, w8, w23
	mul	w24, w19, w8
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=2
	add	w23, w23, #10
	ldr	w8, [x20]
	add	w24, w24, w28
	cmp	w23, w8
	b.hs	LBB0_12
LBB0_9:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x22
	mov	x1, x24
	bl	_DIV_ROUND_CLOSEST
	subs	w8, w27, w0
	cneg	w26, w8, mi
	cmp	w26, w21
	b.hs	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	mov	x25, x0
	mov	x21, x26
	cmp	w27, w0
	b.ne	LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	w21, #0
	mov	x25, x27
LBB0_12:                                ;   in Loop: Header=BB0_6 Depth=1
	cbz	w26, LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w24, [sp, #28]                  ; 4-byte Folded Reload
	add	w24, w24, #1
Lloh25:
	adrp	x8, _MT9V111_CORE_R06_MAX_VBLANK@GOTPAGE
Lloh26:
	ldr	x8, [x8, _MT9V111_CORE_R06_MAX_VBLANK@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	add	w19, w19, #1
	add	w28, w28, #10
	cmp	w24, w8
	b.lo	LBB0_6
	b	LBB0_16
LBB0_14:
	mov	w25, #0
	mov	w23, #0
	b	LBB0_16
LBB0_15:
	ldr	w24, [sp, #28]                  ; 4-byte Folded Reload
LBB0_16:
	ldr	x19, [sp, #16]                  ; 8-byte Folded Reload
	ldr	w0, [x19, #8]
	mov	x1, x23
	bl	_v4l2_ctrl_s_ctrl_int64
	cbnz	w0, LBB0_19
; %bb.17:
	ldr	w0, [x19, #4]
	mov	x1, x24
	bl	_v4l2_ctrl_s_ctrl_int64
	cbnz	w0, LBB0_19
; %bb.18:
	mov	w8, #1
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	stp	w8, w25, [x9]
LBB0_19:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_mt9v111_frame_intervals,8,3    ; @mt9v111_frame_intervals
	.comm	_MT9V111_PIXEL_ARRAY_WIDTH,4,2  ; @MT9V111_PIXEL_ARRAY_WIDTH
	.comm	_MT9V111_CORE_R04_WIN_H_OFFS,4,2 ; @MT9V111_CORE_R04_WIN_H_OFFS
	.comm	_MT9V111_PIXEL_ARRAY_HEIGHT,4,2 ; @MT9V111_PIXEL_ARRAY_HEIGHT
	.comm	_MT9V111_CORE_R03_WIN_V_OFFS,4,2 ; @MT9V111_CORE_R03_WIN_V_OFFS
	.comm	_MT9V111_CORE_R06_MIN_VBLANK,4,2 ; @MT9V111_CORE_R06_MIN_VBLANK
	.comm	_MT9V111_CORE_R06_MAX_VBLANK,4,2 ; @MT9V111_CORE_R06_MAX_VBLANK
	.comm	_MT9V111_CORE_R05_MIN_HBLANK,4,2 ; @MT9V111_CORE_R05_MIN_HBLANK
	.comm	_MT9V111_CORE_R05_MAX_HBLANK,4,2 ; @MT9V111_CORE_R05_MAX_HBLANK
	.no_dead_strip	_mt9v111_calc_frame_rate
.subsections_via_symbols
