	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_gt_init_scratch          ## -- Begin function intel_gt_init_scratch
	.p2align	4, 0x90
_intel_gt_init_scratch:                 ## @intel_gt_init_scratch
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	16(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_i915_gem_object_create_stolen
	movq	%rax, %r13
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_i915_gem_object_create_internal
	movq	%rax, %r13
LBB0_2:
	movq	%r13, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_3
## %bb.9:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	movq	%r13, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_3:
	movq	8(%r14), %rsi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_i915_vma_instance
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movq	%r15, %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_5
LBB0_6:
	movq	_PIN_GLOBAL@GOTPCREL(%rip), %rax
	movq	_PIN_HIGH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	xorl	%r12d, %r12d
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_i915_vma_pin
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_7
LBB0_5:
	movq	%r13, %rdi
	callq	_i915_gem_object_put
	movl	%ebx, %r12d
LBB0_8:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r15, %rdi
	callq	_i915_vma_make_unshrinkable
	movl	%eax, (%r14)
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate scratch page\n"

	.comm	_PIN_GLOBAL,4,2                 ## @PIN_GLOBAL
	.comm	_PIN_HIGH,4,2                   ## @PIN_HIGH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_gt_init_scratch          ; -- Begin function intel_gt_init_scratch
	.p2align	2
_intel_gt_init_scratch:                 ; @intel_gt_init_scratch
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x1
	mov	x19, x0
	ldr	x22, [x0, #16]
	mov	x0, x22
	bl	_i915_gem_object_create_stolen
	mov	x20, x0
	cbnz	x0, LBB0_2
; %bb.1:
	mov	x0, x22
	mov	x1, x21
	bl	_i915_gem_object_create_internal
	mov	x20, x0
LBB0_2:
	mov	x0, x20
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.3:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_PTR_ERR
LBB0_4:
	ldr	x1, [x19, #8]
	mov	x0, x20
	mov	x2, #0
	bl	_i915_vma_instance
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_6
; %bb.5:
	mov	x0, x21
	bl	_PTR_ERR
	mov	x22, x0
	b	LBB0_7
LBB0_6:
Lloh2:
	adrp	x8, _PIN_GLOBAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PIN_GLOBAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _PIN_HIGH@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PIN_HIGH@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	x0, x21
	mov	w1, #0
	mov	w2, #0
	bl	_i915_vma_pin
	mov	x22, x0
	cbz	w0, LBB0_9
LBB0_7:
	mov	x0, x20
	bl	_i915_gem_object_put
LBB0_8:
	mov	x0, x22
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_9:
	mov	x0, x21
	bl	_i915_vma_make_unshrinkable
	str	w0, [x19]
	b	LBB0_8
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate scratch page\n"

	.comm	_PIN_GLOBAL,4,2                 ; @PIN_GLOBAL
	.comm	_PIN_HIGH,4,2                   ; @PIN_HIGH
.subsections_via_symbols
