	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sandybridge_compute_sprite_wm
_sandybridge_compute_sprite_wm:         ## @sandybridge_compute_sprite_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r15d
	movq	%r8, %r12
	movl	%ecx, %r13d
	movl	%edx, %r14d
	callq	_intel_get_crtc_for_plane
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_intel_crtc_active
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	imull	(%rbx), %r13d
	movslq	%r13d, %rax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
	imull	%r15d, %eax
	cltq
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
	movl	8(%r12), %esi
	movl	4(%r12), %ecx
	imull	%esi, %ecx
	shll	$3, %r14d
	subl	%r14d, %ecx
	xorl	%edi, %edi
	testl	%ecx, %ecx
	cmovgl	%ecx, %edi
	addl	%eax, %edi
	callq	_DIV_ROUND_UP
	addl	(%r12), %eax
	movq	16(%rbp), %rdx
	movl	%eax, (%rdx)
	movl	12(%r12), %ecx
	cmpl	%ecx, %eax
	cmovgel	%ecx, %eax
	movl	$1, %ecx
	jmp	LBB0_3
LBB0_1:
	movl	(%r12), %eax
	xorl	%ecx, %ecx
	movq	16(%rbp), %rdx
LBB0_3:
	movl	%eax, (%rdx)
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_sandybridge_compute_sprite_wm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sandybridge_compute_sprite_wm
_sandybridge_compute_sprite_wm:         ; @sandybridge_compute_sprite_wm
	.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, x6
	mov	x22, x5
	mov	x20, x4
	mov	x23, x3
	mov	x21, x2
	bl	_intel_get_crtc_for_plane
	mov	x24, x0
	bl	_intel_crtc_active
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w8, [x24]
	mul	w8, w8, w23
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x8, w8, w9
	lsr	x10, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w10
	mul	w8, w8, w22
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	ldp	w10, w1, [x20, #4]
	mul	w10, w1, w10
	sub	w10, w10, w21, lsl #3
	cmp	w10, #0
	csel	w10, w10, wzr, gt
	add	w8, w8, w9
	add	w0, w10, w8
	bl	_DIV_ROUND_UP
	ldr	w8, [x20]
	add	w8, w8, w0
	str	w8, [x19]
	ldr	w9, [x20, #12]
	cmp	w8, w9
	csel	w8, w8, w9, lt
	mov	w0, #1
	b	LBB0_3
LBB0_2:
	ldr	w8, [x20]
LBB0_3:
	str	w8, [x19]
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_sandybridge_compute_sprite_wm
.subsections_via_symbols
