	.file	"693492.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"input01.txt"
	.section	.data.rel.local,"aw"
	.align 8
	.type	fname, @object
	.size	fname, 8
fname:
	.quad	.LC0
	.section	.rodata
.LC1:
	.string	"r"
.LC2:
	.string	"Part 1: %d\n"
.LC3:
	.string	"Part 2: %d\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, 104
	.cfi_offset 3, -24
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -48[rbp], 0
	mov	QWORD PTR -40[rbp], 0
	mov	DWORD PTR -100[rbp], 0
	mov	DWORD PTR -104[rbp], 0
	mov	QWORD PTR -96[rbp], 0
	mov	QWORD PTR -80[rbp], 0
	mov	QWORD PTR -88[rbp], 0
	mov	QWORD PTR -56[rbp], -1
	mov	rax, QWORD PTR fname[rip]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -32[rbp], rax
	cmp	QWORD PTR -32[rbp], 0
	je	.L2
	jmp	.L3
.L4:
	add	QWORD PTR -80[rbp], 1
.L3:
	mov	rdx, QWORD PTR -32[rbp]
	lea	rcx, -88[rbp]
	lea	rax, -96[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	getline@PLT
	test	rax, rax
	jg	.L4
	cmp	QWORD PTR -80[rbp], 0
	je	.L5
	mov	rax, QWORD PTR -80[rbp]
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -48[rbp], rax
	mov	rax, QWORD PTR -80[rbp]
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -40[rbp], rax
	cmp	QWORD PTR -48[rbp], 0
	je	.L5
	cmp	QWORD PTR -40[rbp], 0
	je	.L5
	mov	rax, QWORD PTR -48[rbp]
	mov	DWORD PTR [rax], 0
	mov	QWORD PTR -72[rbp], 1
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	rewind@PLT
	jmp	.L6
.L8:
	mov	rax, QWORD PTR -72[rbp]
	sal	rax, 2
	lea	rdx, -4[rax]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	ebx, DWORD PTR [rax]
	mov	rax, QWORD PTR -96[rbp]
	mov	rdi, rax
	call	atoi@PLT
	mov	edx, eax
	mov	rax, QWORD PTR -72[rbp]
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rcx
	add	edx, ebx
	mov	DWORD PTR [rax], edx
	add	QWORD PTR -72[rbp], 1
.L6:
	mov	rdx, QWORD PTR -32[rbp]
	lea	rcx, -88[rbp]
	lea	rax, -96[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	getline@PLT
	test	rax, rax
	jle	.L7
	mov	rax, QWORD PTR -72[rbp]
	cmp	rax, QWORD PTR -80[rbp]
	jb	.L8
.L7:
	mov	rax, QWORD PTR -80[rbp]
	sal	rax, 2
	lea	rdx, -4[rax]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	ebx, DWORD PTR [rax]
	mov	rax, QWORD PTR -96[rbp]
	mov	rdi, rax
	call	atoi@PLT
	add	eax, ebx
	mov	DWORD PTR -100[rbp], eax
	mov	eax, DWORD PTR -100[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	QWORD PTR -72[rbp], 0
	jmp	.L9
.L10:
	mov	rax, QWORD PTR -72[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	rdx, QWORD PTR -72[rbp]
	lea	rcx, 0[0+rdx*4]
	mov	rdx, QWORD PTR -40[rbp]
	add	rcx, rdx
	cdq
	idiv	DWORD PTR -100[rbp]
	mov	eax, edx
	mov	DWORD PTR [rcx], eax
	add	QWORD PTR -72[rbp], 1
.L9:
	mov	rax, QWORD PTR -72[rbp]
	cmp	rax, QWORD PTR -80[rbp]
	jb	.L10
	mov	QWORD PTR -72[rbp], 0
	jmp	.L11
.L15:
	mov	rax, QWORD PTR -72[rbp]
	add	rax, 1
	mov	QWORD PTR -64[rbp], rax
	jmp	.L12
.L14:
	mov	rax, QWORD PTR -72[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -64[rbp]
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	cmp	edx, eax
	jne	.L13
	mov	rax, QWORD PTR -64[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	rdx, QWORD PTR -72[rbp]
	lea	rcx, 0[0+rdx*4]
	mov	rdx, QWORD PTR -48[rbp]
	add	rdx, rcx
	mov	edx, DWORD PTR [rdx]
	sub	eax, edx
	cdq
	idiv	DWORD PTR -100[rbp]
	cdqe
	imul	rax, QWORD PTR -80[rbp]
	mov	rdx, rax
	mov	rax, QWORD PTR -72[rbp]
	add	rax, rdx
	mov	QWORD PTR -88[rbp], rax
	mov	rax, QWORD PTR -88[rbp]
	cmp	QWORD PTR -56[rbp], rax
	jbe	.L13
	mov	rax, QWORD PTR -88[rbp]
	mov	QWORD PTR -56[rbp], rax
	mov	rax, QWORD PTR -64[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -104[rbp], eax
.L13:
	add	QWORD PTR -64[rbp], 1
.L12:
	mov	rax, QWORD PTR -64[rbp]
	cmp	rax, QWORD PTR -80[rbp]
	jb	.L14
	add	QWORD PTR -72[rbp], 1
.L11:
	mov	rax, QWORD PTR -80[rbp]
	sub	rax, 1
	cmp	QWORD PTR -72[rbp], rax
	jb	.L15
	mov	eax, DWORD PTR -104[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	free@PLT
.L5:
	mov	rax, QWORD PTR -96[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	fclose@PLT
.L2:
	mov	eax, 0
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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	"693492.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"input01.txt\000"
	.data
	.align	2
	.type	fname, %object
	.size	fname, 4
fname:
	.word	.LC0
	.section	.rodata
	.align	2
.LC1:
	.ascii	"r\000"
	.align	2
.LC2:
	.ascii	"Part 1: %d\012\000"
	.global	__aeabi_idivmod
	.global	__aeabi_idiv
	.align	2
.LC3:
	.ascii	"Part 2: %d\012\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #52
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-52]
	mov	r3, #0
	str	r3, [fp, #-60]
	mov	r3, #0
	str	r3, [fp, #-48]
	mov	r3, #0
	str	r3, [fp, #-56]
	mvn	r3, #0
	str	r3, [fp, #-36]
	ldr	r3, .L18+4
	ldr	r3, [r3]
	ldr	r1, .L18+8
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L2
	b	.L3
.L4:
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
.L3:
	sub	r1, fp, #56
	sub	r3, fp, #60
	ldr	r2, [fp, #-20]
	mov	r0, r3
	bl	getline
	mov	r3, r0
	cmp	r3, #0
	bgt	.L4
	ldr	r3, [fp, #-48]
	cmp	r3, #0
	beq	.L5
	ldr	r3, [fp, #-48]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-48]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	beq	.L5
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L5
	ldr	r3, [fp, #-32]
	mov	r2, #0
	str	r2, [r3]
	mov	r3, #1
	str	r3, [fp, #-44]
	ldr	r0, [fp, #-20]
	bl	rewind
	b	.L6
.L8:
	ldr	r3, [fp, #-44]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	ldr	r4, [r3]
	ldr	r3, [fp, #-60]
	mov	r0, r3
	bl	atoi
	mov	r1, r0
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	add	r2, r4, r1
	str	r2, [r3]
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L6:
	sub	r1, fp, #56
	sub	r3, fp, #60
	ldr	r2, [fp, #-20]
	mov	r0, r3
	bl	getline
	mov	r3, r0
	cmp	r3, #0
	ble	.L7
	ldr	r2, [fp, #-44]
	ldr	r3, [fp, #-48]
	cmp	r2, r3
	bcc	.L8
.L7:
	ldr	r3, [fp, #-48]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	ldr	r4, [r3]
	ldr	r3, [fp, #-60]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	add	r3, r4, r3
	str	r3, [fp, #-24]
	ldr	r1, [fp, #-24]
	ldr	r0, .L18+12
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L9
.L10:
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	ldr	r0, [r3]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r4, r2, r3
	ldr	r1, [fp, #-24]
	bl	__aeabi_idivmod
	mov	r3, r1
	str	r3, [r4]
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L9:
	ldr	r2, [fp, #-44]
	ldr	r3, [fp, #-48]
	cmp	r2, r3
	bcc	.L10
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L11
.L15:
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-40]
	b	.L12
.L14:
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-28]
	add	r3, r1, r3
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L13
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-32]
	add	r3, r1, r3
	ldr	r3, [r3]
	sub	r3, r2, r3
	ldr	r1, [fp, #-24]
	mov	r0, r3
	bl	__aeabi_idiv
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-48]
	mul	r2, r3, r2
	ldr	r3, [fp, #-44]
	add	r3, r2, r3
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-56]
	ldr	r2, [fp, #-36]
	cmp	r2, r3
	bls	.L13
	ldr	r3, [fp, #-56]
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-52]
.L13:
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L12:
	ldr	r2, [fp, #-40]
	ldr	r3, [fp, #-48]
	cmp	r2, r3
	bcc	.L14
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L11:
	ldr	r3, [fp, #-48]
	sub	r3, r3, #1
	ldr	r2, [fp, #-44]
	cmp	r2, r3
	bcc	.L15
	ldr	r1, [fp, #-52]
	ldr	r0, .L18+16
	bl	printf
	ldr	r0, [fp, #-32]
	bl	free
	ldr	r0, [fp, #-28]
	bl	free
.L5:
	ldr	r3, [fp, #-60]
	mov	r0, r3
	bl	free
	ldr	r0, [fp, #-20]
	bl	fclose
.L2:
	mov	r3, #0
	ldr	r2, .L18
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L17
	bl	__stack_chk_fail
.L17:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC4
	.word	fname
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
