	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hb_work_loop                   ## -- Begin function hb_work_loop
	.p2align	4, 0x90
_hb_work_loop:                          ## @hb_work_loop
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	$0, -48(%rbp)
	movq	$0, -40(%rbp)
	movq	_HB_WORK_DONE@GOTPCREL(%rip), %r12
	leaq	-48(%rbp), %r14
	leaq	-40(%rbp), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_23 Depth 2
	movq	32(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$0, (%rax)
	jne	LBB0_9
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	24(%rbx), %rax
	cmpq	$0, (%rax)
	jne	LBB0_9
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%rbx), %rax
	cmpq	(%r12), %rax
	je	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	16(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_18
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	callq	_hb_fifo_get_wait
	movq	%rax, -48(%rbp)
	testq	%rax, %rax
	je	LBB0_1
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	24(%rbx), %rax
	cmpq	$0, (%rax)
	jne	LBB0_8
LBB0_18:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	$0, -40(%rbp)
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	*8(%rbx)
	movq	%rax, (%rbx)
	movq	-40(%rbp), %rdi
	movq	-48(%rbp), %rsi
	callq	_copy_chapter
	cmpq	$0, -48(%rbp)
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	%r14, %rdi
	callq	_hb_buffer_close
LBB0_20:                                ##   in Loop: Header=BB0_1 Depth=1
	cmpq	$0, -40(%rbp)
	je	LBB0_26
## %bb.21:                              ##   in Loop: Header=BB0_1 Depth=1
	cmpq	$0, 48(%rbx)
	jne	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	%r15, %rdi
	callq	_hb_buffer_close
	cmpq	$0, -40(%rbp)
	je	LBB0_26
	.p2align	4, 0x90
LBB0_23:                                ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	24(%rbx), %rax
	cmpq	$0, (%rax)
	jne	LBB0_1
## %bb.24:                              ##   in Loop: Header=BB0_23 Depth=2
	movq	48(%rbx), %rdi
	callq	_hb_fifo_full_wait
	testq	%rax, %rax
	je	LBB0_23
## %bb.25:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	48(%rbx), %rdi
	movq	-40(%rbp), %rsi
	callq	_hb_fifo_push
	movq	$0, -40(%rbp)
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_1 Depth=1
	cmpq	$0, 16(%rbx)
	jne	LBB0_1
## %bb.27:                              ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
	callq	_hb_yield
	jmp	LBB0_1
LBB0_8:
	leaq	-48(%rbp), %rdi
	callq	_hb_buffer_close
LBB0_9:
	cmpq	$0, -40(%rbp)
	je	LBB0_11
## %bb.10:
	leaq	-40(%rbp), %rdi
	callq	_hb_buffer_close
LBB0_11:
	movl	40(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	movl	$3, %edi
	callq	_hb_deep_log
	leaq	-48(%rbp), %r14
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	cmpl	$0, (%rax)
	jne	LBB0_28
LBB0_14:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	24(%rbx), %rax
	cmpq	$0, (%rax)
	jne	LBB0_28
## %bb.15:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	16(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_28
## %bb.16:                              ##   in Loop: Header=BB0_12 Depth=1
	callq	_hb_fifo_get_wait
	movq	%rax, -48(%rbp)
	testq	%rax, %rax
	je	LBB0_12
## %bb.17:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	%r14, %rdi
	callq	_hb_buffer_close
	jmp	LBB0_12
LBB0_28:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HB_WORK_DONE,8,3               ## @HB_WORK_DONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"worker %s waiting to die"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hb_work_loop                   ; -- Begin function hb_work_loop
	.p2align	2
_hb_work_loop:                          ; @hb_work_loop
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	stp	xzr, xzr, [sp]
Lloh0:
	adrp	x20, _HB_WORK_DONE@GOTPAGE
Lloh1:
	ldr	x20, [x20, _HB_WORK_DONE@GOTPAGEOFF]
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_13 Depth 2
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [x8]
	cbnz	w8, LBB0_19
LBB0_3:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	cbnz	x8, LBB0_19
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x19]
	ldr	x9, [x20]
	cmp	x8, x9
	b.eq	LBB0_19
; %bb.5:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_1 Depth=1
	bl	_hb_fifo_get_wait
	str	x0, [sp, #8]
	cbz	x0, LBB0_1
; %bb.7:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	cbnz	x8, LBB0_18
LBB0_8:                                 ;   in Loop: Header=BB0_1 Depth=1
	str	xzr, [sp]
	ldr	x8, [x19, #8]
	add	x1, sp, #8
	mov	x2, sp
	mov	x0, x19
	blr	x8
	str	x0, [x19]
	ldp	x0, x1, [sp]
	bl	_copy_chapter
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_1 Depth=1
	add	x0, sp, #8
	bl	_hb_buffer_close
LBB0_10:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [sp]
	cbz	x8, LBB0_16
; %bb.11:                               ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x19, #48]
	cbnz	x8, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, sp
	bl	_hb_buffer_close
	ldr	x8, [sp]
	cbz	x8, LBB0_16
LBB0_13:                                ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	cbnz	x8, LBB0_1
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=2
	ldr	x0, [x19, #48]
	bl	_hb_fifo_full_wait
	cbz	x0, LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_1 Depth=1
	ldr	x0, [x19, #48]
	ldr	x1, [sp]
	bl	_hb_fifo_push
	str	xzr, [sp]
	b	LBB0_1
LBB0_16:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x19, #16]
	cbnz	x8, LBB0_1
; %bb.17:                               ;   in Loop: Header=BB0_1 Depth=1
	bl	_hb_yield
	b	LBB0_1
LBB0_18:
	add	x0, sp, #8
	bl	_hb_buffer_close
LBB0_19:
	ldr	x8, [sp]
	cbz	x8, LBB0_21
; %bb.20:
	mov	x0, sp
	bl	_hb_buffer_close
LBB0_21:
	ldr	w2, [x19, #40]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #3
	bl	_hb_deep_log
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_24
; %bb.23:                               ;   in Loop: Header=BB0_22 Depth=1
	ldr	w8, [x8]
	cbnz	w8, LBB0_28
LBB0_24:                                ;   in Loop: Header=BB0_22 Depth=1
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	cbnz	x8, LBB0_28
; %bb.25:                               ;   in Loop: Header=BB0_22 Depth=1
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_28
; %bb.26:                               ;   in Loop: Header=BB0_22 Depth=1
	bl	_hb_fifo_get_wait
	str	x0, [sp, #8]
	cbz	x0, LBB0_22
; %bb.27:                               ;   in Loop: Header=BB0_22 Depth=1
	add	x0, sp, #8
	bl	_hb_buffer_close
	b	LBB0_22
LBB0_28:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_HB_WORK_DONE,8,3               ; @HB_WORK_DONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"worker %s waiting to die"

.subsections_via_symbols
