	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_gem_prime_import_sg_table ## -- Begin function amdgpu_gem_prime_import_sg_table
	.p2align	4, 0x90
_amdgpu_gem_prime_import_sg_table:      ## @amdgpu_gem_prime_import_sg_table
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r14
	movq	(%rsi), %rax
	movq	16(%rax), %r15
	movq	(%rdi), %r12
	leaq	-96(%rbp), %r13
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	movq	(%r14), %rax
	movl	8(%rax), %eax
	movl	%eax, -64(%rbp)
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -68(%rbp)
	movq	_AMDGPU_GEM_DOMAIN_CPU@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -72(%rbp)
	movq	$0, -80(%rbp)
	movq	_ttm_bo_type_sg@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -88(%rbp)
	movq	%r15, -96(%rbp)
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_dma_resv_lock
	leaq	-48(%rbp), %rdx
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_amdgpu_bo_create
	testl	%eax, %eax
	je	LBB0_1
## %bb.4:
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_dma_resv_unlock
	movl	%ebx, %edi
	callq	_ERR_PTR
	jmp	LBB0_5
LBB0_1:
	movq	-48(%rbp), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, 24(%rax)
	movq	16(%rax), %rax
	movq	%rcx, (%rax)
	movq	_AMDGPU_GEM_DOMAIN_GTT@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	-48(%rbp), %rax
	movq	%rcx, 40(%rax)
	movq	%rcx, 32(%rax)
	movq	(%r14), %rcx
	movq	(%rcx), %rcx
	cmpq	_amdgpu_dmabuf_ops@GOTPCREL(%rip), %rcx
	je	LBB0_3
## %bb.2:
	movl	$1, (%rax)
LBB0_3:
	movq	%r15, %rdi
	callq	_dma_resv_unlock
	movq	-48(%rbp), %rax
	addq	$8, %rax
LBB0_5:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_AMDGPU_GEM_DOMAIN_CPU,4,2      ## @AMDGPU_GEM_DOMAIN_CPU
	.comm	_ttm_bo_type_sg,4,2             ## @ttm_bo_type_sg
	.comm	_AMDGPU_GEM_DOMAIN_GTT,8,3      ## @AMDGPU_GEM_DOMAIN_GTT
	.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_import_sg_table ; -- Begin function amdgpu_gem_prime_import_sg_table
	.p2align	2
_amdgpu_gem_prime_import_sg_table:      ; @amdgpu_gem_prime_import_sg_table
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x2
	mov	x20, x1
	ldr	x8, [x1]
	ldr	x19, [x8, #16]
	ldr	x22, [x0]
	mov	x0, sp
	mov	w1, #0
	mov	w2, #40
	bl	_memset
	ldr	x8, [x20]
	ldr	w8, [x8, #8]
	str	w8, [sp, #32]
Lloh0:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _AMDGPU_GEM_DOMAIN_CPU@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AMDGPU_GEM_DOMAIN_CPU@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #24]
	str	xzr, [sp, #16]
Lloh6:
	adrp	x8, _ttm_bo_type_sg@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ttm_bo_type_sg@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [sp, #8]
	str	x19, [sp]
	mov	x0, x19
	mov	x1, #0
	bl	_dma_resv_lock
	mov	x1, sp
	add	x2, sp, #40
	mov	x0, x22
	bl	_amdgpu_bo_create
	cbz	w0, LBB0_2
; %bb.1:
	mov	x22, x0
	mov	x0, x19
	bl	_dma_resv_unlock
	mov	x0, x22
	bl	_ERR_PTR
	b	LBB0_5
LBB0_2:
	ldr	x8, [sp, #40]
	str	x21, [x8, #24]
	ldr	x8, [x8, #16]
	str	x21, [x8]
Lloh9:
	adrp	x8, _AMDGPU_GEM_DOMAIN_GTT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AMDGPU_GEM_DOMAIN_GTT@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x8]
	ldr	x8, [sp, #40]
	stp	x9, x9, [x8, #32]
	ldr	x9, [x20]
	ldr	x9, [x9]
Lloh12:
	adrp	x10, _amdgpu_dmabuf_ops@GOTPAGE
Lloh13:
	ldr	x10, [x10, _amdgpu_dmabuf_ops@GOTPAGEOFF]
	cmp	x9, x10
	b.eq	LBB0_4
; %bb.3:
	mov	w9, #1
	str	w9, [x8]
LBB0_4:
	mov	x0, x19
	bl	_dma_resv_unlock
	ldr	x8, [sp, #40]
	add	x0, x8, #8
LBB0_5:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_AMDGPU_GEM_DOMAIN_CPU,4,2      ; @AMDGPU_GEM_DOMAIN_CPU
	.comm	_ttm_bo_type_sg,4,2             ; @ttm_bo_type_sg
	.comm	_AMDGPU_GEM_DOMAIN_GTT,8,3      ; @AMDGPU_GEM_DOMAIN_GTT
	.comm	_amdgpu_dmabuf_ops,4,2          ; @amdgpu_dmabuf_ops
.subsections_via_symbols
