	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function g4x_update_plane
_g4x_update_plane:                      ## @g4x_update_plane
	.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	%rdx, %r12
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movl	4(%rdi), %edi
	callq	_to_i915
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %eax
	movl	%eax, -76(%rbp)                 ## 4-byte Spill
	movq	8(%r12), %rax
	movl	(%rax), %eax
	movl	%eax, -80(%rbp)                 ## 4-byte Spill
	leaq	16(%r12), %r14
	leaq	24(%r12), %rbx
	movl	24(%r12), %eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movl	28(%r12), %eax
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_drm_rect_width
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_drm_rect_height
	movl	%eax, %r15d
	movq	8(%r12), %rax
	movl	4(%rax), %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	8(%rax), %eax
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	callq	_drm_rect_width
	movl	%eax, %r13d
	movl	%eax, %ebx
	sarl	$16, %ebx
	movq	%r14, %rdi
	callq	_drm_rect_height
	movl	%eax, %r14d
	sarl	$16, %r14d
	movl	(%r12), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_g4x_sprite_ctl_crtc
	movq	-96(%rbp), %rdx                 ## 8-byte Reload
	leal	-1(%rdx), %ecx
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	cmpl	%ebx, %edx
	jne	LBB0_2
## %bb.1:
	xorl	%ecx, %ecx
	cmpl	%r14d, %r15d
	je	LBB0_3
LBB0_2:
	decl	%r14d
	movq	_DVS_SCALE_ENABLE@GOTPCREL(%rip), %rcx
	addl	$-65536, %r13d                  ## imm = 0xFFFF0000
	andl	$-65536, %r13d                  ## imm = 0xFFFF0000
	orl	%r14d, %r13d
	orl	(%rcx), %r13d
	movl	%r13d, %ecx
