	.file	"59881.c"
	.intel_syntax noprefix
	.text
	.globl	philosophers
	.bss
	.align 32
	.type	philosophers, @object
	.size	philosophers, 40
philosophers:
	.zero	40
	.globl	forks
	.align 32
	.type	forks, @object
	.size	forks, 200
forks:
	.zero	200
	.text
	.globl	init
	.type	init, @function
init:
.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], 0
	jmp	.L2
.L3:
	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	esi, 0
	mov	rdi, rax
	call	pthread_mutex_init@PLT
	add	DWORD PTR -4[rbp], 1
.L2:
	cmp	DWORD PTR -4[rbp], 4
	jle	.L3
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	init, .-init
	.section	.rodata
.LC0:
	.string	"Philosopher %d thinking... \n"
	.align 8
.LC1:
	.string	"Philosopher %d stopped thinking!!! \n"
	.text
	.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, 16
	mov	DWORD PTR -4[rbp], edi
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	call	random@PLT
	mov	rcx, rax
	movabs	rdx, 7378697629483820647
	mov	rax, rcx
	imul	rdx
	mov	rax, rdx
	sar	rax, 2
	mov	rsi, rcx
	sar	rsi, 63
	sub	rax, rsi
	mov	rdx, rax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	sub	rcx, rax
	mov	rdx, rcx
	mov	eax, edx
	mov	edi, eax
	call	sleep@PLT
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	think, .-think
	.section	.rodata
.LC2:
	.string	"Philosopher %d eating... \n"
	.align 8
.LC3:
	.string	"Philosopher %d is not eating anymore!!! \n"
	.text
	.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, 16
	mov	DWORD PTR -4[rbp], edi
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	call	random@PLT
	mov	rcx, 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
	mov	edi, eax
	call	sleep@PLT
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	eat, .-eat
	.section	.rodata
.LC4:
	.string	"Philosopher %d sleeping... \n"
.LC5:
	.string	"Philosopher %d is awake!!! \n"
	.text
	.globl	toSleep
	.type	toSleep, @function
toSleep:
.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
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	call	random@PLT
	mov	rcx, rax
	movabs	rdx, 7378697629483820647
	mov	rax, rcx
	imul	rdx
	mov	rax, rdx
	sar	rax, 2
	mov	rsi, rcx
	sar	rsi, 63
	sub	rax, rsi
	mov	rdx, rax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	sub	rcx, rax
	mov	rdx, rcx
	mov	eax, edx
	mov	edi, eax
	call	sleep@PLT
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	toSleep, .-toSleep
	.globl	philosopher
	.type	philosopher, @function
philosopher:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR -8[rbp], eax
	cmp	DWORD PTR -12[rbp], 0
	je	.L8
	mov	eax, DWORD PTR -12[rbp]
	sub	eax, 1
	jmp	.L9
.L8:
	mov	eax, 4
.L9:
	mov	DWORD PTR -4[rbp], eax
