	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv17_tv_mode_valid
_nv17_tv_mode_valid:                    ## @nv17_tv_mode_valid
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	callq	_get_tv_norm
	movq	%rax, %rbx
	movq	(%rax), %rcx
	movq	_CTV_ENC_MODE@GOTPCREL(%rip), %rdx
	movl	(%r14), %eax
	cmpq	(%rdx), %rcx
	jne	LBB0_3
## %bb.1:
	cmpl	$400000, %eax                   ## imm = 0x61A80
	jg	LBB0_2
## %bb.5:
	movq	8(%r14), %rcx
	movq	_MODE_BAD@GOTPCREL(%rip), %rax
	cmpq	24(%rbx), %rcx
	jg	LBB0_16
## %bb.6:
	movq	16(%r14), %rcx
	cmpq	32(%rbx), %rcx
	jg	LBB0_16
## %bb.7:
	movl	24(%r14), %eax
	movq	_DRM_MODE_FLAG_INTERLACE@GOTPCREL(%rip), %rcx
	movl	40(%rbx), %edx
	xorl	%eax, %edx
	testl	%edx, (%rcx)
	jne	LBB0_8
## %bb.13:
	movq	_DRM_MODE_FLAG_DBLSCAN@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_15
## %bb.14:
	movq	_MODE_NO_DBLESCAN@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_3:
	cmpl	$70000, %eax                    ## imm = 0x11170
	jle	LBB0_9
LBB0_2:
	movq	_MODE_CLOCK_HIGH@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_9:
	movq	%r14, %rdi
	callq	_drm_mode_vrefresh
	imull	$1000, %eax, %eax               ## imm = 0x3E8
	movslq	%eax, %rdi
	subq	8(%rbx), %rdi
	callq	_abs
	cmpl	$600, %eax                      ## imm = 0x258
	jle	LBB0_11
## %bb.10:
	movq	_MODE_VSYNC@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_11:
	movq	_DRM_MODE_FLAG_INTERLACE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 24(%r14)
	je	LBB0_15
LBB0_8:
	movq	_MODE_NO_INTERLACE@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_15:
	movq	_MODE_OK@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CTV_ENC_MODE,8,3               ## @CTV_ENC_MODE
	.comm	_MODE_CLOCK_HIGH,4,2            ## @MODE_CLOCK_HIGH
	.comm	_MODE_BAD,4,2                   ## @MODE_BAD
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ## @DRM_MODE_FLAG_INTERLACE
	.comm	_MODE_NO_INTERLACE,4,2          ## @MODE_NO_INTERLACE
	.comm	_DRM_MODE_FLAG_DBLSCAN,4,2      ## @DRM_MODE_FLAG_DBLSCAN
	.comm	_MODE_NO_DBLESCAN,4,2           ## @MODE_NO_DBLESCAN
	.comm	_MODE_VSYNC,4,2                 ## @MODE_VSYNC
	.comm	_MODE_OK,4,2                    ## @MODE_OK
	.no_dead_strip	_nv17_tv_mode_valid
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv17_tv_mode_valid
_nv17_tv_mode_valid:                    ; @nv17_tv_mode_valid
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	bl	_get_tv_norm
	mov	x20, x0
	ldr	x9, [x0]
Lloh0:
	adrp	x8, _CTV_ENC_MODE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CTV_ENC_MODE@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x8]
	ldr	w8, [x19]
	cmp	x9, x10
	b.ne	LBB0_5
; %bb.1:
	mov	w9, #6784
	movk	w9, #6, lsl #16
	cmp	w8, w9
	b.gt	LBB0_6
; %bb.2:
	ldr	x8, [x19, #8]
	ldr	x9, [x20, #24]
	cmp	x8, x9
	b.gt	LBB0_4
; %bb.3:
	ldr	x8, [x19, #16]
	ldr	x9, [x20, #32]
	cmp	x8, x9
	b.le	LBB0_11
LBB0_4:
Lloh3:
	adrp	x8, _MODE_BAD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MODE_BAD@GOTPAGEOFF]
	b	LBB0_13
LBB0_5:
	mov	w9, #4464
	movk	w9, #1, lsl #16
	cmp	w8, w9
	b.le	LBB0_7
LBB0_6:
Lloh5:
	adrp	x8, _MODE_CLOCK_HIGH@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MODE_CLOCK_HIGH@GOTPAGEOFF]
	b	LBB0_13
LBB0_7:
	mov	x0, x19
	bl	_drm_mode_vrefresh
	mov	w8, #1000
	mul	w8, w0, w8
	sxtw	x8, w8
	ldr	x9, [x20, #8]
	sub	x0, x8, x9
	bl	_abs
	cmp	w0, #600
	b.le	LBB0_9
; %bb.8:
Lloh7:
	adrp	x8, _MODE_VSYNC@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MODE_VSYNC@GOTPAGEOFF]
	b	LBB0_13
LBB0_9:
	ldr	w8, [x19, #24]
Lloh9:
	adrp	x9, _DRM_MODE_FLAG_INTERLACE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _DRM_MODE_FLAG_INTERLACE@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_12
LBB0_10:
Lloh12:
	adrp	x8, _MODE_OK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MODE_OK@GOTPAGEOFF]
	b	LBB0_13
LBB0_11:
	ldr	w8, [x19, #24]
Lloh14:
	adrp	x9, _DRM_MODE_FLAG_INTERLACE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _DRM_MODE_FLAG_INTERLACE@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	ldr	w10, [x20, #40]
	eor	w10, w10, w8
	tst	w10, w9
	b.eq	LBB0_14
LBB0_12:
Lloh17:
	adrp	x8, _MODE_NO_INTERLACE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MODE_NO_INTERLACE@GOTPAGEOFF]
LBB0_13:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_14:
Lloh19:
	adrp	x9, _DRM_MODE_FLAG_DBLSCAN@GOTPAGE
Lloh20:
	ldr	x9, [x9, _DRM_MODE_FLAG_DBLSCAN@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.15:
Lloh22:
	adrp	x8, _MODE_NO_DBLESCAN@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MODE_NO_DBLESCAN@GOTPAGEOFF]
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_CTV_ENC_MODE,8,3               ; @CTV_ENC_MODE
	.comm	_MODE_CLOCK_HIGH,4,2            ; @MODE_CLOCK_HIGH
	.comm	_MODE_BAD,4,2                   ; @MODE_BAD
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ; @DRM_MODE_FLAG_INTERLACE
	.comm	_MODE_NO_INTERLACE,4,2          ; @MODE_NO_INTERLACE
	.comm	_DRM_MODE_FLAG_DBLSCAN,4,2      ; @DRM_MODE_FLAG_DBLSCAN
	.comm	_MODE_NO_DBLESCAN,4,2           ; @MODE_NO_DBLESCAN
	.comm	_MODE_VSYNC,4,2                 ; @MODE_VSYNC
	.comm	_MODE_OK,4,2                    ; @MODE_OK
	.no_dead_strip	_nv17_tv_mode_valid
.subsections_via_symbols
