	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_join                   ## -- Begin function pthread_join
	.p2align	4, 0x90
_pthread_join:                          ## @pthread_join
	.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
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	_pte_thread_reuse_lock@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_pte_osMutexLock
	testq	%r15, %r15
	je	LBB0_1
## %bb.2:
	movq	_PTHREAD_CREATE_DETACHED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	8(%r15), %rax
	jne	LBB0_17
## %bb.3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_1:
	movq	_ESRCH@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %ebx
	movl	(%r12), %edi
	callq	_pte_osMutexUnlock
	testl	%ebx, %ebx
	jne	LBB0_16
	jmp	LBB0_5
LBB0_17:
	movl	(%r12), %edi
	callq	_pte_osMutexUnlock
LBB0_5:
	xorl	%eax, %eax
	callq	_pthread_self
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %rdi
	movq	%r15, %rsi
	callq	_pthread_equal
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	_EDEADLK@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_6:
	movq	_ENOENT@GOTPCREL(%rip), %rax
LBB0_15:
	movl	(%rax), %ebx
LBB0_16:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	24(%r15), %edi
	callq	_pte_osThreadWaitForEnd
	movq	_PTE_OS_OK@GOTPCREL(%rip), %rcx
	cmpl	%eax, (%rcx)
	jne	LBB0_13
## %bb.10:
	testq	%r14, %r14
	je	LBB0_12
## %bb.11:
	movq	16(%r15), %rax
	movq	%rax, (%r14)
LBB0_12:
	movq	%r15, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pthread_detach                 ## TAILCALL
LBB0_13:
	movq	_PTE_OS_INTERRUPTED@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpl	(%rcx), %eax
	je	LBB0_16
## %bb.14:
	movq	_ESRCH@GOTPCREL(%rip), %rax
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_pte_thread_reuse_lock,4,2      ## @pte_thread_reuse_lock
	.comm	_ESRCH,4,2                      ## @ESRCH
	.comm	_PTHREAD_CREATE_DETACHED,8,3    ## @PTHREAD_CREATE_DETACHED
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_EDEADLK,4,2                    ## @EDEADLK
	.comm	_PTE_OS_OK,4,2                  ## @PTE_OS_OK
	.comm	_PTE_OS_INTERRUPTED,4,2         ## @PTE_OS_INTERRUPTED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_join                   ; -- Begin function pthread_join
	.p2align	2
_pthread_join:                          ; @pthread_join
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x23, _pte_thread_reuse_lock@GOTPAGE
Lloh1:
	ldr	x23, [x23, _pte_thread_reuse_lock@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_pte_osMutexLock
Lloh2:
	adrp	x22, _ESRCH@GOTPAGE
Lloh3:
	ldr	x22, [x22, _ESRCH@GOTPAGEOFF]
	cbz	x19, LBB0_3
; %bb.1:
Lloh4:
	adrp	x8, _PTHREAD_CREATE_DETACHED@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PTHREAD_CREATE_DETACHED@GOTPAGEOFF]
Lloh6:
	ldr	x8, [x8]
	ldr	x9, [x19, #8]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.2:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
	mov	x8, x22
LBB0_4:
	ldr	w21, [x8]
	ldr	w0, [x23]
	bl	_pte_osMutexUnlock
	cbnz	w21, LBB0_15
; %bb.5:
	bl	_pthread_self
	cbz	x0, LBB0_9
LBB0_6:
	mov	x1, x19
	bl	_pthread_equal
	cbz	x0, LBB0_10
; %bb.7:
Lloh9:
	adrp	x8, _EDEADLK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EDEADLK@GOTPAGEOFF]
Lloh11:
	ldr	w21, [x8]
	b	LBB0_15
LBB0_8:
	ldr	w0, [x23]
	bl	_pte_osMutexUnlock
	bl	_pthread_self
	cbnz	x0, LBB0_6
LBB0_9:
Lloh12:
	adrp	x8, _ENOENT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh14:
	ldr	w21, [x8]
	b	LBB0_15
LBB0_10:
	ldr	w0, [x19, #24]
	bl	_pte_osThreadWaitForEnd
Lloh15:
	adrp	x8, _PTE_OS_OK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PTE_OS_OK@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	w8, w0
	b.ne	LBB0_14
; %bb.11:
	cbz	x20, LBB0_13
; %bb.12:
	ldr	x8, [x19, #16]
	str	x8, [x20]
LBB0_13:
	mov	x0, x19
	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
	b	_pthread_detach
LBB0_14:
Lloh18:
	adrp	x8, _PTE_OS_INTERRUPTED@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PTE_OS_INTERRUPTED@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	ldr	w9, [x22]
	cmp	w0, w8
	csel	w21, wzr, w9, eq
LBB0_15:
	mov	x0, x21
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_pte_thread_reuse_lock,4,2      ; @pte_thread_reuse_lock
	.comm	_ESRCH,4,2                      ; @ESRCH
	.comm	_PTHREAD_CREATE_DETACHED,8,3    ; @PTHREAD_CREATE_DETACHED
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_EDEADLK,4,2                    ; @EDEADLK
	.comm	_PTE_OS_OK,4,2                  ; @PTE_OS_OK
	.comm	_PTE_OS_INTERRUPTED,4,2         ; @PTE_OS_INTERRUPTED
.subsections_via_symbols
