	.file	"97012026.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Usage: %s [FILE]\n"
.LC1:
	.string	"r"
.LC2:
	.string	"%u"
	.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, 80
	mov	DWORD PTR -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -48[rbp], 0
	mov	DWORD PTR -44[rbp], 32
	mov	DWORD PTR -40[rbp], 0
	mov	DWORD PTR -36[rbp], 16
	mov	eax, DWORD PTR -36[rbp]
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -32[rbp], rax
	mov	eax, DWORD PTR -44[rbp]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -32[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR [rax], rdx
	cmp	DWORD PTR -68[rbp], 2
	je	.L2
	mov	rax, QWORD PTR -80[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L12
.L2:
	add	QWORD PTR -80[rbp], 8
	mov	rax, QWORD PTR -80[rbp]
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -16[rbp], rax
	jmp	.L4
.L11:
	cmp	BYTE PTR -53[rbp], 10
	je	.L5
	cmp	BYTE PTR -53[rbp], -1
	jne	.L6
.L5:
	mov	edx, DWORD PTR -48[rbp]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	mov	eax, DWORD PTR -40[rbp]
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rdx, -52[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	mov	eax, DWORD PTR -52[rbp]
	cmp	DWORD PTR -40[rbp], eax
	jb	.L7
	mov	edx, DWORD PTR -52[rbp]
	mov	eax, DWORD PTR -40[rbp]
	sub	eax, edx
	mov	eax, eax
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	puts@PLT
.L7:
	mov	DWORD PTR -48[rbp], 0
	mov	DWORD PTR -40[rbp], 0
	jmp	.L4
.L6:
	mov	eax, DWORD PTR -44[rbp]
	sub	eax, 1
	cmp	DWORD PTR -48[rbp], eax
	jne	.L8
	mov	eax, DWORD PTR -44[rbp]
	shr	eax
	add	DWORD PTR -44[rbp], eax
	mov	edx, DWORD PTR -44[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	realloc@PLT
	mov	QWORD PTR -24[rbp], rax
.L8:
	cmp	BYTE PTR -53[rbp], 32
	jne	.L9
	mov	eax, DWORD PTR -48[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -48[rbp], edx
	mov	edx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	mov	eax, DWORD PTR -36[rbp]
	sub	eax, 1
	cmp	DWORD PTR -40[rbp], eax
	jne	.L10
	mov	eax, DWORD PTR -36[rbp]
	shr	eax
	add	DWORD PTR -36[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	realloc@PLT
	mov	QWORD PTR -32[rbp], rax
.L10:
	mov	ecx, DWORD PTR -48[rbp]
	add	DWORD PTR -40[rbp], 1
	mov	eax, DWORD PTR -40[rbp]
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR -24[rbp]
	add	rdx, rcx
	mov	QWORD PTR [rax], rdx
	jmp	.L4
.L9:
	mov	eax, DWORD PTR -48[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -48[rbp], edx
	mov	edx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	movzx	eax, BYTE PTR -53[rbp]
	mov	BYTE PTR [rdx], al
.L4:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	getc@PLT
	mov	BYTE PTR -53[rbp], al
	cmp	BYTE PTR -53[rbp], -1
	jne	.L11
	cmp	DWORD PTR -48[rbp], 0
	jne	.L11
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
.L12:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	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	"97012026.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: %s [FILE]\012\000"
	.align	2
.LC1:
	.ascii	"r\000"
	.align	2
.LC2:
	.ascii	"%u\000"
	.align	2
.LC3:
	.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	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-36]
	mov	r3, #32
	str	r3, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-28]
	mov	r3, #16
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r0, [fp, #-32]
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-16]
	str	r2, [r3]
	ldr	r3, [fp, #-48]
	cmp	r3, #2
	beq	.L2
	ldr	r3, [fp, #-52]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L14+4
	bl	printf
	mov	r3, #1
	ldr	r2, .L14
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L11
	b	.L12
.L2:
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	str	r3, [fp, #-52]
	ldr	r3, [fp, #-52]
	ldr	r3, [r3]
	ldr	r1, .L14+8
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-12]
	b	.L4
.L13:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-36]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	sub	r2, fp, #40
	ldr	r1, .L14+12
	mov	r0, r3
	bl	__isoc99_sscanf
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-28]
	cmp	r2, r3
	bcc	.L6
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-28]
	sub	r3, r2, r3
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	puts
.L6:
	mov	r3, #0
	str	r3, [fp, #-36]
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L4
.L5:
	ldr	r3, [fp, #-32]
	sub	r3, r3, #1
	ldr	r2, [fp, #-36]
	cmp	r2, r3
	bne	.L7
	ldr	r3, [fp, #-32]
	lsr	r3, r3, #1
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	str	r3, [fp, #-32]
	ldr	r1, [fp, #-32]
	ldr	r0, [fp, #-16]
	bl	realloc
	str	r0, [fp, #-16]
.L7:
	ldrb	r3, [fp, #-41]	@ zero_extendqisi2
	cmp	r3, #32
	bne	.L8
	ldr	r3, [fp, #-36]
	add	r2, r3, #1
	str	r2, [fp, #-36]
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-24]
	sub	r3, r3, #1
	ldr	r2, [fp, #-28]
	cmp	r2, r3
	bne	.L9
	ldr	r3, [fp, #-24]
	lsr	r3, r3, #1
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	mov	r1, r3
	ldr	r0, [fp, #-20]
	bl	realloc
	str	r0, [fp, #-20]
.L9:
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r1, [fp, #-16]
	ldr	r2, [fp, #-36]
	add	r2, r1, r2
	str	r2, [r3]
	b	.L4
.L8:
	ldr	r3, [fp, #-36]
	add	r2, r3, #1
	str	r2, [fp, #-36]
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldrb	r2, [fp, #-41]
	strb	r2, [r3]
.L4:
	ldr	r0, [fp, #-12]
	bl	getc
	mov	r3, r0
	strb	r3, [fp, #-41]
	ldrb	r3, [fp, #-41]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L5
	b	.L13
.L12:
	bl	__stack_chk_fail
.L11:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC3
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
