	.file	"109969.c"
	.intel_syntax noprefix
	.text
	.globl	state
	.bss
	.align 16
	.type	state, @object
	.size	state, 20
state:
	.zero	20
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	mutex
	.align 32
	.type	mutex, @object
	.size	mutex, 40
mutex:
	.zero	40
	.globl	forks
	.align 32
	.type	forks, @object
	.size	forks, 200
forks:
	.zero	200
	.globl	philosofers
	.align 32
	.type	philosofers, @object
	.size	philosofers, 40
philosofers:
	.zero	40
	.section	.rodata
.LC0:
	.string	"filosofo %d entrou\n"
.LC1:
	.string	"filosofo %d saindo\n"
	.text
	.globl	philosofer
	.type	philosofer, @function
philosofer:
.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	eax, DWORD PTR [rax]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	add	eax, 1
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -8[rbp], 0
	jmp	.L2
.L3:
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	think
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	take_forks
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	eat
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	put_forks
	add	DWORD PTR -8[rbp], 1
.L2:
	cmp	DWORD PTR -8[rbp], 1
	jle	.L3
	mov	eax, DWORD PTR -4[rbp]
	add	eax, 1
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE6:
	.size	philosofer, .-philosofer
	.globl	think
	.type	think, @function
think:
.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	DWORD PTR -20[rbp], edi
	call	rand@PLT
	mov	edx, eax
	movsx	rax, edx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax, 2
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	mov	DWORD PTR -4[rbp], eax
	mov	ecx, DWORD PTR -4[rbp]
	mov	eax, ecx
	sal	eax, 2
	add	eax, ecx
	add	eax, eax
	sub	edx, eax
	mov	DWORD PTR -4[rbp], edx
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	sleep@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	think, .-think
	.globl	eat
	.type	eat, @function
eat:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	call	rand@PLT
	mov	edx, eax
	movsx	rax, edx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax, 2
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	mov	DWORD PTR -4[rbp], eax
	mov	ecx, DWORD PTR -4[rbp]
	mov	eax, ecx
	sal	eax, 2
	add	eax, ecx
	add	eax, eax
	sub	edx, eax
	mov	DWORD PTR -4[rbp], edx
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	sleep@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	eat, .-eat
	.globl	take_forks
	.type	take_forks, @function
