	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_gem_prime_import_sg_table ## -- Begin function nouveau_gem_prime_import_sg_table
	.p2align	4, 0x90
_nouveau_gem_prime_import_sg_table:     ## @nouveau_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, %r13
	callq	_nouveau_drm
	movq	%rax, %r14
	movq	(%rbx), %rax
	movq	8(%rax), %r15
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movl	$0, -48(%rbp)
	movq	_TTM_PL_FLAG_TT@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_dma_resv_lock
	leaq	-44(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	movl	%r12d, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_nouveau_bo_alloc
	movq	%rax, %rbx
	movq	%rax, -56(%rbp)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_ERR_CAST
	jmp	LBB0_7
LBB0_2:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	_NOUVEAU_GEM_DOMAIN_GART@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	movl	-44(%rbp), %edx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_drm_gem_object_init
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	xorl	%ebx, %ebx
	leaq	-56(%rbp), %rsi
	xorl	%edi, %edi
	callq	_nouveau_bo_ref
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, %edi
	jmp	LBB0_6
LBB0_4:
	movl	-44(%rbp), %esi
	movl	-48(%rbp), %edx
	movq	%rbx, %rdi
	movl	%r12d, %ecx
	movq	%r14, %r8
	movq	%r15, %r9
	callq	_nouveau_bo_init
	testl	%eax, %eax
	je	LBB0_8
## %bb.5:
	movl	%eax, %r14d
	leaq	-56(%rbp), %rsi
	xorl	%edi, %edi
	callq	_nouveau_bo_ref
	movl	%r14d, %edi
LBB0_6:
	callq	_ERR_PTR
LBB0_7:
	movq	%rax, %rbx
LBB0_8:
	movq	%r15, %rdi
	callq	_dma_resv_unlock
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TTM_PL_FLAG_TT,4,2             ## @TTM_PL_FLAG_TT
	.comm	_NOUVEAU_GEM_DOMAIN_GART,4,2    ## @NOUVEAU_GEM_DOMAIN_GART
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_gem_prime_import_sg_table ; -- Begin function nouveau_gem_prime_import_sg_table
	.p2align	2
_nouveau_gem_prime_import_sg_table:     ; @nouveau_gem_prime_import_sg_table
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x2
	mov	x19, x1
	mov	x23, x0
	bl	_nouveau_drm
	mov	x21, x0
	ldr	x8, [x19]
	ldr	x19, [x8, #8]
	ldr	w8, [x8]
	stp	wzr, w8, [sp]
Lloh0:
	adrp	x8, _TTM_PL_FLAG_TT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TTM_PL_FLAG_TT@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	mov	x0, x19
	mov	x1, #0
	bl	_dma_resv_lock
	add	x1, sp, #4
	mov	x2, sp
	mov	x0, x21
	mov	x3, x22
	mov	w4, #0
	mov	w5, #0
	bl	_nouveau_bo_alloc
	mov	x21, x0
	str	x0, [sp, #8]
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x21
	bl	_ERR_CAST
	b	LBB0_7
LBB0_2:
Lloh3:
	adrp	x8, _NOUVEAU_GEM_DOMAIN_GART@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NOUVEAU_GEM_DOMAIN_GART@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x21, #4]
	ldr	w2, [sp, #4]
	mov	x0, x23
	mov	x1, x21
	bl	_drm_gem_object_init
	cbz	w0, LBB0_4
; %bb.3:
	add	x1, sp, #8
	mov	x0, #0
	bl	_nouveau_bo_ref
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_4:
	ldp	w2, w1, [sp]
	mov	x0, x21
	mov	x3, x22
	mov	x4, x20
	mov	x5, x19
	bl	_nouveau_bo_init
	cbz	w0, LBB0_8
; %bb.5:
	mov	x20, x0
	add	x1, sp, #8
	mov	x0, #0
	bl	_nouveau_bo_ref
	mov	x0, x20
LBB0_6:
	bl	_ERR_PTR
LBB0_7:
	mov	x21, x0
LBB0_8:
	mov	x0, x19
	bl	_dma_resv_unlock
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_TTM_PL_FLAG_TT,4,2             ; @TTM_PL_FLAG_TT
	.comm	_NOUVEAU_GEM_DOMAIN_GART,4,2    ; @NOUVEAU_GEM_DOMAIN_GART
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
