	.file	"28261531.c"
	.intel_syntax noprefix
	.text
	.globl	safe_atoi
	.type	safe_atoi, @function
safe_atoi:
.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, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rcx, -24[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, 10
	mov	rsi, rcx
	mov	rdi, rax
	call	strtol@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	cmp	QWORD PTR -40[rbp], rax
	je	.L2
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L2
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -48[rbp]
	mov	DWORD PTR [rax], edx
	mov	eax, 0
	jmp	.L4
.L2:
	mov	eax, -1
.L4:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	safe_atoi, .-safe_atoi
	.section	.rodata
	.align 8
.LC0:
	.string	"Out of memory, failed to allocate %zd bytes\n"
	.text
	.globl	safe_malloc
	.type	safe_malloc, @function
safe_malloc:
.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	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L7
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -24[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L7:
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	safe_malloc, .-safe_malloc
	.section	.rodata
	.align 8
.LC1:
	.string	"Usage: %s thread_count child_threads c_t_ratio\n\nExactly two argument required:\n    thread_count: Total number of threads to create.\n    child_threads: The number of threads simulating children.\n    c_t_ratio: The allowed ratio of children to teachers.\n\n"
	.text
	.globl	usage
	.type	usage, @function
usage:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -8[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE8:
	.size	usage, .-usage
	.section	.rodata
	.align 8
.LC2:
	.string	"Little %s put %s finger in the wall outlet and got electrocuted!"
	.align 8
.LC3:
	.string	"Little %s fell off the slide and broke %s head!"
	.align 8
.LC4:
	.string	"Little %s was playing with matches and lit %s hair on fire!"
	.align 8
.LC5:
	.string	"Little %s drank a bottle of acid with %s lunch!"
	.align 8
.LC6:
	.string	"Little %s caught %s hand in the paper shredder!"
	.align 8
.LC7:
	.string	"Little %s wrestled with a stray dog and it bit %s finger off!"
.LC8:
	.string	"George"
.LC9:
	.string	"John"
.LC10:
	.string	"Nick"
.LC11:
	.string	"Jim"
.LC12:
	.string	"Constantine"
.LC13:
	.string	"Chris"
.LC14:
	.string	"Peter"
.LC15:
	.string	"Paul"
.LC16:
	.string	"Steve"
.LC17:
	.string	"Billy"
.LC18:
	.string	"Mike"
.LC19:
	.string	"Vangelis"
.LC20:
	.string	"Antony"
.LC21:
	.string	"Maria"
.LC22:
	.string	"Irene"
.LC23:
	.string	"Christina"
.LC24:
	.string	"Helena"
.LC25:
	.string	"Georgia"
.LC26:
	.string	"Olga"
.LC27:
	.string	"Sophie"
.LC28:
	.string	"Joanna"
.LC29:
	.string	"Zoe"
.LC30:
	.string	"Catherine"
.LC31:
	.string	"Marina"
.LC32:
	.string	"Stella"
.LC33:
	.string	"Vicky"
.LC34:
	.string	"Jenny"
.LC35:
	.string	"*** Thread %d: Oh no! "
.LC36:
	.string	"his"
.LC37:
	.string	"her"
	.align 8
.LC38:
	.string	"\n*** Why were there only %d teachers for %d children?!\n"
.LC39:
	.string	"%s"
	.text
	.globl	bad_thing
	.type	bad_thing, @function
bad_thing:
.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, 1360
	mov	DWORD PTR -1348[rbp], edi
	mov	DWORD PTR -1352[rbp], esi
	mov	DWORD PTR -1356[rbp], edx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, .LC2[rip]
	mov	QWORD PTR -1312[rbp], rax
	lea	rax, .LC3[rip]
	mov	QWORD PTR -1304[rbp], rax
	lea	rax, .LC4[rip]
	mov	QWORD PTR -1296[rbp], rax
	lea	rax, .LC5[rip]
	mov	QWORD PTR -1288[rbp], rax
	lea	rax, .LC6[rip]
	mov	QWORD PTR -1280[rbp], rax
	lea	rax, .LC7[rip]
	mov	QWORD PTR -1272[rbp], rax
	lea	rax, .LC8[rip]
	mov	QWORD PTR -1264[rbp], rax
	lea	rax, .LC9[rip]
	mov	QWORD PTR -1256[rbp], rax
	lea	rax, .LC10[rip]
	mov	QWORD PTR -1248[rbp], rax
	lea	rax, .LC11[rip]
	mov	QWORD PTR -1240[rbp], rax
	lea	rax, .LC12[rip]
	mov	QWORD PTR -1232[rbp], rax
	lea	rax, .LC13[rip]
	mov	QWORD PTR -1224[rbp], rax
	lea	rax, .LC14[rip]
	mov	QWORD PTR -1216[rbp], rax
	lea	rax, .LC15[rip]
	mov	QWORD PTR -1208[rbp], rax
	lea	rax, .LC16[rip]
	mov	QWORD PTR -1200[rbp], rax
	lea	rax, .LC17[rip]
	mov	QWORD PTR -1192[rbp], rax
	lea	rax, .LC18[rip]
	mov	QWORD PTR -1184[rbp], rax
	lea	rax, .LC19[rip]
	mov	QWORD PTR -1176[rbp], rax
	lea	rax, .LC20[rip]
	mov	QWORD PTR -1168[rbp], rax
	lea	rax, .LC21[rip]
	mov	QWORD PTR -1152[rbp], rax
	lea	rax, .LC22[rip]
	mov	QWORD PTR -1144[rbp], rax
	lea	rax, .LC23[rip]
	mov	QWORD PTR -1136[rbp], rax
	lea	rax, .LC24[rip]
	mov	QWORD PTR -1128[rbp], rax
	lea	rax, .LC25[rip]
	mov	QWORD PTR -1120[rbp], rax
	lea	rax, .LC26[rip]
	mov	QWORD PTR -1112[rbp], rax
	lea	rax, .LC27[rip]
	mov	QWORD PTR -1104[rbp], rax
	lea	rax, .LC28[rip]
	mov	QWORD PTR -1096[rbp], rax
	lea	rax, .LC29[rip]
	mov	QWORD PTR -1088[rbp], rax
	lea	rax, .LC30[rip]
	mov	QWORD PTR -1080[rbp], rax
	lea	rax, .LC31[rip]
	mov	QWORD PTR -1072[rbp], rax
	lea	rax, .LC32[rip]
	mov	QWORD PTR -1064[rbp], rax
	lea	rax, .LC33[rip]
	mov	QWORD PTR -1056[rbp], rax
	lea	rax, .LC34[rip]
	mov	QWORD PTR -1048[rbp], rax
	call	rand@PLT
	cdq
	shr	edx, 30
	add	eax, edx
	and	eax, 3
	sub	eax, edx
	mov	DWORD PTR -1344[rbp], eax
	call	rand@PLT
	cdq
	shr	edx, 31
	add	eax, edx
	and	eax, 1
	sub	eax, edx
	mov	DWORD PTR -1340[rbp], eax
	cmp	DWORD PTR -1340[rbp], 0
	je	.L11
	mov	eax, 13
	jmp	.L12
.L11:
	mov	eax, 14
.L12:
	mov	DWORD PTR -1336[rbp], eax
	call	rand@PLT
	cdq
	idiv	DWORD PTR -1336[rbp]
	mov	DWORD PTR -1332[rbp], edx
	cmp	DWORD PTR -1340[rbp], 0
	je	.L13
	mov	eax, DWORD PTR -1332[rbp]
	cdqe
	mov	rax, QWORD PTR -1264[rbp+rax*8]
	jmp	.L14
.L13:
	mov	eax, DWORD PTR -1332[rbp]
	cdqe
	mov	rax, QWORD PTR -1152[rbp+rax*8]
.L14:
	mov	QWORD PTR -1328[rbp], rax
	lea	rax, -1040[rbp]
	mov	QWORD PTR -1320[rbp], rax
	mov	edx, DWORD PTR -1348[rbp]
	mov	rax, QWORD PTR -1320[rbp]
	lea	rsi, .LC35[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	cdqe
	add	QWORD PTR -1320[rbp], rax
	cmp	DWORD PTR -1340[rbp], 0
	je	.L15
	lea	rax, .LC36[rip]
	jmp	.L16
.L15:
	lea	rax, .LC37[rip]
.L16:
	mov	edx, DWORD PTR -1344[rbp]
	movsx	rdx, edx
	mov	rsi, QWORD PTR -1312[rbp+rdx*8]
	mov	rdx, QWORD PTR -1328[rbp]
	mov	rdi, QWORD PTR -1320[rbp]
	mov	rcx, rax
	mov	eax, 0
	call	sprintf@PLT
	cdqe
	add	QWORD PTR -1320[rbp], rax
	mov	ecx, DWORD PTR -1352[rbp]
	mov	edx, DWORD PTR -1356[rbp]
	mov	rax, QWORD PTR -1320[rbp]
	lea	rsi, .LC38[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	cdqe
	add	QWORD PTR -1320[rbp], rax
	lea	rax, -1040[rbp]
	mov	rsi, rax
	lea	rdi, .LC39[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	bad_thing, .-bad_thing
	.section	.rodata
	.align 8
.LC40:
	.string	"Internal error: %s called for a Teacher thread.\n"
.LC41:
	.string	"THREAD %d: CHILD ENTER\n"
	.text
	.globl	child_enter
	.type	child_enter, @function
child_enter:
.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, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 56[rax]
	mov	DWORD PTR -20[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 52[rax]
	mov	DWORD PTR -16[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 60[rax]
	mov	DWORD PTR -12[rbp], eax
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR 16[rax]
	test	eax, eax
	jne	.L19
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, __func__.3[rip]
	lea	rsi, .LC40[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L19:
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, DWORD PTR 20[rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC41[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	add	rax, 64
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	jmp	.L20
.L21:
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	add	rax, 64
	mov	rdx, QWORD PTR -40[rbp]
	mov	rdx, QWORD PTR 8[rdx]
	mov	rsi, rax
	mov	rdi, rdx
	call	pthread_cond_wait@PLT
.L20:
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	eax, DWORD PTR 48[rax]
	test	eax, eax
	je	.L21
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	edx, DWORD PTR 56[rax]
	add	edx, 1
	mov	DWORD PTR 56[rax], edx
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	edx, DWORD PTR 48[rax]
	sub	edx, 1
	mov	DWORD PTR 48[rax], edx
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	eax, DWORD PTR 48[rax]
	test	eax, eax
	jg	.L22
	mov	eax, DWORD PTR -16[rbp]
	sub	eax, 1
	imul	eax, DWORD PTR -12[rbp]
	cmp	DWORD PTR -20[rbp], eax
	jg	.L23
.L22:
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rdi, rax
	call	pthread_cond_broadcast@PLT
.L23:
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	add	rax, 64
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	child_enter, .-child_enter
	.section	.rodata
.LC42:
	.string	"THREAD %d: CHILD EXIT\n"
	.text
	.globl	child_exit
	.type	child_exit, @function
child_exit:
.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, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 56[rax]
	mov	DWORD PTR -20[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 52[rax]
	mov	DWORD PTR -16[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 60[rax]
	mov	DWORD PTR -12[rbp], eax
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR 16[rax]
	test	eax, eax
	jne	.L25
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, __func__.2[rip]
	lea	rsi, .LC40[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L25:
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, DWORD PTR 20[rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC42[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	add	rax, 64
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	edx, DWORD PTR 56[rax]
	sub	edx, 1
	mov	DWORD PTR 56[rax], edx
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	edx, DWORD PTR 48[rax]
	add	edx, 1
	mov	DWORD PTR 48[rax], edx
	mov	eax, DWORD PTR -16[rbp]
	sub	eax, 1
	imul	eax, DWORD PTR -12[rbp]
	cmp	DWORD PTR -20[rbp], eax
	jle	.L26
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	eax, DWORD PTR 48[rax]
	test	eax, eax
	je	.L27
.L26:
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rdi, rax
	call	pthread_cond_broadcast@PLT
.L27:
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	add	rax, 64
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	child_exit, .-child_exit
	.section	.rodata
	.align 8
.LC43:
	.string	"Internal error: %s called for a Child thread.\n"
.LC44:
	.string	"THREAD %d: TEACHER ENTER\n"
	.text
	.globl	teacher_enter
	.type	teacher_enter, @function
teacher_enter:
.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	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 56[rax]
	mov	DWORD PTR -20[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 52[rax]
	mov	DWORD PTR -16[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 60[rax]
	mov	DWORD PTR -12[rbp], eax
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR 16[rax]
	test	eax, eax
	je	.L29
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, __func__.1[rip]
	lea	rsi, .LC43[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L29:
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, DWORD PTR 20[rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC44[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	add	rax, 64
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	edx, DWORD PTR 52[rax]
	add	edx, 1
	mov	DWORD PTR 52[rax], edx
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	ecx, DWORD PTR 48[rax]
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	edx, DWORD PTR -12[rbp]
	add	edx, ecx
	mov	DWORD PTR 48[rax], edx
	mov	eax, DWORD PTR -16[rbp]
	sub	eax, 1
	imul	eax, DWORD PTR -12[rbp]
	cmp	DWORD PTR -20[rbp], eax
	jle	.L30
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	eax, DWORD PTR 48[rax]
	test	eax, eax
	je	.L31
.L30:
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rdi, rax
	call	pthread_cond_broadcast@PLT
.L31:
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	add	rax, 64
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	teacher_enter, .-teacher_enter
	.section	.rodata
.LC45:
	.string	"THREAD %d: TEACHER EXIT\n"
	.text
	.globl	teacher_exit
	.type	teacher_exit, @function
teacher_exit:
.LFB13:
	.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	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 56[rax]
	mov	DWORD PTR -20[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 52[rax]
	mov	DWORD PTR -16[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 60[rax]
	mov	DWORD PTR -12[rbp], eax
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR 16[rax]
	test	eax, eax
	je	.L33
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, __func__.0[rip]
	lea	rsi, .LC43[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L33:
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, DWORD PTR 20[rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC45[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	add	rax, 64
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	jmp	.L34
.L35:
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	add	rax, 64
	mov	rdx, QWORD PTR -40[rbp]
	mov	rdx, QWORD PTR 8[rdx]
	mov	rsi, rax
	mov	rdi, rdx
	call	pthread_cond_wait@PLT
.L34:
	mov	eax, DWORD PTR -16[rbp]
	sub	eax, 1
	imul	eax, DWORD PTR -12[rbp]
	cmp	DWORD PTR -20[rbp], eax
	jg	.L35
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	eax, DWORD PTR 48[rax]
	test	eax, eax
	jne	.L35
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	edx, DWORD PTR 52[rax]
	sub	edx, 1
	mov	DWORD PTR 52[rax], edx
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	edx, DWORD PTR 48[rax]
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	sub	edx, DWORD PTR -12[rbp]
	mov	DWORD PTR 48[rax], edx
	mov	eax, DWORD PTR -16[rbp]
	sub	eax, 1
	imul	eax, DWORD PTR -12[rbp]
	cmp	DWORD PTR -20[rbp], eax
	jle	.L36
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	eax, DWORD PTR 48[rax]
	test	eax, eax
	je	.L37
.L36:
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rdi, rax
	call	pthread_cond_broadcast@PLT
.L37:
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	add	rax, 64
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	teacher_exit, .-teacher_exit
	.section	.rodata
	.align 8
.LC46:
	.string	"            Thread %d: Teachers: %d, Children: %d\n"
	.text
	.globl	verify
	.type	verify, @function
verify:
.LFB14:
	.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	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 56[rax]
	mov	DWORD PTR -20[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 52[rax]
	mov	DWORD PTR -16[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 60[rax]
	mov	DWORD PTR -12[rbp], eax
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, DWORD PTR 20[rax]
	mov	rax, QWORD PTR stderr[rip]
	mov	esi, DWORD PTR -20[rbp]
	mov	ecx, DWORD PTR -16[rbp]
	mov	r8d, esi
	lea	rsi, .LC46[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, DWORD PTR -16[rbp]
	imul	eax, DWORD PTR -12[rbp]
	cmp	DWORD PTR -20[rbp], eax
	jle	.L40
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR 20[rax]
	mov	edx, DWORD PTR -16[rbp]
	mov	ecx, DWORD PTR -20[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	bad_thing
	mov	edi, 1
	call	exit@PLT
.L40:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	verify, .-verify
	.section	.rodata
.LC47:
	.string	"Thread %d of %d. START.\n"
.LC48:
	.string	"Child"
.LC49:
	.string	"Teacher"
.LC50:
	.string	"Thread %d [%s]: Entering.\n"
.LC51:
	.string	"Thread %d [%s]: Entered.\n"
.LC52:
	.string	"Thread %d [%s]: Exiting.\n"
.LC53:
	.string	"Thread %d [%s]: Exited.\n"
	.text
	.globl	thread_start_fn
	.type	thread_start_fn, @function
thread_start_fn:
.LFB15:
	.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 -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	ecx, DWORD PTR 24[rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, DWORD PTR 20[rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC47[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 16[rax]
	test	eax, eax
	je	.L42
	lea	rax, .LC48[rip]
	jmp	.L43
.L42:
	lea	rax, .LC49[rip]
.L43:
	mov	QWORD PTR -8[rbp], rax
.L48:
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, DWORD PTR 20[rax]
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, QWORD PTR -8[rbp]
	lea	rsi, .LC50[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 16[rax]
	test	eax, eax
	je	.L44
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	child_enter
	jmp	.L45
.L44:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	teacher_enter
.L45:
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, DWORD PTR 20[rax]
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, QWORD PTR -8[rbp]
	lea	rsi, .LC51[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 8[rax]
	add	rax, 64
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	verify
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 8[rax]
	add	rax, 64
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 28
	mov	rdi, rax
	call	rand_r@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 1125899907
	shr	rdx, 32
	sar	edx, 18
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	imul	ecx, edx, 1000000
	sub	eax, ecx
	mov	edx, eax
	mov	eax, edx
	mov	edi, eax
	call	usleep@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, DWORD PTR 20[rax]
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, QWORD PTR -8[rbp]
	lea	rsi, .LC52[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 16[rax]
	test	eax, eax
	je	.L46
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	child_exit
	jmp	.L47
.L46:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	teacher_exit
.L47:
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, DWORD PTR 20[rax]
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, QWORD PTR -8[rbp]
	lea	rsi, .LC53[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 28
	mov	rdi, rax
	call	rand_r@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 351843721
	shr	rdx, 32
	sar	edx, 13
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	imul	ecx, edx, 100000
	sub	eax, ecx
	mov	edx, eax
	mov	eax, edx
	mov	edi, eax
	call	usleep@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 8[rax]
	add	rax, 64
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	verify
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 8[rax]
	add	rax, 64
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	jmp	.L48
	.cfi_endproc
.LFE15:
	.size	thread_start_fn, .-thread_start_fn
	.section	.rodata
	.align 8
.LC54:
	.string	"`%s' is not valid for `thread_count'\n"
	.align 8
.LC55:
	.string	"`%s' is not valid for `child_threads'\n"
	.align 8
.LC56:
	.string	"`%s' is not valid for `c_t_ratio'\n"
.LC57:
	.string	"pthread_mutex_init"
.LC58:
	.string	"pthread_create"
.LC59:
	.string	"pthread_join"
.LC60:
	.string	"OK."
	.text
	.globl	main
	.type	main, @function
main:
.LFB16:
	.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	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -52[rbp], 4
	je	.L50
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	usage
.L50:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rdx, -44[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	safe_atoi
	test	eax, eax
	js	.L51
	mov	eax, DWORD PTR -44[rbp]
	test	eax, eax
	jg	.L52
.L51:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC54[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L52:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rdx, -40[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	safe_atoi
	test	eax, eax
	js	.L53
	mov	eax, DWORD PTR -40[rbp]
	test	eax, eax
	js	.L53
	mov	edx, DWORD PTR -40[rbp]
	mov	eax, DWORD PTR -44[rbp]
	cmp	edx, eax
	jle	.L54
.L53:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 16
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC55[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L54:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	lea	rdx, -36[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	safe_atoi
	test	eax, eax
	js	.L55
	mov	eax, DWORD PTR -36[rbp]
	test	eax, eax
	jg	.L56
.L55:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 24
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC56[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L56:
	mov	edi, 0
	call	time@PLT
	mov	edi, eax
	call	srand@PLT
	mov	edi, 104
	call	safe_malloc
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 56[rax], 0
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, DWORD PTR 56[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 52[rax], edx
	mov	edx, DWORD PTR -36[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 60[rax], edx
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 48[rax], 0
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 64
	mov	esi, 0
	mov	rdi, rax
	call	pthread_mutex_init@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	je	.L57
	call	__errno_location@PLT
	mov	edx, DWORD PTR -28[rbp]
	mov	DWORD PTR [rax], edx
	lea	rdi, .LC57[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L57:
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	sal	rax, 5
	mov	rdi, rax
	call	safe_malloc
	mov	QWORD PTR -16[rbp], rax
	mov	DWORD PTR -32[rbp], 0
	jmp	.L58
.L60:
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -16[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR 8[rdx], rax
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -16[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -32[rbp]
	mov	DWORD PTR 20[rdx], eax
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -16[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -44[rbp]
	mov	DWORD PTR 24[rdx], eax
	mov	eax, DWORD PTR -40[rbp]
	cmp	DWORD PTR -32[rbp], eax
	setl	cl
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -16[rbp]
	add	rdx, rax
	movzx	eax, cl
	mov	DWORD PTR 16[rdx], eax
	call	rand@PLT
	mov	edx, DWORD PTR -32[rbp]
	movsx	rdx, edx
	mov	rcx, rdx
	sal	rcx, 5
	mov	rdx, QWORD PTR -16[rbp]
	add	rdx, rcx
	mov	DWORD PTR 28[rdx], eax
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -32[rbp]
	movsx	rdx, edx
	mov	rcx, rdx
	sal	rcx, 5
	mov	rdx, QWORD PTR -16[rbp]
	add	rdx, rcx
	mov	rdi, rdx
	mov	rcx, rax
	lea	rdx, thread_start_fn[rip]
	mov	esi, 0
	call	pthread_create@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	je	.L59
	call	__errno_location@PLT
	mov	edx, DWORD PTR -28[rbp]
	mov	DWORD PTR [rax], edx
	lea	rdi, .LC58[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L59:
	add	DWORD PTR -32[rbp], 1
.L58:
	mov	eax, DWORD PTR -44[rbp]
	cmp	DWORD PTR -32[rbp], eax
	jl	.L60
	mov	DWORD PTR -32[rbp], 0
	jmp	.L61
.L63:
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	je	.L62
	call	__errno_location@PLT
	mov	edx, DWORD PTR -28[rbp]
	mov	DWORD PTR [rax], edx
	lea	rdi, .LC59[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L62:
	add	DWORD PTR -32[rbp], 1
.L61:
	mov	eax, DWORD PTR -44[rbp]
	cmp	DWORD PTR -32[rbp], eax
	jl	.L63
	lea	rdi, .LC60[rip]
	call	puts@PLT
	mov	eax, 0
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L65
	call	__stack_chk_fail@PLT
.L65:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.size	main, .-main
	.section	.rodata
	.align 8
	.type	__func__.3, @object
	.size	__func__.3, 12
__func__.3:
	.string	"child_enter"
	.align 8
	.type	__func__.2, @object
	.size	__func__.2, 11
__func__.2:
	.string	"child_exit"
	.align 8
	.type	__func__.1, @object
	.size	__func__.1, 14
__func__.1:
	.string	"teacher_enter"
	.align 8
	.type	__func__.0, @object
	.size	__func__.0, 13
__func__.0:
	.string	"teacher_exit"
	.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	"28261531.c"
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Little %s put %s finger in the wall outlet and got "
	.ascii	"electrocuted!\000"
	.align	2
.LC1:
	.ascii	"Little %s fell off the slide and broke %s head!\000"
	.align	2
.LC2:
	.ascii	"Little %s was playing with matches and lit %s hair "
	.ascii	"on fire!\000"
	.align	2
.LC3:
	.ascii	"Little %s drank a bottle of acid with %s lunch!\000"
	.align	2
.LC4:
	.ascii	"Little %s caught %s hand in the paper shredder!\000"
	.align	2
.LC5:
	.ascii	"Little %s wrestled with a stray dog and it bit %s f"
	.ascii	"inger off!\000"
	.align	2
.LC7:
	.ascii	"George\000"
	.align	2
.LC8:
	.ascii	"John\000"
	.align	2
.LC9:
	.ascii	"Nick\000"
	.align	2
.LC10:
	.ascii	"Jim\000"
	.align	2
.LC11:
	.ascii	"Constantine\000"
	.align	2
.LC12:
	.ascii	"Chris\000"
	.align	2
.LC13:
	.ascii	"Peter\000"
	.align	2
.LC14:
	.ascii	"Paul\000"
	.align	2
.LC15:
	.ascii	"Steve\000"
	.align	2
.LC16:
	.ascii	"Billy\000"
	.align	2
.LC17:
	.ascii	"Mike\000"
	.align	2
.LC18:
	.ascii	"Vangelis\000"
	.align	2
.LC19:
	.ascii	"Antony\000"
	.align	2
.LC21:
	.ascii	"Maria\000"
	.align	2
.LC22:
	.ascii	"Irene\000"
	.align	2
.LC23:
	.ascii	"Christina\000"
	.align	2
.LC24:
	.ascii	"Helena\000"
	.align	2
.LC25:
	.ascii	"Georgia\000"
	.align	2
.LC26:
	.ascii	"Olga\000"
	.align	2
.LC27:
	.ascii	"Sophie\000"
	.align	2
.LC28:
	.ascii	"Joanna\000"
	.align	2
.LC29:
	.ascii	"Zoe\000"
	.align	2
.LC30:
	.ascii	"Catherine\000"
	.align	2
.LC31:
	.ascii	"Marina\000"
	.align	2
.LC32:
	.ascii	"Stella\000"
	.align	2
.LC33:
	.ascii	"Vicky\000"
	.align	2
.LC34:
	.ascii	"Jenny\000"
	.text
	.section	.rodata
	.align	2
.LC36:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	safe_atoi
	.syntax unified
	.arm
	.fpu softvfp
	.type	safe_atoi, %function
safe_atoi:
	@ 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]
	str	r1, [fp, #-28]
	ldr	r3, .L6
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #16
	mov	r2, #10
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	strtol
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	beq	.L2
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L2
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-12]
	str	r2, [r3]
	mov	r3, #0
	b	.L4
.L2:
	mvn	r3, #0
.L4:
	ldr	r2, .L6
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L5
	bl	__stack_chk_fail
.L5:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	.LC36
	.size	safe_atoi, .-safe_atoi
	.section	.rodata
	.align	2
.LC37:
	.ascii	"Out of memory, failed to allocate %zd bytes\012\000"
	.text
	.align	2
	.global	safe_malloc
	.syntax unified
	.arm
	.fpu softvfp
	.type	safe_malloc, %function
safe_malloc:
	@ 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	r0, [fp, #-16]
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L9
	ldr	r3, .L11
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	ldr	r1, .L11+4
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L9:
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	stderr
	.word	.LC37
	.size	safe_malloc, .-safe_malloc
	.section	.rodata
	.align	2
.LC38:
	.ascii	"Usage: %s thread_count child_threads c_t_ratio\012\012"
	.ascii	"Exactly two argument required:\012    thread_count:"
	.ascii	" Total number of threads to create.\012    child_th"
	.ascii	"reads: The number of threads simulating children.\012"
	.ascii	"    c_t_ratio: The allowed ratio of children to tea"
	.ascii	"chers.\012\012\000"
	.text
	.align	2
	.global	usage
	.syntax unified
	.arm
	.fpu softvfp
	.type	usage, %function
usage:
	@ 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, .L14
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	ldr	r1, .L14+4
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L15:
	.align	2
.L14:
	.word	stderr
	.word	.LC38
	.size	usage, .-usage
	.global	__aeabi_idivmod
	.section	.rodata
	.align	2
.LC42:
	.ascii	"*** Thread %d: Oh no! \000"
	.align	2
.LC43:
	.ascii	"his\000"
	.align	2
.LC44:
	.ascii	"her\000"
	.align	2
.LC45:
	.ascii	"\012*** Why were there only %d teachers for %d chil"
	.ascii	"dren?!\012\000"
	.align	2
.LC46:
	.ascii	"%s\000"
	.align	2
.LC39:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.align	2
.LC40:
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.align	2
.LC41:
	.word	.LC21
	.word	.LC22
	.word	.LC23
	.word	.LC24
	.word	.LC25
	.word	.LC26
	.word	.LC27
	.word	.LC28
	.word	.LC29
	.word	.LC30
	.word	.LC31
	.word	.LC32
	.word	.LC33
	.word	.LC34
	.align	2
.LC47:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	bad_thing
	.syntax unified
	.arm
	.fpu softvfp
	.type	bad_thing, %function
bad_thing:
	@ args = 0, pretend = 0, frame = 1200
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1200
	str	r0, [fp, #-1192]
	str	r1, [fp, #-1196]
	str	r2, [fp, #-1200]
	ldr	r3, .L24
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L24+4
	sub	ip, fp, #1152
	sub	ip, ip, #4
	sub	ip, ip, #8
	mov	lr, r3
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1}
	stm	ip, {r0, r1}
	ldr	r3, .L24+8
	sub	ip, fp, #1136
	sub	ip, ip, #4
	mov	lr, r3
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldr	r3, [lr]
	str	r3, [ip]
	ldr	r3, .L24+12
	sub	ip, fp, #1072
	sub	ip, ip, #4
	sub	ip, ip, #12
	mov	lr, r3
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1}
	stm	ip, {r0, r1}
	bl	rand
	mov	r3, r0
	rsbs	r2, r3, #0
	and	r3, r3, #3
	and	r2, r2, #3
	rsbpl	r3, r2, #0
	str	r3, [fp, #-1188]
	bl	rand
	mov	r3, r0
	cmp	r3, #0
	and	r3, r3, #1
	rsblt	r3, r3, #0
	str	r3, [fp, #-1184]
	ldr	r3, [fp, #-1184]
	cmp	r3, #0
	beq	.L17
	mov	r3, #13
	b	.L18
.L17:
	mov	r3, #14
.L18:
	str	r3, [fp, #-1180]
	bl	rand
	mov	r3, r0
	ldr	r1, [fp, #-1180]
	mov	r0, r3
	bl	__aeabi_idivmod
	mov	r3, r1
	str	r3, [fp, #-1176]
	ldr	r3, [fp, #-1184]
	cmp	r3, #0
	beq	.L19
	ldr	r3, [fp, #-1176]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-1136]
	b	.L20
.L19:
	ldr	r3, [fp, #-1176]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-1084]
.L20:
	str	r3, [fp, #-1172]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	str	r3, [fp, #-1168]
	ldr	r2, [fp, #-1192]
	ldr	r1, .L24+16
	ldr	r0, [fp, #-1168]
	bl	sprintf
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-1168]
	add	r3, r3, r2
	str	r3, [fp, #-1168]
	ldr	r3, [fp, #-1188]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r1, [r3, #-1160]
	ldr	r3, [fp, #-1184]
	cmp	r3, #0
	beq	.L21
	ldr	r3, .L24+20
	b	.L22
.L21:
	ldr	r3, .L24+24
.L22:
	ldr	r2, [fp, #-1172]
	ldr	r0, [fp, #-1168]
	bl	sprintf
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-1168]
	add	r3, r3, r2
	str	r3, [fp, #-1168]
	ldr	r3, [fp, #-1196]
	ldr	r2, [fp, #-1200]
	ldr	r1, .L24+28
	ldr	r0, [fp, #-1168]
	bl	sprintf
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-1168]
	add	r3, r3, r2
	str	r3, [fp, #-1168]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L24+32
	bl	printf
	nop
	ldr	r3, .L24
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L23
	bl	__stack_chk_fail
.L23:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	.LC47
	.word	.LC39
	.word	.LC40
	.word	.LC41
	.word	.LC42
	.word	.LC43
	.word	.LC44
	.word	.LC45
	.word	.LC46
	.size	bad_thing, .-bad_thing
	.section	.rodata
	.align	2
.LC48:
	.ascii	"Internal error: %s called for a Teacher thread.\012"
	.ascii	"\000"
	.align	2
.LC49:
	.ascii	"THREAD %d: CHILD ENTER\012\000"
	.text
	.align	2
	.global	child_enter
	.syntax unified
	.arm
	.fpu softvfp
	.type	child_enter, %function
child_enter:
	@ 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]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #56]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #52]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #60]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #8]
	cmp	r3, #0
	bne	.L27
	ldr	r3, .L32
	ldr	r3, [r3]
	ldr	r2, .L32+4
	ldr	r1, .L32+8
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L27:
	ldr	r3, .L32
	ldr	r0, [r3]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #12]
	mov	r2, r3
	ldr	r1, .L32+12
	bl	fprintf
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	add	r3, r3, #64
	mov	r0, r3
	bl	pthread_mutex_lock
	b	.L28
.L29:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	mov	r2, r3
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	add	r3, r3, #64
	mov	r1, r3
	mov	r0, r2
	bl	pthread_cond_wait
.L28:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	ldr	r3, [r3, #48]
	cmp	r3, #0
	beq	.L29
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	ldr	r2, [r3, #56]
	add	r2, r2, #1
	str	r2, [r3, #56]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	ldr	r2, [r3, #48]
	sub	r2, r2, #1
	str	r2, [r3, #48]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	ldr	r3, [r3, #48]
	cmp	r3, #0
	bgt	.L30
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	ldr	r2, [fp, #-8]
	mul	r3, r2, r3
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	bgt	.L31
.L30:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	pthread_cond_broadcast
.L31:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	add	r3, r3, #64
	mov	r0, r3
	bl	pthread_mutex_unlock
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L33:
	.align	2
.L32:
	.word	stderr
	.word	__func__.6303
	.word	.LC48
	.word	.LC49
	.size	child_enter, .-child_enter
	.section	.rodata
	.align	2
.LC50:
	.ascii	"THREAD %d: CHILD EXIT\012\000"
	.text
	.align	2
	.global	child_exit
	.syntax unified
	.arm
	.fpu softvfp
	.type	child_exit, %function
child_exit:
	@ 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]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #56]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #52]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #60]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #8]
	cmp	r3, #0
	bne	.L35
	ldr	r3, .L38
	ldr	r3, [r3]
	ldr	r2, .L38+4
	ldr	r1, .L38+8
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L35:
	ldr	r3, .L38
	ldr	r0, [r3]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #12]
	mov	r2, r3
	ldr	r1, .L38+12
	bl	fprintf
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	add	r3, r3, #64
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	ldr	r2, [r3, #56]
	sub	r2, r2, #1
	str	r2, [r3, #56]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	ldr	r2, [r3, #48]
	add	r2, r2, #1
	str	r2, [r3, #48]
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	ldr	r2, [fp, #-8]
	mul	r3, r2, r3
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	ble	.L36
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	ldr	r3, [r3, #48]
	cmp	r3, #0
	beq	.L37
.L36:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	pthread_cond_broadcast
.L37:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	add	r3, r3, #64
	mov	r0, r3
	bl	pthread_mutex_unlock
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L39:
	.align	2
.L38:
	.word	stderr
	.word	__func__.6314
	.word	.LC48
	.word	.LC50
	.size	child_exit, .-child_exit
	.section	.rodata
	.align	2
.LC51:
	.ascii	"Internal error: %s called for a Child thread.\012\000"
	.align	2
.LC52:
	.ascii	"THREAD %d: TEACHER ENTER\012\000"
	.text
	.align	2
	.global	teacher_enter
	.syntax unified
	.arm
	.fpu softvfp
	.type	teacher_enter, %function
teacher_enter:
	@ 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]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #56]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #52]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #60]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #8]
	cmp	r3, #0
	beq	.L41
	ldr	r3, .L44
	ldr	r3, [r3]
	ldr	r2, .L44+4
	ldr	r1, .L44+8
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L41:
	ldr	r3, .L44
	ldr	r0, [r3]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #12]
	mov	r2, r3
	ldr	r1, .L44+12
	bl	fprintf
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	add	r3, r3, #64
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	ldr	r2, [r3, #52]
	add	r2, r2, #1
	str	r2, [r3, #52]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	ldr	r1, [r3, #48]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-8]
	add	r2, r1, r2
	str	r2, [r3, #48]
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	ldr	r2, [fp, #-8]
	mul	r3, r2, r3
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	ble	.L42
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	ldr	r3, [r3, #48]
	cmp	r3, #0
	beq	.L43
.L42:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	pthread_cond_broadcast
.L43:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	add	r3, r3, #64
	mov	r0, r3
	bl	pthread_mutex_unlock
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L45:
	.align	2
.L44:
	.word	stderr
	.word	__func__.6322
	.word	.LC51
	.word	.LC52
	.size	teacher_enter, .-teacher_enter
	.section	.rodata
	.align	2
.LC53:
	.ascii	"THREAD %d: TEACHER EXIT\012\000"
	.text
	.align	2
	.global	teacher_exit
	.syntax unified
	.arm
	.fpu softvfp
	.type	teacher_exit, %function
teacher_exit:
	@ 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]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #56]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #52]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #60]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #8]
	cmp	r3, #0
	beq	.L47
	ldr	r3, .L52
	ldr	r3, [r3]
	ldr	r2, .L52+4
	ldr	r1, .L52+8
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L47:
	ldr	r3, .L52
	ldr	r0, [r3]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #12]
	mov	r2, r3
	ldr	r1, .L52+12
	bl	fprintf
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	add	r3, r3, #64
	mov	r0, r3
	bl	pthread_mutex_lock
	b	.L48
.L49:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	mov	r2, r3
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	add	r3, r3, #64
	mov	r1, r3
	mov	r0, r2
	bl	pthread_cond_wait
.L48:
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	ldr	r2, [fp, #-8]
	mul	r3, r2, r3
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	bgt	.L49
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	ldr	r3, [r3, #48]
	cmp	r3, #0
	bne	.L49
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	ldr	r2, [r3, #52]
	sub	r2, r2, #1
	str	r2, [r3, #52]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	ldr	r1, [r3, #48]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-8]
	sub	r2, r1, r2
	str	r2, [r3, #48]
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	ldr	r2, [fp, #-8]
	mul	r3, r2, r3
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	ble	.L50
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	ldr	r3, [r3, #48]
	cmp	r3, #0
	beq	.L51
.L50:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	pthread_cond_broadcast
.L51:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	add	r3, r3, #64
	mov	r0, r3
	bl	pthread_mutex_unlock
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L53:
	.align	2
.L52:
	.word	stderr
	.word	__func__.6330
	.word	.LC51
	.word	.LC53
	.size	teacher_exit, .-teacher_exit
	.section	.rodata
	.align	2
.LC54:
	.ascii	"            Thread %d: Teachers: %d, Children: %d\012"
	.ascii	"\000"
	.text
	.align	2
	.global	verify
	.syntax unified
	.arm
	.fpu softvfp
	.type	verify, %function
verify:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #56]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #52]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #60]
	str	r3, [fp, #-8]
	ldr	r3, .L57
	ldr	r0, [r3]
	ldr	r3, [fp, #-24]
	ldr	r2, [r3, #12]
	ldr	r3, [fp, #-16]
	str	r3, [sp]
	ldr	r3, [fp, #-12]
	ldr	r1, .L57+4
	bl	fprintf
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-8]
	mul	r3, r2, r3
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	ble	.L56
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #12]
	ldr	r2, [fp, #-12]
	ldr	r1, [fp, #-16]
	mov	r0, r3
	bl	bad_thing
	mov	r0, #1
	bl	exit
.L56:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L58:
	.align	2
.L57:
	.word	stderr
	.word	.LC54
	.size	verify, .-verify
	.section	.rodata
	.align	2
.LC55:
	.ascii	"Thread %d of %d. START.\012\000"
	.align	2
.LC56:
	.ascii	"Child\000"
	.align	2
.LC57:
	.ascii	"Teacher\000"
	.align	2
.LC58:
	.ascii	"Thread %d [%s]: Entering.\012\000"
	.align	2
.LC59:
	.ascii	"Thread %d [%s]: Entered.\012\000"
	.align	2
.LC60:
	.ascii	"Thread %d [%s]: Exiting.\012\000"
	.align	2
.LC61:
	.ascii	"Thread %d [%s]: Exited.\012\000"
	.text
	.align	2
	.global	thread_start_fn
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread_start_fn, %function
thread_start_fn:
	@ 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, #-12]
	ldr	r3, .L67
	ldr	r0, [r3]
	ldr	r3, [fp, #-12]
	ldr	r2, [r3, #12]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #16]
	ldr	r1, .L67+4
	bl	fprintf
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #8]
	cmp	r3, #0
	beq	.L60
	ldr	r3, .L67+8
	b	.L61
.L60:
	ldr	r3, .L67+12
.L61:
	str	r3, [fp, #-8]
.L66:
	ldr	r3, .L67
	ldr	r0, [r3]
	ldr	r3, [fp, #-12]
	ldr	r2, [r3, #12]
	ldr	r3, [fp, #-8]
	ldr	r1, .L67+16
	bl	fprintf
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #8]
	cmp	r3, #0
	beq	.L62
	ldr	r0, [fp, #-12]
	bl	child_enter
	b	.L63
.L62:
	ldr	r0, [fp, #-12]
	bl	teacher_enter
.L63:
	ldr	r3, .L67
	ldr	r0, [r3]
	ldr	r3, [fp, #-12]
	ldr	r2, [r3, #12]
	ldr	r3, [fp, #-8]
	ldr	r1, .L67+20
	bl	fprintf
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #4]
	add	r3, r3, #64
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r0, [fp, #-12]
	bl	verify
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #4]
	add	r3, r3, #64
	mov	r0, r3
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-12]
	add	r3, r3, #20
	mov	r0, r3
	bl	rand_r
	ldr	r3, .L67+24
	smull	r2, r3, r0, r3
	asr	r2, r3, #18
	asr	r3, r0, #31
	sub	r1, r2, r3
	mov	r2, r1
	lsl	r2, r2, #5
	sub	r2, r2, r1
	lsl	r3, r2, #6
	sub	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r1
	lsl	r3, r3, #6
	sub	r1, r0, r3
	mov	r3, r1
	mov	r0, r3
	bl	usleep
	ldr	r3, .L67
	ldr	r0, [r3]
	ldr	r3, [fp, #-12]
	ldr	r2, [r3, #12]
	ldr	r3, [fp, #-8]
	ldr	r1, .L67+28
	bl	fprintf
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #8]
	cmp	r3, #0
	beq	.L64
	ldr	r0, [fp, #-12]
	bl	child_exit
	b	.L65
.L64:
	ldr	r0, [fp, #-12]
	bl	teacher_exit
.L65:
	ldr	r3, .L67
	ldr	r0, [r3]
	ldr	r3, [fp, #-12]
	ldr	r2, [r3, #12]
	ldr	r3, [fp, #-8]
	ldr	r1, .L67+32
	bl	fprintf
	ldr	r3, [fp, #-12]
	add	r3, r3, #20
	mov	r0, r3
	bl	rand_r
	mov	r3, r0
	ldr	r2, .L67+36
	smull	r1, r2, r3, r2
	asr	r1, r2, #13
	asr	r2, r3, #31
	sub	r2, r1, r2
	ldr	r1, .L67+40
	mul	r2, r1, r2
	sub	r2, r3, r2
	mov	r3, r2
	mov	r0, r3
	bl	usleep
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #4]
	add	r3, r3, #64
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r0, [fp, #-12]
	bl	verify
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #4]
	add	r3, r3, #64
	mov	r0, r3
	bl	pthread_mutex_unlock
	b	.L66
.L68:
	.align	2
.L67:
	.word	stderr
	.word	.LC55
	.word	.LC56
	.word	.LC57
	.word	.LC58
	.word	.LC59
	.word	1125899907
	.word	.LC60
	.word	.LC61
	.word	351843721
	.word	100000
	.size	thread_start_fn, .-thread_start_fn
	.section	.rodata
	.align	2
.LC62:
	.ascii	"`%s' is not valid for `thread_count'\012\000"
	.align	2
.LC63:
	.ascii	"`%s' is not valid for `child_threads'\012\000"
	.align	2
.LC64:
	.ascii	"`%s' is not valid for `c_t_ratio'\012\000"
	.align	2
.LC65:
	.ascii	"pthread_mutex_init\000"
	.align	2
.LC66:
	.ascii	"pthread_create\000"
	.align	2
.LC67:
	.ascii	"pthread_join\000"
	.align	2
.LC68:
	.ascii	"OK.\000"
	.align	2
.LC69:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ 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]
	str	r1, [fp, #-44]
	ldr	r3, .L86
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-40]
	cmp	r3, #4
	beq	.L70
	ldr	r3, [fp, #-44]
	ldr	r3, [r3]
	mov	r0, r3
	bl	usage
.L70:
	ldr	r3, [fp, #-44]
	add	r3, r3, #4
	ldr	r3, [r3]
	sub	r2, fp, #36
	mov	r1, r2
	mov	r0, r3
	bl	safe_atoi
	mov	r3, r0
	cmp	r3, #0
	blt	.L71
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bgt	.L72
.L71:
	ldr	r3, .L86+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-44]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L86+8
	bl	fprintf
	mov	r0, #1
	bl	exit
.L72:
	ldr	r3, [fp, #-44]
	add	r3, r3, #8
	ldr	r3, [r3]
	sub	r2, fp, #32
	mov	r1, r2
	mov	r0, r3
	bl	safe_atoi
	mov	r3, r0
	cmp	r3, #0
	blt	.L73
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	blt	.L73
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-36]
	cmp	r2, r3
	ble	.L74
.L73:
	ldr	r3, .L86+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-44]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L86+12
	bl	fprintf
	mov	r0, #1
	bl	exit
.L74:
	ldr	r3, [fp, #-44]
	add	r3, r3, #12
	ldr	r3, [r3]
	sub	r2, fp, #28
	mov	r1, r2
	mov	r0, r3
	bl	safe_atoi
	mov	r3, r0
	cmp	r3, #0
	blt	.L75
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bgt	.L76
.L75:
	ldr	r3, .L86+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-44]
	add	r3, r3, #12
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L86+16
	bl	fprintf
	mov	r0, #1
	bl	exit
.L76:
	mov	r0, #0
	bl	time
	mov	r3, r0
	mov	r0, r3
	bl	srand
	mov	r0, #88
	bl	safe_malloc
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	mov	r2, #0
	str	r2, [r3, #56]
	ldr	r3, [fp, #-20]
	ldr	r2, [r3, #56]
	ldr	r3, [fp, #-20]
	str	r2, [r3, #52]
	ldr	r2, [fp, #-28]
	ldr	r3, [fp, #-20]
	str	r2, [r3, #60]
	ldr	r3, [fp, #-20]
	mov	r2, #0
	str	r2, [r3, #48]
	ldr	r3, [fp, #-20]
	add	r3, r3, #64
	mov	r1, #0
	mov	r0, r3
	bl	pthread_mutex_init
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L77
	bl	__errno_location
	mov	r2, r0
	ldr	r3, [fp, #-16]
	str	r3, [r2]
	ldr	r0, .L86+20
	bl	perror
	mov	r0, #1
	bl	exit
.L77:
	ldr	r3, [fp, #-36]
	mov	r2, r3
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r0, r3
	bl	safe_malloc
	str	r0, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L78
.L80:
	ldr	r2, [fp, #-24]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r2, r3
	ldr	r3, [fp, #-12]
	add	r3, r3, r2
	ldr	r2, [fp, #-20]
	str	r2, [r3, #4]
	ldr	r2, [fp, #-24]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r2, r3
	ldr	r3, [fp, #-12]
	add	r3, r3, r2
	ldr	r2, [fp, #-24]
	str	r2, [r3, #12]
	ldr	r2, [fp, #-24]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r2, r3
	ldr	r3, [fp, #-12]
	add	r3, r3, r2
	ldr	r2, [fp, #-36]
	str	r2, [r3, #16]
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	movlt	r3, #1
	movge	r3, #0
	and	r1, r3, #255
	ldr	r2, [fp, #-24]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r2, r3
	ldr	r3, [fp, #-12]
	add	r3, r3, r2
	mov	r2, r1
	str	r2, [r3, #8]
	bl	rand
	mov	r1, r0
	ldr	r2, [fp, #-24]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r2, r3
	ldr	r3, [fp, #-12]
	add	r3, r3, r2
	mov	r2, r1
	str	r2, [r3, #20]
	ldr	r2, [fp, #-24]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r2, r3
	ldr	r3, [fp, #-12]
	add	r3, r3, r2
	mov	r0, r3
	ldr	r2, [fp, #-24]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r2, r3
	ldr	r3, [fp, #-12]
	add	r3, r3, r2
	ldr	r2, .L86+24
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L79
	bl	__errno_location
	mov	r2, r0
	ldr	r3, [fp, #-16]
	str	r3, [r2]
	ldr	r0, .L86+28
	bl	perror
	mov	r0, #1
	bl	exit
.L79:
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L78:
	ldr	r3, [fp, #-36]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	blt	.L80
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L81
.L83:
	ldr	r2, [fp, #-24]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r2, r3
	ldr	r3, [fp, #-12]
	add	r3, r3, r2
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L82
	bl	__errno_location
	mov	r2, r0
	ldr	r3, [fp, #-16]
	str	r3, [r2]
	ldr	r0, .L86+32
	bl	perror
	mov	r0, #1
	bl	exit
.L82:
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L81:
	ldr	r3, [fp, #-36]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	blt	.L83
	ldr	r0, .L86+36
	bl	puts
	mov	r3, #0
	ldr	r2, .L86
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L85
	bl	__stack_chk_fail
.L85:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L87:
	.align	2
.L86:
	.word	.LC69
	.word	stderr
	.word	.LC62
	.word	.LC63
	.word	.LC64
	.word	.LC65
	.word	thread_start_fn
	.word	.LC66
	.word	.LC67
	.word	.LC68
	.size	main, .-main
	.section	.rodata
	.align	2
	.type	__func__.6303, %object
	.size	__func__.6303, 12
__func__.6303:
	.ascii	"child_enter\000"
	.align	2
	.type	__func__.6314, %object
	.size	__func__.6314, 11
__func__.6314:
	.ascii	"child_exit\000"
	.align	2
	.type	__func__.6322, %object
	.size	__func__.6322, 14
__func__.6322:
	.ascii	"teacher_enter\000"
	.align	2
	.type	__func__.6330, %object
	.size	__func__.6330, 13
__func__.6330:
	.ascii	"teacher_exit\000"
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
