	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tda1997x_configure_vhref
_tda1997x_configure_vhref:              ## @tda1997x_configure_vhref
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	callq	_to_state
	movq	%rax, %r14
	leaq	8(%rax), %r12
	movl	8(%rax), %eax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movl	12(%r14), %eax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movl	16(%r14), %eax
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	movl	20(%r14), %ecx
	movl	24(%r14), %eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movl	28(%r14), %ebx
	movl	32(%r14), %edi
	movl	36(%r14), %edx
	movl	40(%r14), %esi
	movl	44(%r14), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	cmpq	$0, 48(%r14)
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	movq	%rdx, -96(%rbp)                 ## 8-byte Spill
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	je	LBB0_1
## %bb.2:
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	leal	(%rdx,%rdi), %ecx
	leal	(%rax,%rcx), %edx
	decl	%edx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
                                        ## kill: def $eax killed $eax killed $rax def $rax
	addl	%ecx, %eax
	addl	%esi, %ecx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	addl	%esi, %eax
	decl	%eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	jmp	LBB0_3
LBB0_1:
	xorl	%eax, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_3:
	movq	%r12, %rdi
	callq	_V4L2_DV_BT_FRAME_WIDTH
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	_V4L2_DV_BT_FRAME_HEIGHT
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	_REG_FDW_S@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	$751, %edx                      ## imm = 0x2EF
	callq	_io_write16
	movq	_REG_FDW_E@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	$321, %edx                      ## imm = 0x141
	callq	_io_write16
	xorl	%eax, %eax
	cmpq	$0, (%r14)
	sete	%al
	movq	_REG_PXCNT_PR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leal	(%rax,%rax,2), %edx
	incl	%edx
	movq	%r13, %rdi
	callq	_io_write16
	addl	-64(%rbp), %ebx                 ## 4-byte Folded Reload
	addl	%ebx, -52(%rbp)                 ## 4-byte Folded Spill
	addl	-56(%rbp), %ebx                 ## 4-byte Folded Reload
	addl	-80(%rbp), %ebx                 ## 4-byte Folded Reload
	addl	-96(%rbp), %ebx                 ## 4-byte Folded Reload
	addl	-88(%rbp), %ebx                 ## 4-byte Folded Reload
	movq	-112(%rbp), %rcx                ## 8-byte Reload
	movq	-104(%rbp), %rdx                ## 8-byte Reload
	leal	(%rcx,%rdx), %eax
	leal	(%rcx,%rdx), %r12d
	incl	%r12d
	movq	-120(%rbp), %rcx                ## 8-byte Reload
	leal	1(%rcx,%rax), %r14d
	movq	_REG_PXCNT_NPIX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MASK_VHREF@GOTPCREL(%rip), %rax
	andl	(%rax), %r15d
	movq	%r13, %rdi
	movl	%r15d, %edx
	callq	_io_write16
	movq	_REG_LCNT_PR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	$1, %edx
	callq	_io_write16
	movq	_REG_LCNT_NLIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	movq	_MASK_VHREF@GOTPCREL(%rip), %r15
	andl	(%r15), %edx
	movq	%r13, %rdi
	callq	_io_write16
	movq	_VHREF_STD_DET_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_VHREF_STD_DET_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %edx
	movq	_REG_VHREF_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_io_write
	movq	_REG_HREF_S@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andl	(%r15), %r12d
	movq	%r13, %rdi
	movl	%r12d, %edx
	callq	_io_write16
	movq	_REG_HREF_E@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andl	(%r15), %r14d
	movq	%r13, %rdi
	movl	%r14d, %edx
	callq	_io_write16
	movq	_REG_VREF_F1_S@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andl	(%r15), %ebx
	movq	%r13, %rdi
	movl	%ebx, %edx
	callq	_io_write16
	movq	_REG_VREF_F1_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	callq	_io_write
	movq	_REG_VREF_F2_S@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	andl	(%r15), %edx
	movq	%r13, %rdi
	callq	_io_write16
	movq	_REG_VREF_F2_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_io_write
	movq	_REG_FREF_F1_S@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_io_write16
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	andl	(%r15), %edx
	movq	_REG_FREF_F2_S@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_io_write16                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_FDW_S,4,2                  ## @REG_FDW_S
	.comm	_REG_FDW_E,4,2                  ## @REG_FDW_E
	.comm	_REG_PXCNT_PR,4,2               ## @REG_PXCNT_PR
	.comm	_REG_PXCNT_NPIX,4,2             ## @REG_PXCNT_NPIX
	.comm	_MASK_VHREF,4,2                 ## @MASK_VHREF
	.comm	_REG_LCNT_PR,4,2                ## @REG_LCNT_PR
	.comm	_REG_LCNT_NLIN,4,2              ## @REG_LCNT_NLIN
	.comm	_VHREF_STD_DET_OFF,4,2          ## @VHREF_STD_DET_OFF
	.comm	_VHREF_STD_DET_SHIFT,4,2        ## @VHREF_STD_DET_SHIFT
	.comm	_REG_VHREF_CTRL,4,2             ## @REG_VHREF_CTRL
	.comm	_REG_HREF_S,4,2                 ## @REG_HREF_S
	.comm	_REG_HREF_E,4,2                 ## @REG_HREF_E
	.comm	_REG_VREF_F1_S,4,2              ## @REG_VREF_F1_S
	.comm	_REG_VREF_F1_WIDTH,4,2          ## @REG_VREF_F1_WIDTH
	.comm	_REG_VREF_F2_S,4,2              ## @REG_VREF_F2_S
	.comm	_REG_VREF_F2_WIDTH,4,2          ## @REG_VREF_F2_WIDTH
	.comm	_REG_FREF_F1_S,4,2              ## @REG_FREF_F1_S
	.comm	_REG_FREF_F2_S,4,2              ## @REG_FREF_F2_S
	.no_dead_strip	_tda1997x_configure_vhref
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tda1997x_configure_vhref
_tda1997x_configure_vhref:              ; @tda1997x_configure_vhref
	.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	x19, x0
	bl	_to_state
	mov	x21, x0
	mov	x22, x0
	ldr	w9, [x22, #8]!
	ldr	w8, [x0, #12]
	stp	w8, w9, [sp, #8]                ; 8-byte Folded Spill
	ldp	w8, w24, [x0, #16]
	str	w8, [sp, #16]                   ; 4-byte Folded Spill
	ldp	w8, w28, [x0, #24]
	str	w8, [sp, #4]                    ; 4-byte Folded Spill
	ldp	w20, w25, [x0, #32]
	ldp	w26, w27, [x0, #40]
	ldr	x8, [x0, #48]
	cbz	x8, LBB0_2
; %bb.1:
	cmp	w24, #0
	cinc	w8, w24, lt
	add	w9, w25, w20
	add	w10, w9, w26
	add	w8, w9, w8, asr #1
	sub	w8, w8, #1
	stp	w8, w10, [sp, #20]              ; 8-byte Folded Spill
	add	w8, w8, w26
	str	w8, [sp, #28]                   ; 4-byte Folded Spill
	b	LBB0_3
LBB0_2:
	str	xzr, [sp, #24]                  ; 8-byte Folded Spill
	str	wzr, [sp, #20]                  ; 4-byte Folded Spill
LBB0_3:
	mov	x0, x22
	bl	_V4L2_DV_BT_FRAME_WIDTH
	mov	x23, x0
	mov	x0, x22
	bl	_V4L2_DV_BT_FRAME_HEIGHT
	mov	x22, x0
Lloh0:
	adrp	x8, _REG_FDW_S@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REG_FDW_S@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #751
	bl	_io_write16
Lloh3:
	adrp	x8, _REG_FDW_E@GOTPAGE
Lloh4:
	ldr	x8, [x8, _REG_FDW_E@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #321
	bl	_io_write16
	ldr	x8, [x21]
Lloh6:
	adrp	x9, _REG_PXCNT_PR@GOTPAGE
Lloh7:
	ldr	x9, [x9, _REG_PXCNT_PR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x9]
	cmp	x8, #0
	mov	w8, #4
	csinc	w2, w8, wzr, eq
	mov	x0, x19
	bl	_io_write16
	ldp	w8, w9, [sp, #4]                ; 8-byte Folded Reload
	add	w8, w28, w8
	add	w21, w8, w27
	add	w8, w8, w24
	add	w8, w8, w20
	add	w8, w8, w25
	add	w20, w8, w26
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	add	w8, w8, w9
	add	w24, w8, #1
Lloh9:
	adrp	x8, _REG_PXCNT_NPIX@GOTPAGE
Lloh10:
	ldr	x8, [x8, _REG_PXCNT_NPIX@GOTPAGEOFF]
	ldr	w9, [sp, #16]                   ; 4-byte Folded Reload
	add	w25, w24, w9
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x26, _MASK_VHREF@GOTPAGE
Lloh13:
	ldr	x26, [x26, _MASK_VHREF@GOTPAGEOFF]
	ldr	w8, [x26]
	and	w2, w8, w23
	mov	x0, x19
	bl	_io_write16
Lloh14:
	adrp	x8, _REG_LCNT_PR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _REG_LCNT_PR@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_io_write16
Lloh17:
	adrp	x8, _REG_LCNT_NLIN@GOTPAGE
Lloh18:
	ldr	x8, [x8, _REG_LCNT_NLIN@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	ldr	w8, [x26]
	and	w2, w8, w22
	mov	x0, x19
	bl	_io_write16
Lloh20:
	adrp	x8, _VHREF_STD_DET_OFF@GOTPAGE
Lloh21:
	ldr	x8, [x8, _VHREF_STD_DET_OFF@GOTPAGEOFF]
Lloh22:
	adrp	x9, _VHREF_STD_DET_SHIFT@GOTPAGE
Lloh23:
	ldr	x9, [x9, _VHREF_STD_DET_SHIFT@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	ldr	w9, [x9]
	lsl	w2, w8, w9
Lloh26:
	adrp	x8, _REG_VHREF_CTRL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _REG_VHREF_CTRL@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_io_write
Lloh29:
	adrp	x8, _REG_HREF_S@GOTPAGE
Lloh30:
	ldr	x8, [x8, _REG_HREF_S@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	ldr	w8, [x26]
	and	w2, w8, w24
	mov	x0, x19
	bl	_io_write16
Lloh32:
	adrp	x8, _REG_HREF_E@GOTPAGE
Lloh33:
	ldr	x8, [x8, _REG_HREF_E@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	ldr	w8, [x26]
	and	w2, w8, w25
	mov	x0, x19
	bl	_io_write16
Lloh35:
	adrp	x8, _REG_VREF_F1_S@GOTPAGE
Lloh36:
	ldr	x8, [x8, _REG_VREF_F1_S@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
	ldr	w8, [x26]
	and	w2, w8, w20
	mov	x0, x19
	bl	_io_write16
Lloh38:
	adrp	x8, _REG_VREF_F1_WIDTH@GOTPAGE
Lloh39:
	ldr	x8, [x8, _REG_VREF_F1_WIDTH@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_io_write
Lloh41:
	adrp	x8, _REG_VREF_F2_S@GOTPAGE
Lloh42:
	ldr	x8, [x8, _REG_VREF_F2_S@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
	ldr	w8, [x26]
	ldr	w9, [sp, #20]                   ; 4-byte Folded Reload
	and	w2, w8, w9
	mov	x0, x19
	bl	_io_write16
Lloh44:
	adrp	x8, _REG_VREF_F2_WIDTH@GOTPAGE
Lloh45:
	ldr	x8, [x8, _REG_VREF_F2_WIDTH@GOTPAGEOFF]
Lloh46:
	ldr	w1, [x8]
	mov	x0, x19
	ldr	w2, [sp, #24]                   ; 4-byte Folded Reload
	bl	_io_write
Lloh47:
	adrp	x8, _REG_FREF_F1_S@GOTPAGE
Lloh48:
	ldr	x8, [x8, _REG_FREF_F1_S@GOTPAGEOFF]
Lloh49:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_io_write16
	ldr	w8, [x26]
	ldr	w9, [sp, #28]                   ; 4-byte Folded Reload
	and	w2, w8, w9
Lloh50:
	adrp	x8, _REG_FREF_F2_S@GOTPAGE
Lloh51:
	ldr	x8, [x8, _REG_FREF_F2_S@GOTPAGEOFF]
Lloh52:
	ldr	w1, [x8]
	mov	x0, x19
	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
	b	_io_write16
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh24
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_FDW_S,4,2                  ; @REG_FDW_S
	.comm	_REG_FDW_E,4,2                  ; @REG_FDW_E
	.comm	_REG_PXCNT_PR,4,2               ; @REG_PXCNT_PR
	.comm	_REG_PXCNT_NPIX,4,2             ; @REG_PXCNT_NPIX
	.comm	_MASK_VHREF,4,2                 ; @MASK_VHREF
	.comm	_REG_LCNT_PR,4,2                ; @REG_LCNT_PR
	.comm	_REG_LCNT_NLIN,4,2              ; @REG_LCNT_NLIN
	.comm	_VHREF_STD_DET_OFF,4,2          ; @VHREF_STD_DET_OFF
	.comm	_VHREF_STD_DET_SHIFT,4,2        ; @VHREF_STD_DET_SHIFT
	.comm	_REG_VHREF_CTRL,4,2             ; @REG_VHREF_CTRL
	.comm	_REG_HREF_S,4,2                 ; @REG_HREF_S
	.comm	_REG_HREF_E,4,2                 ; @REG_HREF_E
	.comm	_REG_VREF_F1_S,4,2              ; @REG_VREF_F1_S
	.comm	_REG_VREF_F1_WIDTH,4,2          ; @REG_VREF_F1_WIDTH
	.comm	_REG_VREF_F2_S,4,2              ; @REG_VREF_F2_S
	.comm	_REG_VREF_F2_WIDTH,4,2          ; @REG_VREF_F2_WIDTH
	.comm	_REG_FREF_F1_S,4,2              ; @REG_FREF_F1_S
	.comm	_REG_FREF_F2_S,4,2              ; @REG_FREF_F2_S
	.no_dead_strip	_tda1997x_configure_vhref
.subsections_via_symbols
