	.file	"258730.c"
	.intel_syntax noprefix
	.text
	.globl	philosophers
	.data
	.align 16
	.type	philosophers, @object
	.size	philosophers, 20
philosophers:
	.long	0
	.long	1
	.long	2
	.long	3
	.long	4
	.globl	chopsticks
	.bss
	.align 32
	.type	chopsticks, @object
	.size	chopsticks, 200
chopsticks:
	.zero	200
	.text
	.globl	main
	.type	main, @function
main:
.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, 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 -64[rbp], 0
	jmp	.L2
.L3:
	mov	eax, DWORD PTR -64[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	lea	rdx, chopsticks[rip]
	add	rax, rdx
	mov	esi, 0
	mov	rdi, rax
	call	pthread_mutex_init@PLT
	add	DWORD PTR -64[rbp], 1
.L2:
	cmp	DWORD PTR -64[rbp], 4
	jle	.L3
	mov	DWORD PTR -60[rbp], 0
	jmp	.L4
.L5:
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, philosophers[rip]
	add	rdx, rax
	lea	rcx, -48[rbp]
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	sal	rax, 3
	add	rax, rcx
	mov	rcx, rdx
	lea	rdx, philosopher[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	add	DWORD PTR -60[rbp], 1
.L4:
	cmp	DWORD PTR -60[rbp], 4
	jle	.L5
	mov	DWORD PTR -56[rbp], 0
	jmp	.L6
.L7:
	mov	eax, DWORD PTR -56[rbp]
	cdqe
	mov	rax, QWORD PTR -48[rbp+rax*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	DWORD PTR -56[rbp], 1
.L6:
	cmp	DWORD PTR -56[rbp], 4
	jle	.L7
	mov	DWORD PTR -52[rbp], 0
	jmp	.L8
.L9:
	mov	eax, DWORD PTR -52[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	lea	rdx, chopsticks[rip]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_destroy@PLT
	add	DWORD PTR -52[rbp], 1
.L8:
	cmp	DWORD PTR -52[rbp], 4
	jle	.L9
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.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
	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 -4[rbp], edx
	mov	ecx, DWORD PTR -4[rbp]
	mov	edx, ecx
	add	edx, edx
	add	edx, ecx
	sub	eax, edx
	mov	DWORD PTR -4[rbp], eax
	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, 16
	call	rand@PLT
	cdq
	shr	edx, 31
	add	eax, edx
	and	eax, 1
	sub	eax, edx
	mov	DWORD PTR -4[rbp], eax
	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
	.section	.rodata
.LC0:
	.string	"philosopher %d is thinking\n"
.LC1:
	.string	"philosopher %d is hungry\n"
.LC2:
	.string	"philosopher %d is eating\n"
	.align 8
.LC3:
	.string	"philosopher %d finished eating\n"
	.text
	.globl	philosopher
	.type	philosopher, @function
philosopher:
.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, 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	.L15
.L18:
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	call	think
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
.L16:
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	lea	rdx, chopsticks[rip]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	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
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	lea	rdx, chopsticks[rip]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_trylock@PLT
	cmp	eax, 16
	jne	.L17
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	lea	rdx, chopsticks[rip]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	jmp	.L16
.L17:
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	call	eat
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	lea	rdx, chopsticks[rip]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	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
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	lea	rdx, chopsticks[rip]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	add	DWORD PTR -8[rbp], 1
.L15:
	cmp	DWORD PTR -8[rbp], 2
	jle	.L18
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	philosopher, .-philosopher
	.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	"258730.c"
	.text
	.global	philosophers
	.data
	.align	2
	.type	philosophers, %object
	.size	philosophers, 20
philosophers:
	.word	0
	.word	1
	.word	2
	.word	3
	.word	4
	.comm	chopsticks,120,4
	.section	.rodata
	.align	2
.LC0:
	.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
	ldr	r3, .L12
	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, #-44]
	b	.L2
.L3:
	ldr	r2, [fp, #-44]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L12+4
	add	r3, r3, r2
	mov	r1, #0
	mov	r0, r3
	bl	pthread_mutex_init
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L2:
	ldr	r3, [fp, #-44]
	cmp	r3, #4
	ble	.L3
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L4
.L5:
	sub	r2, fp, #28
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	add	r0, r2, r3
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	ldr	r2, .L12+8
	add	r3, r3, r2
	ldr	r2, .L12+12
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L4:
	ldr	r3, [fp, #-40]
	cmp	r3, #4
	ble	.L5
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L6
.L7:
	ldr	r3, [fp, #-36]
	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, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L6:
	ldr	r3, [fp, #-36]
	cmp	r3, #4
	ble	.L7
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L8
.L9:
	ldr	r2, [fp, #-32]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L12+4
	add	r3, r3, r2
	mov	r0, r3
	bl	pthread_mutex_destroy
	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
	ldr	r2, .L12
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L11
	bl	__stack_chk_fail
.L11:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L13:
	.align	2
.L12:
	.word	.LC0
	.word	chopsticks
	.word	philosophers
	.word	philosopher
	.size	main, .-main
	.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
	bl	rand
	mov	r2, r0
	ldr	r3, .L15
	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
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	1431655766
	.size	think, .-think
	.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
	bl	rand
	mov	r3, r0
	cmp	r3, #0
	and	r3, r3, #1
	rsblt	r3, r3, #0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	bl	sleep
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	eat, .-eat
	.section	.rodata
	.align	2
.LC1:
	.ascii	"philosopher %d is thinking\012\000"
	.align	2
.LC2:
	.ascii	"philosopher %d is hungry\012\000"
	.align	2
.LC3:
	.ascii	"philosopher %d is eating\012\000"
	.align	2
.LC4:
	.ascii	"philosopher %d finished eating\012\000"
	.text
	.align	2
	.global	philosopher
	.syntax unified
	.arm
	.fpu softvfp
	.type	philosopher, %function
philosopher:
	@ 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	.L19
.L22:
	ldr	r1, [fp, #-8]
	ldr	r0, .L23
	bl	printf
	bl	think
	ldr	r1, [fp, #-8]
	ldr	r0, .L23+4
	bl	printf
.L20:
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L23+8
	add	r3, r3, r2
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r3, [fp, #-8]
	add	r1, r3, #1
	ldr	r3, .L23+12
	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
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L23+8
	add	r3, r3, r2
	mov	r0, r3
	bl	pthread_mutex_trylock
	mov	r3, r0
	cmp	r3, #16
	bne	.L21
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L23+8
	add	r3, r3, r2
	mov	r0, r3
	bl	pthread_mutex_unlock
	b	.L20
.L21:
	ldr	r1, [fp, #-8]
	ldr	r0, .L23+16
	bl	printf
	bl	eat
	ldr	r1, [fp, #-8]
	ldr	r0, .L23+20
	bl	printf
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L23+8
	add	r3, r3, r2
	mov	r0, r3
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-8]
	add	r1, r3, #1
	ldr	r3, .L23+12
	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
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L23+8
	add	r3, r3, r2
	mov	r0, r3
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L19:
	ldr	r3, [fp, #-12]
	cmp	r3, #2
	ble	.L22
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	.LC1
	.word	.LC2
	.word	chopsticks
	.word	1717986919
	.word	.LC3
	.word	.LC4
	.size	philosopher, .-philosopher
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
