	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_amdkfd_unreserve_memory_limit ## -- Begin function amdgpu_amdkfd_unreserve_memory_limit
	.p2align	4, 0x90
_amdgpu_amdkfd_unreserve_memory_limit:  ## @amdgpu_amdkfd_unreserve_memory_limit
	.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	%rdi, %r15
	movl	12(%rdi), %edi
	callq	_amdgpu_ttm_adev
	movq	%rax, %r14
	movq	(%r15), %rax
	movq	_AMDGPU_GEM_DOMAIN_CPU@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rbx
	cmpq	%rbx, %rax
	sete	%cl
	movq	_AMDGPU_AMDKFD_USERPTR_BO@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	andl	8(%r15), %edx
	sete	%dl
	cmoveq	%rax, %rbx
	andb	%cl, %dl
	movzbl	%dl, %r12d
	movq	%r15, %rdi
	callq	_amdgpu_bo_size
	movq	%r14, %rdi
	movl	%eax, %esi
	movq	%rbx, %rdx
	movl	%r12d, %ecx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_unreserve_mem_limit            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AMDGPU_GEM_DOMAIN_CPU,8,3      ## @AMDGPU_GEM_DOMAIN_CPU
	.comm	_AMDGPU_AMDKFD_USERPTR_BO,4,2   ## @AMDGPU_AMDKFD_USERPTR_BO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_amdkfd_unreserve_memory_limit ; -- Begin function amdgpu_amdkfd_unreserve_memory_limit
	.p2align	2
_amdgpu_amdkfd_unreserve_memory_limit:  ; @amdgpu_amdkfd_unreserve_memory_limit
	.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	x19, x0
	ldr	w0, [x0, #12]
	bl	_amdgpu_ttm_adev
	mov	x20, x0
Lloh0:
	adrp	x8, _AMDGPU_GEM_DOMAIN_CPU@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AMDGPU_GEM_DOMAIN_CPU@GOTPAGEOFF]
	ldr	x9, [x19]
Lloh2:
	ldr	x8, [x8]
	cmp	x9, x8
	cset	w10, eq
Lloh3:
	adrp	x11, _AMDGPU_AMDKFD_USERPTR_BO@GOTPAGE
Lloh4:
	ldr	x11, [x11, _AMDGPU_AMDKFD_USERPTR_BO@GOTPAGEOFF]
	ldr	w12, [x19, #8]
Lloh5:
	ldr	w11, [x11]
	tst	w11, w12
	cset	w11, eq
	csel	x21, x9, x8, eq
	and	w22, w11, w10
	mov	x0, x19
	bl	_amdgpu_bo_size
	mov	x1, x0
	mov	x0, x20
	mov	x2, x21
	mov	x3, x22
	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
	b	_unreserve_mem_limit
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_AMDGPU_GEM_DOMAIN_CPU,8,3      ; @AMDGPU_GEM_DOMAIN_CPU
	.comm	_AMDGPU_AMDKFD_USERPTR_BO,4,2   ; @AMDGPU_AMDKFD_USERPTR_BO
.subsections_via_symbols
