	.file	"117328647.c"
	.intel_syntax noprefix
	.text
	.globl	fp_data
	.bss
	.align 8
	.type	fp_data, @object
	.size	fp_data, 8
fp_data:
	.zero	8
	.globl	fp_frag1
	.align 8
	.type	fp_frag1, @object
	.size	fp_frag1, 8
fp_frag1:
	.zero	8
	.globl	fp_frag2
	.align 8
	.type	fp_frag2, @object
	.size	fp_frag2, 8
fp_frag2:
	.zero	8
	.section	.rodata
.LC0:
	.string	"Needs to pass two arguments.."
.LC1:
	.string	"r"
.LC2:
	.string	"fopen"
.LC3:
	.string	"Error opening datafile "
.LC4:
	.string	"a+"
.LC5:
	.string	"Error opening fragfile "
.LC6:
	.string	"fwrite"
.LC7:
	.string	"fread"
.LC8:
	.string	"Error reading data file"
.LC9:
	.string	"Error in writing data"
	.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, 1296
	mov	DWORD PTR -1284[rbp], edi
	mov	QWORD PTR -1296[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -1280[rbp], 0
	mov	DWORD PTR -1276[rbp], 0
	mov	DWORD PTR -1272[rbp], -1
	mov	DWORD PTR -1268[rbp], -1
	cmp	DWORD PTR -1284[rbp], 3
	je	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L13
.L2:
	mov	rax, QWORD PTR -1296[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR fp_data[rip], rax
	mov	rax, QWORD PTR fp_data[rip]
	test	rax, rax
	jne	.L4
	lea	rdi, .LC2[rip]
	call	perror@PLT
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L13
.L4:
	mov	rax, QWORD PTR -1296[rbp]
	add	rax, 16
	mov	rdx, QWORD PTR [rax]
	lea	rax, -1264[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	lea	rax, -1264[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	lea	rax, -1264[rbp]
	add	rax, rdx
	mov	DWORD PTR [rax], 1634887215
	mov	WORD PTR 4[rax], 12647
	mov	BYTE PTR 6[rax], 0
	mov	rax, QWORD PTR -1296[rbp]
	add	rax, 16
	mov	rdx, QWORD PTR [rax]
	lea	rax, -1152[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	lea	rax, -1152[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	lea	rax, -1152[rbp]
	add	rax, rdx
	mov	DWORD PTR [rax], 1634887215
	mov	WORD PTR 4[rax], 12903
	mov	BYTE PTR 6[rax], 0
.L12:
	lea	rax, -1264[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR fp_frag1[rip], rax
	mov	rax, QWORD PTR fp_frag1[rip]
	test	rax, rax
	jne	.L5
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L13
.L5:
	lea	rax, -1152[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR fp_frag2[rip], rax
	mov	rax, QWORD PTR fp_frag2[rip]
	test	rax, rax
	jne	.L6
	lea	rdi, .LC6[rip]
	call	perror@PLT
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L13
.L6:
	mov	rdx, QWORD PTR fp_data[rip]
	lea	rax, -1040[rbp]
	mov	rcx, rdx
	mov	edx, 1024
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	DWORD PTR -1280[rbp], eax
	cmp	DWORD PTR -1280[rbp], 0
	jns	.L7
	lea	rdi, .LC7[rip]
	call	perror@PLT
	lea	rdi, .LC8[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L13
.L7:
	mov	rcx, QWORD PTR fp_frag1[rip]
	mov	eax, DWORD PTR -1280[rbp]
	movsx	rdx, eax
	lea	rax, -1040[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	DWORD PTR -1276[rbp], eax
	mov	eax, DWORD PTR -1280[rbp]
	cmp	eax, DWORD PTR -1276[rbp]
	je	.L8
	lea	rdi, .LC6[rip]
	call	perror@PLT
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L13
.L8:
	mov	rcx, QWORD PTR fp_frag2[rip]
	mov	eax, DWORD PTR -1280[rbp]
	movsx	rdx, eax
	lea	rax, -1040[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	DWORD PTR -1276[rbp], eax
	mov	eax, DWORD PTR -1280[rbp]
	cmp	eax, DWORD PTR -1276[rbp]
	je	.L9
	lea	rdi, .LC6[rip]
	call	perror@PLT
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L13
.L9:
	mov	rax, QWORD PTR fp_frag1[rip]
	mov	rdi, rax
	call	fileno@PLT
	mov	DWORD PTR -1272[rbp], eax
	mov	rax, QWORD PTR fp_frag2[rip]
	mov	rdi, rax
	call	fileno@PLT
	mov	DWORD PTR -1268[rbp], eax
	mov	eax, DWORD PTR -1272[rbp]
	mov	edi, eax
	call	fsync@PLT
	mov	eax, DWORD PTR -1268[rbp]
	mov	edi, eax
	call	fsync@PLT
	mov	rax, QWORD PTR fp_frag1[rip]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR fp_frag2[rip]
	mov	rdi, rax
	call	fclose@PLT
	cmp	DWORD PTR -1280[rbp], 1023
	jle	.L16
	jmp	.L12
.L16:
	nop
	mov	rax, QWORD PTR fp_data[rip]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
.L13:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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	"117328647.c"
	.text
	.comm	fp_data,4,4
	.comm	fp_frag1,4,4
	.comm	fp_frag2,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Needs to pass two arguments..\000"
	.align	2
.LC1:
	.ascii	"r\000"
	.align	2
.LC2:
	.ascii	"fopen\000"
	.align	2
.LC3:
	.ascii	"Error opening datafile \000"
	.align	2
.LC4:
	.ascii	"/frag1\000"
	.align	2
.LC5:
	.ascii	"/frag2\000"
	.align	2
.LC6:
	.ascii	"a+\000"
	.align	2
.LC7:
	.ascii	"Error opening fragfile \000"
	.align	2
.LC8:
	.ascii	"fwrite\000"
	.align	2
.LC9:
	.ascii	"fread\000"
	.align	2
.LC10:
	.ascii	"Error reading data file\000"
	.align	2
.LC11:
	.ascii	"Error in writing data\000"
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 1256
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1248
	sub	sp, sp, #8
	str	r0, [fp, #-1256]
	str	r1, [fp, #-1260]
	ldr	r3, .L17
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-1248]
	mov	r3, #0
	str	r3, [fp, #-1244]
	mvn	r3, #0
	str	r3, [fp, #-1240]
	mvn	r3, #0
	str	r3, [fp, #-1236]
	ldr	r3, [fp, #-1256]
	cmp	r3, #3
	beq	.L2
	ldr	r0, .L17+4
	bl	puts
	mvn	r3, #0
	b	.L13
.L2:
	ldr	r3, [fp, #-1260]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L17+8
	mov	r0, r3
	bl	fopen
	mov	r3, r0
	ldr	r2, .L17+12
	str	r3, [r2]
	ldr	r3, .L17+12
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L4
	ldr	r0, .L17+16
	bl	perror
	ldr	r0, .L17+20
	bl	puts
	mov	r3, #1
	b	.L13
.L4:
	ldr	r3, [fp, #-1260]
	add	r3, r3, #8
	ldr	r2, [r3]
	sub	r3, fp, #1216
	sub	r3, r3, #4
	sub	r3, r3, #12
	mov	r1, r2
	mov	r0, r3
	bl	strcpy
	sub	r3, fp, #1216
	sub	r3, r3, #4
	sub	r3, r3, #12
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #1216
	sub	r3, r3, #4
	sub	r3, r3, #12
	add	r3, r3, r2
	ldr	r2, .L17+24
	mov	r0, r3
	mov	r1, r2
	mov	r3, #7
	mov	r2, r3
	bl	memcpy
	ldr	r3, [fp, #-1260]
	add	r3, r3, #8
	ldr	r2, [r3]
	sub	r3, fp, #1120
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r1, r2
	mov	r0, r3
	bl	strcpy
	sub	r3, fp, #1120
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #1120
	sub	r3, r3, #4
	sub	r3, r3, #8
	add	r3, r3, r2
	ldr	r2, .L17+28
	mov	r0, r3
	mov	r1, r2
	mov	r3, #7
	mov	r2, r3
	bl	memcpy
.L12:
	sub	r3, fp, #1216
	sub	r3, r3, #4
	sub	r3, r3, #12
	ldr	r1, .L17+32
	mov	r0, r3
	bl	fopen
	mov	r3, r0
	ldr	r2, .L17+36
	str	r3, [r2]
	ldr	r3, .L17+36
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L5
	ldr	r0, .L17+40
	bl	puts
	mvn	r3, #0
	b	.L13
.L5:
	sub	r3, fp, #1120
	sub	r3, r3, #4
	sub	r3, r3, #8
	ldr	r1, .L17+32
	mov	r0, r3
	bl	fopen
	mov	r3, r0
	ldr	r2, .L17+44
	str	r3, [r2]
	ldr	r3, .L17+44
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L6
	ldr	r0, .L17+48
	bl	perror
	ldr	r0, .L17+40
	bl	puts
	mvn	r3, #0
	b	.L13
.L6:
	ldr	r3, .L17+12
	ldr	r3, [r3]
	sub	r0, fp, #1024
	sub	r0, r0, #4
	sub	r0, r0, #4
	mov	r2, #1024
	mov	r1, #1
	bl	fread
	mov	r3, r0
	str	r3, [fp, #-1248]
	ldr	r3, [fp, #-1248]
	cmp	r3, #0
	bge	.L7
	ldr	r0, .L17+52
	bl	perror
	ldr	r0, .L17+56
	bl	puts
	mvn	r3, #0
	b	.L13
.L7:
	ldr	r2, [fp, #-1248]
	ldr	r3, .L17+36
	ldr	r3, [r3]
	sub	r0, fp, #1024
	sub	r0, r0, #4
	sub	r0, r0, #4
	mov	r1, #1
	bl	fwrite
	mov	r3, r0
	str	r3, [fp, #-1244]
	ldr	r2, [fp, #-1248]
	ldr	r3, [fp, #-1244]
	cmp	r2, r3
	beq	.L8
	ldr	r0, .L17+48
	bl	perror
	ldr	r0, .L17+60
	bl	puts
	mvn	r3, #0
	b	.L13
.L8:
	ldr	r2, [fp, #-1248]
	ldr	r3, .L17+44
	ldr	r3, [r3]
	sub	r0, fp, #1024
	sub	r0, r0, #4
	sub	r0, r0, #4
	mov	r1, #1
	bl	fwrite
	mov	r3, r0
	str	r3, [fp, #-1244]
	ldr	r2, [fp, #-1248]
	ldr	r3, [fp, #-1244]
	cmp	r2, r3
	beq	.L9
	ldr	r0, .L17+48
	bl	perror
	ldr	r0, .L17+60
	bl	puts
	mvn	r3, #0
	b	.L13
.L9:
	ldr	r3, .L17+36
	ldr	r3, [r3]
	mov	r0, r3
	bl	fileno
	str	r0, [fp, #-1240]
	ldr	r3, .L17+44
	ldr	r3, [r3]
	mov	r0, r3
	bl	fileno
	str	r0, [fp, #-1236]
	ldr	r0, [fp, #-1240]
	bl	fsync
	ldr	r0, [fp, #-1236]
	bl	fsync
	ldr	r3, .L17+36
	ldr	r3, [r3]
	mov	r0, r3
	bl	fclose
	ldr	r3, .L17+44
	ldr	r3, [r3]
	mov	r0, r3
	bl	fclose
	ldr	r3, [fp, #-1248]
	cmp	r3, #1024
	blt	.L16
	b	.L12
.L16:
	nop
	ldr	r3, .L17+12
	ldr	r3, [r3]
	mov	r0, r3
	bl	fclose
	mov	r3, #0
.L13:
	ldr	r2, .L17
	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}
.L18:
	.align	2
.L17:
	.word	.LC12
	.word	.LC0
	.word	.LC1
	.word	fp_data
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	fp_frag1
	.word	.LC7
	.word	fp_frag2
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
