	.file	"839716.c"
	.intel_syntax noprefix
	.text
	.local	worms
	.comm	worms,4,4
	.local	empty
	.comm	empty,32,32
	.local	any
	.comm	any,32,32
	.local	lock
	.comm	lock,40,32
	.section	.rodata
	.align 8
.LC0:
	.string	" + parent bird brings %d worms\n\n"
	.text
	.globl	parent_bird
	.type	parent_bird, @function
parent_bird:
.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
.L4:
	lea	rdi, empty[rip]
	call	sem_wait@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR worms[rip], 13
	mov	eax, DWORD PTR worms[rip]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_unlock@PLT
	mov	DWORD PTR -4[rbp], 0
	jmp	.L2
.L3:
	lea	rdi, any[rip]
	call	sem_post@PLT
	add	DWORD PTR -4[rbp], 1
.L2:
	cmp	DWORD PTR -4[rbp], 12
	jle	.L3
	jmp	.L4
	.cfi_endproc
.LFE6:
	.size	parent_bird, .-parent_bird
	.section	.rodata
	.align 8
.LC1:
	.string	" - baby bird %d eats (dish: %d worms)\n"
	.align 8
.LC2:
	.string	" - baby bird %d eats (dish: %d worms) and screams\n\n"
	.text
	.globl	baby_bird
	.type	baby_bird, @function
baby_bird:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
.L8:
	call	rand@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 1045477589
	shr	rdx, 32
	sar	edx, 17
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	imul	ecx, edx, 538462
	sub	eax, ecx
	mov	edx, eax
	mov	eax, edx
	mov	edi, eax
	call	usleep@PLT
	lea	rdi, any[rip]
	call	sem_wait@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR worms[rip]
	sub	eax, 1
	mov	DWORD PTR worms[rip], eax
	mov	eax, DWORD PTR worms[rip]
	test	eax, eax
	je	.L6
	mov	eax, DWORD PTR worms[rip]
	mov	rdx, QWORD PTR -8[rbp]
	mov	ecx, edx
	mov	edx, eax
	mov	esi, ecx
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_unlock@PLT
	jmp	.L8
.L6:
	mov	eax, DWORD PTR worms[rip]
	mov	rdx, QWORD PTR -8[rbp]
	mov	ecx, edx
	mov	edx, eax
	mov	esi, ecx
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_unlock@PLT
	lea	rdi, empty[rip]
	call	sem_post@PLT
	jmp	.L8
	.cfi_endproc
.LFE7:
	.size	baby_bird, .-baby_bird
	.section	.rodata
