	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function worker
_worker:                                ## @worker
	.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	_NUM_CHUNKS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_11
## %bb.1:
	movq	%rdi, %r14
	movslq	(%rdi), %r15
	leal	-1(%r15), %r13d
	xorl	%r12d, %r12d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%r12
	movq	_NUM_CHUNKS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %r12
	jge	LBB0_11
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rdi
	movq	(%rdi), %rax
	movslq	(%rax,%r12,4), %rbx
	testl	%r15d, %r15d
	jle	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_chunk_sems@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(,%rbx,4), %rdi
	addq	(%rax,%r13,8), %rdi
	callq	_sem_wait
	cmpl	$-1, %eax
	je	LBB0_12
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r14), %rdi
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, %esi
	movl	%r15d, %edx
	callq	_write_chunk
	testb	$1, %r15b
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_outfd@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_my_sync
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_NUM_THREADS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	decl	%eax
	cmpl	%eax, %r15d
	jge	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_chunk_sems@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	shlq	$2, %rbx
	addq	(%rax,%r15,8), %rbx
	movq	%rbx, %rdi
	callq	_sem_post
	cmpl	$-1, %eax
	jne	LBB0_10
## %bb.9:
	callq	_worker.cold.2
	jmp	LBB0_11
LBB0_12:
	callq	_worker.cold.1
LBB0_11:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function worker.cold.1
_worker.cold.1:                         ## @worker.cold.1
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	leaq	L_.str(%rip), %rdi
	callq	_perror
	pushq	$1
	popq	%rdi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function worker.cold.2
_worker.cold.2:                         ## @worker.cold.2
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	leaq	L_.str.1(%rip), %rdi
	callq	_perror
	pushq	$1
	popq	%rdi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_NUM_CHUNKS,4,2                 ## @NUM_CHUNKS
	.comm	_chunk_sems,8,3                 ## @chunk_sems
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sem_wait"

	.comm	_outfd,4,2                      ## @outfd
	.comm	_NUM_THREADS,4,2                ## @NUM_THREADS
L_.str.1:                               ## @.str.1
	.asciz	"sem_post"

	.no_dead_strip	_worker
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function worker
_worker:                                ; @worker
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x22, _NUM_CHUNKS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _NUM_CHUNKS@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.1:
	mov	x19, x0
	mov	x23, #0
	ldrsw	x20, [x0]
	sub	w24, w20, #1
Lloh2:
	adrp	x25, _chunk_sems@GOTPAGE
Lloh3:
	ldr	x25, [x25, _chunk_sems@GOTPAGEOFF]
Lloh4:
	adrp	x26, _outfd@GOTPAGE
Lloh5:
	ldr	x26, [x26, _outfd@GOTPAGEOFF]
Lloh6:
	adrp	x27, _NUM_THREADS@GOTPAGE
Lloh7:
	ldr	x27, [x27, _NUM_THREADS@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x22]
	cmp	x23, x8
	b.ge	LBB0_11
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19, #8]
	ldr	x8, [x0]
	ldrsw	x21, [x8, x23, lsl #2]
	cmp	w20, #1
	b.lt	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x25]
	ldr	x8, [x8, x24, lsl #3]
	add	x0, x8, x21, lsl #2
	bl	_sem_wait
	cmn	w0, #1
	b.eq	LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [x19, #8]
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x1, x21
	mov	x2, x20
	bl	_write_chunk
	tbnz	w20, #0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x26]
	bl	_my_sync
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x27]
	sub	w8, w8, #1
	cmp	w20, w8
	b.ge	LBB0_2
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x25]
	ldr	x8, [x8, x20, lsl #3]
	add	x0, x8, x21, lsl #2
	bl	_sem_post
	cmn	w0, #1
	b.ne	LBB0_2
; %bb.10:
	bl	_worker.cold.2
LBB0_11:
	mov	x0, #0
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_12:
	bl	_worker.cold.1
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function worker.cold.1
_worker.cold.1:                         ; @worker.cold.1
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_perror
	mov	w0, #1
	bl	_exit
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function worker.cold.2
_worker.cold.2:                         ; @worker.cold.2
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_perror
	mov	w0, #1
	bl	_exit
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_NUM_CHUNKS,4,2                 ; @NUM_CHUNKS
	.comm	_chunk_sems,8,3                 ; @chunk_sems
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sem_wait"

	.comm	_outfd,4,2                      ; @outfd
	.comm	_NUM_THREADS,4,2                ; @NUM_THREADS
l_.str.1:                               ; @.str.1
	.asciz	"sem_post"

	.no_dead_strip	_worker
.subsections_via_symbols
