	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_bo_move
_amdgpu_bo_move:                        ## @amdgpu_bo_move
	.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	%rcx, %r14
	movq	%rdx, %rbx
	movl	%esi, %r12d
	movq	%rdi, %r13
	callq	_ttm_to_amdgpu_bo
	movq	%rax, %r15
	xorl	%edi, %edi
	cmpq	$0, (%rax)
	setg	%dil
	callq	_WARN_ON_ONCE
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_36
LBB0_2:
	movl	24(%r13), %edi
	callq	_amdgpu_ttm_adev
	movq	%rax, %r8
	movq	32(%r13), %rax
	movq	_TTM_PL_SYSTEM@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	jne	LBB0_5
## %bb.3:
	cmpq	$0, 16(%r13)
	je	LBB0_4
LBB0_5:
	movq	_TTM_PL_TT@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	cmpq	%rdx, %rax
	jne	LBB0_7
## %bb.6:
	cmpq	%rcx, (%r14)
	je	LBB0_4
LBB0_7:
	cmpq	%rcx, %rax
	jne	LBB0_9
## %bb.8:
	cmpq	%rdx, (%r14)
	je	LBB0_4
LBB0_9:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	_AMDGPU_PL_GDS@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rsi
	cmpq	%rsi, %rax
	je	LBB0_4
## %bb.10:
	movq	_AMDGPU_PL_GWS@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdi
	cmpq	%rdi, %rax
	je	LBB0_4
## %bb.11:
	movq	_AMDGPU_PL_OA@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rbx
	cmpq	%rbx, %rax
	je	LBB0_4
## %bb.12:
	movq	(%r14), %r9
	cmpq	%rsi, %r9
	je	LBB0_4
## %bb.13:
	cmpq	%rdi, %r9
	je	LBB0_4
## %bb.14:
	cmpq	%rbx, %r9
	je	LBB0_4
## %bb.15:
	leaq	32(%r13), %rdx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	cmpl	$0, 4(%r8)
	je	LBB0_16
## %bb.17:
	movq	_TTM_PL_VRAM@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	cmpq	%rsi, %rax
	jne	LBB0_20
## %bb.18:
	cmpq	%rcx, %r9
	jne	LBB0_20
## %bb.19:
	movq	%r13, %rdi
	movl	%r12d, %esi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	%r14, %rcx
	movq	%r8, %rbx
	callq	_amdgpu_move_vram_ram
	movq	%rbx, %r8
	movl	%eax, %ebx
	jmp	LBB0_25
LBB0_4:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_amdgpu_move_null
LBB0_35:
	xorl	%ebx, %ebx
LBB0_36:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_26
LBB0_20:
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	cmpq	%rcx, %rax
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	jne	LBB0_23
## %bb.21:
	cmpq	%rsi, %r9
	jne	LBB0_23
## %bb.22:
	movq	%r13, %rdi
	movl	%r12d, %esi
	movq	%r14, %rcx
	callq	_amdgpu_move_ram_vram
	jmp	LBB0_24
LBB0_23:
	movl	(%rdx), %edx
	movq	%r13, %rdi
	movl	%r12d, %esi
	movq	%r14, %rcx
	movq	-48(%rbp), %r8                  ## 8-byte Reload
	callq	_amdgpu_move_blit
LBB0_24:
	movl	%eax, %ebx
	movq	-64(%rbp), %r8                  ## 8-byte Reload
LBB0_25:
	testl	%ebx, %ebx
	je	LBB0_30
LBB0_26:
	movq	%r8, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	%r8, %r12
	callq	_amdgpu_mem_visible
	testl	%eax, %eax
	je	LBB0_28
## %bb.27:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_amdgpu_mem_visible
	testl	%eax, %eax
	je	LBB0_28
## %bb.29:
	movq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%r14, %rdx
	callq	_ttm_bo_move_memcpy
	movl	%eax, %ebx
	testl	%eax, %eax
	movq	%r12, %r8
	jne	LBB0_36
