	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __reloc_gpu_alloc
___reloc_gpu_alloc:                     ## @__reloc_gpu_alloc
	.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	%rsi, %r13
	movq	%rdi, %r14
	movq	(%rdi), %rdi
	addq	$8, %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_intel_engine_pool_get
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
## %bb.25:
	movq	%r12, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	movl	(%r12), %edi
	cmpq	$0, 48(%r14)
	jne	LBB0_2
## %bb.3:
	movq	_I915_MAP_FORCE_WC@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movq	_I915_MAP_FORCE_WB@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %esi
	callq	_i915_gem_object_pin_map
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	callq	_PTR_ERR
	movl	%eax, %r15d
	jmp	LBB0_24
LBB0_6:
	movl	(%r12), %edi
	movl	20(%r13), %esi
	xorl	%edx, %edx
	callq	_i915_vma_instance
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movq	%r15, %rdi
	callq	_PTR_ERR
	movl	%eax, %r15d
	jmp	LBB0_8
LBB0_9:
	movq	_PIN_USER@GOTPCREL(%rip), %rax
	movq	_PIN_NONBLOCK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_i915_vma_pin
	movq	%r15, %rcx
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_8
## %bb.10:
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	8(%r14), %edi
	callq	_i915_request_create
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	movq	%r15, %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_12
LBB0_13:
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_intel_engine_pool_mark_active
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	movq	%r15, %rdi
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	jne	LBB0_21
## %bb.14:
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	callq	_reloc_move_to_gpu
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	jne	LBB0_21
## %bb.15:
	movq	(%r14), %rax
	movl	16(%r15), %esi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	xorl	%ecx, %ecx
	cmpl	$6, 16(%r14)
	jge	LBB0_17
## %bb.16:
	movq	_I915_DISPATCH_SECURE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_17:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%rdi, %r13
	callq	*(%rax)
	testl	%eax, %eax
	jne	LBB0_20
## %bb.18:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_i915_vma_lock
	movl	(%r15), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_i915_request_await_object
	testl	%eax, %eax
	je	LBB0_22
## %bb.19:
	movl	%eax, %r13d
	movq	%r15, %rdi
	callq	_i915_vma_unlock
	movl	%r13d, %eax
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_20
LBB0_22:
	movq	%r15, %rdi
	xorl	%r15d, %r15d
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	%rsi, %r13
	xorl	%edx, %edx
	callq	_i915_vma_move_to_active
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_i915_vma_unlock
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	je	LBB0_23
LBB0_20:
	movq	%r13, %rdi
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%eax, %esi
	callq	_i915_request_skip
	movq	%r13, %rdi
	movq	-56(%rbp), %r15                 ## 8-byte Reload
LBB0_21:
	callq	_i915_request_add
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
LBB0_12:
	movq	%r15, %rdi
	callq	_i915_vma_unpin
	movl	%ebx, %r15d
LBB0_8:
	movl	(%r12), %edi
	callq	_i915_gem_object_unpin_map
LBB0_24:
	movq	%r12, %rdi
	callq	_intel_engine_pool_put
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_23:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rdi, 8(%r13)
	callq	_i915_vma_unpin
	movq	%r13, 40(%r14)
	movq	%rbx, 32(%r14)
	movq	$0, 24(%r14)
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_I915_MAP_FORCE_WB,4,2          ## @I915_MAP_FORCE_WB
	.comm	_I915_MAP_FORCE_WC,4,2          ## @I915_MAP_FORCE_WC
	.comm	_PIN_USER,4,2                   ## @PIN_USER
	.comm	_PIN_NONBLOCK,4,2               ## @PIN_NONBLOCK
	.comm	_I915_DISPATCH_SECURE,4,2       ## @I915_DISPATCH_SECURE
	.no_dead_strip	___reloc_gpu_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __reloc_gpu_alloc
___reloc_gpu_alloc:                     ; @__reloc_gpu_alloc
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x24, x1
	mov	x20, x0
	ldr	x8, [x0]
	add	x0, x8, #8
