	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_object_create_stolen_for_preallocated ## -- Begin function i915_gem_object_create_stolen_for_preallocated
	.p2align	4, 0x90
_i915_gem_object_create_stolen_for_preallocated: ## @i915_gem_object_create_stolen_for_preallocated
	.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, %r15
	movq	%rsi, -64(%rbp)
	movq	%rdx, -56(%rbp)
	movq	%rcx, -48(%rbp)
	leaq	4(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_drm_mm_initialized
	testl	%eax, %eax
	je	LBB0_18
## %bb.1:
	leaq	8(%r15), %rdi
	callq	_lockdep_assert_held
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	leaq	-64(%rbp), %rsi
	leaq	-56(%rbp), %rdx
	leaq	-48(%rbp), %rcx
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
	xorl	%edi, %edi
	cmpq	$0, -48(%rbp)
	sete	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	jne	LBB0_19
## %bb.2:
	movq	-48(%rbp), %rdi
	movq	_I915_GTT_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_IS_ALIGNED
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	jne	LBB0_18
## %bb.3:
	movq	-64(%rbp), %rdi
	movq	_I915_GTT_MIN_ALIGNMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_IS_ALIGNED
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_4
LBB0_18:
	xorl	%r14d, %r14d
LBB0_19:
	movq	%r14, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_18
## %bb.5:
	movq	%rax, %r12
	movq	-64(%rbp), %rax
	movq	%rax, 8(%r12)
	movq	-48(%rbp), %rax
	movq	%rax, (%r12)
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_drm_mm_reserve_node
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	je	LBB0_8
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
LBB0_7:
	movq	%r12, %rdi
	callq	_kfree
	jmp	LBB0_19
LBB0_8:
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	__i915_gem_object_create_stolen
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	%rax, %r14
	movq	-56(%rbp), %rax
	movq	_I915_GTT_OFFSET_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_19
## %bb.11:
	movq	%r14, %rdi
	callq	_i915_gem_object_pin_pages
	testl	%eax, %eax
	jne	LBB0_17
## %bb.12:
	leaq	12(%r15), %r12
	movq	%r14, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_i915_vma_instance
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movq	%rbx, %rdi
	callq	_PTR_ERR
	jmp	LBB0_16
LBB0_9:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_i915_gem_stolen_remove_node
	jmp	LBB0_7
LBB0_14:
	movq	%rbx, %r13
	addq	$12, %r13
	movq	-48(%rbp), %rdx
	movq	-56(%rbp), %rcx
	movl	8(%r14), %r8d
	movq	%r12, %rdi
	movq	%r13, %rsi
	xorl	%r9d, %r9d
	callq	_i915_gem_gtt_reserve
	testl	%eax, %eax
	je	LBB0_20
## %bb.15:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
LBB0_16:
	movq	%r14, %rdi
	callq	_i915_gem_object_unpin_pages
LBB0_17:
	movq	%r14, %rdi
	callq	_i915_gem_object_put
	jmp	LBB0_18
LBB0_20:
	movq	%r13, %rdi
	callq	_drm_mm_node_allocated
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_GEM_BUG_ON
	movl	4(%r14), %eax
	movl	%eax, 8(%rbx)
	movq	_I915_VMA_GLOBAL_BIND@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%rbx)
	movq	%rbx, %rdi
	callq	___i915_vma_set_map_and_fenceable
	movq	%r12, %rdi
	callq	_mutex_lock
	addq	$16, %r15
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_list_move_tail
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	%r14, %rdi
	callq	_i915_gem_object_is_shrinkable
	movl	%eax, %edi
	callq	_GEM_BUG_ON
	movq	%r14, %rdi
	callq	_atomic_inc
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"creating preallocated stolen object: stolen_offset=%pa, gtt_offset=%pa, size=%pa\n"

	.comm	_I915_GTT_PAGE_SIZE,4,2         ## @I915_GTT_PAGE_SIZE
	.comm	_I915_GTT_MIN_ALIGNMENT,4,2     ## @I915_GTT_MIN_ALIGNMENT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.1:                               ## @.str.1
	.asciz	"failed to allocate stolen space\n"

L_.str.2:                               ## @.str.2
	.asciz	"failed to allocate stolen object\n"

	.comm	_I915_GTT_OFFSET_NONE,8,3       ## @I915_GTT_OFFSET_NONE
L_.str.3:                               ## @.str.3
	.asciz	"failed to allocate stolen GTT space\n"

	.comm	_I915_VMA_GLOBAL_BIND,4,2       ## @I915_VMA_GLOBAL_BIND
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_object_create_stolen_for_preallocated ; -- Begin function i915_gem_object_create_stolen_for_preallocated
	.p2align	2
