	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__thr_setspecific               ## -- Begin function _thr_setspecific
	.p2align	4, 0x90
__thr_setspecific:                      ## @_thr_setspecific
	.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
	leaq	-1(%rdi), %rbx
	movq	_PTHREAD_KEYS_MAX@GOTPCREL(%rip), %r13
	cmpl	%ebx, (%r13)
	jbe	LBB0_2
## %bb.1:
	movq	%rdi, %r12
	movq	__thread_keytable@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpl	$0, -4(%rax,%rdi,8)
	je	LBB0_2
## %bb.3:
	movq	%rsi, %r14
	xorl	%eax, %eax
	callq	__get_curthread
	movq	%rax, %r15
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	LBB0_7
## %bb.4:
	movl	(%r13), %edi
	movl	$4, %esi
	callq	___thr_calloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, (%r15)
LBB0_7:
	shlq	$4, %rbx
	leaq	(%rax,%rbx), %rcx
	addq	$8, %rcx
	cmpq	$0, 8(%rax,%rbx)
	je	LBB0_8
## %bb.9:
	testq	%r14, %r14
	jne	LBB0_12
## %bb.10:
	movl	$-1, %edx
	jmp	LBB0_11
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_13
LBB0_8:
	movl	$1, %edx
	testq	%r14, %r14
	je	LBB0_12
LBB0_11:
	addl	%edx, 8(%r15)
LBB0_12:
	movq	%r14, (%rcx)
	movq	__thread_keytable@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	-8(%rcx,%r12,8), %ecx
	movl	%ecx, (%rax,%rbx)
	xorl	%eax, %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_PTHREAD_KEYS_MAX,4,2           ## @PTHREAD_KEYS_MAX
	.comm	__thread_keytable,8,3           ## @_thread_keytable
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__thr_setspecific               ; -- Begin function _thr_setspecific
	.p2align	2
__thr_setspecific:                      ; @_thr_setspecific
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	sub	x21, x0, #1
Lloh0:
	adrp	x23, _PTHREAD_KEYS_MAX@GOTPAGE
Lloh1:
	ldr	x23, [x23, _PTHREAD_KEYS_MAX@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, w21
	b.ls	LBB0_8
; %bb.1:
Lloh2:
	adrp	x22, __thread_keytable@GOTPAGE
Lloh3:
	ldr	x22, [x22, __thread_keytable@GOTPAGEOFF]
	ldr	x8, [x22]
	add	x8, x8, x21, lsl #3
	ldr	w8, [x8, #4]
	cbz	w8, LBB0_8
; %bb.2:
	mov	x19, x1
	bl	__get_curthread
	mov	x20, x0
	ldr	x0, [x0]
	cbnz	x0, LBB0_5
; %bb.3:
	ldr	w0, [x23]
	mov	w1, #4
	bl	___thr_calloc
	cbz	x0, LBB0_14
; %bb.4:
	str	x0, [x20]
LBB0_5:
	add	x9, x0, x21, lsl #4
	ldr	x8, [x9, #8]!
	cbz	x8, LBB0_9
; %bb.6:
	cbnz	x19, LBB0_12
; %bb.7:
	mov	w8, #-1
	b	LBB0_11
LBB0_8:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	b	LBB0_13
LBB0_9:
	cbz	x19, LBB0_12
; %bb.10:
	mov	w8, #1
LBB0_11:
	ldr	w10, [x20, #8]
	add	w8, w10, w8
	str	w8, [x20, #8]
LBB0_12:
	mov	w8, #0
	str	x19, [x9]
	ldr	x9, [x22]
	lsl	x10, x21, #3
	ldr	w9, [x9, x10]
	lsl	x10, x21, #4
	str	w9, [x0, x10]
LBB0_13:
	mov	x0, x8
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_14:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	b	LBB0_13
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_PTHREAD_KEYS_MAX,4,2           ; @PTHREAD_KEYS_MAX
	.comm	__thread_keytable,8,3           ; @_thread_keytable
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
