	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wait_all
_wait_all:                              ## @wait_all
	.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
	movq	_HAVE_THREADS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_BUG
LBB0_2:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_grep_lock
	movq	_all_work_added@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	movq	_todo_done@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movq	_todo_end@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	je	LBB0_5
## %bb.3:
	movq	_cond_result@GOTPCREL(%rip), %r14
	movq	_grep_mutex@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_pthread_cond_wait
	movq	(%r13), %rax
	cmpq	(%rbx), %rax
	jne	LBB0_4
LBB0_5:
	movq	_cond_add@GOTPCREL(%rip), %rdi
	callq	_pthread_cond_broadcast
	xorl	%eax, %eax
	callq	_grep_unlock
	movq	_num_threads@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_8
## %bb.6:
	xorl	%ebx, %ebx
	movq	_threads@GOTPCREL(%rip), %r13
	leaq	-48(%rbp), %r14
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	movl	(%rax,%rbx,4), %edi
	movq	%r14, %rsi
	callq	_pthread_join
	orl	-48(%rbp), %r12d
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_7
LBB0_8:
	movq	_threads@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_free
	movq	_grep_mutex@GOTPCREL(%rip), %rdi
	callq	_pthread_mutex_destroy
	movq	_grep_read_mutex@GOTPCREL(%rip), %rdi
	callq	_pthread_mutex_destroy
	movq	_grep_attr_mutex@GOTPCREL(%rip), %rdi
	callq	_pthread_mutex_destroy
	movq	_cond_add@GOTPCREL(%rip), %rdi
	callq	_pthread_cond_destroy
	movq	_cond_write@GOTPCREL(%rip), %rdi
	callq	_pthread_cond_destroy
	movq	_cond_result@GOTPCREL(%rip), %rdi
	callq	_pthread_cond_destroy
	movq	_grep_use_locks@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HAVE_THREADS,4,2               ## @HAVE_THREADS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Never call this function unless you have started threads"

	.comm	_all_work_added,4,2             ## @all_work_added
	.comm	_todo_done,8,3                  ## @todo_done
	.comm	_todo_end,8,3                   ## @todo_end
	.comm	_cond_result,4,2                ## @cond_result
	.comm	_grep_mutex,4,2                 ## @grep_mutex
	.comm	_cond_add,4,2                   ## @cond_add
	.comm	_num_threads,4,2                ## @num_threads
	.comm	_threads,8,3                    ## @threads
	.comm	_grep_read_mutex,4,2            ## @grep_read_mutex
	.comm	_grep_attr_mutex,4,2            ## @grep_attr_mutex
	.comm	_cond_write,4,2                 ## @cond_write
	.comm	_grep_use_locks,8,3             ## @grep_use_locks
	.no_dead_strip	_wait_all
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wait_all
_wait_all:                              ; @wait_all
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
Lloh0:
	adrp	x8, _HAVE_THREADS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HAVE_THREADS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbnz	w8, LBB0_2
; %bb.1:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BUG
LBB0_2:
	bl	_grep_lock
Lloh5:
	adrp	x8, _all_work_added@GOTPAGE
Lloh6:
	ldr	x8, [x8, _all_work_added@GOTPAGEOFF]
	mov	w9, #1
Lloh7:
	adrp	x21, _todo_done@GOTPAGE
Lloh8:
	ldr	x21, [x21, _todo_done@GOTPAGEOFF]
Lloh9:
	str	w9, [x8]
	ldr	x8, [x21]
Lloh10:
	adrp	x22, _todo_end@GOTPAGE
Lloh11:
	ldr	x22, [x22, _todo_end@GOTPAGEOFF]
	ldr	x9, [x22]
	cmp	x8, x9
	b.eq	LBB0_5
; %bb.3:
Lloh12:
	adrp	x19, _cond_result@GOTPAGE
Lloh13:
	ldr	x19, [x19, _cond_result@GOTPAGEOFF]
Lloh14:
	adrp	x20, _grep_mutex@GOTPAGE
Lloh15:
	ldr	x20, [x20, _grep_mutex@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_pthread_cond_wait
	ldr	x8, [x21]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_4
LBB0_5:
Lloh16:
	adrp	x0, _cond_add@GOTPAGE
Lloh17:
	ldr	x0, [x0, _cond_add@GOTPAGEOFF]
	bl	_pthread_cond_broadcast
	bl	_grep_unlock
Lloh18:
	adrp	x21, _num_threads@GOTPAGE
Lloh19:
	ldr	x21, [x21, _num_threads@GOTPAGEOFF]
	ldr	w8, [x21]
Lloh20:
	adrp	x20, _threads@GOTPAGE
Lloh21:
	ldr	x20, [x20, _threads@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.6:
	mov	x22, #0
	mov	w19, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	ldr	w0, [x8, x22, lsl #2]
	add	x1, sp, #8
	bl	_pthread_join
	ldr	w8, [sp, #8]
	orr	w19, w19, w8
	add	x22, x22, #1
	ldrsw	x8, [x21]
	cmp	x22, x8
	b.lt	LBB0_7
	b	LBB0_9
LBB0_8:
	mov	w19, #0
LBB0_9:
	ldr	x0, [x20]
	bl	_free
Lloh22:
	adrp	x0, _grep_mutex@GOTPAGE
Lloh23:
	ldr	x0, [x0, _grep_mutex@GOTPAGEOFF]
	bl	_pthread_mutex_destroy
Lloh24:
	adrp	x0, _grep_read_mutex@GOTPAGE
Lloh25:
	ldr	x0, [x0, _grep_read_mutex@GOTPAGEOFF]
	bl	_pthread_mutex_destroy
Lloh26:
	adrp	x0, _grep_attr_mutex@GOTPAGE
Lloh27:
	ldr	x0, [x0, _grep_attr_mutex@GOTPAGEOFF]
	bl	_pthread_mutex_destroy
Lloh28:
	adrp	x0, _cond_add@GOTPAGE
Lloh29:
	ldr	x0, [x0, _cond_add@GOTPAGEOFF]
	bl	_pthread_cond_destroy
Lloh30:
	adrp	x0, _cond_write@GOTPAGE
Lloh31:
	ldr	x0, [x0, _cond_write@GOTPAGEOFF]
	bl	_pthread_cond_destroy
Lloh32:
	adrp	x0, _cond_result@GOTPAGE
Lloh33:
	ldr	x0, [x0, _cond_result@GOTPAGEOFF]
	bl	_pthread_cond_destroy
Lloh34:
	adrp	x8, _grep_use_locks@GOTPAGE
Lloh35:
	ldr	x8, [x8, _grep_use_locks@GOTPAGEOFF]
Lloh36:
	str	xzr, [x8]
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh9
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotStr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_HAVE_THREADS,4,2               ; @HAVE_THREADS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Never call this function unless you have started threads"

	.comm	_all_work_added,4,2             ; @all_work_added
	.comm	_todo_done,8,3                  ; @todo_done
	.comm	_todo_end,8,3                   ; @todo_end
	.comm	_cond_result,4,2                ; @cond_result
	.comm	_grep_mutex,4,2                 ; @grep_mutex
	.comm	_cond_add,4,2                   ; @cond_add
	.comm	_num_threads,4,2                ; @num_threads
	.comm	_threads,8,3                    ; @threads
	.comm	_grep_read_mutex,4,2            ; @grep_read_mutex
	.comm	_grep_attr_mutex,4,2            ; @grep_attr_mutex
	.comm	_cond_write,4,2                 ; @cond_write
	.comm	_grep_use_locks,8,3             ; @grep_use_locks
	.no_dead_strip	_wait_all
.subsections_via_symbols
