	.file	"305252.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"ERROR CREATING THE SEMAPHORE"
	.align 8
.LC1:
	.string	"FAILED TO RESERVE SHARED MEMORY"
	.align 8
.LC2:
	.string	"ERROR DECREMENTING THE SEMAPHORE"
.LC3:
	.string	"\n"
.LC4:
	.string	"%s"
	.align 8
.LC5:
	.string	"ERROR INCREMENTING THE SEMAPHORE"
	.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, 80
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edx, 950
	mov	esi, 3
	mov	edi, 42421
	call	semget@PLT
	mov	DWORD PTR -76[rbp], eax
	cmp	DWORD PTR -76[rbp], -1
	jne	.L2
	lea	rdi, .LC0[rip]
	call	perror@PLT
.L2:
	mov	edx, 438
	mov	esi, 10
	mov	edi, 42422
	call	shmget@PLT
	mov	DWORD PTR -72[rbp], eax
	cmp	DWORD PTR -72[rbp], 0
	jns	.L3
	lea	rdi, .LC1[rip]
	call	perror@PLT
.L3:
	mov	eax, DWORD PTR -72[rbp]
	mov	edx, 384
	mov	esi, 0
	mov	edi, eax
	call	shmat@PLT
	mov	QWORD PTR -32[rbp], rax
	mov	WORD PTR -68[rbp], 0
	mov	WORD PTR -66[rbp], 1
	mov	WORD PTR -64[rbp], 0
	mov	WORD PTR -62[rbp], 0
	mov	WORD PTR -60[rbp], -1
	mov	WORD PTR -58[rbp], 0
	mov	WORD PTR -56[rbp], 1
	mov	WORD PTR -54[rbp], 1
	mov	WORD PTR -52[rbp], 0
	mov	WORD PTR -50[rbp], 1
	mov	WORD PTR -48[rbp], -1
	mov	WORD PTR -46[rbp], 0
	mov	WORD PTR -44[rbp], 2
	mov	WORD PTR -42[rbp], 1
	mov	WORD PTR -40[rbp], 0
	mov	WORD PTR -38[rbp], 2
	mov	WORD PTR -36[rbp], -1
	mov	WORD PTR -34[rbp], 0
	lea	rcx, -62[rbp]
	mov	eax, DWORD PTR -76[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	semop@PLT
	cmp	eax, -1
	jne	.L4
	lea	rdi, .LC2[rip]
	call	perror@PLT
.L4:
	mov	rdx, QWORD PTR stdin[rip]
	lea	rax, -20[rbp]
	mov	esi, 12
	mov	rdi, rax
	call	fgets@PLT
	lea	rax, -20[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	strtok@PLT
	lea	rdx, -20[rbp]
	mov	rax, QWORD PTR -32[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rcx, -44[rbp]
	mov	eax, DWORD PTR -76[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	semop@PLT
	cmp	eax, -1
	jne	.L5
	lea	rdi, .LC5[rip]
	call	perror@PLT
.L5:
	lea	rcx, -50[rbp]
	mov	eax, DWORD PTR -76[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	semop@PLT
	cmp	eax, -1
	jne	.L6
	lea	rdi, .LC5[rip]
	call	perror@PLT
.L6:
	mov	DWORD PTR -80[rbp], 0
	jmp	.L7
.L9:
	mov	edi, 10
	call	putchar@PLT
	mov	eax, DWORD PTR -80[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	mov	edi, eax
	call	putchar@PLT
	add	DWORD PTR -80[rbp], 1
.L7:
	cmp	DWORD PTR -80[rbp], 9
	jg	.L8
	mov	eax, DWORD PTR -80[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L9
.L8:
	mov	edi, 10
	call	putchar@PLT
	lea	rcx, -68[rbp]
	mov	eax, DWORD PTR -76[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	semop@PLT
	cmp	eax, -1
	jne	.L10
	lea	rdi, .LC5[rip]
	call	perror@PLT
.L10:
	mov	edi, 0
	call	exit@PLT
	.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	"305252.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"ERROR CREATING THE SEMAPHORE\000"
	.align	2
.LC1:
	.ascii	"FAILED TO RESERVE SHARED MEMORY\000"
	.align	2
.LC2:
	.ascii	"ERROR DECREMENTING THE SEMAPHORE\000"
	.align	2
.LC3:
	.ascii	"\012\000"
	.align	2
.LC4:
	.ascii	"%s\000"
	.align	2
.LC5:
	.ascii	"ERROR INCREMENTING THE SEMAPHORE\000"
	.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 = 80
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #80
	ldr	r3, .L12
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r2, .L12+4
	mov	r1, #3
	ldr	r0, .L12+8
	bl	semget
	str	r0, [fp, #-80]
	ldr	r3, [fp, #-80]
	cmn	r3, #1
	bne	.L2
	ldr	r0, .L12+12
	bl	perror
.L2:
	ldr	r2, .L12+16
	mov	r1, #10
	ldr	r0, .L12+20
	bl	shmget
	str	r0, [fp, #-76]
	ldr	r3, [fp, #-76]
	cmp	r3, #0
	bge	.L3
	ldr	r0, .L12+24
	bl	perror
.L3:
	mov	r2, #384
	mov	r1, #0
	ldr	r0, [fp, #-76]
	bl	shmat
	str	r0, [fp, #-72]
	mov	r3, #0
	strh	r3, [fp, #-68]	@ movhi
	mov	r3, #1
	strh	r3, [fp, #-66]	@ movhi
	mov	r3, #0
	strh	r3, [fp, #-64]	@ movhi
	mov	r3, #0
	strh	r3, [fp, #-60]	@ movhi
	mvn	r3, #0
	strh	r3, [fp, #-58]	@ movhi
	mov	r3, #0
	strh	r3, [fp, #-56]	@ movhi
	mov	r3, #1
	strh	r3, [fp, #-52]	@ movhi
	mov	r3, #1
	strh	r3, [fp, #-50]	@ movhi
	mov	r3, #0
	strh	r3, [fp, #-48]	@ movhi
	mov	r3, #1
	strh	r3, [fp, #-44]	@ movhi
	mvn	r3, #0
	strh	r3, [fp, #-42]	@ movhi
	mov	r3, #0
	strh	r3, [fp, #-40]	@ movhi
	mov	r3, #2
	strh	r3, [fp, #-36]	@ movhi
	mov	r3, #1
	strh	r3, [fp, #-34]	@ movhi
	mov	r3, #0
	strh	r3, [fp, #-32]	@ movhi
	mov	r3, #2
	strh	r3, [fp, #-28]	@ movhi
	mvn	r3, #0
	strh	r3, [fp, #-26]	@ movhi
	mov	r3, #0
	strh	r3, [fp, #-24]	@ movhi
	sub	r3, fp, #60
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-80]
	bl	semop
	mov	r3, r0
	cmn	r3, #1
	bne	.L4
	ldr	r0, .L12+28
	bl	perror
.L4:
	ldr	r3, .L12+32
	ldr	r2, [r3]
	sub	r3, fp, #20
	mov	r1, #12
	mov	r0, r3
	bl	fgets
	sub	r3, fp, #20
	ldr	r1, .L12+36
	mov	r0, r3
	bl	strtok
	sub	r3, fp, #20
	mov	r2, r3
	ldr	r1, .L12+40
	ldr	r0, [fp, #-72]
	bl	sprintf
	sub	r3, fp, #36
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-80]
	bl	semop
	mov	r3, r0
	cmn	r3, #1
	bne	.L5
	ldr	r0, .L12+44
	bl	perror
.L5:
	sub	r3, fp, #44
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-80]
	bl	semop
	mov	r3, r0
	cmn	r3, #1
	bne	.L6
	ldr	r0, .L12+44
	bl	perror
.L6:
	mov	r3, #0
	str	r3, [fp, #-84]
	b	.L7
.L9:
	mov	r0, #10
	bl	putchar
	ldr	r3, [fp, #-84]
	ldr	r2, [fp, #-72]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	putchar
	ldr	r3, [fp, #-84]
	add	r3, r3, #1
	str	r3, [fp, #-84]
.L7:
	ldr	r3, [fp, #-84]
	cmp	r3, #9
	bgt	.L8
	ldr	r3, [fp, #-84]
	ldr	r2, [fp, #-72]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L9
.L8:
	mov	r0, #10
	bl	putchar
	sub	r3, fp, #68
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-80]
	bl	semop
	mov	r3, r0
	cmn	r3, #1
	bne	.L10
	ldr	r0, .L12+44
	bl	perror
.L10:
	mov	r0, #0
	bl	exit
.L13:
	.align	2
.L12:
	.word	.LC6
	.word	950
	.word	42421
	.word	.LC0
	.word	438
	.word	42422
	.word	.LC1
	.word	.LC2
	.word	stdin
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
