	.file	"618410.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"301.txt"
	.align 8
.LC1:
	.string	"\nThis program reads and changes file size.\n"
.LC2:
	.string	"open() failed"
	.align 8
.LC3:
	.string	"Original file size: %d bytes.\n\n"
.LC4:
	.string	"truncate() failed"
	.align 8
.LC5:
	.string	"Truncated file size: %d bytes.\n\n"
.LC6:
	.string	"ftruncate() failed"
	.align 8
.LC7:
	.string	"Ftruncated file size: %d bytes.\n\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, 1072
	mov	DWORD PTR -1060[rbp], edi
	mov	QWORD PTR -1072[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -1056[rbp], 0
	lea	rax, .LC0[rip]
	mov	QWORD PTR -1048[rbp], rax
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -1048[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -1052[rbp], eax
	cmp	DWORD PTR -1052[rbp], -1
	jne	.L2
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	eax, DWORD PTR -1052[rbp]
	mov	edi, eax
	call	read_file_and_print
	mov	DWORD PTR -1056[rbp], eax
	mov	eax, DWORD PTR -1056[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -1052[rbp]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -1048[rbp]
	mov	esi, 100
	mov	rdi, rax
	call	truncate@PLT
	cmp	eax, -1
	jne	.L3
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	rax, QWORD PTR -1048[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -1052[rbp], eax
	cmp	DWORD PTR -1052[rbp], -1
	jne	.L4
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	mov	eax, DWORD PTR -1052[rbp]
	mov	edi, eax
	call	read_file_and_print
	mov	DWORD PTR -1056[rbp], eax
	mov	eax, DWORD PTR -1056[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -1052[rbp]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -1048[rbp]
	mov	esi, 2
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -1052[rbp], eax
	cmp	DWORD PTR -1052[rbp], -1
	jne	.L5
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	eax, DWORD PTR -1052[rbp]
	mov	esi, 50
	mov	edi, eax
	call	ftruncate@PLT
	cmp	eax, -1
	jne	.L6
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	mov	eax, DWORD PTR -1052[rbp]
	mov	edi, eax
	call	read_file_and_print
	mov	DWORD PTR -1056[rbp], eax
	mov	eax, DWORD PTR -1056[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -1052[rbp]
	mov	edi, eax
	call	close@PLT
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC8:
	.string	"---------- FILE DATA ----------"
.LC9:
	.string	"%s"
	.align 8
.LC10:
	.string	"\n-------------------------------"
	.text
	.globl	read_file_and_print
	.type	read_file_and_print, @function
read_file_and_print:
.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, 1072
	mov	DWORD PTR -1060[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -1048[rbp], 0
	mov	QWORD PTR -1040[rbp], 0
	mov	QWORD PTR -1032[rbp], 0
	lea	rdx, -1024[rbp]
	mov	eax, 0
	mov	ecx, 126
	mov	rdi, rdx
	rep stosq
	lea	rdi, .LC8[rip]
	call	puts@PLT
	jmp	.L9
.L10:
	lea	rax, -1040[rbp]
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -1044[rbp]
	add	DWORD PTR -1048[rbp], eax
.L9:
	lea	rcx, -1040[rbp]
	mov	eax, DWORD PTR -1060[rbp]
	mov	edx, 1024
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -1044[rbp], eax
	cmp	DWORD PTR -1044[rbp], 0
	jg	.L10
	lea	rdi, .LC10[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -1048[rbp]
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	read_file_and_print, .-read_file_and_print
	.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	"618410.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"301.txt\000"
	.align	2
.LC1:
	.ascii	"\012This program reads and changes file size.\012\000"
	.align	2
.LC2:
	.ascii	"open() failed\000"
	.align	2
.LC3:
	.ascii	"Original file size: %d bytes.\012\012\000"
	.align	2
.LC4:
	.ascii	"truncate() failed\000"
	.align	2
.LC5:
	.ascii	"Truncated file size: %d bytes.\012\012\000"
	.align	2
.LC6:
	.ascii	"ftruncate() failed\000"
	.align	2
.LC7:
	.ascii	"Ftruncated file size: %d bytes.\012\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 = 1048
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1040
	sub	sp, sp, #8
	str	r0, [fp, #-1048]
	str	r1, [fp, #-1052]
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-1044]
	ldr	r3, .L8+4
	str	r3, [fp, #-1040]
	ldr	r0, .L8+8
	bl	puts
	mov	r1, #0
	ldr	r0, [fp, #-1040]
	bl	open
	str	r0, [fp, #-1036]
	ldr	r3, [fp, #-1036]
	cmn	r3, #1
	bne	.L2
	ldr	r0, .L8+12
	bl	perror
	mov	r0, #1
	bl	exit
.L2:
	ldr	r0, [fp, #-1036]
	bl	read_file_and_print
	str	r0, [fp, #-1044]
	ldr	r1, [fp, #-1044]
	ldr	r0, .L8+16
	bl	printf
	ldr	r0, [fp, #-1036]
	bl	close
	mov	r1, #100
	ldr	r0, [fp, #-1040]
	bl	truncate
	mov	r3, r0
	cmn	r3, #1
	bne	.L3
	ldr	r0, .L8+20
	bl	perror
	mov	r0, #1
	bl	exit
.L3:
	mov	r1, #0
	ldr	r0, [fp, #-1040]
	bl	open
	str	r0, [fp, #-1036]
	ldr	r3, [fp, #-1036]
	cmn	r3, #1
	bne	.L4
	ldr	r0, .L8+12
	bl	perror
	mov	r0, #1
	bl	exit
.L4:
	ldr	r0, [fp, #-1036]
	bl	read_file_and_print
	str	r0, [fp, #-1044]
	ldr	r1, [fp, #-1044]
	ldr	r0, .L8+24
	bl	printf
	ldr	r0, [fp, #-1036]
	bl	close
	mov	r1, #2
	ldr	r0, [fp, #-1040]
	bl	open
	str	r0, [fp, #-1036]
	ldr	r3, [fp, #-1036]
	cmn	r3, #1
	bne	.L5
	ldr	r0, .L8+12
	bl	perror
	mov	r0, #1
	bl	exit
.L5:
	mov	r1, #50
	ldr	r0, [fp, #-1036]
	bl	ftruncate
	mov	r3, r0
	cmn	r3, #1
	bne	.L6
	ldr	r0, .L8+28
	bl	perror
	mov	r0, #1
	bl	exit
.L6:
	ldr	r0, [fp, #-1036]
	bl	read_file_and_print
	str	r0, [fp, #-1044]
	ldr	r1, [fp, #-1044]
	ldr	r0, .L8+32
	bl	printf
	ldr	r0, [fp, #-1036]
	bl	close
	mov	r0, #0
	bl	exit
.L9:
	.align	2
.L8:
	.word	.LC8
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.size	main, .-main
	.section	.rodata
	.align	2
.LC9:
	.ascii	"---------- FILE DATA ----------\000"
	.align	2
.LC10:
	.ascii	"%s\000"
	.align	2
.LC11:
	.ascii	"\012-------------------------------\000"
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	read_file_and_print
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_file_and_print, %function
read_file_and_print:
	@ args = 0, pretend = 0, frame = 1048
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1040
	sub	sp, sp, #8
	str	r0, [fp, #-1048]
	ldr	r3, .L15
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-1040]
	mov	r3, #0
	str	r3, [fp, #-1032]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	mov	r2, #1020
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r0, .L15+4
	bl	puts
	b	.L11
.L12:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L15+8
	bl	printf
	ldr	r2, [fp, #-1040]
	ldr	r3, [fp, #-1036]
	add	r3, r2, r3
	str	r3, [fp, #-1040]
.L11:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #1024
	mov	r1, r3
	ldr	r0, [fp, #-1048]
	bl	read
	str	r0, [fp, #-1036]
	ldr	r3, [fp, #-1036]
	cmp	r3, #0
	bgt	.L12
	ldr	r0, .L15+12
	bl	puts
	ldr	r3, [fp, #-1040]
	ldr	r2, .L15
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L14
	bl	__stack_chk_fail
.L14:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	.LC12
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.size	read_file_and_print, .-read_file_and_print
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
