	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tda1997x_detect_std
_tda1997x_detect_std:                   ## @tda1997x_detect_std
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	leaq	4(%rdi), %r13
	movq	_REG_V_PER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_io_read24
	movl	%eax, %ebx
	movq	_MASK_VPER@GOTPCREL(%rip), %rax
	movq	_REG_H_PER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%rax), %r15d
	movq	%r13, %rdi
	callq	_io_read16
	movl	%eax, %r14d
	movq	_MASK_HPER@GOTPCREL(%rip), %rax
	andl	(%rax), %r14d
	movq	_REG_HS_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_io_read16
	movq	_MASK_HSWIDTH@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_debug@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%eax, (%rsp)
	leaq	L_.str(%rip), %rcx
	movl	%ebx, %r8d
	andl	%r15d, %r8d
	movl	$1, %edi
	movq	%r13, %rdx
	movl	%r14d, %r9d
	callq	_v4l2_dbg
	andl	%r15d, %ebx
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	je	LBB0_19
## %bb.1:
	movl	%r14d, %ecx
	testl	%r14d, %r14d
	je	LBB0_19
## %bb.2:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_19
## %bb.3:
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movq	_v4l2_dv_timings_presets@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	cmpq	$0, 24(%r15)
	je	LBB0_16
## %bb.4:
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_5 Depth=1
	incq	%r13
	movq	(%r15), %r15
	cmpq	$0, 56(%r15,%r14)
	leaq	32(%r14), %r14
	je	LBB0_16
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(%r15,%r14), %rbx
	movq	%rbx, %rdi
	callq	_V4L2_DV_BT_FRAME_WIDTH
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_V4L2_DV_BT_FRAME_HEIGHT
	movl	%eax, %ebx
	movl	8(%r15,%r14), %edi
	movl	%edi, %eax
	cltd
	idivl	%r12d
	movl	%eax, %esi
	cmpq	$0, 16(%r15,%r14)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%ebx, %eax
	shrl	$31, %eax
	addl	%ebx, %eax
	sarl	%eax
	movl	%eax, %ebx
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	$26811000, %eax                 ## imm = 0x1991A78
	xorl	%edx, %edx
	idivl	%esi
	movl	%eax, %r8d
	movl	$27189000, %eax                 ## imm = 0x19EDF08
	xorl	%edx, %edx
	idivl	%esi
	movl	%eax, %r10d
	movl	$26730000, %eax                 ## imm = 0x197DE10
	xorl	%edx, %edx
	idivl	%esi
	movl	%eax, %r9d
	movl	$27270000, %eax                 ## imm = 0x1A01B70
	xorl	%edx, %edx
	idivl	%esi
	movl	%eax, %esi
	imull	$27000, (%r15,%r14), %eax       ## imm = 0x6978
	movslq	%edi, %rdx
	imulq	$274877907, %rdx, %rdi          ## imm = 0x10624DD3
	movq	%rdi, %rdx
	shrq	$63, %rdx
	sarq	$38, %rdi
	addl	%edx, %edi
	cltd
	idivl	%edi
                                        ## kill: def $eax killed $eax def $rax
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	cmpl	%r9d, %ecx
	movq	_v4l2_dv_timings_presets@GOTPCREL(%rip), %r15
	jl	LBB0_15
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	%esi, %ecx
	jg	LBB0_15
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	imull	%ebx, %r10d
	cmpl	%r10d, -48(%rbp)                ## 4-byte Folded Reload
	jg	LBB0_15
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	imull	%r8d, %ebx
	cmpl	%ebx, -48(%rbp)                 ## 4-byte Folded Reload
	jl	LBB0_15
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	leal	2(%rax), %edx
	cmpl	%edx, -44(%rbp)                 ## 4-byte Folded Reload
	jg	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_5 Depth=1
	addl	$-2, %eax
	cmpl	%eax, -44(%rbp)                 ## 4-byte Folded Reload
	jl	LBB0_15
## %bb.13:
	movl	%r13d, %r14d
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	shlq	$5, %r14
	movq	(%r15), %rdx
	addq	%r14, %rdx
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%ecx, %ecx
	callq	_v4l2_print_dv_timings
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	je	LBB0_18
## %bb.14:
	movq	(%r15), %rax
	movups	(%rax,%r14), %xmm0
	movups	16(%rax,%r14), %xmm1
	movups	%xmm1, 16(%rcx)
	movups	%xmm0, (%rcx)
	jmp	LBB0_18
LBB0_19:
	movq	_ENOLINK@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_16:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	callq	_v4l_err
	movq	_ERANGE@GOTPCREL(%rip), %rax
LBB0_17:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_18:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_V_PER,4,2                  ## @REG_V_PER
	.comm	_MASK_VPER,4,2                  ## @MASK_VPER
	.comm	_REG_H_PER,4,2                  ## @REG_H_PER
	.comm	_MASK_HPER,4,2                  ## @MASK_HPER
	.comm	_REG_HS_WIDTH,4,2               ## @REG_HS_WIDTH
	.comm	_MASK_HSWIDTH,4,2               ## @MASK_HSWIDTH
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Signal Timings: %u/%u/%u\n"

	.comm	_ENOLINK,4,2                    ## @ENOLINK
	.comm	_v4l2_dv_timings_presets,8,3    ## @v4l2_dv_timings_presets
L_.str.1:                               ## @.str.1
	.asciz	"Detected format: "

L_.str.2:                               ## @.str.2
	.asciz	"no resolution match for timings: %d/%d/%d\n"

	.comm	_ERANGE,4,2                     ## @ERANGE
	.no_dead_strip	_tda1997x_detect_std
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tda1997x_detect_std
_tda1997x_detect_std:                   ; @tda1997x_detect_std
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x1
	mov	x20, x0
	add	x21, x0, #4
