	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_ttm_tt_pin_userptr
_amdgpu_ttm_tt_pin_userptr:             ## @amdgpu_ttm_tt_pin_userptr
	.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	%rdi, %rbx
	movl	20(%rdi), %edi
	callq	_amdgpu_ttm_adev
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %r13d
	movq	_AMDGPU_GEM_USERPTR_READONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%r13d, %r8d
	shll	%cl, %r8d
	movq	8(%rbx), %rdi
	movl	16(%rbx), %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	xorl	%r14d, %r14d
	movl	%r13d, %edx
	xorl	%ecx, %ecx
	callq	_sg_alloc_table_from_pages
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movq	8(%rbx), %rdi
	movl	%eax, %r14d
	jmp	LBB0_2
LBB0_3:
	testl	%r13d, %r12d
	cmovel	-44(%rbp), %r15d                ## 4-byte Folded Reload
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	8(%rbx), %rax
	movl	(%rax), %edx
	movl	4(%rax), %esi
	movl	%r15d, %ecx
	callq	_dma_map_sg
	movq	8(%rbx), %rdi
	cmpl	(%rdi), %eax
	jne	LBB0_2
## %bb.4:
	movl	16(%rbx), %esi
	movl	(%rbx), %ecx
	movl	4(%rbx), %edx
	callq	_drm_prime_sg_to_page_addr_arrays
	xorl	%r14d, %r14d
	jmp	LBB0_5
LBB0_2:
	callq	_kfree
LBB0_5:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AMDGPU_GEM_USERPTR_READONLY,4,2 ## @AMDGPU_GEM_USERPTR_READONLY
	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_amdgpu_ttm_tt_pin_userptr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpu_ttm_tt_pin_userptr
_amdgpu_ttm_tt_pin_userptr:             ; @amdgpu_ttm_tt_pin_userptr
	.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	x19, x0
	ldr	w0, [x0, #20]
	bl	_amdgpu_ttm_adev
	mov	x20, x0
	ldr	w21, [x19]
Lloh0:
	adrp	x8, _AMDGPU_GEM_USERPTR_READONLY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AMDGPU_GEM_USERPTR_READONLY@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
Lloh3:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x8]
Lloh6:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh8:
	ldr	w25, [x8]
	ldr	x0, [x19, #8]
Lloh9:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
	ldr	w1, [x19, #16]
Lloh11:
	ldr	w8, [x8]
	lsl	w4, w21, w8
Lloh12:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh14:
	ldr	w5, [x8]
	mov	x2, x21
	mov	w3, #0
	bl	_sg_alloc_table_from_pages
	cbz	w0, LBB0_2
; %bb.1:
	mov	x22, x0
	ldr	x0, [x19, #8]
	b	LBB0_5
LBB0_2:
	tst	w24, w21
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	csel	w3, w23, w25, eq
Lloh17:
	ldr	w21, [x8]
	ldr	w0, [x20]
	ldr	x8, [x19, #8]
	ldp	w2, w1, [x8]
	bl	_dma_map_sg
	mov	x8, x0
	ldr	x0, [x19, #8]
	ldr	w9, [x0]
	cmp	w8, w9
	b.ne	LBB0_4
; %bb.3:
	ldr	w1, [x19, #16]
	ldp	w3, w2, [x19]
	bl	_drm_prime_sg_to_page_addr_arrays
	mov	w22, #0
	b	LBB0_6
LBB0_4:
	neg	w22, w21
LBB0_5:
	bl	_kfree
LBB0_6:
	mov	x0, x22
	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
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_AMDGPU_GEM_USERPTR_READONLY,4,2 ; @AMDGPU_GEM_USERPTR_READONLY
	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_amdgpu_ttm_tt_pin_userptr
.subsections_via_symbols
