	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_cs_try_evict
_amdgpu_cs_try_evict:                   ## @amdgpu_cs_try_evict
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movl	(%rsi), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movups	L___const.amdgpu_cs_try_evict.ctx(%rip), %xmm0
	movaps	%xmm0, -80(%rbp)
	movq	8(%rdi), %r13
	xorl	%ecx, %ecx
	testq	%r13, %r13
	je	LBB0_16
## %bb.1:
	movq	%rdi, %r14
	cmpq	%rdi, %r13
	je	LBB0_16
## %bb.2:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	notl	%eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r14), %rdi
	movq	_tv@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_list_prev_entry
	movq	%rax, %r13
	movq	%rax, 8(%r14)
	cmpq	%rax, %r14
	je	LBB0_15
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%r13), %edi
	callq	_ttm_to_amdgpu_bo
	movq	%rax, %rbx
	movl	12(%rax), %edi
	callq	_amdgpu_ttm_adev
	cmpq	-64(%rbp), %rbx                 ## 8-byte Folded Reload
	je	LBB0_15
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$0, 16(%rbx)
	jne	LBB0_14
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, %r12
	leaq	8(%rbx), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	(%rax), %edi
	callq	_amdgpu_mem_type_to_domain
	testl	%eax, -44(%rbp)                 ## 4-byte Folded Reload
	je	LBB0_14
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%rbx), %r15d
	andl	-48(%rbp), %r15d                ## 4-byte Folded Reload
	je	LBB0_14
## %bb.7:
	movq	%r12, %rdi
	callq	_amdgpu_gmc_vram_full_visible
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	xorl	%r12d, %r12d
	jmp	LBB0_10
LBB0_15:
	xorl	%ecx, %ecx
LBB0_16:
	movl	%ecx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%rbx, %rdi
	callq	_amdgpu_bo_in_cpu_visible_vram
	testq	%rax, %rax
	setne	%r12b
LBB0_10:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_amdgpu_bo_placement_from_domain
	addq	$4, %rbx
	leaq	-80(%rbp), %rdx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_ttm_bo_validate
	movl	-72(%rbp), %ecx
	addl	%ecx, 20(%r14)
	testb	%r12b, %r12b
	je	LBB0_12
## %bb.11:
	addl	%ecx, 16(%r14)
LBB0_12:
	movl	%eax, %edi
	callq	_unlikely
	xorl	%ecx, %ecx
	testq	%rax, %rax
	jne	LBB0_16
## %bb.13:
	movq	8(%r14), %rdi
	movq	_tv@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_list_prev_entry
	movq	%rax, 8(%r14)
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_list_move
	movl	$1, %ecx
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__literal16,16byte_literals
	.p2align	3                               ## @__const.amdgpu_cs_try_evict.ctx
L___const.amdgpu_cs_try_evict.ctx:
	.long	1                               ## 0x1
	.long	0                               ## 0x0
	.quad	0                               ## 0x0

	.comm	_tv,4,2                         ## @tv
	.no_dead_strip	_amdgpu_cs_try_evict
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpu_cs_try_evict
_amdgpu_cs_try_evict:                   ; @amdgpu_cs_try_evict
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	w27, [x1]
Lloh0:
	adrp	x8, l___const.amdgpu_cs_try_evict.ctx@PAGE
Lloh1:
	add	x8, x8, l___const.amdgpu_cs_try_evict.ctx@PAGEOFF
Lloh2:
	ldr	q0, [x8]
	str	q0, [sp]
	ldr	x20, [x0, #8]
	cbz	x20, LBB0_14
; %bb.1:
	mov	x19, x0
	cmp	x20, x0
	b.eq	LBB0_14
; %bb.2:
	mov	x21, x1
	mvn	w28, w27
Lloh3:
	adrp	x26, _tv@GOTPAGE
Lloh4:
	ldr	x26, [x26, _tv@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x19, #8]
	ldr	w1, [x26]
	bl	_list_prev_entry
	mov	x20, x0
	str	x0, [x19, #8]
	cmp	x19, x0
	b.eq	LBB0_14
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20, #4]
	bl	_ttm_to_amdgpu_bo
	mov	x22, x0
	ldr	w0, [x0, #12]
	bl	_amdgpu_ttm_adev
	cmp	x22, x21
	b.eq	LBB0_14
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x22, #16]
	cbnz	x8, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x25, x0
	add	x23, x22, #8
	ldr	w0, [x23]
	bl	_amdgpu_mem_type_to_domain
	tst	w0, w27
	b.eq	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x22]
	ands	w24, w8, w28
	b.eq	LBB0_3
; %bb.8:
	mov	x0, x25
	bl	_amdgpu_gmc_vram_full_visible
	cbz	w0, LBB0_10
; %bb.9:
	mov	w21, #0
	b	LBB0_11
LBB0_10:
	mov	x0, x22
	bl	_amdgpu_bo_in_cpu_visible_vram
	cmp	x0, #0
	cset	w21, ne
LBB0_11:
	mov	x0, x22
	mov	x1, x24
	bl	_amdgpu_bo_placement_from_domain
	add	x1, x22, #4
	mov	x2, sp
	mov	x0, x23
	bl	_ttm_bo_validate
	ldr	w8, [sp, #8]
	ldr	w9, [x19, #20]
	add	w9, w9, w8
	str	w9, [x19, #20]
	cbz	w21, LBB0_13
; %bb.12:
	ldr	w9, [x19, #16]
	add	w8, w9, w8
	str	w8, [x19, #16]
LBB0_13:
	bl	_unlikely
	cbz	x0, LBB0_16
LBB0_14:
	mov	w0, #0
LBB0_15:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_16:
	ldr	x0, [x19, #8]
	ldr	w1, [x26]
	bl	_list_prev_entry
	str	x0, [x19, #8]
	mov	x0, x20
	mov	x1, x19
	bl	_list_move
	mov	w0, #1
	b	LBB0_15
	.loh AdrpAddLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__literal16,16byte_literals
	.p2align	3                               ; @__const.amdgpu_cs_try_evict.ctx
l___const.amdgpu_cs_try_evict.ctx:
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.quad	0                               ; 0x0

	.comm	_tv,4,2                         ; @tv
	.no_dead_strip	_amdgpu_cs_try_evict
.subsections_via_symbols
