	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function g4x_update_wm
_g4x_update_wm:                         ## @g4x_update_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_latency_ns@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	leaq	-56(%rbp), %rax
	leaq	-64(%rbp), %r10
	movq	_g4x_wm_info@GOTPCREL(%rip), %r13
	movq	_g4x_cursor_wm_info@GOTPCREL(%rip), %r15
	xorl	%esi, %esi
	movq	%r13, %rdx
	movq	%r15, %r8
	movl	%ecx, %r9d
	pushq	%rax
	pushq	%r10
	callq	_g4x_compute_wm0
	addq	$16, %rsp
	xorl	%r12d, %r12d
	testq	%rax, %rax
	setne	%r12b
	movl	(%rbx), %ecx
	leaq	-52(%rbp), %rax
	leaq	-60(%rbp), %rbx
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movq	%r15, %r8
	movl	%ecx, %r9d
	pushq	%rax
	pushq	%rbx
	callq	_g4x_compute_wm0
	addq	$16, %rsp
	leal	2(%r12), %ebx
	testq	%rax, %rax
	cmovel	%r12d, %ebx
	movl	%ebx, %edi
	callq	_single_plane_enabled
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movl	%ebx, %edi
	callq	_ffs
	leaq	-1(%rax), %rsi
	subq	$8, %rsp
	leaq	-44(%rbp), %rax
	movq	_g4x_wm_info@GOTPCREL(%rip), %rcx
	movq	_g4x_cursor_wm_info@GOTPCREL(%rip), %r8
	leaq	-48(%rbp), %r9
	movq	%r14, %rdi
	movl	$12000, %edx                    ## imm = 0x2EE0
	pushq	%rax
	callq	_g4x_compute_srwm
	addq	$16, %rsp
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	_FW_BLC_SELF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_FW_BLC_SELF_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_I915_WRITE
	movl	-48(%rbp), %r9d
	movl	-44(%rbp), %eax
	jmp	LBB0_4
LBB0_3:
	movq	_FW_BLC_SELF@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%ebx, %edi
	callq	_I915_READ
	movq	_FW_BLC_SELF_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	notl	%esi
	andl	%eax, %esi
	movl	%ebx, %edi
	callq	_I915_WRITE
	movl	$0, -44(%rbp)
	movl	$0, -48(%rbp)
	xorl	%r9d, %r9d
	xorl	%eax, %eax
LBB0_4:
	movl	-64(%rbp), %esi
	movl	-56(%rbp), %edx
	movl	-60(%rbp), %ecx
	movl	-52(%rbp), %r8d
	subq	$8, %rsp
	leaq	L_.str(%rip), %rdi
	pushq	%rax
	callq	_DRM_DEBUG_KMS
	addq	$16, %rsp
	movl	-48(%rbp), %eax
	movq	_DSPFW_SR_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movl	-52(%rbp), %edx
	movq	_DSPFW_CURSORB_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	movq	_DSPFW1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	_DSPFW_PLANEB_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	-60(%rbp), %esi
	shll	%cl, %esi
	orl	%eax, %edx
	orl	%edx, %esi
	orl	-64(%rbp), %esi
	callq	_I915_WRITE
	movq	_DSPFW2@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%ebx, %edi
	callq	_I915_READ
	movq	_DSPFW_CURSORA_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movl	-56(%rbp), %esi
	movq	_DSPFW_CURSORA_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %esi
	orl	%edx, %esi
	movl	%ebx, %edi
	callq	_I915_WRITE
	movq	_DSPFW3@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%ebx, %edi
	callq	_I915_READ
	movq	_DSPFW_HPLL_SR_EN@GOTPCREL(%rip), %rcx
	movq	_DSPFW_CURSOR_SR_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movl	-44(%rbp), %esi
	movq	_DSPFW_CURSOR_SR_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %esi
	orl	%edx, %esi
	movl	%ebx, %edi
	callq	_I915_WRITE
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_g4x_wm_info,4,2                ## @g4x_wm_info
	.comm	_latency_ns,4,2                 ## @latency_ns
	.comm	_g4x_cursor_wm_info,4,2         ## @g4x_cursor_wm_info
	.comm	_FW_BLC_SELF,4,2                ## @FW_BLC_SELF
	.comm	_FW_BLC_SELF_EN,4,2             ## @FW_BLC_SELF_EN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Setting FIFO watermarks - A: plane=%d, cursor=%d, B: plane=%d, cursor=%d, SR: plane=%d, cursor=%d\n"

	.comm	_DSPFW1,4,2                     ## @DSPFW1
	.comm	_DSPFW_SR_SHIFT,4,2             ## @DSPFW_SR_SHIFT
	.comm	_DSPFW_CURSORB_SHIFT,4,2        ## @DSPFW_CURSORB_SHIFT
	.comm	_DSPFW_PLANEB_SHIFT,4,2         ## @DSPFW_PLANEB_SHIFT
	.comm	_DSPFW2,4,2                     ## @DSPFW2
	.comm	_DSPFW_CURSORA_MASK,4,2         ## @DSPFW_CURSORA_MASK
	.comm	_DSPFW_CURSORA_SHIFT,4,2        ## @DSPFW_CURSORA_SHIFT
	.comm	_DSPFW3,4,2                     ## @DSPFW3
	.comm	_DSPFW_HPLL_SR_EN,4,2           ## @DSPFW_HPLL_SR_EN
	.comm	_DSPFW_CURSOR_SR_MASK,4,2       ## @DSPFW_CURSOR_SR_MASK
	.comm	_DSPFW_CURSOR_SR_SHIFT,4,2      ## @DSPFW_CURSOR_SR_SHIFT
	.no_dead_strip	_g4x_update_wm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function g4x_update_wm
