// File: /workspace/github_cpp_makefile_star2_O2/mateuz[P]MTS-LS1/source/Benchmarks.cpp
// Function: Benchmarks::readR(int)
double** Benchmarks::readR(int sub_dim)
{
  double** m;

  m = new double*[sub_dim];
  for (int i = 0; i< sub_dim; i++)
    {
      m[i] = new double[sub_dim];
    }

  stringstream ss;
  ss<< "cdatafiles/" << "F" << ID << "-R"<<sub_dim<<".txt";
  // cout<<ss.str()<<endl;

  ifstream file (ss.str());
  string value;
  string line;
  int i=0;
  int j;

  if (file.is_open())
    {
      stringstream iss;
      while ( getline(file, line) )
        {
          j=0;
          iss<<line;
          while (getline(iss, value, ','))
            {
              // printf("%d,%d\t%f\n", i,j, stod(value));
              m[i][j] = stod(value);
              // printf("done\n");
              j++;
            }
          iss.clear();
          i++;
        }
      file.close();
    }
  else
    {
      cout<<"Cannot open datafiles"<<endl;
    }
  return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x568, %rsp            # imm = 0x568
movl %esi, %r14d
movq %rdi, %r15
movl %esi, %eax
shlq $0x3, %rax
xorl %ebx, %ebx
testl %esi, %esi
pushq $-0x1
popq %r12
cmovnsq %rax, %r12
movl $0x0, %r13d
cmovgl %esi, %r13d
movq %r12, %rdi
callq 0x3030
movq %rax, -0x30(%rbp)
cmpq %rbx, %r13
je 0x472e
movq %r12, %rdi
callq 0x3030
movq -0x30(%rbp), %rcx
movq %rax, (%rcx,%rbx,8)
incq %rbx
jmp 0x4714
leaq -0x380(%rbp), %rdi
callq 0x3140
leaq -0x370(%rbp), %rdi
leaq 0x5988(%rip), %rsi      # 0xa0d0
callq 0x31d0
leaq 0x5988(%rip), %rsi      # 0xa0dc
movq %rax, %rdi
callq 0x31d0
movl 0x8(%r15), %esi
movq %rax, %rdi
callq 0x3130
leaq 0x5996(%rip), %rsi      # 0xa105
movq %rax, %rdi
callq 0x31d0
movq %rax, %rdi
movl %r14d, %esi
callq 0x32b0
leaq 0x5977(%rip), %rsi      # 0xa100
movq %rax, %rdi
callq 0x31d0
leaq -0x368(%rbp), %rsi
leaq -0x1f8(%rbp), %rdi
callq 0x3260
leaq -0x588(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
pushq $0x8
popq %rdx
callq 0x3270
leaq -0x1f8(%rbp), %rdi
callq 0x30e0
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq -0x40(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
xorl %edx, %edx
movb %dl, (%rax)
movb %dl, (%rcx)
leaq -0x510(%rbp), %rdi
callq 0x3090
testb %al, %al
je 0x489e
leaq -0x1f8(%rbp), %r14
movq %r14, %rdi
callq 0x3140
xorl %r13d, %r13d
leaq -0x70(%rbp), %r15
pushq $0x2c
popq %r12
leaq -0x588(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x3060
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x48bb
leaq -0x1e8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x31b0
xorl %ebx, %ebx
movq %r14, %rdi
movq %r15, %rsi
movl %r12d, %edx
callq 0x32f0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4881
movq %r15, %rdi
xorl %esi, %esi
callq 0x5a35
movq -0x30(%rbp), %rax
movq (%rax,%r13,8), %rax
movsd %xmm0, (%rax,%rbx)
addq $0x8, %rbx
jmp 0x4848
movq -0x1f8(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
xorl %esi, %esi
callq 0x32a0
incq %r13
jmp 0x4814
movq 0xa72b(%rip), %rdi      # 0xefd0
leaq 0x583c(%rip), %rsi      # 0xa0e8
callq 0x31d0
movq %rax, %rdi
callq 0x30f0
jmp 0x48d3
leaq -0x588(%rbp), %rdi
callq 0x3070
leaq -0x1f8(%rbp), %rdi
callq 0x3160
leaq -0x50(%rbp), %rdi
callq 0x30e0
leaq -0x70(%rbp), %rdi
callq 0x30e0
leaq -0x588(%rbp), %rdi
callq 0x30a0
leaq -0x380(%rbp), %rdi
callq 0x3160
movq -0x30(%rbp), %rax
addq $0x568, %rsp            # imm = 0x568
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4936
jmp 0x4917
movq %rax, %rbx
jmp 0x4945
movq %rax, %rbx
leaq -0x1f8(%rbp), %rdi
callq 0x30e0
jmp 0x4963
jmp 0x492f
movq %rax, %rbx
jmp 0x4963
jmp 0x4936
movq %rax, %rbx
leaq -0x1f8(%rbp), %rdi
callq 0x3160
leaq -0x50(%rbp), %rdi
callq 0x30e0
leaq -0x70(%rbp), %rdi
callq 0x30e0
leaq -0x588(%rbp), %rdi
callq 0x30a0
leaq -0x380(%rbp), %rdi
callq 0x3160
movq %rbx, %rdi
callq 0x32d0
nop