.LC3:
	.string	"\n + intitial dish: %d worms\n\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 208
	mov	DWORD PTR -196[rbp], edi
	mov	QWORD PTR -208[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR worms[rip], 13
	mov	eax, DWORD PTR worms[rip]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edx, 0
	mov	esi, 1
	lea	rdi, empty[rip]
	call	sem_init@PLT
	mov	edx, 13
	mov	esi, 1
	lea	rdi, any[rip]
	call	sem_init@PLT
	mov	esi, 0
	lea	rdi, lock[rip]
	call	pthread_mutex_init@PLT
	lea	rax, -176[rbp]
	mov	rdi, rax
	call	pthread_attr_init@PLT
	lea	rax, -176[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_attr_setscope@PLT
	lea	rsi, -176[rbp]
	lea	rax, -184[rbp]
	mov	ecx, 0
	lea	rdx, parent_bird[rip]
	mov	rdi, rax
	call	pthread_create@PLT
	mov	DWORD PTR -188[rbp], 0
	jmp	.L10
.L11:
	mov	eax, DWORD PTR -188[rbp]
	cdqe
	mov	rdx, rax
	lea	rcx, -112[rbp]
	mov	eax, DWORD PTR -188[rbp]
	cdqe
	sal	rax, 3
	lea	rdi, [rcx+rax]
	lea	rax, -176[rbp]
	mov	rcx, rdx
	lea	rdx, baby_bird[rip]
	mov	rsi, rax
	call	pthread_create@PLT
	add	DWORD PTR -188[rbp], 1
.L10:
	cmp	DWORD PTR -188[rbp], 6
	jle	.L11
	mov	rax, QWORD PTR -184[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	DWORD PTR -188[rbp], 0
	jmp	.L12
.L13:
	mov	eax, DWORD PTR -188[rbp]
	cdqe
	mov	rax, QWORD PTR -112[rbp+rax*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	DWORD PTR -188[rbp], 1
.L12:
	cmp	DWORD PTR -188[rbp], 6
	jle	.L13
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE8:
	.size	main, .-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	"839716.c"
	.text
	.local	worms
	.comm	worms,4,4
	.local	empty
	.comm	empty,16,4
	.local	any
	.comm	any,16,4
	.local	lock
	.comm	lock,24,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	" + parent bird brings %d worms\012\012\000"
	.text
	.align	2
	.global	parent_bird
	.syntax unified
	.arm
	.fpu softvfp
	.type	parent_bird, %function
parent_bird:
	@ 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]
.L4:
	ldr	r0, .L5
	bl	sem_wait
	ldr	r0, .L5+4
	bl	pthread_mutex_lock
	ldr	r3, .L5+8
	mov	r2, #13
	str	r2, [r3]
	ldr	r3, .L5+8
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L5+12
	bl	printf
	ldr	r0, .L5+4
	bl	pthread_mutex_unlock
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L2
.L3:
	ldr	r0, .L5+16
	bl	sem_post
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L2:
	ldr	r3, [fp, #-8]
	cmp	r3, #12
	ble	.L3
	b	.L4
.L6:
	.align	2
.L5:
	.word	empty
	.word	lock
	.word	worms
	.word	.LC0
	.word	any
	.size	parent_bird, .-parent_bird
	.section	.rodata
	.align	2
.LC1:
	.ascii	" - baby bird %d eats (dish: %d worms)\012\000"
	.align	2
.LC2:
	.ascii	" - baby bird %d eats (dish: %d worms) and screams\012"
	.ascii	"\012\000"
	.text
	.align	2
	.global	baby_bird
	.syntax unified
	.arm
	.fpu softvfp
	.type	baby_bird, %function
baby_bird:
	@ 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]
.L10:
	bl	rand
	ldr	r3, .L11
	smull	r2, r3, r0, r3
	asr	r2, r3, #17
	asr	r3, r0, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #7
	add	r3, r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r1, r3, #5
	add	r3, r3, r1
	lsl	r1, r3, #6
	sub	r1, r1, r3
	add	r3, r1, r2
	sub	r2, r0, r3
	mov	r3, r2
	mov	r0, r3
	bl	usleep
	ldr	r0, .L11+4
	bl	sem_wait
	ldr	r0, .L11+8
	bl	pthread_mutex_lock
	ldr	r3, .L11+12
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L11+12
	str	r3, [r2]
	ldr	r3, .L11+12
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L8
	ldr	r3, [fp, #-8]
	ldr	r2, .L11+12
	ldr	r2, [r2]
	mov	r1, r3
	ldr	r0, .L11+16
	bl	printf
	ldr	r0, .L11+8
	bl	pthread_mutex_unlock
	b	.L10
.L8:
	ldr	r3, [fp, #-8]
	ldr	r2, .L11+12
	ldr	r2, [r2]
	mov	r1, r3
	ldr	r0, .L11+20
	bl	printf
	ldr	r0, .L11+8
	bl	pthread_mutex_unlock
	ldr	r0, .L11+24
	bl	sem_post
	b	.L10
.L12:
	.align	2
.L11:
	.word	1045477589
	.word	any
	.word	lock
	.word	worms
	.word	.LC1
	.word	.LC2
	.word	empty
	.size	baby_bird, .-baby_bird
	.section	.rodata
	.align	2
.LC3:
	.ascii	"\012 + intitial dish: %d worms\012\012\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 112
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #112
	str	r0, [fp, #-112]
	str	r1, [fp, #-116]
	ldr	r3, .L19
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L19+4
	mov	r2, #13
	str	r2, [r3]
	ldr	r3, .L19+4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L19+8
	bl	printf
	mov	r2, #0
	mov	r1, #1
	ldr	r0, .L19+12
	bl	sem_init
	mov	r2, #13
	mov	r1, #1
	ldr	r0, .L19+16
	bl	sem_init
	mov	r1, #0
	ldr	r0, .L19+20
	bl	pthread_mutex_init
	sub	r3, fp, #96
	mov	r0, r3
	bl	pthread_attr_init
	sub	r3, fp, #96
	mov	r1, #0
	mov	r0, r3
	bl	pthread_attr_setscope
	sub	r1, fp, #96
	sub	r0, fp, #104
	mov	r3, #0
	ldr	r2, .L19+24
	bl	pthread_create
	mov	r3, #0
	str	r3, [fp, #-100]
	b	.L14
.L15:
	sub	r2, fp, #60
	ldr	r3, [fp, #-100]
	lsl	r3, r3, #2
	add	r0, r2, r3
	ldr	r3, [fp, #-100]
	sub	r1, fp, #96
	ldr	r2, .L19+28
	bl	pthread_create
	ldr	r3, [fp, #-100]
	add	r3, r3, #1
	str	r3, [fp, #-100]
.L14:
	ldr	r3, [fp, #-100]
	cmp	r3, #6
	ble	.L15
	ldr	r3, [fp, #-104]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	mov	r3, #0
	str	r3, [fp, #-100]
	b	.L16
.L17:
	ldr	r3, [fp, #-100]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-56]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-100]
	add	r3, r3, #1
	str	r3, [fp, #-100]
.L16:
	ldr	r3, [fp, #-100]
	cmp	r3, #6
	ble	.L17
	mov	r0, #0
	bl	pthread_exit
.L20:
	.align	2
.L19:
	.word	.LC4
	.word	worms
	.word	.LC3
	.word	empty
	.word	any
	.word	lock
	.word	parent_bird
	.word	baby_bird
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
