	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__pthread_barrier_wait          ## -- Begin function _pthread_barrier_wait
	.p2align	4, 0x90
__pthread_barrier_wait:                 ## @_pthread_barrier_wait
	.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
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	(%rdi), %r15
	testq	%r15, %r15
	je	LBB0_2
## %bb.3:
	movq	_THR_PSHARED_PTR@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	jne	LBB0_5
## %bb.4:
	xorl	%esi, %esi
	callq	___thr_pshared_offpage
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_2
LBB0_5:
	xorl	%eax, %eax
	callq	__get_curthread
	movq	%rax, %r14
	leaq	32(%r15), %rbx
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_THR_UMUTEX_LOCK
	movq	(%r15), %rax
	incq	%rax
	movq	%rax, (%r15)
	cmpq	8(%r15), %rax
	jne	LBB0_7
## %bb.6:
	movq	$0, (%r15)
	incq	16(%r15)
	addq	$36, %r15
	movq	%r15, %rdi
	callq	__thr_ucond_broadcast
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_THR_UMUTEX_UNLOCK
	movq	_PTHREAD_BARRIER_SERIAL_THREAD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_13
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_13
LBB0_7:
	movq	16(%r15), %r13
	incq	24(%r15)
	leaq	36(%r15), %r12
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	__thr_ucond_wait
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_THR_UMUTEX_LOCK
	cmpq	16(%r15), %r13
	je	LBB0_8
## %bb.9:
	decq	24(%r15)
	jne	LBB0_12
## %bb.10:
	cmpq	$0, 40(%r15)
	je	LBB0_12
## %bb.11:
	movq	%r12, %rdi
	callq	__thr_ucond_broadcast
LBB0_12:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_THR_UMUTEX_UNLOCK
	xorl	%eax, %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_THR_PSHARED_PTR,8,3            ## @THR_PSHARED_PTR
	.comm	_PTHREAD_BARRIER_SERIAL_THREAD,4,2 ## @PTHREAD_BARRIER_SERIAL_THREAD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__pthread_barrier_wait          ; -- Begin function _pthread_barrier_wait
	.p2align	2
__pthread_barrier_wait:                 ; @_pthread_barrier_wait
	.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
	cbz	x0, LBB0_6
; %bb.1:
	ldr	x19, [x0]
	cbz	x19, LBB0_6
; %bb.2:
Lloh0:
	adrp	x8, _THR_PSHARED_PTR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _THR_PSHARED_PTR@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x19, x8
	b.ne	LBB0_4
; %bb.3:
	mov	w1, #0
	bl	___thr_pshared_offpage
	mov	x19, x0
	cbz	x0, LBB0_6
LBB0_4:
	bl	__get_curthread
	mov	x20, x0
	add	x21, x19, #32
	mov	x1, x21
	bl	_THR_UMUTEX_LOCK
	ldp	x8, x9, [x19]
	add	x8, x8, #1
	str	x8, [x19]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.5:
	str	xzr, [x19]
	ldr	x8, [x19, #16]
	add	x8, x8, #1
	str	x8, [x19, #16]
	add	x0, x19, #36
	bl	__thr_ucond_broadcast
	mov	x0, x20
	mov	x1, x21
	bl	_THR_UMUTEX_UNLOCK
Lloh3:
	adrp	x8, _PTHREAD_BARRIER_SERIAL_THREAD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PTHREAD_BARRIER_SERIAL_THREAD@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	b	LBB0_13
LBB0_6:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	b	LBB0_13
LBB0_7:
	ldp	x23, x8, [x19, #16]
	add	x8, x8, #1
	str	x8, [x19, #24]
	add	x22, x19, #36
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x21
	mov	x2, #0
	mov	w3, #0
	bl	__thr_ucond_wait
	mov	x0, x20
	mov	x1, x21
	bl	_THR_UMUTEX_LOCK
	ldr	x8, [x19, #16]
	cmp	x23, x8
	b.eq	LBB0_8
; %bb.9:
	ldr	x8, [x19, #24]
	subs	x8, x8, #1
	str	x8, [x19, #24]
	b.ne	LBB0_12
; %bb.10:
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_12
; %bb.11:
	mov	x0, x22
	bl	__thr_ucond_broadcast
LBB0_12:
	mov	x0, x20
	mov	x1, x21
	bl	_THR_UMUTEX_UNLOCK
	mov	w0, #0
LBB0_13:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_THR_PSHARED_PTR,8,3            ; @THR_PSHARED_PTR
	.comm	_PTHREAD_BARRIER_SERIAL_THREAD,4,2 ; @PTHREAD_BARRIER_SERIAL_THREAD
.subsections_via_symbols
