// File: /workspace/github_cpp_makefile_star2_O1/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)
movslq %esi, %rbx
leaq (,%rbx,8), %rax
testl %ebx, %ebx
movq $-0x1, %r12
cmovnsq %rax, %r12
movq %r12, %rdi
callq 0x3030
movq %rax, %r15
testl %ebx, %ebx
jle 0x4c92
movl %r14d, %ebx
xorl %r13d, %r13d
movq %r12, %rdi
callq 0x3030
movq %rax, (%r15,%r13,8)
incq %r13
cmpq %r13, %rbx
jne 0x4c7e
movq %r15, -0x30(%rbp)
leaq -0x390(%rbp), %rdi
callq 0x3160
leaq -0x380(%rbp), %r12
leaq 0x6420(%rip), %rsi      # 0xb0d0
movl $0xb, %edx
movq %r12, %rdi
callq 0x3230
leaq 0x6418(%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 0x641b(%rip), %rsi      # 0xb105
movl $0x2, %edx
movq %rax, %rdi
callq 0x3230
movq %r15, %rdi
movl %r14d, %esi
callq 0x3300
leaq 0x63f7(%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 0x4d5d
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 0x4e93
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 0x4edb
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 0x4e68
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 0x4f6a
movl (%r14), %eax
testl %eax, %eax
je 0x4e51
cmpl $0x22, %eax
movq -0x30(%rbp), %rbx
jne 0x4e58
jmp 0x4f76
movl %r12d, (%r14)
movq -0x30(%rbp), %rbx
movq (%rbx,%r15,8), %rax
movsd %xmm0, (%rax,%r13)
addq $0x8, %r13
jmp 0x4dee
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 0x4d9e
movq 0xa136(%rip), %r14      # 0xefd0
leaq 0x6247(%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 0xa104(%rip), %rdi      # 0xefd0
callq 0x3040
movq %rax, %rdi
callq 0x3150
jmp 0x4f06
leaq -0x598(%rbp), %rdi
callq 0x3070
movq 0xa0ca(%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 0x4f18
callq 0x31f0
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x4f2a
callq 0x31f0
leaq -0x598(%rbp), %rdi
callq 0x30a0
movq 0xa07b(%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 0x61ca(%rip), %rdi      # 0xb13b
callq 0x3130
leaq 0x61be(%rip), %rdi      # 0xb13b
callq 0x3280
jmp 0x4fae
jmp 0x4fa2
movq %rax, %rbx
leaq -0x1f8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x500e
callq 0x31f0
jmp 0x500e
jmp 0x4fa7
movq %rax, %rbx
jmp 0x4fde
movq %rax, %rbx
jmp 0x500e
jmp 0x4fae
movq %rax, %rbx
jmp 0x4fbf
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x4fbf
movl %r12d, (%r14)
movq 0x9ff2(%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 0x4ff0
callq 0x31f0
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x5002
callq 0x31f0
leaq -0x598(%rbp), %rdi
callq 0x30a0
movq 0x9fa3(%rip), %rsi      # 0xefb8
leaq -0x390(%rbp), %rdi
callq 0x3180
leaq -0x310(%rbp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x3320
nop