	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function skl_compute_plane_wm
_skl_compute_plane_wm:                  ## @skl_compute_plane_wm
	.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	%r8, %r13
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r15
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movl	(%rax), %edi
	callq	_to_i915
	movq	%rax, %r12
	movq	8(%rax), %rax
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movslq	%ebx, %rcx
	movq	(%rax,%rcx,8), %rbx
	testq	%rbx, %rbx
	je	LBB0_38
## %bb.1:
	movq	%r12, %rdi
	callq	_IS_KABYLAKE
	testq	%rax, %rax
	jne	LBB0_4
## %bb.2:
	movq	%r12, %rdi
	callq	_IS_COFFEELAKE
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	cmpq	$0, (%r12)
	je	LBB0_5
LBB0_4:
	addq	$4, %rbx
LBB0_5:
	movq	%r12, %rdi
	callq	_skl_needs_memory_bw_wa
	testq	%rax, %rax
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_7
## %bb.6:
	leaq	15(%rbx), %rax
	cmpq	$0, 72(%r15)
	cmovneq	%rax, %rbx
LBB0_7:
	movl	64(%r15), %esi
	movl	(%r15), %edx
	movl	4(%r15), %r8d
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movq	%rbx, %rcx
	callq	_skl_wm_method1
	movl	%eax, %r12d
	movl	32(%r15), %ecx
	movl	64(%r15), %edi
	movl	(%r14), %esi
	movq	%rbx, %rdx
	callq	_skl_wm_method2
	movl	%eax, %r13d
	cmpq	$0, 40(%r15)
	je	LBB0_9
## %bb.8:
	movl	48(%r15), %esi
	movl	%r13d, %edi
	callq	_max_fixed16
	movl	%eax, %r13d
	jmp	LBB0_17
LBB0_9:
	movl	(%r14), %eax
	imull	(%r15), %eax
	movl	4(%r15), %ecx
	cltd
	idivl	%ecx
	testl	%eax, %eax
	jg	LBB0_11
## %bb.10:
	movl	8(%r15), %eax
	cltd
	idivl	%ecx
	testl	%eax, %eax
	jle	LBB0_17
LBB0_11:
	cmpq	16(%r15), %rbx
	jge	LBB0_13
## %bb.12:
	movl	%r12d, %r13d
LBB0_17:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
LBB0_18:
	movl	%r13d, %edi
	callq	_fixed16_to_u32_round_up
	movq	%rax, %rbx
	incq	%rbx
	movl	32(%r15), %esi
	movl	%r13d, %edi
	callq	_div_round_up_fixed16
	movq	%rax, %r14
	movq	%r12, %rdi
	callq	_IS_GEN9_BC
	testq	%rax, %rax
	jne	LBB0_20
## %bb.19:
	movq	%r12, %rdi
	callq	_IS_BROXTON
	testq	%rax, %rax
	je	LBB0_26
LBB0_20:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	testl	%eax, %eax
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_24
## %bb.21:
	decl	%eax
	cmpl	$6, %eax
	ja	LBB0_29
## %bb.22:
	cmpq	$0, 40(%r15)
	je	LBB0_27
## %bb.23:
	movl	48(%r15), %edi
	callq	_fixed16_to_u32_round_up
	addq	24(%r15), %r14
	jmp	LBB0_28
LBB0_24:
	cmpq	$0, 56(%r15)
	je	LBB0_29
## %bb.25:
	movl	48(%r15), %edi
	callq	_fixed16_to_u32_round_up
	addq	%rax, %rbx
	jmp	LBB0_29
LBB0_13:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	$9, %esi
	callq	_IS_GEN
	testq	%rax, %rax
	je	LBB0_16
## %bb.14:
	movl	%r12d, %r14d
	movq	%rbx, %rdi
	callq	_IS_GEMINILAKE
	testl	%eax, %eax
	movq	%rbx, %r12
	jne	LBB0_18
## %bb.15:
	movl	%r14d, %edi
	movl	%r13d, %esi
	callq	_min_fixed16
	movl	%eax, %r13d
	jmp	LBB0_18
