	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sandybridge_compute_sprite_srwm
_sandybridge_compute_sprite_srwm:       ## @sandybridge_compute_sprite_srwm
	.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	16(%rbp), %r13
	testl	%r9d, %r9d
	je	LBB0_1
## %bb.2:
	movl	%r9d, %ebx
	movq	%r8, %r14
	movl	%ecx, %r12d
	movl	%edx, %r15d
	callq	_intel_get_crtc_for_plane
	movl	(%rax), %esi
	testl	%esi, %esi
	je	LBB0_1
## %bb.3:
	imull	$1000, %r15d, %eax              ## imm = 0x3E8
	cltd
	idivl	%esi
	testl	%eax, %eax
	je	LBB0_1
## %bb.4:
	movl	%eax, %ecx
	movslq	%eax, %rdi
	movslq	%ebx, %rax
	movq	%rax, %rdx
	orq	%rdi, %rdx
	shrq	$32, %rdx
	je	LBB0_5
## %bb.6:
	xorl	%edx, %edx
	divq	%rdi
	jmp	LBB0_7
LBB0_1:
	movl	$0, (%r13)
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_5:
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_7:
	addq	$1000, %rax                     ## imm = 0x3E8
	shrq	$3, %rax
	movabsq	$2361183241434822607, %rcx      ## imm = 0x20C49BA5E353F7CF
	mulq	%rcx
	shrq	$4, %rdx
	imull	%r12d, %r15d
	imull	%r12d, %esi
	movslq	%esi, %rax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
	imull	%ebx, %eax
	cltq
	imulq	$274877907, %rax, %rdi          ## imm = 0x10624DD3
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$38, %rdi
	addl	%eax, %edi
	imull	%edx, %r15d
                                        ## kill: def $edi killed $edi killed $rdi
	movl	%r15d, %esi
	callq	_min
	movl	4(%r14), %esi
	movl	%eax, %edi
	callq	_DIV_ROUND_UP
	movl	%eax, %ecx
	addl	(%r14), %ecx
	movl	%ecx, (%r13)
	xorl	%eax, %eax
	cmpl	$1024, %ecx                     ## imm = 0x400
	setl	%al
LBB0_8:
	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_srwm
.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_srwm
_sandybridge_compute_sprite_srwm:       ; @sandybridge_compute_sprite_srwm
	.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
	cbz	w5, LBB0_4
; %bb.1:
	mov	x21, x5
	mov	x20, x4
	mov	x22, x3
	mov	x23, x2
	bl	_intel_get_crtc_for_plane
	ldr	w8, [x0]
	cbz	w8, LBB0_4
; %bb.2:
	mov	w9, #1000
	mul	w9, w23, w9
	sdiv	w9, w9, w8
	cbz	w9, LBB0_4
; %bb.3:
	sxtw	x9, w9
	sxtw	x10, w21
	udiv	x9, x10, x9
	add	x9, x9, #1000
	lsr	x9, x9, #3
	mov	x10, #63439
	movk	x10, #58195, lsl #16
	movk	x10, #39845, lsl #32
	movk	x10, #8388, lsl #48
	umulh	x9, x9, x10
	lsr	x9, x9, #4
	mul	w10, w22, w23
	mul	w8, w8, w22
	mov	w11, #19923
	movk	w11, #4194, lsl #16
	smull	x8, w8, w11
	lsr	x12, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w12
	mul	w8, w8, w21
	smull	x8, w8, w11
	lsr	x11, x8, #63
	asr	x8, x8, #38
	add	w0, w8, w11
	mul	w1, w10, w9
	bl	_min
	ldr	w1, [x20, #4]
	bl	_DIV_ROUND_UP
	ldr	w8, [x20]
	add	w8, w8, w0
	str	w8, [x19]
	cmp	w8, #1024
	cset	w0, lt
	b	LBB0_5
LBB0_4:
	mov	w0, #0
	str	wzr, [x19]
LBB0_5:
	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_srwm
.subsections_via_symbols
