	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_taskq_destroy                  ## -- Begin function taskq_destroy
	.p2align	4, 0x90
_taskq_destroy:                         ## @taskq_destroy
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	(%rdi), %r15d
	callq	_taskq_wait
	leaq	28(%rbx), %r14
	movq	%r14, %rdi
	callq	_mutex_enter
	movq	_TASKQ_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 64(%rbx)
	leaq	24(%rbx), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_cv_broadcast
	cmpl	$0, (%rbx)
	je	LBB0_3
## %bb.1:
	leaq	20(%rbx), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_cv_wait
	cmpl	$0, (%rbx)
	jne	LBB0_2
LBB0_3:
	movq	$0, 56(%rbx)
	cmpq	$0, 8(%rbx)
	je	LBB0_6
## %bb.4:
	movq	_KM_SLEEP@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%edi, %edi
	cmpq	$0, 48(%rbx)
	setne	%dil
	callq	_ASSERT
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_task_alloc
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_task_free
	cmpq	$0, 8(%rbx)
	jne	LBB0_5
LBB0_6:
	movq	%r14, %rdi
	callq	_mutex_exit
	testl	%r15d, %r15d
	jle	LBB0_9
## %bb.7:
	leaq	(,%r15,8), %rax
	leaq	(%rax,%rax,8), %r13
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	40(%rbx), %rax
	movq	64(%rax,%r12), %rcx
	movq	%rcx, 64(%rsp)
	movups	(%rax,%r12), %xmm0
	movups	16(%rax,%r12), %xmm1
	movups	32(%rax,%r12), %xmm2
	movups	48(%rax,%r12), %xmm3
	movups	%xmm3, 48(%rsp)
	movups	%xmm2, 32(%rsp)
	movups	%xmm1, 16(%rsp)
	movups	%xmm0, (%rsp)
	xorl	%edi, %edi
	xorl	%esi, %esi
	callq	_thr_join
	addq	$72, %r12
	cmpq	%r12, %r13
	jne	LBB0_8
LBB0_9:
	movq	40(%rbx), %rdi
	shll	$2, %r15d
	movl	%r15d, %esi
	callq	_kmem_free
	leaq	32(%rbx), %rdi
	callq	_rw_destroy
	movq	%r14, %rdi
	callq	_mutex_destroy
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_cv_destroy
	leaq	20(%rbx), %rdi
	callq	_cv_destroy
	leaq	16(%rbx), %rdi
	callq	_cv_destroy
	movq	%rbx, %rdi
	movl	$72, %esi
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kmem_free                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_TASKQ_ACTIVE,4,2               ## @TASKQ_ACTIVE
	.comm	_KM_SLEEP,4,2                   ## @KM_SLEEP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_taskq_destroy                  ; -- Begin function taskq_destroy
	.p2align	2
_taskq_destroy:                         ; @taskq_destroy
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	ldr	w23, [x0]
	bl	_taskq_wait
	add	x20, x19, #28
	mov	x0, x20
	bl	_mutex_enter
Lloh0:
	adrp	x8, _TASKQ_ACTIVE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TASKQ_ACTIVE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19, #64]
	bic	w8, w9, w8
	str	w8, [x19, #64]
	add	x21, x19, #24
	mov	x0, x21
	bl	_cv_broadcast
	ldr	w8, [x19]
	cbz	w8, LBB0_3
; %bb.1:
	add	x22, x19, #20
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x20
	bl	_cv_wait
	ldr	w8, [x19]
	cbnz	w8, LBB0_2
LBB0_3:
	str	xzr, [x19, #56]
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_6
; %bb.4:
Lloh3:
	adrp	x22, _KM_SLEEP@GOTPAGE
Lloh4:
	ldr	x22, [x22, _KM_SLEEP@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #48]
	cmp	x8, #0
	cset	w0, ne
	bl	_ASSERT
	ldr	w1, [x22]
	mov	x0, x19
	bl	_task_alloc
	mov	x1, x0
	mov	x0, x19
	bl	_task_free
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_5
LBB0_6:
	mov	x0, x20
	bl	_mutex_exit
	cmp	w23, #1
	b.lt	LBB0_9
; %bb.7:
	mov	x22, #0
	add	x8, x23, x23, lsl #3
	lsl	x24, x8, #3
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #40]
	add	x8, x8, x22
	ldr	q0, [x8]
	str	q0, [sp]
	ldp	q0, q1, [x8, #16]
	ldr	q2, [x8, #48]
	ldr	x8, [x8, #64]
	str	x8, [sp, #64]
	stp	q1, q2, [sp, #32]
	str	q0, [sp, #16]
	mov	x0, sp
	mov	x1, #0
	mov	x2, #0
	bl	_thr_join
	add	x22, x22, #72
	cmp	x24, x22
	b.ne	LBB0_8
LBB0_9:
	ldr	x0, [x19, #40]
	lsl	w1, w23, #2
	bl	_kmem_free
	add	x0, x19, #32
	bl	_rw_destroy
	mov	x0, x20
	bl	_mutex_destroy
	mov	x0, x21
	bl	_cv_destroy
	add	x0, x19, #20
	bl	_cv_destroy
	add	x0, x19, #16
	bl	_cv_destroy
	mov	x0, x19
	mov	w1, #72
	bl	_kmem_free
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_TASKQ_ACTIVE,4,2               ; @TASKQ_ACTIVE
	.comm	_KM_SLEEP,4,2                   ; @KM_SLEEP
.subsections_via_symbols
