	.file	"581495.c"
	.intel_syntax noprefix
	.text
	.data
	.align 4
	.type	cnt_task, @object
	.size	cnt_task, 4
cnt_task:
	.long	9
	.globl	task_done
	.bss
	.align 32
	.type	task_done, @object
	.size	task_done, 40
task_done:
	.zero	40
	.section	.rodata
.LC0:
	.string	"WTF?"
.LC1:
	.string	"Remaining task(s): %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	esi, 0
	lea	rdi, task_done[rip]
	call	pthread_mutex_init@PLT
	lea	rax, -16[rbp]
	mov	ecx, 0
	lea	rdx, boss[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	je	.L2
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
	jmp	.L4
.L2:
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	lea	rdi, task_done[rip]
	call	pthread_mutex_lock@PLT
	lea	rdi, task_done[rip]
	call	pthread_mutex_unlock@PLT
	mov	eax, DWORD PTR cnt_task[rip]
	mov	DWORD PTR -24[rbp], eax
	mov	eax, DWORD PTR -24[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
.L4:
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
.LC2:
	.string	"[%s] working...\n"
	.text
	.globl	do_job
	.type	do_job, @function
do_job:
.LFB1:
	.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 fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -16[rbp], 1
	mov	eax, DWORD PTR -16[rbp]
	neg	eax
	mov	edx, eax
	mov	eax, edx
	lock xadd	DWORD PTR cnt_task[rip], eax
	add	eax, edx
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	test	eax, eax
	jne	.L7
	lea	rdi, task_done[rip]
	call	pthread_mutex_unlock@PLT
.L7:
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	do_job, .-do_job
	.section	.rodata
.LC3:
	.string	"[%s] So long suckers!\n"
	.text
	.globl	go_home
	.type	go_home, @function
go_home:
.LFB2:
	.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
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	go_home, .-go_home
	.section	.rodata
.LC4:
	.string	"worker"
.LC5:
	.string	"%s%d"
	.text
	.globl	worker
	.type	worker, @function
worker:
.LFB3:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 64
	mov	QWORD PTR -56[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -56[rbp]
	mov	edx, eax
	lea	rax, -32[rbp]
	mov	ecx, edx
	lea	rdx, .LC4[rip]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	mov	DWORD PTR -36[rbp], 0
	jmp	.L11
.L12:
	mov	edi, 1
	call	sleep@PLT
	lea	rax, -32[rbp]
	mov	rdi, rax
	call	do_job
	add	DWORD PTR -36[rbp], 1
.L11:
	cmp	DWORD PTR -36[rbp], 2
	jle	.L12
	mov	edi, 0
	call	sleep@PLT
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE3:
	.size	worker, .-worker
	.section	.rodata
.LC6:
	.string	"like a boss"
	.text
	.globl	boss
	.type	boss, @function
boss:
.LFB4:
	.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 fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdi, task_done[rip]
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR -24[rbp], 0
	jmp	.L15
.L18:
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	mov	rdx, rax
	lea	rax, -16[rbp]
	mov	rcx, rdx
	lea	rdx, worker[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	je	.L16
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, -1
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L19
	jmp	.L20
.L16:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	pthread_detach@PLT
	add	DWORD PTR -24[rbp], 1
.L15:
	cmp	DWORD PTR -24[rbp], 2
	jle	.L18
	lea	rdi, .LC6[rip]
	call	go_home
	mov	edi, 0
	call	pthread_exit@PLT
.L20:
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	boss, .-boss
	.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	"581495.c"
	.text
	.data
	.align	2
	.type	cnt_task, %object
	.size	cnt_task, 4
cnt_task:
	.word	9
	.comm	task_done,24,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"WTF?\000"
	.global	__sync_synchronize
	.align	2
.LC1:
	.ascii	"Remaining task(s): %d\012\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #28
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, .L6
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r1, #0
	ldr	r0, .L6+4
	bl	pthread_mutex_init
	sub	r0, fp, #28
	mov	r3, #0
	ldr	r2, .L6+8
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L2
	ldr	r0, .L6+12
	bl	printf
	mvn	r3, #0
	b	.L4
.L2:
	ldr	r3, [fp, #-28]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r0, .L6+4
	bl	pthread_mutex_lock
	ldr	r0, .L6+4
	bl	pthread_mutex_unlock
	ldr	r4, .L6+16
	bl	__sync_synchronize
	ldr	r4, [r4]
	bl	__sync_synchronize
	mov	r3, r4
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	mov	r1, r3
	ldr	r0, .L6+20
	bl	printf
	mov	r3, #0
.L4:
	ldr	r2, .L6
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L5
	bl	__stack_chk_fail
.L5:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L7:
	.align	2
.L6:
	.word	.LC2
	.word	task_done
	.word	boss
	.word	.LC0
	.word	cnt_task
	.word	.LC1
	.size	main, .-main
	.global	__sync_sub_and_fetch_4
	.section	.rodata
	.align	2
.LC3:
	.ascii	"[%s] working...\012\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	do_job
	.syntax unified
	.arm
	.fpu softvfp
	.type	do_job, %function
do_job:
	@ 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, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #1
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	mov	r2, r3
	ldr	r3, .L11+4
	mov	r1, r2
	mov	r0, r3
	bl	__sync_sub_and_fetch_4
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L9
	ldr	r0, .L11+8
	bl	pthread_mutex_unlock
.L9:
	ldr	r1, [fp, #-24]
	ldr	r0, .L11+12
	bl	printf
	nop
	ldr	r3, .L11
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L10
	bl	__stack_chk_fail
.L10:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC4
	.word	cnt_task
	.word	task_done
	.word	.LC3
	.size	do_job, .-do_job
	.section	.rodata
	.align	2
.LC5:
	.ascii	"[%s] So long suckers!\012\000"
	.text
	.align	2
	.global	go_home
	.syntax unified
	.arm
	.fpu softvfp
	.type	go_home, %function
go_home:
	@ 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	r1, [fp, #-8]
	ldr	r0, .L14
	bl	printf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC5
	.size	go_home, .-go_home
	.section	.rodata
	.align	2
.LC6:
	.ascii	"worker\000"
	.align	2
.LC7:
	.ascii	"%s%d\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	worker
	.syntax unified
	.arm
	.fpu softvfp
	.type	worker, %function
worker:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-40]
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-40]
	sub	r0, fp, #28
	ldr	r2, .L20+4
	ldr	r1, .L20+8
	bl	sprintf
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L17
.L18:
	mov	r0, #1
	bl	sleep
	sub	r3, fp, #28
	mov	r0, r3
	bl	do_job
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L17:
	ldr	r3, [fp, #-32]
	cmp	r3, #2
	ble	.L18
	mov	r0, #0
	bl	sleep
	mov	r0, #0
	bl	pthread_exit
.L21:
	.align	2
.L20:
	.word	.LC8
	.word	.LC6
	.word	.LC7
	.size	worker, .-worker
	.section	.rodata
	.align	2
.LC9:
	.ascii	"like a boss\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	boss
	.syntax unified
	.arm
	.fpu softvfp
	.type	boss, %function
boss:
	@ 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, .L29
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, .L29+4
	bl	pthread_mutex_lock
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L23
.L26:
	ldr	r3, [fp, #-16]
	sub	r0, fp, #20
	ldr	r2, .L29+8
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L24
	ldr	r0, .L29+12
	bl	printf
	mvn	r3, #0
	ldr	r2, .L29
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L27
	b	.L28
.L24:
	ldr	r3, [fp, #-20]
	mov	r0, r3
	bl	pthread_detach
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L23:
	ldr	r3, [fp, #-16]
	cmp	r3, #2
	ble	.L26
	ldr	r0, .L29+16
	bl	go_home
	mov	r0, #0
	bl	pthread_exit
.L28:
	bl	__stack_chk_fail
.L27:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L30:
	.align	2
.L29:
	.word	.LC10
	.word	task_done
	.word	worker
	.word	.LC0
	.word	.LC9
	.size	boss, .-boss
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
