	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function emit_rpcs_query
_emit_rpcs_query:                       ## @emit_rpcs_query
	.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
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movl	4(%rsi), %edi
	callq	_intel_engine_can_store_dword
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_GEM_BUG_ON
	movl	(%r15), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_i915_vma_instance
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
## %bb.19:
	movq	%r13, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	movq	%rbx, %rdi
	callq	_i915_gem_object_lock
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_i915_gem_object_set_to_gtt_domain
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_i915_gem_object_unlock
	testl	%r12d, %r12d
	jne	LBB0_18
## %bb.2:
	movq	_PIN_USER@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_i915_vma_pin
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_18
## %bb.3:
	movq	%r13, %rdi
	callq	_rpcs_query_batch
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_PTR_ERR
	movl	%eax, %r12d
	jmp	LBB0_17
LBB0_5:
	movq	%r15, %rdi
	callq	_i915_request_create
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%r15, %rdi
	callq	_PTR_ERR
	movl	%eax, %r12d
	jmp	LBB0_16
LBB0_7:
	movq	16(%r15), %rax
	movl	4(%rbx), %edx
	movl	8(%rbx), %esi
	movq	%r15, %rdi
	xorl	%ecx, %ecx
	callq	*(%rax)
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_15
## %bb.8:
	movq	%rbx, %rdi
	callq	_i915_vma_lock
	movl	(%rbx), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_i915_request_await_object
	movl	%eax, %r12d
	movq	%rbx, %rdi
	testl	%eax, %eax
	je	LBB0_9
LBB0_13:
	callq	_i915_vma_unlock
	jmp	LBB0_14
LBB0_9:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_i915_vma_move_to_active
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_i915_vma_unlock
	testl	%r12d, %r12d
	je	LBB0_10
LBB0_14:
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_i915_request_skip
LBB0_15:
	movq	%r15, %rdi
	callq	_i915_request_add
LBB0_16:
	movq	%rbx, %rdi
	callq	_i915_vma_unpin
	movq	%rbx, %rdi
	callq	_i915_vma_put
LBB0_17:
	movq	%r13, %rdi
	callq	_i915_vma_unpin
LBB0_18:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	%r13, %rdi
	callq	_i915_vma_lock
	movl	(%r13), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_i915_request_await_object
	movl	%eax, %r12d
	movq	%r13, %rdi
	testl	%eax, %eax
	jne	LBB0_13
## %bb.11:
	movq	_EXEC_OBJECT_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_i915_vma_move_to_active
	movl	%eax, %r12d
	movq	%r13, %rdi
	callq	_i915_vma_unlock
	testl	%r12d, %r12d
	jne	LBB0_14
## %bb.12:
	movq	%rbx, %rdi
	callq	_i915_vma_unpin
	movq	%rbx, %rdi
	callq	_i915_vma_close
	movq	%rbx, %rdi
	callq	_i915_vma_put
	movq	%r13, %rdi
	callq	_i915_vma_unpin
	movq	%r15, %rdi
	callq	_i915_request_get
	movq	%rax, (%r14)
	movq	%r15, %rdi
	callq	_i915_request_add
	xorl	%r12d, %r12d
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_PIN_USER,4,2                   ## @PIN_USER
	.comm	_EXEC_OBJECT_WRITE,4,2          ## @EXEC_OBJECT_WRITE
	.no_dead_strip	_emit_rpcs_query
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function emit_rpcs_query
_emit_rpcs_query:                       ; @emit_rpcs_query
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x2
	mov	x22, x1
	mov	x21, x0
	ldr	w0, [x1, #4]
	bl	_intel_engine_can_store_dword
	cmp	w0, #0
	cset	w0, eq
	bl	_GEM_BUG_ON
	ldr	w1, [x22]
	mov	x0, x21
	mov	x2, #0
	bl	_i915_vma_instance
	mov	x19, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_PTR_ERR
LBB0_2:
	mov	x0, x21
	bl	_i915_gem_object_lock
	mov	x0, x21
	mov	w1, #0
	bl	_i915_gem_object_set_to_gtt_domain
	mov	x23, x0
	mov	x0, x21
	bl	_i915_gem_object_unlock
	cbnz	w23, LBB0_16
; %bb.3:
Lloh0:
	adrp	x8, _PIN_USER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PIN_USER@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	bl	_i915_vma_pin
	mov	x23, x0
	cbnz	w0, LBB0_16
; %bb.4:
	mov	x0, x19
	bl	_rpcs_query_batch
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_6
; %bb.5:
	mov	x0, x21
	bl	_PTR_ERR
	mov	x23, x0
	b	LBB0_15
LBB0_6:
	mov	x0, x22
	bl	_i915_request_create
	mov	x22, x0
	bl	_IS_ERR
	cbz	x0, LBB0_8
; %bb.7:
	mov	x0, x22
	bl	_PTR_ERR
	mov	x23, x0
	b	LBB0_14
LBB0_8:
	ldr	x8, [x22, #16]
	ldr	x8, [x8]
	ldp	w2, w1, [x21, #4]
	mov	x0, x22
	mov	w3, #0
	blr	x8
	mov	x23, x0
	cbnz	w0, LBB0_13
; %bb.9:
	mov	x0, x21
	bl	_i915_vma_lock
	ldr	w1, [x21]
	mov	x0, x22
	mov	w2, #0
	bl	_i915_request_await_object
	mov	x23, x0
	mov	x0, x21
	cbz	w23, LBB0_11
LBB0_10:
	bl	_i915_vma_unlock
	b	LBB0_12
LBB0_11:
	mov	x0, x21
	mov	x1, x22
	mov	w2, #0
	bl	_i915_vma_move_to_active
	mov	x23, x0
	mov	x0, x21
	bl	_i915_vma_unlock
	cbz	w23, LBB0_17
LBB0_12:
	mov	x0, x22
	mov	x1, x23
	bl	_i915_request_skip
LBB0_13:
	mov	x0, x22
	bl	_i915_request_add
LBB0_14:
	mov	x0, x21
	bl	_i915_vma_unpin
	mov	x0, x21
	bl	_i915_vma_put
LBB0_15:
	mov	x0, x19
	bl	_i915_vma_unpin
LBB0_16:
	mov	x0, x23
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_17:
	mov	x0, x19
	bl	_i915_vma_lock
	ldr	w1, [x19]
	mov	x0, x22
	mov	w2, #1
	bl	_i915_request_await_object
	mov	x23, x0
	mov	x0, x19
	cbnz	w23, LBB0_10
; %bb.18:
Lloh3:
	adrp	x8, _EXEC_OBJECT_WRITE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EXEC_OBJECT_WRITE@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x22
	bl	_i915_vma_move_to_active
	mov	x23, x0
	mov	x0, x19
	bl	_i915_vma_unlock
	cbnz	w23, LBB0_12
; %bb.19:
	mov	x0, x21
	bl	_i915_vma_unpin
	mov	x0, x21
	bl	_i915_vma_close
	mov	x0, x21
	bl	_i915_vma_put
	mov	x0, x19
	bl	_i915_vma_unpin
	mov	x0, x22
	bl	_i915_request_get
	str	x0, [x20]
	mov	x0, x22
	bl	_i915_request_add
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_PIN_USER,4,2                   ; @PIN_USER
	.comm	_EXEC_OBJECT_WRITE,4,2          ; @EXEC_OBJECT_WRITE
	.no_dead_strip	_emit_rpcs_query
.subsections_via_symbols
