	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wait_for_tasks
_wait_for_tasks:                        ## @wait_for_tasks
	.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	%rdi, %r12
	xorl	%eax, %eax
	callq	_get_nsecs
	movl	%eax, 48(%r12)
	movl	$0, (%r12)
	leaq	44(%r12), %r14
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	cmpq	$0, 8(%r12)
	je	LBB0_3
## %bb.1:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%r12), %rax
	movq	(%rax,%rbx,8), %r15
	addq	$28, %r15
	movq	%r15, %rdi
	callq	_sem_wait
	movq	%rax, %rdi
	callq	_BUG_ON
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_sem_init
	incq	%rbx
	cmpq	8(%r12), %rbx
	jb	LBB0_2
LBB0_3:
	movq	%r14, %rdi
	callq	_pthread_mutex_lock
	movq	%rax, %rdi
	callq	_BUG_ON
	xorl	%eax, %eax
	callq	_get_cpu_usage_nsec_parent
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leaq	40(%r12), %r14
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	cmpq	$0, 8(%r12)
	je	LBB0_6
## %bb.4:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%r12), %rax
	movq	(%rax,%rbx,8), %r15
	leaq	24(%r15), %r13
	movq	%r13, %rdi
	callq	_sem_wait
	movq	%rax, %rdi
	callq	_BUG_ON
	movq	%r13, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_sem_init
	movl	16(%r15), %eax
	addl	%eax, (%r12)
	movq	$0, 16(%r15)
	incq	%rbx
	cmpq	8(%r12), %rbx
	jb	LBB0_5
LBB0_6:
	xorl	%eax, %eax
	callq	_get_cpu_usage_nsec_parent
	movl	(%r12), %ecx
	movl	16(%r12), %edx
	testl	%edx, %edx
	cmovel	%ecx, %edx
	leal	(%rdx,%rdx,8), %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	imulq	$1717986919, %rcx, %rcx         ## imm = 0x66666667
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$34, %rcx
	addl	%edx, %ecx
	movl	%ecx, 16(%r12)
	subl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	movl	%eax, 20(%r12)
	movl	24(%r12), %ecx
	testl	%ecx, %ecx
	cmovel	%eax, %ecx
	leal	(%rcx,%rcx,8), %ecx
	addl	%eax, %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax         ## imm = 0x66666667
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$34, %rax
	addl	%ecx, %eax
	movl	%eax, 24(%r12)
	movq	%r14, %rdi
	callq	_pthread_mutex_lock
	movq	%rax, %rdi
	callq	_BUG_ON
	cmpq	$0, 8(%r12)
	je	LBB0_9
## %bb.7:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%r12), %rax
	movq	(%rax,%rbx,8), %r14
	leaq	8(%r14), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_sem_init
	movq	$0, (%r14)
	incq	%rbx
	cmpq	8(%r12), %rbx
	jb	LBB0_8
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_wait_for_tasks
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wait_for_tasks
_wait_for_tasks:                        ; @wait_for_tasks
	.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
	mov	x19, x0
	bl	_get_nsecs
	str	w0, [x19, #48]
	str	wzr, [x19]
	add	x20, x19, #44
	mov	x0, x20
	bl	_pthread_mutex_unlock
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x22, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #32]
	ldr	x8, [x8, x22, lsl #3]
	add	x21, x8, #28
	mov	x0, x21
	bl	_sem_wait
	bl	_BUG_ON
	mov	x0, x21
	mov	w1, #0
	mov	w2, #0
	bl	_sem_init
	add	x22, x22, #1
	ldr	x8, [x19, #8]
	cmp	x22, x8
	b.lo	LBB0_2
LBB0_3:
	mov	x0, x20
	bl	_pthread_mutex_lock
	bl	_BUG_ON
	bl	_get_cpu_usage_nsec_parent
	mov	x21, x0
	add	x20, x19, #40
	mov	x0, x20
	bl	_pthread_mutex_unlock
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_6
; %bb.4:
	mov	x23, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #32]
	ldr	x24, [x8, x23, lsl #3]
	add	x22, x24, #24
	mov	x0, x22
	bl	_sem_wait
	bl	_BUG_ON
	mov	x0, x22
	mov	w1, #0
	mov	w2, #0
	bl	_sem_init
	ldr	w8, [x24, #16]
	ldr	w9, [x19]
	add	w8, w9, w8
	str	w8, [x19]
	str	xzr, [x24, #16]
	add	x23, x23, #1
	ldr	x8, [x19, #8]
	cmp	x23, x8
	b.lo	LBB0_5
LBB0_6:
	bl	_get_cpu_usage_nsec_parent
	ldr	w8, [x19, #16]
	ldr	w9, [x19]
	cmp	w8, #0
	csel	w8, w9, w8, eq
	add	w8, w8, w8, lsl #3
	add	w8, w8, w9
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	smull	x8, w8, w9
	lsr	x10, x8, #63
	asr	x8, x8, #34
	add	w8, w8, w10
	sub	w10, w0, w21
	ldr	w11, [x19, #24]
	cmp	w11, #0
	csel	w11, w10, w11, eq
	add	w11, w11, w11, lsl #3
	add	w11, w11, w10
	stp	w8, w10, [x19, #16]
	smull	x8, w11, w9
	lsr	x9, x8, #63
	asr	x8, x8, #34
	add	w8, w8, w9
	str	w8, [x19, #24]
	mov	x0, x20
	bl	_pthread_mutex_lock
	bl	_BUG_ON
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_9
; %bb.7:
	mov	x20, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #32]
	ldr	x21, [x8, x20, lsl #3]
	add	x0, x21, #8
	mov	w1, #0
	mov	w2, #0
	bl	_sem_init
	str	xzr, [x21]
	add	x20, x20, #1
	ldr	x8, [x19, #8]
	cmp	x20, x8
	b.lo	LBB0_8
LBB0_9:
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_wait_for_tasks
.subsections_via_symbols
