	.file	"471873.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Not enough arguments"
.LC1:
	.string	"poll failed"
.LC2:
	.string	"No data for reading/writing"
.LC3:
	.string	"%d"
.LC4:
	.string	"Maximum possible line is %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
	sub	rsp, 896
	mov	DWORD PTR -884[rbp], edi
	mov	QWORD PTR -896[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -884[rbp], 1
	jne	.L2
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	rax, QWORD PTR -896[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -848[rbp], rax
	mov	DWORD PTR -868[rbp], 1
	mov	rax, QWORD PTR -848[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -864[rbp], eax
	cmp	DWORD PTR -864[rbp], -1
	jne	.L3
	mov	rax, QWORD PTR -848[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	eax, DWORD PTR -864[rbp]
	mov	edx, 2
	mov	esi, 0
	mov	edi, eax
	call	lseek@PLT
	mov	QWORD PTR -840[rbp], rax
	mov	edx, DWORD PTR -864[rbp]
	mov	rax, QWORD PTR -840[rbp]
	mov	r9d, 0
	mov	r8d, edx
	mov	ecx, 1
	mov	edx, 1
	mov	rsi, rax
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -832[rbp], rax
	mov	rax, QWORD PTR -832[rbp]
	mov	QWORD PTR -816[rbp], rax
	mov	DWORD PTR -872[rbp], 0
	jmp	.L4
.L7:
	mov	eax, DWORD PTR -872[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -832[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 10
	jne	.L5
	mov	eax, DWORD PTR -872[rbp]
	movsx	rcx, eax
	mov	eax, DWORD PTR -868[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -868[rbp], edx
	mov	rdx, QWORD PTR -832[rbp]
	add	rdx, rcx
	cdqe
	mov	QWORD PTR -816[rbp+rax*8], rdx
	jmp	.L6
.L5:
	mov	eax, DWORD PTR -872[rbp]
	cdqe
	mov	rdx, QWORD PTR -840[rbp]
	sub	rdx, 1
	cmp	rax, rdx
	jne	.L6
	mov	eax, DWORD PTR -872[rbp]
	cdqe
	lea	rcx, 1[rax]
	mov	eax, DWORD PTR -868[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -868[rbp], edx
	mov	rdx, QWORD PTR -832[rbp]
	add	rdx, rcx
	cdqe
	mov	QWORD PTR -816[rbp+rax*8], rdx
.L6:
	add	DWORD PTR -872[rbp], 1
.L4:
	mov	eax, DWORD PTR -872[rbp]
	cdqe
	cmp	QWORD PTR -840[rbp], rax
	ja	.L7
	mov	DWORD PTR -824[rbp], 0
	mov	WORD PTR -820[rbp], 1
.L19:
	lea	rax, -824[rbp]
	mov	edx, 5000
	mov	esi, 1
	mov	rdi, rax
	call	poll@PLT
	mov	DWORD PTR -860[rbp], eax
	cmp	DWORD PTR -860[rbp], -1
	jne	.L8
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	cmp	DWORD PTR -860[rbp], 0
	jne	.L9
	lea	rdi, .LC2[rip]
	call	puts@PLT
.L9:
	movzx	eax, WORD PTR -818[rbp]
	cwde
	and	eax, 1
	test	eax, eax
	je	.L10
	lea	rax, -876[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -876[rbp]
	cmp	DWORD PTR -868[rbp], eax
	jle	.L11
	mov	eax, DWORD PTR -876[rbp]
	test	eax, eax
	jle	.L11
	mov	eax, DWORD PTR -876[rbp]
	sub	eax, 1
	cdqe
	mov	rax, QWORD PTR -816[rbp+rax*8]
	add	rax, 1
	mov	QWORD PTR -856[rbp], rax
	jmp	.L12
.L13:
	mov	rax, QWORD PTR -856[rbp]
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	mov	edi, eax
	call	putchar@PLT
	add	QWORD PTR -856[rbp], 1
.L12:
	mov	eax, DWORD PTR -876[rbp]
	cdqe
	mov	rax, QWORD PTR -816[rbp+rax*8]
	sub	rax, 1
	cmp	QWORD PTR -856[rbp], rax
	jbe	.L13
	mov	edi, 10
	call	putchar@PLT
	jmp	.L15
.L11:
	mov	eax, DWORD PTR -868[rbp]
	sub	eax, 1
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L19
.L10:
	mov	DWORD PTR -872[rbp], 0
	jmp	.L16
.L17:
	mov	eax, DWORD PTR -872[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -832[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	mov	edi, eax
	call	putchar@PLT
	add	DWORD PTR -872[rbp], 1
.L16:
	mov	eax, DWORD PTR -872[rbp]
	cdqe
	cmp	QWORD PTR -840[rbp], rax
	ja	.L17
	jmp	.L22
.L15:
	jmp	.L19
.L22:
	mov	eax, DWORD PTR -864[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	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	"471873.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Not enough arguments\000"
	.align	2
.LC1:
	.ascii	"poll failed\000"
	.align	2
.LC2:
	.ascii	"No data for reading/writing\000"
	.align	2
.LC3:
	.ascii	"%d\000"
	.align	2
.LC4:
	.ascii	"Maximum possible line is %d\012\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 464
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #472
	str	r0, [fp, #-464]
	str	r1, [fp, #-468]
	ldr	r3, .L23
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-464]
	cmp	r3, #1
	bne	.L2
	ldr	r0, .L23+4
	bl	perror
	mov	r0, #1
	bl	exit
.L2:
	ldr	r3, [fp, #-468]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-440]
	mov	r3, #1
	str	r3, [fp, #-448]
	mov	r1, #0
	ldr	r0, [fp, #-440]
	bl	open
	str	r0, [fp, #-436]
	ldr	r3, [fp, #-436]
	cmn	r3, #1
	bne	.L3
	ldr	r0, [fp, #-440]
	bl	perror
	mov	r0, #1
	bl	exit
.L3:
	mov	r2, #2
	mov	r1, #0
	ldr	r0, [fp, #-436]
	bl	lseek
	mov	r3, r0
	str	r3, [fp, #-432]
	mov	r3, #0
	str	r3, [sp, #4]
	ldr	r3, [fp, #-436]
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #1
	ldr	r1, [fp, #-432]
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-428]
	ldr	r3, [fp, #-428]
	str	r3, [fp, #-412]
	mov	r3, #0
	str	r3, [fp, #-452]
	b	.L4
.L7:
	ldr	r3, [fp, #-452]
	ldr	r2, [fp, #-428]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L5
	ldr	r2, [fp, #-452]
	ldr	r3, [fp, #-448]
	add	r1, r3, #1
	str	r1, [fp, #-448]
	ldr	r1, [fp, #-428]
	add	r2, r1, r2
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	str	r2, [r3, #-408]
	b	.L6
.L5:
	ldr	r3, [fp, #-432]
	sub	r2, r3, #1
	ldr	r3, [fp, #-452]
	cmp	r2, r3
	bne	.L6
	ldr	r3, [fp, #-452]
	add	r2, r3, #1
	ldr	r3, [fp, #-448]
	add	r1, r3, #1
	str	r1, [fp, #-448]
	ldr	r1, [fp, #-428]
	add	r2, r1, r2
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	str	r2, [r3, #-408]
.L6:
	ldr	r3, [fp, #-452]
	add	r3, r3, #1
	str	r3, [fp, #-452]
.L4:
	ldr	r3, [fp, #-452]
	ldr	r2, [fp, #-432]
	cmp	r2, r3
	bhi	.L7
	mov	r3, #0
	str	r3, [fp, #-420]
	sub	r3, fp, #4
	sub	r3, r3, #416
	mov	r2, #1
	strh	r2, [r3, #4]	@ movhi
.L19:
	sub	r3, fp, #420
	ldr	r2, .L23+8
	mov	r1, #1
	mov	r0, r3
	bl	poll
	str	r0, [fp, #-424]
	ldr	r3, [fp, #-424]
	cmn	r3, #1
	bne	.L8
	ldr	r0, .L23+12
	bl	perror
	mov	r0, #1
	bl	exit
.L8:
	ldr	r3, [fp, #-424]
	cmp	r3, #0
	bne	.L9
	ldr	r0, .L23+16
	bl	puts
.L9:
	sub	r3, fp, #4
	sub	r3, r3, #416
	ldrsh	r3, [r3, #6]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L10
	sub	r3, fp, #456
	mov	r1, r3
	ldr	r0, .L23+20
	bl	__isoc99_scanf
	ldr	r3, [fp, #-456]
	ldr	r2, [fp, #-448]
	cmp	r2, r3
	ble	.L11
	ldr	r3, [fp, #-456]
	cmp	r3, #0
	ble	.L11
	ldr	r3, [fp, #-456]
	sub	r3, r3, #1
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-408]
	add	r3, r3, #1
	str	r3, [fp, #-444]
	b	.L12
.L13:
	ldr	r3, [fp, #-444]
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	putchar
	ldr	r3, [fp, #-444]
	add	r3, r3, #1
	str	r3, [fp, #-444]
.L12:
	ldr	r3, [fp, #-456]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-408]
	sub	r3, r3, #1
	ldr	r2, [fp, #-444]
	cmp	r2, r3
	bls	.L13
	mov	r0, #10
	bl	putchar
	b	.L15
.L11:
	ldr	r3, [fp, #-448]
	sub	r3, r3, #1
	mov	r1, r3
	ldr	r0, .L23+24
	bl	printf
	b	.L19
.L10:
	mov	r3, #0
	str	r3, [fp, #-452]
	b	.L16
.L17:
	ldr	r3, [fp, #-452]
	ldr	r2, [fp, #-428]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	putchar
	ldr	r3, [fp, #-452]
	add	r3, r3, #1
	str	r3, [fp, #-452]
.L16:
	ldr	r3, [fp, #-452]
	ldr	r2, [fp, #-432]
	cmp	r2, r3
	bhi	.L17
	b	.L22
.L15:
	b	.L19
.L22:
	ldr	r0, [fp, #-436]
	bl	close
	mov	r3, #0
	ldr	r2, .L23
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L21
	bl	__stack_chk_fail
.L21:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	.LC5
	.word	.LC0
	.word	5000
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
