	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_v4l2_detect_gtf                ## -- Begin function v4l2_detect_gtf
	.p2align	4, 0x90
_v4l2_detect_gtf:                       ## @v4l2_detect_gtf
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%eax, %eax
	cmpl	$3, %edx
	jne	LBB0_15
## %bb.1:
	movq	%rcx, %r14
	movl	%esi, %ebx
	movl	%edi, %r15d
	movq	_V4L2_DV_VSYNC_POS_POL@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	cmpq	%r14, %rdi
	setne	%cl
	movq	_V4L2_DV_HSYNC_POS_POL@GOTPCREL(%rip), %rdx
	cmpq	%r14, (%rdx)
	setne	%dl
	testl	%esi, %esi
	je	LBB0_15
## %bb.2:
	andb	%dl, %cl
	jne	LBB0_15
## %bb.3:
	movq	_GTF_V_FP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r10d
	movq	_GTF_MIN_VSYNC_BP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	imull	%ebx, %ecx
	addl	$500000, %ecx                   ## imm = 0x7A120
	imulq	$1125899907, %rcx, %rcx         ## imm = 0x431BDE83
	shrq	$50, %rcx
	addl	%r10d, %ecx
	testl	%r8d, %r8d
	je	LBB0_5
## %bb.4:
	addl	%ecx, %ecx
	movl	%r15d, %r12d
	subl	%ecx, %r12d
	andl	$-2, %r12d
	jns	LBB0_7
	jmp	LBB0_15
LBB0_5:
	movl	%r15d, %r12d
	subl	%ecx, %r12d
	incl	%r12d
	andl	$-2, %r12d
	js	LBB0_15
LBB0_7:
	movq	%r9, %rcx
	shrq	$32, %rcx
	testl	%r9d, %r9d
	sete	%al
	testl	%ecx, %ecx
	sete	%dl
	orb	%al, %dl
	movl	$16, %eax
	cmovel	%r9d, %eax
	movl	$9, %esi
	cmovel	%ecx, %esi
	imull	%r12d, %eax
	cltd
	idivl	%esi
	movq	_GTF_CELL_GRAN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	shrl	$31, %edx
	addl	%ecx, %edx
	sarl	%edx
	addl	%eax, %edx
	movl	%ecx, %r13d
	negl	%r13d
	andl	%edx, %r13d
	cmpq	%r14, %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movq	%r10, -64(%rbp)                 ## 8-byte Spill
	jne	LBB0_9
## %bb.8:
	movq	_GTF_D_C_PRIME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$100, %edx
	subl	%eax, %edx
	imull	%ebx, %eax
	movq	_GTF_D_M_PRIME@GOTPCREL(%rip), %rsi
	jmp	LBB0_10
LBB0_9:
	movq	_GTF_S_C_PRIME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$100, %edx
	subl	%eax, %edx
	imull	%ebx, %eax
	movq	_GTF_S_M_PRIME@GOTPCREL(%rip), %rsi
LBB0_10:
	movl	(%rsi), %esi
	imull	$-1000, %esi, %edi              ## imm = 0xFC18
	addl	%eax, %edi
	imull	%ebx, %edx
	imull	$1000, %esi, %eax               ## imm = 0x3E8
	addl	%edx, %eax
	imull	%eax, %ecx
	addl	%ecx, %ecx
	movl	%ecx, %esi
	shrl	%ecx
	imull	%r13d, %edi
	addl	%ecx, %edi
	callq	_div_u64
                                        ## kill: def $eax killed $eax def $rax
	movq	_GTF_CELL_GRAN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	imull	%edi, %eax
	leal	(%r13,%rax,2), %ecx
	movl	%eax, %esi
	addl	%eax, %esi
	imull	%ecx, %ebx
	movq	_GTF_PXL_CLK_GRAN@GOTPCREL(%rip), %r8
	movl	%ebx, %eax
	cltd
	idivl	(%r8)
	subl	%edx, %ebx
	leal	50(,%rcx,8), %eax
	cltq
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$37, %rax
	addl	%ecx, %eax
	movl	%edi, %ecx
	shrl	$31, %ecx
	addl	%edi, %ecx
	sarl	%ecx
	addl	%eax, %ecx
	movl	%ecx, %eax
	cltd
	idivl	%edi
	subl	%edx, %ecx
	movl	%esi, %eax
	sarl	%eax
	subl	%eax, %esi
	subl	%ecx, %eax
	movq	_V4L2_DV_BT_656_1120@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movq	16(%rbp), %rdi
	movl	%edx, 72(%rdi)
	movq	%r14, 64(%rdi)
	movl	%r13d, (%rdi)
	movl	%r12d, 4(%rdi)
	movl	%eax, 8(%rdi)
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	%edx, 12(%rdi)
	movl	%ecx, 16(%rdi)
	movl	$3, 20(%rdi)
	movl	%esi, 24(%rdi)
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_11
## %bb.12:
	subl	%edx, %r15d
	subl	%edx, %r15d
	subl	%r12d, %r15d
	addl	$-6, %r15d
	movl	%r15d, %ecx
	shrl	%ecx
	subl	%ecx, %r15d
	movl	%r15d, 32(%rdi)
	movl	%edx, 36(%rdi)
	movl	$3, 40(%rdi)
	movq	_V4L2_DV_FL_HALF_LINE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 48(%rdi)
	movq	_V4L2_DV_INTERLACED@GOTPCREL(%rip), %rax
	movl	%ecx, %r15d
	jmp	LBB0_13
