	.file	"59936.c"
	.intel_syntax noprefix
	.text
	.globl	SHM_KEY
	.section	.rodata
	.align 4
	.type	SHM_KEY, @object
	.size	SHM_KEY, 4
SHM_KEY:
	.long	4342338
	.globl	SEM_KEY
	.align 4
	.type	SEM_KEY, @object
	.size	SEM_KEY, 4
SEM_KEY:
	.long	4342338
	.globl	READY_TO_WRITE
	.align 4
	.type	READY_TO_WRITE, @object
	.size	READY_TO_WRITE, 4
READY_TO_WRITE:
	.zero	4
	.globl	READY_TO_READ
	.align 4
	.type	READY_TO_READ, @object
	.size	READY_TO_READ, 4
READY_TO_READ:
	.long	1
	.globl	P_OP
	.align 4
	.type	P_OP, @object
	.size	P_OP, 4
P_OP:
	.long	-1
	.globl	V_OP
	.align 4
	.type	V_OP, @object
	.size	V_OP, 4
V_OP:
	.long	1
	.globl	PERM
	.align 4
	.type	PERM, @object
	.size	PERM, 4
PERM:
	.long	420
	.globl	global_semid
	.bss
	.align 4
	.type	global_semid, @object
	.size	global_semid, 4
global_semid:
	.zero	4
	.section	.rodata
	.align 8
.LC0:
	.string	"Error when creating the semaphore ...\n"
	.text
	.globl	fetch_semaphore
	.type	fetch_semaphore, @function
fetch_semaphore:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, 4342338
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	semget@PLT
	mov	DWORD PTR global_semid[rip], eax
	mov	eax, DWORD PTR global_semid[rip]
	test	eax, eax
	jns	.L3
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	fetch_semaphore, .-fetch_semaphore
	.section	.rodata
.LC1:
	.string	"semop failed"
	.text
	.globl	semaphore_operation
	.type	semaphore_operation, @function
