// File: istellartech[P]OpenTsiolkovsky/src/../lib/csv.h
// Function: io::LineReader::next_line()
char*next_line(){
                        if(data_begin == data_end)
                                return 0;

                        ++file_line;

                        assert(data_begin < data_end);
                        assert(data_end <= block_len*2);

                        if(data_begin >= block_len){
                                std::memcpy(buffer, buffer+block_len, block_len);
                                data_begin -= block_len;
                                data_end -= block_len;
                                if(reader.is_valid())
                                {
                                        data_end += reader.finish_read();
                                        std::memcpy(buffer+block_len, buffer+2*block_len, block_len);
                                        reader.start_read(buffer + 2*block_len, block_len);
                                }
                        }

                        int line_end = data_begin;
                        while(buffer[line_end] != '\n' && line_end != data_end){
                                ++line_end;
                        }

                        if(line_end - data_begin + 1 > block_len){
                                error::line_length_limit_exceeded err;
                                err.set_file_name(file_name);
                                err.set_file_line(file_line);
                                throw err;
                        }

                        if(buffer[line_end] == '\n'){
                                buffer[line_end] = '\0';
                        }else{
                                // some files are missing the newline at the end of the
                                // last line
                                ++data_end;
                                buffer[line_end] = '\0';
                        }

                        // handle windows \r\n-line breaks
                        if(line_end != data_begin && buffer[line_end-1] == '\r')
                                buffer[line_end-1] = '\0';

                        char*ret = buffer + data_begin;
                        data_begin = line_end+1;
                        return ret;
                }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, -0x248(%rbp)
movl 0xc0(%rcx), %eax
cmpl 0xc4(%rcx), %eax
jne 0x415b5
movq $0x0, -0x8(%rbp)
jmp 0x41903
movq -0x248(%rbp), %rcx
movl 0x1c8(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x1c8(%rcx)
movl 0xc0(%rcx), %eax
cmpl 0xc4(%rcx), %eax
jge 0x415db
jmp 0x415fa
leaq 0x179ec(%rip), %rdi     # 0x58fce
leaq 0x179fb(%rip), %rsi     # 0x58fe4
movl $0x1bf, %edx            # imm = 0x1BF
leaq 0x17a00(%rip), %rcx     # 0x58ff5
callq 0x62f0
movq -0x248(%rbp), %rax
cmpl $0x2000000, 0xc4(%rax)  # imm = 0x2000000
jg 0x4160f
jmp 0x4162e
leaq 0x17a01(%rip), %rdi     # 0x59017
leaq 0x179c7(%rip), %rsi     # 0x58fe4
movl $0x1c0, %edx            # imm = 0x1C0
leaq 0x179cc(%rip), %rcx     # 0x58ff5
callq 0x62f0
movq -0x248(%rbp), %rax
cmpl $0x1000000, 0xc0(%rax)  # imm = 0x1000000
jl 0x41707
movq -0x248(%rbp), %rax
movq 0xb8(%rax), %rdi
movq 0xb8(%rax), %rsi
addq $0x1000000, %rsi        # imm = 0x1000000
movl $0x1000000, %edx        # imm = 0x1000000
callq 0x63b0
movq -0x248(%rbp), %rdi
movl 0xc0(%rdi), %eax
subl $0x1000000, %eax        # imm = 0x1000000
movl %eax, 0xc0(%rdi)
movl 0xc4(%rdi), %eax
subl $0x1000000, %eax        # imm = 0x1000000
movl %eax, 0xc4(%rdi)
callq 0x41d40
testb $0x1, %al
jne 0x4169f
jmp 0x41705
movq -0x248(%rbp), %rdi
callq 0x41d70
movl %eax, %ecx
movq -0x248(%rbp), %rax
addl 0xc4(%rax), %ecx
movl %ecx, 0xc4(%rax)
movq 0xb8(%rax), %rdi
addq $0x1000000, %rdi        # imm = 0x1000000
movq 0xb8(%rax), %rsi
addq $0x2000000, %rsi        # imm = 0x2000000
movl $0x1000000, %edx        # imm = 0x1000000
callq 0x63b0
movq -0x248(%rbp), %rdi
movq 0xb8(%rdi), %rsi
addq $0x2000000, %rsi        # imm = 0x2000000
movl $0x1000000, %edx        # imm = 0x1000000
callq 0x3f920
jmp 0x41707
movq -0x248(%rbp), %rax
movl 0xc0(%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x248(%rbp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0xa, %ecx
movb %al, -0x249(%rbp)
je 0x41753
movq -0x248(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0xc4(%rcx), %eax
setne %al
movb %al, -0x249(%rbp)
movb -0x249(%rbp), %al
testb $0x1, %al
jne 0x4175f
jmp 0x4176a
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x41717
movq -0x248(%rbp), %rcx
movl -0x14(%rbp), %eax
subl 0xc0(%rcx), %eax
addl $0x1, %eax
cmpl $0x1000000, %eax        # imm = 0x1000000
jle 0x41828
leaq -0x228(%rbp), %rdi
callq 0x41e40
movq -0x248(%rbp), %rsi
leaq -0x120(%rbp), %rdi
addq $0xc8, %rsi
callq 0x40600
movq -0x248(%rbp), %rax
leaq -0x20(%rbp), %rdi
movl 0x1c8(%rax), %esi
callq 0x41ec0
jmp 0x417c6
movl $0x210, %edi            # imm = 0x210
callq 0x6250
movq %rax, %rdi
movq %rdi, -0x258(%rbp)
leaq -0x228(%rbp), %rsi
callq 0x41ee0
movq -0x258(%rbp), %rdi
leaq 0x37194(%rip), %rsi     # 0x78988
leaq 0x755(%rip), %rdx       # 0x41f50
callq 0x6760
jmp 0x4191c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x41f50
jmp 0x41910
movq -0x248(%rbp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
jne 0x4185b
movq -0x248(%rbp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rbp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x41880
movq -0x248(%rbp), %rax
movl 0xc4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc4(%rax)
movq 0xb8(%rax), %rax
movslq -0x14(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x248(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0xc0(%rcx), %eax
je 0x418cd
movq -0x248(%rbp), %rax
movq 0xb8(%rax), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xd, %eax
jne 0x418cd
movq -0x248(%rbp), %rax
movq 0xb8(%rax), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x248(%rbp), %rax
movq 0xb8(%rax), %rcx
movslq 0xc0(%rax), %rdx
addq %rdx, %rcx
movq %rcx, -0x240(%rbp)
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, 0xc0(%rax)
movq -0x240(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
movq -0x230(%rbp), %rdi
callq 0x67a0
nopl (%rax)