	.file	"663982.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"sem3"
.LC1:
	.string	"sem_open failure"
.LC2:
	.string	"sharedmem"
.LC3:
	.string	"shm_open"
.LC4:
	.string	"ftruncate"
.LC5:
	.string	"mmap"
.LC6:
	.string	"sem1"
.LC7:
	.string	"sem2"
.LC8:
	.string	"To exit program enter 'q::'."
.LC9:
	.string	"Enter item for the table: "
.LC10:
	.string	"Invalid string"
.LC11:
	.string	"\r\n"
.LC12:
	.string	"q::"
.LC13:
	.string	"%s"
	.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, 2144
	mov	DWORD PTR -2132[rbp], edi
	mov	QWORD PTR -2144[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	ecx, 0
	mov	edx, 432
	mov	esi, 64
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	sem_open@PLT
	mov	QWORD PTR -2096[rbp], rax
	cmp	QWORD PTR -2096[rbp], 0
	jne	.L2
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 0
	call	exit@PLT
.L2:
	mov	DWORD PTR -2116[rbp], 4096
	lea	rax, .LC2[rip]
	mov	QWORD PTR -2088[rbp], rax
	mov	rax, QWORD PTR -2088[rbp]
	mov	rdi, rax
	call	shm_unlink@PLT
	mov	rax, QWORD PTR -2088[rbp]
	mov	edx, 384
	mov	esi, 194
	mov	rdi, rax
	call	shm_open@PLT
	mov	DWORD PTR -2112[rbp], eax
	cmp	DWORD PTR -2112[rbp], -1
	jne	.L3
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	eax, DWORD PTR -2116[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -2112[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	ftruncate@PLT
	cmp	eax, -1
	jne	.L4
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	mov	eax, DWORD PTR -2116[rbp]
	cdqe
	mov	edx, DWORD PTR -2112[rbp]
	mov	r9d, 0
	mov	r8d, edx
	mov	ecx, 1
	mov	edx, 3
	mov	rsi, rax
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -2104[rbp], rax
	cmp	QWORD PTR -2104[rbp], -1
	jne	.L5
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	lea	rdi, .LC6[rip]
	call	sem_unlink@PLT
	lea	rdi, .LC7[rip]
	call	sem_unlink@PLT
	mov	ecx, 2
	mov	edx, 432
	mov	esi, 64
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	sem_open@PLT
	mov	QWORD PTR -2080[rbp], rax
	cmp	QWORD PTR -2080[rbp], 0
	jne	.L6
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 0
	call	exit@PLT
.L6:
	mov	ecx, 0
	mov	edx, 432
	mov	esi, 64
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	sem_open@PLT
	mov	QWORD PTR -2072[rbp], rax
	cmp	QWORD PTR -2072[rbp], 0
	jne	.L7
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 0
	call	exit@PLT
.L7:
	mov	rax, QWORD PTR -2096[rbp]
	mov	rdi, rax
	call	sem_post@PLT
	mov	DWORD PTR -2108[rbp], 2047
	lea	rdi, .LC8[rip]
	call	puts@PLT
.L13:
	lea	rax, -2064[rbp]
	mov	edx, 2046
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rdx, QWORD PTR stdin[rip]
	lea	rax, -2064[rbp]
	mov	esi, 2046
	mov	rdi, rax
	call	fgets@PLT
	test	rax, rax
	jne	.L8
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L9
.L8:
	lea	rax, -2064[rbp]
	lea	rsi, .LC11[rip]
	mov	rdi, rax
	call	strcspn@PLT
	mov	BYTE PTR -2064[rbp+rax], 0
	lea	rax, -2064[rbp]
	lea	rsi, .LC12[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	je	.L16
	mov	rax, QWORD PTR -2080[rbp]
	mov	rdi, rax
	call	sem_wait@PLT
	mov	rax, QWORD PTR -2104[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L11
	mov	eax, DWORD PTR -2108[rbp]
	cdqe
	add	QWORD PTR -2104[rbp], rax
	lea	rdx, -2064[rbp]
	mov	rax, QWORD PTR -2104[rbp]
	lea	rsi, .LC13[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	mov	eax, DWORD PTR -2108[rbp]
	cdqe
	neg	rax
	add	QWORD PTR -2104[rbp], rax
	jmp	.L12
.L11:
	lea	rdx, -2064[rbp]
	mov	rax, QWORD PTR -2104[rbp]
	lea	rsi, .LC13[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
.L12:
	mov	rax, QWORD PTR -2072[rbp]
	mov	rdi, rax
	call	sem_post@PLT
	jmp	.L13
.L16:
	nop
.L9:
	mov	rax, QWORD PTR -2088[rbp]
	mov	rdi, rax
	call	shm_unlink@PLT
	lea	rdi, .LC0[rip]
	call	sem_unlink@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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	"663982.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"sem3\000"
	.align	2
.LC1:
	.ascii	"sem_open failure\000"
	.align	2
.LC2:
	.ascii	"sharedmem\000"
	.align	2
.LC3:
	.ascii	"shm_open\000"
	.align	2
.LC4:
	.ascii	"ftruncate\000"
	.align	2
.LC5:
	.ascii	"mmap\000"
	.align	2
.LC6:
	.ascii	"sem1\000"
	.align	2
.LC7:
	.ascii	"sem2\000"
	.align	2
.LC8:
	.ascii	"To exit program enter 'q::'.\000"
	.align	2
.LC9:
	.ascii	"Enter item for the table: \000"
	.align	2
.LC10:
	.ascii	"Invalid string\000"
	.align	2
.LC11:
	.ascii	"\015\012\000"
	.align	2
.LC12:
	.ascii	"q::\000"
	.align	2
.LC13:
	.ascii	"%s\000"
	.align	2
.LC14:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 2096
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #2096
	sub	sp, sp, #8
	str	r0, [fp, #-2096]
	str	r1, [fp, #-2100]
	ldr	r3, .L17
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	mov	r2, #432
	mov	r1, #64
	ldr	r0, .L17+4
	bl	sem_open
	str	r0, [fp, #-2084]
	ldr	r3, [fp, #-2084]
	cmp	r3, #0
	bne	.L2
	ldr	r0, .L17+8
	bl	perror
	mov	r0, #0
	bl	exit
.L2:
	mov	r3, #4096
	str	r3, [fp, #-2080]
	ldr	r3, .L17+12
	str	r3, [fp, #-2076]
	ldr	r0, [fp, #-2076]
	bl	shm_unlink
	mov	r2, #384
	mov	r1, #194
	ldr	r0, [fp, #-2076]
	bl	shm_open
	str	r0, [fp, #-2072]
	ldr	r3, [fp, #-2072]
	cmn	r3, #1
	bne	.L3
	ldr	r0, .L17+16
	bl	perror
	mov	r0, #1
	bl	exit
.L3:
	ldr	r1, [fp, #-2080]
	ldr	r0, [fp, #-2072]
	bl	ftruncate
	mov	r3, r0
	cmn	r3, #1
	bne	.L4
	ldr	r0, .L17+20
	bl	perror
	mov	r0, #1
	bl	exit
.L4:
	ldr	r1, [fp, #-2080]
	mov	r3, #0
	str	r3, [sp, #4]
	ldr	r3, [fp, #-2072]
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #3
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-2088]
	ldr	r3, [fp, #-2088]
	cmn	r3, #1
	bne	.L5
	ldr	r0, .L17+24
	bl	perror
	mov	r0, #1
	bl	exit
.L5:
	ldr	r0, .L17+28
	bl	sem_unlink
	ldr	r0, .L17+32
	bl	sem_unlink
	mov	r3, #2
	mov	r2, #432
	mov	r1, #64
	ldr	r0, .L17+28
	bl	sem_open
	str	r0, [fp, #-2068]
	ldr	r3, [fp, #-2068]
	cmp	r3, #0
	bne	.L6
	ldr	r0, .L17+8
	bl	perror
	mov	r0, #0
	bl	exit
.L6:
	mov	r3, #0
	mov	r2, #432
	mov	r1, #64
	ldr	r0, .L17+32
	bl	sem_open
	str	r0, [fp, #-2064]
	ldr	r3, [fp, #-2064]
	cmp	r3, #0
	bne	.L7
	ldr	r0, .L17+8
	bl	perror
	mov	r0, #0
	bl	exit
.L7:
	ldr	r0, [fp, #-2084]
	bl	sem_post
	ldr	r3, .L17+36
	str	r3, [fp, #-2060]
	ldr	r0, .L17+40
	bl	puts
.L13:
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r2, .L17+44
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r0, .L17+48
	bl	printf
	ldr	r3, .L17+52
	ldr	r2, [r3]
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r1, .L17+44
	mov	r0, r3
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	bne	.L8
	ldr	r0, .L17+56
	bl	printf
	b	.L9
.L8:
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r1, .L17+60
	mov	r0, r3
	bl	strcspn
	mov	r3, r0
	sub	r2, fp, #4
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3, #-2052]
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r1, .L17+64
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L16
	ldr	r0, [fp, #-2068]
	bl	sem_wait
	ldr	r3, [fp, #-2088]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L11
	ldr	r3, [fp, #-2060]
	ldr	r2, [fp, #-2088]
	add	r3, r2, r3
	str	r3, [fp, #-2088]
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, r3
	ldr	r1, .L17+68
	ldr	r0, [fp, #-2088]
	bl	sprintf
	ldr	r3, [fp, #-2060]
	rsb	r3, r3, #0
	ldr	r2, [fp, #-2088]
	add	r3, r2, r3
	str	r3, [fp, #-2088]
	b	.L12
.L11:
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, r3
	ldr	r1, .L17+68
	ldr	r0, [fp, #-2088]
	bl	sprintf
.L12:
	ldr	r0, [fp, #-2064]
	bl	sem_post
	b	.L13
.L16:
	nop
.L9:
	ldr	r0, [fp, #-2076]
	bl	shm_unlink
	ldr	r0, .L17+4
	bl	sem_unlink
	mov	r3, #0
	ldr	r2, .L17
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L15
	bl	__stack_chk_fail
.L15:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L18:
	.align	2
.L17:
	.word	.LC14
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	2047
	.word	.LC8
	.word	2046
	.word	.LC9
	.word	stdin
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
