	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pteTlsAlloc                    ## -- Begin function pteTlsAlloc
	.p2align	4, 0x90
_pteTlsAlloc:                           ## @pteTlsAlloc
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_PTE_OS_NO_RESOURCES@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_globalTlsLock@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_pte_osMutexLock
	movq	_maxTlsValues@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_5
## %bb.1:
	movq	_keysUsed@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$0, (%rdx,%rcx,4)
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	incq	%rcx
	cmpq	%rcx, %rax
	jne	LBB0_2
	jmp	LBB0_5
LBB0_3:
	movl	$1, (%rdx,%rcx,4)
	incl	%ecx
	movl	%ecx, (%r14)
	movq	_PTE_OS_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_5:
	movl	(%r15), %edi
	callq	_pte_osMutexUnlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PTE_OS_NO_RESOURCES,4,2        ## @PTE_OS_NO_RESOURCES
	.comm	_globalTlsLock,4,2              ## @globalTlsLock
	.comm	_maxTlsValues,4,2               ## @maxTlsValues
	.comm	_keysUsed,8,3                   ## @keysUsed
	.comm	_PTE_OS_OK,4,2                  ## @PTE_OS_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pteTlsAlloc                    ; -- Begin function pteTlsAlloc
	.p2align	2
_pteTlsAlloc:                           ; @pteTlsAlloc
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x0
Lloh0:
	adrp	x8, _PTE_OS_NO_RESOURCES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PTE_OS_NO_RESOURCES@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
Lloh3:
	adrp	x21, _globalTlsLock@GOTPAGE
Lloh4:
	ldr	x21, [x21, _globalTlsLock@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_pte_osMutexLock
Lloh5:
	adrp	x8, _maxTlsValues@GOTPAGE
Lloh6:
	ldr	x8, [x8, _maxTlsValues@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.1:
	mov	x9, #0
Lloh8:
	adrp	x10, _keysUsed@GOTPAGE
Lloh9:
	ldr	x10, [x10, _keysUsed@GOTPAGEOFF]
Lloh10:
	ldr	x10, [x10]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x10, x9, lsl #2]
	cbz	w11, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x9, x9, #1
	cmp	x8, x9
	b.ne	LBB0_2
	b	LBB0_5
LBB0_4:
	mov	w8, #1
	str	w8, [x10, x9, lsl #2]
	add	w8, w9, #1
	str	w8, [x20]
Lloh11:
	adrp	x8, _PTE_OS_OK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PTE_OS_OK@GOTPAGEOFF]
Lloh13:
	ldr	w19, [x8]
LBB0_5:
	ldr	w0, [x21]
	bl	_pte_osMutexUnlock
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_PTE_OS_NO_RESOURCES,4,2        ; @PTE_OS_NO_RESOURCES
	.comm	_globalTlsLock,4,2              ; @globalTlsLock
	.comm	_maxTlsValues,4,2               ; @maxTlsValues
	.comm	_keysUsed,8,3                   ; @keysUsed
	.comm	_PTE_OS_OK,4,2                  ; @PTE_OS_OK
.subsections_via_symbols
