	.file	"250936.c"
	.intel_syntax noprefix
	.text
	.globl	tasks
	.bss
	.align 4
	.type	tasks, @object
	.size	tasks, 4
tasks:
	.zero	4
	.globl	done
	.align 4
	.type	done, @object
	.size	done, 4
done:
	.zero	4
	.globl	lock
	.align 32
	.type	lock, @object
	.size	lock, 40
lock:
	.zero	40
	.section	.rodata
	.align 8
.LC0:
	.string	"\346\210\221\346\230\257\351\230\237\345\210\227\344\270\255\347\232\204\347\254\254 %d \344\270\252\344\273\273\345\212\241\357\274\214\347\216\260\345\234\250\350\242\253\346\211\247\350\241\214\357\274\201\n"
	.text
	.globl	dummy_task
	.type	dummy_task, @function
dummy_task:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR done[rip]
	add	eax, 1
	mov	DWORD PTR done[rip], eax
	lea	rdi, lock[rip]
	call	pthread_mutex_unlock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	dummy_task, .-dummy_task
	.section	.rodata
.LC1:
	.string	"the_stack_data/250936.c"
	.align 8
.LC2:
	.string	"(pool = threadpool_create(THREAD, QUEUE, 0)) != NULL"
	.align 8
.LC3:
	.string	"Pool started with %d threads and queue size of %d\n"
.LC4:
	.string	"Added %d tasks\n"
	.align 8
.LC5:
	.string	"threadpool_destroy(pool, 0) == 0"
.LC6:
	.string	"Did %d tasks\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	esi, 0
	lea	rdi, lock[rip]
	call	pthread_mutex_init@PLT
	mov	edx, 0
	mov	esi, 256
	mov	edi, 32
	call	threadpool_create
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L3
	lea	rcx, __PRETTY_FUNCTION__.0[rip]
	mov	edx, 82
	lea	rsi, .LC1[rip]
	lea	rdi, .LC2[rip]
	call	__assert_fail@PLT
