	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function skl_check_main_surface
_skl_check_main_surface:                ## @skl_check_main_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	24(%rdi), %rax
	movl	(%rax), %edi
	callq	_to_i915
	movq	%rax, %r15
	movq	16(%r13), %r14
	movl	(%r13), %r12d
	leaq	4(%r13), %rbx
	movswl	6(%r13), %eax
	movl	%eax, -44(%rbp)
	movswl	10(%r13), %eax
	movl	%eax, -48(%rbp)
	movq	%rbx, %rdi
	callq	_drm_rect_width
	sarl	$16, %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_drm_rect_height
	movl	%eax, %ebx
	movq	32(%r13), %rax
	movl	16(%rax), %eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	callq	_INTEL_GEN
	cmpl	$11, %eax
	jl	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%r12d, %edx
	callq	_icl_max_plane_width
	movq	%r14, %r15
	jmp	LBB0_6
LBB0_2:
	movq	%r15, %rdi
	callq	_INTEL_GEN
	cmpl	$9, %eax
	jg	LBB0_4
## %bb.3:
	movq	%r15, %rdi
	callq	_IS_GEMINILAKE
	testq	%rax, %rax
	je	LBB0_5
LBB0_4:
	movq	%r14, %r15
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%r12d, %edx
	callq	_glk_max_plane_width
LBB0_6:
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	cmpl	%eax, %r12d
	jg	LBB0_8
## %bb.7:
	cmpl	$268500992, %ebx                ## imm = 0x10010000
	jge	LBB0_8
## %bb.9:
	leaq	-44(%rbp), %rbx
	leaq	-48(%rbp), %r14
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r13, %rdx
	xorl	%ecx, %ecx
	callq	_intel_add_fb_offsets
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r13, %rdx
	xorl	%ecx, %ecx
	callq	_intel_plane_compute_aligned_offset
	movl	%eax, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_intel_surf_alignment
	movl	%eax, %r14d
	movl	-64(%rbp), %r9d                 ## 4-byte Reload
	cmpl	%r9d, %ebx
	jle	LBB0_11
## %bb.10:
	movl	%r14d, %eax
	negl	%eax
	andl	%eax, %r9d
	leaq	-44(%rbp), %rdi
	leaq	-48(%rbp), %rsi
	movq	%r13, %rdx
	xorl	%ecx, %ecx
	movl	%ebx, %r8d
	callq	_intel_plane_adjust_aligned_offset
	movl	%eax, %ebx
LBB0_11:
	movq	(%r15), %rdi
	movq	_I915_FORMAT_MOD_X_TILED@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	jne	LBB0_19
## %bb.12:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	8(%r15), %rax
	movq	(%rax), %rax
	movl	(%rax), %r15d
	movl	-44(%rbp), %eax
	addl	%r12d, %eax
	imull	%r15d, %eax
	movq	32(%r13), %rcx
	cmpl	4(%rcx), %eax
	jle	LBB0_19
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	testl	%ebx, %ebx
	je	LBB0_14
## %bb.17:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	%ebx, %r9d
	subl	%r14d, %r9d
	leaq	-44(%rbp), %rdi
	leaq	-48(%rbp), %rsi
	movq	%r13, %rdx
	xorl	%ecx, %ecx
	movl	%ebx, %r8d
	callq	_intel_plane_adjust_aligned_offset
	movl	%eax, %ebx
	movl	-44(%rbp), %eax
	addl	%r12d, %eax
	imull	%r15d, %eax
	movq	32(%r13), %rcx
	cmpl	4(%rcx), %eax
	jg	LBB0_13
## %bb.18:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
LBB0_19:
	callq	_is_ccs_modifier
	testq	%rax, %rax
	je	LBB0_20
## %bb.23:
	movl	-44(%rbp), %esi
	movl	-48(%rbp), %edx
	movq	%r13, %rdi
	movl	%ebx, %ecx
	callq	_skl_check_main_ccs_coordinates
	testl	%ebx, %ebx
	je	LBB0_28
## %bb.24:
	testl	%eax, %eax
	jne	LBB0_28
## %bb.25:
	leaq	-44(%rbp), %r15
	leaq	-48(%rbp), %r12
	.p2align	4, 0x90
