	.file	"76700270.c"
	.intel_syntax noprefix
	.text
	.globl	forks
	.bss
	.align 32
	.type	forks, @object
	.size	forks, 160
forks:
	.zero	160
	.text
	.globl	randomInRange
	.type	randomInRange, @function
randomInRange:
.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, 16
	mov	DWORD PTR -4[rbp], edi
	mov	DWORD PTR -8[rbp], esi
	call	random@PLT
	mov	edx, DWORD PTR -8[rbp]
	sub	edx, DWORD PTR -4[rbp]
	add	edx, 1
	movsx	rcx, edx
	cqo
	idiv	rcx
	mov	rax, rdx
	mov	edx, eax
	mov	eax, DWORD PTR -4[rbp]
	add	eax, edx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	randomInRange, .-randomInRange
	.section	.rodata
	.align 8
.LC0:
	.string	"Soy el phil %ld y quiero mis tenedores \n"
	.align 8
.LC1:
	.string	"Soy el phil %ld y voy a comer \n"
	.align 8
.LC2:
	.string	"Soy el phil %ld y voy a pensar \n"
	.text
	.globl	life
	.type	life, @function
life:
.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	QWORD PTR -8[rbp], rax
	mov	edi, 0
	call	time@PLT
	mov	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	imul	eax, edx
	mov	edi, eax
	call	srandom@PLT
.L6:
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	and	eax, 1
	test	rax, rax
	jne	.L4
	mov	rax, QWORD PTR -8[rbp]
	lea	rcx, -1[rax]
	movabs	rdx, 7378697629483820647
	mov	rax, rcx
	imul	rdx
	mov	rax, rdx
	sar	rax
	mov	rdx, rcx
	sar	rdx, 63
	sub	rax, rdx
	mov	rdx, rax
	sal	rdx, 2
	add	rdx, rax
	mov	rax, rcx
	sub	rax, rdx
	sal	rax, 5
	mov	rdx, rax
	lea	rax, forks[rip]
	add	rax, rdx
	mov	rdi, rax
	call	sem_wait@PLT
	mov	rax, QWORD PTR -8[rbp]
	sal	rax, 5
	mov	rdx, rax
	lea	rax, forks[rip]
	add	rax, rdx
	mov	rdi, rax
	call	sem_wait@PLT
	jmp	.L5
.L4:
	mov	rax, QWORD PTR -8[rbp]
	sal	rax, 5
	mov	rdx, rax
	lea	rax, forks[rip]
	add	rax, rdx
	mov	rdi, rax
	call	sem_wait@PLT
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, 1
	and	eax, 5
	sal	rax, 5
	mov	rdx, rax
	lea	rax, forks[rip]
	add	rax, rdx
	mov	rdi, rax
	call	sem_wait@PLT
.L5:
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	esi, 20
	mov	edi, 5
	call	randomInRange
	mov	edi, eax
	call	sleep@PLT
	mov	rax, QWORD PTR -8[rbp]
	sal	rax, 5
	mov	rdx, rax
	lea	rax, forks[rip]
	add	rax, rdx
	mov	rdi, rax
	call	sem_post@PLT
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, 1
	and	eax, 5
	sal	rax, 5
	mov	rdx, rax
	lea	rax, forks[rip]
	add	rax, rdx
	mov	rdi, rax
	call	sem_post@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	esi, 20
	mov	edi, 5
	call	randomInRange
	mov	edi, eax
	call	sleep@PLT
	jmp	.L6
	.cfi_endproc
.LFE7:
	.size	life, .-life
	.section	.rodata
.LC3:
	.string	"In main: creating thread %ld\n"
	.align 8
.LC4:
	.string	"ERROR; return code from pthread_create() is %d\n"
	.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
	sub	rsp, 80
	mov	DWORD PTR -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -56[rbp], 0
	jmp	.L8
.L9:
	mov	rax, QWORD PTR -56[rbp]
	sal	rax, 5
	mov	rdx, rax
	lea	rax, forks[rip]
	add	rax, rdx
	mov	edx, 1
	mov	esi, 0
	mov	rdi, rax
	call	sem_init@PLT
	add	QWORD PTR -56[rbp], 1
.L8:
	cmp	QWORD PTR -56[rbp], 4
	jle	.L9
	mov	QWORD PTR -56[rbp], 0
	jmp	.L10