LBB0_11:
	addl	%r12d, %edx
	subl	%edx, %r15d
	addl	$-3, %r15d
	movq	_V4L2_DV_PROGRESSIVE@GOTPCREL(%rip), %rax
LBB0_13:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rax), %eax
	movl	%r15d, 28(%rdi)
	movl	%eax, 56(%rdi)
	movl	%ebx, 44(%rdi)
	movq	_V4L2_DV_BT_STD_GTF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 52(%rdi)
	movl	$1, %eax
	cmpq	%r14, %rcx
	je	LBB0_15
## %bb.14:
	movq	_V4L2_DV_FL_REDUCED_BLANKING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 48(%rdi)
LBB0_15:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_DV_VSYNC_POS_POL,8,3      ## @V4L2_DV_VSYNC_POS_POL
	.comm	_V4L2_DV_HSYNC_POS_POL,8,3      ## @V4L2_DV_HSYNC_POS_POL
	.comm	_GTF_V_FP,4,2                   ## @GTF_V_FP
	.comm	_GTF_MIN_VSYNC_BP,4,2           ## @GTF_MIN_VSYNC_BP
	.comm	_GTF_CELL_GRAN,4,2              ## @GTF_CELL_GRAN
	.comm	_GTF_D_C_PRIME,4,2              ## @GTF_D_C_PRIME
	.comm	_GTF_D_M_PRIME,4,2              ## @GTF_D_M_PRIME
	.comm	_GTF_S_C_PRIME,4,2              ## @GTF_S_C_PRIME
	.comm	_GTF_S_M_PRIME,4,2              ## @GTF_S_M_PRIME
	.comm	_GTF_PXL_CLK_GRAN,4,2           ## @GTF_PXL_CLK_GRAN
	.comm	_V4L2_DV_BT_656_1120,4,2        ## @V4L2_DV_BT_656_1120
	.comm	_V4L2_DV_PROGRESSIVE,4,2        ## @V4L2_DV_PROGRESSIVE
	.comm	_V4L2_DV_FL_HALF_LINE,4,2       ## @V4L2_DV_FL_HALF_LINE
	.comm	_V4L2_DV_INTERLACED,4,2         ## @V4L2_DV_INTERLACED
	.comm	_V4L2_DV_BT_STD_GTF,4,2         ## @V4L2_DV_BT_STD_GTF
	.comm	_V4L2_DV_FL_REDUCED_BLANKING,4,2 ## @V4L2_DV_FL_REDUCED_BLANKING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_v4l2_detect_gtf                ; -- Begin function v4l2_detect_gtf
	.p2align	2
_v4l2_detect_gtf:                       ; @v4l2_detect_gtf
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	cmp	w2, #3
	b.ne	LBB0_6
; %bb.1:
	mov	x20, x3
	mov	x23, x1
	mov	x21, x0
	mov	w0, #0
Lloh0:
	adrp	x8, _V4L2_DV_VSYNC_POS_POL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_DV_VSYNC_POS_POL@GOTPAGEOFF]
Lloh2:
	ldr	x24, [x8]
	cmp	x24, x3
Lloh3:
	adrp	x8, _V4L2_DV_HSYNC_POS_POL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V4L2_DV_HSYNC_POS_POL@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ccmp	x8, x3, #4, ne
	cset	w8, ne
	cbz	w1, LBB0_11
