// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/io/instream.cpp
// Function: smooth::IO::InStream::InputLine()
S::String S::IO::InStream::InputLine()
{
	if (streamType == STREAM_NONE)		{ lastError = IO_ERROR_NOTOPEN; return NIL; }

	if (bitstreamActive && !keepBits) CompleteBitstream();

	Long	 inpval;
	Int	 bytes = 0;

	Buffer<UnsignedByte>	 stringBuffer(1024);

	while (True)
	{
		for (Int i = 0; i < 1024; i++)
		{
			inpval = InputNumber(1);

			if (inpval == 0 || inpval == -1)
			{
				stringBuffer[bytes] = 0;

				return String((char *) (UnsignedByte *) stringBuffer);
			}

			if (inpval != 13 && inpval != 10)
			{
				stringBuffer[bytes++] = (char) inpval;
			}
			else
			{
				if (inpval == 13) InputNumber(1);

				stringBuffer[bytes] = 0;

				return String((char *) (UnsignedByte *) stringBuffer);
			}
		}

		stringBuffer.Resize(bytes + 1024);
	}

	return NIL; // never reached
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x68(%rbp)
movq %rdi, %rax
movq %rax, -0x60(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movswl 0x8(%rax), %eax
cmpl $0x0, %eax
jne 0xe632c
movq -0x68(%rbp), %rdi
movq -0x58(%rbp), %rax
movw $0x5, 0xf8(%rax)
xorl %esi, %esi
callq 0x5da90
jmp 0xe64d6
movq -0x58(%rbp), %rax
testb $0x1, 0x60(%rax)
je 0xe6349
movq -0x58(%rbp), %rax
testb $0x1, 0x61(%rax)
jne 0xe6349
movq -0x58(%rbp), %rdi
callq 0x5bd50
movl $0x0, -0x1c(%rbp)
leaq -0x38(%rbp), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x71080
jmp 0xe6360
movl $0x0, -0x3c(%rbp)
cmpl $0x400, -0x3c(%rbp)     # imm = 0x400
jge 0xe64b4
movq -0x58(%rbp), %rdi
movl $0x1, %esi
callq 0x5a170
movq %rax, -0x70(%rbp)
jmp 0xe6388
movq -0x70(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xe639e
cmpq $-0x1, -0x18(%rbp)
jne 0xe63fb
movl -0x1c(%rbp), %esi
leaq -0x38(%rbp), %rdi
callq 0x717e0
movq %rax, -0x78(%rbp)
jmp 0xe63b0
movq -0x78(%rbp), %rax
movb $0x0, (%rax)
leaq -0x38(%rbp), %rdi
callq 0x71100
movq %rax, -0x80(%rbp)
jmp 0xe63c6
movq -0x80(%rbp), %rsi
movq -0x68(%rbp), %rdi
callq 0x5c1f0
jmp 0xe63d5
movl $0x1, -0x50(%rbp)
jmp 0xe64cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x71000
jmp 0xe64e3
cmpq $0xd, -0x18(%rbp)
je 0xe643f
cmpq $0xa, -0x18(%rbp)
je 0xe643f
movb -0x18(%rbp), %al
movb %al, -0x89(%rbp)
movl -0x1c(%rbp), %esi
movl %esi, %eax
incl %eax
movl %eax, -0x1c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x717e0
movq %rax, -0x88(%rbp)
jmp 0xe642e
movq -0x88(%rbp), %rax
movb -0x89(%rbp), %cl
movb %cl, (%rax)
jmp 0xe64a4
cmpq $0xd, -0x18(%rbp)
jne 0xe6458
movq -0x58(%rbp), %rdi
movl $0x1, %esi
callq 0x5a170
jmp 0xe6456
jmp 0xe6458
movl -0x1c(%rbp), %esi
leaq -0x38(%rbp), %rdi
callq 0x717e0
movq %rax, -0x98(%rbp)
jmp 0xe646d
movq -0x98(%rbp), %rax
movb $0x0, (%rax)
leaq -0x38(%rbp), %rdi
callq 0x71100
movq %rax, -0xa0(%rbp)
jmp 0xe6489
movq -0xa0(%rbp), %rsi
movq -0x68(%rbp), %rdi
callq 0x5c1f0
jmp 0xe649b
movl $0x1, -0x50(%rbp)
jmp 0xe64cd
jmp 0xe64a6
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xe6367
movl -0x1c(%rbp), %esi
addl $0x400, %esi            # imm = 0x400
leaq -0x38(%rbp), %rdi
callq 0x72e00
jmp 0xe64c8
jmp 0xe635e
leaq -0x38(%rbp), %rdi
callq 0x71000
movq -0x60(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x5b6b0
nopl (%rax)