LBB0_3:
	orl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	movl	-72(%rbp), %r13d                ## 4-byte Reload
	movl	%ecx, %r14d
	movl	%r13d, %esi
	movq	%r12, %rdx
	xorl	%ecx, %ecx
	callq	_intel_fb_xy_to_linear
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_lock_irqsave
	movl	-76(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	callq	_DVSSTRIDE
	movq	8(%r12), %rcx
	movl	12(%rcx), %esi
	movl	%eax, %edi
	callq	_I915_WRITE_FW
	movl	%ebx, %edi
	callq	_DVSPOS
	movl	-68(%rbp), %esi                 ## 4-byte Reload
	shll	$16, %esi
	orl	-64(%rbp), %esi                 ## 4-byte Folded Reload
	movl	%eax, %edi
	callq	_I915_WRITE_FW
	movl	%ebx, %edi
	callq	_DVSSIZE
	shll	$16, %r15d
	addl	$-65536, %r15d                  ## imm = 0xFFFF0000
	orl	-60(%rbp), %r15d                ## 4-byte Folded Reload
	movl	%eax, %edi
	movl	%r15d, %esi
	callq	_I915_WRITE_FW
	movl	%ebx, %edi
	callq	_DVSSCALE
	movl	%eax, %edi
	movl	%r14d, %esi
	callq	_I915_WRITE_FW
	cmpq	$0, 48(%r12)
	je	LBB0_5
## %bb.4:
	movl	%ebx, %edi
	callq	_DVSKEYVAL
	movl	32(%r12), %esi
	movl	%eax, %edi
	callq	_I915_WRITE_FW
	movl	%ebx, %edi
	callq	_DVSKEYMSK
	movl	36(%r12), %esi
	movl	%eax, %edi
	callq	_I915_WRITE_FW
	movl	%ebx, %edi
	callq	_DVSKEYMAX
	movl	40(%r12), %esi
	movl	%eax, %edi
	callq	_I915_WRITE_FW
LBB0_5:
	movl	%ebx, %edi
	callq	_DVSLINOFF
	movl	%eax, %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_I915_WRITE_FW
	movl	%ebx, %edi
	callq	_DVSTILEOFF
	shll	$16, %r13d
	orl	-48(%rbp), %r13d                ## 4-byte Folded Reload
	movl	%eax, %edi
	movl	%r13d, %esi
	callq	_I915_WRITE_FW
	movl	%ebx, %edi
	callq	_DVSCNTR
	movl	%eax, %edi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	callq	_I915_WRITE_FW
	movl	%ebx, %edi
	callq	_DVSSURF
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_intel_plane_ggtt_offset
	movl	-80(%rbp), %esi                 ## 4-byte Reload
	addl	%eax, %esi
	movl	%ebx, %edi
	callq	_I915_WRITE_FW
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_IS_G4X
	movq	%r12, %rdi
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	callq	_g4x_update_gamma
	jmp	LBB0_8
LBB0_7:
	callq	_ilk_update_gamma
LBB0_8:
	movq	%rbx, %rdi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DVS_SCALE_ENABLE,4,2           ## @DVS_SCALE_ENABLE
	.no_dead_strip	_g4x_update_plane
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function g4x_update_plane
_g4x_update_plane:                      ; @g4x_update_plane
	.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	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldr	w0, [x0, #4]
	bl	_to_i915
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	ldr	w21, [x21]
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	str	w8, [sp, #28]                   ; 4-byte Folded Spill
	add	x27, x19, #16
	mov	x22, x19
	ldr	w8, [x22, #24]!
	str	w8, [sp, #4]                    ; 4-byte Folded Spill
	ldr	w8, [x19, #28]
	str	w8, [sp, #20]                   ; 4-byte Folded Spill
	mov	x0, x22
	bl	_drm_rect_width
	mov	x28, x0
	mov	x0, x22
	bl	_drm_rect_height
	mov	x24, x0
	ldr	x8, [x19, #8]
	ldp	w23, w26, [x8, #4]
	mov	x0, x27
	bl	_drm_rect_width
	mov	x25, x0
	mov	x0, x27
	bl	_drm_rect_height
	asr	w27, w0, #16
	ldr	w22, [x19]
	mov	x0, x20
	bl	_g4x_sprite_ctl_crtc
	orr	w8, w0, w22
	sub	w22, w28, #1
	cmp	w28, w25, asr #16
	str	w8, [sp, #24]                   ; 4-byte Folded Spill
	b.ne	LBB0_3
; %bb.1:
	cmp	w24, w27
	b.ne	LBB0_3
; %bb.2:
	mov	w27, #0
	b	LBB0_4
LBB0_3:
Lloh0:
	adrp	x8, _DVS_SCALE_ENABLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DVS_SCALE_ENABLE@GOTPAGEOFF]
	sub	w9, w27, #1
Lloh2:
	ldr	w8, [x8]
	sub	w10, w25, #16, lsl #12          ; =65536
	and	w10, w10, #0xffff0000
	orr	w9, w9, w10
	orr	w27, w9, w8
LBB0_4:
	ldr	x25, [sp, #8]                   ; 8-byte Folded Reload
	mov	x28, x26
	ldr	w20, [sp, #4]                   ; 4-byte Folded Reload
	mov	x26, x24
	mov	x0, x23
	mov	x1, x28
	mov	x2, x19
	mov	w3, #0
	bl	_intel_fb_xy_to_linear
	mov	x24, x0
	mov	x0, x25
	bl	_spin_lock_irqsave
	mov	x0, x21
	bl	_DVSSTRIDE
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #12]
	bl	_I915_WRITE_FW
	mov	x0, x21
	bl	_DVSPOS
	ldr	w8, [sp, #20]                   ; 4-byte Folded Reload
	orr	w1, w20, w8, lsl #16
	bl	_I915_WRITE_FW
	mov	x0, x21
	bl	_DVSSIZE
	lsl	w8, w26, #16
	sub	w8, w8, #16, lsl #12            ; =65536
	orr	w1, w8, w22
	bl	_I915_WRITE_FW
	mov	x0, x21
	bl	_DVSSCALE
	mov	x1, x27
	bl	_I915_WRITE_FW
	ldr	x8, [x19, #48]
	cbz	x8, LBB0_6
; %bb.5:
	mov	x0, x21
	bl	_DVSKEYVAL
	ldr	w1, [x19, #32]
	bl	_I915_WRITE_FW
	mov	x0, x21
	bl	_DVSKEYMSK
	ldr	w1, [x19, #36]
	bl	_I915_WRITE_FW
	mov	x0, x21
	bl	_DVSKEYMAX
	ldr	w1, [x19, #40]
	bl	_I915_WRITE_FW
LBB0_6:
	mov	x0, x21
	bl	_DVSLINOFF
	mov	x1, x24
	bl	_I915_WRITE_FW
	mov	x0, x21
	bl	_DVSTILEOFF
	orr	w1, w23, w28, lsl #16
	bl	_I915_WRITE_FW
	mov	x0, x21
	bl	_DVSCNTR
	ldr	w1, [sp, #24]                   ; 4-byte Folded Reload
	bl	_I915_WRITE_FW
	mov	x0, x21
	bl	_DVSSURF
	mov	x21, x0
	mov	x0, x19
	bl	_intel_plane_ggtt_offset
	ldr	w8, [sp, #28]                   ; 4-byte Folded Reload
	add	w1, w0, w8
	mov	x0, x21
	bl	_I915_WRITE_FW
	mov	x0, x25
	bl	_IS_G4X
	cbz	x0, LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_g4x_update_gamma
	b	LBB0_9
LBB0_8:
	mov	x0, x19
	bl	_ilk_update_gamma
LBB0_9:
	mov	x0, x25
	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
	b	_spin_unlock_irqrestore
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_DVS_SCALE_ENABLE,4,2           ; @DVS_SCALE_ENABLE
	.no_dead_strip	_g4x_update_plane
.subsections_via_symbols
