	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_tv_compute_config
_intel_tv_compute_config:               ## @intel_tv_compute_config
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rsi, %r15
	movl	(%rdi), %edi
	callq	_to_i915
	movq	%rax, %r12
	movq	%r13, %rdi
	callq	_to_intel_tv_connector_state
	movq	%rax, %rbx
	movq	%r13, %rdi
	callq	_intel_tv_mode_find
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	_DRM_MODE_FLAG_DBLSCAN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 24(%r15)
	je	LBB0_3
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	leaq	16(%r15), %r12
	movl	16(%r15), %ebx
	movl	20(%r15), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_INTEL_OUTPUT_FORMAT_RGB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG_KMS
	movl	$24, (%r15)
	movl	4(%r14), %eax
	movl	%eax, 4(%r15)
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_intel_tv_mode_to_mode
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movl	-48(%rbp), %r12d                ## 4-byte Reload
	xorl	%esi, %esi
	callq	_drm_mode_set_crtcinfo
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %esi
	callq	_intel_tv_source_too_wide
	testq	%rax, %rax
	je	LBB0_4
LBB0_5:
	movl	20(%r15), %ecx
	subl	%r12d, %ecx
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	js	LBB0_11
## %bb.6:
	movl	(%r13), %eax
	movl	4(%r13), %esi
	addl	%eax, %esi
	je	LBB0_8
## %bb.7:
	imull	%ecx, %eax
	cltd
	idivl	%esi
	jmp	LBB0_9
LBB0_4:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movl	%r12d, %edx
	callq	_intel_tv_vert_scaling
	testl	%eax, %eax
	je	LBB0_5
## %bb.12:
	movl	(%r13), %eax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	%eax, 4(%rbx)
	movl	4(%r13), %eax
	movl	%eax, 8(%rbx)
	movl	$0, (%rbx)
	jmp	LBB0_13
LBB0_11:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_DEBUG_KMS
	jmp	LBB0_1
LBB0_8:
	movl	%ecx, %eax
	shrl	%eax
LBB0_9:
	subl	%eax, %ecx
	movl	%eax, 4(%rbx)
	movl	%ecx, 8(%rbx)
	movl	$1, (%rbx)
	cmpl	$0, (%r14)
	jne	LBB0_13
## %bb.10:
	movl	28(%r15), %eax
	movl	32(%r15), %ecx
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	movl	%edx, 28(%r15)
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, 32(%r15)
	movq	_DRM_MODE_FLAG_INTERLACE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 24(%r15)
LBB0_13:
	leaq	L_.str.2(%rip), %rdi
	callq	_DRM_DEBUG_KMS
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_drm_mode_debug_printmodeline
	movl	8(%r13), %ecx
	movl	12(%r13), %edx
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_intel_tv_scale_mode_horiz
	movl	4(%rbx), %edx
	movl	8(%rbx), %ecx
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_intel_tv_scale_mode_vert
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_drm_mode_set_crtcinfo
	movq	40(%r15), %rax
	movb	$0, (%rax)
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_IS_I965GM
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:
	movq	_I915_MODE_FLAG_USE_SCANLINE_COUNTER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 48(%r15)
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DRM_MODE_FLAG_DBLSCAN,4,2      ## @DRM_MODE_FLAG_DBLSCAN
	.comm	_INTEL_OUTPUT_FORMAT_RGB,4,2    ## @INTEL_OUTPUT_FORMAT_RGB
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"forcing bpc to 8 for TV\n"

L_.str.1:                               ## @.str.1
	.asciz	"No vertical scaling for >1024 pixel wide modes\n"

	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ## @DRM_MODE_FLAG_INTERLACE
L_.str.2:                               ## @.str.2
	.asciz	"TV mode:\n"

	.comm	_I915_MODE_FLAG_USE_SCANLINE_COUNTER,4,2 ## @I915_MODE_FLAG_USE_SCANLINE_COUNTER
	.no_dead_strip	_intel_tv_compute_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_tv_compute_config
