	.file	"812885.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"shmget failed\n"
.LC1:
	.string	"shmat failed\n"
.LC2:
	.string	"Memory Attached at %x\n"
.LC3:
	.string	"You Wrote: %s"
.LC4:
	.string	"end"
.LC5:
	.string	"shmdt failed\n"
.LC6:
	.string	"failed to delete\n"
	.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, 32
	mov	DWORD PTR -24[rbp], 1
	mov	QWORD PTR -16[rbp], 0
	call	getpid@PLT
	mov	edi, eax
	call	srand@PLT
	mov	edx, 950
	mov	esi, 2052
	mov	edi, 1234
	call	shmget@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], -1
	jne	.L2
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 14
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	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	.L3
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 13
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR [rax], 0
	jmp	.L4
.L5:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	je	.L4
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 4
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	call	rand@PLT
	cdq
	shr	edx, 30
	add	eax, edx
	and	eax, 3
	sub	eax, edx
	mov	edi, eax
	call	sleep@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 4
	mov	edx, 3
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	strncmp@PLT
	test	eax, eax
	jne	.L4
	mov	DWORD PTR -24[rbp], 0
.L4:
	cmp	DWORD PTR -24[rbp], 0
	jne	.L5
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	shmdt@PLT
	cmp	eax, -1
	jne	.L6
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 13
	mov	esi, 1
	lea	rdi, .LC5[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmctl@PLT
	cmp	eax, -1
	jne	.L7
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 17
	mov	esi, 1
	lea	rdi, .LC6[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L7:
	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	"812885.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"shmget failed\012\000"
	.align	2
.LC1:
	.ascii	"shmat failed\012\000"
	.align	2
.LC2:
	.ascii	"Memory Attached at %x\012\000"
	.align	2
.LC3:
	.ascii	"You Wrote: %s\000"
	.align	2
.LC4:
	.ascii	"end\000"
	.align	2
.LC5:
	.ascii	"shmdt failed\012\000"
	.align	2
.LC6:
	.ascii	"failed to delete\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	mov	r3, #1
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-16]
	bl	getpid
	mov	r3, r0
	mov	r0, r3
	bl	srand
	ldr	r2, .L8
	ldr	r1, .L8+4
	ldr	r0, .L8+8
	bl	shmget
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	bne	.L2
	ldr	r3, .L8+12
	ldr	r3, [r3]
	mov	r2, #14
	mov	r1, #1
	ldr	r0, .L8+16
	bl	fwrite
	mov	r0, #1
	bl	exit
.L2:
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-12]
	bl	shmat
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L3
	ldr	r3, .L8+12
	ldr	r3, [r3]
	mov	r2, #13
	mov	r1, #1
	ldr	r0, .L8+20
	bl	fwrite
	mov	r0, #1
	bl	exit
.L3:
	ldr	r3, [fp, #-16]
	mov	r1, r3
	ldr	r0, .L8+24
	bl	printf
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3]
	b	.L4
.L5:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L4
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L8+28
	bl	printf
	bl	rand
	mov	r3, r0
	rsbs	r2, r3, #0
	and	r3, r3, #3
	and	r2, r2, #3
	rsbpl	r3, r2, #0
	mov	r0, r3
	bl	sleep
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	mov	r2, #3
	ldr	r1, .L8+32
	mov	r0, r3
	bl	strncmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L4
	mov	r3, #0
	str	r3, [fp, #-20]
.L4:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L5
	ldr	r0, [fp, #-16]
	bl	shmdt
	mov	r3, r0
	cmn	r3, #1
	bne	.L6
	ldr	r3, .L8+12
	ldr	r3, [r3]
	mov	r2, #13
	mov	r1, #1
	ldr	r0, .L8+36
	bl	fwrite
	mov	r0, #1
	bl	exit
.L6:
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-12]
	bl	shmctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L7
	ldr	r3, .L8+12
	ldr	r3, [r3]
	mov	r2, #17
	mov	r1, #1
	ldr	r0, .L8+40
	bl	fwrite
	mov	r0, #1
	bl	exit
.L7:
	mov	r0, #0
	bl	exit
.L9:
	.align	2
.L8:
	.word	950
	.word	2052
	.word	1234
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
