// File: /workspace/github_cpp_makefile_star2_O1/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), %r12
xorl %ebx, %ebx
movq 0x7bb6(%rip), %rax      # 0xffc0
addq $0x10, %rax
movq %rax, 0x90(%rsp)
movl $0x0, 0x8(%rsp)
movl %ebp, 0x18(%rsp)
movq 0x220(%rsp), %rax
movq -0x18(%rax), %rcx
testb $0x5, 0x240(%rsp,%rcx)
jne 0x8743
cmpl %ebp, 0x8(%rsp)
jge 0x8743
movq %r14, 0x38(%rsp)
movq $0x0, 0x40(%rsp)
movb $0x0, 0x48(%rsp)
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3210
movsbl %al, %edx
movq %r15, %rdi
leaq 0x38(%rsp), %rsi
callq 0x3410
incl %ebx
movl %ebx, 0xc(%rsp)
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x20(%rax,%rcx), %ebx
testb $0x5, %bl
jne 0x871f
movq 0x38(%rsp), %rax
cmpb $0x23, (%rax)
je 0x871f
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 0x86b9
movq %r12, 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), %r15d
testb $0x5, %r15b
jne 0x85b9
movq 0x70(%rsp), %rbp
callq 0x3060
movq %rax, %r14
movl (%rax), %r13d
movl $0x0, (%rax)
movq %rbp, %rdi
leaq 0x60(%rsp), %rsi
callq 0x31d0
cmpq %rbp, 0x60(%rsp)
je 0x85e2
movl (%r14), %eax
testl %eax, %eax
je 0x8578
cmpl $0x22, %eax
leaq 0xa0(%rsp), %rbp
jne 0x8583
leaq 0x2ce1(%rip), %rdi      # 0xb24f
callq 0x32f0
jmp 0x87cd
movl %r13d, (%r14)
leaq 0xa0(%rsp), %rbp
movsd %xmm0, 0x98(%rsp)
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x85a7
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x28(%rsp)
jmp 0x85b9
leaq 0x20(%rsp), %rdi
leaq 0x98(%rsp), %rdx
callq 0xa8e0
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x85d3
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3230
testb $0x5, %r15b
je 0x84cd
jmp 0x86b9
leaq 0x2c66(%rip), %rdi      # 0xb24f
callq 0x3160
jmp 0x87cd
movq %rax, %rbp
jmp 0x8604
movq %rax, %rbp
cmpl $0x0, (%r14)
jne 0x8604
movl %r13d, (%r14)
cmpl $0x1, %edx
jne 0x880a
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 0x798d(%rip), %rdi      # 0xffd0
leaq 0x2bc6(%rip), %rsi      # 0xb210
callq 0x3270
movq 0x58(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x796e(%rip), %rdi      # 0xffd0
callq 0x3270
movq %rax, %r14
movl $0x6, %edx
movq %rax, %rdi
leaq 0x2baa(%rip), %rsi      # 0xb223
callq 0x3270
movq %r14, %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 0x85b9
movl 0x8(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jl 0x86d2
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x8a9a
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
leaq 0x48(%rsp), %r14
movl 0x18(%rsp), %ebp
leaq 0x220(%rsp), %r15
je 0x86fa
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x3230
incl 0x8(%rsp)
leaq 0xa0(%rsp), %rdi
movq 0x78bb(%rip), %rsi      # 0xffc8
callq 0x32e0
leaq 0x118(%rsp), %rdi
callq 0x30c0
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x8736
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3230
testb $0x5, %bl
movl 0xc(%rsp), %ebx
je 0x8422
movq 0x220(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x240(%rsp,%rax)
je 0x877d
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 0x786c(%rip), %rdi      # 0xfff0
leaq 0x2a9f(%rip), %rsi      # 0xb22a
movl $0x14, %edx
callq 0x3270
movq 0x58(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x7848(%rip), %rdi      # 0xfff0
callq 0x3270
leaq 0x28b3(%rip), %rsi      # 0xb067
movl $0x1, %edx
movq %rax, %rdi
callq 0x3270
leaq 0x2a77(%rip), %rdi      # 0xb23f
callq 0x3160
jmp 0x8807
movq %rax, %rbp
leaq 0x60(%rsp), %rdi
callq 0x3380
callq 0x3370
jmp 0x880a
movq %rax, %rdi
callq 0x651f
movq %rax, %rbp
jmp 0x8878
movq %rax, %rbp
jmp 0x8885
movq %rax, %rbp
jmp 0x8824
jmp 0x8802
movq %rax, %rbp
jmp 0x885c
movq %rax, %rbp
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x8824
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3230
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x883b
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x3230
movq 0x7786(%rip), %rsi      # 0xffc8
leaq 0xa0(%rsp), %rdi
callq 0x32e0
leaq 0x118(%rsp), %rdi
callq 0x30c0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x8878
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3230
leaq 0x220(%rsp), %rdi
callq 0x3090
movq 0x10(%rsp), %rdi
callq 0x6428
movq %rbp, %rdi
callq 0x33e0