take_forks:
.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, 16
	mov	DWORD PTR -4[rbp], edi
	lea	rdi, mutex[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	mov	DWORD PTR [rdx+rax], 1
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	print_status
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	test
	lea	rdi, mutex[rip]
	call	pthread_mutex_unlock@PLT
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	lea	rdx, forks[rip]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	take_forks, .-take_forks
	.globl	put_forks
	.type	put_forks, @function
put_forks:
.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, 16
	mov	DWORD PTR -4[rbp], edi
	lea	rdi, mutex[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	mov	DWORD PTR [rdx+rax], 0
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	print_status
	mov	eax, DWORD PTR -4[rbp]
	lea	edx, 4[rax]
	movsx	rax, edx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	mov	ecx, eax
	sal	ecx, 2
	add	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	mov	edi, eax
	call	test
	mov	eax, DWORD PTR -4[rbp]
	lea	edx, 1[rax]
	movsx	rax, edx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	mov	ecx, eax
	sal	ecx, 2
	add	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	mov	edi, eax
	call	test
	lea	rdi, mutex[rip]
	call	pthread_mutex_unlock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	put_forks, .-put_forks
	.globl	test
	.type	test, @function
test:
.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, 16
	mov	DWORD PTR -4[rbp], edi
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	mov	eax, DWORD PTR [rdx+rax]
	cmp	eax, 1
	jne	.L10
	mov	eax, DWORD PTR -4[rbp]
	lea	edx, 4[rax]
	movsx	rax, edx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	mov	ecx, eax
	sal	ecx, 2
	add	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	mov	eax, DWORD PTR [rdx+rax]
	cmp	eax, 2
	je	.L10
	mov	eax, DWORD PTR -4[rbp]
	lea	edx, 1[rax]
	movsx	rax, edx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	mov	ecx, eax
	sal	ecx, 2
	add	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	mov	eax, DWORD PTR [rdx+rax]
	cmp	eax, 2
	je	.L10
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	mov	DWORD PTR [rdx+rax], 2
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	print_status
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	lea	rdx, forks[rip]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
.L10:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	test, .-test
	.section	.rodata
.LC2:
	.string	"O filosofo %d esta pensando!\n"
.LC3:
	.string	"O filosofo %d esta com fome!\n"
.LC4:
	.string	"O filosofo %d esta comendo!\n"
	.text
	.globl	print_status
	.type	print_status, @function
print_status:
.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, 16
	mov	DWORD PTR -4[rbp], edi
	mov	edi, 10
	call	putchar@PLT
	mov	DWORD PTR -4[rbp], 1
	jmp	.L12
.L16:
	mov	eax, DWORD PTR -4[rbp]
	sub	eax, 1
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	mov	eax, DWORD PTR [rdx+rax]
	test	eax, eax
	jne	.L13
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
.L13:
	mov	eax, DWORD PTR -4[rbp]
	sub	eax, 1
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	mov	eax, DWORD PTR [rdx+rax]
	cmp	eax, 1
	jne	.L14
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
.L14:
	mov	eax, DWORD PTR -4[rbp]
	sub	eax, 1
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	mov	eax, DWORD PTR [rdx+rax]
	cmp	eax, 2
	jne	.L15
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
.L15:
	add	DWORD PTR -4[rbp], 1
.L12:
	cmp	DWORD PTR -4[rbp], 5
	jle	.L16
	mov	edi, 10
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	print_status, .-print_status
	.section	.rodata
.LC5:
	.string	"todas os filosofos sairam"
	.text
	.globl	main
	.type	main, @function
main:
.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, 16
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	esi, 0
	lea	rdi, mutex[rip]
	call	pthread_mutex_init@PLT
	mov	DWORD PTR -16[rbp], 0
	jmp	.L18
.L19:
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, philosofers[rip]
	lea	rdi, [rdx+rax]
	lea	rax, -16[rbp]
	mov	rcx, rax
	lea	rdx, philosofer[rip]
	mov	esi, 0
	call	pthread_create@PLT
	mov	edi, 1
	call	sleep@PLT
	mov	eax, DWORD PTR -16[rbp]
	add	eax, 1
	mov	DWORD PTR -16[rbp], eax
.L18:
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, 4
	jle	.L19
	lea	rdi, mutex[rip]
	call	pthread_mutex_destroy@PLT
	mov	DWORD PTR -12[rbp], 0
	jmp	.L20
.L21:
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	lea	rdx, forks[rip]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_destroy@PLT
	add	DWORD PTR -12[rbp], 1
.L20:
	cmp	DWORD PTR -12[rbp], 4
	jle	.L21
	mov	rax, QWORD PTR philosofers[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR philosofers[rip+8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR philosofers[rip+16]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR philosofers[rip+24]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR philosofers[rip+32]
	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	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.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	"109969.c"
	.text
	.comm	state,20,4
	.comm	i,4,4
	.comm	mutex,24,4
	.comm	forks,120,4
	.comm	philosofers,20,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"filosofo %d entrou\012\000"
	.align	2
.LC1:
	.ascii	"filosofo %d saindo\012\000"
	.text
	.align	2
	.global	philosofer
	.syntax unified
	.arm
	.fpu softvfp
	.type	philosofer, %function
philosofer:
	@ 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]
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, .L4
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L2
.L3:
	ldr	r0, [fp, #-8]
	bl	think
	ldr	r0, [fp, #-8]
	bl	take_forks
	ldr	r0, [fp, #-8]
	bl	eat
	ldr	r0, [fp, #-8]
	bl	put_forks
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L2:
	ldr	r3, [fp, #-12]
	cmp	r3, #1
	ble	.L3
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, .L4+4
	bl	printf
	mov	r0, #0
	bl	pthread_exit
.L5:
	.align	2
.L4:
	.word	.LC0
	.word	.LC1
	.size	philosofer, .-philosofer
	.align	2
	.global	think
	.syntax unified
	.arm
	.fpu softvfp
	.type	think, %function
think:
	@ 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]
	bl	rand
	mov	r2, r0
	ldr	r3, .L7
	smull	r1, r3, r2, r3
	asr	r1, r3, #2
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	lsl	r3, r3, #1
	sub	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	bl	sleep
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	1717986919
	.size	think, .-think
	.align	2
	.global	eat
	.syntax unified
	.arm
	.fpu softvfp
	.type	eat, %function
eat:
	@ 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]
	bl	rand
	mov	r2, r0
	ldr	r3, .L10
	smull	r1, r3, r2, r3
	asr	r1, r3, #2
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	lsl	r3, r3, #1
	sub	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	bl	sleep
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	1717986919
	.size	eat, .-eat
	.align	2
	.global	take_forks
	.syntax unified
	.arm
	.fpu softvfp
	.type	take_forks, %function
take_forks:
	@ 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	r0, .L13
	bl	pthread_mutex_lock
	ldr	r2, .L13+4
	ldr	r3, [fp, #-8]
	mov	r1, #1
	str	r1, [r2, r3, lsl #2]
	ldr	r0, [fp, #-8]
	bl	print_status
	ldr	r0, [fp, #-8]
	bl	test
	ldr	r0, .L13
	bl	pthread_mutex_unlock
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L13+8
	add	r3, r3, r2
	mov	r0, r3
	bl	pthread_mutex_lock
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L14:
	.align	2
.L13:
	.word	mutex
	.word	state
	.word	forks
	.size	take_forks, .-take_forks
	.align	2
	.global	put_forks
	.syntax unified
	.arm
	.fpu softvfp
	.type	put_forks, %function
put_forks:
	@ 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	r0, .L16
	bl	pthread_mutex_lock
	ldr	r2, .L16+4
	ldr	r3, [fp, #-8]
	mov	r1, #0
	str	r1, [r2, r3, lsl #2]
	ldr	r0, [fp, #-8]
	bl	print_status
	ldr	r3, [fp, #-8]
	add	r2, r3, #4
	ldr	r3, .L16+8
	smull	r1, r3, r2, r3
	asr	r1, r3, #1
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	sub	r1, r2, r3
	mov	r0, r1
	bl	test
	ldr	r3, [fp, #-8]
	add	r2, r3, #1
	ldr	r3, .L16+8
	smull	r1, r3, r2, r3
	asr	r1, r3, #1
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	sub	r1, r2, r3
	mov	r0, r1
	bl	test
	ldr	r0, .L16
	bl	pthread_mutex_unlock
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	mutex
	.word	state
	.word	1717986919
	.size	put_forks, .-put_forks
	.align	2
	.global	test
	.syntax unified
	.arm
	.fpu softvfp
	.type	test, %function
test:
	@ 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	r2, .L21
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	cmp	r3, #1
	bne	.L20
	ldr	r3, [fp, #-8]
	add	r1, r3, #4
	ldr	r3, .L21+4
	smull	r2, r3, r1, r3
	asr	r2, r3, #1
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	sub	r2, r1, r3
	ldr	r3, .L21
	ldr	r3, [r3, r2, lsl #2]
	cmp	r3, #2
	beq	.L20
	ldr	r3, [fp, #-8]
	add	r1, r3, #1
	ldr	r3, .L21+4
	smull	r2, r3, r1, r3
	asr	r2, r3, #1
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	sub	r2, r1, r3
	ldr	r3, .L21
	ldr	r3, [r3, r2, lsl #2]
	cmp	r3, #2
	beq	.L20
	ldr	r2, .L21
	ldr	r3, [fp, #-8]
	mov	r1, #2
	str	r1, [r2, r3, lsl #2]
	ldr	r0, [fp, #-8]
	bl	print_status
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L21+8
	add	r3, r3, r2
	mov	r0, r3
	bl	pthread_mutex_unlock
.L20:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	state
	.word	1717986919
	.word	forks
	.size	test, .-test
	.section	.rodata
	.align	2
.LC2:
	.ascii	"O filosofo %d esta pensando!\012\000"
	.align	2
.LC3:
	.ascii	"O filosofo %d esta com fome!\012\000"
	.align	2
.LC4:
	.ascii	"O filosofo %d esta comendo!\012\000"
	.text
	.align	2
	.global	print_status
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_status, %function
print_status:
	@ 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]
	mov	r0, #10
	bl	putchar
	mov	r3, #1
	str	r3, [fp, #-8]
	b	.L24
.L28:
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	ldr	r2, .L29
	ldr	r3, [r2, r3, lsl #2]
	cmp	r3, #0
	bne	.L25
	ldr	r1, [fp, #-8]
	ldr	r0, .L29+4
	bl	printf
.L25:
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	ldr	r2, .L29
	ldr	r3, [r2, r3, lsl #2]
	cmp	r3, #1
	bne	.L26
	ldr	r1, [fp, #-8]
	ldr	r0, .L29+8
	bl	printf
.L26:
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	ldr	r2, .L29
	ldr	r3, [r2, r3, lsl #2]
	cmp	r3, #2
	bne	.L27
	ldr	r1, [fp, #-8]
	ldr	r0, .L29+12
	bl	printf
.L27:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L24:
	ldr	r3, [fp, #-8]
	cmp	r3, #5
	ble	.L28
	mov	r0, #10
	bl	putchar
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L30:
	.align	2
.L29:
	.word	state
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	print_status, .-print_status
	.section	.rodata
	.align	2
.LC5:
	.ascii	"todas os filosofos sairam\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, .L38
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r1, #0
	ldr	r0, .L38+4
	bl	pthread_mutex_init
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L32
.L33:
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	ldr	r2, .L38+8
	add	r0, r3, r2
	sub	r3, fp, #16
	ldr	r2, .L38+12
	mov	r1, #0
	bl	pthread_create
	mov	r0, #1
	bl	sleep
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L32:
	ldr	r3, [fp, #-16]
	cmp	r3, #4
	ble	.L33
	ldr	r0, .L38+4
	bl	pthread_mutex_destroy
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L34
.L35:
	ldr	r2, [fp, #-12]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L38+16
	add	r3, r3, r2
	mov	r0, r3
	bl	pthread_mutex_destroy
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L34:
	ldr	r3, [fp, #-12]
	cmp	r3, #4
	ble	.L35
	ldr	r3, .L38+8
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, .L38+8
	ldr	r3, [r3, #4]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, .L38+8
	ldr	r3, [r3, #8]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, .L38+8
	ldr	r3, [r3, #12]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, .L38+8
	ldr	r3, [r3, #16]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r0, .L38+20
	bl	puts
	mov	r3, #0
	ldr	r2, .L38
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L37
	bl	__stack_chk_fail
.L37:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L39:
	.align	2
.L38:
	.word	.LC6
	.word	mutex
	.word	philosofers
	.word	philosofer
	.word	forks
	.word	.LC5
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
