	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function create_scratch
_create_scratch:                        ## @create_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $esi killed $esi def $rsi
	movq	%rdi, %rbx
	leal	(,%rsi,4), %edi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_round_up
	movl	(%rbx), %edi
	movl	%eax, %esi
	callq	_i915_gem_object_create_internal
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
## %bb.9:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_CAST                       ## TAILCALL
LBB0_1:
	movq	_I915_CACHE_LLC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i915_gem_object_set_cache_coherency
	movq	%r15, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	_i915_vma_instance
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	%r14, %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_3
LBB0_4:
	movq	%r14, %rdi
	callq	_i915_vma_is_ggtt
	testq	%rax, %rax
	jne	LBB0_5
## %bb.6:
	movq	_PIN_USER@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movq	_PIN_GLOBAL@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %ecx
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_i915_vma_pin
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_8
LBB0_3:
	movq	%r15, %rdi
	callq	_i915_gem_object_put
	movl	%ebx, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_8:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_I915_CACHE_LLC,4,2             ## @I915_CACHE_LLC
	.comm	_PIN_GLOBAL,4,2                 ## @PIN_GLOBAL
	.comm	_PIN_USER,4,2                   ## @PIN_USER
	.no_dead_strip	_create_scratch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function create_scratch
_create_scratch:                        ; @create_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	x20, x0
	lsl	w0, w1, #2
Lloh0:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_round_up
	mov	x1, x0
	ldr	w0, [x20]
	bl	_i915_gem_object_create_internal
	mov	x19, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	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	_ERR_CAST
LBB0_2:
Lloh3:
	adrp	x8, _I915_CACHE_LLC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _I915_CACHE_LLC@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_i915_gem_object_set_cache_coherency
	mov	x0, x19
	mov	x1, x20
	mov	x2, #0
	bl	_i915_vma_instance
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x20
	bl	_PTR_ERR
	mov	x21, x0
	b	LBB0_5
LBB0_4:
	mov	x0, x20
	bl	_i915_vma_is_ggtt
Lloh6:
	adrp	x8, _PIN_GLOBAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PIN_GLOBAL@GOTPAGEOFF]
Lloh8:
	adrp	x9, _PIN_USER@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PIN_USER@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x9, x8, eq
	ldr	w3, [x8]
	mov	x0, x20
	mov	w1, #0
	mov	w2, #0
	bl	_i915_vma_pin
	mov	x21, x0
	cbz	w0, LBB0_6
LBB0_5:
	mov	x0, x19
	bl	_i915_gem_object_put
	mov	x0, x21
	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	_ERR_PTR
LBB0_6:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_I915_CACHE_LLC,4,2             ; @I915_CACHE_LLC
	.comm	_PIN_GLOBAL,4,2                 ; @PIN_GLOBAL
	.comm	_PIN_USER,4,2                   ; @PIN_USER
	.no_dead_strip	_create_scratch
.subsections_via_symbols
