	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function g4x_compute_srwm
_g4x_compute_srwm:                      ## @g4x_compute_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r14
	movq	16(%rbp), %rax
	testl	%edx, %edx
	je	LBB0_5
## %bb.1:
	movq	%r8, %r15
	movq	%rcx, %r13
	movl	%edx, %r12d
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_intel_get_crtc_for_plane
	movl	8(%rax), %esi
	movl	16(%rax), %edi
	movq	(%rax), %rcx
	movl	(%rcx), %ecx
	leal	7(%rcx), %ebx
	testl	%ecx, %ecx
	cmovnsl	%ecx, %ebx
	sarl	$3, %ebx
	imull	$1000, 12(%rax), %eax           ## imm = 0x3E8
	cltd
	idivl	%edi
	movl	%eax, %r8d
	movslq	%eax, %rcx
	movslq	%r12d, %rax
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_2
## %bb.3:
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_4
LBB0_5:
	movl	$0, (%rax)
	movl	$0, (%r14)
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%r8d
                                        ## kill: def $eax killed $eax def $rax
LBB0_4:
	addq	$1000, %rax                     ## imm = 0x3E8
	shrq	$3, %rax
	movabsq	$2361183241434822607, %rcx      ## imm = 0x20C49BA5E353F7CF
	mulq	%rcx
	shrq	$4, %rdx
	imull	%ebx, %edi
	movslq	%edi, %rax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
	imull	%r12d, %eax
	cltq
	imulq	$274877907, %rax, %rdi          ## imm = 0x10624DD3
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$38, %rdi
	addl	%eax, %edi
	imull	%edx, %ebx
	imull	%ebx, %esi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_min
	movl	4(%r13), %esi
	movl	%eax, %edi
	callq	_DIV_ROUND_UP
	addl	(%r13), %eax
	movl	%eax, (%r14)
	shll	$6, %ebx
	movl	4(%r15), %esi
	movl	%ebx, %edi
	callq	_DIV_ROUND_UP
	addl	(%r15), %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movl	(%r14), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	movq	%r13, %rcx
	movq	%r15, %r8
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_g4x_check_srwm                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_g4x_compute_srwm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function g4x_compute_srwm
_g4x_compute_srwm:                      ; @g4x_compute_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	x21, x6
	mov	x20, x5
	cbz	w2, LBB0_2
; %bb.1:
	mov	x19, x4
	mov	x22, x3
	mov	x24, x2
	mov	x23, x0
	bl	_intel_get_crtc_for_plane
	ldp	w8, w9, [x0, #8]
	ldr	w10, [x0, #16]
	ldr	x11, [x0]
	ldr	w11, [x11]
	add	w12, w11, #7
	cmp	w11, #0
	csel	w11, w12, w11, lt
	asr	w11, w11, #3
	mov	w12, #1000
	mul	w9, w9, w12
	sdiv	w9, w9, w10
	sxtw	x9, w9
	sxtw	x12, w24
	udiv	x9, x12, x9
	add	x9, x9, #1000
	lsr	x9, x9, #3
	mov	x12, #63439
	movk	x12, #58195, lsl #16
	movk	x12, #39845, lsl #32
	movk	x12, #8388, lsl #48
	umulh	x9, x9, x12
	lsr	x9, x9, #4
	mul	w10, w11, w10
	mov	w12, #19923
	movk	w12, #4194, lsl #16
	smull	x10, w10, w12
	lsr	x13, x10, #63
	asr	x10, x10, #38
	add	w10, w10, w13
	mul	w10, w10, w24
	smull	x10, w10, w12
	lsr	x12, x10, #63
	asr	x10, x10, #38
	add	w0, w10, w12
	mul	w24, w11, w9
	mul	w1, w24, w8
	bl	_min
	ldr	w1, [x22, #4]
	bl	_DIV_ROUND_UP
	ldr	w8, [x22]
	add	w8, w8, w0
	str	w8, [x20]
	lsl	w0, w24, #6
	ldr	w1, [x19, #4]
	bl	_DIV_ROUND_UP
	ldr	w8, [x19]
	add	w2, w8, w0
	str	w2, [x21]
	ldr	w1, [x20]
	mov	x0, x23
	mov	x3, x22
	mov	x4, 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
	b	_g4x_check_srwm
LBB0_2:
	str	wzr, [x21]
	str	wzr, [x20]
	mov	w0, #0
	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	_g4x_compute_srwm
.subsections_via_symbols
