	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ttm_mem_global_reserve
_ttm_mem_global_reserve:                ## @ttm_mem_global_reserve
	.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
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	movq	%rdx, %rbx
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	leaq	4(%rdi), %r15
	movq	%r15, %rdi
	callq	_spin_lock
	movl	(%r12), %edx
	testl	%edx, %edx
	je	LBB0_17
## %bb.1:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	_CAP_SYS_ADMIN@GOTPCREL(%rip), %r15
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movl	%edx, %eax
	cmpq	%rax, %rbx
	jae	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movq	(%rax,%rbx,8), %r14
	testq	%r13, %r13
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	%r13, %r14
	jne	LBB0_2
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r15), %edi
	callq	_capable
	xorl	%ecx, %ecx
	testq	%rax, %rax
	sete	%cl
	movq	16(%r14), %rax
	cmpq	(%r14,%rcx,8), %rax
	jg	LBB0_15
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r12), %edx
	jmp	LBB0_2
LBB0_7:
	xorl	%r14d, %r14d
	cmpl	$0, -56(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_16
## %bb.8:
	testl	%edx, %edx
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_17
## %bb.9:
	movq	8(%r12), %rcx
	xorl	%r14d, %r14d
	cmpl	$1, %edx
	jne	LBB0_18
## %bb.10:
	xorl	%edx, %edx
LBB0_11:
	testb	$1, %al
	je	LBB0_17
## %bb.12:
	movq	(%rcx,%rdx,8), %rax
	testq	%r13, %r13
	je	LBB0_14
## %bb.13:
	cmpq	%r13, %rax
	jne	LBB0_17
LBB0_14:
	addq	%rbx, 16(%rax)
	jmp	LBB0_17
LBB0_15:
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, %r14d
LBB0_16:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
LBB0_17:
	movq	%r15, %rdi
	callq	_spin_unlock
	movq	%r12, %rdi
	callq	_ttm_check_swapping
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movl	%eax, %esi
	andl	$-2, %esi
	xorl	%edx, %edx
	jmp	LBB0_21
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_21 Depth=1
	addq	%rbx, 16(%rdi)
LBB0_20:                                ##   in Loop: Header=BB0_21 Depth=1
	addq	$2, %rdx
	cmpq	%rdx, %rsi
	je	LBB0_11
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rdx,8), %rdi
	testq	%r13, %r13
	je	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_21 Depth=1
	cmpq	%r13, %rdi
	jne	LBB0_24
LBB0_23:                                ##   in Loop: Header=BB0_21 Depth=1
	addq	%rbx, 16(%rdi)
LBB0_24:                                ##   in Loop: Header=BB0_21 Depth=1
	movq	8(%rcx,%rdx,8), %rdi
	testq	%r13, %r13
	je	LBB0_19
## %bb.25:                              ##   in Loop: Header=BB0_21 Depth=1
	cmpq	%r13, %rdi
	jne	LBB0_20
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CAP_SYS_ADMIN,4,2              ## @CAP_SYS_ADMIN
	.no_dead_strip	_ttm_mem_global_reserve
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ttm_mem_global_reserve
_ttm_mem_global_reserve:                ; @ttm_mem_global_reserve
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x24, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
	add	x20, x0, #4
	mov	x0, x20
	bl	_spin_lock
	ldr	w8, [x19]
	cbz	w8, LBB0_14
; %bb.1:
	mov	x25, #0
	neg	w23, w23
Lloh3:
	adrp	x26, _CAP_SYS_ADMIN@GOTPAGE
Lloh4:
	ldr	x26, [x26, _CAP_SYS_ADMIN@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x25, x25, #1
	cmp	x25, w8, uxtw
	b.hs	LBB0_7
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #8]
	ldr	x27, [x9, x25, lsl #3]
	cbz	x22, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	x27, x22
	b.ne	LBB0_2
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x26]
	bl	_capable
	cmp	x0, #0
	cset	w8, eq
	ldr	x8, [x27, w8, uxtw #3]
	ldr	x9, [x27, #16]
	cmp	x9, x8
	b.gt	LBB0_15
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x19]
	b	LBB0_2
LBB0_7:
	mov	w23, #0
	cbz	w24, LBB0_15
; %bb.8:
	cbz	w8, LBB0_15
; %bb.9:
	mov	w8, w8
	ldr	x9, [x19, #8]
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	x11, [x10, #16]
	add	x11, x11, x21
	str	x11, [x10, #16]
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x9, x9, #8
	subs	x8, x8, #1
	b.eq	LBB0_14
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9]
	cbz	x22, LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	cmp	x10, x22
	b.ne	LBB0_11
	b	LBB0_10
LBB0_14:
	mov	w23, #0
LBB0_15:
	mov	x0, x20
	bl	_spin_unlock
	mov	x0, x19
	bl	_ttm_check_swapping
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CAP_SYS_ADMIN,4,2              ; @CAP_SYS_ADMIN
	.no_dead_strip	_ttm_mem_global_reserve
.subsections_via_symbols