LBB0_30:
	movq	(%r13), %rax
	movq	_ttm_bo_type_device@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_34
## %bb.31:
	movq	(%r14), %rax
	movq	_TTM_PL_VRAM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_34
## %bb.32:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%rax, (%rcx)
	je	LBB0_34
## %bb.33:
	movq	_AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 8(%r15)
LBB0_34:
	movl	8(%r13), %edi
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %edi
	movq	%r8, %rsi
	callq	_atomic64_add
	jmp	LBB0_35
LBB0_28:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_36
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_TTM_PL_SYSTEM,8,3              ## @TTM_PL_SYSTEM
	.comm	_TTM_PL_TT,8,3                  ## @TTM_PL_TT
	.comm	_AMDGPU_PL_GDS,8,3              ## @AMDGPU_PL_GDS
	.comm	_AMDGPU_PL_GWS,8,3              ## @AMDGPU_PL_GWS
	.comm	_AMDGPU_PL_OA,8,3               ## @AMDGPU_PL_OA
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_TTM_PL_VRAM,8,3                ## @TTM_PL_VRAM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Move buffer fallback to memcpy unavailable\n"

	.comm	_ttm_bo_type_device,8,3         ## @ttm_bo_type_device
	.comm	_AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,4,2 ## @AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.no_dead_strip	_amdgpu_bo_move
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpu_bo_move
_amdgpu_bo_move:                        ; @amdgpu_bo_move
	.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	x20, x3
	mov	x23, x2
	mov	x24, x1
	mov	x19, x0
	bl	_ttm_to_amdgpu_bo
	mov	x21, x0
	ldr	x8, [x0]
	cmp	x8, #0
	cset	w0, gt
	bl	_WARN_ON_ONCE
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_20
LBB0_2:
	ldr	w0, [x19, #24]
	bl	_amdgpu_ttm_adev
	mov	x22, x0
	ldr	x8, [x19, #32]
Lloh3:
	adrp	x9, _TTM_PL_SYSTEM@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TTM_PL_SYSTEM@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	ldr	x10, [x19, #16]
	cbz	x10, LBB0_18
LBB0_4:
Lloh6:
	adrp	x10, _TTM_PL_TT@GOTPAGE
Lloh7:
	ldr	x10, [x10, _TTM_PL_TT@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x8, x10
	b.ne	LBB0_6
; %bb.5:
	ldr	x11, [x20]
	cmp	x11, x9
	b.eq	LBB0_18
LBB0_6:
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.7:
	ldr	x11, [x20]
	cmp	x11, x10
	b.eq	LBB0_18
LBB0_8:
Lloh9:
	adrp	x10, _AMDGPU_PL_GDS@GOTPAGE
Lloh10:
	ldr	x10, [x10, _AMDGPU_PL_GDS@GOTPAGEOFF]
Lloh11:
	ldr	x11, [x10]
	cmp	x8, x11
	b.eq	LBB0_18
; %bb.9:
Lloh12:
	adrp	x10, _AMDGPU_PL_GWS@GOTPAGE
Lloh13:
	ldr	x10, [x10, _AMDGPU_PL_GWS@GOTPAGEOFF]
Lloh14:
	ldr	x12, [x10]
	cmp	x8, x12
	b.eq	LBB0_18
; %bb.10:
Lloh15:
	adrp	x10, _AMDGPU_PL_OA@GOTPAGE
Lloh16:
	ldr	x10, [x10, _AMDGPU_PL_OA@GOTPAGEOFF]
Lloh17:
	ldr	x13, [x10]
	cmp	x8, x13
	b.eq	LBB0_18
; %bb.11:
	ldr	x10, [x20]
	cmp	x10, x11
	b.eq	LBB0_18
; %bb.12:
	cmp	x10, x12
	b.eq	LBB0_18
; %bb.13:
	cmp	x10, x13
	b.eq	LBB0_18
; %bb.14:
	add	x25, x19, #32
	ldr	w11, [x22, #4]
	cbz	w11, LBB0_21
; %bb.15:
Lloh18:
	adrp	x11, _TTM_PL_VRAM@GOTPAGE
Lloh19:
	ldr	x11, [x11, _TTM_PL_VRAM@GOTPAGEOFF]
Lloh20:
	ldr	x11, [x11]
	cmp	x8, x11
	b.ne	LBB0_22
; %bb.16:
	cmp	x10, x9
	b.ne	LBB0_22
; %bb.17:
	mov	x0, x19
	mov	x1, x24
	mov	x2, x23
	mov	x3, x20
	bl	_amdgpu_move_vram_ram
	b	LBB0_26
LBB0_18:
	mov	x0, x19
	mov	x1, x20
	bl	_amdgpu_move_null
LBB0_19:
	mov	w24, #0
LBB0_20:
	mov	x0, x24
	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
LBB0_21:
Lloh21:
	adrp	x8, _ENODEV@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_27
LBB0_22:
	cmp	x8, x9
	b.ne	LBB0_25
; %bb.23:
	cmp	x10, x11
	b.ne	LBB0_25
; %bb.24:
	mov	x0, x19
	mov	x1, x24
	mov	x2, x23
	mov	x3, x20
	bl	_amdgpu_move_ram_vram
	b	LBB0_26
LBB0_25:
	ldr	w2, [x23]
	mov	x0, x19
	mov	x1, x24
	mov	x3, x20
	mov	x4, x25
	bl	_amdgpu_move_blit
LBB0_26:
	mov	x24, x0
	cbz	w0, LBB0_30
LBB0_27:
	mov	x0, x22
	mov	x1, x25
	bl	_amdgpu_mem_visible
	cbz	w0, LBB0_35
; %bb.28:
	mov	x0, x22
	mov	x1, x20
	bl	_amdgpu_mem_visible
	cbz	w0, LBB0_35
; %bb.29:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x20
	bl	_ttm_bo_move_memcpy
	mov	x24, x0
	cbnz	w0, LBB0_20
LBB0_30:
	ldr	x8, [x19]
Lloh24:
	adrp	x9, _ttm_bo_type_device@GOTPAGE
Lloh25:
	ldr	x9, [x9, _ttm_bo_type_device@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_34
; %bb.31:
	ldr	x8, [x20]
Lloh27:
	adrp	x9, _TTM_PL_VRAM@GOTPAGE
Lloh28:
	ldr	x9, [x9, _TTM_PL_VRAM@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_34
; %bb.32:
	ldr	x9, [x25]
	cmp	x9, x8
	b.eq	LBB0_34
; %bb.33:
Lloh30:
	adrp	x8, _AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED@GOTPAGE
Lloh31:
	ldr	x8, [x8, _AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	ldr	w9, [x21, #8]
	bic	w8, w9, w8
	str	w8, [x21, #8]
LBB0_34:
	ldr	w8, [x19, #8]
Lloh33:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh34:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	lsl	w0, w8, w9
	mov	x1, x22
	bl	_atomic64_add
	b	LBB0_19
LBB0_35:
Lloh36:
	adrp	x0, l_.str@PAGE
Lloh37:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	b	LBB0_20
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_TTM_PL_SYSTEM,8,3              ; @TTM_PL_SYSTEM
	.comm	_TTM_PL_TT,8,3                  ; @TTM_PL_TT
	.comm	_AMDGPU_PL_GDS,8,3              ; @AMDGPU_PL_GDS
	.comm	_AMDGPU_PL_GWS,8,3              ; @AMDGPU_PL_GWS
	.comm	_AMDGPU_PL_OA,8,3               ; @AMDGPU_PL_OA
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_TTM_PL_VRAM,8,3                ; @TTM_PL_VRAM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Move buffer fallback to memcpy unavailable\n"

	.comm	_ttm_bo_type_device,8,3         ; @ttm_bo_type_device
	.comm	_AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,4,2 ; @AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.no_dead_strip	_amdgpu_bo_move
.subsections_via_symbols