Lloh0:
	adrp	x8, _REG_V_PER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REG_V_PER@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_io_read24
Lloh3:
	adrp	x8, _MASK_VPER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MASK_VPER@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w22, w8, w0
Lloh6:
	adrp	x8, _REG_H_PER@GOTPAGE
Lloh7:
	ldr	x8, [x8, _REG_H_PER@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_io_read16
Lloh9:
	adrp	x8, _MASK_HPER@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MASK_HPER@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	and	w23, w8, w0
Lloh12:
	adrp	x8, _REG_HS_WIDTH@GOTPAGE
Lloh13:
	ldr	x8, [x8, _REG_HS_WIDTH@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_io_read16
Lloh15:
	adrp	x8, _MASK_HSWIDTH@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MASK_HSWIDTH@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	and	w24, w8, w0
Lloh18:
	adrp	x8, _debug@GOTPAGE
Lloh19:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x3, l_.str@PAGE
Lloh22:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x21
	mov	x4, x22
	mov	x5, x23
	mov	x6, x24
	bl	_v4l2_dbg
	cmp	w22, #0
	ccmp	w23, #0, #4, ne
	ccmp	w24, #0, #4, ne
	b.ne	LBB0_2
; %bb.1:
Lloh23:
	adrp	x8, _ENOLINK@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENOLINK@GOTPAGEOFF]
	b	LBB0_14
LBB0_2:
	stp	x19, x20, [sp]                  ; 16-byte Folded Spill
Lloh25:
	adrp	x20, _v4l2_dv_timings_presets@GOTPAGE
Lloh26:
	ldr	x20, [x20, _v4l2_dv_timings_presets@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	x9, [x8, #24]
	cbz	x9, LBB0_13
; %bb.3:
	mov	x19, #0
	mov	x28, #0
	mov	w27, #56848
	movk	w27, #407, lsl #16
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x28, x28, #1
	ldr	x8, [x20]
	add	x9, x8, x19
	ldr	x9, [x9, #56]
	add	x19, x19, #32
	cbz	x9, LBB0_13
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	x25, x8, x19
	mov	x0, x25
	bl	_V4L2_DV_BT_FRAME_WIDTH
	mov	x26, x0
	mov	x0, x25
	bl	_V4L2_DV_BT_FRAME_HEIGHT
	ldrsw	x8, [x25, #8]
	sdiv	w9, w8, w26
	ldr	x10, [x25, #16]
	cmp	w0, #0
	cinc	w11, w0, lt
	asr	w11, w11, #1
	cmp	x10, #0
	csel	w10, w0, w11, eq
	sdiv	w11, w27, w9
	cmp	w23, w11
	b.lt	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w11, #7024
	movk	w11, #416, lsl #16
	sdiv	w11, w11, w9
	cmp	w23, w11
	b.gt	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w11, #57096
	movk	w11, #414, lsl #16
	sdiv	w11, w11, w9
	mul	w11, w11, w10
	cmp	w22, w11
	b.gt	LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w11, #6776
	movk	w11, #409, lsl #16
	sdiv	w9, w11, w9
	mul	w9, w10, w9
	cmp	w22, w9
	b.lt	LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w9, [x25]
	mov	w10, #27000
	mul	w9, w9, w10
	mov	w10, #19923
	movk	w10, #4194, lsl #16
	mul	x8, x8, x10
	lsr	x10, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w10
	sdiv	w8, w9, w8
	add	w9, w8, #2
	cmp	w24, w9
	b.gt	LBB0_4
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	sub	w8, w8, #2
	cmp	w24, w8
	b.lt	LBB0_4
; %bb.11:
	and	x19, x28, #0xffffffff
	ldr	w0, [x21]
	ldr	x8, [x20]
	add	x2, x8, x19, lsl #5
Lloh27:
	adrp	x1, l_.str.1@PAGE
Lloh28:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w3, #0
	bl	_v4l2_print_dv_timings
	ldr	x9, [sp]                        ; 8-byte Folded Reload
	cbz	x9, LBB0_16
; %bb.12:
	mov	w0, #0
	ldr	x8, [x20]
	add	x8, x8, x19, lsl #5
	ldp	q0, q1, [x8]
	stp	q0, q1, [x9]
	b	LBB0_15
LBB0_13:
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	ldr	w0, [x8]
Lloh29:
	adrp	x1, l_.str.2@PAGE
Lloh30:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x22
	mov	x3, x23
	mov	x4, x24
	bl	_v4l_err
Lloh31:
	adrp	x8, _ERANGE@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_16:
	mov	w0, #0
	b	LBB0_15
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_V_PER,4,2                  ; @REG_V_PER
	.comm	_MASK_VPER,4,2                  ; @MASK_VPER
	.comm	_REG_H_PER,4,2                  ; @REG_H_PER
	.comm	_MASK_HPER,4,2                  ; @MASK_HPER
	.comm	_REG_HS_WIDTH,4,2               ; @REG_HS_WIDTH
	.comm	_MASK_HSWIDTH,4,2               ; @MASK_HSWIDTH
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Signal Timings: %u/%u/%u\n"

	.comm	_ENOLINK,4,2                    ; @ENOLINK
	.comm	_v4l2_dv_timings_presets,8,3    ; @v4l2_dv_timings_presets
l_.str.1:                               ; @.str.1
	.asciz	"Detected format: "

l_.str.2:                               ; @.str.2
	.asciz	"no resolution match for timings: %d/%d/%d\n"

	.comm	_ERANGE,4,2                     ; @ERANGE
	.no_dead_strip	_tda1997x_detect_std
.subsections_via_symbols
