	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function g4x_raw_plane_wm_compute
_g4x_raw_plane_wm_compute:              ## @g4x_raw_plane_wm_compute
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movl	(%rsi), %edi
	callq	_to_intel_plane
	movq	%rax, %r13
	movl	8(%rax), %edi
	callq	_to_i915
	movl	%eax, %edi
	callq	_intel_wm_num_levels
	movl	%eax, %r14d
	movl	(%r13), %r12d
	movq	%r15, %rdi
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rsi
	callq	_intel_wm_plane_visible
	testl	%eax, %eax
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_3
## %bb.1:
	movl	%r14d, %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	testl	%eax, %eax
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	jle	LBB0_2
## %bb.5:
	xorl	%ebx, %ebx
	movl	$8, %r12d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	xorl	%eax, %eax
	cmpl	%r15d, (%r14,%r12)
	setne	%al
	movl	%r13d, %ecx
	orl	%eax, %ecx
	movl	%r15d, (%r14,%r12)
LBB0_12:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	incq	%rbx
	addq	$16, %r12
	cmpq	%rbx, -80(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_13
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %r14
	movq	%r15, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %edx
	callq	_g4x_compute_wm
	movl	%eax, %r15d
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movl	%r13d, %edi
	movl	%ebx, %esi
	callq	_g4x_plane_fifo_size
	cmpl	%eax, %r15d
	jg	LBB0_22
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	-8(%r14,%r12), %rax
	xorl	%ecx, %ecx
	cmpl	%r15d, (%rax,%r13,4)
	setne	%cl
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	orl	%ecx, %edx
	movl	%edx, %ecx
	movl	%r15d, (%rax,%r13,4)
	movq	_PLANE_PRIMARY@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	_G4X_WM_LEVEL_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpq	%rax, %rbx
	je	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	%ecx, %r13d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movl	%r15d, %edx
	callq	_ilk_compute_fbc_wm
	movl	%eax, %r15d
	movl	%ebx, %edi
	callq	_g4x_fbc_fifo_size
	cmpl	%eax, %r15d
	jle	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	_USHRT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_11
LBB0_3:
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	%r12d, %edx
	xorl	%ecx, %ecx
	callq	_g4x_raw_plane_wm_set
	movq	%r12, %rcx
	movl	%eax, %r12d
	movq	_PLANE_PRIMARY@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jne	LBB0_18
## %bb.4:
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_g4x_raw_fbc_wm_set
	orl	%eax, %r12d
	jmp	LBB0_18
LBB0_2:
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	jmp	LBB0_15
LBB0_13:
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
                                        ## kill: def $ebx killed $ebx killed $rbx def $rbx
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_14
LBB0_22:
	movq	%r13, %r12
LBB0_14:
	movl	-44(%rbp), %r13d                ## 4-byte Reload
LBB0_15:
	movq	_USHRT_MAX@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	callq	_g4x_raw_plane_wm_set
	movq	%r12, %rcx
	movl	%eax, %r12d
	orl	%r13d, %r12d
	movq	_PLANE_PRIMARY@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jne	LBB0_17
## %bb.16:
	movl	(%r15), %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_g4x_raw_fbc_wm_set
	orl	%eax, %r12d
LBB0_17:
	movq	%r14, %r15
	movq	-72(%rbp), %r13                 ## 8-byte Reload
LBB0_18:
	testl	%r12d, %r12d
	je	LBB0_21
## %bb.19:
	movl	4(%r13), %esi
	movq	(%r15), %rax
	movq	_G4X_WM_LEVEL_NORMAL@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	shlq	$4, %rcx
	movq	(%rax,%rcx), %rcx
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rcx,%rbx,4), %edx
	movq	_G4X_WM_LEVEL_SR@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	shlq	$4, %rcx
	movq	(%rax,%rcx), %rcx
	movl	(%rcx,%rbx,4), %ecx
	movq	_G4X_WM_LEVEL_HPLL@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	shlq	$4, %rdi
	movq	(%rax,%rdi), %rax
	movl	(%rax,%rbx,4), %r8d
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	movq	_PLANE_PRIMARY@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_21
## %bb.20:
	movq	(%r15), %rax
	movq	(%r14), %rcx
	shlq	$4, %rcx
	movl	8(%rax,%rcx), %esi
	movq	(%r13), %rcx
	shlq	$4, %rcx
	movl	8(%rax,%rcx), %edx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
