// File: /workspace/github_cpp_makefile_star2_O1/mateuz[P]MTS-LS1/source/Benchmarks.cpp
// Function: Benchmarks::readOvectorVec()
double** Benchmarks::readOvectorVec()
{
  // read O vector from file in csv format, seperated by s_size groups
  double** d = (double**) malloc(s_size*sizeof(double*));
  stringstream ss;
  ss<< "cdatafiles/" << "F" << ID << "-xopt.txt";
  ifstream file (ss.str());
  string value;
  string line;
  int c = 0;                      // index over 1 to dim
  int i = -1;                      // index over 1 to s_size
  int up = 0;                   // current upper bound for one group
  
  if (file.is_open())
    {
      stringstream iss;
      while ( getline(file, line) )
        {
          if (c==up)             // out (start) of one group
            {
              // printf("=\n");
              i++;
              d[i] =  (double*) malloc(s[i]*sizeof(double));
              up += s[i];
            }
          iss<<line;
          while (getline(iss, value, ','))
            {
              // printf("c=%d\ts=%d\ti=%d\tup=%d\tindex=%d\n",c,s[i],i,up,c-(up-s[i]));
              d[i][c-(up-s[i])] = stod(value);
              // printf("1\n");
              c++;
            }
          iss.clear();
          // printf("2\n");
        }
      file.close();
    }
  else
    {
      cout<<"Cannot open datafiles"<<endl;
    }
  return d;  
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x588, %rsp            # imm = 0x588
movq %rdi, -0x40(%rbp)
movslq 0x3c(%rdi), %rdi
shlq $0x3, %rdi
callq 0x3270
movq %rax, -0x38(%rbp)
leaq -0x3a8(%rbp), %rdi
callq 0x3160
leaq -0x398(%rbp), %rbx
leaq 0x7121(%rip), %rsi      # 0xb0d0
movl $0xb, %edx
movq %rbx, %rdi
callq 0x3230
leaq 0x7119(%rip), %rsi      # 0xb0dc
movl $0x1, %edx
movq %rbx, %rdi
callq 0x3230
movq -0x40(%rbp), %rax
movl 0x8(%rax), %esi
movq %rbx, %rdi
callq 0x3140
leaq 0x70f8(%rip), %rsi      # 0xb0de
movl $0x9, %edx
movq %rax, %rdi
callq 0x3230
leaq -0x390(%rbp), %rsi
leaq -0x220(%rbp), %rdi
callq 0x32b0
leaq -0x5b0(%rbp), %rbx
leaq -0x220(%rbp), %rsi
movq %rbx, %rdi
movl $0x8, %edx
callq 0x32c0
leaq -0x210(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4036
callq 0x31f0
leaq -0x88(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x60(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x538(%rbp), %rdi
callq 0x3090
testb %al, %al
je 0x41e0
leaq -0x220(%rbp), %rdi
callq 0x3160
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
xorl %r15d, %r15d
movl $0x0, -0x2c(%rbp)
movq -0x5b0(%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3200
movsbl %al, %edx
movq %rbx, %rdi
leaq -0x70(%rbp), %rsi
callq 0x3340
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4228
movl -0x2c(%rbp), %r13d
cmpl %r13d, %r15d
jne 0x40fb
movq -0x40(%rbp), %rax
movq 0xf0(%rax), %rax
movslq %r12d, %rbx
incl %r12d
movslq 0x4(%rax,%rbx,4), %r14
movq %r14, %rdi
shlq $0x3, %rdi
callq 0x3270
movq -0x38(%rbp), %rcx
movq %rax, 0x8(%rcx,%rbx,8)
addl %r14d, %r13d
movl %r13d, -0x2c(%rbp)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
leaq -0x210(%rbp), %rdi
callq 0x3230
movl %r12d, -0x44(%rbp)
movslq %r12d, %r13
movl -0x2c(%rbp), %eax
negl %eax
movq %rax, -0x50(%rbp)
leaq -0x220(%rbp), %rdi
leaq -0x98(%rbp), %rsi
movl $0x2c, %edx
callq 0x3340
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x41b4
movq -0x98(%rbp), %r12
callq 0x3050
movq %rax, %rbx
movl (%rax), %r14d
movl $0x0, (%rax)
movq %r12, %rdi
leaq -0x78(%rbp), %rsi
callq 0x3190
cmpq %r12, -0x78(%rbp)
je 0x42be
movl (%rbx), %eax
testl %eax, %eax
je 0x4183
cmpl $0x22, %eax
jne 0x4186
jmp 0x42ca
movl %r14d, (%rbx)
movq -0x40(%rbp), %rax
movq 0xf0(%rax), %rax
movq -0x50(%rbp), %rcx
addl %r15d, %ecx
addl (%rax,%r13,4), %ecx
movq -0x38(%rbp), %rax
movq (%rax,%r13,8), %rax
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
incl %r15d
jmp 0x411f
movq -0x220(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x220(%rbp), %rax
addq %rax, %rdi
xorl %esi, %esi
callq 0x32f0
leaq -0x5b0(%rbp), %rbx
movl -0x44(%rbp), %r12d
jmp 0x4087
movq 0xade9(%rip), %rbx      # 0xefd0
leaq 0x6efa(%rip), %rsi      # 0xb0e8
movl $0x15, %edx
movq %rbx, %rdi
callq 0x3230
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3200
movsbl %al, %esi
movq 0xadb7(%rip), %rdi      # 0xefd0
callq 0x3040
movq %rax, %rdi
callq 0x3150
jmp 0x4253
leaq -0x5b0(%rbp), %rdi
callq 0x3070
movq 0xad7d(%rip), %rsi      # 0xefb8
leaq -0x220(%rbp), %rdi
callq 0x3180
leaq -0x1a0(%rbp), %rdi
callq 0x30c0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x4265
callq 0x31f0
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x427d
callq 0x31f0
leaq -0x5b0(%rbp), %rdi
callq 0x30a0
movq 0xad28(%rip), %rsi      # 0xefb8
leaq -0x3a8(%rbp), %rdi
callq 0x3180
leaq -0x328(%rbp), %rdi
callq 0x30c0
movq -0x38(%rbp), %rax
addq $0x588, %rsp            # imm = 0x588
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6e76(%rip), %rdi      # 0xb13b
callq 0x3130
leaq 0x6e6a(%rip), %rdi      # 0xb13b
callq 0x3280
jmp 0x4302
jmp 0x42f6
movq %rax, %r15
leaq -0x210(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4367
callq 0x31f0
jmp 0x4367
jmp 0x42fb
movq %rax, %r15
jmp 0x4331
movq %rax, %r15
jmp 0x4367
jmp 0x4302
movq %rax, %r15
jmp 0x4312
movq %rax, %r15
cmpl $0x0, (%rbx)
jne 0x4312
movl %r14d, (%rbx)
movq 0xac9f(%rip), %rsi      # 0xefb8
leaq -0x220(%rbp), %rdi
callq 0x3180
leaq -0x1a0(%rbp), %rdi
callq 0x30c0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x4343
callq 0x31f0
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x435b
callq 0x31f0
leaq -0x5b0(%rbp), %rdi
callq 0x30a0
movq 0xac4a(%rip), %rsi      # 0xefb8
leaq -0x3a8(%rbp), %rdi
callq 0x3180
leaq -0x328(%rbp), %rdi
callq 0x30c0
movq %r15, %rdi
callq 0x3320