	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ttm_bo_mem_space               ## -- Begin function ttm_bo_mem_space
	.p2align	4, 0x90
_ttm_bo_mem_space:                      ## @ttm_bo_mem_space
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	8(%rdi), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	_TTM_PL_SYSTEM@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)
	movq	$0, -56(%rbp)
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	$0, 16(%rdx)
	cmpl	$0, (%rsi)
	jle	LBB0_20
## %bb.1:
	movq	%rsi, %r12
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movl	%ecx, -84(%rbp)                 ## 4-byte Spill
	movl	%r8d, -88(%rbp)                 ## 4-byte Spill
	xorl	%r14d, %r14d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r12), %rax
	movl	(%rax,%r14,4), %edi
	leaq	-64(%rbp), %rsi
	callq	_ttm_mem_type_from_flags
	testl	%eax, %eax
	jne	LBB0_16
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rbx
	movq	-64(%rbp), %rsi
	leaq	(%rsi,%rsi,2), %r15
	leaq	(%rbx,%r15,8), %r13
	movq	16(%r12), %rax
	movl	(%rax,%r14,4), %edx
	movq	%r13, %rdi
	leaq	-56(%rbp), %rcx
	callq	_ttm_bo_mt_compatible
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	incq	%r14
	movslq	(%r12), %rax
	cmpq	%rax, %r14
	jl	LBB0_2
	jmp	LBB0_12
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	movq	-56(%rbp), %rdx
	movq	%r13, %rdi
	callq	_ttm_bo_select_caching
	movq	%rax, -56(%rbp)
	movq	16(%r12), %rax
	movl	(%rax,%r14,4), %esi
	movq	_TTM_PL_MASK_MEMTYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	leaq	-56(%rbp), %rdi
	callq	_ttm_flag_masked
	movq	-64(%rbp), %rax
	movq	_TTM_PL_SYSTEM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_11
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	$0, (%r13)
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	$0, 16(%rbx,%r15,8)
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%rbx,%r15,8), %rax
	movq	%r13, %rdi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movq	%r12, %rdx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	callq	*(%rax)
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_unlikely
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	testq	%rax, %rax
	jne	LBB0_22
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, 16(%rax)
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	incq	%r14
	movslq	(%r12), %rax
	cmpq	%rax, %r14
	jl	LBB0_2
LBB0_11:
	movq	-64(%rbp), %rax
	movq	_TTM_PL_SYSTEM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_14
LBB0_12:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, 16(%rax)
	je	LBB0_17
## %bb.13:
	movq	-64(%rbp), %rax
LBB0_14:
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	movq	-56(%rbp), %rax
LBB0_15:
	movq	%rax, 8(%rcx)
	xorl	%ebx, %ebx
	jmp	LBB0_22
LBB0_17:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_20
## %bb.18:
	cmpl	$0, 4(%r12)
	jle	LBB0_34
## %bb.19:
	xorl	%r14d, %r14d
	leaq	-64(%rbp), %r13
	leaq	-56(%rbp), %r15
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_25
LBB0_20:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_21:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_22
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	movl	$1, %eax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmovel	%eax, %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	leaq	-64(%rbp), %r13
LBB0_24:                                ##   in Loop: Header=BB0_25 Depth=1
	incq	%r14
	movslq	4(%r12), %rax
	cmpq	%rax, %r14
	jge	LBB0_33
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movl	(%rax,%r14,4), %edi
	movq	%r13, %rsi
	callq	_ttm_mem_type_from_flags
	testl	%eax, %eax
	jne	LBB0_16
## %bb.26:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	-64(%rbp), %rsi
	leaq	(%rsi,%rsi,2), %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_24
## %bb.27:                              ##   in Loop: Header=BB0_25 Depth=1
	leaq	(%rax,%rcx,8), %rbx
	movq	8(%r12), %rax
	movl	(%rax,%r14,4), %edx
	movq	%rbx, %rdi
	movq	%r15, %rcx
	callq	_ttm_bo_mt_compatible
	testl	%eax, %eax
	je	LBB0_24