_intel_tv_compute_config:               ; @intel_tv_compute_config
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x2
	mov	x19, x1
	ldr	w0, [x0]
	bl	_to_i915
	mov	x20, x0
	mov	x0, x21
	bl	_to_intel_tv_connector_state
	mov	x22, x0
	mov	x0, x21
	bl	_intel_tv_mode_find
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w8, [x19, #24]
Lloh0:
	adrp	x9, _DRM_MODE_FLAG_DBLSCAN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DRM_MODE_FLAG_DBLSCAN@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
LBB0_2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_4:
	mov	x26, x0
	mov	x23, x19
	ldp	w25, w24, [x23, #16]!
Lloh6:
	adrp	x8, _INTEL_OUTPUT_FORMAT_RGB@GOTPAGE
Lloh7:
	ldr	x8, [x8, _INTEL_OUTPUT_FORMAT_RGB@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x19, #8]
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_KMS
	mov	w8, #24
	ldr	w9, [x26, #4]
	stp	w8, w9, [x19]
	mov	x0, x23
	mov	x1, x26
	bl	_intel_tv_mode_to_mode
	mov	x0, x23
	mov	w1, #0
	bl	_drm_mode_set_crtcinfo
	mov	x0, x20
	mov	x1, x25
	bl	_intel_tv_source_too_wide
	cbz	x0, LBB0_8
LBB0_5:
	ldr	w8, [x19, #20]
	subs	w8, w8, w24
	b.mi	LBB0_12
; %bb.6:
	ldp	w9, w10, [x21]
	adds	w10, w10, w9
	lsr	w11, w8, #1
	mul	w9, w9, w8
	sdiv	w9, w9, w10
	csel	w9, w11, w9, eq
	sub	w8, w8, w9
	stp	w9, w8, [x22, #4]
	mov	w8, #1
	str	w8, [x22]
	ldr	w8, [x26]
	cbnz	w8, LBB0_10
; %bb.7:
	ldp	w9, w8, [x19, #24]
	cmp	w8, #0
	cinc	w8, w8, lt
	ldr	w10, [x19, #32]
	cmp	w10, #0
	cinc	w10, w10, lt
	asr	w10, w10, #1
Lloh11:
	adrp	x11, _DRM_MODE_FLAG_INTERLACE@GOTPAGE
Lloh12:
	ldr	x11, [x11, _DRM_MODE_FLAG_INTERLACE@GOTPAGEOFF]
	str	w10, [x19, #32]
Lloh13:
	ldr	w10, [x11]
	orr	w9, w9, w10
	asr	w8, w8, #1
	stp	w9, w8, [x19, #24]
	b	LBB0_10
LBB0_8:
	mov	x0, x23
	mov	x1, x21
	mov	x2, x24
	bl	_intel_tv_vert_scaling
	cbz	w0, LBB0_5
; %bb.9:
	ldr	d0, [x21]
	stur	d0, [x22, #4]
	str	wzr, [x22]
LBB0_10:
Lloh14:
	adrp	x0, l_.str.2@PAGE
Lloh15:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_DEBUG_KMS
	mov	x0, x23
	bl	_drm_mode_debug_printmodeline
	ldp	w3, w2, [x21, #8]
	mov	x0, x23
	mov	x1, x25
	bl	_intel_tv_scale_mode_horiz
	ldp	w2, w3, [x22, #4]
	mov	x0, x23
	mov	x1, x24
	bl	_intel_tv_scale_mode_vert
	mov	x0, x23
	mov	w1, #0
	bl	_drm_mode_set_crtcinfo
	ldr	x8, [x19, #40]
	strb	wzr, [x8]
	mov	x0, x20
	bl	_IS_I965GM
	cbz	x0, LBB0_3
; %bb.11:
	mov	w0, #0
Lloh16:
	adrp	x8, _I915_MODE_FLAG_USE_SCANLINE_COUNTER@GOTPAGE
Lloh17:
	ldr	x8, [x8, _I915_MODE_FLAG_USE_SCANLINE_COUNTER@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	ldr	w9, [x19, #48]
	orr	w8, w9, w8
	str	w8, [x19, #48]
	b	LBB0_3
LBB0_12:
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG_KMS
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DRM_MODE_FLAG_DBLSCAN,4,2      ; @DRM_MODE_FLAG_DBLSCAN
	.comm	_INTEL_OUTPUT_FORMAT_RGB,4,2    ; @INTEL_OUTPUT_FORMAT_RGB
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"forcing bpc to 8 for TV\n"

l_.str.1:                               ; @.str.1
	.asciz	"No vertical scaling for >1024 pixel wide modes\n"

	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ; @DRM_MODE_FLAG_INTERLACE
l_.str.2:                               ; @.str.2
	.asciz	"TV mode:\n"

	.comm	_I915_MODE_FLAG_USE_SCANLINE_COUNTER,4,2 ; @I915_MODE_FLAG_USE_SCANLINE_COUNTER
	.no_dead_strip	_intel_tv_compute_config
.subsections_via_symbols
