	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_plane_remap_gtt
_intel_plane_remap_gtt:                 ## @intel_plane_remap_gtt
	.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	$136, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	40(%rdi), %rax
	movl	(%rax), %edi
	callq	_to_i915
	movq	%rax, %r13
	movq	32(%r12), %rbx
	movq	%rbx, %rdi
	callq	_to_intel_framebuffer
	movq	%rax, -160(%rbp)                ## 8-byte Spill
	leaq	48(%r12), %r14
	movl	8(%r12), %r15d
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	movq	8(%rbx), %rax
	movl	(%rax), %eax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	%r13, -168(%rbp)                ## 8-byte Spill
	movq	%r13, %rdi
	callq	_intel_tile_size
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -136(%rbp)                ## 8-byte Spill
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movl	%r15d, -72(%rbp)                ## 4-byte Spill
	movl	%r15d, %edi
	callq	_drm_rotation_90_or_270
	testq	%rax, %rax
	jne	LBB0_1
## %bb.2:
	movq	_I915_GGTT_VIEW_REMAPPED@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_I915_GGTT_VIEW_ROTATED@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %eax
	movl	%eax, 48(%r12)
	leaq	12(%r12), %r14
	movl	12(%r12), %ebx
	movl	16(%r12), %r15d
	movq	%r14, %rdi
	callq	_drm_rect_width
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	callq	_drm_rect_height
	movl	%eax, %r13d
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movl	16(%rax), %edi
	callq	_is_ccs_modifier
	movl	%eax, %edi
	callq	_WARN_ON
	movl	%ebx, -68(%rbp)                 ## 4-byte Spill
	movl	%ebx, %esi
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	andl	$-65536, %esi                   ## imm = 0xFFFF0000
	negl	%esi
	movl	%r15d, -64(%rbp)                ## 4-byte Spill
	movl	%r15d, %edx
	andl	$-65536, %edx                   ## imm = 0xFFFF0000
	negl	%edx
	movq	%r14, %rdi
	callq	_drm_rect_translate
	movl	-72(%rbp), %edi                 ## 4-byte Reload
	callq	_drm_rotation_90_or_270
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movl	%ebx, %esi
	andl	$-65536, %esi                   ## imm = 0xFFFF0000
	movl	%r13d, %edx
	andl	$-65536, %edx                   ## imm = 0xFFFF0000
	movq	_DRM_MODE_ROTATE_270@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	callq	_drm_rect_rotate
LBB0_5:
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	testl	%eax, %eax
	jle	LBB0_14
