	.file	"extr_taskq.c_taskq_destroy.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	taskq_destroy
	.type	taskq_destroy, @function
taskq_destroy:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	lea	r12, 28[rbp]
	lea	r15, 24[rbp]
	lea	r13, 20[rbp]
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	eax, DWORD PTR [rdi]
	mov	DWORD PTR 12[rsp], eax
	call	taskq_wait@PLT
	mov	rdi, r12
	call	mutex_enter@PLT
	mov	eax, DWORD PTR TASKQ_ACTIVE[rip]
	mov	rdi, r15
	not	eax
	and	DWORD PTR 64[rbp], eax
	call	cv_broadcast@PLT
	mov	ecx, DWORD PTR 0[rbp]
	test	ecx, ecx
	je	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	mov	rsi, r12
	mov	rdi, r13
	call	cv_wait@PLT
	mov	edx, DWORD PTR 0[rbp]
	test	edx, edx
	jne	.L2
.L5:
	cmp	QWORD PTR 8[rbp], 0
	mov	QWORD PTR 56[rbp], 0
	je	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	xor	edi, edi
	cmp	QWORD PTR 48[rbp], 0
	setne	dil
	call	ASSERT@PLT
	mov	esi, DWORD PTR KM_SLEEP[rip]
	mov	rdi, rbp
	call	task_alloc@PLT
	mov	rdi, rbp
	mov	esi, eax
	call	task_free@PLT
	cmp	QWORD PTR 8[rbp], 0
	jne	.L3
.L4:
	mov	rdi, r12
	call	mutex_exit@PLT
	mov	eax, DWORD PTR 12[rsp]
	test	eax, eax
	jle	.L7
	mov	eax, DWORD PTR 12[rsp]
	xor	r14d, r14d
	sub	eax, 1
	lea	rbx, 9[rax+rax*8]
	sal	rbx, 3
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rax, QWORD PTR 40[rbp]
	sub	rsp, 8
	.cfi_def_cfa_offset 88
	xor	esi, esi
	xor	edi, edi
	push	QWORD PTR 64[rax+r14]
	.cfi_def_cfa_offset 96
	push	QWORD PTR 56[rax+r14]
	.cfi_def_cfa_offset 104
	push	QWORD PTR 48[rax+r14]
	.cfi_def_cfa_offset 112
	push	QWORD PTR 40[rax+r14]
	.cfi_def_cfa_offset 120
	push	QWORD PTR 32[rax+r14]
	.cfi_def_cfa_offset 128
	push	QWORD PTR 24[rax+r14]
	.cfi_def_cfa_offset 136
	push	QWORD PTR 16[rax+r14]
	.cfi_def_cfa_offset 144
	push	QWORD PTR 8[rax+r14]
	.cfi_def_cfa_offset 152
	push	QWORD PTR [rax+r14]
	.cfi_def_cfa_offset 160
	add	r14, 72
	call	thr_join@PLT
	add	rsp, 80
	.cfi_def_cfa_offset 80
	cmp	rbx, r14
	jne	.L8
.L7:
	mov	esi, DWORD PTR 12[rsp]
	mov	rdi, QWORD PTR 40[rbp]
	sal	esi, 2
	call	kmem_free@PLT
	lea	rdi, 32[rbp]
	call	rw_destroy@PLT
	mov	rdi, r12
	call	mutex_destroy@PLT
	mov	rdi, r15
	call	cv_destroy@PLT
	mov	rdi, r13
	call	cv_destroy@PLT
	lea	rdi, 16[rbp]
	call	cv_destroy@PLT
	add	rsp, 24
	.cfi_def_cfa_offset 56
	mov	rdi, rbp
	mov	esi, 72
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	jmp	kmem_free@PLT
	.cfi_endproc
.LFE0:
	.size	taskq_destroy, .-taskq_destroy
	.comm	TASKQ_ACTIVE,4,4
	.comm	KM_SLEEP,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_taskq.c_taskq_destroy.c"
	.text
	.align	2
	.global	taskq_destroy
	.syntax unified
	.arm
	.fpu softvfp
	.type	taskq_destroy, %function
taskq_destroy:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r8, r0
	mov	r4, r0
	mov	r9, r0
	ldr	r10, [r8], #20
	sub	sp, sp, #52
	bl	taskq_wait
	mov	r0, r8
	bl	mutex_enter
	ldr	r2, .L17
	ldr	r3, [r4, #40]
	ldr	r2, [r2]
	add	r0, r4, #16
	bic	r3, r3, r2
	str	r3, [r4, #40]
	str	r0, [sp, #44]
	bl	cv_broadcast
	ldr	r3, [r9], #12
	cmp	r3, #0
	beq	.L5
.L2:
	mov	r1, r8
	mov	r0, r9
	bl	cv_wait
	ldr	r3, [r4]
	cmp	r3, #0
	bne	.L2
.L5:
	mov	r2, #0
	ldr	r3, [r4, #4]
	str	r2, [r4, #36]
	cmp	r3, r2
	beq	.L4
	ldr	r5, .L17+4
.L3:
	ldr	r0, [r4, #32]
	subs	r0, r0, #0
	movne	r0, #1
	bl	ASSERT
	ldr	r1, [r5]
	mov	r0, r4
	bl	task_alloc
	mov	r1, r0
	mov	r0, r4
	bl	task_free
	ldr	r3, [r4, #4]
	cmp	r3, #0
	bne	.L3
.L4:
	mov	r0, r8
	bl	mutex_exit
	cmp	r10, #0
	movgt	r5, #0
	movgt	r6, r5
	movgt	r7, r5
	ble	.L7
.L6:
	mov	ip, sp
	ldr	fp, [r4, #28]
	str	r7, [sp, #32]
	add	fp, fp, r5
	str	r7, [sp, #28]
	add	lr, fp, #16
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1, r2}
	stm	ip, {r0, r1, r2}
	add	r6, r6, #1
	ldm	fp, {r0, r1, r2, r3}
	bl	thr_join
	cmp	r10, r6
	add	r5, r5, #44
	bne	.L6
.L7:
	lsl	r1, r10, #2
	ldr	r0, [r4, #28]
	bl	kmem_free
	add	r0, r4, #24
	bl	rw_destroy
	mov	r0, r8
	bl	mutex_destroy
	ldr	r0, [sp, #44]
	bl	cv_destroy
	mov	r0, r9
	bl	cv_destroy
	add	r0, r4, #8
	bl	cv_destroy
	mov	r0, r4
	mov	r1, #44
	add	sp, sp, #52
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	kmem_free
.L18:
	.align	2
.L17:
	.word	TASKQ_ACTIVE
	.word	KM_SLEEP
	.size	taskq_destroy, .-taskq_destroy
	.comm	TASKQ_ACTIVE,4,4
	.comm	KM_SLEEP,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