.L12:
	mov	rax, QWORD PTR -56[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -56[rbp]
	lea	rcx, -48[rbp]
	mov	rdx, QWORD PTR -56[rbp]
	sal	rdx, 3
	lea	rdi, [rcx+rdx]
	mov	rcx, rax
	lea	rdx, life[rip]
	mov	esi, 0
	call	pthread_create@PLT
	mov	DWORD PTR -60[rbp], eax
	cmp	DWORD PTR -60[rbp], 0
	je	.L11
	mov	eax, DWORD PTR -60[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, -1
	call	exit@PLT
.L11:
	add	QWORD PTR -56[rbp], 1
.L10:
	cmp	QWORD PTR -56[rbp], 4
	jle	.L12
	mov	edi, 0
	call	pthread_exit@PLT
	.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	"76700270.c"
	.text
	.comm	forks,80,4
	.global	__aeabi_idivmod
	.align	2
	.global	randomInRange
	.syntax unified
	.arm
	.fpu softvfp
	.type	randomInRange, %function
randomInRange:
	@ 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]
	str	r1, [fp, #-12]
	bl	random
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-8]
	sub	r3, r2, r3
	add	r3, r3, #1
	mov	r1, r3
	bl	__aeabi_idivmod
	mov	r3, r1
	mov	r2, r3
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	randomInRange, .-randomInRange
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Soy el phil %ld y quiero mis tenedores \012\000"
	.align	2
.LC1:
	.ascii	"Soy el phil %ld y voy a comer \012\000"
	.align	2
.LC2:
	.ascii	"Soy el phil %ld y voy a pensar \012\000"
	.text
	.align	2
	.global	life
	.syntax unified
	.arm
	.fpu softvfp
	.type	life, %function
life:
	@ 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	r0, #0
	bl	time
	mov	r2, r0
	ldr	r3, [fp, #-8]
	mul	r3, r2, r3
	mov	r0, r3
	bl	srandom
.L6:
	ldr	r1, [fp, #-8]
	ldr	r0, .L7
	bl	printf
	ldr	r3, [fp, #-8]
	and	r3, r3, #1
	cmp	r3, #0
	bne	.L4
	ldr	r3, [fp, #-8]
	sub	r1, r3, #1
	ldr	r3, .L7+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
	lsl	r3, r2, #4
	ldr	r2, .L7+8
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_wait
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #4
	ldr	r2, .L7+8
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_wait
	b	.L5
.L4:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #4
	ldr	r2, .L7+8
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_wait
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	and	r3, r3, #5
	lsl	r3, r3, #4
	ldr	r2, .L7+8
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_wait
.L5:
	ldr	r1, [fp, #-8]
	ldr	r0, .L7+12
	bl	printf
	mov	r1, #20
	mov	r0, #5
	bl	randomInRange
	mov	r3, r0
	mov	r0, r3
	bl	sleep
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #4
	ldr	r2, .L7+8
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_post
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	and	r3, r3, #5
	lsl	r3, r3, #4
	ldr	r2, .L7+8
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_post
	ldr	r1, [fp, #-8]
	ldr	r0, .L7+16
	bl	printf
	mov	r1, #20
	mov	r0, #5
	bl	randomInRange
	mov	r3, r0
	mov	r0, r3
	bl	sleep
	b	.L6
.L8:
	.align	2
.L7:
	.word	.LC0
	.word	1717986919
	.word	forks
	.word	.LC1
	.word	.LC2
	.size	life, .-life
	.section	.rodata
	.align	2
.LC3:
	.ascii	"In main: creating thread %ld\012\000"
	.align	2
.LC4:
	.ascii	"ERROR; return code from pthread_create() is %d\012\000"
	.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 = 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, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L10
.L11:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #4
	ldr	r2, .L16+4
	add	r3, r3, r2
	mov	r2, #1
	mov	r1, #0
	mov	r0, r3
	bl	sem_init
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L10:
	ldr	r3, [fp, #-36]
	cmp	r3, #4
	ble	.L11
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L12
.L14:
	ldr	r1, [fp, #-36]
	ldr	r0, .L16+8
	bl	printf
	sub	r2, fp, #28
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	add	r0, r2, r3
	ldr	r3, [fp, #-36]
	ldr	r2, .L16+12
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	beq	.L13
	ldr	r1, [fp, #-32]
	ldr	r0, .L16+16
	bl	printf
	mvn	r0, #0
	bl	exit
.L13:
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L12:
	ldr	r3, [fp, #-36]
	cmp	r3, #4
	ble	.L14
	mov	r0, #0
	bl	pthread_exit
.L17:
	.align	2
.L16:
	.word	.LC5
	.word	forks
	.word	.LC3
	.word	life
	.word	.LC4
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
