	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ttm_bo_validate                ## -- Begin function ttm_bo_validate
	.p2align	4, 0x90
_ttm_bo_validate:                       ## @ttm_bo_validate
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movl	%edx, %r12d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	callq	_ttm_bo_is_reserved
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_BUG_ON
	movq	(%rbx), %rax
	movq	8(%rbx), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	je	LBB0_4
## %bb.1:
	subq	%rcx, %rax
	jl	LBB0_3
## %bb.2:
	cmpq	(%r15), %rax
	jge	LBB0_4
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_11
LBB0_4:
	leaq	16(%r15), %r13
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_ttm_bo_mem_compat
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	leaq	24(%r15), %rdi
	movq	16(%rbx), %rcx
	movl	%eax, %eax
	movl	(%rcx,%rax,4), %esi
	movq	_TTM_PL_MASK_MEMTYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	callq	_ttm_flag_masked
LBB0_7:
	movq	(%r13), %rax
	movq	_TTM_PL_SYSTEM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.8:
	cmpq	$0, 8(%r15)
	jne	LBB0_10
## %bb.9:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_ttm_bo_add_ttm
	testl	%eax, %eax
	jne	LBB0_11
LBB0_10:
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_5:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%r12d, %edx
	movl	%r14d, %ecx
	callq	_ttm_bo_move_buffer
	testl	%eax, %eax
	je	LBB0_7
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_TTM_PL_MASK_MEMTYPE,4,2        ## @TTM_PL_MASK_MEMTYPE
	.comm	_TTM_PL_SYSTEM,8,3              ## @TTM_PL_SYSTEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ttm_bo_validate                ; -- Begin function ttm_bo_validate
	.p2align	2
_ttm_bo_validate:                       ; @ttm_bo_validate
	.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	x20, x3
	mov	x22, x2
	mov	x21, x1
	mov	x19, x0
	bl	_ttm_bo_is_reserved
	cmp	w0, #0
	cset	w0, eq
	bl	_BUG_ON
	ldp	x8, x9, [x21]
	orr	x10, x8, x9
	cbz	x10, LBB0_4
; %bb.1:
	subs	x8, x8, x9
	b.lt	LBB0_3
; %bb.2:
	ldr	x9, [x19]
	cmp	x8, x9
	b.ge	LBB0_4
LBB0_3:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_4:
	add	x23, x19, #16
	mov	x0, x21
	mov	x1, x23
	bl	_ttm_bo_mem_compat
	tbnz	w0, #31, LBB0_10
; %bb.5:
	add	x8, x19, #24
	ldr	x9, [x21, #16]
	ldr	w1, [x9, w0, uxtw #2]
Lloh3:
	adrp	x9, _TTM_PL_MASK_MEMTYPE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TTM_PL_MASK_MEMTYPE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	mvn	w2, w9
	mov	x0, x8
	bl	_ttm_flag_masked
LBB0_6:
	ldr	x8, [x23]
Lloh6:
	adrp	x9, _TTM_PL_SYSTEM@GOTPAGE
Lloh7:
	ldr	x9, [x9, _TTM_PL_SYSTEM@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.7:
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_9
; %bb.8:
	mov	x0, x19
	mov	w1, #1
	bl	_ttm_bo_add_ttm
	cbnz	w0, LBB0_11
LBB0_9:
	mov	w0, #0
	b	LBB0_11
LBB0_10:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	mov	x3, x20
	bl	_ttm_bo_move_buffer
	cbz	w0, LBB0_6
LBB0_11:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_TTM_PL_MASK_MEMTYPE,4,2        ; @TTM_PL_MASK_MEMTYPE
	.comm	_TTM_PL_SYSTEM,8,3              ; @TTM_PL_SYSTEM
.subsections_via_symbols
