	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_gtt_mgr_alloc
_amdgpu_gtt_mgr_alloc:                  ## @amdgpu_gtt_mgr_alloc
	.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, %r12
	movq	%rdx, %r15
	movq	%rdi, %rbx
	movl	8(%rdi), %edi
	callq	_amdgpu_ttm_adev
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %r13
	movq	16(%r12), %rbx
	movq	%r12, %rdi
	callq	_amdgpu_gtt_mgr_has_gart_addr
	xorl	%r14d, %r14d
	testq	%rax, %rax
	jne	LBB0_11
## %bb.1:
	movq	%r12, %rsi
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	testq	%r15, %r15
	je	LBB0_2
## %bb.3:
	movq	8(%r15), %r14
	testq	%r14, %r14
	jne	LBB0_5
## %bb.4:
	movq	(%r12), %r14
LBB0_5:
	movq	_TTM_PL_FLAG_TOPDOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%r15)
	jne	LBB0_6
## %bb.7:
	movq	_DRM_MM_INSERT_BEST@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_2:
	movq	(%r12), %r14
	movq	_DRM_MM_INSERT_BEST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	%r13, %r12
	movq	%rsi, %rbx
	jmp	LBB0_9
LBB0_6:
	movq	_DRM_MM_INSERT_HIGH@GOTPCREL(%rip), %rax
LBB0_8:
	movq	%r13, %r12
	movq	%rsi, %rbx
	movq	(%r15), %r15
	movl	(%rax), %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
LBB0_9:
	movq	%r12, %rdi
	callq	_spin_lock
	leaq	4(%r12), %rdi
	movl	4(%rbx), %ecx
	movl	8(%rbx), %edx
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rsi
	xorl	%r8d, %r8d
	movq	%r15, %r9
	pushq	-48(%rbp)                       ## 8-byte Folded Reload
	pushq	%r14
	callq	_drm_mm_insert_node_in_range
	addq	$16, %rsp
	movl	%eax, %r14d
	movq	%r12, %rdi
	callq	_spin_unlock
	testl	%r14d, %r14d
	jne	LBB0_11
## %bb.10:
	movl	(%r13), %eax
	movl	%eax, (%rbx)
	xorl	%r14d, %r14d
LBB0_11:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_MM_INSERT_BEST,4,2         ## @DRM_MM_INSERT_BEST
	.comm	_TTM_PL_FLAG_TOPDOWN,4,2        ## @TTM_PL_FLAG_TOPDOWN
	.comm	_DRM_MM_INSERT_HIGH,4,2         ## @DRM_MM_INSERT_HIGH
	.no_dead_strip	_amdgpu_gtt_mgr_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpu_gtt_mgr_alloc
_amdgpu_gtt_mgr_alloc:                  ; @amdgpu_gtt_mgr_alloc
	.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, x3
	mov	x24, x2
	mov	x20, x0
	ldr	w0, [x0, #8]
	bl	_amdgpu_ttm_adev
	mov	x25, x0
	ldr	x21, [x20]
	ldr	x20, [x19, #16]
	mov	x0, x19
	bl	_amdgpu_gtt_mgr_has_gart_addr
	cbz	x0, LBB0_2
; %bb.1:
	mov	w22, #0
	b	LBB0_9
LBB0_2:
	cbz	x24, LBB0_6
; %bb.3:
	ldp	x22, x23, [x24]
	cbnz	x23, LBB0_5
; %bb.4:
	ldr	x23, [x25]
LBB0_5:
Lloh0:
	adrp	x8, _DRM_MM_INSERT_BEST@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRM_MM_INSERT_BEST@GOTPAGEOFF]
	ldr	w9, [x24, #16]
Lloh2:
	adrp	x10, _TTM_PL_FLAG_TOPDOWN@GOTPAGE
Lloh3:
	ldr	x10, [x10, _TTM_PL_FLAG_TOPDOWN@GOTPAGEOFF]
Lloh4:
	ldr	w10, [x10]
Lloh5:
	adrp	x11, _DRM_MM_INSERT_HIGH@GOTPAGE
Lloh6:
	ldr	x11, [x11, _DRM_MM_INSERT_HIGH@GOTPAGEOFF]
	tst	w10, w9
	csel	x8, x8, x11, eq
	b	LBB0_7
LBB0_6:
	mov	x22, #0
	ldr	x23, [x25]
Lloh7:
	adrp	x8, _DRM_MM_INSERT_BEST@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DRM_MM_INSERT_BEST@GOTPAGEOFF]
LBB0_7:
	ldr	w24, [x8]
	mov	x0, x21
	bl	_spin_lock
	add	x0, x21, #4
	ldp	w3, w2, [x19, #4]
	mov	x1, x20
	mov	w4, #0
	mov	x5, x22
	mov	x6, x23
	mov	x7, x24
	bl	_drm_mm_insert_node_in_range
	mov	x22, x0
	mov	x0, x21
	bl	_spin_unlock
	cbnz	w22, LBB0_9
; %bb.8:
	ldr	w8, [x20]
	str	w8, [x19]
LBB0_9:
	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 AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_MM_INSERT_BEST,4,2         ; @DRM_MM_INSERT_BEST
	.comm	_TTM_PL_FLAG_TOPDOWN,4,2        ; @TTM_PL_FLAG_TOPDOWN
	.comm	_DRM_MM_INSERT_HIGH,4,2         ; @DRM_MM_INSERT_HIGH
	.no_dead_strip	_amdgpu_gtt_mgr_alloc
.subsections_via_symbols