; %bb.2:
	tbnz	w8, #0, LBB0_11
; %bb.3:
	mov	x22, x4
Lloh6:
	adrp	x8, _GTF_V_FP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GTF_V_FP@GOTPAGEOFF]
Lloh8:
	ldr	w25, [x8]
Lloh9:
	adrp	x8, _GTF_MIN_VSYNC_BP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GTF_MIN_VSYNC_BP@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	mov	w9, #41248
	movk	w9, #7, lsl #16
	madd	w8, w8, w23, w9
	mov	w9, #56963
	movk	w9, #17179, lsl #16
	umull	x8, w8, w9
	lsr	x8, x8, #50
	add	w9, w25, w8
	sub	w9, w21, w9
	add	w8, w8, w25
	sub	w8, w21, w8, lsl #1
	cmp	w4, #0
	csinc	w8, w8, w9, ne
	ands	w26, w8, #0xfffffffe
	b.lt	LBB0_6
; %bb.4:
	mov	x19, x6
	lsr	x8, x5, #32
	cmp	w5, #0
	ccmp	w8, #0, #4, ne
	mov	w9, #16
	csel	w9, w9, w5, eq
	mov	w10, #9
	csel	w8, w10, w8, eq
	mul	w9, w26, w9
	sdiv	w8, w9, w8
Lloh12:
	adrp	x28, _GTF_CELL_GRAN@GOTPAGE
Lloh13:
	ldr	x28, [x28, _GTF_CELL_GRAN@GOTPAGEOFF]
	ldr	w9, [x28]
	cmp	w9, #0
	cinc	w10, w9, lt
	add	w8, w8, w10, asr #1
Lloh14:
	adrp	x10, _GTF_S_C_PRIME@GOTPAGE
Lloh15:
	ldr	x10, [x10, _GTF_S_C_PRIME@GOTPAGEOFF]
	neg	w11, w9
	and	w27, w8, w11
Lloh16:
	adrp	x8, _GTF_D_C_PRIME@GOTPAGE
Lloh17:
	ldr	x8, [x8, _GTF_D_C_PRIME@GOTPAGEOFF]
Lloh18:
	adrp	x11, _GTF_S_M_PRIME@GOTPAGE
Lloh19:
	ldr	x11, [x11, _GTF_S_M_PRIME@GOTPAGEOFF]
	cmp	x24, x20
	csel	x8, x8, x10, eq
Lloh20:
	adrp	x10, _GTF_D_M_PRIME@GOTPAGE
Lloh21:
	ldr	x10, [x10, _GTF_D_M_PRIME@GOTPAGEOFF]
	csel	x10, x10, x11, eq
	ldr	w8, [x8]
	mul	w11, w8, w23
	ldr	w10, [x10]
	mov	w12, #-1000
	mov	w13, #100
	sub	w8, w13, w8
	mov	w13, #1000
	mul	w13, w10, w13
	madd	w8, w8, w23, w13
	mul	w8, w9, w8
	lsl	w1, w8, #1
	madd	w9, w10, w12, w11
	and	w8, w8, #0x7fffffff
	madd	w0, w9, w27, w8
	bl	_div_u64
	ldr	w9, [x28]
	mul	w10, w0, w9
	lsl	w11, w10, #1
	add	w12, w11, w27
Lloh22:
	adrp	x8, _GTF_PXL_CLK_GRAN@GOTPAGE
Lloh23:
	ldr	x8, [x8, _GTF_PXL_CLK_GRAN@GOTPAGEOFF]
	mul	w13, w12, w23
Lloh24:
	ldr	w8, [x8]
	sdiv	w13, w13, w8
	mul	w8, w13, w8
	lsl	w12, w12, #3
	add	w12, w12, #50
	mov	w13, #34079
	movk	w13, #20971, lsl #16
	smull	x12, w12, w13
	lsr	x13, x12, #63
	asr	x12, x12, #37
	add	w12, w12, w13
	cmp	w9, #0
	cinc	w13, w9, lt
	add	w12, w12, w13, asr #1
	sdiv	w12, w12, w9
	mul	w9, w12, w9
Lloh25:
	adrp	x12, _V4L2_DV_BT_656_1120@GOTPAGE
Lloh26:
	ldr	x12, [x12, _V4L2_DV_BT_656_1120@GOTPAGEOFF]
	mov	w13, #1
