	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_vm_bo_add               ## -- Begin function amdgpu_vm_bo_add
	.p2align	4, 0x90
_amdgpu_vm_bo_add:                      ## @amdgpu_vm_bo_add
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$20, %edi
	callq	_kzalloc
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	leaq	16(%rbx), %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_amdgpu_vm_bo_base_init
	movl	$1, (%rbx)
	leaq	12(%rbx), %rdi
	callq	_INIT_LIST_HEAD
	movq	%rbx, %rdi
	addq	$8, %rdi
	callq	_INIT_LIST_HEAD
	testq	%r15, %r15
	je	LBB0_7
## %bb.2:
	movl	4(%r15), %edi
	callq	_amdgpu_ttm_adev
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_amdgpu_xgmi_same_hive
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	movq	_AMDGPU_GEM_DOMAIN_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_7
## %bb.4:
	movl	$1, 4(%rbx)
	leaq	4(%r14), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movl	(%r14), %eax
	leal	1(%rax), %ecx
	movl	%ecx, (%r14)
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_amdgpu_xgmi_set_pstate
LBB0_6:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_7:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_AMDGPU_GEM_DOMAIN_VRAM,4,2     ## @AMDGPU_GEM_DOMAIN_VRAM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_vm_bo_add               ; -- Begin function amdgpu_vm_bo_add
	.p2align	2
_amdgpu_vm_bo_add:                      ; @amdgpu_vm_bo_add
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #20
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_7
; %bb.1:
	add	x0, x19, #16
	mov	x1, x22
	mov	x2, x21
	bl	_amdgpu_vm_bo_base_init
	mov	w8, #1
	mov	x22, x19
	str	w8, [x22], #8
	add	x0, x19, #12
	bl	_INIT_LIST_HEAD
	mov	x0, x22
	bl	_INIT_LIST_HEAD
	cbz	x21, LBB0_7
; %bb.2:
	ldr	w0, [x21, #4]
	bl	_amdgpu_ttm_adev
	mov	x1, x0
	mov	x0, x20
	bl	_amdgpu_xgmi_same_hive
	cbz	x0, LBB0_7
; %bb.3:
	ldr	w8, [x21]
Lloh3:
	adrp	x9, _AMDGPU_GEM_DOMAIN_VRAM@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AMDGPU_GEM_DOMAIN_VRAM@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.4:
	mov	w8, #1
	str	w8, [x19, #4]
	add	x21, x20, #4
	mov	x0, x21
	bl	_mutex_lock
	ldr	w8, [x20]
	add	w9, w8, #1
	str	w9, [x20]
	cbnz	w8, LBB0_6
; %bb.5:
	mov	x0, x20
	mov	w1, #1
	bl	_amdgpu_xgmi_set_pstate
LBB0_6:
	mov	x0, x21
	bl	_mutex_unlock
LBB0_7:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_AMDGPU_GEM_DOMAIN_VRAM,4,2     ; @AMDGPU_GEM_DOMAIN_VRAM
.subsections_via_symbols