.L14:
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	think
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, DWORD PTR -8[rbp]
	jge	.L10
	mov	eax, DWORD PTR -8[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
	mov	eax, 0
	call	sem_wait@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
	mov	eax, 0
	call	sem_wait@PLT
	jmp	.L11
.L10:
	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
	mov	eax, 0
	call	sem_wait@PLT
	mov	eax, DWORD PTR -8[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
	mov	eax, 0
	call	sem_wait@PLT
.L11:
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	eat
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, DWORD PTR -8[rbp]
	jge	.L12
	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
	mov	eax, 0
	call	sem_post@PLT
	mov	eax, DWORD PTR -8[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
	mov	eax, 0
	call	sem_post@PLT
	jmp	.L13
.L12:
	mov	eax, DWORD PTR -8[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
	mov	eax, 0
	call	sem_post@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
	mov	eax, 0
	call	sem_post@PLT
.L13:
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	toSleep
	jmp	.L14
	.cfi_endproc
.LFE10:
	.size	philosopher, .-philosopher
	.globl	main
	.type	main, @function
main:
.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	eax, 0
	call	init
	mov	QWORD PTR -8[rbp], 0
	jmp	.L16
.L17:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR -8[rbp]
	lea	rcx, 0[0+rdx*8]
	lea	rdx, philosophers[rip]
	lea	rdi, [rcx+rdx]
	mov	rcx, rax
	lea	rdx, philosopher[rip]
	mov	esi, 0
	call	pthread_create@PLT
	add	QWORD PTR -8[rbp], 1
.L16:
	cmp	QWORD PTR -8[rbp], 4
	jbe	.L17
	mov	QWORD PTR -8[rbp], 0
	jmp	.L18
.L19:
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 0[0+rax*8]
	lea	rax, philosophers[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	QWORD PTR -8[rbp], 1
.L18:
	cmp	QWORD PTR -8[rbp], 4
	jbe	.L19
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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	"59881.c"
	.text
	.comm	philosophers,20,4
	.comm	forks,120,4
	.align	2
	.global	init
	.syntax unified
	.arm
	.fpu softvfp
	.type	init, %function
init:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L2
.L3:
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L4
	add	r3, r3, r2
	mov	r1, #0
	mov	r0, r3
	bl	pthread_mutex_init
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L2:
	ldr	r3, [fp, #-8]
	cmp	r3, #4
	ble	.L3
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	forks
	.size	init, .-init
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Philosopher %d thinking... \012\000"
	.align	2
.LC1:
	.ascii	"Philosopher %d stopped thinking!!! \012\000"
	.text
	.align	2
	.global	think
	.syntax unified
	.arm
	.fpu softvfp
	.type	think, %function
think:
	@ 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	r1, [fp, #-8]
	ldr	r0, .L7
	bl	printf
	bl	random
	mov	r2, r0
	ldr	r3, .L7+4
	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	r1, r2, r3
	mov	r3, r1
	mov	r0, r3
	bl	sleep
	ldr	r1, [fp, #-8]
	ldr	r0, .L7+8
	bl	printf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	.LC0
	.word	1717986919
	.word	.LC1
	.size	think, .-think
	.section	.rodata
	.align	2
.LC2:
	.ascii	"Philosopher %d eating... \012\000"
	.align	2
.LC3:
	.ascii	"Philosopher %d is not eating anymore!!! \012\000"
	.text
	.align	2
	.global	eat
	.syntax unified
	.arm
	.fpu softvfp
	.type	eat, %function
eat:
	@ 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	r1, [fp, #-8]
	ldr	r0, .L10
	bl	printf
	bl	random
	mov	r2, r0
	ldr	r3, .L10+4
	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	r3, r1
	mov	r0, r3
	bl	sleep
	ldr	r1, [fp, #-8]
	ldr	r0, .L10+8
	bl	printf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC2
	.word	1717986919
	.word	.LC3
	.size	eat, .-eat
	.section	.rodata
	.align	2
.LC4:
	.ascii	"Philosopher %d sleeping... \012\000"
	.align	2
.LC5:
	.ascii	"Philosopher %d is awake!!! \012\000"
	.text
	.align	2
	.global	toSleep
	.syntax unified
	.arm
	.fpu softvfp
	.type	toSleep, %function
toSleep:
	@ 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	r1, [fp, #-8]
	ldr	r0, .L13
	bl	printf
	bl	random
	mov	r2, r0
	ldr	r3, .L13+4
	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	r1, r2, r3
	mov	r3, r1
	mov	r0, r3
	bl	sleep
	ldr	r1, [fp, #-8]
	ldr	r0, .L13+8
	bl	printf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L14:
	.align	2
.L13:
	.word	.LC4
	.word	1717986919
	.word	.LC5
	.size	toSleep, .-toSleep
	.align	2
	.global	philosopher
	.syntax unified
	.arm
	.fpu softvfp
	.type	philosopher, %function
philosopher:
	@ 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]
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L16
	ldr	r3, [fp, #-16]
	sub	r3, r3, #1
	b	.L17
.L16:
	mov	r3, #4
.L17:
	str	r3, [fp, #-8]
.L22:
	ldr	r0, [fp, #-16]
	bl	think
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	bge	.L18
	ldr	r2, [fp, #-12]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L23
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_wait
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L23
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_wait
	b	.L19
.L18:
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L23
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_wait
	ldr	r2, [fp, #-12]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L23
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_wait
.L19:
	ldr	r0, [fp, #-16]
	bl	eat
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	bge	.L20
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L23
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_post
	ldr	r2, [fp, #-12]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L23
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_post
	b	.L21
.L20:
	ldr	r2, [fp, #-12]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L23
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_post
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L23
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_post
.L21:
	ldr	r0, [fp, #-16]
	bl	toSleep
	b	.L22
.L24:
	.align	2
.L23:
	.word	forks
	.size	philosopher, .-philosopher
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	bl	init
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L26
.L27:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, .L31
	add	r0, r3, r2
	ldr	r3, [fp, #-8]
	ldr	r2, .L31+4
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L26:
	ldr	r3, [fp, #-8]
	cmp	r3, #4
	bls	.L27
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L28
.L29:
	ldr	r2, .L31
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L28:
	ldr	r3, [fp, #-8]
	cmp	r3, #4
	bls	.L29
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L32:
	.align	2
.L31:
	.word	philosophers
	.word	philosopher
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