Lloh0:
	adrp	x26, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x26, [x26, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w1, [x26]
	bl	_intel_engine_pool_get
	mov	x19, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_PTR_ERR
LBB0_2:
	ldr	w0, [x19]
Lloh2:
	adrp	x8, _I915_MAP_FORCE_WB@GOTPAGE
Lloh3:
	ldr	x8, [x8, _I915_MAP_FORCE_WB@GOTPAGEOFF]
	ldr	x9, [x20, #48]
Lloh4:
	adrp	x10, _I915_MAP_FORCE_WC@GOTPAGE
Lloh5:
	ldr	x10, [x10, _I915_MAP_FORCE_WC@GOTPAGEOFF]
	cmp	x9, #0
	csel	x8, x10, x8, eq
	ldr	w1, [x8]
	bl	_i915_gem_object_pin_map
	mov	x22, x0
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x22
	bl	_PTR_ERR
	mov	x25, x0
	b	LBB0_19
LBB0_4:
	ldr	w0, [x19]
	ldr	w1, [x24, #20]
	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	x25, x0
	b	LBB0_18
LBB0_6:
Lloh6:
	adrp	x8, _PIN_USER@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PIN_USER@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _PIN_NONBLOCK@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PIN_NONBLOCK@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	x0, x21
	mov	w1, #0
	mov	w2, #0
	bl	_i915_vma_pin
	mov	x25, x0
	cbnz	w0, LBB0_18
; %bb.7:
	ldr	w0, [x20, #8]
	bl	_i915_request_create
	mov	x23, x0
	bl	_IS_ERR
	cbz	x0, LBB0_9
; %bb.8:
	mov	x0, x23
	bl	_PTR_ERR
	mov	x25, x0
	b	LBB0_17
LBB0_9:
	mov	x0, x19
	mov	x1, x23
	bl	_intel_engine_pool_mark_active
	mov	x25, x0
	cbnz	w0, LBB0_16
; %bb.10:
	mov	x0, x23
	mov	x1, x24
	bl	_reloc_move_to_gpu
	mov	x25, x0
	cbnz	w0, LBB0_16
; %bb.11:
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	w1, [x21, #16]
	ldr	w2, [x26]
	ldr	w9, [x20, #16]
Lloh12:
	adrp	x10, _I915_DISPATCH_SECURE@GOTPAGE
Lloh13:
	ldr	x10, [x10, _I915_DISPATCH_SECURE@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	cmp	w9, #5
	csel	w3, wzr, w10, gt
	mov	x0, x23
	blr	x8
	mov	x25, x0
	cbnz	w0, LBB0_15
; %bb.12:
	mov	x0, x21
	bl	_i915_vma_lock
	ldr	w1, [x21]
	mov	x0, x23
	mov	w2, #0
	bl	_i915_request_await_object
	cbz	w0, LBB0_14
; %bb.13:
	mov	x25, x0
	mov	x0, x21
	bl	_i915_vma_unlock
	b	LBB0_15
LBB0_14:
	mov	x0, x21
	mov	x1, x23
	mov	w2, #0
	bl	_i915_vma_move_to_active
	mov	x25, x0
	mov	x0, x21
	bl	_i915_vma_unlock
	cbz	w25, LBB0_20
LBB0_15:
	mov	x0, x23
	mov	x1, x25
	bl	_i915_request_skip
LBB0_16:
	mov	x0, x23
	bl	_i915_request_add
LBB0_17:
	mov	x0, x21
	bl	_i915_vma_unpin
LBB0_18:
	ldr	w0, [x19]
	bl	_i915_gem_object_unpin_map
LBB0_19:
	mov	x0, x19
	bl	_intel_engine_pool_put
	mov	x0, x25
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_20:
	str	x21, [x23, #8]
	mov	x0, x21
	bl	_i915_vma_unpin
	stp	x22, x23, [x20, #32]
	str	xzr, [x20, #24]
	b	LBB0_19
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_I915_MAP_FORCE_WB,4,2          ; @I915_MAP_FORCE_WB
	.comm	_I915_MAP_FORCE_WC,4,2          ; @I915_MAP_FORCE_WC
	.comm	_PIN_USER,4,2                   ; @PIN_USER
	.comm	_PIN_NONBLOCK,4,2               ; @PIN_NONBLOCK
	.comm	_I915_DISPATCH_SECURE,4,2       ; @I915_DISPATCH_SECURE
	.no_dead_strip	___reloc_gpu_alloc
.subsections_via_symbols
