	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vlv_compute_drain_latency
_vlv_compute_drain_latency:             ## @vlv_compute_drain_latency
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r14
	movq	%r8, %r15
	movq	%rcx, %r12
	movq	%rdx, %r13
	callq	_intel_get_crtc_for_plane
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_intel_crtc_active
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movslq	8(%rbx), %r9
	movq	(%rbx), %rax
	movl	(%rax), %eax
	leal	7(%rax), %edi
	testl	%eax, %eax
	cmovnsl	%eax, %edi
	sarl	$3, %edi
	imulq	$274877907, %r9, %rcx           ## imm = 0x10624DD3
	movq	%rcx, %rax
	shrq	$63, %rax
	sarq	$38, %rcx
	addl	%eax, %ecx
	imull	%ecx, %edi
	cmpl	$257, %edi                      ## imm = 0x101
	movq	_DRAIN_LATENCY_PRECISION_32@GOTPCREL(%rip), %r8
	movq	_DRAIN_LATENCY_PRECISION_16@GOTPCREL(%rip), %rbx
	movq	%rbx, %rax
	cmovgeq	%r8, %rax
	movl	(%rax), %esi
	movl	%esi, %eax
	shll	$8, %eax
	cltd
	idivl	%edi
	shll	$2, %ecx
	cmpq	$65000, %r9                     ## imm = 0xFDE8
	movl	%esi, (%r13)
	cmovgeq	%r8, %rbx
	movl	%eax, (%r12)
	movl	(%rbx), %eax
	movl	%eax, (%r15)
	shll	$8, %eax
	cltd
	idivl	%ecx
	movl	%eax, (%r14)
	movl	$1, %eax
	jmp	LBB0_3
LBB0_1:
	xorl	%eax, %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRAIN_LATENCY_PRECISION_32,4,2 ## @DRAIN_LATENCY_PRECISION_32
	.comm	_DRAIN_LATENCY_PRECISION_16,4,2 ## @DRAIN_LATENCY_PRECISION_16
	.no_dead_strip	_vlv_compute_drain_latency
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vlv_compute_drain_latency
_vlv_compute_drain_latency:             ; @vlv_compute_drain_latency
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x5
	mov	x20, x4
	mov	x21, x3
	mov	x22, x2
	bl	_intel_get_crtc_for_plane
	mov	x23, x0
	bl	_intel_crtc_active
	cbz	w0, LBB0_2
; %bb.1:
	ldrsw	x8, [x23, #8]
	ldr	x9, [x23]
	ldr	w9, [x9]
	add	w10, w9, #7
	cmp	w9, #0
	csel	w9, w10, w9, lt
	asr	w9, w9, #3
	mov	w10, #19923
	movk	w10, #4194, lsl #16
	mul	x10, x8, x10
	lsr	x11, x10, #63
	asr	x10, x10, #38
	add	w10, w10, w11
Lloh0:
	adrp	x11, _DRAIN_LATENCY_PRECISION_32@GOTPAGE
Lloh1:
	ldr	x11, [x11, _DRAIN_LATENCY_PRECISION_32@GOTPAGEOFF]
Lloh2:
	adrp	x12, _DRAIN_LATENCY_PRECISION_16@GOTPAGE
Lloh3:
	ldr	x12, [x12, _DRAIN_LATENCY_PRECISION_16@GOTPAGEOFF]
	mul	w9, w9, w10
	cmp	w9, #256
	csel	x13, x11, x12, gt
	ldr	w13, [x13]
	str	w13, [x22]
	lsl	w13, w13, #8
	sdiv	w9, w13, w9
	str	w9, [x21]
	lsl	w9, w10, #2
	mov	w10, #64999
	cmp	w8, w10
	csel	x8, x11, x12, gt
	ldr	w8, [x8]
	str	w8, [x20]
	lsl	w8, w8, #8
	sdiv	w8, w8, w9
	str	w8, [x19]
	mov	w0, #1
LBB0_2:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_DRAIN_LATENCY_PRECISION_32,4,2 ; @DRAIN_LATENCY_PRECISION_32
	.comm	_DRAIN_LATENCY_PRECISION_16,4,2 ; @DRAIN_LATENCY_PRECISION_16
	.no_dead_strip	_vlv_compute_drain_latency
.subsections_via_symbols
