	.file	"589416.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"(process %d) philosopher %d is sitting at the table\n"
	.align 8
.LC1:
	.string	"(process %d) philosopher %d is eating\n"
	.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
	push	rbx
	sub	rsp, 56
	.cfi_offset 3, -24
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	cmp	DWORD PTR -52[rbp], 2
	je	.L2
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	sal	rax, 5
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	mov	DWORD PTR -48[rbp], 0
	jmp	.L3
.L4:
	mov	eax, DWORD PTR -48[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	edx, 1
	mov	esi, 1
	mov	rdi, rax
	call	sem_init@PLT
	add	DWORD PTR -48[rbp], 1
.L3:
	mov	eax, DWORD PTR -48[rbp]
	cmp	eax, DWORD PTR -28[rbp]
	jl	.L4
	mov	DWORD PTR -48[rbp], 0
	jmp	.L5
.L11:
	call	fork@PLT
	mov	DWORD PTR -44[rbp], eax
	cmp	DWORD PTR -44[rbp], 0
	jne	.L6
	mov	esi, 9
	mov	edi, 1
	mov	eax, 0
	call	prctl@PLT
	mov	eax, DWORD PTR -48[rbp]
	mov	DWORD PTR -32[rbp], eax
	mov	eax, DWORD PTR -48[rbp]
	mov	DWORD PTR -40[rbp], eax
	mov	eax, DWORD PTR -28[rbp]
	sub	eax, 1
	cmp	DWORD PTR -32[rbp], eax
	jne	.L7
	mov	DWORD PTR -36[rbp], 0
	jmp	.L8
.L7:
	mov	eax, DWORD PTR -32[rbp]
	add	eax, 1
	mov	DWORD PTR -36[rbp], eax
.L8:
	mov	eax, DWORD PTR -48[rbp]
	lea	ebx, 1[rax]
	call	getpid@PLT
	mov	edx, ebx
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L9
.L6:
	cmp	DWORD PTR -44[rbp], 0
	jle	.L10
	add	DWORD PTR -48[rbp], 1
	jmp	.L5
.L10:
	mov	edi, -1
	call	exit@PLT
.L5:
	mov	eax, DWORD PTR -48[rbp]
	cmp	eax, DWORD PTR -28[rbp]
	jl	.L11
.L9:
	cmp	DWORD PTR -44[rbp], 0
	jne	.L12
	call	getpid@PLT
	mov	DWORD PTR -44[rbp], eax
.L15:
	mov	eax, DWORD PTR -32[rbp]
	and	eax, 1
	test	eax, eax
	jne	.L13
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	rdi, rax
	call	sem_wait@PLT
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	rdi, rax
	call	sem_wait@PLT
	jmp	.L14
.L13:
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	rdi, rax
	call	sem_wait@PLT
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	rdi, rax
	call	sem_wait@PLT
.L14:
	mov	eax, DWORD PTR -32[rbp]
	lea	edx, 1[rax]
	mov	eax, DWORD PTR -44[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	rdi, rax
	call	sem_post@PLT
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	rdi, rax
	call	sem_post@PLT
	jmp	.L15
.L12:
	call	pause@PLT
	mov	eax, 0
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"589416.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"(process %d) philosopher %d is sitting at the table"
	.ascii	"\012\000"
	.align	2
.LC1:
	.ascii	"(process %d) philosopher %d is eating\012\000"
	.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, [fp, #-40]
	cmp	r3, #2
	beq	.L2
	mov	r0, #1
	bl	exit
.L2:
	ldr	r3, [fp, #-44]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #4
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L3
.L4:
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	mov	r2, #1
	mov	r1, #1
	mov	r0, r3
	bl	sem_init
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L3:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	blt	.L4
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L5
.L11:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L6
	mov	r1, #9
	mov	r0, #1
	bl	prctl
	ldr	r3, [fp, #-32]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-32]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	bne	.L7
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L8
.L7:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L8:
	bl	getpid
	mov	r1, r0
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	mov	r2, r3
	ldr	r0, .L17
	bl	printf
	b	.L9
.L6:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	ble	.L10
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
	b	.L5
.L10:
	mvn	r0, #0
	bl	exit
.L5:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	blt	.L11
.L9:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L12
	bl	getpid
	str	r0, [fp, #-28]
.L15:
	ldr	r3, [fp, #-16]
	and	r3, r3, #1
	cmp	r3, #0
	bne	.L13
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	mov	r0, r3
	bl	sem_wait
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	mov	r0, r3
	bl	sem_wait
	b	.L14
.L13:
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	mov	r0, r3
	bl	sem_wait
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	mov	r0, r3
	bl	sem_wait
.L14:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	mov	r2, r3
	ldr	r1, [fp, #-28]
	ldr	r0, .L17+4
	bl	printf
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	mov	r0, r3
	bl	sem_post
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	mov	r0, r3
	bl	sem_post
	b	.L15
.L12:
	bl	pause
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L18:
	.align	2
.L17:
	.word	.LC0
	.word	.LC1
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
