	.file	"850622.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"mmapfile.dat"
.LC1:
	.string	"Fail: open(): (%d:%s)\n"
.LC2:
	.string	"Fail: ftruncate(): (%d:%s)\n"
.LC3:
	.string	"Fail: mmap(): (%d:%s)\n"
.LC4:
	.string	"* mmap file : %s\n"
	.align 8
.LC5:
	.string	"'*' print current mmap, '-' invalidate mmap otherwise input text to mmap. >>"
.LC6:
	.string	"Fail: msync(): (%d:%s)\n"
.LC7:
	.string	"Current mmap -> '%.*s'\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
	push	rbx
	sub	rsp, 72
	.cfi_offset 3, -24
	mov	DWORD PTR -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -60[rbp], 2
	mov	DWORD PTR -56[rbp], 0
	mov	QWORD PTR -48[rbp], 128
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -40[rbp], rax
	cmp	DWORD PTR -68[rbp], 2
	jne	.L2
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 115
	jne	.L3
	mov	DWORD PTR -60[rbp], 1
	jmp	.L2
.L3:
	mov	DWORD PTR -60[rbp], 2
.L2:
	mov	edx, 436
	mov	esi, 66
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], -1
	jne	.L4
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rbx, rax
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	rdx, rbx
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L14
.L4:
	mov	eax, DWORD PTR -52[rbp]
	mov	esi, 40960
	mov	edi, eax
	call	ftruncate@PLT
	cmp	eax, -1
	jne	.L6
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rbx, rax
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	rdx, rbx
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L14
.L6:
	mov	edx, DWORD PTR -52[rbp]
	mov	eax, DWORD PTR -60[rbp]
	mov	r9d, 0
	mov	r8d, edx
	mov	ecx, eax
	mov	edx, 3
	mov	esi, 40960
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -32[rbp], rax
	cmp	QWORD PTR -32[rbp], -1
	jne	.L7
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rbx, rax
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	rdx, rbx
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L14
.L7:
	mov	eax, DWORD PTR -52[rbp]
	mov	edi, eax
	call	close@PLT
	lea	rsi, .LC0[rip]
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
.L13:
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rdx, QWORD PTR stdin[rip]
	lea	rcx, -48[rbp]
	lea	rax, -40[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	getline@PLT
	mov	DWORD PTR -56[rbp], eax
	cmp	DWORD PTR -56[rbp], -1
	jne	.L8
	mov	eax, -1
	jmp	.L14
.L8:
	mov	rax, QWORD PTR -40[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 42
	jne	.L9
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, 4
	mov	esi, 40960
	mov	rdi, rax
	call	msync@PLT
	cmp	eax, -1
	jne	.L10
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rbx, rax
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	rdx, rbx
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L14
.L10:
	mov	rax, QWORD PTR -32[rbp]
	mov	rdx, rax
	mov	esi, 40960
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L13
.L9:
	mov	rax, QWORD PTR -40[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 45
	jne	.L12
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, 2
	mov	esi, 40960
	mov	rdi, rax
	call	msync@PLT
	cmp	eax, -1
	jne	.L13
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rbx, rax
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	rdx, rbx
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L14
.L12:
	mov	rdx, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR -56[rbp]
	cdqe
	sub	rax, 1
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	mov	eax, DWORD PTR -56[rbp]
	sub	eax, 1
	movsx	rdx, eax
	mov	rcx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	memcpy@PLT
	jmp	.L13
.L14:
	mov	rcx, QWORD PTR -24[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.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	"850622.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"mmapfile.dat\000"
	.align	2
.LC1:
	.ascii	"Fail: open(): (%d:%s)\012\000"
	.align	2
.LC2:
	.ascii	"Fail: ftruncate(): (%d:%s)\012\000"
	.align	2
.LC3:
	.ascii	"Fail: mmap(): (%d:%s)\012\000"
	.align	2
.LC4:
	.ascii	"* mmap file : %s\012\000"
	.align	2
.LC5:
	.ascii	"'*' print current mmap, '-' invalidate mmap otherwi"
	.ascii	"se input text to mmap. >>\000"
	.align	2
.LC6:
	.ascii	"Fail: msync(): (%d:%s)\012\000"
	.align	2
.LC7:
	.ascii	"Current mmap -> '%.*s'\012\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #52
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	ldr	r3, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #2
	str	r3, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-28]
	mov	r3, #128
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-40]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-48]
	cmp	r3, #2
	bne	.L2
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #115
	bne	.L3
	mov	r3, #1
	str	r3, [fp, #-32]
	b	.L2
.L3:
	mov	r3, #2
	str	r3, [fp, #-32]
.L2:
	mov	r2, #436
	mov	r1, #66
	ldr	r0, .L16+4
	bl	open
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmn	r3, #1
	bne	.L4
	bl	__errno_location
	mov	r3, r0
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L16+8
	bl	printf
	mov	r3, #1
	b	.L14
.L4:
	mov	r1, #40960
	ldr	r0, [fp, #-24]
	bl	ftruncate
	mov	r3, r0
	cmn	r3, #1
	bne	.L6
	bl	__errno_location
	mov	r3, r0
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L16+12
	bl	printf
	mov	r3, #1
	b	.L14
.L6:
	mov	r3, #0
	str	r3, [sp, #4]
	ldr	r3, [fp, #-24]
	str	r3, [sp]
	ldr	r3, [fp, #-32]
	mov	r2, #3
	mov	r1, #40960
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmn	r3, #1
	bne	.L7
	bl	__errno_location
	mov	r3, r0
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L16+16
	bl	printf
	mov	r3, #1
	b	.L14
.L7:
	ldr	r0, [fp, #-24]
	bl	close
	ldr	r1, .L16+4
	ldr	r0, .L16+20
	bl	printf
.L13:
	ldr	r0, .L16+24
	bl	printf
	ldr	r3, .L16+28
	ldr	r2, [r3]
	sub	r1, fp, #40
	sub	r3, fp, #36
	mov	r0, r3
	bl	getline
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmn	r3, #1
	bne	.L8
	mvn	r3, #0
	b	.L14
.L8:
	ldr	r3, [fp, #-36]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #42
	bne	.L9
	mov	r2, #4
	mov	r1, #40960
	ldr	r0, [fp, #-20]
	bl	msync
	mov	r3, r0
	cmn	r3, #1
	bne	.L10
	bl	__errno_location
	mov	r3, r0
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L16+32
	bl	printf
	mov	r3, #1
	b	.L14
.L10:
	ldr	r2, [fp, #-20]
	mov	r1, #40960
	ldr	r0, .L16+36
	bl	printf
	b	.L13
.L9:
	ldr	r3, [fp, #-36]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #45
	bne	.L12
	mov	r2, #2
	mov	r1, #40960
	ldr	r0, [fp, #-20]
	bl	msync
	mov	r3, r0
	cmn	r3, #1
	bne	.L13
	bl	__errno_location
	mov	r3, r0
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L16+32
	bl	printf
	mov	r3, #1
	b	.L14
.L12:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-28]
	sub	r3, r3, #1
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r1, [fp, #-36]
	ldr	r3, [fp, #-28]
	sub	r3, r3, #1
	mov	r2, r3
	ldr	r0, [fp, #-20]
	bl	memcpy
	b	.L13
.L14:
	ldr	r2, .L16
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L15
	bl	__stack_chk_fail
.L15:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC8
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	stdin
	.word	.LC6
	.word	.LC7
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
