	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function g4x_compute_wm0
_g4x_compute_wm0:                       ## @g4x_compute_wm0
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r13d
	movq	%r8, %r15
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r12
	movq	24(%rbp), %r14
	callq	_intel_get_crtc_for_plane
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_intel_crtc_active
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	12(%rbx), %r14d
	movl	16(%rbx), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	(%rbx), %rax
	movl	(%rax), %eax
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
	leal	7(%rax), %r13d
	testl	%eax, %eax
	cmovnsl	%eax, %r13d
	sarl	$3, %r13d
	movl	%r13d, %eax
	imull	%ecx, %eax
	cltq
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
	imull	-52(%rbp), %eax                 ## 4-byte Folded Reload
	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), %edi
	imull	%esi, %edi
	shll	$3, %r14d
	subl	%r14d, %edi
	xorl	%ecx, %ecx
	testl	%edi, %edi
	cmovlel	%ecx, %edi
	addl	%eax, %edi
	imull	$1000, 8(%rbx), %ebx            ## imm = 0x3E8
	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	%eax, (%rdx)
	movl	%ebx, %eax
	cltd
	idivl	-44(%rbp)                       ## 4-byte Folded Reload
	movl	%eax, %ecx
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	cltd
	idivl	%ecx
	addl	$1000, %eax                     ## imm = 0x3E8
	cltq
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	shrq	$38, %rax
	addl	%ecx, %eax
	imull	%r13d, %eax
	shll	$6, %eax
	movl	8(%r15), %esi
	movl	4(%r15), %edi
	imull	%esi, %edi
	subl	%r14d, %edi
	testl	%edi, %edi
	movl	$0, %ecx
	cmovlel	%ecx, %edi
	addl	%eax, %edi
	callq	_DIV_ROUND_UP
	addl	(%r15), %eax
	movq	24(%rbp), %rdx
	movl	%eax, (%rdx)
	movl	12(%r15), %ecx
	cmpl	%ecx, %eax
	cmovgel	%ecx, %eax
	movl	%eax, (%rdx)
	movl	$1, %eax
	jmp	LBB0_3
LBB0_1:
	movl	(%r15), %eax
	movl	%eax, (%r14)
	movl	(%r12), %eax
	movq	16(%rbp), %rcx
	movl	%eax, (%rcx)
	xorl	%eax, %eax
LBB0_3:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_g4x_compute_wm0
.subsections_via_symbols

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