	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_gem_prime_export        ## -- Begin function amdgpu_gem_prime_export
	.p2align	4, 0x90
_amdgpu_gem_prime_export:               ## @amdgpu_gem_prime_export
	.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
	movl	%esi, %r14d
	movq	%rdi, %r15
	callq	_gem_to_amdgpu_bo
	movq	%rax, %rbx
	movl	4(%rax), %edi
	callq	_amdgpu_ttm_tt_get_usermm
	testq	%rax, %rax
	jne	LBB0_5
## %bb.1:
	movq	_AMDGPU_GEM_CREATE_VM_ALWAYS_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_2
LBB0_5:
	movq	_EPERM@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_2:
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_drm_gem_prime_export
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	(%r15), %rax
	movq	(%rax), %rax
	movl	(%rax), %eax
	movq	8(%r14), %rcx
	movl	%eax, (%rcx)
	movq	_amdgpu_dmabuf_ops@GOTPCREL(%rip), %rax
	movq	%rax, (%r14)
LBB0_4:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AMDGPU_GEM_CREATE_VM_ALWAYS_VALID,4,2 ## @AMDGPU_GEM_CREATE_VM_ALWAYS_VALID
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_amdgpu_dmabuf_ops,4,2          ## @amdgpu_dmabuf_ops
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_gem_prime_export        ; -- Begin function amdgpu_gem_prime_export
	.p2align	2
_amdgpu_gem_prime_export:               ; @amdgpu_gem_prime_export
	.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, x1
	mov	x19, x0
	bl	_gem_to_amdgpu_bo
	mov	x21, x0
	ldr	w0, [x0, #4]
	bl	_amdgpu_ttm_tt_get_usermm
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	w8, [x21]
Lloh0:
	adrp	x9, _AMDGPU_GEM_CREATE_VM_ALWAYS_VALID@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AMDGPU_GEM_CREATE_VM_ALWAYS_VALID@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
LBB0_2:
Lloh3:
	adrp	x8, _EPERM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	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_3:
	mov	x0, x19
	mov	x1, x20
	bl	_drm_gem_prime_export
	mov	x20, x0
	bl	_IS_ERR
	cbnz	w0, LBB0_5
; %bb.4:
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	w8, [x8]
	ldr	x9, [x20, #8]
	str	w8, [x9]
Lloh6:
	adrp	x8, _amdgpu_dmabuf_ops@GOTPAGE
Lloh7:
	ldr	x8, [x8, _amdgpu_dmabuf_ops@GOTPAGEOFF]
	str	x8, [x20]
LBB0_5:
	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	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_AMDGPU_GEM_CREATE_VM_ALWAYS_VALID,4,2 ; @AMDGPU_GEM_CREATE_VM_ALWAYS_VALID
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_amdgpu_dmabuf_ops,4,2          ; @amdgpu_dmabuf_ops
.subsections_via_symbols