LBB0_26:
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_29
LBB0_27:
	movl	$1, %eax
LBB0_28:
	addq	%rbx, %rax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	cmpq	%rax, %rcx
	cmovgq	%rcx, %rax
	movq	%rax, %rbx
LBB0_29:
	movq	%r12, %rdi
	callq	_INTEL_GEN
	cmpl	$11, %eax
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	jl	LBB0_33
## %bb.30:
	cmpq	$0, 40(%r15)
	je	LBB0_34
## %bb.31:
	movq	24(%r15), %rcx
	movq	%r14, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_35
## %bb.32:
	movq	%r14, %rax
	cqto
	idivq	%rcx
	jmp	LBB0_36
LBB0_33:
	xorl	%ebx, %ebx
	jmp	LBB0_37
LBB0_34:
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_DIV_ROUND_UP
	movq	%rbx, %rcx
	movq	%rax, %rbx
	addq	%rcx, %rbx
	jmp	LBB0_37
LBB0_35:
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
LBB0_36:
	leal	(%rcx,%rcx), %eax
	subl	%edx, %eax
	testq	%rdx, %rdx
	cmoveq	%rcx, %rax
	movslq	%eax, %rdi
	addq	%r14, %rdi
	movl	32(%r15), %esi
	callq	_mul_round_up_u32_fixed16
	movq	%rax, %rbx
LBB0_37:
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%r12, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_skl_wm_has_lines
	xorl	%ecx, %ecx
	testl	%eax, %eax
	cmoveq	%rcx, %r14
	cmpq	$32, %r14
	jl	LBB0_39
LBB0_38:
	movq	_U16_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%r13)
	jmp	LBB0_40
LBB0_39:
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	%rsi, (%r13)
	movq	%r14, 24(%r13)
	movq	%rbx, %rdi
	callq	_max
	incq	%rax
	movq	%rax, 16(%r13)
	movl	$1, 8(%r13)
LBB0_40:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	%rbx, %r12
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_U16_MAX,8,3                    ## @U16_MAX
	.no_dead_strip	_skl_compute_plane_wm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function skl_compute_plane_wm