_i915_gem_object_create_stolen_for_preallocated: ; @i915_gem_object_create_stolen_for_preallocated
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	stp	x2, x1, [sp, #32]
	str	x3, [sp, #24]
	add	x20, x0, #4
	mov	x0, x20
	bl	_drm_mm_initialized
	cbz	w0, LBB0_4
; %bb.1:
	add	x0, x19, #8
	bl	_lockdep_assert_held
	add	x8, sp, #24
	str	x8, [sp, #16]
	add	x8, sp, #32
	add	x9, sp, #40
	stp	x9, x8, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	ldr	x8, [sp, #24]
	cmp	x8, #0
	cset	w0, eq
	bl	_WARN_ON
	cbnz	x0, LBB0_4
; %bb.2:
	ldr	x0, [sp, #24]
Lloh2:
	adrp	x8, _I915_GTT_PAGE_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _I915_GTT_PAGE_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_IS_ALIGNED
	cmp	w0, #0
	cset	w0, eq
	bl	_WARN_ON
	cbnz	x0, LBB0_4
; %bb.3:
	ldr	x0, [sp, #40]
Lloh5:
	adrp	x8, _I915_GTT_MIN_ALIGNMENT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _I915_GTT_MIN_ALIGNMENT@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_IS_ALIGNED
	cmp	w0, #0
	cset	w0, eq
	bl	_WARN_ON
	cbz	x0, LBB0_6
LBB0_4:
	mov	x20, #0
LBB0_5:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_6:
Lloh8:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_4
; %bb.7:
	mov	x21, x0
	ldr	x8, [sp, #40]
	ldr	x9, [sp, #24]
	stp	x9, x8, [x0]
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x20
	mov	x1, x21
	bl	_drm_mm_reserve_node
	mov	x20, x0
	mov	x0, x19
	bl	_mutex_unlock
	cbz	w20, LBB0_9
; %bb.8:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	mov	x0, x21
	bl	_kfree
	b	LBB0_4
LBB0_9:
	mov	x0, x19
	mov	x1, x21
	bl	__i915_gem_object_create_stolen
	mov	x20, x0
	cbz	x0, LBB0_14
; %bb.10:
	ldr	x8, [sp, #32]
Lloh13:
	adrp	x9, _I915_GTT_OFFSET_NONE@GOTPAGE
Lloh14:
	ldr	x9, [x9, _I915_GTT_OFFSET_NONE@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_5
; %bb.11:
	mov	x0, x20
	bl	_i915_gem_object_pin_pages
	cbnz	w0, LBB0_18
; %bb.12:
	add	x21, x19, #12
	mov	x0, x20
	mov	x1, x21
	mov	x2, #0
	bl	_i915_vma_instance
	mov	x22, x0
	bl	_IS_ERR
	cbz	x0, LBB0_15
; %bb.13:
	mov	x0, x22
	bl	_PTR_ERR
	b	LBB0_17
LBB0_14:
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	mov	x0, x19
	mov	x1, x21
	bl	_i915_gem_stolen_remove_node
	mov	x0, x21
	bl	_kfree
	b	LBB0_5
LBB0_15:
	add	x23, x22, #12
	ldp	x2, x3, [sp, #24]
	ldr	w4, [x20, #8]
	mov	x0, x21
	mov	x1, x23
	mov	w5, #0
	bl	_i915_gem_gtt_reserve
	cbz	w0, LBB0_19
; %bb.16:
Lloh18:
	adrp	x0, l_.str.3@PAGE
Lloh19:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
LBB0_17:
	mov	x0, x20
	bl	_i915_gem_object_unpin_pages
LBB0_18:
	mov	x0, x20
	bl	_i915_gem_object_put
	b	LBB0_4
LBB0_19:
	mov	x0, x23
	bl	_drm_mm_node_allocated
	cmp	w0, #0
	cset	w0, eq
	bl	_GEM_BUG_ON
Lloh20:
	adrp	x8, _I915_VMA_GLOBAL_BIND@GOTPAGE
Lloh21:
	ldr	x8, [x8, _I915_VMA_GLOBAL_BIND@GOTPAGEOFF]
	ldr	w9, [x20, #4]
Lloh22:
	ldr	w8, [x8]
	ldr	w10, [x22, #4]
	orr	w8, w10, w8
	stp	w8, w9, [x22, #4]
	mov	x0, x22
	bl	___i915_vma_set_map_and_fenceable
	mov	x0, x21
	bl	_mutex_lock
	add	x1, x19, #16
	mov	x0, x22
	bl	_list_move_tail
	mov	x0, x21
	bl	_mutex_unlock
	mov	x0, x20
	bl	_i915_gem_object_is_shrinkable
	bl	_GEM_BUG_ON
	mov	x0, x20
	bl	_atomic_inc
	b	LBB0_5
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"creating preallocated stolen object: stolen_offset=%pa, gtt_offset=%pa, size=%pa\n"

	.comm	_I915_GTT_PAGE_SIZE,4,2         ; @I915_GTT_PAGE_SIZE
	.comm	_I915_GTT_MIN_ALIGNMENT,4,2     ; @I915_GTT_MIN_ALIGNMENT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.1:                               ; @.str.1
	.asciz	"failed to allocate stolen space\n"

l_.str.2:                               ; @.str.2
	.asciz	"failed to allocate stolen object\n"

	.comm	_I915_GTT_OFFSET_NONE,8,3       ; @I915_GTT_OFFSET_NONE
l_.str.3:                               ; @.str.3
	.asciz	"failed to allocate stolen GTT space\n"

	.comm	_I915_VMA_GLOBAL_BIND,4,2       ; @I915_VMA_GLOBAL_BIND
.subsections_via_symbols
