	.file	"82138.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Usage: %s <file> <start> <count>\n"
	.align 8
.LC1:
	.string	"Error: <start> (%d) must be positive\n"
.LC2:
	.string	"r"
.LC3:
	.string	"No such file: %s\n"
	.align 8
.LC4:
	.string	"Error: invalid parameters for file with %d lines\n"
.LC5:
	.string	"w"
	.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, 64
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	DWORD PTR -48[rbp], 1
	mov	DWORD PTR -44[rbp], 0
	mov	DWORD PTR -40[rbp], 0
	mov	DWORD PTR -36[rbp], -1
	cmp	DWORD PTR -52[rbp], 4
	je	.L2
	mov	rax, QWORD PTR -64[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L3
.L2:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -32[rbp], eax
	cmp	DWORD PTR -32[rbp], 0
	jg	.L4
	mov	eax, 0
	jmp	.L3
.L4:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	jg	.L5
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -28[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L3
.L5:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L6
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L3
.L6:
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, 2
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	ftell@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 1
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	rewind@PLT
	jmp	.L7
.L9:
	mov	eax, DWORD PTR -36[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 10
	jne	.L7
	add	DWORD PTR -48[rbp], 1
	mov	eax, DWORD PTR -48[rbp]
	cmp	eax, DWORD PTR -28[rbp]
	jne	.L8
	mov	eax, DWORD PTR -36[rbp]
	add	eax, 1
	mov	DWORD PTR -44[rbp], eax
.L8:
	mov	edx, DWORD PTR -28[rbp]
	mov	eax, DWORD PTR -32[rbp]
	add	eax, edx
	cmp	DWORD PTR -48[rbp], eax
	jne	.L7
	mov	eax, DWORD PTR -36[rbp]
	add	eax, 1
	mov	DWORD PTR -40[rbp], eax
.L7:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	edx, eax
	add	DWORD PTR -36[rbp], 1
	mov	eax, DWORD PTR -36[rbp]
	movsx	rcx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rcx
	mov	BYTE PTR [rax], dl
	movzx	eax, BYTE PTR [rax]
	cmp	al, -1
	jne	.L9
	mov	edx, DWORD PTR -28[rbp]
	mov	eax, DWORD PTR -32[rbp]
	add	eax, edx
	cmp	DWORD PTR -48[rbp], eax
	jge	.L10
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fclose@PLT
	sub	DWORD PTR -48[rbp], 1
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -48[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L3
.L10:
	mov	eax, DWORD PTR -36[rbp]
	sub	eax, DWORD PTR -40[rbp]
	cdqe
	mov	edx, DWORD PTR -40[rbp]
	movsx	rcx, edx
	mov	rdx, QWORD PTR -8[rbp]
	lea	rsi, [rcx+rdx]
	mov	edx, DWORD PTR -44[rbp]
	movsx	rcx, edx
	mov	rdx, QWORD PTR -8[rbp]
	add	rcx, rdx
	mov	rdx, rax
	mov	rdi, rcx
	call	memmove@PLT
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR -24[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	call	freopen@PLT
	mov	eax, DWORD PTR -36[rbp]
	sub	eax, DWORD PTR -40[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -44[rbp]
	add	eax, edx
	movsx	rsi, eax
	mov	rdx, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
.L3:
	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	"82138.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: %s <file> <start> <count>\012\000"
	.align	2
.LC1:
	.ascii	"Error: <start> (%d) must be positive\012\000"
	.align	2
.LC2:
	.ascii	"r\000"
	.align	2
.LC3:
	.ascii	"No such file: %s\012\000"
	.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]
	mov	r3, #1
	str	r3, [fp, #-36]
	mov	r3, #0
	str	r3, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-24]
	mvn	r3, #0
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-48]
	cmp	r3, #4
	beq	.L2
	ldr	r3, .L11
	ldr	r0, [r3]
	ldr	r3, [fp, #-52]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L11+4
	bl	fprintf
	mov	r3, r0
	b	.L3
.L2:
	ldr	r3, [fp, #-52]
	add	r3, r3, #12
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	bgt	.L4
	mov	r3, #0
	b	.L3
.L4:
	ldr	r3, [fp, #-52]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bgt	.L5
	ldr	r3, .L11
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	ldr	r1, .L11+8
	mov	r0, r3
	bl	fprintf
	mov	r3, r0
	b	.L3
.L5:
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L11+12
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L6
	ldr	r3, .L11
	ldr	r0, [r3]
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L11+16
	bl	fprintf
	mov	r3, r0
	b	.L3
.L6:
	mov	r2, #2
	mov	r1, #0
	ldr	r0, [fp, #-16]
	bl	fseek
	ldr	r0, [fp, #-16]
	bl	ftell
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r0, [fp, #-16]
	bl	rewind
	b	.L7
.L10:
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-20]
	cmp	r2, r3
	bne	.L8
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L8:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-40]
	add	r3, r2, r3
	ldr	r2, [fp, #-36]
	cmp	r2, r3
	bne	.L7
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L7:
	ldr	r0, [fp, #-16]
	bl	fgetc
	mov	r1, r0
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	and	r2, r1, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L7
	b	.L10
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	stderr
	.word	.LC0
	.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