LBB0_26:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %r9d
	subl	%r14d, %r9d
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%r13, %rdx
	xorl	%ecx, %ecx
	movl	%ebx, %r8d
	callq	_intel_plane_adjust_aligned_offset
	movl	%eax, %ebx
	movl	-44(%rbp), %esi
	movl	-48(%rbp), %edx
	movq	%r13, %rdi
	movl	%eax, %ecx
	callq	_skl_check_main_ccs_coordinates
	testl	%ebx, %ebx
	je	LBB0_28
## %bb.27:                              ##   in Loop: Header=BB0_26 Depth=1
	testl	%eax, %eax
	je	LBB0_26
LBB0_28:
	movl	-44(%rbp), %ecx
	movq	32(%r13), %rax
	cmpl	24(%rax), %ecx
	jne	LBB0_30
## %bb.29:
	movl	-48(%rbp), %ecx
	cmpl	28(%rax), %ecx
	je	LBB0_21
LBB0_30:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_15
LBB0_8:
	sarl	$16, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %edx
	xorl	%ebx, %ebx
	movl	%r12d, %esi
	movl	%eax, %ecx
	movl	$4096, %r8d                     ## imm = 0x1000
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	jmp	LBB0_16
LBB0_20:
	movq	32(%r13), %rax
LBB0_21:
	movl	%ebx, (%rax)
	movl	-44(%rbp), %esi
	movl	%esi, 8(%rax)
	movl	-48(%rbp), %edx
	movl	%edx, 12(%rax)
	shll	$16, %esi
	subl	4(%r13), %esi
	shll	$16, %edx
	subl	8(%r13), %edx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_drm_rect_translate
	xorl	%ebx, %ebx
	jmp	LBB0_22
LBB0_5:
	movq	%r14, %r15
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%r12d, %edx
	callq	_skl_max_plane_width
	jmp	LBB0_6
LBB0_14:
	leaq	L_.str.1(%rip), %rdi
LBB0_15:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
LBB0_16:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_22:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"requested Y/RGB source size %dx%d too big (limit %dx%d)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_I915_FORMAT_MOD_X_TILED,8,3    ## @I915_FORMAT_MOD_X_TILED
L_.str.1:                               ## @.str.1
	.asciz	"Unable to find suitable display surface offset due to X-tiling\n"

