	.file	"225144600.c"
	.intel_syntax noprefix
	.text
	.globl	garfos
	.bss
	.align 16
	.type	garfos, @object
	.size	garfos, 20
garfos:
	.zero	20
	.globl	mutex
	.align 32
	.type	mutex, @object
	.size	mutex, 160
mutex:
	.zero	160
	.section	.rodata
.LC0:
	.string	"Filosofo %d pegou o garfo %d\n"
.LC1:
	.string	"Filosofo %d parou de comer\n"
.LC2:
	.string	"Filosofo %d esta pensando\n"
	.text
	.globl	acao
	.type	acao, @function
acao:
.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
.L2:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -16[rbp], eax
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	lea	rax, mutex[rip]
	add	rax, rdx
	mov	rdi, rax
	call	sem_wait@PLT
	mov	edx, DWORD PTR -16[rbp]
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -16[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
	sal	rax, 5
	mov	rdx, rax
	lea	rax, mutex[rip]
	add	rax, rdx
	mov	rdi, rax
	call	sem_wait@PLT
	mov	eax, DWORD PTR -16[rbp]
	lea	edx, 1[rax]
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	call	rand@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 1431655766
	shr	rdx, 32
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	mov	DWORD PTR -12[rbp], edx
	mov	ecx, DWORD PTR -12[rbp]
	mov	edx, ecx
	add	edx, edx
	add	edx, ecx
	sub	eax, edx
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	sleep@PLT
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	lea	rax, mutex[rip]
	add	rax, rdx
	mov	rdi, rax
	call	sem_post@PLT
	mov	eax, DWORD PTR -16[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
	sal	rax, 5
	mov	rdx, rax
	lea	rax, mutex[rip]
	add	rax, rdx
	mov	rdi, rax
	call	sem_post@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	call	rand@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 1431655766
	shr	rdx, 32
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	mov	DWORD PTR -12[rbp], edx
	mov	ecx, DWORD PTR -12[rbp]
	mov	edx, ecx
	add	edx, edx
	add	edx, ecx
	sub	eax, edx
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	sleep@PLT
	jmp	.L2
	.cfi_endproc
.LFE6:
	.size	acao, .-acao
	.globl	main
	.type	main, @function
main:
.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, 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edi, 0
	call	time@PLT
	mov	edi, eax
	call	srand@PLT
	mov	DWORD PTR -52[rbp], 0
	jmp	.L4
.L5:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rdx, garfos[rip]
	mov	eax, DWORD PTR -52[rbp]
	mov	DWORD PTR [rcx+rdx], eax
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	lea	rax, mutex[rip]
	add	rax, rdx
	mov	edx, 1
	mov	esi, 0
	mov	rdi, rax
	call	sem_init@PLT
	add	DWORD PTR -52[rbp], 1
.L4:
	cmp	DWORD PTR -52[rbp], 4
	jle	.L5
	mov	DWORD PTR -52[rbp], 0
	jmp	.L6
.L7:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, garfos[rip]
	add	rdx, rax
	lea	rcx, -48[rbp]
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	sal	rax, 3
	add	rax, rcx
	mov	rcx, rdx
	lea	rdx, acao[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	add	DWORD PTR -52[rbp], 1
.L6:
	cmp	DWORD PTR -52[rbp], 4
	jle	.L7
	mov	DWORD PTR -52[rbp], 0
	jmp	.L8
.L9:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	mov	rax, QWORD PTR -48[rbp+rax*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	DWORD PTR -52[rbp], 1
.L8:
	cmp	DWORD PTR -52[rbp], 4
	jle	.L9
	mov	DWORD PTR -52[rbp], 0
	jmp	.L10
.L11:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	lea	rax, mutex[rip]
	add	rax, rdx
	mov	rdi, rax
	call	sem_destroy@PLT
	add	DWORD PTR -52[rbp], 1
.L10:
	cmp	DWORD PTR -52[rbp], 4
	jle	.L11
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE7:
	.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	"225144600.c"
	.text
	.comm	garfos,20,4
	.comm	mutex,80,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Filosofo %d pegou o garfo %d\012\000"
	.align	2
.LC1:
	.ascii	"Filosofo %d parou de comer\012\000"
	.align	2
.LC2:
	.ascii	"Filosofo %d esta pensando\012\000"
	.text
	.align	2
	.global	acao
	.syntax unified
	.arm
	.fpu softvfp
	.type	acao, %function
acao:
	@ 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]
	str	r3, [fp, #-16]
.L2:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #4
	ldr	r2, .L3
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_wait
	ldr	r2, [fp, #-12]
	ldr	r1, [fp, #-12]
	ldr	r0, .L3+4
	bl	printf
	ldr	r3, [fp, #-12]
	add	r1, r3, #1
	ldr	r3, .L3+8
	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
	lsl	r3, r2, #4
	ldr	r2, .L3
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_wait
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	mov	r2, r3
	ldr	r1, [fp, #-12]
	ldr	r0, .L3+4
	bl	printf
	bl	rand
	mov	r2, r0
	ldr	r3, .L3+12
	smull	r0, r1, r3, r2
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #1
	add	r3, r3, r1
	sub	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	bl	sleep
	ldr	r1, [fp, #-12]
	ldr	r0, .L3+16
	bl	printf
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #4
	ldr	r2, .L3
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_post
	ldr	r3, [fp, #-12]
	add	r1, r3, #1
	ldr	r3, .L3+8
	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
	lsl	r3, r2, #4
	ldr	r2, .L3
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_post
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L3+20
	bl	printf
	bl	rand
	mov	r2, r0
	ldr	r3, .L3+12
	smull	r0, r1, r3, r2
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #1
	add	r3, r3, r1
	sub	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	bl	sleep
	b	.L2
.L4:
	.align	2
.L3:
	.word	mutex
	.word	.LC0
	.word	1717986919
	.word	1431655766
	.word	.LC1
	.word	.LC2
	.size	acao, .-acao
	.section	.rodata
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	ldr	r3, .L15
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r0, #0
	bl	time
	mov	r3, r0
	mov	r0, r3
	bl	srand
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L6
.L7:
	ldr	r1, .L15+4
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-32]
	str	r2, [r1, r3, lsl #2]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #4
	ldr	r2, .L15+8
	add	r3, r3, r2
	mov	r2, #1
	mov	r1, #0
	mov	r0, r3
	bl	sem_init
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L6:
	ldr	r3, [fp, #-32]
	cmp	r3, #4
	ble	.L7
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L8
.L9:
	sub	r2, fp, #28
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	add	r0, r2, r3
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	ldr	r2, .L15+4
	add	r3, r3, r2
	ldr	r2, .L15+12
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L8:
	ldr	r3, [fp, #-32]
	cmp	r3, #4
	ble	.L9
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L10
.L11:
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-24]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L10:
	ldr	r3, [fp, #-32]
	cmp	r3, #4
	ble	.L11
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L12
.L13:
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #4
	ldr	r2, .L15+8
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_destroy
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L12:
	ldr	r3, [fp, #-32]
	cmp	r3, #4
	ble	.L13
	mov	r0, #0
	bl	exit
.L16:
	.align	2
.L15:
	.word	.LC3
	.word	garfos
	.word	mutex
	.word	acao
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