## %bb.6:
	sarl	$16, -68(%rbp)                  ## 4-byte Folded Spill
	sarl	$16, -64(%rbp)                  ## 4-byte Folded Spill
	sarl	$16, -60(%rbp)                  ## 4-byte Folded Spill
	sarl	$16, %r13d
	movl	%r13d, -100(%rbp)               ## 4-byte Spill
	shlq	$3, %rax
	leaq	(%rax,%rax,2), %rax
	movq	%rax, -144(%rbp)                ## 8-byte Spill
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	movl	$0, -76(%rbp)                   ## 4-byte Folded Spill
	movq	%r12, -152(%rbp)                ## 8-byte Spill
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	(%r14), %rax
	movq	56(%r14), %rcx
	movl	4(%rcx,%r15), %r12d
	movl	-88(%rbp), %ecx                 ## 4-byte Reload
	imull	%r12d, %ecx
	imull	-52(%rbp), %ecx
	movl	%ecx, (%rax,%r15)
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	-52(%rbp), %edx
	movl	-56(%rbp), %ecx
	movl	-76(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %eax
	movq	-136(%rbp), %r8                 ## 8-byte Reload
	imull	%r8d, %eax
	leaq	-48(%rbp), %rdi
	leaq	-44(%rbp), %rsi
                                        ## kill: def $r8d killed $r8d killed $r8
	movl	%r12d, %r9d
	pushq	$0
	pushq	%rax
	callq	_intel_adjust_tile_offset
	addq	$16, %rsp
	movq	(%r14), %rax
	movq	56(%r14), %rcx
	movl	8(%rcx,%r15), %edx
	imull	4(%rcx,%r15), %edx
	addl	%edx, %ebx
	movl	%ebx, -76(%rbp)                 ## 4-byte Spill
	movq	$0, 16(%rax,%r15)
	movl	-48(%rbp), %ecx
	movl	%ecx, 4(%rax,%r15)
	movl	-44(%rbp), %ecx
	movl	%ecx, 8(%rax,%r15)
	incq	%r13
	addq	$24, %r15
	cmpq	%r15, -144(%rbp)                ## 8-byte Folded Reload
	je	LBB0_14
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	testq	%r15, %r15
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	4(%rax), %ebx
	movl	8(%rax), %r14d
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_7 Depth=1
	movl	$1, %ebx
	movl	$1, %r14d
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	16(%rax), %rax
	movl	(%rax,%r13,4), %eax
	movl	%eax, -88(%rbp)                 ## 4-byte Spill
	movq	-96(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movl	%r13d, %esi
	leaq	-52(%rbp), %rdx
	leaq	-56(%rbp), %rcx
	callq	_intel_tile_dims
	movl	-68(%rbp), %eax                 ## 4-byte Reload
	xorl	%edx, %edx
	divl	%ebx
	movl	%eax, %ecx
	movl	%eax, -48(%rbp)
	movl	-64(%rbp), %eax                 ## 4-byte Reload
	xorl	%edx, %edx
	divl	%r14d
	movl	%eax, %esi
	movl	%eax, -44(%rbp)
	movl	-60(%rbp), %eax                 ## 4-byte Reload
	xorl	%edx, %edx
	divl	%ebx
	movl	%eax, -108(%rbp)                ## 4-byte Spill
	movl	-100(%rbp), %eax                ## 4-byte Reload
	xorl	%edx, %edx
	divl	%r14d
	movl	%eax, -104(%rbp)                ## 4-byte Spill
	movq	-160(%rbp), %rax                ## 8-byte Reload
	movq	(%rax), %rax
	addl	(%rax,%r13,8), %ecx
	movl	%ecx, -48(%rbp)
	addl	4(%rax,%r13,8), %esi
	movl	%esi, -44(%rbp)
	movq	(%r12), %rax
	movl	(%rax,%r13,4), %r9d
	movq	_DRM_MODE_ROTATE_0@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-168(%rbp), %rdi                ## 8-byte Reload
	leaq	-48(%rbp), %rsi
	leaq	-44(%rbp), %rdx
	movq	%r12, %rcx
	movl	%r13d, %r8d
	movq	-136(%rbp), %rbx                ## 8-byte Reload
	pushq	%rbx
	pushq	%rax
	callq	_intel_compute_aligned_offset
	addq	$16, %rsp
	xorl	%edx, %edx
	divl	%ebx
	movq	-152(%rbp), %r14                ## 8-byte Reload
	movq	56(%r14), %rcx
	movl	%eax, (%rcx,%r15)
	movq	(%r12), %rax
	movl	-104(%rbp), %r12d               ## 4-byte Reload
	movl	-108(%rbp), %ebx                ## 4-byte Reload
	movl	(%rax,%r13,4), %edi
	movl	-52(%rbp), %esi
	imull	-88(%rbp), %esi                 ## 4-byte Folded Reload
	callq	_DIV_ROUND_UP
	movq	56(%r14), %rcx
	movq	%rax, 16(%rcx,%r15)
	movl	-48(%rbp), %edi
	addl	%ebx, %edi
	movl	-52(%rbp), %esi
	callq	_DIV_ROUND_UP
	movq	56(%r14), %rcx
	movl	%eax, 4(%rcx,%r15)
	movl	-44(%rbp), %edi
	addl	%r12d, %edi
	movl	-56(%rbp), %esi
	callq	_DIV_ROUND_UP
	movq	56(%r14), %rcx
	movl	%eax, 8(%rcx,%r15)
	movl	-72(%rbp), %edi                 ## 4-byte Reload
	callq	_drm_rotation_90_or_270
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	-48(%rbp), %eax
	movl	%eax, -128(%rbp)
	movl	-44(%rbp), %ecx
	movl	%ecx, -124(%rbp)
	addl	%eax, %ebx
	movl	%ebx, -120(%rbp)
	addl	%ecx, %r12d
	movl	%r12d, -116(%rbp)
	movq	56(%r14), %rax
	movl	-52(%rbp), %esi
	imull	4(%rax,%r15), %esi
	movl	-56(%rbp), %edx
	imull	8(%rax,%r15), %edx
	movq	_DRM_MODE_ROTATE_270@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-128(%rbp), %rdi
	callq	_drm_rect_rotate
	movl	-128(%rbp), %eax
	movl	-124(%rbp), %ecx
	movl	%eax, -48(%rbp)
	movl	%ecx, -44(%rbp)
	movq	(%r14), %rax
	movq	56(%r14), %rcx
	movl	8(%rcx,%r15), %r12d
	movl	-56(%rbp), %ecx
	imull	%r12d, %ecx
	movl	%ecx, (%rax,%r15)
	movl	-52(%rbp), %edi
	movl	-56(%rbp), %esi
	callq	_swap
	jmp	LBB0_13
LBB0_14:
	addq	$136, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I915_GGTT_VIEW_ROTATED,4,2     ## @I915_GGTT_VIEW_ROTATED
	.comm	_I915_GGTT_VIEW_REMAPPED,4,2    ## @I915_GGTT_VIEW_REMAPPED
	.comm	_DRM_MODE_ROTATE_270,4,2        ## @DRM_MODE_ROTATE_270
	.comm	_DRM_MODE_ROTATE_0,4,2          ## @DRM_MODE_ROTATE_0
	.no_dead_strip	_intel_plane_remap_gtt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_plane_remap_gtt
_intel_plane_remap_gtt:                 ; @intel_plane_remap_gtt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x28, x27, [sp, #96]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #112]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #128]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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, x0
	ldr	x8, [x0, #40]
	ldr	w0, [x8]
	bl	_to_i915
	mov	x22, x0
	ldr	x21, [x19, #32]
	mov	x0, x21
	bl	_to_intel_framebuffer
	stp	x0, x22, [sp, #40]              ; 16-byte Folded Spill
	add	x25, x19, #48
	ldr	w24, [x19, #8]
	ldr	x8, [x21, #8]
	ldr	w20, [x8]
	mov	x0, x22
	bl	_intel_tile_size
	str	w0, [sp, #60]                   ; 4-byte Folded Spill
	mov	x0, x25
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	mov	x0, x24
	bl	_drm_rotation_90_or_270
Lloh0:
	adrp	x8, _I915_GGTT_VIEW_ROTATED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I915_GGTT_VIEW_ROTATED@GOTPAGEOFF]
Lloh2:
	adrp	x9, _I915_GGTT_VIEW_REMAPPED@GOTPAGE
Lloh3:
	ldr	x9, [x9, _I915_GGTT_VIEW_REMAPPED@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x9, x8, eq
	ldr	w8, [x8]
	str	w8, [x19, #48]
	mov	x25, x19
	ldp	w22, w23, [x25, #12]!
	mov	x0, x25
	bl	_drm_rect_width
	mov	x27, x0
	mov	x0, x25
	bl	_drm_rect_height
	mov	x26, x0
	ldr	w0, [x21, #16]
	bl	_is_ccs_modifier
	bl	_WARN_ON
	and	w8, w22, #0xffff0000
	neg	w1, w8
	and	w8, w23, #0xffff0000
	neg	w2, w8
	mov	x0, x25
	bl	_drm_rect_translate
	str	w24, [sp, #36]                  ; 4-byte Folded Spill
	mov	x0, x24
	bl	_drm_rotation_90_or_270
Lloh4:
	adrp	x8, _DRM_MODE_ROTATE_270@GOTPAGE
Lloh5:
	ldr	x8, [x8, _DRM_MODE_ROTATE_270@GOTPAGEOFF]
	cbz	x0, LBB0_2
; %bb.1:
	and	w1, w27, #0xffff0000
	and	w2, w26, #0xffff0000
	ldr	w3, [x8]
	mov	x0, x25
	bl	_drm_rect_rotate
LBB0_2:
	cmp	w20, #1
	b.lt	LBB0_11
; %bb.3:
	mov	x28, #0
	mov	x25, #0
	mov	x9, x27
	mov	w27, #0
	asr	w10, w22, #16
	asr	w8, w23, #16
	stp	w8, w10, [sp, #28]              ; 8-byte Folded Spill
	asr	w10, w9, #16
	asr	w8, w26, #16
	stp	w8, w10, [sp, #20]              ; 8-byte Folded Spill
	add	x8, x20, x20, lsl #1
	mov	w20, #4
	lsl	x8, x8, #3
	stp	x19, x8, [sp]                   ; 16-byte Folded Spill
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x19, #56]
	add	x8, x8, x28
	ldr	w26, [x8, #4]
	ldur	w8, [x29, #-84]
	mul	w9, w26, w22
	mul	w8, w9, w8
	ldr	x9, [x19]
	str	w8, [x9, x28]
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldur	w2, [x29, #-84]
	ldr	w3, [sp, #88]
	ldr	w4, [sp, #60]                   ; 4-byte Folded Reload
	mul	w6, w27, w4
	add	x0, sp, #84
	add	x1, sp, #80
	mov	x5, x26
	mov	w7, #0
	bl	_intel_adjust_tile_offset
	ldr	x8, [x19, #56]
	add	x8, x8, x28
	ldp	w9, w8, [x8, #4]
	madd	w27, w8, w9, w27
	ldr	x8, [x19]
	add	x8, x8, x28
	str	xzr, [x8, #16]
	ldr	w9, [sp, #84]
	str	w9, [x8, #4]
	ldr	w9, [sp, #80]
	str	w9, [x8, #8]
	add	x25, x25, #1
	add	x28, x28, #24
	add	x20, x20, #8
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	cmp	x8, x28
	b.eq	LBB0_11
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #8]
	cbz	x28, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldp	w26, w23, [x8, #4]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	w26, #1
	mov	w23, #1
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x8, #16]
	lsl	x24, x25, #2
	ldr	w19, [x8, x24]
	sub	x2, x29, #84
	add	x3, sp, #88
	mov	x0, x21
	mov	x1, x25
	bl	_intel_tile_dims
	ldp	w9, w8, [sp, #28]               ; 8-byte Folded Reload
	udiv	w8, w8, w26
	udiv	w9, w9, w23
	stp	w9, w8, [sp, #80]
	ldr	w10, [sp, #24]                  ; 4-byte Folded Reload
	udiv	w26, w10, w26
	ldp	x10, x0, [sp, #40]              ; 16-byte Folded Reload
	ldr	x10, [x10]
	add	x10, x10, x20
	ldur	w11, [x10, #-4]
	add	w8, w11, w8
	str	w8, [sp, #84]
	ldr	w8, [x10]
	add	w8, w8, w9
	str	w8, [sp, #80]
	ldr	x8, [x21]
	ldr	w5, [x8, x24]
Lloh6:
	adrp	x8, _DRM_MODE_ROTATE_0@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DRM_MODE_ROTATE_0@GOTPAGEOFF]
Lloh8:
	ldr	w6, [x8]
	ldr	w8, [sp, #20]                   ; 4-byte Folded Reload
	udiv	w23, w8, w23
	add	x1, sp, #84
	add	x2, sp, #80
	mov	x3, x21
	mov	x4, x25
	mov	x22, x21
	ldr	w21, [sp, #60]                  ; 4-byte Folded Reload
	mov	x7, x21
	bl	_intel_compute_aligned_offset
	udiv	w8, w0, w21
	mov	x21, x22
	mov	x22, x19
	ldr	x19, [sp]                       ; 8-byte Folded Reload
	ldr	x9, [x19, #56]
	str	w8, [x9, x28]
	ldr	x8, [x21]
	ldr	w0, [x8, x24]
	ldur	w8, [x29, #-84]
	mul	w1, w8, w22
	bl	_DIV_ROUND_UP
	ldr	x8, [x19, #56]
	add	x8, x8, x28
	str	x0, [x8, #16]
	ldr	w8, [sp, #84]
	add	w0, w8, w26
	ldur	w1, [x29, #-84]
	bl	_DIV_ROUND_UP
	ldr	x8, [x19, #56]
	add	x8, x8, x28
	str	w0, [x8, #4]
	ldr	w8, [sp, #80]
	add	w0, w8, w23
	ldr	w1, [sp, #88]
	bl	_DIV_ROUND_UP
	ldr	x8, [x19, #56]
	add	x8, x8, x28
	str	w0, [x8, #8]
	ldr	w0, [sp, #36]                   ; 4-byte Folded Reload
	bl	_drm_rotation_90_or_270
	cbz	x0, LBB0_4
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	ldp	w9, w8, [sp, #80]
	stp	w8, w9, [sp, #64]
	add	w8, w8, w26
	add	w9, w9, w23
	stp	w8, w9, [sp, #72]
	ldr	x8, [x19, #56]
	add	x8, x8, x28
	ldur	w9, [x29, #-84]
	ldp	w10, w8, [x8, #4]
	mul	w1, w9, w10
	ldr	w9, [sp, #88]
	mul	w2, w9, w8
Lloh9:
	adrp	x8, _DRM_MODE_ROTATE_270@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DRM_MODE_ROTATE_270@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	add	x0, sp, #64
	bl	_drm_rect_rotate
	ldp	w8, w9, [sp, #64]
	stp	w9, w8, [sp, #80]
	ldr	x8, [x19, #56]
	add	x8, x8, x28
	ldr	w26, [x8, #8]
	ldr	w8, [sp, #88]
	mul	w8, w8, w26
	ldr	x9, [x19]
	str	w8, [x9, x28]
	ldur	w0, [x29, #-84]
	ldr	w1, [sp, #88]
	bl	_swap
	b	LBB0_5
LBB0_11:
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #128]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #112]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_I915_GGTT_VIEW_ROTATED,4,2     ; @I915_GGTT_VIEW_ROTATED
	.comm	_I915_GGTT_VIEW_REMAPPED,4,2    ; @I915_GGTT_VIEW_REMAPPED
	.comm	_DRM_MODE_ROTATE_270,4,2        ; @DRM_MODE_ROTATE_270
	.comm	_DRM_MODE_ROTATE_0,4,2          ; @DRM_MODE_ROTATE_0
	.no_dead_strip	_intel_plane_remap_gtt
.subsections_via_symbols
