	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i9xx_check_plane_surface       ## -- Begin function i9xx_check_plane_surface
	.p2align	4, 0x90
_i9xx_check_plane_surface:              ## @i9xx_check_plane_surface
	.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, %rbx
	movq	24(%rdi), %rax
	movl	(%rax), %edi
	callq	_to_i915
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_intel_plane_compute_gtt
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.1:
	cmpl	$0, 20(%rbx)
	je	LBB0_11
## %bb.2:
	leaq	12(%rbx), %r12
	movswl	14(%rbx), %eax
	movl	%eax, -44(%rbp)
	movswl	18(%rbx), %eax
	movl	%eax, -48(%rbp)
	leaq	-44(%rbp), %rdi
	leaq	-48(%rbp), %rsi
	xorl	%r15d, %r15d
	movq	%rbx, %rdx
	xorl	%ecx, %ecx
	callq	_intel_add_fb_offsets
	movq	%r13, %rdi
	callq	_INTEL_GEN
	cmpl	$4, %eax
	jl	LBB0_4
## %bb.3:
	leaq	-44(%rbp), %rdi
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdx
	xorl	%ecx, %ecx
	callq	_intel_plane_compute_aligned_offset
	movq	%rax, %r15
LBB0_4:
	movl	-44(%rbp), %esi
	shll	$16, %esi
	subl	12(%rbx), %esi
	movl	-48(%rbp), %edx
	shll	$16, %edx
	subl	16(%rbx), %edx
	movq	%r12, %rdi
	callq	_drm_rect_translate
	movq	%r13, %rdi
	callq	_IS_HASWELL
	testl	%eax, %eax
	jne	LBB0_10
## %bb.5:
	movq	%r13, %rdi
	callq	_IS_BROADWELL
	testl	%eax, %eax
	jne	LBB0_10
## %bb.6:
	movl	8(%rbx), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%r12, %rdi
	callq	_drm_rect_width
	movl	%eax, %r13d
	sarl	$16, %r13d
	movq	%r12, %rdi
	callq	_drm_rect_height
                                        ## kill: def $eax killed $eax def $rax
	movq	_DRM_MODE_ROTATE_180@GOTPCREL(%rip), %rcx
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	testl	%edx, (%rcx)
	je	LBB0_8
## %bb.7:
	sarl	$16, %eax
	movl	-44(%rbp), %ecx
	addl	%r13d, %ecx
	decl	%ecx
	movl	%ecx, -44(%rbp)
	movl	-48(%rbp), %ecx
	addl	%ecx, %eax
	decl	%eax
	movl	%eax, -48(%rbp)
	jmp	LBB0_10
LBB0_8:
	movl	%edx, %ecx
	movq	_DRM_MODE_REFLECT_X@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_10
## %bb.9:
	movl	-44(%rbp), %eax
	addl	%r13d, %eax
	decl	%eax
	movl	%eax, -44(%rbp)
LBB0_10:
	movq	(%rbx), %rax
	movq	%r15, 8(%rax)
	movl	-44(%rbp), %ecx
	movl	%ecx, (%rax)
	movl	-48(%rbp), %ecx
	movl	%ecx, 4(%rax)
LBB0_11:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_MODE_ROTATE_180,4,2        ## @DRM_MODE_ROTATE_180
	.comm	_DRM_MODE_REFLECT_X,4,2         ## @DRM_MODE_REFLECT_X
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i9xx_check_plane_surface       ; -- Begin function i9xx_check_plane_surface
	.p2align	2
_i9xx_check_plane_surface:              ; @i9xx_check_plane_surface
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	x8, [x0, #24]
	ldr	w0, [x8]
	bl	_to_i915
	mov	x21, x0
	mov	x0, x19
	bl	_intel_plane_compute_gtt
	mov	x20, x0
	cbnz	w0, LBB0_12
; %bb.1:
	ldr	w8, [x19, #20]
	cbz	w8, LBB0_12
; %bb.2:
	add	x22, x19, #12
	ldrsh	w9, [x19, #14]
	ldrsh	w8, [x19, #18]
	stp	w8, w9, [sp, #8]
	add	x0, sp, #12
	add	x1, sp, #8
	mov	x2, x19
	mov	w3, #0
	bl	_intel_add_fb_offsets
	mov	x0, x21
	bl	_INTEL_GEN
	cmp	w0, #4
	b.lt	LBB0_4
; %bb.3:
	add	x0, sp, #12
	add	x1, sp, #8
	mov	x2, x19
	mov	w3, #0
	bl	_intel_plane_compute_aligned_offset
	mov	x23, x0
	b	LBB0_5
LBB0_4:
	mov	x23, #0
LBB0_5:
	ldr	w8, [sp, #12]
	lsl	w8, w8, #16
	ldp	w9, w10, [x19, #12]
	sub	w1, w8, w9
	ldr	w8, [sp, #8]
	lsl	w8, w8, #16
	sub	w2, w8, w10
	mov	x0, x22
	bl	_drm_rect_translate
	mov	x0, x21
	bl	_IS_HASWELL
	cbnz	w0, LBB0_11
; %bb.6:
	mov	x0, x21
	bl	_IS_BROADWELL
	cbnz	w0, LBB0_11
; %bb.7:
	ldr	w24, [x19, #8]
	mov	x0, x22
	bl	_drm_rect_width
	asr	w21, w0, #16
	mov	x0, x22
	bl	_drm_rect_height
Lloh0:
	adrp	x8, _DRM_MODE_ROTATE_180@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRM_MODE_ROTATE_180@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w24
	b.eq	LBB0_9
; %bb.8:
	ldr	w8, [sp, #12]
	add	w8, w21, w8
	sub	w9, w8, #1
	ldr	w8, [sp, #8]
	add	w8, w8, w0, asr #16
	sub	w8, w8, #1
	stp	w8, w9, [sp, #8]
	b	LBB0_11
LBB0_9:
Lloh3:
	adrp	x8, _DRM_MODE_REFLECT_X@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DRM_MODE_REFLECT_X@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w24
	b.eq	LBB0_11
; %bb.10:
	ldr	w8, [sp, #12]
	add	w8, w21, w8
	sub	w8, w8, #1
	str	w8, [sp, #12]
LBB0_11:
	ldr	x8, [x19]
	str	x23, [x8, #8]
	ldr	w9, [sp, #12]
	str	w9, [x8]
	ldr	w9, [sp, #8]
	str	w9, [x8, #4]
LBB0_12:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_MODE_ROTATE_180,4,2        ; @DRM_MODE_ROTATE_180
	.comm	_DRM_MODE_REFLECT_X,4,2         ; @DRM_MODE_REFLECT_X
.subsections_via_symbols
