	.file	"642613.c"
	.intel_syntax noprefix
	.text
	.globl	global_i
	.bss
	.align 8
	.type	global_i, @object
	.size	global_i, 8
global_i:
	.zero	8
	.globl	sem
	.align 32
	.type	sem, @object
	.size	sem, 32
sem:
	.zero	32
	.globl	lock
	.align 32
	.type	lock, @object
	.size	lock, 32
lock:
	.zero	32
	.section	.rodata
.LC0:
	.string	"global_i_1: %ld\n"
.LC1:
	.string	"local_i_1: %ld\n"
	.text
	.globl	fn1
	.type	fn1, @function
fn1:
.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	QWORD PTR -8[rbp], 0
	mov	DWORD PTR -12[rbp], 0
	jmp	.L2
.L3:
	lea	rdi, sem[rip]
	call	sem_wait@PLT
	mov	rax, QWORD PTR global_i[rip]
	add	rax, 1
	mov	QWORD PTR global_i[rip], rax
	lea	rdi, sem[rip]
	call	sem_post@PLT
	add	QWORD PTR -8[rbp], 1
	add	DWORD PTR -12[rbp], 1
.L2:
	cmp	DWORD PTR -12[rbp], 49999999
	jle	.L3
	mov	rax, QWORD PTR global_i[rip]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	fn1, .-fn1
	.section	.rodata
.LC2:
	.string	"global_i_2: %ld\n"
.LC3:
	.string	"local_i_2: %ld\n"
	.text
	.globl	fn2
	.type	fn2, @function
fn2:
.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	QWORD PTR -8[rbp], 0
	mov	DWORD PTR -12[rbp], 0
	jmp	.L6
.L7:
	lea	rdi, sem[rip]
	call	sem_wait@PLT
	mov	rax, QWORD PTR global_i[rip]
	add	rax, 1
	mov	QWORD PTR global_i[rip], rax
	lea	rdi, sem[rip]
	call	sem_post@PLT
	add	QWORD PTR -8[rbp], 1
	add	DWORD PTR -12[rbp], 1
.L6:
	cmp	DWORD PTR -12[rbp], 49999999
	jle	.L7
	mov	rax, QWORD PTR global_i[rip]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fn2, .-fn2
	.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	rdx, QWORD PTR 8[rax]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -16[rbp], rax
	mov	QWORD PTR -8[rbp], rdx