.L3:
	mov	rax, QWORD PTR stderr[rip]
	mov	ecx, 256
	mov	edx, 32
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L4
.L5:
	lea	rdi, lock[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR tasks[rip]
	add	eax, 1
	mov	DWORD PTR tasks[rip], eax
	lea	rdi, lock[rip]
	call	pthread_mutex_unlock@PLT
.L4:
	mov	rax, QWORD PTR -8[rbp]
	mov	ecx, 0
	lea	rdx, tasks[rip]
	lea	rsi, dummy_task[rip]
	mov	rdi, rax
	call	threadpool_add
	test	eax, eax
	je	.L5
	mov	edx, DWORD PTR tasks[rip]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L6
.L7:
	mov	edi, 10000
	call	usleep@PLT
.L6:
	mov	edx, DWORD PTR tasks[rip]
	mov	eax, DWORD PTR done[rip]
	cmp	edx, eax
	jne	.L7
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	threadpool_destroy
	test	eax, eax
	je	.L8
	lea	rcx, __PRETTY_FUNCTION__.0[rip]
	mov	edx, 99
	lea	rsi, .LC1[rip]
	lea	rdi, .LC5[rip]
	call	__assert_fail@PLT
.L8:
	mov	edx, DWORD PTR done[rip]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.globl	threadpool_create
	.type	threadpool_create, @function
threadpool_create:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	DWORD PTR -24[rbp], esi
	mov	DWORD PTR -28[rbp], edx
	cmp	DWORD PTR -20[rbp], 0
	jle	.L11
	cmp	DWORD PTR -20[rbp], 64
	jg	.L11
	cmp	DWORD PTR -24[rbp], 0
	jle	.L11
	cmp	DWORD PTR -24[rbp], 65536
	jle	.L12
.L11:
	mov	eax, 0
	jmp	.L13
.L12:
	mov	edi, 136
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	je	.L22
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 104[rax], 0
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -24[rbp]
	mov	DWORD PTR 108[rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 120[rax], 0
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR 120[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 116[rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR 116[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 112[rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 128[rax], 0
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR 128[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 124[rax], edx
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 88[rax], rdx
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	sal	rax, 4
	mov	rdi, rax
	call	malloc@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 96[rax], rdx
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_mutex_init@PLT
	test	eax, eax
	jne	.L23
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 40
	mov	esi, 0
	mov	rdi, rax
	call	pthread_cond_init@PLT
	test	eax, eax
	jne	.L23
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 88[rax]
	test	rax, rax
	je	.L23
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 96[rax]
	test	rax, rax
	je	.L23
	mov	DWORD PTR -12[rbp], 0
	jmp	.L18
.L20:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR 88[rax]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 3
	lea	rdi, [rdx+rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rax
	lea	rdx, threadpool_thread[rip]
	mov	esi, 0
	call	pthread_create@PLT
	test	eax, eax
	je	.L19
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	threadpool_destroy
	mov	eax, 0
	jmp	.L13
.L19:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 104[rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 104[rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 128[rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 128[rax], edx
	add	DWORD PTR -12[rbp], 1
.L18:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	jl	.L20
	mov	rax, QWORD PTR -8[rbp]
	jmp	.L13
.L22:
	nop
	jmp	.L15
.L23:
	nop
.L15:
	cmp	QWORD PTR -8[rbp], 0
	je	.L21
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	threadpool_free
.L21:
	mov	eax, 0
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	threadpool_create, .-threadpool_create
	.globl	threadpool_add
	.type	threadpool_add, @function
threadpool_add:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	QWORD PTR -40[rbp], rdx
	mov	DWORD PTR -44[rbp], ecx
	mov	DWORD PTR -8[rbp], 0
	cmp	QWORD PTR -24[rbp], 0
	je	.L25
	cmp	QWORD PTR -32[rbp], 0
	jne	.L26
.L25:
	mov	eax, -1
	jmp	.L27
.L26:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	test	eax, eax
	je	.L28
	mov	eax, -2
	jmp	.L27
.L28:
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 116[rax]
	add	eax, 1
	mov	DWORD PTR -4[rbp], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 108[rax]
	cmp	DWORD PTR -4[rbp], eax
	je	.L29
	mov	eax, DWORD PTR -4[rbp]
	jmp	.L30
.L29:
	mov	eax, 0
.L30:
	mov	DWORD PTR -4[rbp], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, DWORD PTR 120[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 108[rax]
	cmp	edx, eax
	jne	.L31
	mov	DWORD PTR -8[rbp], -3
	jmp	.L32
.L31:
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 124[rax]
	test	eax, eax
	je	.L33
	mov	DWORD PTR -8[rbp], -4
	jmp	.L32
.L33:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 96[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 116[rax]
	cdqe
	sal	rax, 4
	add	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	mov	QWORD PTR [rdx], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 96[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 116[rax]
	cdqe
	sal	rax, 4
	add	rdx, rax
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR 8[rdx], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, DWORD PTR -4[rbp]
	mov	DWORD PTR 116[rax], edx
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 120[rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 120[rax], edx
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 40
	mov	rdi, rax
	call	pthread_cond_signal@PLT
	test	eax, eax
	je	.L32
	mov	DWORD PTR -8[rbp], -2
	nop
.L32:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	test	eax, eax
	je	.L34
	mov	DWORD PTR -8[rbp], -2
.L34:
	mov	eax, DWORD PTR -8[rbp]
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	threadpool_add, .-threadpool_add
	.globl	threadpool_destroy
	.type	threadpool_destroy, @function
threadpool_destroy:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -4[rbp], 0
	cmp	QWORD PTR -24[rbp], 0
	jne	.L36
	mov	eax, -1
	jmp	.L37
.L36:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	test	eax, eax
	je	.L38
	mov	eax, -2
	jmp	.L37
.L38:
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 124[rax]
	test	eax, eax
	je	.L39
	mov	DWORD PTR -4[rbp], -4
	jmp	.L40
.L39:
	mov	eax, DWORD PTR -28[rbp]
	and	eax, 1
	test	eax, eax
	je	.L41
	mov	edx, 2
	jmp	.L42
.L41:
	mov	edx, 1
.L42:
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 124[rax], edx
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 40
	mov	rdi, rax
	call	pthread_cond_broadcast@PLT
	test	eax, eax
	jne	.L43
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	test	eax, eax
	je	.L44
.L43:
	mov	DWORD PTR -4[rbp], -2
	jmp	.L40
.L44:
	mov	DWORD PTR -8[rbp], 0
	jmp	.L45
.L47:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 88[rax]
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	test	eax, eax
	je	.L46
	mov	DWORD PTR -4[rbp], -5
.L46:
	add	DWORD PTR -8[rbp], 1
.L45:
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 104[rax]
	cmp	DWORD PTR -8[rbp], eax
	jl	.L47
.L40:
	cmp	DWORD PTR -4[rbp], 0
	jne	.L48
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	threadpool_free
.L48:
	mov	eax, DWORD PTR -4[rbp]
.L37:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	threadpool_destroy, .-threadpool_destroy
	.globl	threadpool_free
	.type	threadpool_free, @function
threadpool_free:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	QWORD PTR -8[rbp], rdi
	cmp	QWORD PTR -8[rbp], 0
	je	.L50
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 128[rax]
	test	eax, eax
	jle	.L51
.L50:
	mov	eax, -1
	jmp	.L52
.L51:
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 88[rax]
	test	rax, rax
	je	.L53
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 88[rax]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 96[rax]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	pthread_mutex_destroy@PLT
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 40
	mov	rdi, rax
	call	pthread_cond_destroy@PLT
.L53:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
.L52:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	threadpool_free, .-threadpool_free
	.type	threadpool_thread, @function
threadpool_thread:
.LFB12:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -24[rbp], rax
.L62:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	jmp	.L55
.L57:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	add	rdx, 40
	mov	rsi, rax
	mov	rdi, rdx
	call	pthread_cond_wait@PLT
.L55:
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 120[rax]
	test	eax, eax
	jne	.L56
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 124[rax]
	test	eax, eax
	je	.L57
.L56:
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 124[rax]
	cmp	eax, 1
	je	.L58
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 124[rax]
	cmp	eax, 2
	jne	.L59
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 120[rax]
	test	eax, eax
	je	.L58
.L59:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 96[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 112[rax]
	cdqe
	sal	rax, 4
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 96[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 112[rax]
	cdqe
	sal	rax, 4
	add	rax, rdx
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 112[rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 112[rax], edx
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, DWORD PTR 112[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 108[rax]
	cmp	edx, eax
	je	.L60
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 112[rax]
	jmp	.L61
.L60:
	mov	eax, 0
.L61:
	mov	rdx, QWORD PTR -24[rbp]
	mov	DWORD PTR 112[rdx], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 120[rax]
	lea	edx, -1[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 120[rax], edx
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	rdx
	jmp	.L62
.L58:
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 128[rax]
	lea	edx, -1[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 128[rax], edx
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE12:
	.size	threadpool_thread, .-threadpool_thread
	.section	.rodata
	.type	__PRETTY_FUNCTION__.0, @object
	.size	__PRETTY_FUNCTION__.0, 5
__PRETTY_FUNCTION__.0:
	.string	"main"
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"250936.c"
	.text
	.global	tasks
	.bss
	.align	2
	.type	tasks, %object
	.size	tasks, 4
tasks:
	.space	4
	.global	done
	.align	2
	.type	done, %object
	.size	done, 4
done:
	.space	4
	.comm	lock,24,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"\346\210\221\346\230\257\351\230\237\345\210\227\344"
	.ascii	"\270\255\347\232\204\347\254\254 %d \344\270\252\344"
	.ascii	"\273\273\345\212\241\357\274\214\347\216\260\345\234"
	.ascii	"\250\350\242\253\346\211\247\350\241\214\357\274\201"
	.ascii	"\012\000"
	.text
	.align	2
	.global	dummy_task
	.syntax unified
	.arm
	.fpu softvfp
	.type	dummy_task, %function
dummy_task:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L2
	bl	printf
	ldr	r0, .L2+4
	bl	pthread_mutex_lock
	ldr	r3, .L2+8
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L2+8
	str	r3, [r2]
	ldr	r0, .L2+4
	bl	pthread_mutex_unlock
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L3:
	.align	2
.L2:
	.word	.LC0
	.word	lock
	.word	done
	.size	dummy_task, .-dummy_task
	.section	.rodata
	.align	2
.LC1:
	.ascii	"the_stack_data/250936.c\000"
	.align	2
.LC2:
	.ascii	"(pool = threadpool_create(THREAD, QUEUE, 0)) != NUL"
	.ascii	"L\000"
	.align	2
.LC3:
	.ascii	"Pool started with %d threads and queue size of %d\012"
	.ascii	"\000"
	.align	2
.LC4:
	.ascii	"Added %d tasks\012\000"
	.align	2
.LC5:
	.ascii	"threadpool_destroy(pool, 0) == 0\000"
	.align	2
.LC6:
	.ascii	"Did %d tasks\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	mov	r1, #0
	ldr	r0, .L12
	bl	pthread_mutex_init
	mov	r2, #0
	mov	r1, #256
	mov	r0, #32
	bl	threadpool_create
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L5
	ldr	r3, .L12+4
	mov	r2, #82
	ldr	r1, .L12+8
	ldr	r0, .L12+12
	bl	__assert_fail
.L5:
	ldr	r3, .L12+16
	ldr	r0, [r3]
	mov	r3, #256
	mov	r2, #32
	ldr	r1, .L12+20
	bl	fprintf
	b	.L6
.L7:
	ldr	r0, .L12
	bl	pthread_mutex_lock
	ldr	r3, .L12+24
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L12+24
	str	r3, [r2]
	ldr	r0, .L12
	bl	pthread_mutex_unlock
.L6:
	mov	r3, #0
	ldr	r2, .L12+24
	ldr	r1, .L12+28
	ldr	r0, [fp, #-8]
	bl	threadpool_add
	mov	r3, r0
	cmp	r3, #0
	beq	.L7
	ldr	r3, .L12+16
	ldr	r3, [r3]
	ldr	r2, .L12+24
	ldr	r2, [r2]
	ldr	r1, .L12+32
	mov	r0, r3
	bl	fprintf
	b	.L8
.L9:
	ldr	r0, .L12+36
	bl	usleep
.L8:
	ldr	r3, .L12+24
	ldr	r2, [r3]
	ldr	r3, .L12+40
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L9
	mov	r1, #0
	ldr	r0, [fp, #-8]
	bl	threadpool_destroy
	mov	r3, r0
	cmp	r3, #0
	beq	.L10
	ldr	r3, .L12+4
	mov	r2, #99
	ldr	r1, .L12+8
	ldr	r0, .L12+44
	bl	__assert_fail
.L10:
	ldr	r3, .L12+16
	ldr	r3, [r3]
	ldr	r2, .L12+40
	ldr	r2, [r2]
	ldr	r1, .L12+48
	mov	r0, r3
	bl	fprintf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L13:
	.align	2
.L12:
	.word	lock
	.word	__PRETTY_FUNCTION__.6298
	.word	.LC1
	.word	.LC2
	.word	stderr
	.word	.LC3
	.word	tasks
	.word	dummy_task
	.word	.LC4
	.word	10000
	.word	done
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.align	2
	.global	threadpool_create
	.syntax unified
	.arm
	.fpu softvfp
	.type	threadpool_create, %function
threadpool_create:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	ble	.L15
	ldr	r3, [fp, #-16]
	cmp	r3, #64
	bgt	.L15
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	ble	.L15
	ldr	r3, [fp, #-20]
	cmp	r3, #65536
	ble	.L16
.L15:
	mov	r3, #0
	b	.L17
.L16:
	mov	r0, #112
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L26
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3, #80]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-20]
	str	r2, [r3, #84]
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3, #96]
	ldr	r3, [fp, #-8]
	ldr	r2, [r3, #96]
	ldr	r3, [fp, #-8]
	str	r2, [r3, #92]
	ldr	r3, [fp, #-8]
	ldr	r2, [r3, #92]
	ldr	r3, [fp, #-8]
	str	r2, [r3, #88]
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3, #104]
	ldr	r3, [fp, #-8]
	ldr	r2, [r3, #104]
	ldr	r3, [fp, #-8]
	str	r2, [r3, #100]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-8]
	str	r2, [r3, #72]
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #3
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-8]
	str	r2, [r3, #76]
	ldr	r3, [fp, #-8]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_mutex_init
	mov	r3, r0
	cmp	r3, #0
	bne	.L27
	ldr	r3, [fp, #-8]
	add	r3, r3, #24
	mov	r1, #0
	mov	r0, r3
	bl	pthread_cond_init
	mov	r3, r0
	cmp	r3, #0
	bne	.L27
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #72]
	cmp	r3, #0
	beq	.L27
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #76]
	cmp	r3, #0
	beq	.L27
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L22
.L24:
	ldr	r3, [fp, #-8]
	ldr	r2, [r3, #72]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	add	r0, r2, r3
	ldr	r3, [fp, #-8]
	ldr	r2, .L28
	mov	r1, #0
	bl	pthread_create
	mov	r3, r0
	cmp	r3, #0
	beq	.L23
	mov	r1, #0
	ldr	r0, [fp, #-8]
	bl	threadpool_destroy
	mov	r3, #0
	b	.L17
.L23:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #80]
	add	r2, r3, #1
	ldr	r3, [fp, #-8]
	str	r2, [r3, #80]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #104]
	add	r2, r3, #1
	ldr	r3, [fp, #-8]
	str	r2, [r3, #104]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L22:
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	blt	.L24
	ldr	r3, [fp, #-8]
	b	.L17
.L26:
	nop
	b	.L19
.L27:
	nop
.L19:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L25
	ldr	r0, [fp, #-8]
	bl	threadpool_free
.L25:
	mov	r3, #0
.L17:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L29:
	.align	2
.L28:
	.word	threadpool_thread
	.size	threadpool_create, .-threadpool_create
	.align	2
	.global	threadpool_add
	.syntax unified
	.arm
	.fpu softvfp
	.type	threadpool_add, %function
threadpool_add:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	str	r3, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L31
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L32
.L31:
	mvn	r3, #0
	b	.L33
.L32:
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	pthread_mutex_lock
	mov	r3, r0
	cmp	r3, #0
	beq	.L34
	mvn	r3, #1
	b	.L33
.L34:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #92]
	add	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #84]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	beq	.L35
	ldr	r3, [fp, #-8]
	b	.L36
.L35:
	mov	r3, #0
.L36:
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #96]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #84]
	cmp	r2, r3
	bne	.L37
	mvn	r3, #2
	str	r3, [fp, #-12]
	b	.L38
.L37:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #100]
	cmp	r3, #0
	beq	.L39
	mvn	r3, #3
	str	r3, [fp, #-12]
	b	.L38
.L39:
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #76]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #92]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r2, [fp, #-20]
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #76]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #92]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r2, [fp, #-24]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-8]
	str	r2, [r3, #92]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #96]
	add	r2, r3, #1
	ldr	r3, [fp, #-16]
	str	r2, [r3, #96]
	ldr	r3, [fp, #-16]
	add	r3, r3, #24
	mov	r0, r3
	bl	pthread_cond_signal
	mov	r3, r0
	cmp	r3, #0
	beq	.L38
	mvn	r3, #1
	str	r3, [fp, #-12]
	nop
.L38:
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	pthread_mutex_unlock
	mov	r3, r0
	cmp	r3, #0
	beq	.L40
	mvn	r3, #1
	str	r3, [fp, #-12]
.L40:
	ldr	r3, [fp, #-12]
.L33:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	threadpool_add, .-threadpool_add
	.align	2
	.global	threadpool_destroy
	.syntax unified
	.arm
	.fpu softvfp
	.type	threadpool_destroy, %function
threadpool_destroy:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L42
	mvn	r3, #0
	b	.L43
.L42:
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	pthread_mutex_lock
	mov	r3, r0
	cmp	r3, #0
	beq	.L44
	mvn	r3, #1
	b	.L43
.L44:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #100]
	cmp	r3, #0
	beq	.L45
	mvn	r3, #3
	str	r3, [fp, #-8]
	b	.L46
.L45:
	ldr	r3, [fp, #-20]
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L47
	mov	r2, #2
	b	.L48
.L47:
	mov	r2, #1
.L48:
	ldr	r3, [fp, #-16]
	str	r2, [r3, #100]
	ldr	r3, [fp, #-16]
	add	r3, r3, #24
	mov	r0, r3
	bl	pthread_cond_broadcast
	mov	r3, r0
	cmp	r3, #0
	bne	.L49
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	pthread_mutex_unlock
	mov	r3, r0
	cmp	r3, #0
	beq	.L50
.L49:
	mvn	r3, #1
	str	r3, [fp, #-8]
	b	.L46
.L50:
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L51
.L53:
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #72]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	mov	r3, r0
	cmp	r3, #0
	beq	.L52
	mvn	r3, #4
	str	r3, [fp, #-8]
.L52:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L51:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #80]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L53
.L46:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L54
	ldr	r0, [fp, #-16]
	bl	threadpool_free
.L54:
	ldr	r3, [fp, #-8]
.L43:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	threadpool_destroy, .-threadpool_destroy
	.align	2
	.global	threadpool_free
	.syntax unified
	.arm
	.fpu softvfp
	.type	threadpool_free, %function
threadpool_free:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L56
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #104]
	cmp	r3, #0
	ble	.L57
.L56:
	mvn	r3, #0
	b	.L58
.L57:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #72]
	cmp	r3, #0
	beq	.L59
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #72]
	mov	r0, r3
	bl	free
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #76]
	mov	r0, r3
	bl	free
	ldr	r3, [fp, #-8]
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r3, [fp, #-8]
	mov	r0, r3
	bl	pthread_mutex_destroy
	ldr	r3, [fp, #-8]
	add	r3, r3, #24
	mov	r0, r3
	bl	pthread_cond_destroy
.L59:
	ldr	r0, [fp, #-8]
	bl	free
	mov	r3, #0
.L58:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	threadpool_free, .-threadpool_free
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	threadpool_thread, %function
threadpool_thread:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-16]
.L68:
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	pthread_mutex_lock
	b	.L61
.L63:
	ldr	r3, [fp, #-16]
	add	r3, r3, #24
	ldr	r2, [fp, #-16]
	mov	r1, r2
	mov	r0, r3
	bl	pthread_cond_wait
.L61:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #96]
	cmp	r3, #0
	bne	.L62
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #100]
	cmp	r3, #0
	beq	.L63
.L62:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #100]
	cmp	r3, #1
	beq	.L64
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #100]
	cmp	r3, #2
	bne	.L65
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #96]
	cmp	r3, #0
	beq	.L64
.L65:
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #76]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #88]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #76]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #88]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #88]
	add	r2, r3, #1
	ldr	r3, [fp, #-16]
	str	r2, [r3, #88]
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #88]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #84]
	cmp	r2, r3
	beq	.L66
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #88]
	b	.L67
.L66:
	mov	r3, #0
.L67:
	ldr	r2, [fp, #-16]
	str	r3, [r2, #88]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #96]
	sub	r2, r3, #1
	ldr	r3, [fp, #-16]
	str	r2, [r3, #96]
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-8]
	mov	r0, r2
	blx	r3
	b	.L68
.L64:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #104]
	sub	r2, r3, #1
	ldr	r3, [fp, #-16]
	str	r2, [r3, #104]
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	pthread_mutex_unlock
	mov	r0, #0
	bl	pthread_exit
	.size	threadpool_thread, .-threadpool_thread
	.section	.rodata
	.align	2
	.type	__PRETTY_FUNCTION__.6298, %object
	.size	__PRETTY_FUNCTION__.6298, 5
__PRETTY_FUNCTION__.6298:
	.ascii	"main\000"
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
