	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tcm_reserve_2d
_tcm_reserve_2d:                        ## @tcm_reserve_2d
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r10
	movq	%rdi, %rbx
	movq	16(%rbp), %r14
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	leaq	-1(%rcx), %rsi
	movq	_EINVAL@GOTPCREL(%rip), %rax
	testq	%rsi, %rcx
	jne	LBB0_8
## %bb.3:
	testq	%rdx, %rdx
	je	LBB0_8
## %bb.4:
	testq	%r10, %r10
	je	LBB0_8
## %bb.5:
	testq	%r14, %r14
	je	LBB0_8
## %bb.6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	cmpq	%rdx, (%rbx)
	jl	LBB0_8
## %bb.7:
	cmpq	%r10, 8(%rbx)
	jl	LBB0_8
	jmp	LBB0_10
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_8:
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	negq	%rax
	jmp	LBB0_11
LBB0_10:
	movl	$1, (%r14)
	movq	%r14, (%rsp)
	movq	%rbx, %rdi
	movq	%rdx, %rsi
	movq	%r10, %rdx
	callq	*16(%rbx)
	xorl	%ecx, %ecx
	testq	%rax, %rax
	cmoveq	%rbx, %rcx
	movq	%rcx, 8(%r14)
LBB0_11:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,8,3                     ## @ENODEV
	.comm	_EINVAL,8,3                     ## @EINVAL
	.comm	_ENOMEM,8,3                     ## @ENOMEM
	.no_dead_strip	_tcm_reserve_2d
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tcm_reserve_2d
_tcm_reserve_2d:                        ; @tcm_reserve_2d
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x6
	mov	x8, x1
	mov	x20, x0
	cbz	x0, LBB0_10
; %bb.1:
Lloh0:
	adrp	x9, _EINVAL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _EINVAL@GOTPAGEOFF]
	sub	x10, x3, #1
	tst	x3, x10
	b.ne	LBB0_8
; %bb.2:
	cbz	x2, LBB0_8
; %bb.3:
	cbz	x8, LBB0_8
; %bb.4:
	cbz	x19, LBB0_8
; %bb.5:
	ldr	x9, [x20]
	cmp	x9, x2
	b.lt	LBB0_7
; %bb.6:
	ldr	x9, [x20, #8]
	cmp	x9, x8
	b.ge	LBB0_11
LBB0_7:
Lloh2:
	adrp	x9, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ENOMEM@GOTPAGEOFF]
LBB0_8:
	ldr	x9, [x9]
	cbz	x9, LBB0_11
LBB0_9:
	neg	x0, x9
	b	LBB0_12
LBB0_10:
Lloh4:
	adrp	x9, _ENODEV@GOTPAGE
Lloh5:
	ldr	x9, [x9, _ENODEV@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cbnz	x9, LBB0_9
LBB0_11:
	mov	w9, #1
	str	w9, [x19]
	ldr	x9, [x20, #16]
	mov	x0, x20
	mov	x1, x2
	mov	x2, x8
	mov	x6, x19
	blr	x9
	cmp	x0, #0
	csel	x8, x20, xzr, eq
	str	x8, [x19, #8]
LBB0_12:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,8,3                     ; @ENODEV
	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_ENOMEM,8,3                     ; @ENOMEM
	.no_dead_strip	_tcm_reserve_2d
.subsections_via_symbols
