	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tvp7002_query_dv
_tvp7002_query_dv:                      ## @tvp7002_query_dv
	.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
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	_tvp7002_timings@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	$0, -44(%rbp)
	movq	_NUM_TIMINGS@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	movl	%eax, (%rsi)
	movq	_TVP7002_L_FRAME_STAT_LSBS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-60(%rbp), %rdx
	leaq	-44(%rbp), %r12
	movq	%r12, %rcx
	callq	_tvp7002_read_err
	movq	_TVP7002_L_FRAME_STAT_MSBS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	movq	%r14, %rdi
	movq	%r12, %rcx
	callq	_tvp7002_read_err
	movl	-44(%rbp), %r12d
	testl	%r12d, %r12d
	js	LBB0_14
## %bb.1:
	movq	_TVP7002_CLK_L_STAT_LSBS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-52(%rbp), %rdx
	leaq	-44(%rbp), %r12
	movq	%r14, %rdi
	movq	%r12, %rcx
	callq	_tvp7002_read_err
	movq	_TVP7002_CLK_L_STAT_MSBS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	movq	%r12, %rcx
	callq	_tvp7002_read_err
	movl	-44(%rbp), %r12d
	testl	%r12d, %r12d
	js	LBB0_14
## %bb.2:
	movq	_TVP7002_CL_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movl	-56(%rbp), %edx
	movl	%edx, %r8d
	andl	%r9d, %r8d
	movq	_TVP7002_CL_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r8d
	andl	-48(%rbp), %r9d
	shll	%cl, %r9d
	orl	-60(%rbp), %r8d
	orl	-52(%rbp), %r9d
	movq	_TVP7002_INPR_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %edx
	movq	_TVP7002_IP_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %edx
	movl	$0, (%r15)
	movl	(%r13), %ecx
	testl	%ecx, %ecx
	jle	LBB0_3
## %bb.4:
	addq	$12, %rbx
	xorl	%eax, %eax
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	incl	%eax
	movl	%eax, (%r15)
	movl	(%r13), %ecx
	addq	$16, %rbx
	cmpl	%ecx, %eax
	jge	LBB0_11
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	-12(%rbx), %r8d
	jne	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	-8(%rbx), %edx
	jne	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	-4(%rbx), %esi
	cmpl	$65535, %esi                    ## imm = 0xFFFF
	je	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	%esi, %r9d
	jl	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	(%rbx), %r9d
	jg	LBB0_10
	jmp	LBB0_11
LBB0_3:
	xorl	%eax, %eax
LBB0_11:
	movq	_debug@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	cmpl	%ecx, %eax
	jne	LBB0_13
## %bb.12:
	leaq	L_.str(%rip), %rcx
	xorl	%r12d, %r12d
	movl	$1, %edi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_v4l2_dbg
	movq	_ENOLINK@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_14
LBB0_13:
	leaq	L_.str.1(%rip), %rcx
	xorl	%r12d, %r12d
	movl	$1, %edi
	movq	%r14, %rdx
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_v4l2_dbg
LBB0_14:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_tvp7002_timings,8,3            ## @tvp7002_timings
	.comm	_NUM_TIMINGS,4,2                ## @NUM_TIMINGS
	.comm	_TVP7002_L_FRAME_STAT_LSBS,4,2  ## @TVP7002_L_FRAME_STAT_LSBS
	.comm	_TVP7002_L_FRAME_STAT_MSBS,4,2  ## @TVP7002_L_FRAME_STAT_MSBS
	.comm	_TVP7002_CLK_L_STAT_LSBS,4,2    ## @TVP7002_CLK_L_STAT_LSBS
	.comm	_TVP7002_CLK_L_STAT_MSBS,4,2    ## @TVP7002_CLK_L_STAT_MSBS
	.comm	_TVP7002_CL_MASK,4,2            ## @TVP7002_CL_MASK
	.comm	_TVP7002_CL_SHIFT,4,2           ## @TVP7002_CL_SHIFT
	.comm	_TVP7002_INPR_MASK,4,2          ## @TVP7002_INPR_MASK
	.comm	_TVP7002_IP_SHIFT,4,2           ## @TVP7002_IP_SHIFT
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"detection failed: lpf = %x, cpl = %x\n"

	.comm	_ENOLINK,4,2                    ## @ENOLINK
L_.str.1:                               ## @.str.1
	.asciz	"detected timings: %d\n"

	.no_dead_strip	_tvp7002_query_dv
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tvp7002_query_dv
_tvp7002_query_dv:                      ; @tvp7002_query_dv
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _tvp7002_timings@GOTPAGE
Lloh1:
	ldr	x8, [x8, _tvp7002_timings@GOTPAGEOFF]
Lloh2:
	ldr	x22, [x8]
Lloh3:
	adrp	x21, _NUM_TIMINGS@GOTPAGE