_g4x_update_wm:                         ; @g4x_update_wm
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x0
Lloh0:
	adrp	x22, _latency_ns@GOTPAGE
Lloh1:
	ldr	x22, [x22, _latency_ns@GOTPAGEOFF]
	ldr	w3, [x22]
Lloh2:
	adrp	x20, _g4x_wm_info@GOTPAGE
Lloh3:
	ldr	x20, [x20, _g4x_wm_info@GOTPAGEOFF]
Lloh4:
	adrp	x21, _g4x_cursor_wm_info@GOTPAGE
Lloh5:
	ldr	x21, [x21, _g4x_cursor_wm_info@GOTPAGEOFF]
	add	x6, sp, #28
	add	x7, sp, #20
	mov	w1, #0
	mov	x2, x20
	mov	x4, x21
	mov	x5, x3
	bl	_g4x_compute_wm0
	cmp	x0, #0
	cset	w23, ne
	ldr	w3, [x22]
	add	x6, sp, #24
	add	x7, sp, #16
	mov	x0, x19
	mov	w1, #1
	mov	x2, x20
	mov	x4, x21
	mov	x5, x3
	bl	_g4x_compute_wm0
	orr	w8, w23, #0x2
	cmp	x0, #0
	csel	w20, w23, w8, eq
	mov	x0, x20
	bl	_single_plane_enabled
	cbz	x0, LBB0_3
; %bb.1:
	mov	x0, x20
	bl	_ffs
	sub	x1, x0, #1
Lloh6:
	adrp	x3, _g4x_wm_info@GOTPAGE
Lloh7:
	ldr	x3, [x3, _g4x_wm_info@GOTPAGEOFF]
Lloh8:
	adrp	x4, _g4x_cursor_wm_info@GOTPAGE
Lloh9:
	ldr	x4, [x4, _g4x_cursor_wm_info@GOTPAGEOFF]
	add	x5, sp, #12
	add	x6, sp, #8
	mov	x0, x19
	mov	w2, #12000
	bl	_g4x_compute_srwm
	cbz	x0, LBB0_3
; %bb.2:
Lloh10:
	adrp	x8, _FW_BLC_SELF@GOTPAGE