.L10:
	mov	eax, DWORD PTR -16[rbp]
	mov	edi, eax
	call	think
	lea	rdi, lock[rip]
	call	sem_wait@PLT
	mov	rcx, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR -16[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	add	rax, rcx
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	rsi, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR -16[rbp]
	add	eax, 1
	mov	ecx, DWORD PTR -12[rbp]
	cdq
	idiv	ecx
	mov	eax, edx
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	add	rax, rsi
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR -16[rbp]
	mov	edi, eax
	call	eat
	mov	rcx, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR -16[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	add	rax, rcx
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	mov	rsi, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR -16[rbp]
	add	eax, 1
	mov	ecx, DWORD PTR -12[rbp]
	cdq
	idiv	ecx
	mov	eax, edx
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	add	rax, rsi
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	lea	rdi, lock[rip]
	call	sem_post@PLT
	jmp	.L10
	.cfi_endproc
.LFE9:
	.size	philosopher, .-philosopher
	.section	.rodata
.LC4:
	.string	"Philosopher %d thinking...\n"
	.text
	.globl	think
	.type	think, @function
think:
.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
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	think, .-think
	.section	.rodata
.LC5:
	.string	"Philosopher %d eating...\n"
	.text
	.globl	eat
	.type	eat, @function
eat:
.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
	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
.LFE11:
	.size	eat, .-eat
	.globl	main
	.type	main, @function
main:
.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, 288
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -276[rbp], 0
	jmp	.L14
.L15:
	lea	rcx, -208[rbp]
	mov	eax, DWORD PTR -276[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	add	rax, rcx
	mov	esi, 0
	mov	rdi, rax
	call	pthread_mutex_init@PLT
	add	DWORD PTR -276[rbp], 1
.L14:
	cmp	DWORD PTR -276[rbp], 4
	jle	.L15
	mov	edx, 5
	mov	esi, 0
	lea	rdi, lock[rip]
	call	sem_init@PLT
	mov	DWORD PTR -272[rbp], 0
	jmp	.L16
.L17:
	mov	edi, 16
	call	malloc@PLT
	mov	QWORD PTR -264[rbp], rax
	mov	rax, QWORD PTR -264[rbp]
	mov	edx, DWORD PTR -272[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -264[rbp]
	mov	DWORD PTR 4[rax], 5
	mov	rax, QWORD PTR -264[rbp]
	lea	rdx, -208[rbp]
	mov	QWORD PTR 8[rax], rdx
	lea	rdx, -256[rbp]
	mov	eax, DWORD PTR -272[rbp]
	cdqe
	sal	rax, 3
	lea	rdi, [rdx+rax]
	mov	rax, QWORD PTR -264[rbp]
	mov	rcx, rax
	lea	rdx, philosopher[rip]
	mov	esi, 0
	call	pthread_create@PLT
	add	DWORD PTR -272[rbp], 1
.L16:
	cmp	DWORD PTR -272[rbp], 4
	jle	.L17
	mov	DWORD PTR -268[rbp], 0
	jmp	.L18
.L19:
	mov	eax, DWORD PTR -268[rbp]
	cdqe
	mov	rax, QWORD PTR -256[rbp+rax*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	lea	rcx, -208[rbp]
	mov	eax, DWORD PTR -268[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	add	rax, rcx
	mov	rdi, rax
	call	pthread_mutex_destroy@PLT
	add	DWORD PTR -268[rbp], 1
.L18:
	cmp	DWORD PTR -268[rbp], 4
	jle	.L19
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE12:
	.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	"642613.c"
	.text
	.global	global_i
	.bss
	.align	2
	.type	global_i, %object
	.size	global_i, 4
global_i:
	.space	4
	.comm	sem,16,4
	.comm	lock,16,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"global_i_1: %ld\012\000"
	.align	2
.LC1:
	.ascii	"local_i_1: %ld\012\000"
	.text
	.align	2
	.global	fn1
	.syntax unified
	.arm
	.fpu softvfp
	.type	fn1, %function
fn1:
	@ 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]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L2
.L3:
	ldr	r0, .L5
	bl	sem_wait
	ldr	r3, .L5+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L5+4
	str	r3, [r2]
	ldr	r0, .L5
	bl	sem_post
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L2:
	ldr	r3, [fp, #-8]
	ldr	r2, .L5+8
	cmp	r3, r2
	ble	.L3
	ldr	r3, .L5+4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L5+12
	bl	printf
	ldr	r1, [fp, #-12]
	ldr	r0, .L5+16
	bl	printf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	sem
	.word	global_i
	.word	49999999
	.word	.LC0
	.word	.LC1
	.size	fn1, .-fn1
	.section	.rodata
	.align	2
.LC2:
	.ascii	"global_i_2: %ld\012\000"
	.align	2
.LC3:
	.ascii	"local_i_2: %ld\012\000"
	.text
	.align	2
	.global	fn2
	.syntax unified
	.arm
	.fpu softvfp
	.type	fn2, %function
fn2:
	@ 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]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L8
.L9:
	ldr	r0, .L11
	bl	sem_wait
	ldr	r3, .L11+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L11+4
	str	r3, [r2]
	ldr	r0, .L11
	bl	sem_post
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L8:
	ldr	r3, [fp, #-8]
	ldr	r2, .L11+8
	cmp	r3, r2
	ble	.L9
	ldr	r3, .L11+4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L11+12
	bl	printf
	ldr	r1, [fp, #-12]
	ldr	r0, .L11+16
	bl	printf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	sem
	.word	global_i
	.word	49999999
	.word	.LC2
	.word	.LC3
	.size	fn2, .-fn2
	.global	__aeabi_idivmod
	.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	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #28
	str	r0, [fp, #-32]
	ldr	r2, [fp, #-32]
	sub	r3, fp, #24
	ldm	r2, {r0, r1, r2}
	stm	r3, {r0, r1, r2}
.L14:
	ldr	r3, [fp, #-24]
	mov	r0, r3
	bl	think
	ldr	r0, .L15
	bl	sem_wait
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-24]
	mov	r1, r3
	mov	r3, r1
	lsl	r3, r3, #1
	add	r3, r3, r1
	lsl	r3, r3, #3
	add	r3, r2, r3
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r4, [fp, #-16]
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	ldr	r2, [fp, #-20]
	mov	r1, r2
	mov	r0, r3
	bl	__aeabi_idivmod
	mov	r3, r1
	mov	r2, r3
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r4, r3
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r3, [fp, #-24]
	mov	r0, r3
	bl	eat
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-24]
	mov	r1, r3
	mov	r3, r1
	lsl	r3, r3, #1
	add	r3, r3, r1
	lsl	r3, r3, #3
	add	r3, r2, r3
	mov	r0, r3
	bl	pthread_mutex_unlock
	ldr	r4, [fp, #-16]
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	ldr	r2, [fp, #-20]
	mov	r1, r2
	mov	r0, r3
	bl	__aeabi_idivmod
	mov	r3, r1
	mov	r2, r3
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r4, r3
	mov	r0, r3
	bl	pthread_mutex_unlock
	ldr	r0, .L15
	bl	sem_post
	b	.L14
.L16:
	.align	2
.L15:
	.word	lock
	.size	philosopher, .-philosopher
	.section	.rodata
	.align	2
.LC4:
	.ascii	"Philosopher %d 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, .L18
	bl	printf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC4
	.size	think, .-think
	.section	.rodata
	.align	2
.LC5:
	.ascii	"Philosopher %d eating...\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, .L21
	bl	printf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	.LC5
	.size	eat, .-eat
	.section	.rodata
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 160
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #160
	ldr	r3, .L31
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-164]
	b	.L24
.L25:
	sub	r1, fp, #128
	ldr	r2, [fp, #-164]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r1, r3
	mov	r1, #0
	mov	r0, r3
	bl	pthread_mutex_init
	ldr	r3, [fp, #-164]
	add	r3, r3, #1
	str	r3, [fp, #-164]
.L24:
	ldr	r3, [fp, #-164]
	cmp	r3, #4
	ble	.L25
	mov	r2, #5
	mov	r1, #0
	ldr	r0, .L31+4
	bl	sem_init
	mov	r3, #0
	str	r3, [fp, #-160]
	b	.L26
.L27:
	mov	r0, #12
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-152]
	ldr	r3, [fp, #-152]
	ldr	r2, [fp, #-160]
	str	r2, [r3]
	ldr	r3, [fp, #-152]
	mov	r2, #5
	str	r2, [r3, #4]
	ldr	r3, [fp, #-152]
	sub	r2, fp, #128
	str	r2, [r3, #8]
	sub	r2, fp, #148
	ldr	r3, [fp, #-160]
	lsl	r3, r3, #2
	add	r0, r2, r3
	ldr	r3, [fp, #-152]
	ldr	r2, .L31+8
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-160]
	add	r3, r3, #1
	str	r3, [fp, #-160]
.L26:
	ldr	r3, [fp, #-160]
	cmp	r3, #4
	ble	.L27
	mov	r3, #0
	str	r3, [fp, #-156]
	b	.L28
.L29:
	ldr	r3, [fp, #-156]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-144]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	sub	r1, fp, #128
	ldr	r2, [fp, #-156]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r1, r3
	mov	r0, r3
	bl	pthread_mutex_destroy
	ldr	r3, [fp, #-156]
	add	r3, r3, #1
	str	r3, [fp, #-156]
.L28:
	ldr	r3, [fp, #-156]
	cmp	r3, #4
	ble	.L29
	mov	r0, #0
	bl	pthread_exit
.L32:
	.align	2
.L31:
	.word	.LC6
	.word	lock
	.word	philosopher
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