semaphore_operation:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	DWORD PTR -24[rbp], esi
	mov	DWORD PTR -28[rbp], edx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR -28[rbp]
	mov	WORD PTR -12[rbp], ax
	mov	WORD PTR -10[rbp], 0
	mov	eax, DWORD PTR -24[rbp]
	mov	WORD PTR -14[rbp], ax
	lea	rcx, -14[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	semop@PLT
	cmp	eax, -1
	jne	.L7
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L7:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	semaphore_operation, .-semaphore_operation
	.globl	P
	.type	P, @function
P:
.LFB8:
	.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	DWORD PTR -4[rbp], edi
	mov	DWORD PTR -8[rbp], esi
	mov	edx, -1
	mov	ecx, DWORD PTR -8[rbp]
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	semaphore_operation
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	P, .-P
	.globl	V
	.type	V, @function
V:
.LFB9:
	.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	DWORD PTR -4[rbp], edi
	mov	DWORD PTR -8[rbp], esi
	mov	edx, 1
	mov	ecx, DWORD PTR -8[rbp]
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	semaphore_operation
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	V, .-V
	.section	.rodata
	.align 8
.LC2:
	.string	"Error: can't get shared memory!\n"
	.align 8
.LC3:
	.string	"Error: can't attach shared memory!\n"
.LC4:
	.string	"\\quit\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 1072
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, 0
	call	fetch_semaphore
	mov	eax, 4342338
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmget@PLT
	mov	DWORD PTR -1060[rbp], eax
	cmp	DWORD PTR -1060[rbp], 0
	jns	.L11
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L11:
	mov	eax, DWORD PTR -1060[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmat@PLT
	mov	QWORD PTR -1056[rbp], rax
	cmp	QWORD PTR -1056[rbp], -1
	jne	.L12
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L12:
	mov	rax, QWORD PTR -1056[rbp]
	mov	QWORD PTR -1048[rbp], rax
.L15:
	mov	rdx, QWORD PTR stdin[rip]
	lea	rax, -1040[rbp]
	mov	esi, 1024
	mov	rdi, rax
	call	fgets@PLT
	lea	rax, -1040[rbp]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	call	strcmp@PLT
	test	eax, eax
	jne	.L13
	mov	rax, QWORD PTR -1056[rbp]
	mov	rdi, rax
	call	shmdt@PLT
	mov	QWORD PTR -1048[rbp], 0
	mov	QWORD PTR -1056[rbp], 0
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L16
	jmp	.L17
.L13:
	mov	edx, 0
	mov	eax, DWORD PTR global_semid[rip]
	mov	esi, edx
	mov	edi, eax
	call	P
	lea	rdx, -1040[rbp]
	mov	rax, QWORD PTR -1048[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	mov	edx, 1
	mov	eax, DWORD PTR global_semid[rip]
	mov	esi, edx
	mov	edi, eax
	call	V
	jmp	.L15
.L17:
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	"59936.c"
	.text
	.global	SHM_KEY
	.section	.rodata
	.align	2
	.type	SHM_KEY, %object
	.size	SHM_KEY, 4
SHM_KEY:
	.word	4342338
	.global	SEM_KEY
	.align	2
	.type	SEM_KEY, %object
	.size	SEM_KEY, 4
SEM_KEY:
	.word	4342338
	.global	READY_TO_WRITE
	.align	2
	.type	READY_TO_WRITE, %object
	.size	READY_TO_WRITE, 4
READY_TO_WRITE:
	.space	4
	.global	READY_TO_READ
	.align	2
	.type	READY_TO_READ, %object
	.size	READY_TO_READ, 4
READY_TO_READ:
	.word	1
	.global	P_OP
	.align	2
	.type	P_OP, %object
	.size	P_OP, 4
P_OP:
	.word	-1
	.global	V_OP
	.align	2
	.type	V_OP, %object
	.size	V_OP, 4
V_OP:
	.word	1
	.global	PERM
	.align	2
	.type	PERM, %object
	.size	PERM, 4
PERM:
	.word	420
	.global	global_semid
	.bss
	.align	2
	.type	global_semid, %object
	.size	global_semid, 4
global_semid:
	.space	4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Error when creating the semaphore ...\012\000"
	.text
	.align	2
	.global	fetch_semaphore
	.syntax unified
	.arm
	.fpu softvfp
	.type	fetch_semaphore, %function
fetch_semaphore:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L4
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	semget
	mov	r3, r0
	ldr	r2, .L4+4
	str	r3, [r2]
	ldr	r3, .L4+4
	ldr	r3, [r3]
	cmp	r3, #0
	bge	.L3
	ldr	r0, .L4+8
	bl	perror
	mov	r0, #1
	bl	exit
.L3:
	nop
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	4342338
	.word	global_semid
	.word	.LC0
	.size	fetch_semaphore, .-fetch_semaphore
	.section	.rodata
	.align	2
.LC1:
	.ascii	"semop failed\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	semaphore_operation
	.syntax unified
	.arm
	.fpu softvfp
	.type	semaphore_operation, %function
semaphore_operation:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	ldr	r3, .L10
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #16
	asr	r3, r3, #16
	strh	r3, [fp, #-14]	@ movhi
	mov	r3, #0
	strh	r3, [fp, #-12]	@ movhi
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	strh	r3, [fp, #-16]	@ movhi
	sub	r3, fp, #16
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	semop
	mov	r3, r0
	cmn	r3, #1
	bne	.L9
	ldr	r0, .L10+4
	bl	perror
	mov	r0, #1
	bl	exit
.L9:
	nop
	ldr	r3, .L10
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L8
	bl	__stack_chk_fail
.L8:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC2
	.word	.LC1
	.size	semaphore_operation, .-semaphore_operation
	.align	2
	.global	P
	.syntax unified
	.arm
	.fpu softvfp
	.type	P, %function
P:
	@ 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]
	str	r1, [fp, #-12]
	mvn	r3, #0
	mov	r2, r3
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-8]
	bl	semaphore_operation
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	P, .-P
	.align	2
	.global	V
	.syntax unified
	.arm
	.fpu softvfp
	.type	V, %function
V:
	@ 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]
	str	r1, [fp, #-12]
	mov	r3, #1
	mov	r2, r3
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-8]
	bl	semaphore_operation
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	V, .-V
	.section	.rodata
	.align	2
.LC3:
	.ascii	"Error: can't get shared memory!\012\000"
	.align	2
.LC4:
	.ascii	"Error: can't attach shared memory!\012\000"
	.align	2
.LC5:
	.ascii	"\\quit\012\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 = 1040
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1040
	ldr	r3, .L22
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	bl	fetch_semaphore
	ldr	r3, .L22+4
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	shmget
	str	r0, [fp, #-1044]
	ldr	r3, [fp, #-1044]
	cmp	r3, #0
	bge	.L15
	ldr	r0, .L22+8
	bl	perror
	mov	r0, #1
	bl	exit
.L15:
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-1044]
	bl	shmat
	str	r0, [fp, #-1040]
	ldr	r3, [fp, #-1040]
	cmn	r3, #1
	bne	.L16
	ldr	r0, .L22+12
	bl	perror
	mov	r0, #1
	bl	exit
.L16:
	ldr	r3, [fp, #-1040]
	str	r3, [fp, #-1036]
.L19:
	ldr	r3, .L22+16
	ldr	r2, [r3]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, #1024
	mov	r0, r3
	bl	fgets
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L22+20
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L17
	ldr	r0, [fp, #-1040]
	bl	shmdt
	mov	r3, #0
	str	r3, [fp, #-1036]
	mov	r3, #0
	str	r3, [fp, #-1040]
	mov	r3, #0
	ldr	r2, .L22
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L20
	b	.L21
.L17:
	ldr	r3, .L22+24
	ldr	r3, [r3]
	mov	r2, #0
	mov	r1, r2
	mov	r0, r3
	bl	P
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, [fp, #-1036]
	bl	strcpy
	ldr	r3, .L22+24
	ldr	r3, [r3]
	mov	r2, #1
	mov	r1, r2
	mov	r0, r3
	bl	V
	b	.L19
.L21:
	bl	__stack_chk_fail
.L20:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	.LC6
	.word	4342338
	.word	.LC3
	.word	.LC4
	.word	stdin
	.word	.LC5
	.word	global_semid
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