Lloh4:
	ldr	x21, [x21, _NUM_TIMINGS@GOTPAGEOFF]
	str	wzr, [sp, #28]
	ldr	w8, [x21]
	str	w8, [x1]
Lloh5:
	adrp	x8, _TVP7002_L_FRAME_STAT_LSBS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TVP7002_L_FRAME_STAT_LSBS@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x2, sp, #24
	add	x3, sp, #28
	bl	_tvp7002_read_err
Lloh8:
	adrp	x8, _TVP7002_L_FRAME_STAT_MSBS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _TVP7002_L_FRAME_STAT_MSBS@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x2, sp, #20
	add	x3, sp, #28
	mov	x0, x19
	bl	_tvp7002_read_err
	ldr	w0, [sp, #28]
	tbnz	w0, #31, LBB0_14
; %bb.1:
Lloh11:
	adrp	x8, _TVP7002_CLK_L_STAT_LSBS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TVP7002_CLK_L_STAT_LSBS@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	add	x2, sp, #16
	add	x3, sp, #28
	mov	x0, x19
	bl	_tvp7002_read_err
Lloh14:
	adrp	x8, _TVP7002_CLK_L_STAT_MSBS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TVP7002_CLK_L_STAT_MSBS@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	add	x2, sp, #12
	add	x3, sp, #28
	mov	x0, x19
	bl	_tvp7002_read_err
	ldr	w0, [sp, #28]
	tbnz	w0, #31, LBB0_14
; %bb.2:
	ldp	w11, w8, [sp, #20]
Lloh17:
	adrp	x9, _TVP7002_CL_MASK@GOTPAGE
Lloh18:
	ldr	x9, [x9, _TVP7002_CL_MASK@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
Lloh20:
	adrp	x10, _TVP7002_CL_SHIFT@GOTPAGE
Lloh21:
	ldr	x10, [x10, _TVP7002_CL_SHIFT@GOTPAGEOFF]
	and	w12, w11, w9
Lloh22:
	ldr	w10, [x10]
	lsl	w12, w12, w10
	orr	w4, w12, w8
	ldp	w12, w8, [sp, #12]
	and	w9, w12, w9
	lsl	w9, w9, w10
	orr	w9, w9, w8
Lloh23:
	adrp	x8, _TVP7002_INPR_MASK@GOTPAGE
Lloh24:
	ldr	x8, [x8, _TVP7002_INPR_MASK@GOTPAGEOFF]
Lloh25:
	ldr	w13, [x8]
Lloh26:
	adrp	x8, _TVP7002_IP_SHIFT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _TVP7002_IP_SHIFT@GOTPAGEOFF]
Lloh28:
	ldr	w12, [x8]
	str	wzr, [x20]
	ldr	w10, [x21]
	cmp	w10, #1
	b.lt	LBB0_10
; %bb.3:
	mov	w8, #0
	and	w11, w13, w11
	asr	w11, w11, w12
	add	x12, x22, #8
	mov	w13, #65535
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w8, w8, #1
	str	w8, [x20]
	ldr	w10, [x21]
	add	x12, x12, #16
	cmp	w8, w10
	b.ge	LBB0_11
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w14, [x12, #-8]
	cmp	w4, w14
	b.ne	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldur	w14, [x12, #-4]
	cmp	w11, w14
	b.ne	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w14, [x12]
	cmp	w14, w13
	b.eq	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w9, w14
	b.lt	LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w14, [x12, #4]
	cmp	w9, w14
	b.gt	LBB0_4
	b	LBB0_11
LBB0_10:
	mov	w8, #0
LBB0_11:
Lloh29:
	adrp	x11, _debug@GOTPAGE
Lloh30:
	ldr	x11, [x11, _debug@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x11]
	cmp	w8, w10
	b.ne	LBB0_13
; %bb.12:
Lloh32:
	adrp	x3, l_.str@PAGE
Lloh33:
	add	x3, x3, l_.str@PAGEOFF
	str	x9, [sp]
	mov	w0, #1
	mov	x2, x19
	bl	_v4l2_dbg
Lloh34:
	adrp	x8, _ENOLINK@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ENOLINK@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_14
LBB0_13:
Lloh37:
	adrp	x3, l_.str.1@PAGE
Lloh38:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	mov	x4, x8
	bl	_v4l2_dbg
	mov	w0, #0
LBB0_14:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_tvp7002_timings,8,3            ; @tvp7002_timings
	.comm	_NUM_TIMINGS,4,2                ; @NUM_TIMINGS
	.comm	_TVP7002_L_FRAME_STAT_LSBS,4,2  ; @TVP7002_L_FRAME_STAT_LSBS
	.comm	_TVP7002_L_FRAME_STAT_MSBS,4,2  ; @TVP7002_L_FRAME_STAT_MSBS
	.comm	_TVP7002_CLK_L_STAT_LSBS,4,2    ; @TVP7002_CLK_L_STAT_LSBS
	.comm	_TVP7002_CLK_L_STAT_MSBS,4,2    ; @TVP7002_CLK_L_STAT_MSBS
	.comm	_TVP7002_CL_MASK,4,2            ; @TVP7002_CL_MASK
	.comm	_TVP7002_CL_SHIFT,4,2           ; @TVP7002_CL_SHIFT
	.comm	_TVP7002_INPR_MASK,4,2          ; @TVP7002_INPR_MASK
	.comm	_TVP7002_IP_SHIFT,4,2           ; @TVP7002_IP_SHIFT
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"detection failed: lpf = %x, cpl = %x\n"

	.comm	_ENOLINK,4,2                    ; @ENOLINK
l_.str.1:                               ; @.str.1
	.asciz	"detected timings: %d\n"

	.no_dead_strip	_tvp7002_query_dv
.subsections_via_symbols
