	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_gtt_mgr_new
_amdgpu_gtt_mgr_new:                    ## @amdgpu_gtt_mgr_new
	.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, %r13
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	(%rdi), %r14
	leaq	4(%r14), %r15
	movq	%r15, %rdi
	callq	_spin_lock
	cmpq	%r13, %r12
	je	LBB0_3
## %bb.1:
	movq	(%r12), %rax
	movq	_TTM_PL_TT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movq	8(%r13), %rdi
	jmp	LBB0_5
LBB0_3:
	movq	%r14, %rdi
	callq	_atomic64_read
	movq	8(%r13), %rdi
	cmpq	%rdi, %rax
	jge	LBB0_5
## %bb.4:
	movq	%r15, %rdi
	callq	_spin_unlock
	jmp	LBB0_13
LBB0_5:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rsi
	callq	_atomic64_sub
	movq	%r15, %rdi
	callq	_spin_unlock
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.6:
	movq	%rax, %r15
	movq	_AMDGPU_BO_INVALID_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	movq	8(%r13), %rcx
	movq	%rcx, (%r15)
	movq	%r12, 16(%r15)
	movq	%r15, 24(%r13)
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	cmpq	$0, 16(%rdx)
	jne	LBB0_9
## %bb.7:
	cmpq	$0, 8(%rdx)
	jne	LBB0_9
## %bb.8:
	movq	_TTM_PL_FLAG_TOPDOWN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rdx)
	je	LBB0_15
LBB0_9:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	%r13, %rcx
	callq	_amdgpu_gtt_mgr_alloc
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_13
## %bb.10:
	movq	%r15, %rdi
	callq	_kfree
	movq	$0, 24(%r13)
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_11:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_12:
	movq	8(%r13), %rdi
	movq	%r14, %rsi
	callq	_atomic64_add
	jmp	LBB0_14
LBB0_15:
	movl	%eax, 16(%r13)
LBB0_13:
	xorl	%ebx, %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TTM_PL_TT,8,3                  ## @TTM_PL_TT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AMDGPU_BO_INVALID_OFFSET,4,2   ## @AMDGPU_BO_INVALID_OFFSET
	.comm	_TTM_PL_FLAG_TOPDOWN,4,2        ## @TTM_PL_FLAG_TOPDOWN
	.no_dead_strip	_amdgpu_gtt_mgr_new
.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_new
_amdgpu_gtt_mgr_new:                    ; @amdgpu_gtt_mgr_new
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x3
	mov	x21, x2
	mov	x22, x1
	mov	x23, x0
	ldr	x20, [x0]
	add	x24, x20, #4
	mov	x0, x24
	bl	_spin_lock
	cmp	x22, x19
	b.eq	LBB0_3
; %bb.1:
	ldr	x8, [x22]
Lloh0:
	adrp	x9, _TTM_PL_TT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TTM_PL_TT@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
	ldr	x0, [x19, #8]
	b	LBB0_5
LBB0_3:
	mov	x0, x20
	bl	_atomic64_read
	mov	x8, x0
	ldr	x0, [x19, #8]
	cmp	x8, x0
	b.ge	LBB0_5
; %bb.4:
	mov	x0, x24
	bl	_spin_unlock
	b	LBB0_11
LBB0_5:
	mov	x1, x20
	bl	_atomic64_sub
	mov	x0, x24
	bl	_spin_unlock
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kzalloc
	cbz	x0, LBB0_12
; %bb.6:
	mov	x24, x0
Lloh6:
	adrp	x8, _AMDGPU_BO_INVALID_OFFSET@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AMDGPU_BO_INVALID_OFFSET@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x0, #8]
	ldr	x9, [x19, #8]
	str	x9, [x0]
	str	x22, [x0, #16]
	str	x0, [x19, #24]
	ldr	x9, [x21, #16]
	cbnz	x9, LBB0_9
; %bb.7:
	ldr	x9, [x21, #8]
	cbnz	x9, LBB0_9
; %bb.8:
	ldr	w9, [x21]
Lloh9:
	adrp	x10, _TTM_PL_FLAG_TOPDOWN@GOTPAGE
Lloh10:
	ldr	x10, [x10, _TTM_PL_FLAG_TOPDOWN@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_15
LBB0_9:
	mov	x0, x23
	mov	x1, x22
	mov	x2, x21
	mov	x3, x19
	bl	_amdgpu_gtt_mgr_alloc
	bl	_unlikely
	cbz	x0, LBB0_11
; %bb.10:
	mov	x0, x24
	bl	_kfree
	mov	w21, #0
	str	xzr, [x19, #24]
	b	LBB0_13
LBB0_11:
	mov	w21, #0
	b	LBB0_14
LBB0_12:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_13:
	ldr	x0, [x19, #8]
	mov	x1, x20
	bl	_atomic64_add
LBB0_14:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_15:
	mov	w21, #0
	str	w8, [x19, #16]
	b	LBB0_14
	.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
	.cfi_endproc
                                        ; -- End function
	.comm	_TTM_PL_TT,8,3                  ; @TTM_PL_TT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AMDGPU_BO_INVALID_OFFSET,4,2   ; @AMDGPU_BO_INVALID_OFFSET
	.comm	_TTM_PL_FLAG_TOPDOWN,4,2        ; @TTM_PL_FLAG_TOPDOWN
	.no_dead_strip	_amdgpu_gtt_mgr_new
.subsections_via_symbols
