// File: /workspace/github_cpp_makefile_star2_O1/mateuz[P]MTS-LS1/source/Benchmarks.cpp
// Function: Benchmarks::rotateVectorConform(int, int&)
double* Benchmarks::rotateVectorConform(int i, int &c)
{
  double* z = new double[s[i]];
  // printf("i=%d\tc=%d\tl=%d\tu=%d\n", i, c, c - (i)*overlap, c +s[i] - (i)*overlap);
  
  // copy values into the new vector
  for (int j = c - i*overlap; j < c +s[i] - i*overlap; ++j)
    {
      // cout<<"j-c "<<j-c<<" p "<<Pvector[j]<<endl;
      z[j-(c - i*overlap)] = anotherz[Pvector[j]];
    }
  // cout<<"copy done"<<endl;
  if (s[i]==25)
    {
      anotherz1 = multiply( z, r25, s[i]);
    }
  else if (s[i] == 50)
    {    
      anotherz1 = multiply( z, r50, s[i]);
    }
  else if (s[i] == 100) 
    {
      anotherz1 = multiply( z, r100, s[i]);
    }
  else
    {
      cout<< "size of rotation matrix out of range" <<endl;
    }
  delete []z;
  c = c + s[i];
  return anotherz1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq 0xf0(%rdi), %r12
movslq %esi, %r13
movslq (%r12,%r13,4), %rax
leaq (,%rax,8), %rcx
testq %rax, %rax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x3030
movq %rax, %r15
movslq (%rbx), %rcx
movslq 0x40(%r14), %rsi
imulq %r13, %rsi
movl %ecx, %edx
subl %esi, %edx
movl (%r12,%r13,4), %eax
leal (%rax,%rdx), %edi
cmpl %edi, %edx
jge 0x5818
movq 0x70(%r14), %rdx
shlq $0x2, %rcx
shlq $0x2, %rsi
subq %rsi, %rcx
addq 0x58(%r14), %rcx
xorl %esi, %esi
movslq (%rcx,%rsi,4), %rdi
movsd (%rdx,%rdi,8), %xmm0
movslq %esi, %rdi
movsd %xmm0, (%r15,%rdi,8)
incq %rsi
cmpl %esi, %eax
jne 0x57ff
cmpq $0x19, %rax
je 0x58cd
cmpl $0x32, %eax
je 0x5880
cmpl $0x64, %eax
jne 0x591e
movq 0xe8(%r14), %r12
movl $0x320, %edi            # imm = 0x320
callq 0x3030
movl $0x63, %ecx
movq $0x0, (%rax,%rcx,8)
movq (%r12,%rcx,8), %rdx
xorpd %xmm0, %xmm0
movl $0x63, %esi
movsd (%r15,%rsi,8), %xmm1
mulsd (%rdx,%rsi,8), %xmm1
addsd %xmm1, %xmm0
addq $-0x1, %rsi
jb 0x585b
movsd %xmm0, (%rax,%rcx,8)
subq $0x1, %rcx
jae 0x5846
jmp 0x5918
movq 0xe0(%r14), %r12
movl $0x190, %edi            # imm = 0x190
callq 0x3030
movl $0x31, %ecx
movq $0x0, (%rax,%rcx,8)
movq (%r12,%rcx,8), %rdx
xorpd %xmm0, %xmm0
movl $0x31, %esi
movsd (%r15,%rsi,8), %xmm1
mulsd (%rdx,%rsi,8), %xmm1
addsd %xmm1, %xmm0
addq $-0x1, %rsi
jb 0x58ab
movsd %xmm0, (%rax,%rcx,8)
subq $0x1, %rcx
jae 0x5896
jmp 0x5918
movq 0xd8(%r14), %r12
movl $0xc8, %edi
callq 0x3030
movl $0x18, %ecx
movq $0x0, (%rax,%rcx,8)
movq (%r12,%rcx,8), %rdx
xorpd %xmm0, %xmm0
movl $0x18, %esi
movsd (%r15,%rsi,8), %xmm1
mulsd (%rdx,%rsi,8), %xmm1
addsd %xmm1, %xmm0
addq $-0x1, %rsi
jb 0x58f8
movsd %xmm0, (%rax,%rcx,8)
subq $0x1, %rcx
jae 0x58e3
movq %rax, 0x78(%r14)
jmp 0x5961
movq 0x96ab(%rip), %r12      # 0xefd0
leaq 0x57ea(%rip), %rsi      # 0xb116
movl $0x24, %edx
movq %r12, %rdi
callq 0x3230
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3200
movsbl %al, %esi
movq %r12, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3150
movq %r15, %rdi
callq 0x3260
movq 0xf0(%r14), %rax
movl (%rax,%r13,4), %eax
addl %eax, (%rbx)
movq 0x78(%r14), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop