	.file	"176705144.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"/sem_ex14_beingUsed"
.LC1:
	.string	"Error at sem_open()!\n"
.LC2:
	.string	"/sem_ex14_barrier"
.LC3:
	.string	"/sem_mutex"
.LC4:
	.string	"/shm_ex14"
.LC5:
	.string	"Opening shared memory ERROR.\n"
.LC6:
	.string	"Space in Shared Memory ERROR\n"
.LC7:
	.string	"Error maping the object.\n"
	.align 8
.LC8:
	.string	"Writter pid is %d and arrived at %s"
.LC9:
	.string	"%s"
	.align 8
.LC10:
	.string	"WRITTER: number of writters is %d and number of readers is %d\n"
.LC11:
	.string	"==== Writter a sair ====\n"
.LC12:
	.string	"Munmap failed.\n"
.LC13:
	.string	"Cant close object.\n"
.LC14:
	.string	"Error at sem close"
	.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, 88
	.cfi_offset 3, -24
	mov	DWORD PTR -84[rbp], edi
	mov	QWORD PTR -96[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	esi, 64
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	sem_open@PLT
	mov	QWORD PTR -64[rbp], rax
	cmp	QWORD PTR -64[rbp], 0
	jne	.L2
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	esi, 64
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	sem_open@PLT
	mov	QWORD PTR -56[rbp], rax
	cmp	QWORD PTR -56[rbp], 0
	jne	.L3
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	esi, 64
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	sem_open@PLT
	mov	QWORD PTR -48[rbp], rax
	cmp	QWORD PTR -48[rbp], 0
	jne	.L4
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	mov	edx, 384
	mov	esi, 2
	lea	rdi, .LC4[rip]
	call	shm_open@PLT
	mov	DWORD PTR -76[rbp], eax
	cmp	DWORD PTR -76[rbp], -1
	jne	.L5
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	eax, DWORD PTR -76[rbp]
	mov	esi, 112
	mov	edi, eax
	call	ftruncate@PLT
	cmp	eax, -1
	jne	.L6
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	mov	eax, DWORD PTR -76[rbp]
	mov	r9d, 0
	mov	r8d, eax
	mov	ecx, 1
	mov	edx, 3
	mov	esi, 112
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -40[rbp], rax
	cmp	QWORD PTR -40[rbp], -1
	jne	.L7
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L7:
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	sem_wait@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR 108[rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -40[rbp]
	mov	DWORD PTR 108[rax], edx
	mov	rax, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	sem_wait@PLT
	lea	rax, -72[rbp]
	mov	rdi, rax
	call	time@PLT
	lea	rax, -72[rbp]
	mov	rdi, rax
	call	localtime@PLT
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	asctime@PLT
	mov	rbx, rax
	call	getpid@PLT
	mov	edx, eax
	mov	rax, QWORD PTR -40[rbp]
	mov	rcx, rbx
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, DWORD PTR 104[rax]
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR 108[rax]
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	sem_post@PLT
	mov	rax, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	sem_post@PLT
	lea	rdi, .LC11[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	esi, 112
	mov	rdi, rax
	call	munmap@PLT
	cmp	eax, -1
	jne	.L8
	lea	rdi, .LC12[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	mov	eax, DWORD PTR -76[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	eax, -1
	jne	.L9
	lea	rdi, .LC13[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L9:
	mov	rax, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	sem_close@PLT
	test	eax, eax
	jns	.L10
	lea	rdi, .LC14[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	sem_close@PLT
	test	eax, eax
	jns	.L11
	lea	rdi, .LC14[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L11:
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	sem_close@PLT
	test	eax, eax
	jns	.L12
	lea	rdi, .LC14[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L12:
	mov	eax, 0
	mov	rcx, QWORD PTR -24[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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	"176705144.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/sem_ex14_beingUsed\000"
	.align	2
.LC1:
	.ascii	"Error at sem_open()!\012\000"
	.align	2
.LC2:
	.ascii	"/sem_ex14_barrier\000"
	.align	2
.LC3:
	.ascii	"/sem_mutex\000"
	.align	2
.LC4:
	.ascii	"/shm_ex14\000"
	.align	2
.LC5:
	.ascii	"Opening shared memory ERROR.\012\000"
	.align	2
.LC6:
	.ascii	"Space in Shared Memory ERROR\012\000"
	.align	2
.LC7:
	.ascii	"Error maping the object.\012\000"
	.align	2
.LC8:
	.ascii	"Writter pid is %d and arrived at %s\000"
	.align	2
.LC9:
	.ascii	"%s\000"
	.align	2
.LC10:
	.ascii	"WRITTER: number of writters is %d and number of rea"
	.ascii	"ders is %d\012\000"
	.align	2
.LC11:
	.ascii	"==== Writter a sair ====\012\000"
	.align	2
.LC12:
	.ascii	"Munmap failed.\012\000"
	.align	2
.LC13:
	.ascii	"Cant close object.\012\000"
	.align	2
.LC14:
	.ascii	"Error at sem close\000"
	.align	2
.LC15:
	.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	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #48
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	ldr	r3, .L15
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r1, #64
	ldr	r0, .L15+4
	bl	sem_open
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	bne	.L2
	ldr	r0, .L15+8
	bl	perror
	mov	r0, #1
	bl	exit
.L2:
	mov	r1, #64
	ldr	r0, .L15+12
	bl	sem_open
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bne	.L3
	ldr	r0, .L15+8
	bl	perror
	mov	r0, #1
	bl	exit
.L3:
	mov	r1, #64
	ldr	r0, .L15+16
	bl	sem_open
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L4
	ldr	r0, .L15+8
	bl	perror
	mov	r0, #1
	bl	exit
.L4:
	mov	r2, #384
	mov	r1, #2
	ldr	r0, .L15+20
	bl	shm_open
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmn	r3, #1
	bne	.L5
	ldr	r0, .L15+24
	bl	perror
	mov	r0, #1
	bl	exit
.L5:
	mov	r1, #112
	ldr	r0, [fp, #-28]
	bl	ftruncate
	mov	r3, r0
	cmn	r3, #1
	bne	.L6
	ldr	r0, .L15+28
	bl	perror
	mov	r0, #1
	bl	exit
.L6:
	mov	r3, #0
	str	r3, [sp, #4]
	ldr	r3, [fp, #-28]
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #3
	mov	r1, #112
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmn	r3, #1
	bne	.L7
	ldr	r0, .L15+32
	bl	perror
	mov	r0, #1
	bl	exit
.L7:
	ldr	r0, [fp, #-36]
	bl	sem_wait
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #108]
	add	r2, r3, #1
	ldr	r3, [fp, #-24]
	str	r2, [r3, #108]
	ldr	r0, [fp, #-40]
	bl	sem_wait
	sub	r3, fp, #44
	mov	r0, r3
	bl	time
	sub	r3, fp, #44
	mov	r0, r3
	bl	localtime
	str	r0, [fp, #-20]
	ldr	r4, [fp, #-24]
	bl	getpid
	mov	r5, r0
	ldr	r0, [fp, #-20]
	bl	asctime
	mov	r3, r0
	mov	r2, r5
	ldr	r1, .L15+36
	mov	r0, r4
	bl	sprintf
	ldr	r3, [fp, #-24]
	mov	r1, r3
	ldr	r0, .L15+40
	bl	printf
	ldr	r3, [fp, #-24]
	ldr	r1, [r3, #108]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #104]
	mov	r2, r3
	ldr	r0, .L15+44
	bl	printf
	ldr	r0, [fp, #-36]
	bl	sem_post
	ldr	r0, [fp, #-40]
	bl	sem_post
	ldr	r0, .L15+48
	bl	puts
	mov	r1, #112
	ldr	r0, [fp, #-24]
	bl	munmap
	mov	r3, r0
	cmn	r3, #1
	bne	.L8
	ldr	r0, .L15+52
	bl	perror
	mov	r0, #1
	bl	exit
.L8:
	ldr	r0, [fp, #-28]
	bl	close
	mov	r3, r0
	cmn	r3, #1
	bne	.L9
	ldr	r0, .L15+56
	bl	perror
	mov	r0, #1
	bl	exit
.L9:
	ldr	r0, [fp, #-40]
	bl	sem_close
	mov	r3, r0
	cmp	r3, #0
	bge	.L10
	ldr	r0, .L15+60
	bl	perror
	mov	r0, #1
	bl	exit
.L10:
	ldr	r0, [fp, #-36]
	bl	sem_close
	mov	r3, r0
	cmp	r3, #0
	bge	.L11
	ldr	r0, .L15+60
	bl	perror
	mov	r0, #1
	bl	exit
.L11:
	ldr	r0, [fp, #-32]
	bl	sem_close
	mov	r3, r0
	cmp	r3, #0
	bge	.L12
	ldr	r0, .L15+60
	bl	perror
	mov	r0, #1
	bl	exit
.L12:
	mov	r3, #0
	ldr	r2, .L15
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L14
	bl	__stack_chk_fail
.L14:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L16:
	.align	2
.L15:
	.word	.LC15
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
