	.file	"803362.c"
	.intel_syntax noprefix
	.text
	.globl	numLoaves
	.bss
	.align 4
	.type	numLoaves, @object
	.size	numLoaves, 4
numLoaves:
	.zero	4
	.globl	lock
	.align 32
	.type	lock, @object
	.size	lock, 40
lock:
	.zero	40
	.globl	no_bread
	.align 32
	.type	no_bread, @object
	.size	no_bread, 48
no_bread:
	.zero	48
	.globl	bread
	.align 32
	.type	bread, @object
	.size	bread, 48
bread:
	.zero	48
	.section	.rodata
	.align 8
.LC0:
	.string	"%-20s: A fresh batch of bread is ready.\n"
	.align 8
.LC1:
	.string	"%-20s: I'm fed up with feeding you lazy animals! No more bread!\n"
	.text
	.globl	littleRedHenThread
	.type	littleRedHenThread, @function
littleRedHenThread:
.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	DWORD PTR -12[rbp], 1
	jmp	.L2
.L5:
	lea	rdi, lock[rip]
	call	pthread_mutex_lock@PLT
	jmp	.L3
.L4:
	lea	rsi, lock[rip]
	lea	rdi, no_bread[rip]
	call	pthread_cond_wait@PLT
.L3:
	mov	eax, DWORD PTR numLoaves[rip]
	test	eax, eax
	jne	.L4
	lea	rdi, lock[rip]
	call	pthread_mutex_unlock@PLT
	mov	edi, 2
	call	sleep@PLT
	mov	eax, DWORD PTR numLoaves[rip]
	add	eax, 7
	mov	DWORD PTR numLoaves[rip], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_lock@PLT
	lea	rdi, bread[rip]
	call	pthread_cond_signal@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_unlock@PLT
	add	DWORD PTR -12[rbp], 1
.L2:
	cmp	DWORD PTR -12[rbp], 6
	jle	.L5
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	littleRedHenThread, .-littleRedHenThread
	.section	.rodata
	.align 8
.LC2:
	.string	"%-20s: Hey, Little Red Hen, make some more bread!\n"
	.align 8
.LC3:
	.string	"%-20s: Mmm, this loaf is delicious.\n"
	.align 8
.LC4:
	.string	"%-20s: I've had my fill of bread. Thanks, Little Red Hen!\n"
	.text
	.globl	otherAnimalThread
	.type	otherAnimalThread, @function
otherAnimalThread:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 40
	.cfi_offset 3, -24
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -24[rbp], rax
	mov	DWORD PTR -28[rbp], 0
	jmp	.L8
.L13:
	lea	rdi, lock[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR numLoaves[rip]
	test	eax, eax
	jg	.L9
	lea	rdi, no_bread[rip]
	call	pthread_cond_signal@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_unlock@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_lock@PLT
	jmp	.L10
.L11:
	lea	rsi, lock[rip]
	lea	rdi, bread[rip]
	call	pthread_cond_wait@PLT
.L10:
	mov	eax, DWORD PTR numLoaves[rip]
	test	eax, eax
	jle	.L11
.L9:
	mov	eax, DWORD PTR numLoaves[rip]
	sub	eax, 1
	mov	DWORD PTR numLoaves[rip], eax
	lea	rdi, lock[rip]
	call	pthread_mutex_unlock@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_lock@PLT
	add	DWORD PTR -28[rbp], 1
	mov	eax, 0
	call	random@PLT
	mov	ebx, eax
	mov	eax, 0
	call	random@PLT
	cmp	ebx, eax
	jle	.L12
	mov	edi, 1
	call	sleep@PLT
.L12:
	lea	rdi, lock[rip]
	call	pthread_mutex_unlock@PLT
.L8:
	cmp	DWORD PTR -28[rbp], 13
	jle	.L13
	mov	eax, DWORD PTR numLoaves[rip]
	test	eax, eax
	jg	.L14
	lea	rdi, lock[rip]
	call	pthread_mutex_lock@PLT
	lea	rdi, no_bread[rip]
	call	pthread_cond_signal@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_unlock@PLT
.L14:
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	otherAnimalThread, .-otherAnimalThread
	.section	.rodata
.LC5:
	.string	"Everything finished."
	.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
	add	rsp, -128
	mov	DWORD PTR -116[rbp], edi
	mov	QWORD PTR -128[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR numLoaves[rip], 0
	movabs	rax, 7453250814589165900
	mov	QWORD PTR -67[rbp], rax
	mov	BYTE PTR -59[rbp], 0
	movabs	rax, 4836999523440356435
	mov	QWORD PTR -58[rbp], rax
	mov	WORD PTR -50[rbp], 29793
	mov	BYTE PTR -48[rbp], 0
	movabs	rax, 7302903976757391182
	movabs	rdx, 7166709288263445612
	mov	QWORD PTR -32[rbp], rax
	mov	QWORD PTR -24[rbp], rdx
	mov	WORD PTR -16[rbp], 107
	movabs	rax, 5917841426849491276
	mov	QWORD PTR -47[rbp], rax
	mov	DWORD PTR -39[rbp], 1210082405
	mov	WORD PTR -35[rbp], 28261
	mov	BYTE PTR -33[rbp], 0
	lea	rdx, -67[rbp]
	lea	rax, -104[rbp]
	mov	rcx, rdx
	lea	rdx, otherAnimalThread[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	lea	rdx, -58[rbp]
	lea	rax, -96[rbp]
	mov	rcx, rdx
	lea	rdx, otherAnimalThread[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	lea	rdx, -32[rbp]
	lea	rax, -88[rbp]
	mov	rcx, rdx
	lea	rdx, otherAnimalThread[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	lea	rdx, -47[rbp]
	lea	rax, -80[rbp]
	mov	rcx, rdx
	lea	rdx, littleRedHenThread[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	rax, QWORD PTR -104[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR -96[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR -88[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR -80[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.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	"803362.c"
	.text
	.comm	numLoaves,4,4
	.global	lock
	.bss
	.align	2
	.type	lock, %object
	.size	lock, 24
lock:
	.space	24
	.global	no_bread
	.align	3
	.type	no_bread, %object
	.size	no_bread, 48
no_bread:
	.space	48
	.global	bread
	.align	3
	.type	bread, %object
	.size	bread, 48
bread:
	.space	48
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%-20s: A fresh batch of bread is ready.\012\000"
	.align	2
.LC1:
	.ascii	"%-20s: I'm fed up with feeding you lazy animals! No"
	.ascii	" more bread!\012\000"
	.text
	.align	2
	.global	littleRedHenThread
	.syntax unified
	.arm
	.fpu softvfp
	.type	littleRedHenThread, %function
littleRedHenThread:
	@ 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]
	mov	r3, #1
	str	r3, [fp, #-12]
	b	.L2
.L5:
	ldr	r0, .L7
	bl	pthread_mutex_lock
	b	.L3
.L4:
	ldr	r1, .L7
	ldr	r0, .L7+4
	bl	pthread_cond_wait
.L3:
	ldr	r3, .L7+8
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L4
	ldr	r0, .L7
	bl	pthread_mutex_unlock
	mov	r0, #2
	bl	sleep
	ldr	r3, .L7+8
	ldr	r3, [r3]
	add	r3, r3, #7
	ldr	r2, .L7+8
	str	r3, [r2]
	ldr	r1, [fp, #-8]
	ldr	r0, .L7+12
	bl	printf
	ldr	r0, .L7
	bl	pthread_mutex_lock
	ldr	r0, .L7+16
	bl	pthread_cond_signal
	ldr	r0, .L7
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L2:
	ldr	r3, [fp, #-12]
	cmp	r3, #6
	ble	.L5
	ldr	r1, [fp, #-8]
	ldr	r0, .L7+20
	bl	printf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	lock
	.word	no_bread
	.word	numLoaves
	.word	.LC0
	.word	bread
	.word	.LC1
	.size	littleRedHenThread, .-littleRedHenThread
	.section	.rodata
	.align	2
.LC2:
	.ascii	"%-20s: Hey, Little Red Hen, make some more bread!\012"
	.ascii	"\000"
	.align	2
.LC3:
	.ascii	"%-20s: Mmm, this loaf is delicious.\012\000"
	.align	2
.LC4:
	.ascii	"%-20s: I've had my fill of bread. Thanks, Little Re"
	.ascii	"d Hen!\012\000"
	.text
	.align	2
	.global	otherAnimalThread
	.syntax unified
	.arm
	.fpu softvfp
	.type	otherAnimalThread, %function
otherAnimalThread:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #20
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L10
.L15:
	ldr	r0, .L18
	bl	pthread_mutex_lock
	ldr	r3, .L18+4
	ldr	r3, [r3]
	cmp	r3, #0
	bgt	.L11
	ldr	r0, .L18+8
	bl	pthread_cond_signal
	ldr	r0, .L18
	bl	pthread_mutex_unlock
	ldr	r1, [fp, #-16]
	ldr	r0, .L18+12
	bl	printf
	ldr	r0, .L18
	bl	pthread_mutex_lock
	b	.L12
.L13:
	ldr	r1, .L18
	ldr	r0, .L18+16
	bl	pthread_cond_wait
.L12:
	ldr	r3, .L18+4
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L13
.L11:
	ldr	r3, .L18+4
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L18+4
	str	r3, [r2]
	ldr	r0, .L18
	bl	pthread_mutex_unlock
	ldr	r1, [fp, #-16]
	ldr	r0, .L18+20
	bl	printf
	ldr	r0, .L18
	bl	pthread_mutex_lock
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
	bl	random
	mov	r4, r0
	bl	random
	mov	r3, r0
	cmp	r4, r3
	ble	.L14
	mov	r0, #1
	bl	sleep
.L14:
	ldr	r0, .L18
	bl	pthread_mutex_unlock
.L10:
	ldr	r3, [fp, #-20]
	cmp	r3, #13
	ble	.L15
	ldr	r3, .L18+4
	ldr	r3, [r3]
	cmp	r3, #0
	bgt	.L16
	ldr	r0, .L18
	bl	pthread_mutex_lock
	ldr	r0, .L18+8
	bl	pthread_cond_signal
	ldr	r0, .L18
	bl	pthread_mutex_unlock
.L16:
	ldr	r1, [fp, #-16]
	ldr	r0, .L18+24
	bl	printf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L19:
	.align	2
.L18:
	.word	lock
	.word	numLoaves
	.word	no_bread
	.word	.LC2
	.word	bread
	.word	.LC3
	.word	.LC4
	.size	otherAnimalThread, .-otherAnimalThread
	.section	.rodata
	.align	2
.LC9:
	.ascii	"Everything finished.\000"
	.align	2
.LC5:
	.ascii	"Lazy Dog\000"
	.align	2
.LC6:
	.ascii	"Sleepy Cat\000"
	.align	2
.LC7:
	.ascii	"Noisy Yellow Duck\000"
	.align	2
.LC8:
	.ascii	"Little Red Hen\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 88
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #88
	str	r0, [fp, #-88]
	str	r1, [fp, #-92]
	ldr	r3, .L23
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L23+4
	mov	r2, #0
	str	r2, [r3]
	ldr	r2, .L23+8
	sub	r3, fp, #68
	ldm	r2, {r0, r1, r2}
	stmia	r3!, {r0, r1}
	strb	r2, [r3]
	ldr	r2, .L23+12
	sub	r3, fp, #56
	ldm	r2, {r0, r1, r2}
	stmia	r3!, {r0, r1}
	strh	r2, [r3]	@ movhi
	add	r3, r3, #2
	lsr	r2, r2, #16
	strb	r2, [r3]
	ldr	r3, .L23+16
	sub	ip, fp, #28
	mov	lr, r3
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldr	r3, [lr]
	strh	r3, [ip]	@ movhi
	ldr	r3, .L23+20
	sub	ip, fp, #44
	ldm	r3, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2}
	strh	r3, [ip]	@ movhi
	add	ip, ip, #2
	lsr	r3, r3, #16
	strb	r3, [ip]
	sub	r3, fp, #68
	sub	r0, fp, #84
	ldr	r2, .L23+24
	mov	r1, #0
	bl	pthread_create
	sub	r3, fp, #56
	sub	r0, fp, #80
	ldr	r2, .L23+24
	mov	r1, #0
	bl	pthread_create
	sub	r3, fp, #28
	sub	r0, fp, #76
	ldr	r2, .L23+24
	mov	r1, #0
	bl	pthread_create
	sub	r3, fp, #44
	sub	r0, fp, #72
	ldr	r2, .L23+28
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-84]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-80]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-76]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-72]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r0, .L23+32
	bl	puts
	mov	r3, #0
	ldr	r2, .L23
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L22
	bl	__stack_chk_fail
.L22:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	.LC10
	.word	numLoaves
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	otherAnimalThread
	.word	littleRedHenThread
	.word	.LC9
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
