	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_v4l2_calc_timeperframe         ## -- Begin function v4l2_calc_timeperframe
	.p2align	4, 0x90
_v4l2_calc_timeperframe:                ## @v4l2_calc_timeperframe
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	l___const.v4l2_calc_timeperframe.fps_fract+16(%rip), %rax
	movq	%rax, 16(%rdi)
	movups	l___const.v4l2_calc_timeperframe.fps_fract(%rip), %xmm0
	movups	%xmm0, (%rdi)
	movq	(%rsi), %rax
	movq	_V4L2_DV_BT_656_1120@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.1:
	movq	%rsi, %rbx
	leaq	8(%rsi), %r14
	movq	%r14, %rdi
	callq	_V4L2_DV_BT_FRAME_WIDTH
	movl	%eax, %r15d
	movq	%r14, %rdi
	callq	_V4L2_DV_BT_FRAME_HEIGHT
	movl	%eax, %r14d
	movq	8(%rbx), %rax
	movl	16(%rbx), %ecx
	movq	_V4L2_DV_FL_CAN_DETECT_REDUCED_FPS@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_4
## %bb.2:
	movq	_V4L2_DV_FL_REDUCED_FPS@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_4
## %bb.3:
	imull	$1000, %eax, %edi               ## imm = 0x3E8
	movl	$1001, %esi                     ## imm = 0x3E9
	callq	_div_u64
LBB0_4:
	imull	%r15d, %r14d
	testl	%r14d, %r14d
	jle	LBB0_7
## %bb.5:
	imull	$100, %eax, %edi
	movl	%r14d, %esi
	callq	_div_u64
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	leaq	-48(%rbp), %r8
	leaq	-40(%rbp), %r9
	movl	%eax, %edi
	movl	$100, %esi
	movl	%eax, %edx
	movl	$100, %ecx
	callq	_rational_best_approximation
	movq	-40(%rbp), %rax
	movq	%rax, 8(%r12)
	movq	-48(%rbp), %rax
	movq	%rax, 16(%r12)
LBB0_7:
	movq	%r12, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	3                               ## @__const.v4l2_calc_timeperframe.fps_fract
l___const.v4l2_calc_timeperframe.fps_fract:
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.quad	0                               ## 0x0
	.quad	0                               ## 0x0

	.comm	_V4L2_DV_BT_656_1120,8,3        ## @V4L2_DV_BT_656_1120
	.comm	_V4L2_DV_FL_CAN_DETECT_REDUCED_FPS,4,2 ## @V4L2_DV_FL_CAN_DETECT_REDUCED_FPS
	.comm	_V4L2_DV_FL_REDUCED_FPS,4,2     ## @V4L2_DV_FL_REDUCED_FPS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_v4l2_calc_timeperframe         ; -- Begin function v4l2_calc_timeperframe
	.p2align	2
_v4l2_calc_timeperframe:                ; @v4l2_calc_timeperframe
	.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
	mov	x19, x8
Lloh0:
	adrp	x8, l___const.v4l2_calc_timeperframe.fps_fract@PAGE
Lloh1:
	add	x8, x8, l___const.v4l2_calc_timeperframe.fps_fract@PAGEOFF
	ldr	q0, [x8]
	str	q0, [x19]
	ldr	x8, [x8, #16]
	str	x8, [x19, #16]
	ldr	x8, [x0]
Lloh2:
	adrp	x9, _V4L2_DV_BT_656_1120@GOTPAGE
Lloh3:
	ldr	x9, [x9, _V4L2_DV_BT_656_1120@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.1:
	mov	x22, x0
	add	x21, x0, #8
	mov	x0, x21
	bl	_V4L2_DV_BT_FRAME_WIDTH
	mov	x20, x0
	mov	x0, x21
	bl	_V4L2_DV_BT_FRAME_HEIGHT
	mov	x21, x0
	ldr	x0, [x22, #8]
	ldr	w8, [x22, #16]
Lloh5:
	adrp	x9, _V4L2_DV_FL_CAN_DETECT_REDUCED_FPS@GOTPAGE
Lloh6:
	ldr	x9, [x9, _V4L2_DV_FL_CAN_DETECT_REDUCED_FPS@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.2:
Lloh8:
	adrp	x9, _V4L2_DV_FL_REDUCED_FPS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _V4L2_DV_FL_REDUCED_FPS@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	mov	w8, #1000
	mul	w0, w0, w8
	mov	w1, #1001
	bl	_div_u64
LBB0_4:
	mul	w1, w21, w20
	cmp	w1, #1
	b.lt	LBB0_7
; %bb.5:
	mov	w8, #100
	mul	w0, w0, w8
	bl	_div_u64
	cbz	w0, LBB0_7
; %bb.6:
	add	x4, sp, #8
	mov	x5, sp
	mov	w1, #100
	mov	x2, x0
	mov	w3, #100
	bl	_rational_best_approximation
	ldp	x8, x9, [sp]
	stp	x8, x9, [x19, #8]
LBB0_7:
	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
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	3                               ; @__const.v4l2_calc_timeperframe.fps_fract
l___const.v4l2_calc_timeperframe.fps_fract:
	.long	1                               ; 0x1
	.long	1                               ; 0x1
	.quad	0                               ; 0x0
	.quad	0                               ; 0x0

	.comm	_V4L2_DV_BT_656_1120,8,3        ; @V4L2_DV_BT_656_1120
	.comm	_V4L2_DV_FL_CAN_DETECT_REDUCED_FPS,4,2 ; @V4L2_DV_FL_CAN_DETECT_REDUCED_FPS
	.comm	_V4L2_DV_FL_REDUCED_FPS,4,2     ; @V4L2_DV_FL_REDUCED_FPS
.subsections_via_symbols