Lloh27:
	ldr	w12, [x12]
	str	w12, [x19, #72]
	bfi	w13, w10, #1, #31
	str	x20, [x19, #64]
	cmp	w11, #0
	csel	w10, w13, w11, lt
	stp	w27, w26, [x19]
	asr	w12, w10, #1
	sub	w10, w12, w9
	stp	w10, w25, [x19, #8]
	mov	w10, #3
	stp	w9, w10, [x19, #16]
	sub	w9, w11, w12
	str	w9, [x19, #24]
	cbz	w22, LBB0_7
; %bb.5:
	sub	w9, w21, w25, lsl #1
	sub	w9, w9, w26
	sub	w11, w9, #6
	lsr	w9, w11, #1
	sub	w11, w11, w9
	stp	w11, w25, [x19, #32]
	str	w10, [x19, #40]
Lloh28:
	adrp	x10, _V4L2_DV_FL_HALF_LINE@GOTPAGE
Lloh29:
	ldr	x10, [x10, _V4L2_DV_FL_HALF_LINE@GOTPAGEOFF]
Lloh30:
	ldr	w10, [x10]
	ldr	w11, [x19, #48]
	orr	w10, w11, w10
	str	w10, [x19, #48]
Lloh31:
	adrp	x10, _V4L2_DV_INTERLACED@GOTPAGE
Lloh32:
	ldr	x10, [x10, _V4L2_DV_INTERLACED@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:
	mov	w0, #0
	b	LBB0_11
LBB0_7:
	add	w9, w25, w26
	sub	w9, w21, w9
	sub	w9, w9, #3
Lloh33:
	adrp	x10, _V4L2_DV_PROGRESSIVE@GOTPAGE
Lloh34:
	ldr	x10, [x10, _V4L2_DV_PROGRESSIVE@GOTPAGEOFF]
LBB0_8:
	ldr	w10, [x10]
	str	w9, [x19, #28]
	str	w8, [x19, #44]
Lloh35:
	adrp	x8, _V4L2_DV_BT_STD_GTF@GOTPAGE
Lloh36:
	ldr	x8, [x8, _V4L2_DV_BT_STD_GTF@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	stp	w8, w10, [x19, #52]
	cmp	x24, x20
	b.eq	LBB0_10
; %bb.9:
Lloh38:
	adrp	x8, _V4L2_DV_FL_REDUCED_BLANKING@GOTPAGE
Lloh39:
	ldr	x8, [x8, _V4L2_DV_FL_REDUCED_BLANKING@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	ldr	w9, [x19, #48]
	orr	w8, w9, w8
	str	w8, [x19, #48]
LBB0_10:
	mov	w0, #1
LBB0_11:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_DV_VSYNC_POS_POL,8,3      ; @V4L2_DV_VSYNC_POS_POL
	.comm	_V4L2_DV_HSYNC_POS_POL,8,3      ; @V4L2_DV_HSYNC_POS_POL
	.comm	_GTF_V_FP,4,2                   ; @GTF_V_FP
	.comm	_GTF_MIN_VSYNC_BP,4,2           ; @GTF_MIN_VSYNC_BP
	.comm	_GTF_CELL_GRAN,4,2              ; @GTF_CELL_GRAN
	.comm	_GTF_D_C_PRIME,4,2              ; @GTF_D_C_PRIME
	.comm	_GTF_D_M_PRIME,4,2              ; @GTF_D_M_PRIME
	.comm	_GTF_S_C_PRIME,4,2              ; @GTF_S_C_PRIME
	.comm	_GTF_S_M_PRIME,4,2              ; @GTF_S_M_PRIME
	.comm	_GTF_PXL_CLK_GRAN,4,2           ; @GTF_PXL_CLK_GRAN
	.comm	_V4L2_DV_BT_656_1120,4,2        ; @V4L2_DV_BT_656_1120
	.comm	_V4L2_DV_PROGRESSIVE,4,2        ; @V4L2_DV_PROGRESSIVE
	.comm	_V4L2_DV_FL_HALF_LINE,4,2       ; @V4L2_DV_FL_HALF_LINE
	.comm	_V4L2_DV_INTERLACED,4,2         ; @V4L2_DV_INTERLACED
	.comm	_V4L2_DV_BT_STD_GTF,4,2         ; @V4L2_DV_BT_STD_GTF
	.comm	_V4L2_DV_FL_REDUCED_BLANKING,4,2 ; @V4L2_DV_FL_REDUCED_BLANKING
.subsections_via_symbols
