	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ttm_bo_mem_placement
_ttm_bo_mem_placement:                  ## @ttm_bo_mem_placement
	.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	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	(%rdi), %r13
	movq	_TTM_PL_SYSTEM@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)
	movq	$0, -48(%rbp)
	leaq	-56(%rbp), %rsi
	movq	%r12, %rdi
	callq	_ttm_mem_type_from_place
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.1:
	movq	8(%r13), %rax
	movq	-56(%rbp), %rsi
	cmpl	$0, 4(%rax,%rsi,8)
	je	LBB0_3
## %bb.2:
	leaq	(%rax,%rsi,8), %rbx
	cmpl	$0, (%rbx)
	je	LBB0_3
## %bb.4:
	leaq	-48(%rbp), %rcx
	movq	%rbx, %rdi
	movq	%r12, %rdx
	callq	_ttm_bo_mt_compatible
	testl	%eax, %eax
	je	LBB0_3
## %bb.5:
	movl	24(%r15), %esi
	movq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_ttm_bo_select_caching
	movq	%rax, -48(%rbp)
	movl	(%r12), %esi
	movq	_TTM_PL_MASK_MEMTYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	leaq	-48(%rbp), %rdi
	callq	_ttm_flag_masked
	movq	-56(%rbp), %rax
	movq	%rax, (%r14)
	movq	-48(%rbp), %rcx
	movq	%rcx, 8(%r14)
	xorl	%ebx, %ebx
	cmpq	%rax, 16(%r15)
	jae	LBB0_8
## %bb.6:
	leaq	8(%r15), %rdi
	callq	_list_empty
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:
	movq	(%r15), %rax
	movq	(%rax), %rdi
	callq	_spin_lock
	movq	%r15, %rdi
	callq	_ttm_bo_del_from_lru
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_ttm_bo_add_mem_to_lru
	movq	(%r15), %rax
	movq	(%rax), %rdi
	callq	_spin_unlock
	jmp	LBB0_8
LBB0_3:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	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_SYSTEM,8,3              ## @TTM_PL_SYSTEM
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_TTM_PL_MASK_MEMTYPE,4,2        ## @TTM_PL_MASK_MEMTYPE
	.no_dead_strip	_ttm_bo_mem_placement
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ttm_bo_mem_placement
_ttm_bo_mem_placement:                  ; @ttm_bo_mem_placement
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x22, [x0]
Lloh0:
	adrp	x8, _TTM_PL_SYSTEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TTM_PL_SYSTEM@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stp	xzr, x8, [sp]
	add	x1, sp, #8
	mov	x0, x21
	bl	_ttm_mem_type_from_place
	cbnz	w0, LBB0_9
; %bb.1:
	ldr	x8, [x22, #8]
	ldr	x1, [sp, #8]
	add	x22, x8, x1, lsl #3
	ldr	w8, [x22, #4]
	cbz	w8, LBB0_8
; %bb.2:
	ldr	w8, [x22]
	cbz	w8, LBB0_8
; %bb.3:
	mov	x3, sp
	mov	x0, x22
	mov	x2, x21
	bl	_ttm_bo_mt_compatible
	cbz	w0, LBB0_8
; %bb.4:
	ldr	w1, [x19, #24]
	ldr	x2, [sp]
	mov	x0, x22
	bl	_ttm_bo_select_caching
	str	x0, [sp]
	ldr	w1, [x21]
Lloh3:
	adrp	x8, _TTM_PL_MASK_MEMTYPE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TTM_PL_MASK_MEMTYPE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mvn	w2, w8
	mov	x0, sp
	bl	_ttm_flag_masked
	ldp	x9, x8, [sp]
	stp	x8, x9, [x20]
	ldr	x9, [x19, #16]
	cmp	x9, x8
	b.hs	LBB0_7
; %bb.5:
	add	x0, x19, #8
	bl	_list_empty
	cbnz	w0, LBB0_7
; %bb.6:
	ldr	x8, [x19]
	ldr	x0, [x8]
	bl	_spin_lock
	mov	x0, x19
	bl	_ttm_bo_del_from_lru
	mov	x0, x19
	mov	x1, x20
	bl	_ttm_bo_add_mem_to_lru
	ldr	x8, [x19]
	ldr	x0, [x8]
	bl	_spin_unlock
LBB0_7:
	mov	w0, #0
	b	LBB0_9
LBB0_8:
Lloh6:
	adrp	x8, _EBUSY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_TTM_PL_SYSTEM,8,3              ; @TTM_PL_SYSTEM
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_TTM_PL_MASK_MEMTYPE,4,2        ; @TTM_PL_MASK_MEMTYPE
	.no_dead_strip	_ttm_bo_mem_placement
.subsections_via_symbols
