	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function worker_runphase1
_worker_runphase1:                      ## @worker_runphase1
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	leaq	16(%rdi), %r15
	leaq	44(%rdi), %r14
	leaq	32(%rdi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_pthread_mutex_unlock
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
	movq	%r15, %rdi
	callq	_pthread_mutex_lock
	.p2align	4, 0x90
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	40(%rbx), %edi
	callq	_fifo_empty
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=2
	cmpl	$1, (%rbx)
	je	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=2
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_pthread_cond_wait
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	40(%rbx), %edi
	callq	_fifo_remove
	movq	%rax, %r13
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	36(%rbx), %r12d
	leal	1(%r12), %eax
	movl	%eax, 36(%rbx)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_pthread_cond_broadcast
	xorl	%edi, %edi
	testq	%r13, %r13
	setne	%dil
	callq	_assert
	movl	%r12d, %eax
	cltd
	idivl	4(%rbx)
	movq	24(%rbx), %r13
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movslq	%edx, %r12
	shlq	$4, %r12
	leaq	(%r12,%r13), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	(%r12,%r13), %rdi
	addq	$8, %rdi
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	callq	_pthread_mutex_lock
	movq	%r15, %rdi
	callq	_pthread_mutex_unlock
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_wip_add_work
	movq	(%r13,%r12), %rax
	cmpq	8(%rbx), %rax
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_wip_save_work
	jmp	LBB0_7
LBB0_8:
	movq	%r14, %rdi
	callq	_pthread_cond_broadcast
	movq	%r15, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pthread_mutex_unlock           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_worker_runphase1
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function worker_runphase1
_worker_runphase1:                      ; @worker_runphase1
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x0
	add	x19, x0, #16
	add	x21, x0, #44
	add	x22, x0, #32
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x23
	bl	_pthread_mutex_unlock
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_3 Depth 2
	mov	x0, x19
	bl	_pthread_mutex_lock
LBB0_3:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w0, [x20, #40]
	bl	_fifo_empty
	cbz	x0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=2
	ldr	w8, [x20]
	cmp	w8, #1
	b.eq	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=2
	mov	x0, x21
	mov	x1, x19
	bl	_pthread_cond_wait
	b	LBB0_3
LBB0_6:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x20, #40]
	bl	_fifo_remove
	mov	x26, x0
	ldr	w23, [x20, #36]
	add	w8, w23, #1
	str	w8, [x20, #36]
	mov	x0, x22
	bl	_pthread_cond_broadcast
	cmp	x26, #0
	cset	w0, ne
	bl	_assert
	ldr	w8, [x20, #4]
	sdiv	w9, w23, w8
	msub	w24, w9, w8, w23
	ldr	x8, [x20, #24]
	add	x25, x8, w24, sxtw #4
	add	x23, x25, #8
	mov	x0, x23
	bl	_pthread_mutex_lock
	mov	x0, x19
	bl	_pthread_mutex_unlock
	mov	x0, x25
	mov	x1, x26
	bl	_wip_add_work
	ldr	x8, [x25]
	ldr	x9, [x20, #8]
	cmp	x8, x9
	b.ne	LBB0_1
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x20
	mov	x1, x25
	mov	x2, x24
	bl	_wip_save_work
	b	LBB0_1
LBB0_8:
	mov	x0, x21
	bl	_pthread_cond_broadcast
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_pthread_mutex_unlock
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_worker_runphase1
.subsections_via_symbols