L_.str.2:                               ## @.str.2
	.asciz	"Unable to find suitable display surface offset due to CCS\n"

	.no_dead_strip	_skl_check_main_surface
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function skl_check_main_surface
_skl_check_main_surface:                ; @skl_check_main_surface
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	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
	mov	x19, x0
	ldr	x8, [x0, #24]
	ldr	w0, [x8]
	bl	_to_i915
	mov	x24, x0
	ldr	x21, [x19, #16]
	ldr	w23, [x19]
	add	x20, x19, #4
	ldrsh	w9, [x19, #6]
	ldrsh	w8, [x19, #10]
	stp	w8, w9, [sp, #40]
	mov	x0, x20
	bl	_drm_rect_width
	asr	w25, w0, #16
	mov	x0, x20
	bl	_drm_rect_height
	mov	x22, x0
	ldr	x8, [x19, #32]
	ldr	w26, [x8, #16]
	mov	x0, x24
	bl	_INTEL_GEN
	cmp	w0, #10
	b.le	LBB0_2
; %bb.1:
	mov	x0, x21
	mov	w1, #0
	mov	x2, x23
	bl	_icl_max_plane_width
	b	LBB0_5
LBB0_2:
	mov	x0, x24
	bl	_INTEL_GEN
	cmp	w0, #10
	b.ge	LBB0_4
; %bb.3:
	mov	x0, x24
	bl	_IS_GEMINILAKE
	cbz	x0, LBB0_24
LBB0_4:
	mov	x0, x21
	mov	w1, #0
	mov	x2, x23
	bl	_glk_max_plane_width
LBB0_5:
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w25, w0
	mov	w8, #268500992
	ccmp	w22, w8, #0, le
	b.lt	LBB0_7
; %bb.6:
	asr	w8, w22, #16
	mov	w9, #4096
	stp	x0, x9, [sp, #16]
	stp	x25, x8, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_26
LBB0_7:
	add	x0, sp, #44
	add	x1, sp, #40
	mov	x2, x19
	mov	w3, #0
	bl	_intel_add_fb_offsets
	add	x0, sp, #44
	add	x1, sp, #40
	mov	x2, x19
	mov	w3, #0
	bl	_intel_plane_compute_aligned_offset
	mov	x22, x0
	mov	x0, x21
	mov	w1, #0
	bl	_intel_surf_alignment
	mov	x23, x0
	cmp	w22, w26
	b.le	LBB0_9
; %bb.8:
	neg	w8, w23
	and	w5, w26, w8
	add	x0, sp, #44
	add	x1, sp, #40
	mov	x2, x19
	mov	w3, #0
	mov	x4, x22
	bl	_intel_plane_adjust_aligned_offset
	mov	x22, x0
LBB0_9:
	ldr	x0, [x21]
Lloh2:
	adrp	x8, _I915_FORMAT_MOD_X_TILED@GOTPAGE
Lloh3:
	ldr	x8, [x8, _I915_FORMAT_MOD_X_TILED@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_14
; %bb.10:
	ldr	x8, [x21, #8]
	ldr	x8, [x8]
	ldr	w24, [x8]
	ldr	w8, [sp, #44]
	add	w8, w8, w25
	mul	w8, w8, w24
	ldr	x9, [x19, #32]
	ldr	w9, [x9, #4]
	cmp	w8, w9
	b.le	LBB0_14
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	cbz	w22, LBB0_25
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	sub	w5, w22, w23
	add	x0, sp, #44
	add	x1, sp, #40
	mov	x2, x19
	mov	w3, #0
	mov	x4, x22
	bl	_intel_plane_adjust_aligned_offset
	mov	x22, x0
	ldr	w8, [sp, #44]
	add	w8, w8, w25
	mul	w8, w8, w24
	ldr	x9, [x19, #32]
	ldr	w9, [x9, #4]
	cmp	w8, w9
	b.gt	LBB0_11
; %bb.13:
	ldr	x0, [x21]
LBB0_14:
	bl	_is_ccs_modifier
	cbz	x0, LBB0_22
; %bb.15:
	ldp	w2, w1, [sp, #40]
	mov	x0, x19
	mov	x3, x22
	bl	_skl_check_main_ccs_coordinates
	cbz	w22, LBB0_19
; %bb.16:
	cbnz	w0, LBB0_19
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	sub	w5, w22, w23
	add	x0, sp, #44
	add	x1, sp, #40
	mov	x2, x19
	mov	w3, #0
	mov	x4, x22
	bl	_intel_plane_adjust_aligned_offset
	mov	x22, x0
	ldp	w2, w1, [sp, #40]
	mov	x0, x19
	mov	x3, x22
	bl	_skl_check_main_ccs_coordinates
	cbz	w22, LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	cbz	w0, LBB0_17
LBB0_19:
	ldr	w9, [sp, #44]
	ldr	x8, [x19, #32]
	ldr	w10, [x8, #24]
	cmp	w9, w10
	b.ne	LBB0_21
; %bb.20:
	ldr	w9, [sp, #40]
	ldr	w10, [x8, #28]
	cmp	w9, w10
	b.eq	LBB0_23
LBB0_21:
Lloh5:
	adrp	x0, l_.str.2@PAGE
Lloh6:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_26
LBB0_22:
	ldr	x8, [x19, #32]
LBB0_23:
	str	w22, [x8]
	ldp	w10, w9, [sp, #40]
	stp	w9, w10, [x8, #8]
	lsl	w8, w9, #16
	ldp	w9, w11, [x19, #4]
	sub	w1, w8, w9
	lsl	w8, w10, #16
	sub	w2, w8, w11
	mov	x0, x20
	bl	_drm_rect_translate
	mov	w0, #0
	b	LBB0_27
LBB0_24:
	mov	x0, x21
	mov	w1, #0
	mov	x2, x23
	bl	_skl_max_plane_width
	b	LBB0_5
LBB0_25:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_26:
	bl	_DRM_DEBUG_KMS
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_27:
	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
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"requested Y/RGB source size %dx%d too big (limit %dx%d)\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_I915_FORMAT_MOD_X_TILED,8,3    ; @I915_FORMAT_MOD_X_TILED
l_.str.1:                               ; @.str.1
	.asciz	"Unable to find suitable display surface offset due to X-tiling\n"

l_.str.2:                               ; @.str.2
	.asciz	"Unable to find suitable display surface offset due to CCS\n"

	.no_dead_strip	_skl_check_main_surface
.subsections_via_symbols