LBB0_21:
	movl	%r12d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PLANE_PRIMARY,4,2              ## @PLANE_PRIMARY
	.comm	_G4X_WM_LEVEL_NORMAL,4,2        ## @G4X_WM_LEVEL_NORMAL
	.comm	_USHRT_MAX,4,2                  ## @USHRT_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s watermarks: normal=%d, SR=%d, HPLL=%d\n"

	.comm	_G4X_WM_LEVEL_SR,8,3            ## @G4X_WM_LEVEL_SR
	.comm	_G4X_WM_LEVEL_HPLL,8,3          ## @G4X_WM_LEVEL_HPLL
L_.str.1:                               ## @.str.1
	.asciz	"FBC watermarks: SR=%d, HPLL=%d\n"

	.no_dead_strip	_g4x_raw_plane_wm_compute
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function g4x_raw_plane_wm_compute
_g4x_raw_plane_wm_compute:              ; @g4x_raw_plane_wm_compute
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x22, x1
	mov	x19, x0
	ldr	w0, [x1]
	bl	_to_intel_plane
	mov	x21, x0
	ldr	w0, [x0, #8]
	bl	_to_i915
	bl	_intel_wm_num_levels
	mov	x23, x0
	ldr	w20, [x21]
	mov	x0, x19
	mov	x1, x22
	bl	_intel_wm_plane_visible
Lloh0:
	adrp	x24, _PLANE_PRIMARY@GOTPAGE
Lloh1:
	ldr	x24, [x24, _PLANE_PRIMARY@GOTPAGEOFF]
	cbz	w0, LBB0_7
; %bb.1:
	mov	w27, w23
Lloh2:
	adrp	x25, _USHRT_MAX@GOTPAGE
Lloh3:
	ldr	x25, [x25, _USHRT_MAX@GOTPAGEOFF]
	cmp	w27, #1
	b.lt	LBB0_9
; %bb.2:
	str	x21, [sp, #24]                  ; 8-byte Folded Spill
	mov	x23, #0
	mov	w28, #0
	mov	w21, #8
	lsl	x26, x20, #2
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x23, x23, #1
	add	x21, x21, #16
	cmp	x27, x23
	b.eq	LBB0_10
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x25, [x19]
	mov	x0, x19
	mov	x1, x22
	mov	x2, x23
	bl	_g4x_compute_wm
	mov	x24, x0
	mov	x0, x20
	mov	x1, x23
	bl	_g4x_plane_fifo_size
	cmp	w24, w0
	b.gt	LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x25, x21
	ldur	x8, [x8, #-8]
	ldr	w9, [x8, x26]
	cmp	w9, w24
	cset	w9, ne
	orr	w28, w28, w9
	str	w24, [x8, x26]
Lloh4:
	adrp	x8, _PLANE_PRIMARY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PLANE_PRIMARY@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _G4X_WM_LEVEL_NORMAL@GOTPAGE
Lloh8:
	ldr	x9, [x9, _G4X_WM_LEVEL_NORMAL@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	cmp	w20, w8
	ccmp	x23, x9, #4, eq
	b.eq	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	mov	x1, x22
	mov	x2, x24
	bl	_ilk_compute_fbc_wm
	mov	x24, x0
	mov	x0, x23
	bl	_g4x_fbc_fifo_size
Lloh10:
	adrp	x8, _USHRT_MAX@GOTPAGE
Lloh11:
	ldr	x8, [x8, _USHRT_MAX@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	ldr	w9, [x25, x21]
	cmp	w24, w0
	csel	w8, w8, w24, gt
	cmp	w9, w8
	cset	w9, ne
	orr	w28, w28, w9
	str	w8, [x25, x21]
	b	LBB0_3
LBB0_7:
	mov	x0, x19
	mov	w1, #0
	mov	x2, x20
	mov	w3, #0
	bl	_g4x_raw_plane_wm_set
	mov	x22, x0
	ldr	w8, [x24]
	cmp	w20, w8
	b.ne	LBB0_15
; %bb.8:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	b	LBB0_14
LBB0_9:
	mov	w23, #0
	mov	w28, #0
	b	LBB0_12
LBB0_10:
	mov	x23, x27
LBB0_11:
Lloh13:
	adrp	x24, _PLANE_PRIMARY@GOTPAGE
Lloh14:
	ldr	x24, [x24, _PLANE_PRIMARY@GOTPAGEOFF]
	ldr	x21, [sp, #24]                  ; 8-byte Folded Reload
Lloh15:
	adrp	x25, _USHRT_MAX@GOTPAGE
Lloh16:
	ldr	x25, [x25, _USHRT_MAX@GOTPAGEOFF]
LBB0_12:
	ldr	w3, [x25]
	mov	x0, x19
	mov	x1, x23
	mov	x2, x20
	bl	_g4x_raw_plane_wm_set
	orr	w22, w0, w28
	ldr	w8, [x24]
	cmp	w20, w8
	b.ne	LBB0_15
; %bb.13:
	ldr	w2, [x25]
	mov	x0, x19
	mov	x1, x23
LBB0_14:
	bl	_g4x_raw_fbc_wm_set
	orr	w22, w0, w22
LBB0_15:
	cbz	w22, LBB0_18
; %bb.16:
	ldr	w1, [x21, #4]
	ldr	x8, [x19]
Lloh17:
	adrp	x9, _G4X_WM_LEVEL_NORMAL@GOTPAGE
Lloh18:
	ldr	x9, [x9, _G4X_WM_LEVEL_NORMAL@GOTPAGEOFF]
Lloh19:
	ldrsw	x9, [x9]
	lsl	x9, x9, #4
	ldr	x9, [x8, x9]
	lsl	x10, x20, #2
	ldr	w2, [x9, x10]
Lloh20:
	adrp	x21, _G4X_WM_LEVEL_SR@GOTPAGE
Lloh21:
	ldr	x21, [x21, _G4X_WM_LEVEL_SR@GOTPAGEOFF]
	ldr	x9, [x21]
	lsl	x9, x9, #4
	ldr	x9, [x8, x9]
Lloh22:
	adrp	x23, _G4X_WM_LEVEL_HPLL@GOTPAGE
Lloh23:
	ldr	x23, [x23, _G4X_WM_LEVEL_HPLL@GOTPAGEOFF]
	ldr	x11, [x23]
	lsl	x11, x11, #4
	ldr	x8, [x8, x11]
	ldr	w9, [x9, x10]
	ldr	w8, [x8, x10]
	stp	x9, x8, [sp]
Lloh24:
	adrp	x0, l_.str@PAGE
Lloh25:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_KMS
	ldr	w8, [x24]
	cmp	w20, w8
	b.ne	LBB0_18
; %bb.17:
	ldr	x8, [x19]
	ldr	x9, [x21]
	add	x9, x8, x9, lsl #4
	ldr	w1, [x9, #8]
	ldr	x9, [x23]
	add	x8, x8, x9, lsl #4
	ldr	w2, [x8, #8]
Lloh26:
	adrp	x0, l_.str.1@PAGE
Lloh27:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG_KMS
LBB0_18:
	mov	x0, x22
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_PLANE_PRIMARY,4,2              ; @PLANE_PRIMARY
	.comm	_G4X_WM_LEVEL_NORMAL,4,2        ; @G4X_WM_LEVEL_NORMAL
	.comm	_USHRT_MAX,4,2                  ; @USHRT_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s watermarks: normal=%d, SR=%d, HPLL=%d\n"

	.comm	_G4X_WM_LEVEL_SR,8,3            ; @G4X_WM_LEVEL_SR
	.comm	_G4X_WM_LEVEL_HPLL,8,3          ; @G4X_WM_LEVEL_HPLL
l_.str.1:                               ; @.str.1
	.asciz	"FBC watermarks: SR=%d, HPLL=%d\n"

	.no_dead_strip	_g4x_raw_plane_wm_compute
.subsections_via_symbols