_skl_compute_plane_wm:                  ; @skl_compute_plane_wm
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x4
	mov	x23, x3
	mov	x22, x2
	mov	x20, x1
	mov	x25, x0
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	bl	_to_i915
	ldr	x8, [x0, #8]
	ldr	x24, [x8, w20, sxtw #3]
	cbz	x24, LBB0_33
; %bb.1:
	mov	x21, x0
	bl	_IS_KABYLAKE
	cbnz	x0, LBB0_4
; %bb.2:
	mov	x0, x21
	bl	_IS_COFFEELAKE
	cbnz	x0, LBB0_4
; %bb.3:
	ldr	x8, [x21]
	cbz	x8, LBB0_5
LBB0_4:
	add	x24, x24, #4
LBB0_5:
	mov	x0, x21
	bl	_skl_needs_memory_bw_wa
	cbz	x0, LBB0_7
; %bb.6:
	ldr	x8, [x22, #72]
	add	x9, x24, #15
	cmp	x8, #0
	csel	x24, x24, x9, eq
LBB0_7:
	ldr	w1, [x22, #64]
	ldp	w2, w4, [x22]
	mov	x0, x21
	mov	x3, x24
	bl	_skl_wm_method1
	mov	x27, x0
	ldr	w0, [x22, #64]
	ldr	w1, [x25]
	ldr	w3, [x22, #32]
	mov	x2, x24
	bl	_skl_wm_method2
	mov	x26, x0
	ldr	x8, [x22, #40]
	cbz	x8, LBB0_16
; %bb.8:
	ldr	w1, [x22, #48]
	mov	x0, x26
	bl	_max_fixed16
LBB0_9:
	mov	x26, x0
LBB0_10:
	mov	x0, x26
	bl	_fixed16_to_u32_round_up
	add	x24, x0, #1
	ldr	w1, [x22, #32]
	mov	x0, x26
	bl	_div_round_up_fixed16
	mov	x25, x0
	mov	x0, x21
	bl	_IS_GEN9_BC
	cbnz	x0, LBB0_12
; %bb.11:
	mov	x0, x21
	bl	_IS_BROXTON
	cbz	x0, LBB0_27
LBB0_12:
	cbz	w20, LBB0_20
; %bb.13:
	sub	w8, w20, #1
	cmp	w8, #6
	b.hi	LBB0_27
; %bb.14:
	ldr	x8, [x22, #40]
	cbz	x8, LBB0_25
; %bb.15:
	ldr	w0, [x22, #48]
	bl	_fixed16_to_u32_round_up
	ldr	x8, [x22, #24]
	add	x25, x8, x25
	b	LBB0_26
LBB0_16:
	ldr	w9, [x25]
	ldp	w10, w8, [x22]
	mul	w9, w9, w10
	sdiv	w9, w9, w8
	cmp	w9, #0
	b.gt	LBB0_18
; %bb.17:
	ldr	w9, [x22, #8]
	sdiv	w8, w9, w8
	cmp	w8, #1
	b.lt	LBB0_10
LBB0_18:
	ldr	x8, [x22, #16]
	cmp	x24, x8
	b.ge	LBB0_22
; %bb.19:
	mov	x26, x27
	b	LBB0_10
LBB0_20:
	ldr	x8, [x22, #56]
	cbz	x8, LBB0_27
; %bb.21:
	ldr	w0, [x22, #48]
	bl	_fixed16_to_u32_round_up
	add	x24, x0, x24
	b	LBB0_27
LBB0_22:
	mov	x0, x21
	mov	w1, #9
	bl	_IS_GEN
	cbz	x0, LBB0_10
; %bb.23:
	mov	x0, x21
	bl	_IS_GEMINILAKE
	cbnz	w0, LBB0_10
; %bb.24:
	mov	x0, x27
	mov	x1, x26
	bl	_min_fixed16
	b	LBB0_9
LBB0_25:
	mov	w0, #1
LBB0_26:
	ldr	x8, [x23]
	add	x9, x0, x24
	cmp	x8, x9
	csel	x24, x8, x9, gt
LBB0_27:
	mov	x0, x21
	bl	_INTEL_GEN
	cmp	w0, #11
	b.lt	LBB0_30
; %bb.28:
	ldr	x8, [x22, #40]
	cbz	x8, LBB0_31
; %bb.29:
	ldr	x8, [x22, #24]
	sdiv	x9, x25, x8
	msub	x9, x9, x8, x25
	lsl	w10, w8, #1
	sub	w10, w10, w9
	cmp	x9, #0
	csel	x8, x8, x10, eq
	add	x0, x25, w8, sxtw
	ldr	w1, [x22, #32]
	bl	_mul_round_up_u32_fixed16
	mov	x22, x0
	b	LBB0_32
LBB0_30:
	mov	x22, #0
	b	LBB0_32
LBB0_31:
	mov	x0, x24
	mov	w1, #10
	bl	_DIV_ROUND_UP
	add	x22, x0, x24
LBB0_32:
	mov	x0, x21
	mov	x1, x20
	bl	_skl_wm_has_lines
	cmp	w0, #0
	csel	x8, xzr, x25, eq
	cmp	x8, #32
	b.lt	LBB0_34
LBB0_33:
Lloh0:
	adrp	x8, _U16_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _U16_MAX@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [x19, #16]
	b	LBB0_35
LBB0_34:
	str	x24, [x19]
	str	x8, [x19, #24]
	mov	x0, x22
	mov	x1, x24
	bl	_max
	add	x8, x0, #1
	str	x8, [x19, #16]
	mov	w8, #1
	str	w8, [x19, #8]
LBB0_35:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_U16_MAX,8,3                    ; @U16_MAX
	.no_dead_strip	_skl_compute_plane_wm
.subsections_via_symbols