Lloh11:
	ldr	x8, [x8, _FW_BLC_SELF@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x8, _FW_BLC_SELF_EN@GOTPAGE
Lloh14:
	ldr	x8, [x8, _FW_BLC_SELF_EN@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	bl	_I915_WRITE
	ldp	w6, w5, [sp, #8]
	b	LBB0_4
LBB0_3:
Lloh16:
	adrp	x8, _FW_BLC_SELF@GOTPAGE
Lloh17:
	ldr	x8, [x8, _FW_BLC_SELF@GOTPAGEOFF]
Lloh18:
	ldr	w19, [x8]
	mov	x0, x19
	bl	_I915_READ
Lloh19:
	adrp	x8, _FW_BLC_SELF_EN@GOTPAGE
Lloh20:
	ldr	x8, [x8, _FW_BLC_SELF_EN@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	bic	w1, w0, w8
	mov	x0, x19
	bl	_I915_WRITE
	mov	w6, #0
	mov	w5, #0
	str	xzr, [sp, #8]
LBB0_4:
	ldp	w3, w1, [sp, #24]
	ldp	w4, w2, [sp, #16]
Lloh22:
	adrp	x0, l_.str@PAGE
Lloh23:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_KMS
Lloh24:
	adrp	x8, _DSPFW1@GOTPAGE
Lloh25:
	ldr	x8, [x8, _DSPFW1@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	ldp	w8, w10, [sp, #12]
Lloh27:
	adrp	x9, _DSPFW_SR_SHIFT@GOTPAGE
Lloh28:
	ldr	x9, [x9, _DSPFW_SR_SHIFT@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	lsl	w8, w8, w9
Lloh30:
	adrp	x9, _DSPFW_CURSORB_SHIFT@GOTPAGE
Lloh31:
	ldr	x9, [x9, _DSPFW_CURSORB_SHIFT@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	lsl	w9, w10, w9
	orr	w8, w9, w8
Lloh33:
	adrp	x9, _DSPFW_PLANEB_SHIFT@GOTPAGE
Lloh34:
	ldr	x9, [x9, _DSPFW_PLANEB_SHIFT@GOTPAGEOFF]
	ldr	w10, [sp, #24]
Lloh35:
	ldr	w9, [x9]
	lsl	w9, w10, w9
	orr	w8, w8, w9
	ldr	w9, [sp, #28]
	orr	w1, w8, w9
	bl	_I915_WRITE
Lloh36:
	adrp	x8, _DSPFW2@GOTPAGE
Lloh37:
	ldr	x8, [x8, _DSPFW2@GOTPAGEOFF]
Lloh38:
	ldr	w19, [x8]
	mov	x0, x19
	bl	_I915_READ
Lloh39:
	adrp	x8, _DSPFW_CURSORA_MASK@GOTPAGE
Lloh40:
	ldr	x8, [x8, _DSPFW_CURSORA_MASK@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	bic	w8, w0, w8
	ldr	w9, [sp, #20]
Lloh42:
	adrp	x10, _DSPFW_CURSORA_SHIFT@GOTPAGE
Lloh43:
	ldr	x10, [x10, _DSPFW_CURSORA_SHIFT@GOTPAGEOFF]
Lloh44:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w1, w9, w8
	mov	x0, x19
	bl	_I915_WRITE
Lloh45:
	adrp	x8, _DSPFW3@GOTPAGE
Lloh46:
	ldr	x8, [x8, _DSPFW3@GOTPAGEOFF]
Lloh47:
	ldr	w19, [x8]
	mov	x0, x19
	bl	_I915_READ
Lloh48:
	adrp	x8, _DSPFW_HPLL_SR_EN@GOTPAGE
Lloh49:
	ldr	x8, [x8, _DSPFW_HPLL_SR_EN@GOTPAGEOFF]
Lloh50:
	ldr	w8, [x8]
Lloh51:
	adrp	x9, _DSPFW_CURSOR_SR_MASK@GOTPAGE
Lloh52:
	ldr	x9, [x9, _DSPFW_CURSOR_SR_MASK@GOTPAGEOFF]
Lloh53:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w8, w0, w8
	ldr	w9, [sp, #8]
Lloh54:
	adrp	x10, _DSPFW_CURSOR_SR_SHIFT@GOTPAGE
Lloh55:
	ldr	x10, [x10, _DSPFW_CURSOR_SR_SHIFT@GOTPAGEOFF]
Lloh56:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w1, w9, w8
	mov	x0, x19
	bl	_I915_WRITE
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_g4x_wm_info,4,2                ; @g4x_wm_info
	.comm	_latency_ns,4,2                 ; @latency_ns
	.comm	_g4x_cursor_wm_info,4,2         ; @g4x_cursor_wm_info
	.comm	_FW_BLC_SELF,4,2                ; @FW_BLC_SELF
	.comm	_FW_BLC_SELF_EN,4,2             ; @FW_BLC_SELF_EN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Setting FIFO watermarks - A: plane=%d, cursor=%d, B: plane=%d, cursor=%d, SR: plane=%d, cursor=%d\n"

	.comm	_DSPFW1,4,2                     ; @DSPFW1
	.comm	_DSPFW_SR_SHIFT,4,2             ; @DSPFW_SR_SHIFT
	.comm	_DSPFW_CURSORB_SHIFT,4,2        ; @DSPFW_CURSORB_SHIFT
	.comm	_DSPFW_PLANEB_SHIFT,4,2         ; @DSPFW_PLANEB_SHIFT
	.comm	_DSPFW2,4,2                     ; @DSPFW2
	.comm	_DSPFW_CURSORA_MASK,4,2         ; @DSPFW_CURSORA_MASK
	.comm	_DSPFW_CURSORA_SHIFT,4,2        ; @DSPFW_CURSORA_SHIFT
	.comm	_DSPFW3,4,2                     ; @DSPFW3
	.comm	_DSPFW_HPLL_SR_EN,4,2           ; @DSPFW_HPLL_SR_EN
	.comm	_DSPFW_CURSOR_SR_MASK,4,2       ; @DSPFW_CURSOR_SR_MASK
	.comm	_DSPFW_CURSOR_SR_SHIFT,4,2      ; @DSPFW_CURSOR_SR_SHIFT
	.no_dead_strip	_g4x_update_wm
.subsections_via_symbols
