	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_work
_get_work:                              ## @get_work
	.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
	xorl	%eax, %eax
	callq	_grep_lock
	movq	_todo_start@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_todo_end@GOTPCREL(%rip), %r13
	movq	_all_work_added@GOTPCREL(%rip), %r15
	movq	(%r15), %rdx
	testq	%rdx, %rdx
	setne	%al
	cmpq	(%r13), %rbx
	sete	%cl
	jne	LBB0_5
## %bb.1:
	testq	%rdx, %rdx
	jne	LBB0_5
## %bb.2:
	movq	_cond_add@GOTPCREL(%rip), %r14
	movq	_grep_mutex@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_pthread_cond_wait
	movq	_todo_start@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	(%r15), %rdx
	testq	%rdx, %rdx
	setne	%al
	cmpq	(%r13), %rbx
	sete	%cl
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	testq	%rdx, %rdx
	je	LBB0_3
LBB0_5:
	testb	%cl, %cl
	je	LBB0_8
## %bb.6:
	testb	%al, %al
	je	LBB0_8
## %bb.7:
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_8:
	movq	_todo@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	leaq	1(%rbx), %r12
	movq	%r14, %rdi
	callq	_ARRAY_SIZE
	movq	%rax, %rcx
	orq	%r12, %rax
	shrq	$32, %rax
	je	LBB0_9
## %bb.10:
	movq	%r12, %rax
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_11
LBB0_9:
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
LBB0_11:
	leaq	(%r14,%rbx,4), %rbx
	movq	_todo_start@GOTPCREL(%rip), %rax
	movq	%rdx, (%rax)
LBB0_12:
	xorl	%eax, %eax
	callq	_grep_unlock
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_todo_start,8,3                 ## @todo_start
	.comm	_todo_end,8,3                   ## @todo_end
	.comm	_all_work_added,8,3             ## @all_work_added
	.comm	_cond_add,4,2                   ## @cond_add
	.comm	_grep_mutex,4,2                 ## @grep_mutex
	.comm	_todo,8,3                       ## @todo
	.no_dead_strip	_get_work
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_work
_get_work:                              ; @get_work
	.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
	bl	_grep_lock
Lloh0:
	adrp	x21, _todo_start@GOTPAGE
Lloh1:
	ldr	x21, [x21, _todo_start@GOTPAGEOFF]
	ldr	x8, [x21]
Lloh2:
	adrp	x22, _todo_end@GOTPAGE
Lloh3:
	ldr	x22, [x22, _todo_end@GOTPAGEOFF]
	ldr	x10, [x22]
Lloh4:
	adrp	x23, _all_work_added@GOTPAGE
Lloh5:
	ldr	x23, [x23, _all_work_added@GOTPAGEOFF]
	ldr	x11, [x23]
	cmp	x11, #0
	cset	w9, ne
	cmp	x8, x10
	cset	w10, eq
	ccmp	x11, #0, #0, eq
	b.ne	LBB0_3
; %bb.1:
Lloh6:
	adrp	x19, _cond_add@GOTPAGE
Lloh7:
	ldr	x19, [x19, _cond_add@GOTPAGEOFF]
Lloh8:
	adrp	x20, _grep_mutex@GOTPAGE
Lloh9:
	ldr	x20, [x20, _grep_mutex@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_pthread_cond_wait
	ldr	x8, [x21]
	ldr	x10, [x22]
	ldr	x11, [x23]
	cmp	x11, #0
	cset	w9, ne
	cmp	x8, x10
	cset	w10, eq
	ccmp	x11, #0, #0, eq
	b.eq	LBB0_2
LBB0_3:
	cbz	w10, LBB0_6
; %bb.4:
	tbz	w9, #0, LBB0_6
; %bb.5:
	mov	x19, #0
	b	LBB0_7
LBB0_6:
Lloh10:
	adrp	x9, _todo@GOTPAGE
Lloh11:
	ldr	x9, [x9, _todo@GOTPAGEOFF]
Lloh12:
	ldr	x0, [x9]
	add	x19, x0, x8, lsl #2
	add	x20, x8, #1
	bl	_ARRAY_SIZE
	udiv	x8, x20, x0
	msub	x8, x8, x0, x20
	str	x8, [x21]
LBB0_7:
	bl	_grep_unlock
	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
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_todo_start,8,3                 ; @todo_start
	.comm	_todo_end,8,3                   ; @todo_end
	.comm	_all_work_added,8,3             ; @all_work_added
	.comm	_cond_add,4,2                   ; @cond_add
	.comm	_grep_mutex,4,2                 ; @grep_mutex
	.comm	_todo,8,3                       ; @todo
	.no_dead_strip	_get_work
.subsections_via_symbols
