	.file	"586265.c"
	.intel_syntax noprefix
	.text
	.globl	Philosopher
	.bss
	.align 32
	.type	Philosopher, @object
	.size	Philosopher, 160
Philosopher:
	.zero	160
	.globl	Mutex
	.align 32
	.type	Mutex, @object
	.size	Mutex, 32
Mutex:
	.zero	32
	.globl	State
	.align 16
	.type	State, @object
	.size	State, 20
State:
	.zero	20
	.section	.rodata
.LC0:
	.string	"pthread_cond_init"
.LC1:
	.string	"pthread_mutex_init"
.LC2:
	.string	"pthread_mutex_lock"
.LC3:
	.string	"pthread_cond_timedwait"
.LC4:
	.string	"pthread_cond_destroy"
.LC5:
	.string	"pthread_mutex_destroy"
	.text
	.globl	ThreadUsleep
	.type	ThreadUsleep, @function
ThreadUsleep:
.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, 160
	mov	DWORD PTR -148[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -64[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_cond_init@PLT
	test	eax, eax
	jns	.L2
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 0
	call	pthread_exit@PLT
.L2:
	lea	rax, -112[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_mutex_init@PLT
	test	eax, eax
	jns	.L3
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 0
	call	pthread_exit@PLT
.L3:
	lea	rax, -128[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	gettimeofday@PLT
	mov	rcx, QWORD PTR -128[rbp]
	mov	eax, DWORD PTR -148[rbp]
	movsx	rdx, eax
	imul	rdx, rdx, 1125899907
	shr	rdx, 32
	sar	edx, 18
	sar	eax, 31
	mov	esi, eax
	mov	eax, edx
	sub	eax, esi
	cdqe
	add	rax, rcx
	mov	QWORD PTR -144[rbp], rax
	mov	rcx, QWORD PTR -120[rbp]
	mov	eax, DWORD PTR -148[rbp]
	movsx	rdx, eax
	imul	rdx, rdx, 1125899907
	shr	rdx, 32
	sar	edx, 18
	mov	esi, eax
	sar	esi, 31
	sub	edx, esi
	imul	esi, edx, 1000000
	sub	eax, esi
	mov	edx, eax
	movsx	rax, edx
	add	rax, rcx
	imul	rax, rax, 1000
	mov	QWORD PTR -136[rbp], rax
	mov	rax, QWORD PTR -136[rbp]
	cmp	rax, 999999999
	jle	.L4
	mov	rax, QWORD PTR -136[rbp]
	sub	rax, 1000000000
	mov	QWORD PTR -136[rbp], rax
	mov	rax, QWORD PTR -144[rbp]
	add	rax, 1
	mov	QWORD PTR -144[rbp], rax
.L4:
	lea	rax, -112[rbp]
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	test	eax, eax
	jns	.L5
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 0
	call	pthread_exit@PLT
.L5:
	lea	rdx, -144[rbp]
	lea	rcx, -112[rbp]
	lea	rax, -64[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	pthread_cond_timedwait@PLT
	test	eax, eax
	jns	.L6
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 0
	call	pthread_exit@PLT
.L6:
	lea	rax, -64[rbp]
	mov	rdi, rax
	call	pthread_cond_destroy@PLT
	test	eax, eax
	jns	.L7
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 0
	call	pthread_exit@PLT
.L7:
	lea	rax, -112[rbp]
	mov	rdi, rax
	call	pthread_mutex_destroy@PLT
	test	eax, eax
	jns	.L10
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	edi, 0
	call	pthread_exit@PLT
.L10:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	ThreadUsleep, .-ThreadUsleep
	.section	.rodata
.LC6:
	.string	"Philosopher%d: Thinking.....\n"
	.align 8
.LC7:
	.string	"Philosopher%d: Want to eat.....\n"
	.text
	.globl	Thinking
	.type	Thinking, @function
Thinking:
.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, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	call	rand@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 1374389535
	shr	rdx, 32
	sar	edx, 6
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	imul	ecx, edx, 200
	sub	eax, ecx
	mov	edx, eax
	imul	eax, edx, 10000
	mov	edi, eax
	call	ThreadUsleep
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	Thinking, .-Thinking
	.section	.rodata
.LC8:
	.string	"Philosopher%d: Eating.....\n"
	.text
	.globl	Eating
	.type	Eating, @function
Eating:
.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, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	call	rand@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 1374389535
	shr	rdx, 32
	sar	edx, 5
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	imul	ecx, edx, 100
	sub	eax, ecx
	mov	edx, eax
	imul	eax, edx, 10000
	mov	edi, eax
	call	ThreadUsleep
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	Eating, .-Eating
	.section	.rodata
.LC9:
	.string	"sem_post"
	.text
	.globl	Test
	.type	Test, @function
Test:
.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]
	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]
	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, 1
	je	.L15
	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, 1
	je	.L15
	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]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	lea	rax, Philosopher[rip]
	add	rax, rdx
	mov	rdi, rax
	call	sem_post@PLT
	test	eax, eax
	jns	.L15
	lea	rdi, .LC9[rip]
	call	perror@PLT
	mov	edi, 0
	call	pthread_exit@PLT
.L15:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	Test, .-Test
	.section	.rodata
.LC10:
	.string	"sem_wait"
	.text
	.globl	PickUp
	.type	PickUp, @function
PickUp:
.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	sem_wait@PLT
	test	eax, eax
	jns	.L17
	lea	rdi, .LC10[rip]
	call	perror@PLT
	mov	edi, 0
	call	pthread_exit@PLT
.L17:
	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	Test
	lea	rdi, Mutex[rip]
	call	sem_post@PLT
	test	eax, eax
	jns	.L18
	lea	rdi, .LC9[rip]
	call	perror@PLT
	mov	edi, 0
	call	pthread_exit@PLT
.L18:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	lea	rax, Philosopher[rip]
	add	rax, rdx
	mov	rdi, rax
	call	sem_wait@PLT
	test	eax, eax
	jns	.L20
	lea	rdi, .LC10[rip]
	call	perror@PLT
	mov	edi, 0
	call	pthread_exit@PLT
.L20:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	PickUp, .-PickUp
	.globl	PutDown
	.type	PutDown, @function
PutDown:
.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
	lea	rdi, Mutex[rip]
	call	sem_wait@PLT
	test	eax, eax
	jns	.L22
	lea	rdi, .LC10[rip]
	call	perror@PLT
	mov	edi, 0
	call	pthread_exit@PLT
.L22:
	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]
	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	sem_post@PLT
	test	eax, eax
	jns	.L24
	lea	rdi, .LC9[rip]
	call	perror@PLT
	mov	edi, 0
	call	pthread_exit@PLT
.L24:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	PutDown, .-PutDown
	.section	.rodata
	.align 8
.LC11:
	.string	"Philosopher%d: thinking & eating %d times.....\n"
	.text
	.globl	DiningPhilosopher
	.type	DiningPhilosopher, @function
DiningPhilosopher:
.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, 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	DWORD PTR -8[rbp], 0
	jmp	.L26
.L27:
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	Thinking
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	PickUp
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	Eating
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	PutDown
	add	DWORD PTR -8[rbp], 1
.L26:
	cmp	DWORD PTR -8[rbp], 4
	jle	.L27
	mov	edx, DWORD PTR -8[rbp]
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE12:
	.size	DiningPhilosopher, .-DiningPhilosopher
	.section	.rodata
.LC12:
	.string	"sem_init"
.LC13:
	.string	"pthread_create"
.LC14:
	.string	"pthread_join"
.LC15:
	.string	"sem_destroy"
	.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, 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edi, 34952
	call	srand@PLT
	mov	DWORD PTR -84[rbp], 0
	jmp	.L29
.L31:
	mov	eax, DWORD PTR -84[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	lea	rax, Philosopher[rip]
	add	rax, rdx
	mov	edx, 1
	mov	esi, 0
	mov	rdi, rax
	call	sem_init@PLT
	test	eax, eax
	jns	.L30
	lea	rdi, .LC12[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L30:
	mov	eax, DWORD PTR -84[rbp]
	cdqe
	mov	edx, DWORD PTR -84[rbp]
	mov	DWORD PTR -80[rbp+rax*4], edx
	add	DWORD PTR -84[rbp], 1
.L29:
	cmp	DWORD PTR -84[rbp], 4
	jle	.L31
	mov	edx, 1
	mov	esi, 0
	lea	rdi, Mutex[rip]
	call	sem_init@PLT
	test	eax, eax
	jns	.L32
	lea	rdi, .LC12[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L32:
	mov	DWORD PTR -84[rbp], 0
	jmp	.L33
.L35:
	lea	rdx, -80[rbp]
	mov	eax, DWORD PTR -84[rbp]
	cdqe
	sal	rax, 2
	add	rdx, rax
	lea	rcx, -48[rbp]
	mov	eax, DWORD PTR -84[rbp]
	cdqe
	sal	rax, 3
	add	rax, rcx
	mov	rcx, rdx
	lea	rdx, DiningPhilosopher[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	test	eax, eax
	jns	.L34
	lea	rdi, .LC13[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L34:
	add	DWORD PTR -84[rbp], 1
.L33:
	cmp	DWORD PTR -84[rbp], 4
	jle	.L35
	mov	DWORD PTR -84[rbp], 0
	jmp	.L36
.L38:
	mov	eax, DWORD PTR -84[rbp]
	cdqe
	mov	rax, QWORD PTR -48[rbp+rax*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	test	eax, eax
	jns	.L37
	lea	rdi, .LC14[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L37:
	add	DWORD PTR -84[rbp], 1
.L36:
	cmp	DWORD PTR -84[rbp], 4
	jle	.L38
	mov	DWORD PTR -84[rbp], 0
	jmp	.L39
.L41:
	mov	eax, DWORD PTR -84[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	lea	rax, Philosopher[rip]
	add	rax, rdx
	mov	rdi, rax
	call	sem_destroy@PLT
	test	eax, eax
	je	.L40
	lea	rdi, .LC15[rip]
	call	perror@PLT
.L40:
	add	DWORD PTR -84[rbp], 1
.L39:
	cmp	DWORD PTR -84[rbp], 4
	jle	.L41
	lea	rdi, Mutex[rip]
	call	sem_destroy@PLT
	test	eax, eax
	je	.L42
	lea	rdi, .LC15[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L42:
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L44
	call	__stack_chk_fail@PLT
.L44:
	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	"586265.c"
	.text
	.comm	Philosopher,80,4
	.comm	Mutex,16,4
	.comm	State,20,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"pthread_cond_init\000"
	.align	2
.LC1:
	.ascii	"pthread_mutex_init\000"
	.align	2
.LC2:
	.ascii	"pthread_mutex_lock\000"
	.align	2
.LC3:
	.ascii	"pthread_cond_timedwait\000"
	.align	2
.LC4:
	.ascii	"pthread_cond_destroy\000"
	.align	2
.LC5:
	.ascii	"pthread_mutex_destroy\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	ThreadUsleep
	.syntax unified
	.arm
	.fpu softvfp
	.type	ThreadUsleep, %function
ThreadUsleep:
	@ args = 0, pretend = 0, frame = 104
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #104
	str	r0, [fp, #-104]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #60
	mov	r1, #0
	mov	r0, r3
	bl	pthread_cond_init
	mov	r3, r0
	cmp	r3, #0
	bge	.L2
	ldr	r0, .L11+4
	bl	perror
	mov	r0, #0
	bl	pthread_exit
.L2:
	sub	r3, fp, #84
	mov	r1, #0
	mov	r0, r3
	bl	pthread_mutex_init
	mov	r3, r0
	cmp	r3, #0
	bge	.L3
	ldr	r0, .L11+8
	bl	perror
	mov	r0, #0
	bl	pthread_exit
.L3:
	sub	r3, fp, #92
	mov	r1, #0
	mov	r0, r3
	bl	gettimeofday
	ldr	r2, [fp, #-92]
	ldr	r3, [fp, #-104]
	ldr	r1, .L11+12
	smull	r0, r1, r3, r1
	asr	r1, r1, #18
	asr	r3, r3, #31
	sub	r3, r1, r3
	add	r3, r2, r3
	str	r3, [fp, #-100]
	ldr	ip, [fp, #-88]
	ldr	r0, [fp, #-104]
	ldr	r3, .L11+12
	smull	r2, r3, r0, r3
	asr	r2, r3, #18
	asr	r3, r0, #31
	sub	r1, r2, r3
	mov	r2, r1
	lsl	r2, r2, #5
	sub	r2, r2, r1
	lsl	r3, r2, #6
	sub	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r1
	lsl	r3, r3, #6
	sub	r1, r0, r3
	add	r2, ip, r1
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	str	r3, [fp, #-96]
	ldr	r3, [fp, #-96]
	ldr	r2, .L11+16
	cmp	r3, r2
	ble	.L4
	ldr	r2, [fp, #-96]
	ldr	r3, .L11+20
	add	r3, r2, r3
	str	r3, [fp, #-96]
	ldr	r3, [fp, #-100]
	add	r3, r3, #1
	str	r3, [fp, #-100]
.L4:
	sub	r3, fp, #84
	mov	r0, r3
	bl	pthread_mutex_lock
	mov	r3, r0
	cmp	r3, #0
	bge	.L5
	ldr	r0, .L11+24
	bl	perror
	mov	r0, #0
	bl	pthread_exit
.L5:
	sub	r2, fp, #100
	sub	r1, fp, #84
	sub	r3, fp, #60
	mov	r0, r3
	bl	pthread_cond_timedwait
	mov	r3, r0
	cmp	r3, #0
	bge	.L6
	ldr	r0, .L11+28
	bl	perror
	mov	r0, #0
	bl	pthread_exit
.L6:
	sub	r3, fp, #60
	mov	r0, r3
	bl	pthread_cond_destroy
	mov	r3, r0
	cmp	r3, #0
	bge	.L7
	ldr	r0, .L11+32
	bl	perror
	mov	r0, #0
	bl	pthread_exit
.L7:
	sub	r3, fp, #84
	mov	r0, r3
	bl	pthread_mutex_destroy
	mov	r3, r0
	cmp	r3, #0
	bge	.L10
	ldr	r0, .L11+36
	bl	perror
	mov	r0, #0
	bl	pthread_exit
.L10:
	nop
	ldr	r3, .L11
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L9
	bl	__stack_chk_fail
.L9:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC6
	.word	.LC0
	.word	.LC1
	.word	1125899907
	.word	999999999
	.word	-1000000000
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	ThreadUsleep, .-ThreadUsleep
	.section	.rodata
	.align	2
.LC7:
	.ascii	"Philosopher%d: Thinking.....\012\000"
	.align	2
.LC8:
	.ascii	"Philosopher%d: Want to eat.....\012\000"
	.text
	.align	2
	.global	Thinking
	.syntax unified
	.arm
	.fpu softvfp
	.type	Thinking, %function
Thinking:
	@ 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, .L14
	bl	printf
	bl	rand
	mov	r1, r0
	ldr	r3, .L14+4
	smull	r2, r3, r1, r3
	asr	r2, r3, #6
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r2, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	sub	r2, r1, r3
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r2, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #4
	mov	r0, r3
	bl	ThreadUsleep
	ldr	r1, [fp, #-8]
	ldr	r0, .L14+8
	bl	printf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC7
	.word	1374389535
	.word	.LC8
	.size	Thinking, .-Thinking
	.section	.rodata
	.align	2
.LC9:
	.ascii	"Philosopher%d: Eating.....\012\000"
	.text
	.align	2
	.global	Eating
	.syntax unified
	.arm
	.fpu softvfp
	.type	Eating, %function
Eating:
	@ 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, .L17
	bl	printf
	bl	rand
	mov	r1, r0
	ldr	r3, .L17+4
	smull	r2, r3, r1, r3
	asr	r2, r3, #5
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r2, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #2
	sub	r2, r1, r3
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r2, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #4
	mov	r0, r3
	bl	ThreadUsleep
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L18:
	.align	2
.L17:
	.word	.LC9
	.word	1374389535
	.size	Eating, .-Eating
	.section	.rodata
	.align	2
.LC10:
	.ascii	"sem_post\000"
	.text
	.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, .L22
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	cmp	r3, #2
	bne	.L21
	ldr	r3, [fp, #-8]
	add	r1, r3, #4
	ldr	r3, .L22+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, .L22
	ldr	r3, [r3, r2, lsl #2]
	cmp	r3, #1
	beq	.L21
	ldr	r3, [fp, #-8]
	add	r1, r3, #1
	ldr	r3, .L22+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, .L22
	ldr	r3, [r3, r2, lsl #2]
	cmp	r3, #1
	beq	.L21
	ldr	r2, .L22
	ldr	r3, [fp, #-8]
	mov	r1, #1
	str	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #4
	ldr	r2, .L22+8
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_post
	mov	r3, r0
	cmp	r3, #0
	bge	.L21
	ldr	r0, .L22+12
	bl	perror
	mov	r0, #0
	bl	pthread_exit
.L21:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	State
	.word	1717986919
	.word	Philosopher
	.word	.LC10
	.size	Test, .-Test
	.section	.rodata
	.align	2
.LC11:
	.ascii	"sem_wait\000"
	.text
	.align	2
	.global	PickUp
	.syntax unified
	.arm
	.fpu softvfp
	.type	PickUp, %function
PickUp:
	@ 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, .L29
	bl	sem_wait
	mov	r3, r0
	cmp	r3, #0
	bge	.L25
	ldr	r0, .L29+4
	bl	perror
	mov	r0, #0
	bl	pthread_exit
.L25:
	ldr	r2, .L29+8
	ldr	r3, [fp, #-8]
	mov	r1, #2
	str	r1, [r2, r3, lsl #2]
	ldr	r0, [fp, #-8]
	bl	Test
	ldr	r0, .L29
	bl	sem_post
	mov	r3, r0
	cmp	r3, #0
	bge	.L26
	ldr	r0, .L29+12
	bl	perror
	mov	r0, #0
	bl	pthread_exit
.L26:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #4
	ldr	r2, .L29+16
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_wait
	mov	r3, r0
	cmp	r3, #0
	bge	.L28
	ldr	r0, .L29+4
	bl	perror
	mov	r0, #0
	bl	pthread_exit
.L28:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L30:
	.align	2
.L29:
	.word	Mutex
	.word	.LC11
	.word	State
	.word	.LC10
	.word	Philosopher
	.size	PickUp, .-PickUp
	.align	2
	.global	PutDown
	.syntax unified
	.arm
	.fpu softvfp
	.type	PutDown, %function
PutDown:
	@ 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, .L35
	bl	sem_wait
	mov	r3, r0
	cmp	r3, #0
	bge	.L32
	ldr	r0, .L35+4
	bl	perror
	mov	r0, #0
	bl	pthread_exit
.L32:
	ldr	r2, .L35+8
	ldr	r3, [fp, #-8]
	mov	r1, #0
	str	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-8]
	add	r2, r3, #4
	ldr	r3, .L35+12
	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, .L35+12
	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, .L35
	bl	sem_post
	mov	r3, r0
	cmp	r3, #0
	bge	.L34
	ldr	r0, .L35+16
	bl	perror
	mov	r0, #0
	bl	pthread_exit
.L34:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L36:
	.align	2
.L35:
	.word	Mutex
	.word	.LC11
	.word	State
	.word	1717986919
	.word	.LC10
	.size	PutDown, .-PutDown
	.section	.rodata
	.align	2
.LC12:
	.ascii	"Philosopher%d: thinking & eating %d times.....\012\000"
	.text
	.align	2
	.global	DiningPhilosopher
	.syntax unified
	.arm
	.fpu softvfp
	.type	DiningPhilosopher, %function
DiningPhilosopher:
	@ 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]
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L38
.L39:
	ldr	r0, [fp, #-8]
	bl	Thinking
	ldr	r0, [fp, #-8]
	bl	PickUp
	ldr	r0, [fp, #-8]
	bl	Eating
	ldr	r0, [fp, #-8]
	bl	PutDown
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L38:
	ldr	r3, [fp, #-12]
	cmp	r3, #4
	ble	.L39
	ldr	r2, [fp, #-12]
	ldr	r1, [fp, #-8]
	ldr	r0, .L40
	bl	printf
	mov	r0, #0
	bl	pthread_exit
.L41:
	.align	2
.L40:
	.word	.LC12
	.size	DiningPhilosopher, .-DiningPhilosopher
	.section	.rodata
	.align	2
.LC13:
	.ascii	"sem_init\000"
	.align	2
.LC14:
	.ascii	"pthread_create\000"
	.align	2
.LC15:
	.ascii	"pthread_join\000"
	.align	2
.LC16:
	.ascii	"sem_destroy\000"
	.align	2
.LC17:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	ldr	r3, .L59
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, .L59+4
	bl	srand
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L43
.L45:
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #4
	ldr	r2, .L59+8
	add	r3, r3, r2
	mov	r2, #1
	mov	r1, #0
	mov	r0, r3
	bl	sem_init
	mov	r3, r0
	cmp	r3, #0
	bge	.L44
	ldr	r0, .L59+12
	bl	perror
	mov	r0, #1
	bl	exit
.L44:
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r2, [fp, #-52]
	str	r2, [r3, #-24]
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L43:
	ldr	r3, [fp, #-52]
	cmp	r3, #4
	ble	.L45
	mov	r2, #1
	mov	r1, #0
	ldr	r0, .L59+16
	bl	sem_init
	mov	r3, r0
	cmp	r3, #0
	bge	.L46
	ldr	r0, .L59+12
	bl	perror
	mov	r0, #1
	bl	exit
.L46:
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L47
.L49:
	sub	r2, fp, #48
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	add	r0, r2, r3
	sub	r2, fp, #28
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, .L59+20
	mov	r1, #0
	bl	pthread_create
	mov	r3, r0
	cmp	r3, #0
	bge	.L48
	ldr	r0, .L59+24
	bl	perror
	mov	r0, #1
	bl	exit
.L48:
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L47:
	ldr	r3, [fp, #-52]
	cmp	r3, #4
	ble	.L49
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L50
.L52:
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-44]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	mov	r3, r0
	cmp	r3, #0
	bge	.L51
	ldr	r0, .L59+28
	bl	perror
	mov	r0, #1
	bl	exit
.L51:
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L50:
	ldr	r3, [fp, #-52]
	cmp	r3, #4
	ble	.L52
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L53
.L55:
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #4
	ldr	r2, .L59+8
	add	r3, r3, r2
	mov	r0, r3
	bl	sem_destroy
	mov	r3, r0
	cmp	r3, #0
	beq	.L54
	ldr	r0, .L59+32
	bl	perror
.L54:
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L53:
	ldr	r3, [fp, #-52]
	cmp	r3, #4
	ble	.L55
	ldr	r0, .L59+16
	bl	sem_destroy
	mov	r3, r0
	cmp	r3, #0
	beq	.L56
	ldr	r0, .L59+32
	bl	perror
	mov	r0, #1
	bl	exit
.L56:
	mov	r3, #0
	ldr	r2, .L59
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L58
	bl	__stack_chk_fail
.L58:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L60:
	.align	2
.L59:
	.word	.LC17
	.word	34952
	.word	Philosopher
	.word	.LC13
	.word	Mutex
	.word	DiningPhilosopher
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
