	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt9v111_s_frame_interval
_mt9v111_s_frame_interval:              ## @mt9v111_s_frame_interval
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	callq	_sd_to_mt9v111
	movq	%rax, %rbx
	movq	%rax, %r15
	movl	(%r14), %ecx
	movl	4(%r14), %r12d
	testl	%ecx, %ecx
	je	LBB0_2
## %bb.1:
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %r12d
	jmp	LBB0_3
LBB0_2:
	movl	$1, (%r14)
LBB0_3:
	addq	$20, %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	cmpq	$0, 40(%r15)
	je	LBB0_6
## %bb.4:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	_EBUSY@GOTPCREL(%rip), %rcx
LBB0_5:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_16
LBB0_6:
	cmpl	%r12d, (%r15)
	je	LBB0_15
## %bb.7:
	movq	24(%r15), %rcx
	movq	_QVGA_WIDTH@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	jge	LBB0_9
## %bb.8:
	movq	32(%r15), %rdx
	movq	_QVGA_HEIGHT@GOTPCREL(%rip), %rsi
	movl	$90, %eax
	cmpq	(%rsi), %rdx
	jl	LBB0_12
LBB0_9:
	movq	_CIF_WIDTH@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	jge	LBB0_11
## %bb.10:
	movq	32(%r15), %rcx
	movq	_CIF_HEIGHT@GOTPCREL(%rip), %rdx
	movl	$60, %eax
	cmpq	(%rdx), %rcx
	jl	LBB0_12
LBB0_11:
	movq	8(%r15), %r13
	movq	_MT9V111_MAX_CLKIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$2, %esi
	callq	_DIV_ROUND_CLOSEST
	cmpq	%rax, %r13
	movl	$15, %ecx
	movl	$30, %eax
	cmovll	%ecx, %eax
LBB0_12:
	cmpl	%eax, %r12d
	jbe	LBB0_14
## %bb.13:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_14:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_mt9v111_calc_frame_rate
	movl	%r12d, (%r15)
	movl	$1, 16(%r15)
LBB0_15:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_QVGA_WIDTH,8,3                 ## @QVGA_WIDTH
	.comm	_QVGA_HEIGHT,8,3                ## @QVGA_HEIGHT
	.comm	_CIF_WIDTH,8,3                  ## @CIF_WIDTH
	.comm	_CIF_HEIGHT,8,3                 ## @CIF_HEIGHT
	.comm	_MT9V111_MAX_CLKIN,4,2          ## @MT9V111_MAX_CLKIN
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_mt9v111_s_frame_interval
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt9v111_s_frame_interval
_mt9v111_s_frame_interval:              ; @mt9v111_s_frame_interval
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	bl	_sd_to_mt9v111
	mov	x20, x0
	ldp	w8, w22, [x19]
	cbz	w8, LBB0_2
; %bb.1:
	udiv	w22, w22, w8
	b	LBB0_3
LBB0_2:
	mov	w8, #1
	str	w8, [x19]
LBB0_3:
	add	x21, x20, #20
	mov	x0, x21
	bl	_mutex_lock
	ldr	x8, [x20, #40]
	cbz	x8, LBB0_6
; %bb.4:
	mov	x0, x21
	bl	_mutex_unlock
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_15
LBB0_6:
	ldr	w8, [x20]
	cmp	w8, w22
	b.eq	LBB0_14
; %bb.7:
	ldr	x8, [x20, #24]
Lloh2:
	adrp	x9, _QVGA_WIDTH@GOTPAGE
Lloh3:
	ldr	x9, [x9, _QVGA_WIDTH@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_10
; %bb.8:
	ldr	x9, [x20, #32]
Lloh5:
	adrp	x10, _QVGA_HEIGHT@GOTPAGE
Lloh6:
	ldr	x10, [x10, _QVGA_HEIGHT@GOTPAGEOFF]
Lloh7:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ge	LBB0_10
; %bb.9:
	mov	w8, #90
	cmp	w22, w8
	b.ls	LBB0_13
	b	LBB0_17
LBB0_10:
Lloh8:
	adrp	x9, _CIF_WIDTH@GOTPAGE
Lloh9:
	ldr	x9, [x9, _CIF_WIDTH@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_16
; %bb.11:
	ldr	x8, [x20, #32]
Lloh11:
	adrp	x9, _CIF_HEIGHT@GOTPAGE
Lloh12:
	ldr	x9, [x9, _CIF_HEIGHT@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_16
; %bb.12:
	mov	w8, #60
	cmp	w22, w8
	b.hi	LBB0_17
LBB0_13:
	mov	x0, x20
	mov	x1, x19
	bl	_mt9v111_calc_frame_rate
	str	w22, [x20]
	mov	w8, #1
	str	w8, [x20, #16]
LBB0_14:
	mov	x0, x21
	bl	_mutex_unlock
	mov	w0, #0
LBB0_15:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_16:
	ldr	x23, [x20, #8]
Lloh14:
	adrp	x8, _MT9V111_MAX_CLKIN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MT9V111_MAX_CLKIN@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	mov	w1, #2
	bl	_DIV_ROUND_CLOSEST
	cmp	x23, x0
	mov	w8, #30
	mov	w9, #15
	csel	w8, w9, w8, lt
	cmp	w22, w8
	b.ls	LBB0_13
LBB0_17:
	mov	x0, x21
	bl	_mutex_unlock
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_QVGA_WIDTH,8,3                 ; @QVGA_WIDTH
	.comm	_QVGA_HEIGHT,8,3                ; @QVGA_HEIGHT
	.comm	_CIF_WIDTH,8,3                  ; @CIF_WIDTH
	.comm	_CIF_HEIGHT,8,3                 ; @CIF_HEIGHT
	.comm	_MT9V111_MAX_CLKIN,4,2          ; @MT9V111_MAX_CLKIN
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_mt9v111_s_frame_interval
.subsections_via_symbols
