// File: /workspace/github_cpp_makefile_star2_O3/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 $0x578, %rsp            # imm = 0x578
movl %esi, %r14d
movq %rdi, -0x38(%rbp)
movl %esi, %ebx
leaq (,%rbx,8), %rax
testl %esi, %esi
movq $-0x1, %r12
cmovnsq %rax, %r12
movq %r12, %rdi
callq 0x3030
movq %rax, %r15
testl %r14d, %r14d
jle 0x4c99
xorl %r13d, %r13d
movq %r12, %rdi
callq 0x3030
movq %rax, (%r15,%r13,8)
incq %r13
cmpq %r13, %rbx
jne 0x4c85
movq %r15, -0x30(%rbp)
leaq -0x390(%rbp), %rdi
callq 0x3160
leaq -0x380(%rbp), %r12
leaq 0x6419(%rip), %rsi      # 0xb0d0
movl $0xb, %edx
movq %r12, %rdi
callq 0x3230
leaq 0x6411(%rip), %rsi      # 0xb0dc
movl $0x1, %edx
movq %r12, %rdi
callq 0x3230
movq -0x38(%rbp), %rax
movl 0x8(%rax), %esi
movq %r12, %rdi
callq 0x3140
movq %rax, %r15
leaq 0x6414(%rip), %rsi      # 0xb105
movl $0x2, %edx
movq %rax, %rdi
callq 0x3230
movq %r15, %rdi
movl %r14d, %esi
callq 0x3300
leaq 0x63f0(%rip), %rsi      # 0xb100
movl $0x4, %edx
movq %rax, %rdi
callq 0x3230
leaq -0x378(%rbp), %rsi
leaq -0x208(%rbp), %rdi
callq 0x32b0
movq -0x30(%rbp), %rbx
leaq -0x598(%rbp), %r14
leaq -0x208(%rbp), %rsi
movq %r14, %rdi
movl $0x8, %edx
callq 0x32c0
leaq -0x1f8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4d64
callq 0x31f0
leaq -0x70(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x48(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x520(%rbp), %rdi
callq 0x3090
testb %al, %al
je 0x4e9a
leaq -0x208(%rbp), %rdi
callq 0x3160
xorl %r15d, %r15d
movq -0x598(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3200
movsbl %al, %edx
movq %r14, %rdi
leaq -0x58(%rbp), %rsi
callq 0x3340
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4ee2
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
leaq -0x1f8(%rbp), %rdi
callq 0x3230
xorl %r13d, %r13d
leaq -0x208(%rbp), %rdi
leaq -0x80(%rbp), %rsi
movl $0x2c, %edx
callq 0x3340
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4e6f
movq -0x80(%rbp), %rbx
callq 0x3050
movq %rax, %r14
movl (%rax), %r12d
movl $0x0, (%rax)
movq %rbx, %rdi
leaq -0x60(%rbp), %rsi
callq 0x3190
cmpq %rbx, -0x60(%rbp)
je 0x4f71
movl (%r14), %eax
testl %eax, %eax
je 0x4e58
cmpl $0x22, %eax
movq -0x30(%rbp), %rbx
jne 0x4e5f
jmp 0x4f7d
movl %r12d, (%r14)
movq -0x30(%rbp), %rbx
movq (%rbx,%r15,8), %rax
movsd %xmm0, (%rax,%r13)
addq $0x8, %r13
jmp 0x4df5
movq -0x208(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x208(%rbp), %rax
addq %rax, %rdi
xorl %esi, %esi
callq 0x32f0
leaq -0x598(%rbp), %r14
incq %r15
jmp 0x4da5
movq 0xa12f(%rip), %r14      # 0xefd0
leaq 0x6240(%rip), %rsi      # 0xb0e8
movl $0x15, %edx
movq %r14, %rdi
callq 0x3230
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x3200
movsbl %al, %esi
movq 0xa0fd(%rip), %rdi      # 0xefd0
callq 0x3040
movq %rax, %rdi
callq 0x3150
jmp 0x4f0d
leaq -0x598(%rbp), %rdi
callq 0x3070
movq 0xa0c3(%rip), %rsi      # 0xefb8
leaq -0x208(%rbp), %rdi
callq 0x3180
leaq -0x188(%rbp), %rdi
callq 0x30c0
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x4f1f
callq 0x31f0
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x4f31
callq 0x31f0
leaq -0x598(%rbp), %rdi
callq 0x30a0
movq 0xa074(%rip), %rsi      # 0xefb8
leaq -0x390(%rbp), %rdi
callq 0x3180
leaq -0x310(%rbp), %rdi
callq 0x30c0
movq %rbx, %rax
addq $0x578, %rsp            # imm = 0x578
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x61c3(%rip), %rdi      # 0xb13b
callq 0x3130
leaq 0x61b7(%rip), %rdi      # 0xb13b
callq 0x3280
jmp 0x4fb5
jmp 0x4fa9
movq %rax, %rbx
leaq -0x1f8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5015
callq 0x31f0
jmp 0x5015
jmp 0x4fae
movq %rax, %rbx
jmp 0x4fe5
movq %rax, %rbx
jmp 0x5015
jmp 0x4fb5
movq %rax, %rbx
jmp 0x4fc6
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x4fc6
movl %r12d, (%r14)
movq 0x9feb(%rip), %rsi      # 0xefb8
leaq -0x208(%rbp), %rdi
callq 0x3180
leaq -0x188(%rbp), %rdi
callq 0x30c0
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x4ff7
callq 0x31f0
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x5009
callq 0x31f0
leaq -0x598(%rbp), %rdi
callq 0x30a0
movq 0x9f9c(%rip), %rsi      # 0xefb8
leaq -0x390(%rbp), %rdi
callq 0x3180
leaq -0x310(%rbp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x3320