	.file	"2034.c"
	.intel_syntax noprefix
	.text
	.globl	studentsInRoom
	.bss
	.align 4
	.type	studentsInRoom, @object
	.size	studentsInRoom, 4
studentsInRoom:
	.zero	4
	.globl	deanInRoom
	.align 4
	.type	deanInRoom, @object
	.size	deanInRoom, 4
deanInRoom:
	.zero	4
	.globl	mutex
	.align 32
	.type	mutex, @object
	.size	mutex, 40
mutex:
	.zero	40
	.globl	deanLeft
	.align 32
	.type	deanLeft, @object
	.size	deanLeft, 48
deanLeft:
	.zero	48
	.globl	studentsLeft
	.align 32
	.type	studentsLeft, @object
	.size	studentsLeft, 48
studentsLeft:
	.zero	48
	.section	.rodata
	.align 8
.LC0:
	.string	"Dean entrou na sala pois h\303\241 %d alunos na sala\n"
.LC1:
	.string	"Dean saindo da sala"
	.text
	.globl	dean
	.type	dean, @function
dean:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	jmp	.L2
.L5:
	lea	rdi, mutex[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR studentsInRoom[rip]
	test	eax, eax
	je	.L3
	mov	eax, DWORD PTR studentsInRoom[rip]
	cmp	eax, 50
	jle	.L4
.L3:
	mov	DWORD PTR deanInRoom[rip], 1
	mov	eax, DWORD PTR studentsInRoom[rip]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
.L4:
	lea	rdi, mutex[rip]
	call	pthread_mutex_unlock@PLT
.L2:
	mov	eax, DWORD PTR deanInRoom[rip]
	test	eax, eax
	je	.L5
	lea	rdi, mutex[rip]
	call	pthread_mutex_lock@PLT
	jmp	.L6
.L7:
	lea	rsi, mutex[rip]
	lea	rdi, studentsLeft[rip]
	call	pthread_cond_wait@PLT
.L6:
	mov	eax, DWORD PTR studentsInRoom[rip]
	test	eax, eax
	jg	.L7
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	DWORD PTR deanInRoom[rip], 0
	lea	rdi, deanLeft[rip]
	call	pthread_cond_broadcast@PLT
	lea	rdi, mutex[rip]
	call	pthread_mutex_unlock@PLT
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	dean, .-dean
	.section	.rodata
	.align 8
.LC2:
	.string	"Aluno esperando dean sair para entrar na sala"
.LC3:
	.string	"Aluno entrando na sala"
.LC4:
	.string	"Aluno saindo da sala"
	.text
	.globl	student
	.type	student, @function
student:
.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	DWORD PTR -4[rbp], 0
.L14:
	lea	rdi, mutex[rip]
	call	pthread_mutex_lock@PLT
	jmp	.L10
.L12:
	lea	rdi, .LC2[rip]
	call	puts@PLT
	lea	rsi, mutex[rip]
	lea	rdi, deanLeft[rip]
	call	pthread_cond_wait@PLT
.L10:
	cmp	DWORD PTR -4[rbp], 0
	jne	.L11
	mov	eax, DWORD PTR deanInRoom[rip]
	test	eax, eax
	jne	.L12
.L11:
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	DWORD PTR -4[rbp], 1
	mov	eax, DWORD PTR studentsInRoom[rip]
	add	eax, 1
	mov	DWORD PTR studentsInRoom[rip], eax
	lea	rdi, mutex[rip]
	call	pthread_mutex_unlock@PLT
	lea	rdi, mutex[rip]
	call	pthread_mutex_lock@PLT
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	DWORD PTR -4[rbp], 0
	mov	eax, DWORD PTR studentsInRoom[rip]
	sub	eax, 1
	mov	DWORD PTR studentsInRoom[rip], eax
	mov	eax, DWORD PTR studentsInRoom[rip]
	test	eax, eax
	jne	.L13
	mov	eax, DWORD PTR deanInRoom[rip]
	test	eax, eax
	je	.L13
	lea	rdi, studentsLeft[rip]
	call	pthread_cond_signal@PLT
.L13:
	lea	rdi, mutex[rip]
	call	pthread_mutex_unlock@PLT
	jmp	.L14
	.cfi_endproc
.LFE1:
	.size	student, .-student
	.globl	main
	.type	main, @function
main:
.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, 832
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -824[rbp]
	mov	ecx, 0
	lea	rdx, dean[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	DWORD PTR -828[rbp], 0
	jmp	.L16
.L17:
	lea	rdx, -816[rbp]
	mov	eax, DWORD PTR -828[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	ecx, 0
	lea	rdx, student[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	add	DWORD PTR -828[rbp], 1
.L16:
	cmp	DWORD PTR -828[rbp], 99
	jle	.L17
	mov	rax, QWORD PTR -824[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	"2034.c"
	.text
	.global	studentsInRoom
	.bss
	.align	2
	.type	studentsInRoom, %object
	.size	studentsInRoom, 4
studentsInRoom:
	.space	4
	.global	deanInRoom
	.align	2
	.type	deanInRoom, %object
	.size	deanInRoom, 4
deanInRoom:
	.space	4
	.global	mutex
	.align	2
	.type	mutex, %object
	.size	mutex, 24
mutex:
	.space	24
	.global	deanLeft
	.align	3
	.type	deanLeft, %object
	.size	deanLeft, 48
deanLeft:
	.space	48
	.global	studentsLeft
	.align	3
	.type	studentsLeft, %object
	.size	studentsLeft, 48
studentsLeft:
	.space	48
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Dean entrou na sala pois h\303\241 %d alunos na sal"
	.ascii	"a\012\000"
	.align	2
.LC1:
	.ascii	"Dean saindo da sala\000"
	.text
	.align	2
	.global	dean
	.syntax unified
	.arm
	.fpu softvfp
	.type	dean, %function
dean:
	@ 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]
	b	.L2
.L5:
	ldr	r0, .L9
	bl	pthread_mutex_lock
	ldr	r3, .L9+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L3
	ldr	r3, .L9+4
	ldr	r3, [r3]
	cmp	r3, #50
	ble	.L4
.L3:
	ldr	r3, .L9+8
	mov	r2, #1
	str	r2, [r3]
	ldr	r3, .L9+4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L9+12
	bl	printf
.L4:
	ldr	r0, .L9
	bl	pthread_mutex_unlock
.L2:
	ldr	r3, .L9+8
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L5
	ldr	r0, .L9
	bl	pthread_mutex_lock
	b	.L6
.L7:
	ldr	r1, .L9
	ldr	r0, .L9+16
	bl	pthread_cond_wait
.L6:
	ldr	r3, .L9+4
	ldr	r3, [r3]
	cmp	r3, #0
	bgt	.L7
	ldr	r0, .L9+20
	bl	puts
	ldr	r3, .L9+8
	mov	r2, #0
	str	r2, [r3]
	ldr	r0, .L9+24
	bl	pthread_cond_broadcast
	ldr	r0, .L9
	bl	pthread_mutex_unlock
	b	.L2
.L10:
	.align	2
.L9:
	.word	mutex
	.word	studentsInRoom
	.word	deanInRoom
	.word	.LC0
	.word	studentsLeft
	.word	.LC1
	.word	deanLeft
	.size	dean, .-dean
	.section	.rodata
	.align	2
.LC2:
	.ascii	"Aluno esperando dean sair para entrar na sala\000"
	.align	2
.LC3:
	.ascii	"Aluno entrando na sala\000"
	.align	2
.LC4:
	.ascii	"Aluno saindo da sala\000"
	.text
	.align	2
	.global	student
	.syntax unified
	.arm
	.fpu softvfp
	.type	student, %function
student:
	@ 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]
	mov	r3, #0
	str	r3, [fp, #-8]
.L16:
	ldr	r0, .L17
	bl	pthread_mutex_lock
	b	.L12
.L14:
	ldr	r0, .L17+4
	bl	puts
	ldr	r1, .L17
	ldr	r0, .L17+8
	bl	pthread_cond_wait
.L12:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L13
	ldr	r3, .L17+12
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L14
.L13:
	ldr	r0, .L17+16
	bl	puts
	mov	r3, #1
	str	r3, [fp, #-8]
	ldr	r3, .L17+20
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L17+20
	str	r3, [r2]
	ldr	r0, .L17
	bl	pthread_mutex_unlock
	ldr	r0, .L17
	bl	pthread_mutex_lock
	ldr	r0, .L17+24
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-8]
	ldr	r3, .L17+20
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L17+20
	str	r3, [r2]
	ldr	r3, .L17+20
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L15
	ldr	r3, .L17+12
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L15
	ldr	r0, .L17+28
	bl	pthread_cond_signal
.L15:
	ldr	r0, .L17
	bl	pthread_mutex_unlock
	b	.L16
.L18:
	.align	2
.L17:
	.word	mutex
	.word	.LC2
	.word	deanLeft
	.word	deanInRoom
	.word	.LC3
	.word	studentsInRoom
	.word	.LC4
	.word	studentsLeft
	.size	student, .-student
	.section	.rodata
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 416
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #416
	ldr	r3, .L24
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r0, fp, #416
	mov	r3, #0
	ldr	r2, .L24+4
	mov	r1, #0
	bl	pthread_create
	mov	r3, #0
	str	r3, [fp, #-412]
	b	.L20
.L21:
	sub	r2, fp, #408
	ldr	r3, [fp, #-412]
	lsl	r3, r3, #2
	add	r0, r2, r3
	mov	r3, #0
	ldr	r2, .L24+8
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-412]
	add	r3, r3, #1
	str	r3, [fp, #-412]
.L20:
	ldr	r3, [fp, #-412]
	cmp	r3, #99
	ble	.L21
	ldr	r3, [fp, #-416]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	mov	r3, #0
	ldr	r2, .L24
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L23
	bl	__stack_chk_fail
.L23:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	.LC5
	.word	dean
	.word	student
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
