	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_barrier_wait                   ## -- Begin function barrier_wait
	.p2align	4, 0x90
_barrier_wait:                          ## @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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	leaq	16(%rdi), %r14
	movq	%r14, %rdi
	callq	_pthread_mutex_lock
	movq	(%r12), %rcx
	movq	8(%r12), %rax
	incq	%rcx
	movq	%rcx, (%r12)
	cmpq	%rax, %rcx
	jge	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	addq	$20, %r12
	movq	%r12, %rdi
	callq	_sem_wait
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_2:
	movq	$0, (%r12)
	cmpq	$2, %rax
	jl	LBB0_5
## %bb.3:
	leaq	20(%r12), %r15
	movl	$1, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_sem_post
	incq	%rbx
	cmpq	%rbx, 8(%r12)
	jg	LBB0_4
LBB0_5:
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	movl	$1, %eax
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_barrier_wait                   ; -- Begin function barrier_wait
	.p2align	2
_barrier_wait:                          ; @barrier_wait
	.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
	mov	x19, x0
	add	x20, x0, #16
	mov	x0, x20
	bl	_pthread_mutex_lock
	ldp	x9, x8, [x19]
	add	x9, x9, #1
	str	x9, [x19]
	cmp	x9, x8
	b.ge	LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_pthread_mutex_unlock
	add	x0, x19, #20
	bl	_sem_wait
	mov	w0, #0
	b	LBB0_6
LBB0_2:
	str	xzr, [x19]
	cmp	x8, #2
	b.lt	LBB0_5
; %bb.3:
	add	x21, x19, #20
	mov	w22, #1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_sem_post
	add	x22, x22, #1
	ldr	x8, [x19, #8]
	cmp	x8, x22
	b.gt	LBB0_4
LBB0_5:
	mov	x0, x20
	bl	_pthread_mutex_unlock
	mov	w0, #1
LBB0_6:
	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
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
