	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BarrierArriveAndWait           ## -- Begin function BarrierArriveAndWait
	.p2align	4, 0x90
_BarrierArriveAndWait:                  ## @BarrierArriveAndWait
	.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
	movl	%esi, %r12d
	movq	%rdi, %rbx
	leaq	32(%rdi), %r14
	movq	%r14, %rdi
	callq	_SpinLockAcquire
	movl	(%rbx), %r15d
	leal	1(%r15), %r13d
	movq	8(%rbx), %rax
	incq	%rax
	movq	%rax, 8(%rbx)
	cmpq	16(%rbx), %rax
	jne	LBB0_2
## %bb.1:
	movq	$0, 8(%rbx)
	movl	%r13d, (%rbx)
	movl	%r13d, 24(%rbx)
	movq	%r14, %rdi
	callq	_SpinLockRelease
	addq	$28, %rbx
	movq	%rbx, %rdi
	callq	_ConditionVariableBroadcast
	movl	$1, %r15d
	jmp	LBB0_7
LBB0_2:
	movq	%r14, %rdi
	callq	_SpinLockRelease
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	leaq	28(%rbx), %r12
	movq	%r12, %rdi
	callq	_ConditionVariablePrepareToSleep
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_SpinLockAcquire
	movl	(%rbx), %eax
	cmpl	%r15d, %eax
	sete	%cl
	cmpl	%r13d, %eax
	sete	%al
	orb	%cl, %al
	movzbl	%al, %edi
	callq	_Assert
	cmpl	%r13d, (%rbx)
	je	LBB0_4
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	callq	_SpinLockRelease
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_ConditionVariableSleep
	jmp	LBB0_3
LBB0_4:
	xorl	%r15d, %r15d
	cmpl	%r13d, 24(%rbx)
	je	LBB0_6
## %bb.5:
	movl	%r13d, 24(%rbx)
	movl	$1, %r15d
LBB0_6:
	movq	%r14, %rdi
	callq	_SpinLockRelease
	xorl	%eax, %eax
	callq	_ConditionVariableCancelSleep
LBB0_7:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	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	_BarrierArriveAndWait           ; -- Begin function BarrierArriveAndWait
	.p2align	2
_BarrierArriveAndWait:                  ; @BarrierArriveAndWait
	.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	x21, x1
	mov	x20, x0
	add	x19, x0, #32
	mov	x0, x19
	bl	_SpinLockAcquire
	ldr	w24, [x20]
	add	w23, w24, #1
	ldp	x8, x9, [x20, #8]
	add	x8, x8, #1
	str	x8, [x20, #8]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	str	xzr, [x20, #8]
	str	w23, [x20]
	str	w23, [x20, #24]
	mov	x0, x19
	bl	_SpinLockRelease
	add	x0, x20, #28
	bl	_ConditionVariableBroadcast
	mov	w20, #1
	b	LBB0_9
LBB0_2:
	mov	x0, x19
	bl	_SpinLockRelease
	add	x22, x20, #28
	mov	x0, x22
	bl	_ConditionVariablePrepareToSleep
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_SpinLockAcquire
	ldr	w8, [x20]
	cmp	w8, w24
	ccmp	w8, w23, #4, ne
	cset	w0, eq
	bl	_Assert
	ldr	w8, [x20]
	cmp	w8, w23
	b.eq	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_SpinLockRelease
	mov	x0, x22
	mov	x1, x21
	bl	_ConditionVariableSleep
	b	LBB0_3
LBB0_5:
	ldr	w8, [x20, #24]
	cmp	w8, w23
	b.ne	LBB0_7
; %bb.6:
	mov	w20, #0
	b	LBB0_8
LBB0_7:
	str	w23, [x20, #24]
	mov	w20, #1
LBB0_8:
	mov	x0, x19
	bl	_SpinLockRelease
	bl	_ConditionVariableCancelSleep
LBB0_9:
	mov	x0, x20
	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
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
