	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_allocate_tls                   ## -- Begin function allocate_tls
	.p2align	4, 0x90
_allocate_tls:                          ## @allocate_tls
	.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
	movq	_tls_static_max_align@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	cmpq	%rcx, %r14
	cmovbeq	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	_tls_static_space@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%r14, %rsi
	callq	_round
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_round
	movq	%rax, %r13
	addq	-48(%rbp), %r13                 ## 8-byte Folded Reload
	xorl	%edi, %edi
	cmpq	$16, %r15
	setae	%dil
	callq	_assert
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_malloc_aligned
	movq	%rax, %r13
	movq	_tls_max_index@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	$2, %rdi
	movl	$8, %esi
	callq	_xcalloc
	movq	%rax, %r15
	movq	_tls_static_space@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%r14, %rsi
	callq	_round
	leaq	(%rax,%r13), %r14
	movq	%r14, (%r13,%rax)
	movq	%r15, 8(%r13,%rax)
	movq	_tls_dtv_generation@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
	movq	_tls_max_index@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r15)
	testq	%r12, %r12
	je	LBB0_1
## %bb.9:
	movq	_tls_static_space@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	%r14, %rdi
	subq	%rdx, %rdi
	movq	%r12, %rsi
	subq	%rdx, %rsi
	callq	_memcpy
	movq	8(%r12), %rax
	movq	8(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_15
## %bb.10:
	movq	%r12, %rdx
	subq	-48(%rbp), %rdx                 ## 8-byte Folded Reload
	xorl	%esi, %esi
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	%rdi, 16(%r15,%rsi,8)
	movq	$0, 16(%rax,%rsi,8)
	movq	8(%rax), %rcx
LBB0_14:                                ##   in Loop: Header=BB0_11 Depth=1
	incq	%rsi
	cmpq	%rcx, %rsi
	jae	LBB0_15
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%rax,%rsi,8), %rdi
	cmpq	%rdx, %rdi
	jb	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	cmpq	%r12, %rdi
	jbe	LBB0_14
	jmp	LBB0_13
LBB0_15:
	movq	%r12, %rdi
	movl	$16, %esi
	movl	$8, %edx
	callq	_free_tls
LBB0_16:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	testq	%rbx, %rbx
	je	LBB0_16
## %bb.2:
	movq	_next@GOTPCREL(%rip), %r13
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movslq	28(%rbx), %rax
	movq	%r12, 8(%r15,%rax,8)
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_TAILQ_NEXT
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_16
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, 40(%rbx)
	jne	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %r12
	subq	%rax, %r12
	movq	8(%rbx), %rdi
	movq	32(%rbx), %rdx
	subq	%rdi, %rdx
	addq	%r12, %rdi
	xorl	%esi, %esi
	callq	_memset
	movq	16(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%rbx), %rdx
	movq	%r12, %rdi
	callq	_memcpy
	movl	$1, 24(%rbx)
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_tls_static_max_align,8,3       ## @tls_static_max_align
	.comm	_tls_static_space,8,3           ## @tls_static_space
	.comm	_tls_max_index,8,3              ## @tls_max_index
	.comm	_tls_dtv_generation,8,3         ## @tls_dtv_generation
	.comm	_next,4,2                       ## @next
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_allocate_tls                   ; -- Begin function allocate_tls
	.p2align	2
_allocate_tls:                          ; @allocate_tls
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _tls_static_max_align@GOTPAGE
Lloh1:
	ldr	x8, [x8, _tls_static_max_align@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x3
	csel	x24, x8, x3, hi
Lloh3:
	adrp	x25, _tls_static_space@GOTPAGE
Lloh4:
	ldr	x25, [x25, _tls_static_space@GOTPAGEOFF]
	ldr	x0, [x25]
	mov	x1, x24
	bl	_round
	mov	x22, x0
	mov	x0, x19
	mov	x1, x24
	bl	_round
	add	x23, x0, x22
	cmp	x19, #15
	cset	w0, hi
	bl	_assert
	mov	x0, x23
	mov	x1, x24
	bl	_malloc_aligned
	mov	x19, x0
Lloh5:
	adrp	x26, _tls_max_index@GOTPAGE
Lloh6:
	ldr	x26, [x26, _tls_max_index@GOTPAGEOFF]
	ldr	x8, [x26]
	add	x0, x8, #2
	mov	w1, #8
	bl	_xcalloc
	mov	x22, x0
	ldr	x0, [x25]
	mov	x1, x24
	bl	_round
	add	x19, x19, x0
	stp	x19, x22, [x19]
Lloh7:
	adrp	x8, _tls_dtv_generation@GOTPAGE
Lloh8:
	ldr	x8, [x8, _tls_dtv_generation@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	str	x8, [x22]
	ldr	x8, [x26]
	str	x8, [x22, #8]
	cbz	x20, LBB0_8
; %bb.1:
	ldr	x2, [x25]
	sub	x0, x19, x2
	sub	x1, x20, x2
	bl	_memcpy
	ldr	x8, [x20, #8]
	ldr	x11, [x8, #8]
	cbz	x11, LBB0_6
; %bb.2:
	mov	x9, #0
	sub	x10, x20, x23
	add	x12, x22, #16
	add	x13, x8, #16
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x9, x9, #1
	cmp	x9, x11
	b.hs	LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x14, [x13, x9, lsl #3]
	cmp	x14, x10
	ccmp	x14, x20, #2, hs
	b.ls	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	lsl	x11, x9, #3
	str	x14, [x12, x11]
	str	xzr, [x13, x11]
	ldr	x11, [x8, #8]
	b	LBB0_3
LBB0_6:
	mov	x0, x20
	mov	w1, #16
	mov	w2, #8
	bl	_free_tls
LBB0_7:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_8:
	cbz	x21, LBB0_7
; %bb.9:
	mov	w23, #1
Lloh10:
	adrp	x24, _next@GOTPAGE
Lloh11:
	ldr	x24, [x24, _next@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	ldrsw	x8, [x21, #28]
	add	x8, x22, x8, lsl #3
	str	x20, [x8, #8]
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	w1, [x24]
	mov	x0, x21
	bl	_TAILQ_NEXT
	mov	x21, x0
	cbz	x0, LBB0_7
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #40]
	cbnz	x8, LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x8, [x21]
	cbz	x8, LBB0_11
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x9, [x21, #8]
	sub	x20, x19, x8
	add	x0, x9, x20
	ldr	x8, [x21, #32]
	sub	x2, x8, x9
	mov	w1, #0
	bl	_memset
	ldr	x1, [x21, #16]
	cbz	x1, LBB0_10
; %bb.15:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x2, [x21, #8]
	mov	x0, x20
	bl	_memcpy
	str	w23, [x21, #24]
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_tls_static_max_align,8,3       ; @tls_static_max_align
	.comm	_tls_static_space,8,3           ; @tls_static_space
	.comm	_tls_max_index,8,3              ; @tls_max_index
	.comm	_tls_dtv_generation,8,3         ; @tls_dtv_generation
	.comm	_next,4,2                       ; @next
.subsections_via_symbols
