	.file	"14200479.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"semctl(SETVAL)"
	.text
	.globl	init_sem
	.type	init_sem, @function
init_sem:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	DWORD PTR -24[rbp], esi
	mov	eax, DWORD PTR -24[rbp]
	mov	DWORD PTR -8[rbp], eax
	mov	rdx, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	rcx, rdx
	mov	edx, 16
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], -1
	jne	.L2
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L4
.L2:
	mov	eax, 0
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	init_sem, .-init_sem
	.section	.rodata
.LC1:
	.string	"semctl(IPC_RMID)"
	.text
	.globl	del_sem
	.type	del_sem, @function
del_sem:
.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	rdx, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	rcx, rdx
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], -1
	jne	.L6
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L8
.L6:
	mov	eax, 0
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	del_sem, .-del_sem
	.section	.rodata
.LC2:
	.string	"semop"
	.text
	.globl	sem_p
	.type	sem_p, @function
sem_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, 48
	mov	DWORD PTR -36[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	WORD PTR -14[rbp], 0
	mov	WORD PTR -12[rbp], -1
	mov	WORD PTR -10[rbp], 4096
	lea	rcx, -14[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	semop@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], -1
	jne	.L10
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L12
.L10:
	mov	eax, 0
.L12:
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	sem_p, .-sem_p
	.globl	sem_v
	.type	sem_v, @function
sem_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, 48
	mov	DWORD PTR -36[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	WORD PTR -14[rbp], 0
	mov	WORD PTR -12[rbp], 1
	mov	WORD PTR -10[rbp], 4096
	lea	rcx, -14[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	semop@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], -1
	jne	.L15
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L17
.L15:
	mov	eax, 0
.L17:
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	sem_v, .-sem_v
	.globl	ignore_signals
	.type	ignore_signals, @function
ignore_signals:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	esi, 1
	mov	edi, 2
	call	signal@PLT
	mov	esi, 1
	mov	edi, 3
	call	signal@PLT
	mov	esi, 1
	mov	edi, 19
	call	signal@PLT
	mov	eax, 0
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	ignore_signals, .-ignore_signals
	.section	.rodata
.LC3:
	.string	"Usage:%s w/W/r/R\r\n"
	.text
	.globl	Usage
	.type	Usage, @function
Usage:
.LFB11:
	.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	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	Usage, .-Usage
	.section	.rodata
.LC4:
	.string	"w"
.LC5:
	.string	"."
.LC6:
	.string	"semget"
.LC7:
	.string	"shmget"
.LC8:
	.string	"shmat error\r\n"
.LC9:
	.string	"Memory attached at %p\r\n"
	.align 8
.LC10:
	.string	"Produce some text('quit' to leave):\r"
.LC11:
	.string	"fgets"
.LC12:
	.string	"quit"
.LC13:
	.string	"shmdt"
.LC14:
	.string	"r"
.LC15:
	.string	"shmat"
	.align 8
.LC16:
	.string	"Shared memory was written by process %d:%s\r\n"
.LC17:
	.string	"shmctl(IPC_RMID)"
	.text
	.globl	main
	.type	main, @function
main:
.LFB12:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	QWORD PTR -16[rbp], 0
	cmp	DWORD PTR -36[rbp], 1
	jg	.L23
	mov	rax, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	Usage
	mov	edi, 1
	call	exit@PLT
.L23:
	mov	eax, 0
	call	ignore_signals
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	edx, 1
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	strncasecmp@PLT
	test	eax, eax
	jne	.L24
	mov	esi, 97
	lea	rdi, .LC5[rip]
	call	ftok@PLT
	mov	edx, 950
	mov	esi, 1
	mov	edi, eax
	call	semget@PLT
	mov	DWORD PTR -24[rbp], eax
	cmp	DWORD PTR -24[rbp], 0
	jns	.L25
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L25:
	mov	eax, DWORD PTR -24[rbp]
	mov	esi, 1
	mov	edi, eax
	call	init_sem
	mov	esi, 98
	lea	rdi, .LC5[rip]
	call	ftok@PLT
	mov	edx, 950
	mov	esi, 516
	mov	edi, eax
	call	shmget@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	jns	.L26
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	call	del_sem
	mov	edi, 1
	call	exit@PLT
.L26:
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmat@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], -1
	jne	.L27
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	call	del_sem
	mov	edi, 1
	call	exit@PLT
.L27:
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR -8[rbp], rax
.L29:
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	call	sem_p
	lea	rdi, .LC10[rip]
	call	puts@PLT
	mov	rax, QWORD PTR stdin[rip]
	mov	rdx, QWORD PTR -8[rbp]
	lea	rcx, 4[rdx]
	mov	rdx, rax
	mov	esi, 512
	mov	rdi, rcx
	call	fgets@PLT
	test	rax, rax
	jne	.L28
	lea	rdi, .LC11[rip]
	call	perror@PLT
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	call	sem_v
	mov	edi, 1
	call	exit@PLT
.L28:
	call	getpid@PLT
	mov	rdx, QWORD PTR -8[rbp]
	mov	DWORD PTR [rdx], eax
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	call	sem_v
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 4
	mov	edx, 4
	lea	rsi, .LC12[rip]
	mov	rdi, rax
	call	strncmp@PLT
	test	eax, eax
	jne	.L29
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	call	del_sem
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	shmdt@PLT
	test	eax, eax
	jns	.L30
	lea	rdi, .LC13[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L30:
	mov	edi, 0
	call	exit@PLT
.L24:
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	edx, 1
	lea	rsi, .LC14[rip]
	mov	rdi, rax
	call	strncasecmp@PLT
	test	eax, eax
	jne	.L31
	mov	esi, 97
	lea	rdi, .LC5[rip]
	call	ftok@PLT
	mov	edx, 438
	mov	esi, 1
	mov	edi, eax
	call	semget@PLT
	mov	DWORD PTR -24[rbp], eax
	cmp	DWORD PTR -24[rbp], 0
	jns	.L32
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L32:
	mov	esi, 98
	lea	rdi, .LC5[rip]
	call	ftok@PLT
	mov	edx, 438
	mov	esi, 516
	mov	edi, eax
	call	shmget@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	jns	.L33
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L33:
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmat@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], -1
	jne	.L34
	lea	rdi, .LC15[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L34:
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR -8[rbp], rax
.L37:
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	call	sem_p
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 4[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 4
	mov	edx, 4
	lea	rsi, .LC12[rip]
	mov	rdi, rax
	call	strncmp@PLT
	test	eax, eax
	je	.L41
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 4
	mov	edx, 512
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	call	sem_v
	jmp	.L37
.L41:
	nop
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	shmdt@PLT
	test	eax, eax
	jns	.L38
	lea	rdi, .LC13[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L38:
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmctl@PLT
	test	eax, eax
	jns	.L39
	lea	rdi, .LC17[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L39:
	mov	edi, 0
	call	exit@PLT
.L31:
	mov	rax, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	Usage
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE12:
	.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	"14200479.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"semctl(SETVAL)\000"
	.text
	.align	2
	.global	init_sem
	.syntax unified
	.arm
	.fpu softvfp
	.type	init_sem, %function
init_sem:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-20]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	mov	r2, #16
	mov	r1, #0
	ldr	r0, [fp, #-16]
	bl	semctl
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L2
	ldr	r0, .L5
	bl	perror
	mvn	r3, #0
	b	.L4
.L2:
	mov	r3, #0
.L4:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	.LC0
	.size	init_sem, .-init_sem
	.section	.rodata
	.align	2
.LC1:
	.ascii	"semctl(IPC_RMID)\000"
	.text
	.align	2
	.global	del_sem
	.syntax unified
	.arm
	.fpu softvfp
	.type	del_sem, %function
del_sem:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-12]
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-16]
	bl	semctl
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L8
	ldr	r0, .L11
	bl	perror
	mvn	r3, #0
	b	.L10
.L8:
	mov	r3, #0
.L10:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC1
	.size	del_sem, .-del_sem
	.section	.rodata
	.align	2
.LC2:
	.ascii	"semop\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	sem_p
	.syntax unified
	.arm
	.fpu softvfp
	.type	sem_p, %function
sem_p:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	strh	r3, [fp, #-16]	@ movhi
	mvn	r3, #0
	strh	r3, [fp, #-14]	@ movhi
	mov	r3, #4096
	strh	r3, [fp, #-12]	@ movhi
	sub	r3, fp, #16
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	semop
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmn	r3, #1
	bne	.L14
	ldr	r0, .L18+4
	bl	perror
	mvn	r3, #0
	b	.L16
.L14:
	mov	r3, #0
.L16:
	ldr	r2, .L18
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L17
	bl	__stack_chk_fail
.L17:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC3
	.word	.LC2
	.size	sem_p, .-sem_p
	.section	.rodata
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	sem_v
	.syntax unified
	.arm
	.fpu softvfp
	.type	sem_v, %function
sem_v:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	ldr	r3, .L25
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	strh	r3, [fp, #-16]	@ movhi
	mov	r3, #1
	strh	r3, [fp, #-14]	@ movhi
	mov	r3, #4096
	strh	r3, [fp, #-12]	@ movhi
	sub	r3, fp, #16
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	semop
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmn	r3, #1
	bne	.L21
	ldr	r0, .L25+4
	bl	perror
	mvn	r3, #0
	b	.L23
.L21:
	mov	r3, #0
.L23:
	ldr	r2, .L25
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L24
	bl	__stack_chk_fail
.L24:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L26:
	.align	2
.L25:
	.word	.LC4
	.word	.LC2
	.size	sem_v, .-sem_v
	.align	2
	.global	ignore_signals
	.syntax unified
	.arm
	.fpu softvfp
	.type	ignore_signals, %function
ignore_signals:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	mov	r1, #1
	mov	r0, #2
	bl	signal
	mov	r1, #1
	mov	r0, #3
	bl	signal
	mov	r1, #1
	mov	r0, #19
	bl	signal
	mov	r3, #0
	mov	r0, r3
	pop	{fp, pc}
	.size	ignore_signals, .-ignore_signals
	.section	.rodata
	.align	2
.LC5:
	.ascii	"Usage:%s w/W/r/R\015\012\000"
	.text
	.align	2
	.global	Usage
	.syntax unified
	.arm
	.fpu softvfp
	.type	Usage, %function
Usage:
	@ 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	r1, [fp, #-8]
	ldr	r0, .L30
	bl	printf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L31:
	.align	2
.L30:
	.word	.LC5
	.size	Usage, .-Usage
	.section	.rodata
	.align	2
.LC6:
	.ascii	"w\000"
	.align	2
.LC7:
	.ascii	".\000"
	.align	2
.LC8:
	.ascii	"semget\000"
	.align	2
.LC9:
	.ascii	"shmget\000"
	.align	2
.LC10:
	.ascii	"shmat error\015\012\000"
	.align	2
.LC11:
	.ascii	"Memory attached at %p\015\012\000"
	.align	2
.LC12:
	.ascii	"Produce some text('quit' to leave):\015\000"
	.align	2
.LC13:
	.ascii	"fgets\000"
	.align	2
.LC14:
	.ascii	"quit\000"
	.align	2
.LC15:
	.ascii	"shmdt\000"
	.align	2
.LC16:
	.ascii	"r\000"
	.align	2
.LC17:
	.ascii	"shmat\000"
	.align	2
.LC18:
	.ascii	"Shared memory was written by process %d:%s\015\012\000"
	.align	2
.LC19:
	.ascii	"shmctl(IPC_RMID)\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-24]
	cmp	r3, #1
	bgt	.L33
	ldr	r3, [fp, #-28]
	ldr	r3, [r3]
	mov	r0, r3
	bl	Usage
	mov	r0, #1
	bl	exit
.L33:
	bl	ignore_signals
	ldr	r3, [fp, #-28]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, #1
	ldr	r1, .L52
	mov	r0, r3
	bl	strncasecmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L34
	mov	r1, #97
	ldr	r0, .L52+4
	bl	ftok
	mov	r3, r0
	ldr	r2, .L52+8
	mov	r1, #1
	mov	r0, r3
	bl	semget
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bge	.L35
	ldr	r0, .L52+12
	bl	perror
	mov	r0, #1
	bl	exit
.L35:
	mov	r1, #1
	ldr	r0, [fp, #-16]
	bl	init_sem
	mov	r1, #98
	ldr	r0, .L52+4
	bl	ftok
	mov	r3, r0
	ldr	r2, .L52+8
	mov	r1, #516
	mov	r0, r3
	bl	shmget
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bge	.L36
	ldr	r0, .L52+16
	bl	perror
	ldr	r0, [fp, #-16]
	bl	del_sem
	mov	r0, #1
	bl	exit
.L36:
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-12]
	bl	shmat
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmn	r3, #1
	bne	.L37
	ldr	r0, .L52+20
	bl	perror
	ldr	r0, [fp, #-16]
	bl	del_sem
	mov	r0, #1
	bl	exit
.L37:
	ldr	r1, [fp, #-20]
	ldr	r0, .L52+24
	bl	printf
	ldr	r3, [fp, #-20]
	str	r3, [fp, #-8]
.L39:
	ldr	r0, [fp, #-16]
	bl	sem_p
	ldr	r0, .L52+28
	bl	puts
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	ldr	r2, .L52+32
	ldr	r2, [r2]
	mov	r1, #512
	mov	r0, r3
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	bne	.L38
	ldr	r0, .L52+36
	bl	perror
	ldr	r0, [fp, #-16]
	bl	sem_v
	mov	r0, #1
	bl	exit
.L38:
	bl	getpid
	mov	r2, r0
	ldr	r3, [fp, #-8]
	str	r2, [r3]
	ldr	r0, [fp, #-16]
	bl	sem_v
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	mov	r2, #4
	ldr	r1, .L52+40
	mov	r0, r3
	bl	strncmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L39
	ldr	r0, [fp, #-16]
	bl	del_sem
	ldr	r0, [fp, #-20]
	bl	shmdt
	mov	r3, r0
	cmp	r3, #0
	bge	.L40
	ldr	r0, .L52+44
	bl	perror
	mov	r0, #1
	bl	exit
.L40:
	mov	r0, #0
	bl	exit
.L34:
	ldr	r3, [fp, #-28]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, #1
	ldr	r1, .L52+48
	mov	r0, r3
	bl	strncasecmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L41
	mov	r1, #97
	ldr	r0, .L52+4
	bl	ftok
	mov	r3, r0
	ldr	r2, .L52+52
	mov	r1, #1
	mov	r0, r3
	bl	semget
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bge	.L42
	ldr	r0, .L52+12
	bl	perror
	mov	r0, #1
	bl	exit
.L42:
	mov	r1, #98
	ldr	r0, .L52+4
	bl	ftok
	mov	r3, r0
	ldr	r2, .L52+52
	mov	r1, #516
	mov	r0, r3
	bl	shmget
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bge	.L43
	ldr	r0, .L52+16
	bl	perror
	mov	r0, #1
	bl	exit
.L43:
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-12]
	bl	shmat
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmn	r3, #1
	bne	.L44
	ldr	r0, .L52+56
	bl	perror
	mov	r0, #1
	bl	exit
.L44:
	ldr	r1, [fp, #-20]
	ldr	r0, .L52+24
	bl	printf
	ldr	r3, [fp, #-20]
	str	r3, [fp, #-8]
.L47:
	ldr	r0, [fp, #-16]
	bl	sem_p
	ldr	r3, [fp, #-8]
	ldr	r1, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	mov	r2, r3
	ldr	r0, .L52+60
	bl	printf
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	mov	r2, #4
	ldr	r1, .L52+40
	mov	r0, r3
	bl	strncmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L51
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	mov	r2, #512
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r0, [fp, #-16]
	bl	sem_v
	b	.L47
.L51:
	nop
	ldr	r0, [fp, #-20]
	bl	shmdt
	mov	r3, r0
	cmp	r3, #0
	bge	.L48
	ldr	r0, .L52+44
	bl	perror
	mov	r0, #1
	bl	exit
.L48:
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-12]
	bl	shmctl
	mov	r3, r0
	cmp	r3, #0
	bge	.L49
	ldr	r0, .L52+64
	bl	perror
	mov	r0, #1
	bl	exit
.L49:
	mov	r0, #0
	bl	exit
.L41:
	ldr	r3, [fp, #-28]
	ldr	r3, [r3]
	mov	r0, r3
	bl	Usage
	mov	r0, #1
	bl	exit
.L53:
	.align	2
.L52:
	.word	.LC6
	.word	.LC7
	.word	950
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	stdin
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	438
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
