	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_ttm_access_memory
_amdgpu_ttm_access_memory:              ## @amdgpu_ttm_access_memory
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -72(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r15d
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	movq	%rsi, -88(%rbp)
	callq	_ttm_to_amdgpu_bo
	movq	%rax, %r14
	movl	4(%rax), %edi
	callq	_amdgpu_ttm_adev
	movl	$0, -44(%rbp)
	movq	(%r12), %rdx
	movq	_TTM_PL_VRAM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_1
## %bb.2:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	-88(%rbp), %rsi
	movq	%r14, %rdi
	callq	_amdgpu_find_mm_node
	testl	%r15d, %r15d
	je	LBB0_3
## %bb.4:
	movq	(%rax), %r12
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shlq	%cl, %r12
	addl	-88(%rbp), %r12d
	xorl	%esi, %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-68(%rbp), %esi                 ## 4-byte Reload
	addl	%ebx, %esi
	movslq	%ebx, %rdx
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rdx,4), %rcx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	testl	%r15d, %r15d
	je	LBB0_15
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	4(%rdi), %r12d
	jge	LBB0_15
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%esi, -68(%rbp)                 ## 4-byte Spill
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movl	%r12d, %r13d
	andl	$3, %r13d
	movl	$4, %eax
	subl	%r13d, %eax
	movl	%eax, %ecx
	subl	%r15d, %ecx
	shll	$3, %ecx
	movl	$-1, %r14d
                                        ## kill: def $cl killed $cl killed $ecx
	shrl	%cl, %r14d
	cmpl	%r15d, %eax
	movl	%r15d, -64(%rbp)                ## 4-byte Spill
	cmovgel	%r15d, %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	$-1, %eax
	cmovlel	%eax, %r14d
	movl	%r12d, %r15d
	shll	$3, %r13d
	movl	%r13d, %ecx
	shrl	%cl, %r14d
	andl	$2147483644, %r15d              ## imm = 0x7FFFFFFC
	shll	%cl, %r14d
	callq	_spin_lock_irqsave
	movq	_mmMM_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	$-2147483648, %r15d             ## imm = 0x80000000
	movl	%r15d, %esi
	movl	-72(%rbp), %ebx                 ## 4-byte Reload
	callq	_WREG32_NO_KIQ
	movq	_mmMM_INDEX_HI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r12, -96(%rbp)                 ## 8-byte Spill
	movl	%r12d, %esi
	sarl	$31, %esi
	callq	_WREG32_NO_KIQ
	testl	%ebx, %ebx
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$-1, %r14d
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$0, -72(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_11
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	-44(%rbp), %eax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %esi
	movl	%r13d, %ecx
	shll	%cl, %esi
	xorl	%eax, %esi
	andl	%r14d, %esi
	xorl	%eax, %esi
	movl	%esi, -44(%rbp)
	movq	_mmMM_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_WREG32_NO_KIQ
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
	movl	-64(%rbp), %r15d                ## 4-byte Reload
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	_mmMM_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32_NO_KIQ
	movl	%eax, -44(%rbp)
	cmpl	$0, -72(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_10
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
	andl	-44(%rbp), %r14d
	movl	%r13d, %ecx
	sarl	%cl, %r14d
	movl	%r14d, -44(%rbp)
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	leaq	-44(%rbp), %rsi
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edx
	callq	_memcpy
	movl	-64(%rbp), %r15d                ## 4-byte Reload
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-96(%rbp), %r12                 ## 8-byte Reload
	addl	%ebx, %r12d
	subl	%ebx, %r15d
	movslq	%r12d, %rsi
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movslq	8(%rax), %rdx
	addq	(%rax), %rdx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	shlq	%cl, %rdx
	cmpq	%rsi, %rdx
	ja	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	16(%rax), %r12
	addq	$16, %rax
                                        ## kill: def $cl killed $cl killed $rcx
	shlq	%cl, %r12
	jmp	LBB0_14
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%esi, %esi
	subl	(%rax), %esi
	jmp	LBB0_15
LBB0_3:
	xorl	%esi, %esi
LBB0_15:
	movl	%esi, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TTM_PL_VRAM,8,3                ## @TTM_PL_VRAM
	.comm	_EIO,4,2                        ## @EIO
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_mmMM_INDEX,4,2                 ## @mmMM_INDEX
	.comm	_mmMM_INDEX_HI,4,2              ## @mmMM_INDEX_HI
	.comm	_mmMM_DATA,4,2                  ## @mmMM_DATA
	.no_dead_strip	_amdgpu_ttm_access_memory
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpu_ttm_access_memory
_amdgpu_ttm_access_memory:              ; @amdgpu_ttm_access_memory
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x4
	mov	x20, x3
	mov	x21, x2
	mov	x24, x0
	str	x1, [sp, #24]
	bl	_ttm_to_amdgpu_bo
	mov	x23, x0
	ldr	w0, [x0, #4]
	bl	_amdgpu_ttm_adev
	str	wzr, [sp, #20]
	ldr	x8, [x24]
Lloh0:
	adrp	x9, _TTM_PL_VRAM@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TTM_PL_VRAM@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.1:
	mov	x22, x0
	add	x1, sp, #24
	mov	x0, x23
	bl	_amdgpu_find_mm_node
	mov	w23, #0
	cbz	w20, LBB0_14
; %bb.2:
	ldr	x8, [x0]
Lloh3:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	lsl	x8, x8, x9
	ldr	w9, [sp, #24]
	add	w28, w8, w9
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w23, w25, w23
	add	x21, x21, w25, sxtw #2
	cbz	w20, LBB0_14
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x22, #4]
	cmp	w28, w8
	b.ge	LBB0_14
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	mov	x0, x22
	mov	x22, x19
	and	w19, w28, #0x7ffffffc
	and	w8, w28, #0x3
	lsl	w26, w8, #3
	mov	w11, #-1
	lsl	w9, w11, w26
	mov	w10, #4
	sub	w8, w10, w8
	subs	w10, w8, w20
	lsl	w10, w10, #3
	lsr	w10, w11, w10
	csel	w25, w8, w20, lt
	csinv	w8, w10, wzr, gt
	and	w27, w8, w9
	mov	x24, x0
	bl	_spin_lock_irqsave
Lloh6:
	adrp	x8, _mmMM_INDEX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _mmMM_INDEX@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	orr	w1, w19, #0x80000000
	mov	x19, x22
	bl	_WREG32_NO_KIQ
Lloh9:
	adrp	x8, _mmMM_INDEX_HI@GOTPAGE
Lloh10:
	ldr	x8, [x8, _mmMM_INDEX_HI@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	asr	w1, w28, #31
	bl	_WREG32_NO_KIQ
	cbz	w22, LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	cmn	w27, #1
	b.ne	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	cbz	w19, LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [sp, #20]
	bic	w8, w8, w27
	ldr	w9, [x21]
	lsl	w9, w9, w26
	and	w9, w9, w27
	orr	w1, w9, w8
	str	w1, [sp, #20]
Lloh12:
	adrp	x8, _mmMM_DATA@GOTPAGE
Lloh13:
	ldr	x8, [x8, _mmMM_DATA@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_WREG32_NO_KIQ
	mov	x22, x24
	mov	x0, x24
	bl	_spin_unlock_irqrestore
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
Lloh15:
	adrp	x8, _mmMM_DATA@GOTPAGE
Lloh16:
	ldr	x8, [x8, _mmMM_DATA@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	bl	_RREG32_NO_KIQ
	str	w0, [sp, #20]
	cbnz	w19, LBB0_8
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x22, x24
	mov	x0, x24
	bl	_spin_unlock_irqrestore
	ldr	w8, [sp, #20]
	and	w8, w8, w27
	asr	w8, w8, w26
	str	w8, [sp, #20]
	add	x1, sp, #20
	mov	x0, x21
	mov	x2, x25
	bl	_memcpy
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w28, w25, w28
	sub	w20, w20, w25
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	ldr	x8, [x0]
	ldrsw	x9, [x0, #8]
	add	x9, x8, x9
Lloh18:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	lsl	x9, x9, x8
	cmp	x9, w28, sxtw
	b.hi	LBB0_3
; %bb.12:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x9, [x0, #16]!
	lsl	x28, x9, x8
	b	LBB0_3
LBB0_13:
Lloh21:
	adrp	x8, _EIO@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_14:
	mov	x0, x23
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_TTM_PL_VRAM,8,3                ; @TTM_PL_VRAM
	.comm	_EIO,4,2                        ; @EIO
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_mmMM_INDEX,4,2                 ; @mmMM_INDEX
	.comm	_mmMM_INDEX_HI,4,2              ; @mmMM_INDEX_HI
	.comm	_mmMM_DATA,4,2                  ; @mmMM_DATA
	.no_dead_strip	_amdgpu_ttm_access_memory
.subsections_via_symbols
