// File: mateuz[P]MTS-LS1/source/Benchmarks.cpp
// Function: Benchmarks::readOvector()
double* Benchmarks::readOvector()
{
  // read O vector from file in csv format
  double* d = new double[dimension];
  stringstream ss;
  ss<< "cdatafiles/" << "F" << ID << "-xopt.txt";
  ifstream file (ss.str());
  string value;
  string line;
  int c=0;
  
  if (file.is_open())
    {
      stringstream iss;
      while ( getline(file, line) )
        {
          iss<<line;
          while (getline(iss, value, ','))
            {
              d[c++] = stod(value);
            }
          iss.clear();
          // if (c==dimension)
          //   {
          //     break;
          //   }
          // printf("%d\n",c);
        }
      file.close();
    }
  else
    {
      cout<<"Cannot open datafiles"<<endl;
    }
  return d;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x600, %rsp            # imm = 0x600
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x5b0(%rbp)
movslq 0xb8(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x3030
movq %rax, -0x10(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x3120
leaq -0x188(%rbp), %rdi
leaq 0xf295(%rip), %rsi      # 0x130ff
callq 0x31d0
movq %rax, -0x5a8(%rbp)
jmp 0x3e78
movq -0x5a8(%rbp), %rdi
leaq 0xf285(%rip), %rsi      # 0x1310b
callq 0x31d0
movq %rax, -0x5b8(%rbp)
jmp 0x3e94
movq -0x5b8(%rbp), %rdi
movq -0x5b0(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x3250
movq %rax, -0x5c0(%rbp)
jmp 0x3eb3
movq -0x5c0(%rbp), %rdi
leaq 0xf24c(%rip), %rsi      # 0x1310d
callq 0x31d0
jmp 0x3ec8
leaq -0x3d0(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x31c0
jmp 0x3edd
leaq -0x3b0(%rbp), %rdi
leaq -0x3d0(%rbp), %rsi
movl $0x8, %edx
callq 0x32b0
jmp 0x3ef7
leaq -0x3d0(%rbp), %rdi
callq 0x3110
leaq -0x3f0(%rbp), %rdi
callq 0x3260
leaq -0x410(%rbp), %rdi
callq 0x3260
movl $0x0, -0x414(%rbp)
leaq -0x3b0(%rbp), %rdi
callq 0x32a0
movb %al, -0x5c1(%rbp)
jmp 0x3f39
movb -0x5c1(%rbp), %al
testb $0x1, %al
jne 0x3f48
jmp 0x40fb
leaq -0x5a0(%rbp), %rdi
callq 0x3120
jmp 0x3f56
jmp 0x3f58
leaq -0x3b0(%rbp), %rdi
leaq -0x410(%rbp), %rsi
callq 0x3060
movq %rax, -0x5d0(%rbp)
jmp 0x3f74
movq -0x5d0(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3220
movb %al, -0x5d1(%rbp)
jmp 0x3f92
movb -0x5d1(%rbp), %al
testb $0x1, %al
jne 0x3fa1
jmp 0x40df
leaq -0x590(%rbp), %rdi
leaq -0x410(%rbp), %rsi
callq 0x31a0
jmp 0x3fb6
jmp 0x3fb8
leaq -0x5a0(%rbp), %rdi
leaq -0x3f0(%rbp), %rsi
movl $0x2c, %edx
callq 0x3340
movq %rax, -0x5e0(%rbp)
jmp 0x3fd9
movq -0x5e0(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3220
movb %al, -0x5e1(%rbp)
jmp 0x3ff7
movb -0x5e1(%rbp), %al
testb $0x1, %al
jne 0x4006
jmp 0x40be
xorl %eax, %eax
movl %eax, %esi
leaq -0x3f0(%rbp), %rdi
callq 0x7570
movsd %xmm0, -0x5f0(%rbp)
jmp 0x4020
movsd -0x5f0(%rbp), %xmm0
movq -0x10(%rbp), %rax
movl -0x414(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x414(%rbp)
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x3fb8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x419d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0x3d0(%rbp), %rdi
callq 0x3110
jmp 0x419d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x4179
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0x5a0(%rbp), %rdi
callq 0x3140
jmp 0x4179
movq -0x5a0(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x5a0(%rbp,%rax), %rdi
xorl %esi, %esi
callq 0x32f0
jmp 0x40da
jmp 0x3f58
leaq -0x3b0(%rbp), %rdi
callq 0x3070
jmp 0x40ed
leaq -0x5a0(%rbp), %rdi
callq 0x3140
jmp 0x412e
movq 0x15ece(%rip), %rdi     # 0x19fd0
leaq 0xf00e(%rip), %rsi      # 0x13117
callq 0x31d0
movq %rax, -0x5f8(%rbp)
jmp 0x4117
movq -0x5f8(%rbp), %rdi
movq 0x15e93(%rip), %rsi     # 0x19fb8
callq 0x31f0
jmp 0x412c
jmp 0x412e
movq -0x10(%rbp), %rax
movq %rax, -0x600(%rbp)
leaq -0x410(%rbp), %rdi
callq 0x3110
leaq -0x3f0(%rbp), %rdi
callq 0x3110
leaq -0x3b0(%rbp), %rdi
callq 0x3090
leaq -0x198(%rbp), %rdi
callq 0x3140
movq -0x600(%rbp), %rax
addq $0x600, %rsp            # imm = 0x600
popq %rbp
retq
leaq -0x410(%rbp), %rdi
callq 0x3110
leaq -0x3f0(%rbp), %rdi
callq 0x3110
leaq -0x3b0(%rbp), %rdi
callq 0x3090
leaq -0x198(%rbp), %rdi
callq 0x3140
movq -0x1a0(%rbp), %rdi
callq 0x3320
nopw %cs:(%rax,%rax)