	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_key_delete             ## -- Begin function pthread_key_delete
	.p2align	4, 0x90
_pthread_key_delete:                    ## @pthread_key_delete
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movq	%rdi, %r14
	cmpq	$0, 24(%rdi)
	je	LBB0_9
## %bb.3:
	cmpq	$0, 8(%r14)
	je	LBB0_9
## %bb.4:
	movq	%r14, %rdi
	callq	_pthread_mutex_lock
	testq	%rax, %rax
	jne	LBB0_9
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	(%rbx), %r15
	movq	%r15, %rdi
	callq	_pthread_mutex_lock
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_pte_tkAssocDestroy
	testq	%r12, %r12
	jne	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r15, %rdi
	callq	_pthread_mutex_unlock
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r14), %rbx
	testq	%rbx, %rbx
	jne	LBB0_6
## %bb.8:
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
LBB0_9:
	movl	16(%r14), %edi
	callq	_pte_osTlsFree
	cmpq	$0, 8(%r14)
	je	LBB0_10
## %bb.11:
	movq	_EBUSY@GOTPCREL(%rip), %r15
	movl	(%r15), %r12d
	movq	%r14, %rdi
	callq	_pthread_mutex_destroy
	movl	%eax, %ebx
	cmpl	%eax, %r12d
	jne	LBB0_14
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	callq	_pte_osThreadSleep
	movl	(%r15), %r12d
	movq	%r14, %rdi
	callq	_pthread_mutex_destroy
	cmpl	%eax, %r12d
	je	LBB0_12
## %bb.13:
	movl	%eax, %ebx
	jmp	LBB0_14
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_10:
	xorl	%ebx, %ebx
LBB0_14:
	movq	%r14, %rdi
	callq	_free
LBB0_15:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_key_delete             ; -- Begin function pthread_key_delete
	.p2align	2
_pthread_key_delete:                    ; @pthread_key_delete
	.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
	cbz	x0, LBB0_12
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_8
; %bb.2:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_8
; %bb.3:
	mov	x0, x19
	bl	_pthread_mutex_lock
	cbnz	x0, LBB0_8
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x21, [x20]
	mov	x0, x21
	bl	_pthread_mutex_lock
	mov	x22, x0
	mov	x0, x20
	bl	_pte_tkAssocDestroy
	cbnz	x22, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x21
	bl	_pthread_mutex_unlock
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x20, [x19, #24]
	cbnz	x20, LBB0_4
; %bb.7:
	mov	x0, x19
	bl	_pthread_mutex_unlock
LBB0_8:
	ldr	w0, [x19, #16]
	bl	_pte_osTlsFree
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_13
; %bb.9:
Lloh0:
	adrp	x21, _EBUSY@GOTPAGE
Lloh1:
	ldr	x21, [x21, _EBUSY@GOTPAGEOFF]
	ldr	w22, [x21]
	mov	x0, x19
	bl	_pthread_mutex_destroy
	mov	x20, x0
	cmp	w22, w0
	b.ne	LBB0_14
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	w0, #1
	bl	_pte_osThreadSleep
	ldr	w22, [x21]
	mov	x0, x19
	bl	_pthread_mutex_destroy
	cmp	w22, w0
	b.eq	LBB0_10
; %bb.11:
	mov	x20, x0
	b	LBB0_14
LBB0_12:
	mov	w20, #0
	b	LBB0_15
LBB0_13:
	mov	w20, #0
LBB0_14:
	mov	x0, x19
	bl	_free
LBB0_15:
	mov	x0, x20
	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 AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
.subsections_via_symbols
