// File: /workspace/github_cpp_makefile_star2_O3/canzarlab[P]Trajan/src/read_csv.cpp
// Function: CSVReader::getDoubleData(int, int)
std::vector<std::vector<double> > CSVReader::getDoubleData(int from_row, int to_row)
{
    vector<vector<double> > data;
    ifstream inputFile(fileName);
    int l = 0; // 0
    int count =0;
 
    while (inputFile) {
        if (count >= to_row) break;
        l++;
        string s;
        if (!getline(inputFile, s)) break;
        if (s[0] != '#') {
            istringstream ss(s);
            vector<double> record;
            int removefist = 0;
            
            while (ss) {
                string line;
                if (!getline(ss, line, ','))
                {
                    break;
                }
                try {
                    if (removefist >= 0){ // matrix
                        record.push_back(stod(line));
                    }    
                    
                    else
                        removefist++;
                }
                catch (const std::invalid_argument e) {
                    cout << "NaN found in file " << fileName << " line " << l
                         << endl;
                    e.what();
                }
            }
            if (count >= from_row)
                data.push_back(record);
            count ++;
        }
    }
 
    if (!inputFile.eof()) {
        cerr << "Could not read file " << fileName << "\n";
        __throw_invalid_argument("File not found.");
    }
 
    return data;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
movl %ecx, %ebp
movl %edx, 0x1c(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, 0x10(%rsp)
movq $0x0, 0x10(%rdi)
leaq 0x220(%rsp), %r15
movq %r15, %rdi
movq %rsi, 0x58(%rsp)
movl $0x8, %edx
callq 0x3350
leaq 0x48(%rsp), %r14
leaq 0x80(%rsp), %r13
xorl %r12d, %r12d
movq 0x8685(%rip), %rax      # 0x10fc0
addq $0x10, %rax
movq %rax, 0x90(%rsp)
movl $0x0, 0x8(%rsp)
movl %ebp, 0x18(%rsp)
movq 0x220(%rsp), %rcx
movq -0x18(%rcx), %rax
testb $0x5, 0x240(%rsp,%rax)
jne 0x8c83
cmpl %ebp, 0x8(%rsp)
jge 0x8c83
movq %r14, 0x38(%rsp)
movq $0x0, 0x40(%rsp)
movb $0x0, 0x48(%rsp)
movq -0x18(%rcx), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3210
movsbl %al, %edx
movq %r15, %rdi
leaq 0x38(%rsp), %rsi
callq 0x3410
incl %r12d
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x20(%rax,%rcx), %ebx
movq 0x38(%rsp), %rdi
testb $0x5, %bl
jne 0x8c5c
cmpb $0x23, (%rdi)
je 0x8c5c
movl %r12d, 0xc(%rsp)
leaq 0xa0(%rsp), %rbp
movq %rbp, %rdi
leaq 0x38(%rsp), %rsi
movl $0x8, %edx
callq 0x33a0
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq 0xa0(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xc0(%rsp,%rax)
jne 0x8bec
movq %r13, 0x70(%rsp)
movq $0x0, 0x78(%rsp)
movb $0x0, 0x80(%rsp)
movq %rbp, %rdi
leaq 0x70(%rsp), %rsi
movl $0x2c, %edx
callq 0x3410
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x20(%rax,%rcx), %r12d
testb $0x5, %r12b
jne 0x8aec
movq 0x70(%rsp), %rbp
callq 0x3060
movq %rax, %r15
movl (%rax), %r14d
movl $0x0, (%rax)
movq %rbp, %rdi
leaq 0x60(%rsp), %rsi
callq 0x31d0
cmpq %rbp, 0x60(%rsp)
je 0x8b15
movl (%r15), %eax
testl %eax, %eax
je 0x8aab
cmpl $0x22, %eax
leaq 0xa0(%rsp), %rbp
jne 0x8ab6
leaq 0x37e6(%rip), %rdi      # 0xc287
callq 0x32f0
jmp 0x8d01
movl %r14d, (%r15)
leaq 0xa0(%rsp), %rbp
movsd %xmm0, 0x98(%rsp)
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x8ada
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x28(%rsp)
jmp 0x8aec
leaq 0x20(%rsp), %rdi
leaq 0x98(%rsp), %rdx
callq 0xae04
movq 0x70(%rsp), %rdi
cmpq %r13, %rdi
je 0x8b06
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3230
testb $0x5, %r12b
je 0x8a00
jmp 0x8bec
leaq 0x376b(%rip), %rdi      # 0xc287
callq 0x3160
jmp 0x8d01
movq %rax, %rbp
jmp 0x8b37
movq %rax, %rbp
cmpl $0x0, (%r15)
jne 0x8b37
movl %r14d, (%r15)
cmpl $0x1, %edx
jne 0x8d3e
movq %rbp, %rdi
callq 0x3280
leaq 0x60(%rsp), %rdi
movq %rax, %rsi
callq 0x3390
movq 0x90(%rsp), %rax
movq %rax, 0x60(%rsp)
movq %rbp, %rdi
callq 0x30f0
movl $0x12, %edx
movq 0x845a(%rip), %rdi      # 0x10fd0
leaq 0x36cb(%rip), %rsi      # 0xc248
callq 0x3270
movq 0x58(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x843b(%rip), %rdi      # 0x10fd0
callq 0x3270
movq %rax, %r15
movl $0x6, %edx
movq %rax, %rdi
leaq 0x36af(%rip), %rsi      # 0xc25b
callq 0x3270
movq %r15, %rdi
movl 0xc(%rsp), %esi
callq 0x33d0
movq %rax, %rdi
callq 0x3110
leaq 0x60(%rsp), %r14
movq %r14, %rdi
callq 0x3310
movq %r14, %rdi
callq 0x3380
callq 0x3370
leaq 0xa0(%rsp), %rbp
jmp 0x8aec
movl 0x8(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jl 0x8c05
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x8fd4
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
leaq 0x48(%rsp), %r14
movl 0x18(%rsp), %ebp
leaq 0x220(%rsp), %r15
movl 0xc(%rsp), %r12d
je 0x8c32
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x3230
incl 0x8(%rsp)
leaq 0xa0(%rsp), %rdi
movq 0x8383(%rip), %rsi      # 0x10fc8
callq 0x32e0
leaq 0x118(%rsp), %rdi
callq 0x30c0
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x8c6e
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3230
testb $0x5, %bl
je 0x8953
movq 0x220(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x240(%rsp,%rax)
je 0x8cb1
leaq 0x220(%rsp), %rdi
callq 0x3090
movq 0x10(%rsp), %rax
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8338(%rip), %rdi      # 0x10ff0
leaq 0x35a3(%rip), %rsi      # 0xc262
movl $0x14, %edx
callq 0x3270
movq 0x58(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x8314(%rip), %rdi      # 0x10ff0
callq 0x3270
leaq 0x33c7(%rip), %rsi      # 0xc0af
movl $0x1, %edx
movq %rax, %rdi
callq 0x3270
leaq 0x357b(%rip), %rdi      # 0xc277
callq 0x3160
jmp 0x8d3b
movq %rax, %rbp
leaq 0x60(%rsp), %rdi
callq 0x3380
callq 0x3370
jmp 0x8d3e
movq %rax, %rdi
callq 0x66f1
movq %rax, %rbp
jmp 0x8dac
movq %rax, %rbp
jmp 0x8db9
movq %rax, %rbp
jmp 0x8d58
jmp 0x8d36
movq %rax, %rbp
jmp 0x8d90
movq %rax, %rbp
movq 0x70(%rsp), %rdi
cmpq %r13, %rdi
je 0x8d58
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3230
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x8d6f
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x3230
movq 0x8252(%rip), %rsi      # 0x10fc8
leaq 0xa0(%rsp), %rdi
callq 0x32e0
leaq 0x118(%rsp), %rdi
callq 0x30c0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x8dac
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3230
leaq 0x220(%rsp), %rdi
callq 0x3090
movq 0x10(%rsp), %rdi
callq 0x65f4
movq %rbp, %rdi
callq 0x33e0