## %bb.28:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movl	(%r13), %esi
	movq	-56(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_ttm_bo_select_caching
	movq	%rax, -56(%rbp)
	movq	8(%r12), %rax
	movl	(%rax,%r14,4), %esi
	movq	_TTM_PL_MASK_MEMTYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	movq	%r15, %rdi
	callq	_ttm_flag_masked
	movq	-64(%rbp), %rsi
	movq	_TTM_PL_SYSTEM@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	je	LBB0_35
## %bb.29:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	%r13, %rdi
	movq	%r12, %rdx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	-84(%rbp), %r8d                 ## 4-byte Reload
	movl	-88(%rbp), %r9d                 ## 4-byte Reload
	callq	_ttm_bo_mem_force_space
	testl	%eax, %eax
	jne	LBB0_23
## %bb.30:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	cmpq	$0, 16(%rcx)
	je	LBB0_23
## %bb.31:
	movq	-56(%rbp), %rax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	jmp	LBB0_15
LBB0_16:
	movl	%eax, %ebx
LBB0_22:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_33:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	jne	LBB0_21
LBB0_34:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_21
LBB0_35:
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	%rsi, (%rcx)
	movq	-56(%rbp), %rax
	movq	%rax, 8(%rcx)
	movq	$0, 16(%rcx)
	xorl	%ebx, %ebx
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_TTM_PL_SYSTEM,8,3              ## @TTM_PL_SYSTEM
	.comm	_TTM_PL_MASK_MEMTYPE,4,2        ## @TTM_PL_MASK_MEMTYPE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ttm_bo_mem_space               ; -- Begin function ttm_bo_mem_space
	.p2align	2
_ttm_bo_mem_space:                      ; @ttm_bo_mem_space
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x26, [x0, #8]
Lloh0:
	adrp	x8, _TTM_PL_SYSTEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TTM_PL_SYSTEM@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stp	xzr, x8, [sp, #16]
	str	xzr, [x2, #16]
	ldr	w8, [x1]
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.1:
	mov	x19, x2
	mov	x22, x1
	mov	x23, x0
	stp	w3, w4, [sp, #8]                ; 8-byte Folded Spill
	mov	x20, #0
	mov	w28, #0
	mov	w21, #24
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22, #16]
	ldr	w0, [x8, x20, lsl #2]
	add	x1, sp, #24
	bl	_ttm_mem_type_from_flags
	cbnz	w0, LBB0_30
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x27, [x26]
	ldr	x25, [sp, #24]
	madd	x24, x25, x21, x27
	ldr	x8, [x22, #16]
	ldr	w2, [x8, x20, lsl #2]
	add	x3, sp, #16
	mov	x0, x24
	mov	x1, x25
	bl	_ttm_bo_mt_compatible
	cbnz	w0, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x20, x20, #1
	ldrsw	x8, [x22]
	cmp	x20, x8
	b.lt	LBB0_2
	b	LBB0_13
LBB0_5:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [x23]
	ldr	x2, [sp, #16]
	mov	x0, x24
	bl	_ttm_bo_select_caching
	str	x0, [sp, #16]
	ldr	x8, [x22, #16]
	ldr	w1, [x8, x20, lsl #2]
Lloh3:
	adrp	x8, _TTM_PL_MASK_MEMTYPE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TTM_PL_MASK_MEMTYPE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mvn	w2, w8
	add	x0, sp, #16
	bl	_ttm_flag_masked
	ldr	x8, [sp, #24]
Lloh6:
	adrp	x9, _TTM_PL_SYSTEM@GOTPAGE
Lloh7:
	ldr	x9, [x9, _TTM_PL_SYSTEM@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x24]
	cbz	x8, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	madd	x8, x25, x21, x27
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
	madd	x8, x25, x21, x27
	ldr	x8, [x8, #8]
	ldr	x8, [x8]
	mov	x0, x24
	mov	x1, x23
	mov	x2, x22
	mov	x3, x19
	blr	x8
	mov	x24, x0
	bl	_unlikely
	cbnz	x0, LBB0_31
; %bb.9:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w28, #1
LBB0_10:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x19, #16]
	cbnz	x8, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_2 Depth=1
	add	x20, x20, #1
	ldrsw	x8, [x22]
	cmp	x20, x8
	b.lt	LBB0_2
LBB0_12:
	ldr	x8, [sp, #24]
Lloh9:
	adrp	x9, _TTM_PL_SYSTEM@GOTPAGE
Lloh10:
	ldr	x9, [x9, _TTM_PL_SYSTEM@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_15
LBB0_13:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_16
; %bb.14:
	ldr	x8, [sp, #24]
LBB0_15:
	mov	w24, #0
	ldr	x9, [sp, #16]
	stp	x8, x9, [x19]
	b	LBB0_31
LBB0_16:
	cbz	w28, LBB0_19
; %bb.17:
	ldr	w8, [x22, #4]
	cmp	w8, #1
	b.lt	LBB0_34
; %bb.18:
	mov	x21, #0
	mov	w20, #0
	mov	w25, #24
Lloh12:
	adrp	x28, _ERESTARTSYS@GOTPAGE
Lloh13:
	ldr	x28, [x28, _ERESTARTSYS@GOTPAGEOFF]
	b	LBB0_23
LBB0_19:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_20:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_31
LBB0_21:                                ;   in Loop: Header=BB0_23 Depth=1
	ldr	w8, [x28]
	cmn	w0, w8
	csinc	w20, w20, wzr, ne
LBB0_22:                                ;   in Loop: Header=BB0_23 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x22, #4]
	cmp	x21, x8
	b.ge	LBB0_32
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22, #8]
	ldr	w0, [x8, x21, lsl #2]
	add	x1, sp, #24
	bl	_ttm_mem_type_from_flags
	cbnz	w0, LBB0_30
; %bb.24:                               ;   in Loop: Header=BB0_23 Depth=1
	ldr	x8, [x26]
	ldr	x1, [sp, #24]
	madd	x24, x1, x25, x8
	ldr	x8, [x24]
	cbz	x8, LBB0_22
; %bb.25:                               ;   in Loop: Header=BB0_23 Depth=1
	ldr	x8, [x22, #8]
	ldr	w2, [x8, x21, lsl #2]
	add	x3, sp, #16
	mov	x0, x24
	bl	_ttm_bo_mt_compatible
	cbz	w0, LBB0_22
; %bb.26:                               ;   in Loop: Header=BB0_23 Depth=1
	ldr	w1, [x23]
	ldr	x2, [sp, #16]
	mov	x0, x24
	bl	_ttm_bo_select_caching
	str	x0, [sp, #16]
	ldr	x8, [x22, #8]
	ldr	w1, [x8, x21, lsl #2]
Lloh16:
	adrp	x8, _TTM_PL_MASK_MEMTYPE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _TTM_PL_MASK_MEMTYPE@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	mvn	w2, w8
	add	x0, sp, #16
	bl	_ttm_flag_masked
	ldr	x1, [sp, #24]
Lloh19:
	adrp	x8, _TTM_PL_SYSTEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _TTM_PL_SYSTEM@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	cmp	x1, x8
	b.eq	LBB0_35
; %bb.27:                               ;   in Loop: Header=BB0_23 Depth=1
	mov	x0, x23
	mov	x2, x22
	mov	x3, x19
	ldp	w4, w5, [sp, #8]                ; 8-byte Folded Reload
	bl	_ttm_bo_mem_force_space
	cbnz	w0, LBB0_21
; %bb.28:                               ;   in Loop: Header=BB0_23 Depth=1
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_21
; %bb.29:
	mov	w24, #0
	ldr	x8, [sp, #16]
	str	x8, [x19, #8]
	b	LBB0_31
LBB0_30:
	mov	x24, x0
LBB0_31:
	mov	x0, x24
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_32:
	cbz	w20, LBB0_34
; %bb.33:
Lloh22:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
	b	LBB0_20
LBB0_34:
Lloh24:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_20
LBB0_35:
	mov	w24, #0
	ldr	x8, [sp, #16]
	stp	x1, x8, [x19]
	str	xzr, [x19, #16]
	b	LBB0_31
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_TTM_PL_SYSTEM,8,3              ; @TTM_PL_SYSTEM
	.comm	_TTM_PL_MASK_MEMTYPE,4,2        ; @TTM_PL_MASK_MEMTYPE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
