	.file	"240134.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"w+"
.LC1:
	.string	"Usage: %s file\n"
.LC2:
	.string	"record: '%d'\n"
.LC3:
	.string	"Err.(%d) open() - %s\n"
.LC4:
	.string	"Err.(%d) mmap() - %s\n"
.LC5:
	.string	"Reading from file mapped:\n"
.LC6:
	.string	"Err.(%d) munmap() - %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, 136
	.cfi_offset 3, -24
	mov	DWORD PTR -132[rbp], edi
	mov	QWORD PTR -144[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -144[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -112[rbp], rax
	cmp	QWORD PTR -112[rbp], 0
	jne	.L2
	mov	rax, QWORD PTR -144[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	DWORD PTR -124[rbp], 0
	jmp	.L3
.L4:
	mov	eax, DWORD PTR -124[rbp]
	mov	DWORD PTR -96[rbp], eax
	mov	eax, DWORD PTR -124[rbp]
	lea	rdx, -96[rbp]
	lea	rcx, 4[rdx]
	mov	edx, eax
	lea	rsi, .LC2[rip]
	mov	rdi, rcx
	mov	eax, 0
	call	sprintf@PLT
	lea	rax, -96[rbp]
	add	rax, 4
	mov	rdi, rax
	call	strlen@PLT
	mov	rsi, rax
	mov	rax, QWORD PTR -112[rbp]
	lea	rdx, -96[rbp]
	lea	rdi, 4[rdx]
	mov	rcx, rax
	mov	edx, 1
	call	fwrite@PLT
	add	DWORD PTR -124[rbp], 1
.L3:
	cmp	DWORD PTR -124[rbp], 9
	jle	.L4
	mov	rax, QWORD PTR -112[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -144[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	esi, 2
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -120[rbp], eax
	cmp	DWORD PTR -120[rbp], -1
	jne	.L5
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rbx, rax
	call	__errno_location@PLT
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rbx
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	eax, DWORD PTR -120[rbp]
	mov	r9d, 0
	mov	r8d, eax
	mov	ecx, 1
	mov	edx, 3
	mov	esi, 680
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -104[rbp], rax
	cmp	QWORD PTR -104[rbp], -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	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rbx
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	mov	rax, QWORD PTR stdout[rip]
	mov	rcx, rax
	mov	edx, 26
	mov	esi, 1
	lea	rdi, .LC5[rip]
	call	fwrite@PLT
	jmp	.L7
.L8:
	mov	eax, DWORD PTR -116[rbp]
	movsx	rdx, eax
	lea	rax, -125[rbp]
	mov	rsi, rax
	mov	edi, 1
	call	write@PLT
.L7:
	lea	rcx, -125[rbp]
	mov	eax, DWORD PTR -120[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -116[rbp], eax
	cmp	DWORD PTR -116[rbp], 0
	jg	.L8
	mov	rax, QWORD PTR -104[rbp]
	mov	esi, 680
	mov	rdi, rax
	call	munmap@PLT
	cmp	eax, -1
	jne	.L9
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rbx, rax
	call	__errno_location@PLT
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rbx
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L9:
	mov	eax, DWORD PTR -120[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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	"240134.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"w+\000"
	.align	2
.LC1:
	.ascii	"Usage: %s file\012\000"
	.align	2
.LC2:
	.ascii	"record: '%d'\012\000"
	.align	2
.LC3:
	.ascii	"Err.(%d) open() - %s\012\000"
	.align	2
.LC4:
	.ascii	"Err.(%d) mmap() - %s\012\000"
	.align	2
.LC5:
	.ascii	"Reading from file mapped:\012\000"
	.align	2
.LC6:
	.ascii	"Err.(%d) munmap() - %s\012\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 104
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #112
	str	r0, [fp, #-112]
	str	r1, [fp, #-116]
	ldr	r3, .L12
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, [fp, #-116]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L12+4
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-100]
	ldr	r3, [fp, #-100]
	cmp	r3, #0
	bne	.L2
	ldr	r3, .L12+8
	ldr	r0, [r3]
	ldr	r3, [fp, #-116]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L12+12
	bl	fprintf
	mov	r0, #1
	bl	exit
.L2:
	mov	r3, #0
	str	r3, [fp, #-104]
	b	.L3
.L4:
	ldr	r3, [fp, #-104]
	str	r3, [fp, #-84]
	sub	r3, fp, #84
	add	r3, r3, #4
	ldr	r2, [fp, #-104]
	ldr	r1, .L12+16
	mov	r0, r3
	bl	sprintf
	sub	r3, fp, #84
	add	r3, r3, #4
	mov	r0, r3
	bl	strlen
	mov	r1, r0
	sub	r3, fp, #84
	add	r0, r3, #4
	ldr	r3, [fp, #-100]
	mov	r2, #1
	bl	fwrite
	ldr	r3, [fp, #-104]
	add	r3, r3, #1
	str	r3, [fp, #-104]
.L3:
	ldr	r3, [fp, #-104]
	cmp	r3, #9
	ble	.L4
	ldr	r0, [fp, #-100]
	bl	fclose
	ldr	r3, [fp, #-116]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, #2
	mov	r0, r3
	bl	open
	str	r0, [fp, #-96]
	ldr	r3, [fp, #-96]
	cmn	r3, #1
	bne	.L5
	ldr	r3, .L12+8
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r5, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r5
	ldr	r1, .L12+20
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L5:
	mov	r3, #0
	str	r3, [sp, #4]
	ldr	r3, [fp, #-96]
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #3
	mov	r1, #680
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-92]
	ldr	r3, [fp, #-92]
	cmn	r3, #1
	bne	.L6
	ldr	r3, .L12+8
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r5, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r5
	ldr	r1, .L12+24
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L6:
	ldr	r3, .L12+28
	ldr	r3, [r3]
	mov	r2, #26
	mov	r1, #1
	ldr	r0, .L12+32
	bl	fwrite
	b	.L7
.L8:
	ldr	r2, [fp, #-88]
	sub	r3, fp, #105
	mov	r1, r3
	mov	r0, #1
	bl	write
.L7:
	sub	r3, fp, #105
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-96]
	bl	read
	str	r0, [fp, #-88]
	ldr	r3, [fp, #-88]
	cmp	r3, #0
	bgt	.L8
	mov	r1, #680
	ldr	r0, [fp, #-92]
	bl	munmap
	mov	r3, r0
	cmn	r3, #1
	bne	.L9
	ldr	r3, .L12+8
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r5, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r5
	ldr	r1, .L12+36
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L9:
	ldr	r0, [fp, #-96]
	bl	close
	mov	r3, #0
	ldr	r2, .L12
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L11
	bl	__stack_chk_fail
.L11:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L13:
	.align	2
.L12:
	.word	.LC7
	.word	.LC0
	.word	stderr
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	stdout
	.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
