	.file	"797945.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"open(%s, O_RDONLY)"
.LC1:
	.string	"initial pread"
	.align 8
.LC2:
	.string	"short initial pread (%ld/%lu bytes)"
	.align 8
.LC3:
	.string	"initial pread returned wrong data: %s"
.LC4:
	.string	"mmap"
	.align 8
.LC5:
	.string	"mapping contains wrong initial data: %s"
.LC6:
	.string	"open(%s, O_RDWR)"
.LC7:
	.string	"write"
.LC8:
	.string	"short write (%ld/%lu bytes)"
.LC9:
	.string	"truncate"
.LC10:
	.string	"final pread"
	.align 8
.LC11:
	.string	"short final pread (%ld/%lu bytes)"
	.align 8
.LC12:
	.string	"final pread returned wrong data: %s"
	.align 8
.LC13:
	.string	"mapping contains wrong final data: %s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	add	rsp, -128
	mov	DWORD PTR -116[rbp], edi
	mov	QWORD PTR -128[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	movabs	rax, 6877125683914501987
	movabs	rdx, 7308332184076772724
	mov	QWORD PTR -32[rbp], rax
	mov	QWORD PTR -24[rbp], rdx
	mov	DWORD PTR -16[rbp], 1954051118
	mov	BYTE PTR -12[rbp], 0
	movabs	rax, 7022344801645522031
	mov	QWORD PTR -72[rbp], rax
	mov	WORD PTR -64[rbp], 10
	movabs	rax, 7022344801646765422
	mov	QWORD PTR -62[rbp], rax
	mov	WORD PTR -54[rbp], 10
	mov	edi, 30
	call	sysconf@PLT
	mov	QWORD PTR -96[rbp], rax
	lea	rax, -32[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -104[rbp], eax
	cmp	DWORD PTR -104[rbp], 0
	jns	.L2
	lea	rax, -32[rbp]
	mov	rdx, rax
	lea	rsi, .LC0[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L2:
	mov	QWORD PTR -52[rbp], 0
	mov	WORD PTR -44[rbp], 0
	lea	rsi, -52[rbp]
	mov	eax, DWORD PTR -104[rbp]
	mov	ecx, 0
	mov	edx, 10
	mov	edi, eax
	call	pread@PLT
	mov	QWORD PTR -88[rbp], rax
	cmp	QWORD PTR -88[rbp], 0
	jns	.L3
	lea	rsi, .LC1[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L3:
	lea	rax, -72[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, QWORD PTR -88[rbp]
	cmp	rax, rdx
	je	.L4
	lea	rax, -72[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -88[rbp]
	mov	rcx, rdx
	mov	rdx, rax
	lea	rsi, .LC2[rip]
	mov	edi, 1
	mov	eax, 0
	call	errx@PLT
.L4:
	lea	rdx, -72[rbp]
	lea	rax, -52[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	je	.L5
	lea	rax, -52[rbp]
	mov	rdx, rax
	lea	rsi, .LC3[rip]
	mov	edi, 1
	mov	eax, 0
	call	errx@PLT
.L5:
	mov	edx, DWORD PTR -104[rbp]
	mov	rax, QWORD PTR -96[rbp]
	mov	r9d, 0
	mov	r8d, edx
	mov	ecx, 1
	mov	edx, 1
	mov	rsi, rax
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -80[rbp], rax
	cmp	QWORD PTR -80[rbp], -1
	jne	.L6
	lea	rsi, .LC4[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L6:
	lea	rdx, -72[rbp]
	mov	rax, QWORD PTR -80[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	je	.L7
	mov	rax, QWORD PTR -80[rbp]
	mov	rdx, rax
	lea	rsi, .LC5[rip]
	mov	edi, 1
	mov	eax, 0
	call	errx@PLT
.L7:
	lea	rax, -32[rbp]
	mov	esi, 2
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -100[rbp], eax
	cmp	DWORD PTR -100[rbp], 0
	jns	.L8
	lea	rax, -32[rbp]
	mov	rdx, rax
	lea	rsi, .LC6[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L8:
	lea	rax, -62[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	lea	rcx, -62[rbp]
	mov	eax, DWORD PTR -100[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	QWORD PTR -88[rbp], rax
	cmp	QWORD PTR -88[rbp], 0
	jns	.L9
	lea	rsi, .LC7[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L9:
	lea	rax, -62[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, QWORD PTR -88[rbp]
	cmp	rax, rdx
	je	.L10
	lea	rax, -62[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -88[rbp]
	mov	rcx, rdx
	mov	rdx, rax
	lea	rsi, .LC8[rip]
	mov	edi, 1
	mov	eax, 0
	call	errx@PLT
.L10:
	lea	rax, -62[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	eax, DWORD PTR -100[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	ftruncate@PLT
	test	eax, eax
	jns	.L11
	lea	rsi, .LC9[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L11:
	mov	DWORD PTR -108[rbp], 0
	mov	QWORD PTR -42[rbp], 0
	mov	WORD PTR -34[rbp], 0
	lea	rsi, -42[rbp]
	mov	eax, DWORD PTR -104[rbp]
	mov	ecx, 0
	mov	edx, 10
	mov	edi, eax
	call	pread@PLT
	mov	QWORD PTR -88[rbp], rax
	cmp	QWORD PTR -88[rbp], 0
	jns	.L12
	lea	rsi, .LC10[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L12:
	lea	rax, -62[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, QWORD PTR -88[rbp]
	cmp	rax, rdx
	je	.L13
	lea	rax, -62[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -88[rbp]
	mov	rsi, rax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	warnx@PLT
	mov	DWORD PTR -108[rbp], 1
	jmp	.L14
.L13:
	lea	rdx, -62[rbp]
	lea	rax, -42[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	je	.L14
	lea	rax, -42[rbp]
	mov	rsi, rax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	warnx@PLT
	mov	DWORD PTR -108[rbp], 1
.L14:
	lea	rdx, -62[rbp]
	mov	rax, QWORD PTR -80[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	je	.L15
	mov	rax, QWORD PTR -80[rbp]
	mov	rsi, rax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	warnx@PLT
	mov	DWORD PTR -108[rbp], 1
.L15:
	mov	eax, DWORD PTR -108[rbp]
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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	"797945.c"
	.text
	.section	.rodata
	.align	2
.LC3:
	.ascii	"open(%s, O_RDONLY)\000"
	.align	2
.LC4:
	.ascii	"initial pread\000"
	.align	2
.LC5:
	.ascii	"short initial pread (%ld/%lu bytes)\000"
	.align	2
.LC6:
	.ascii	"initial pread returned wrong data: %s\000"
	.align	2
.LC7:
	.ascii	"mmap\000"
	.align	2
.LC8:
	.ascii	"mapping contains wrong initial data: %s\000"
	.align	2
.LC9:
	.ascii	"open(%s, O_RDWR)\000"
	.align	2
.LC10:
	.ascii	"write\000"
	.align	2
.LC11:
	.ascii	"short write (%ld/%lu bytes)\000"
	.align	2
.LC12:
	.ascii	"truncate\000"
	.align	2
.LC13:
	.ascii	"final pread\000"
	.align	2
.LC14:
	.ascii	"short final pread (%ld/%lu bytes)\000"
	.align	2
.LC15:
	.ascii	"final pread returned wrong data: %s\000"
	.align	2
.LC16:
	.ascii	"mapping contains wrong final data: %s\000"
	.align	2
.LC0:
	.ascii	"copy_up_testfile.txt\000"
	.align	2
.LC1:
	.ascii	"old data\012\000"
	.align	2
.LC2:
	.ascii	"new data\012\000"
	.align	2
.LC17:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 112
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #120
	str	r0, [fp, #-112]
	str	r1, [fp, #-116]
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L18+4
	sub	ip, fp, #32
	mov	lr, r3
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1}
	str	r0, [ip]
	add	ip, ip, #4
	strb	r1, [ip]
	ldr	r2, .L18+8
	sub	r3, fp, #80
	ldm	r2, {r0, r1, r2}
	stmia	r3!, {r0, r1}
	strh	r2, [r3]	@ movhi
	ldr	r2, .L18+12
	sub	r3, fp, #68
	ldm	r2, {r0, r1, r2}
	stmia	r3!, {r0, r1}
	strh	r2, [r3]	@ movhi
	mov	r0, #30
	bl	sysconf
	mov	r3, r0
	str	r3, [fp, #-100]
	sub	r3, fp, #32
	mov	r1, #0
	mov	r0, r3
	bl	open
	str	r0, [fp, #-96]
	ldr	r3, [fp, #-96]
	cmp	r3, #0
	bge	.L2
	sub	r3, fp, #32
	mov	r2, r3
	ldr	r1, .L18+16
	mov	r0, #1
	bl	err
.L2:
	mov	r3, #0
	str	r3, [fp, #-56]
	sub	r3, fp, #52
	mov	r2, #0
	str	r2, [r3]
	strh	r2, [r3, #4]	@ movhi
	sub	r1, fp, #56
	mov	r3, #0
	mov	r2, #10
	ldr	r0, [fp, #-96]
	bl	pread
	str	r0, [fp, #-92]
	ldr	r3, [fp, #-92]
	cmp	r3, #0
	bge	.L3
	ldr	r1, .L18+20
	mov	r0, #1
	bl	err
.L3:
	sub	r3, fp, #80
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	ldr	r3, [fp, #-92]
	cmp	r2, r3
	beq	.L4
	sub	r3, fp, #80
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	ldr	r2, [fp, #-92]
	ldr	r1, .L18+24
	mov	r0, #1
	bl	errx
.L4:
	sub	r2, fp, #80
	sub	r3, fp, #56
	mov	r1, r2
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L5
	sub	r3, fp, #56
	mov	r2, r3
	ldr	r1, .L18+28
	mov	r0, #1
	bl	errx
.L5:
	mov	r3, #0
	str	r3, [sp, #4]
	ldr	r3, [fp, #-96]
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #1
	ldr	r1, [fp, #-100]
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-88]
	ldr	r3, [fp, #-88]
	cmn	r3, #1
	bne	.L6
	ldr	r1, .L18+32
	mov	r0, #1
	bl	err
.L6:
	sub	r3, fp, #80
	mov	r1, r3
	ldr	r0, [fp, #-88]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L7
	ldr	r2, [fp, #-88]
	ldr	r1, .L18+36
	mov	r0, #1
	bl	errx
.L7:
	sub	r3, fp, #32
	mov	r1, #2
	mov	r0, r3
	bl	open
	str	r0, [fp, #-84]
	ldr	r3, [fp, #-84]
	cmp	r3, #0
	bge	.L8
	sub	r3, fp, #32
	mov	r2, r3
	ldr	r1, .L18+40
	mov	r0, #1
	bl	err
.L8:
	sub	r3, fp, #68
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	sub	r3, fp, #68
	mov	r1, r3
	ldr	r0, [fp, #-84]
	bl	write
	str	r0, [fp, #-92]
	ldr	r3, [fp, #-92]
	cmp	r3, #0
	bge	.L9
	ldr	r1, .L18+44
	mov	r0, #1
	bl	err
.L9:
	sub	r3, fp, #68
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	ldr	r3, [fp, #-92]
	cmp	r2, r3
	beq	.L10
	sub	r3, fp, #68
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	ldr	r2, [fp, #-92]
	ldr	r1, .L18+48
	mov	r0, #1
	bl	errx
.L10:
	sub	r3, fp, #68
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	mov	r1, r3
	ldr	r0, [fp, #-84]
	bl	ftruncate
	mov	r3, r0
	cmp	r3, #0
	bge	.L11
	ldr	r1, .L18+52
	mov	r0, #1
	bl	err
.L11:
	mov	r3, #0
	str	r3, [fp, #-104]
	mov	r3, #0
	str	r3, [fp, #-44]
	sub	r3, fp, #40
	mov	r2, #0
	str	r2, [r3]
	strh	r2, [r3, #4]	@ movhi
	sub	r1, fp, #44
	mov	r3, #0
	mov	r2, #10
	ldr	r0, [fp, #-96]
	bl	pread
	str	r0, [fp, #-92]
	ldr	r3, [fp, #-92]
	cmp	r3, #0
	bge	.L12
	ldr	r1, .L18+56
	mov	r0, #1
	bl	err
.L12:
	sub	r3, fp, #68
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	ldr	r3, [fp, #-92]
	cmp	r2, r3
	beq	.L13
	sub	r3, fp, #68
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, [fp, #-92]
	ldr	r0, .L18+60
	bl	warnx
	mov	r3, #1
	str	r3, [fp, #-104]
	b	.L14
.L13:
	sub	r2, fp, #68
	sub	r3, fp, #44
	mov	r1, r2
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L14
	sub	r3, fp, #44
	mov	r1, r3
	ldr	r0, .L18+64
	bl	warnx
	mov	r3, #1
	str	r3, [fp, #-104]
.L14:
	sub	r3, fp, #68
	mov	r1, r3
	ldr	r0, [fp, #-88]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L15
	ldr	r1, [fp, #-88]
	ldr	r0, .L18+68
	bl	warnx
	mov	r3, #1
	str	r3, [fp, #-104]
.L15:
	ldr	r3, [fp, #-104]
	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	.LC17
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
