	.file	"495598.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"/sem-mutex"
.LC1:
	.string	"sem_open"
.LC2:
	.string	"/posix-shared-mem-example"
.LC3:
	.string	"shm_open"
.LC4:
	.string	"mmap"
.LC5:
	.string	"/sem-buffer-count"
.LC6:
	.string	"/sem-spool-signal"
.LC7:
	.string	"Please type a message: "
.LC8:
	.string	"sem_wait: buffer_count_sem"
.LC9:
	.string	"sem_wait: mutex_sem"
.LC10:
	.string	"%d: %s %s\n"
.LC11:
	.string	"sem_post: mutex_sem"
.LC12:
	.string	"sem_post: (spool_signal_sem"
.LC13:
	.string	"munmap"
	.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, 352
	mov	DWORD PTR -340[rbp], edi
	mov	QWORD PTR -352[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	ecx, 0
	mov	edx, 0
	mov	esi, 0
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	sem_open@PLT
	mov	QWORD PTR -312[rbp], rax
	cmp	QWORD PTR -312[rbp], 0
	jne	.L2
	lea	rdi, .LC1[rip]
	call	error
.L2:
	mov	edx, 0
	mov	esi, 2
	lea	rdi, .LC2[rip]
	call	shm_open@PLT
	mov	DWORD PTR -332[rbp], eax
	cmp	DWORD PTR -332[rbp], -1
	jne	.L3
	lea	rdi, .LC3[rip]
	call	error
.L3:
	mov	eax, DWORD PTR -332[rbp]
	mov	r9d, 0
	mov	r8d, eax
	mov	ecx, 1
	mov	edx, 3
	mov	esi, 2568
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -304[rbp], rax
	cmp	QWORD PTR -304[rbp], -1
	jne	.L4
	lea	rdi, .LC4[rip]
	call	error
.L4:
	mov	ecx, 0
	mov	edx, 0
	mov	esi, 0
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	sem_open@PLT
	mov	QWORD PTR -296[rbp], rax
	cmp	QWORD PTR -296[rbp], 0
	jne	.L5
	lea	rdi, .LC1[rip]
	call	error
.L5:
	mov	ecx, 0
	mov	edx, 0
	mov	esi, 0
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	sem_open@PLT
	mov	QWORD PTR -288[rbp], rax
	cmp	QWORD PTR -288[rbp], 0
	jne	.L6
	lea	rdi, .LC1[rip]
	call	error
.L6:
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L7
.L15:
	lea	rax, -272[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -328[rbp], eax
	mov	eax, DWORD PTR -328[rbp]
	sub	eax, 1
	cdqe
	movzx	eax, BYTE PTR -272[rbp+rax]
	cmp	al, 10
	jne	.L8
	mov	eax, DWORD PTR -328[rbp]
	sub	eax, 1
	cdqe
	mov	BYTE PTR -272[rbp+rax], 0
.L8:
	mov	rax, QWORD PTR -296[rbp]
	mov	rdi, rax
	call	sem_wait@PLT
	cmp	eax, -1
	jne	.L9
	lea	rdi, .LC8[rip]
	call	error
.L9:
	mov	rax, QWORD PTR -312[rbp]
	mov	rdi, rax
	call	sem_wait@PLT
	cmp	eax, -1
	jne	.L10
	lea	rdi, .LC9[rip]
	call	error
.L10:
	mov	edi, 0
	call	time@PLT
	mov	QWORD PTR -320[rbp], rax
	lea	rax, -320[rbp]
	mov	rdi, rax
	call	ctime@PLT
	mov	QWORD PTR -280[rbp], rax
	mov	rax, QWORD PTR -280[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -324[rbp], eax
	mov	eax, DWORD PTR -324[rbp]
	cdqe
	lea	rdx, -1[rax]
	mov	rax, QWORD PTR -280[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 10
	jne	.L11
	mov	eax, DWORD PTR -324[rbp]
	cdqe
	lea	rdx, -1[rax]
	mov	rax, QWORD PTR -280[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
.L11:
	call	getpid@PLT
	mov	edx, eax
	mov	rax, QWORD PTR -304[rbp]
	mov	eax, DWORD PTR 2560[rax]
	cdqe
	sal	rax, 8
	mov	rcx, rax
	mov	rax, QWORD PTR -304[rbp]
	lea	rdi, [rcx+rax]
	lea	rcx, -272[rbp]
	mov	rax, QWORD PTR -280[rbp]
	mov	r8, rcx
	mov	rcx, rax
	lea	rsi, .LC10[rip]
	mov	eax, 0
	call	sprintf@PLT
	mov	rax, QWORD PTR -304[rbp]
	mov	eax, DWORD PTR 2560[rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -304[rbp]
	mov	DWORD PTR 2560[rax], edx
	mov	rax, QWORD PTR -304[rbp]
	mov	eax, DWORD PTR 2560[rax]
	cmp	eax, 10
	jne	.L12
	mov	rax, QWORD PTR -304[rbp]
	mov	DWORD PTR 2560[rax], 0
.L12:
	mov	rax, QWORD PTR -312[rbp]
	mov	rdi, rax
	call	sem_post@PLT
	cmp	eax, -1
	jne	.L13
	lea	rdi, .LC11[rip]
	call	error
.L13:
	mov	rax, QWORD PTR -288[rbp]
	mov	rdi, rax
	call	sem_post@PLT
	cmp	eax, -1
	jne	.L14
	lea	rdi, .LC12[rip]
	call	error
.L14:
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
.L7:
	mov	rdx, QWORD PTR stdin[rip]
	lea	rax, -272[rbp]
	mov	esi, 198
	mov	rdi, rax
	call	fgets@PLT
	test	rax, rax
	jne	.L15
	mov	rax, QWORD PTR -304[rbp]
	mov	esi, 2568
	mov	rdi, rax
	call	munmap@PLT
	cmp	eax, -1
	jne	.L16
	lea	rdi, .LC13[rip]
	call	error
.L16:
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	error
	.type	error, @function
error:
.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
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE7:
	.size	error, .-error
	.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	"495598.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/sem-mutex\000"
	.align	2
.LC1:
	.ascii	"sem_open\000"
	.align	2
.LC2:
	.ascii	"/posix-shared-mem-example\000"
	.align	2
.LC3:
	.ascii	"shm_open\000"
	.align	2
.LC4:
	.ascii	"mmap\000"
	.align	2
.LC5:
	.ascii	"/sem-buffer-count\000"
	.align	2
.LC6:
	.ascii	"/sem-spool-signal\000"
	.align	2
.LC7:
	.ascii	"Please type a message: \000"
	.align	2
.LC8:
	.ascii	"sem_wait: buffer_count_sem\000"
	.align	2
.LC9:
	.ascii	"sem_wait: mutex_sem\000"
	.align	2
.LC10:
	.ascii	"%d: %s %s\012\000"
	.align	2
.LC11:
	.ascii	"sem_post: mutex_sem\000"
	.align	2
.LC12:
	.ascii	"sem_post: (spool_signal_sem\000"
	.align	2
.LC13:
	.ascii	"munmap\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 = 304
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #316
	str	r0, [fp, #-312]
	str	r1, [fp, #-316]
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	mov	r2, #0
	mov	r1, #0
	ldr	r0, .L18+4
	bl	sem_open
	str	r0, [fp, #-304]
	ldr	r3, [fp, #-304]
	cmp	r3, #0
	bne	.L2
	ldr	r0, .L18+8
	bl	error
.L2:
	mov	r2, #0
	mov	r1, #2
	ldr	r0, .L18+12
	bl	shm_open
	str	r0, [fp, #-300]
	ldr	r3, [fp, #-300]
	cmn	r3, #1
	bne	.L3
	ldr	r0, .L18+16
	bl	error
.L3:
	mov	r3, #0
	str	r3, [sp, #4]
	ldr	r3, [fp, #-300]
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #3
	ldr	r1, .L18+20
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-296]
	ldr	r3, [fp, #-296]
	cmn	r3, #1
	bne	.L4
	ldr	r0, .L18+24
	bl	error
.L4:
	mov	r3, #0
	mov	r2, #0
	mov	r1, #0
	ldr	r0, .L18+28
	bl	sem_open
	str	r0, [fp, #-292]
	ldr	r3, [fp, #-292]
	cmp	r3, #0
	bne	.L5
	ldr	r0, .L18+8
	bl	error
.L5:
	mov	r3, #0
	mov	r2, #0
	mov	r1, #0
	ldr	r0, .L18+32
	bl	sem_open
	str	r0, [fp, #-288]
	ldr	r3, [fp, #-288]
	cmp	r3, #0
	bne	.L6
	ldr	r0, .L18+8
	bl	error
.L6:
	ldr	r0, .L18+36
	bl	printf
	b	.L7
.L15:
	sub	r3, fp, #272
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-284]
	ldr	r3, [fp, #-284]
	sub	r3, r3, #1
	sub	r2, fp, #12
	add	r3, r2, r3
	ldrb	r3, [r3, #-260]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L8
	ldr	r3, [fp, #-284]
	sub	r3, r3, #1
	sub	r2, fp, #12
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3, #-260]
.L8:
	ldr	r0, [fp, #-292]
	bl	sem_wait
	mov	r3, r0
	cmn	r3, #1
	bne	.L9
	ldr	r0, .L18+40
	bl	error
.L9:
	ldr	r0, [fp, #-304]
	bl	sem_wait
	mov	r3, r0
	cmn	r3, #1
	bne	.L10
	ldr	r0, .L18+44
	bl	error
.L10:
	mov	r0, #0
	bl	time
	mov	r3, r0
	str	r3, [fp, #-308]
	sub	r3, fp, #308
	mov	r0, r3
	bl	ctime
	str	r0, [fp, #-280]
	ldr	r0, [fp, #-280]
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-276]
	ldr	r3, [fp, #-276]
	sub	r3, r3, #1
	ldr	r2, [fp, #-280]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L11
	ldr	r3, [fp, #-276]
	sub	r3, r3, #1
	ldr	r2, [fp, #-280]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
.L11:
	ldr	r3, [fp, #-296]
	ldr	r3, [r3, #2560]
	lsl	r3, r3, #8
	ldr	r2, [fp, #-296]
	add	r4, r2, r3
	bl	getpid
	mov	r2, r0
	sub	r3, fp, #272
	str	r3, [sp]
	ldr	r3, [fp, #-280]
	ldr	r1, .L18+48
	mov	r0, r4
	bl	sprintf
	ldr	r3, [fp, #-296]
	ldr	r3, [r3, #2560]
	add	r2, r3, #1
	ldr	r3, [fp, #-296]
	str	r2, [r3, #2560]
	ldr	r3, [fp, #-296]
	ldr	r3, [r3, #2560]
	cmp	r3, #10
	bne	.L12
	ldr	r3, [fp, #-296]
	mov	r2, #0
	str	r2, [r3, #2560]
.L12:
	ldr	r0, [fp, #-304]
	bl	sem_post
	mov	r3, r0
	cmn	r3, #1
	bne	.L13
	ldr	r0, .L18+52
	bl	error
.L13:
	ldr	r0, [fp, #-288]
	bl	sem_post
	mov	r3, r0
	cmn	r3, #1
	bne	.L14
	ldr	r0, .L18+56
	bl	error
.L14:
	ldr	r0, .L18+36
	bl	printf
.L7:
	ldr	r3, .L18+60
	ldr	r2, [r3]
	sub	r3, fp, #272
	mov	r1, #198
	mov	r0, r3
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	bne	.L15
	ldr	r1, .L18+20
	ldr	r0, [fp, #-296]
	bl	munmap
	mov	r3, r0
	cmn	r3, #1
	bne	.L16
	ldr	r0, .L18+64
	bl	error
.L16:
	mov	r0, #0
	bl	exit
.L19:
	.align	2
.L18:
	.word	.LC14
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	2568
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	stdin
	.word	.LC13
	.size	main, .-main
	.align	2
	.global	error
	.syntax unified
	.arm
	.fpu softvfp
	.type	error, %function
error:
	@ 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	r0, [fp, #-8]
	bl	perror
	mov	r0, #1
	bl	exit
	.size	error, .-error
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
